• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stripe / stripe-java / #16727

09 Jan 2025 09:36PM UTC coverage: 12.34% (-0.04%) from 12.384%
#16727

push

github

web-flow
Update generated code for beta (#1932)

* Update generated code for v1407

* Update generated code for v1408

* Update generated code for v1409

* Update generated code for v1410

* Update generated code for v1411

* Update generated code for v1413

* Update generated code for v1414

* Update generated code for v1415

* Update generated code for v1416

* Update generated code (#1931)

* Update generated code for v1399

* Update generated code for v1402

* Update generated code for v1409

* Update generated code for v1412

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>

* Bump version to 28.2.0

* Added pull request template (#1933)

* Update generated code for v1423

* Update generated code for v1429

* Update generated code for v1430

* Update generated code for v1431

* Update generated code for v1432

* Update generated code for v1433

* Update generated code for v1435

* Update generated code for v1436

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
Co-authored-by: Jesse Rosalia <jar@stripe.com>

30 of 1359 new or added lines in 26 files covered. (2.21%)

45 existing lines in 12 files now uncovered.

18906 of 153209 relevant lines covered (12.34%)

0.12 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

43.23
/src/main/java/com/stripe/model/treasury/OutboundTransfer.java
1
// File generated from our OpenAPI spec
2
package com.stripe.model.treasury;
3

4
import com.google.gson.annotations.SerializedName;
5
import com.stripe.exception.StripeException;
6
import com.stripe.model.Address;
7
import com.stripe.model.ExpandableField;
8
import com.stripe.model.HasId;
9
import com.stripe.model.Mandate;
10
import com.stripe.model.StripeObject;
11
import com.stripe.net.ApiRequest;
12
import com.stripe.net.ApiRequestParams;
13
import com.stripe.net.ApiResource;
14
import com.stripe.net.BaseAddress;
15
import com.stripe.net.RequestOptions;
16
import com.stripe.net.StripeResponseGetter;
17
import com.stripe.param.treasury.OutboundTransferCancelParams;
18
import com.stripe.param.treasury.OutboundTransferCreateParams;
19
import com.stripe.param.treasury.OutboundTransferFailParams;
20
import com.stripe.param.treasury.OutboundTransferListParams;
21
import com.stripe.param.treasury.OutboundTransferPostParams;
22
import com.stripe.param.treasury.OutboundTransferRetrieveParams;
23
import com.stripe.param.treasury.OutboundTransferReturnOutboundTransferParams;
24
import com.stripe.param.treasury.OutboundTransferUpdateParams;
25
import java.util.Map;
26
import lombok.EqualsAndHashCode;
27
import lombok.Getter;
28
import lombok.Setter;
29

30
/**
31
 * Use <a
32
 * href="https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers">OutboundTransfers</a>
33
 * to transfer funds from a <a
34
 * href="https://stripe.com/docs/api#financial_accounts">FinancialAccount</a> to a PaymentMethod
35
 * belonging to the same entity. To send funds to a different party, use <a
36
 * href="https://stripe.com/docs/api#outbound_payments">OutboundPayments</a> instead. You can send
37
 * funds over ACH rails or through a domestic wire transfer to a user's own external bank account.
38
 *
39
 * <p>Simulate OutboundTransfer state changes with the {@code
40
 * /v1/test_helpers/treasury/outbound_transfers} endpoints. These methods can only be called on test
41
 * mode objects.
42
 *
43
 * <p>Related guide: <a
44
 * href="https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers">Moving
45
 * money with Treasury using OutboundTransfer objects</a>
46
 */
47
@Getter
48
@Setter
49
@EqualsAndHashCode(callSuper = false)
50
public class OutboundTransfer extends ApiResource implements HasId {
1✔
51
  /** Amount (in cents) transferred. */
52
  @SerializedName("amount")
53
  Long amount;
54

55
  /** Returns {@code true} if the object can be canceled, and {@code false} otherwise. */
56
  @SerializedName("cancelable")
57
  Boolean cancelable;
58

59
  /** Time at which the object was created. Measured in seconds since the Unix epoch. */
60
  @SerializedName("created")
61
  Long created;
62

63
  /**
64
   * Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>,
65
   * in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
66
   */
67
  @SerializedName("currency")
68
  String currency;
69

70
  /** An arbitrary string attached to the object. Often useful for displaying to users. */
71
  @SerializedName("description")
72
  String description;
73

74
  /** The PaymentMethod used as the payment instrument for an OutboundTransfer. */
75
  @SerializedName("destination_payment_method")
76
  String destinationPaymentMethod;
77

78
  @SerializedName("destination_payment_method_details")
79
  DestinationPaymentMethodDetails destinationPaymentMethodDetails;
80

81
  /** The date when funds are expected to arrive in the destination account. */
82
  @SerializedName("expected_arrival_date")
83
  Long expectedArrivalDate;
84

85
  /** The FinancialAccount that funds were pulled from. */
86
  @SerializedName("financial_account")
87
  String financialAccount;
88

89
  /**
90
   * A <a href="https://stripe.com/docs/treasury/moving-money/regulatory-receipts">hosted
91
   * transaction receipt</a> URL that is provided when money movement is considered regulated under
92
   * Stripe's money transmission licenses.
93
   */
94
  @SerializedName("hosted_regulatory_receipt_url")
95
  String hostedRegulatoryReceiptUrl;
96

97
  /** Unique identifier for the object. */
98
  @Getter(onMethod_ = {@Override})
99
  @SerializedName("id")
100
  String id;
101

102
  /**
103
   * Has the value {@code true} if the object exists in live mode or the value {@code false} if the
104
   * object exists in test mode.
105
   */
106
  @SerializedName("livemode")
107
  Boolean livemode;
108

109
  /**
110
   * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
111
   * to an object. This can be useful for storing additional information about the object in a
112
   * structured format.
113
   */
114
  @SerializedName("metadata")
115
  Map<String, String> metadata;
116

117
  /** Details about the network used for the OutboundTransfer. */
118
  @SerializedName("network_details")
119
  NetworkDetails networkDetails;
120

121
  /**
122
   * String representing the object's type. Objects of the same type share the same value.
123
   *
124
   * <p>Equal to {@code treasury.outbound_transfer}.
125
   */
126
  @SerializedName("object")
127
  String object;
128

129
  /** Details about a returned OutboundTransfer. Only set when the status is {@code returned}. */
130
  @SerializedName("returned_details")
131
  ReturnedDetails returnedDetails;
132

133
  /** Information about the OutboundTransfer to be sent to the recipient account. */
134
  @SerializedName("statement_descriptor")
135
  String statementDescriptor;
136

137
  /**
138
   * Current status of the OutboundTransfer: {@code processing}, {@code failed}, {@code canceled},
139
   * {@code posted}, {@code returned}. An OutboundTransfer is {@code processing} if it has been
140
   * created and is pending. The status changes to {@code posted} once the OutboundTransfer has been
141
   * &quot;confirmed&quot; and funds have left the account, or to {@code failed} or {@code
142
   * canceled}. If an OutboundTransfer fails to arrive at its destination, its status will change to
143
   * {@code returned}.
144
   *
145
   * <p>One of {@code canceled}, {@code failed}, {@code posted}, {@code processing}, or {@code
146
   * returned}.
147
   */
148
  @SerializedName("status")
149
  String status;
150

151
  @SerializedName("status_transitions")
152
  StatusTransitions statusTransitions;
153

154
  /** Details about network-specific tracking information if available. */
155
  @SerializedName("tracking_details")
156
  TrackingDetails trackingDetails;
157

158
  /** The Transaction associated with this object. */
159
  @SerializedName("transaction")
160
  @Getter(lombok.AccessLevel.NONE)
161
  @Setter(lombok.AccessLevel.NONE)
162
  ExpandableField<Transaction> transaction;
163

164
  /** Get ID of expandable {@code transaction} object. */
165
  public String getTransaction() {
166
    return (this.transaction != null) ? this.transaction.getId() : null;
×
167
  }
168

169
  public void setTransaction(String id) {
170
    this.transaction = ApiResource.setExpandableFieldId(id, this.transaction);
×
171
  }
×
172

173
  /** Get expanded {@code transaction}. */
174
  public Transaction getTransactionObject() {
175
    return (this.transaction != null) ? this.transaction.getExpanded() : null;
×
176
  }
177

178
  public void setTransactionObject(Transaction expandableObject) {
179
    this.transaction = new ExpandableField<Transaction>(expandableObject.getId(), expandableObject);
×
180
  }
×
181

182
  /** An OutboundTransfer can be canceled if the funds have not yet been paid out. */
183
  public OutboundTransfer cancel() throws StripeException {
184
    return cancel((Map<String, Object>) null, (RequestOptions) null);
×
185
  }
186

187
  /** An OutboundTransfer can be canceled if the funds have not yet been paid out. */
188
  public OutboundTransfer cancel(RequestOptions options) throws StripeException {
189
    return cancel((Map<String, Object>) null, options);
×
190
  }
191

192
  /** An OutboundTransfer can be canceled if the funds have not yet been paid out. */
193
  public OutboundTransfer cancel(Map<String, Object> params) throws StripeException {
194
    return cancel(params, (RequestOptions) null);
×
195
  }
196

197
  /** An OutboundTransfer can be canceled if the funds have not yet been paid out. */
198
  public OutboundTransfer cancel(Map<String, Object> params, RequestOptions options)
199
      throws StripeException {
200
    String path =
×
201
        String.format(
×
202
            "/v1/treasury/outbound_transfers/%s/cancel", ApiResource.urlEncodeId(this.getId()));
×
203
    ApiRequest request =
×
204
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
205
    return getResponseGetter().request(request, OutboundTransfer.class);
×
206
  }
207

208
  /** An OutboundTransfer can be canceled if the funds have not yet been paid out. */
209
  public OutboundTransfer cancel(OutboundTransferCancelParams params) throws StripeException {
210
    return cancel(params, (RequestOptions) null);
1✔
211
  }
212

213
  /** An OutboundTransfer can be canceled if the funds have not yet been paid out. */
214
  public OutboundTransfer cancel(OutboundTransferCancelParams params, RequestOptions options)
215
      throws StripeException {
216
    String path =
1✔
217
        String.format(
1✔
218
            "/v1/treasury/outbound_transfers/%s/cancel", ApiResource.urlEncodeId(this.getId()));
1✔
219
    ApiResource.checkNullTypedParams(path, params);
1✔
220
    ApiRequest request =
1✔
221
        new ApiRequest(
222
            BaseAddress.API,
223
            ApiResource.RequestMethod.POST,
224
            path,
225
            ApiRequestParams.paramsToMap(params),
1✔
226
            options);
227
    return getResponseGetter().request(request, OutboundTransfer.class);
1✔
228
  }
229

230
  /** Creates an OutboundTransfer. */
231
  public static OutboundTransfer create(Map<String, Object> params) throws StripeException {
232
    return create(params, (RequestOptions) null);
×
233
  }
234

235
  /** Creates an OutboundTransfer. */
236
  public static OutboundTransfer create(Map<String, Object> params, RequestOptions options)
237
      throws StripeException {
238
    String path = "/v1/treasury/outbound_transfers";
×
239
    ApiRequest request =
×
240
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
241
    return getGlobalResponseGetter().request(request, OutboundTransfer.class);
×
242
  }
243

244
  /** Creates an OutboundTransfer. */
245
  public static OutboundTransfer create(OutboundTransferCreateParams params)
246
      throws StripeException {
247
    return create(params, (RequestOptions) null);
1✔
248
  }
249

250
  /** Creates an OutboundTransfer. */
251
  public static OutboundTransfer create(OutboundTransferCreateParams params, RequestOptions options)
252
      throws StripeException {
253
    String path = "/v1/treasury/outbound_transfers";
1✔
254
    ApiResource.checkNullTypedParams(path, params);
1✔
255
    ApiRequest request =
1✔
256
        new ApiRequest(
257
            BaseAddress.API,
258
            ApiResource.RequestMethod.POST,
259
            path,
260
            ApiRequestParams.paramsToMap(params),
1✔
261
            options);
262
    return getGlobalResponseGetter().request(request, OutboundTransfer.class);
1✔
263
  }
264

265
  /** Returns a list of OutboundTransfers sent from the specified FinancialAccount. */
266
  public static OutboundTransferCollection list(Map<String, Object> params) throws StripeException {
267
    return list(params, (RequestOptions) null);
×
268
  }
269

270
  /** Returns a list of OutboundTransfers sent from the specified FinancialAccount. */
271
  public static OutboundTransferCollection list(Map<String, Object> params, RequestOptions options)
272
      throws StripeException {
273
    String path = "/v1/treasury/outbound_transfers";
×
274
    ApiRequest request =
×
275
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
276
    return getGlobalResponseGetter().request(request, OutboundTransferCollection.class);
×
277
  }
278

279
  /** Returns a list of OutboundTransfers sent from the specified FinancialAccount. */
280
  public static OutboundTransferCollection list(OutboundTransferListParams params)
281
      throws StripeException {
282
    return list(params, (RequestOptions) null);
1✔
283
  }
284

285
  /** Returns a list of OutboundTransfers sent from the specified FinancialAccount. */
286
  public static OutboundTransferCollection list(
287
      OutboundTransferListParams params, RequestOptions options) throws StripeException {
288
    String path = "/v1/treasury/outbound_transfers";
1✔
289
    ApiResource.checkNullTypedParams(path, params);
1✔
290
    ApiRequest request =
1✔
291
        new ApiRequest(
292
            BaseAddress.API,
293
            ApiResource.RequestMethod.GET,
294
            path,
295
            ApiRequestParams.paramsToMap(params),
1✔
296
            options);
297
    return getGlobalResponseGetter().request(request, OutboundTransferCollection.class);
1✔
298
  }
299

300
  /**
301
   * Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID
302
   * from either the OutboundTransfer creation request or OutboundTransfer list.
303
   */
304
  public static OutboundTransfer retrieve(String outboundTransfer) throws StripeException {
305
    return retrieve(outboundTransfer, (Map<String, Object>) null, (RequestOptions) null);
1✔
306
  }
307

308
  /**
309
   * Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID
310
   * from either the OutboundTransfer creation request or OutboundTransfer list.
311
   */
312
  public static OutboundTransfer retrieve(String outboundTransfer, RequestOptions options)
313
      throws StripeException {
314
    return retrieve(outboundTransfer, (Map<String, Object>) null, options);
×
315
  }
316

317
  /**
318
   * Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID
319
   * from either the OutboundTransfer creation request or OutboundTransfer list.
320
   */
321
  public static OutboundTransfer retrieve(
322
      String outboundTransfer, Map<String, Object> params, RequestOptions options)
323
      throws StripeException {
324
    String path =
1✔
325
        String.format(
1✔
326
            "/v1/treasury/outbound_transfers/%s", ApiResource.urlEncodeId(outboundTransfer));
1✔
327
    ApiRequest request =
1✔
328
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
329
    return getGlobalResponseGetter().request(request, OutboundTransfer.class);
1✔
330
  }
331

332
  /**
333
   * Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID
334
   * from either the OutboundTransfer creation request or OutboundTransfer list.
335
   */
336
  public static OutboundTransfer retrieve(
337
      String outboundTransfer, OutboundTransferRetrieveParams params, RequestOptions options)
338
      throws StripeException {
339
    String path =
×
340
        String.format(
×
341
            "/v1/treasury/outbound_transfers/%s", ApiResource.urlEncodeId(outboundTransfer));
×
342
    ApiResource.checkNullTypedParams(path, params);
×
343
    ApiRequest request =
×
344
        new ApiRequest(
345
            BaseAddress.API,
346
            ApiResource.RequestMethod.GET,
347
            path,
348
            ApiRequestParams.paramsToMap(params),
×
349
            options);
350
    return getGlobalResponseGetter().request(request, OutboundTransfer.class);
×
351
  }
352

353
  /**
354
   * For more details about DestinationPaymentMethodDetails, please refer to the <a
355
   * href="https://docs.stripe.com/api">API Reference.</a>
356
   */
357
  @Getter
358
  @Setter
359
  @EqualsAndHashCode(callSuper = false)
360
  public static class DestinationPaymentMethodDetails extends StripeObject {
1✔
361
    @SerializedName("billing_details")
362
    BillingDetails billingDetails;
363

364
    @SerializedName("financial_account")
365
    FinancialAccount financialAccount;
366

367
    /**
368
     * The type of the payment method used in the OutboundTransfer.
369
     *
370
     * <p>One of {@code financial_account}, or {@code us_bank_account}.
371
     */
372
    @SerializedName("type")
373
    String type;
374

375
    @SerializedName("us_bank_account")
376
    UsBankAccount usBankAccount;
377

378
    /**
379
     * For more details about BillingDetails, please refer to the <a
380
     * href="https://docs.stripe.com/api">API Reference.</a>
381
     */
382
    @Getter
383
    @Setter
384
    @EqualsAndHashCode(callSuper = false)
385
    public static class BillingDetails extends StripeObject {
1✔
386
      @SerializedName("address")
387
      Address address;
388

389
      /** Email address. */
390
      @SerializedName("email")
391
      String email;
392

393
      /** Full name. */
394
      @SerializedName("name")
395
      String name;
396
    }
397

398
    /**
399
     * For more details about FinancialAccount, please refer to the <a
400
     * href="https://docs.stripe.com/api">API Reference.</a>
401
     */
402
    @Getter
403
    @Setter
404
    @EqualsAndHashCode(callSuper = false)
NEW
405
    public static class FinancialAccount extends StripeObject implements HasId {
×
406
      /** Token of the FinancialAccount. */
407
      @Getter(onMethod_ = {@Override})
408
      @SerializedName("id")
409
      String id;
410

411
      /**
412
       * The rails used to send funds.
413
       *
414
       * <p>Equal to {@code stripe}.
415
       */
416
      @SerializedName("network")
417
      String network;
418
    }
419

420
    /**
421
     * For more details about UsBankAccount, please refer to the <a
422
     * href="https://docs.stripe.com/api">API Reference.</a>
423
     */
424
    @Getter
425
    @Setter
426
    @EqualsAndHashCode(callSuper = false)
427
    public static class UsBankAccount extends StripeObject {
1✔
428
      /**
429
       * Account holder type: individual or company.
430
       *
431
       * <p>One of {@code company}, or {@code individual}.
432
       */
433
      @SerializedName("account_holder_type")
434
      String accountHolderType;
435

436
      /**
437
       * Account type: checkings or savings. Defaults to checking if omitted.
438
       *
439
       * <p>One of {@code checking}, or {@code savings}.
440
       */
441
      @SerializedName("account_type")
442
      String accountType;
443

444
      /** Name of the bank associated with the bank account. */
445
      @SerializedName("bank_name")
446
      String bankName;
447

448
      /**
449
       * Uniquely identifies this particular bank account. You can use this attribute to check
450
       * whether two bank accounts are the same.
451
       */
452
      @SerializedName("fingerprint")
453
      String fingerprint;
454

455
      /** Last four digits of the bank account number. */
456
      @SerializedName("last4")
457
      String last4;
458

459
      /** ID of the mandate used to make this payment. */
460
      @SerializedName("mandate")
461
      @Getter(lombok.AccessLevel.NONE)
462
      @Setter(lombok.AccessLevel.NONE)
463
      ExpandableField<Mandate> mandate;
464

465
      /**
466
       * The network rails used. See the <a
467
       * href="https://stripe.com/docs/treasury/money-movement/timelines">docs</a> to learn more
468
       * about money movement timelines for each network type.
469
       *
470
       * <p>One of {@code ach}, or {@code us_domestic_wire}.
471
       */
472
      @SerializedName("network")
473
      String network;
474

475
      /** Routing number of the bank account. */
476
      @SerializedName("routing_number")
477
      String routingNumber;
478

479
      /** Get ID of expandable {@code mandate} object. */
480
      public String getMandate() {
481
        return (this.mandate != null) ? this.mandate.getId() : null;
×
482
      }
483

484
      public void setMandate(String id) {
485
        this.mandate = ApiResource.setExpandableFieldId(id, this.mandate);
×
486
      }
×
487

488
      /** Get expanded {@code mandate}. */
489
      public Mandate getMandateObject() {
490
        return (this.mandate != null) ? this.mandate.getExpanded() : null;
×
491
      }
492

493
      public void setMandateObject(Mandate expandableObject) {
494
        this.mandate = new ExpandableField<Mandate>(expandableObject.getId(), expandableObject);
×
495
      }
×
496
    }
497
  }
498

499
  /**
500
   * For more details about NetworkDetails, please refer to the <a
501
   * href="https://docs.stripe.com/api">API Reference.</a>
502
   */
503
  @Getter
504
  @Setter
505
  @EqualsAndHashCode(callSuper = false)
506
  public static class NetworkDetails extends StripeObject {
×
507
    /** Details about an ACH transaction. */
508
    @SerializedName("ach")
509
    Ach ach;
510

511
    /**
512
     * The type of flow that originated the OutboundTransfer.
513
     *
514
     * <p>Equal to {@code ach}.
515
     */
516
    @SerializedName("type")
517
    String type;
518

519
    /**
520
     * For more details about Ach, please refer to the <a href="https://docs.stripe.com/api">API
521
     * Reference.</a>
522
     */
523
    @Getter
524
    @Setter
525
    @EqualsAndHashCode(callSuper = false)
526
    public static class Ach extends StripeObject {
×
527
      /** ACH Addenda record. */
528
      @SerializedName("addenda")
529
      String addenda;
530
    }
531
  }
532

533
  /**
534
   * For more details about ReturnedDetails, please refer to the <a
535
   * href="https://docs.stripe.com/api">API Reference.</a>
536
   */
537
  @Getter
538
  @Setter
539
  @EqualsAndHashCode(callSuper = false)
540
  public static class ReturnedDetails extends StripeObject {
×
541
    /**
542
     * Reason for the return.
543
     *
544
     * <p>One of {@code account_closed}, {@code account_frozen}, {@code bank_account_restricted},
545
     * {@code bank_ownership_changed}, {@code declined}, {@code incorrect_account_holder_name},
546
     * {@code invalid_account_number}, {@code invalid_currency}, {@code no_account}, or {@code
547
     * other}.
548
     */
549
    @SerializedName("code")
550
    String code;
551

552
    /** The Transaction associated with this object. */
553
    @SerializedName("transaction")
554
    @Getter(lombok.AccessLevel.NONE)
555
    @Setter(lombok.AccessLevel.NONE)
556
    ExpandableField<Transaction> transaction;
557

558
    /** Get ID of expandable {@code transaction} object. */
559
    public String getTransaction() {
560
      return (this.transaction != null) ? this.transaction.getId() : null;
×
561
    }
562

563
    public void setTransaction(String id) {
564
      this.transaction = ApiResource.setExpandableFieldId(id, this.transaction);
×
565
    }
×
566

567
    /** Get expanded {@code transaction}. */
568
    public Transaction getTransactionObject() {
569
      return (this.transaction != null) ? this.transaction.getExpanded() : null;
×
570
    }
571

572
    public void setTransactionObject(Transaction expandableObject) {
573
      this.transaction =
×
574
          new ExpandableField<Transaction>(expandableObject.getId(), expandableObject);
×
575
    }
×
576
  }
577

578
  /**
579
   * For more details about StatusTransitions, please refer to the <a
580
   * href="https://docs.stripe.com/api">API Reference.</a>
581
   */
582
  @Getter
583
  @Setter
584
  @EqualsAndHashCode(callSuper = false)
585
  public static class StatusTransitions extends StripeObject {
1✔
586
    /** Timestamp describing when an OutboundTransfer changed status to {@code canceled}. */
587
    @SerializedName("canceled_at")
588
    Long canceledAt;
589

590
    /** Timestamp describing when an OutboundTransfer changed status to {@code failed}. */
591
    @SerializedName("failed_at")
592
    Long failedAt;
593

594
    /** Timestamp describing when an OutboundTransfer changed status to {@code posted}. */
595
    @SerializedName("posted_at")
596
    Long postedAt;
597

598
    /** Timestamp describing when an OutboundTransfer changed status to {@code returned}. */
599
    @SerializedName("returned_at")
600
    Long returnedAt;
601
  }
602

603
  /**
604
   * For more details about TrackingDetails, please refer to the <a
605
   * href="https://docs.stripe.com/api">API Reference.</a>
606
   */
607
  @Getter
608
  @Setter
609
  @EqualsAndHashCode(callSuper = false)
610
  public static class TrackingDetails extends StripeObject {
×
611
    @SerializedName("ach")
612
    Ach ach;
613

614
    /**
615
     * The US bank account network used to send funds.
616
     *
617
     * <p>One of {@code ach}, or {@code us_domestic_wire}.
618
     */
619
    @SerializedName("type")
620
    String type;
621

622
    @SerializedName("us_domestic_wire")
623
    UsDomesticWire usDomesticWire;
624

625
    /**
626
     * For more details about Ach, please refer to the <a href="https://docs.stripe.com/api">API
627
     * Reference.</a>
628
     */
629
    @Getter
630
    @Setter
631
    @EqualsAndHashCode(callSuper = false)
632
    public static class Ach extends StripeObject {
×
633
      /** ACH trace ID of the OutboundTransfer for transfers sent over the {@code ach} network. */
634
      @SerializedName("trace_id")
635
      String traceId;
636
    }
637

638
    /**
639
     * For more details about UsDomesticWire, please refer to the <a
640
     * href="https://docs.stripe.com/api">API Reference.</a>
641
     */
642
    @Getter
643
    @Setter
644
    @EqualsAndHashCode(callSuper = false)
645
    public static class UsDomesticWire extends StripeObject {
×
646
      /**
647
       * CHIPS System Sequence Number (SSN) of the OutboundTransfer for transfers sent over the
648
       * {@code us_domestic_wire} network.
649
       */
650
      @SerializedName("chips")
651
      String chips;
652

653
      /**
654
       * IMAD of the OutboundTransfer for transfers sent over the {@code us_domestic_wire} network.
655
       */
656
      @SerializedName("imad")
657
      String imad;
658

659
      /**
660
       * OMAD of the OutboundTransfer for transfers sent over the {@code us_domestic_wire} network.
661
       */
662
      @SerializedName("omad")
663
      String omad;
664
    }
665
  }
666

667
  public TestHelpers getTestHelpers() {
668
    return new TestHelpers(this);
1✔
669
  }
670

671
  public static class TestHelpers {
672
    private final OutboundTransfer resource;
673

674
    private TestHelpers(OutboundTransfer resource) {
1✔
675
      this.resource = resource;
1✔
676
    }
1✔
677

678
    /**
679
     * Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must
680
     * not be cancelable, and cannot be in the {@code canceled} or {@code failed} states.
681
     */
682
    public OutboundTransfer update(Map<String, Object> params) throws StripeException {
683
      return update(params, (RequestOptions) null);
×
684
    }
685

686
    /**
687
     * Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must
688
     * not be cancelable, and cannot be in the {@code canceled} or {@code failed} states.
689
     */
690
    public OutboundTransfer update(Map<String, Object> params, RequestOptions options)
691
        throws StripeException {
692
      String path =
×
693
          String.format(
×
694
              "/v1/test_helpers/treasury/outbound_transfers/%s",
695
              ApiResource.urlEncodeId(this.resource.getId()));
×
696
      ApiRequest request =
×
697
          new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
698
      return resource.getResponseGetter().request(request, OutboundTransfer.class);
×
699
    }
700

701
    /**
702
     * Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must
703
     * not be cancelable, and cannot be in the {@code canceled} or {@code failed} states.
704
     */
705
    public OutboundTransfer update(OutboundTransferUpdateParams params) throws StripeException {
706
      return update(params, (RequestOptions) null);
×
707
    }
708

709
    /**
710
     * Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must
711
     * not be cancelable, and cannot be in the {@code canceled} or {@code failed} states.
712
     */
713
    public OutboundTransfer update(OutboundTransferUpdateParams params, RequestOptions options)
714
        throws StripeException {
715
      String path =
×
716
          String.format(
×
717
              "/v1/test_helpers/treasury/outbound_transfers/%s",
718
              ApiResource.urlEncodeId(this.resource.getId()));
×
719
      ApiResource.checkNullTypedParams(path, params);
×
720
      ApiRequest request =
×
721
          new ApiRequest(
722
              BaseAddress.API,
723
              ApiResource.RequestMethod.POST,
724
              path,
725
              ApiRequestParams.paramsToMap(params),
×
726
              options);
727
      return resource.getResponseGetter().request(request, OutboundTransfer.class);
×
728
    }
729

730
    /**
731
     * Transitions a test mode created OutboundTransfer to the {@code failed} status. The
732
     * OutboundTransfer must already be in the {@code processing} state.
733
     */
734
    public OutboundTransfer fail() throws StripeException {
735
      return fail((Map<String, Object>) null, (RequestOptions) null);
×
736
    }
737

738
    /**
739
     * Transitions a test mode created OutboundTransfer to the {@code failed} status. The
740
     * OutboundTransfer must already be in the {@code processing} state.
741
     */
742
    public OutboundTransfer fail(RequestOptions options) throws StripeException {
743
      return fail((Map<String, Object>) null, options);
×
744
    }
745

746
    /**
747
     * Transitions a test mode created OutboundTransfer to the {@code failed} status. The
748
     * OutboundTransfer must already be in the {@code processing} state.
749
     */
750
    public OutboundTransfer fail(Map<String, Object> params) throws StripeException {
751
      return fail(params, (RequestOptions) null);
×
752
    }
753

754
    /**
755
     * Transitions a test mode created OutboundTransfer to the {@code failed} status. The
756
     * OutboundTransfer must already be in the {@code processing} state.
757
     */
758
    public OutboundTransfer fail(Map<String, Object> params, RequestOptions options)
759
        throws StripeException {
760
      String path =
×
761
          String.format(
×
762
              "/v1/test_helpers/treasury/outbound_transfers/%s/fail",
763
              ApiResource.urlEncodeId(this.resource.getId()));
×
764
      ApiRequest request =
×
765
          new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
766
      return resource.getResponseGetter().request(request, OutboundTransfer.class);
×
767
    }
768

769
    /**
770
     * Transitions a test mode created OutboundTransfer to the {@code failed} status. The
771
     * OutboundTransfer must already be in the {@code processing} state.
772
     */
773
    public OutboundTransfer fail(OutboundTransferFailParams params) throws StripeException {
774
      return fail(params, (RequestOptions) null);
1✔
775
    }
776

777
    /**
778
     * Transitions a test mode created OutboundTransfer to the {@code failed} status. The
779
     * OutboundTransfer must already be in the {@code processing} state.
780
     */
781
    public OutboundTransfer fail(OutboundTransferFailParams params, RequestOptions options)
782
        throws StripeException {
783
      String path =
1✔
784
          String.format(
1✔
785
              "/v1/test_helpers/treasury/outbound_transfers/%s/fail",
786
              ApiResource.urlEncodeId(this.resource.getId()));
1✔
787
      ApiResource.checkNullTypedParams(path, params);
1✔
788
      ApiRequest request =
1✔
789
          new ApiRequest(
790
              BaseAddress.API,
791
              ApiResource.RequestMethod.POST,
792
              path,
793
              ApiRequestParams.paramsToMap(params),
1✔
794
              options);
795
      return resource.getResponseGetter().request(request, OutboundTransfer.class);
1✔
796
    }
797

798
    /**
799
     * Transitions a test mode created OutboundTransfer to the {@code posted} status. The
800
     * OutboundTransfer must already be in the {@code processing} state.
801
     */
802
    public OutboundTransfer post() throws StripeException {
803
      return post((Map<String, Object>) null, (RequestOptions) null);
×
804
    }
805

806
    /**
807
     * Transitions a test mode created OutboundTransfer to the {@code posted} status. The
808
     * OutboundTransfer must already be in the {@code processing} state.
809
     */
810
    public OutboundTransfer post(RequestOptions options) throws StripeException {
811
      return post((Map<String, Object>) null, options);
×
812
    }
813

814
    /**
815
     * Transitions a test mode created OutboundTransfer to the {@code posted} status. The
816
     * OutboundTransfer must already be in the {@code processing} state.
817
     */
818
    public OutboundTransfer post(Map<String, Object> params) throws StripeException {
819
      return post(params, (RequestOptions) null);
×
820
    }
821

822
    /**
823
     * Transitions a test mode created OutboundTransfer to the {@code posted} status. The
824
     * OutboundTransfer must already be in the {@code processing} state.
825
     */
826
    public OutboundTransfer post(Map<String, Object> params, RequestOptions options)
827
        throws StripeException {
828
      String path =
×
829
          String.format(
×
830
              "/v1/test_helpers/treasury/outbound_transfers/%s/post",
831
              ApiResource.urlEncodeId(this.resource.getId()));
×
832
      ApiRequest request =
×
833
          new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
834
      return resource.getResponseGetter().request(request, OutboundTransfer.class);
×
835
    }
836

837
    /**
838
     * Transitions a test mode created OutboundTransfer to the {@code posted} status. The
839
     * OutboundTransfer must already be in the {@code processing} state.
840
     */
841
    public OutboundTransfer post(OutboundTransferPostParams params) throws StripeException {
842
      return post(params, (RequestOptions) null);
1✔
843
    }
844

845
    /**
846
     * Transitions a test mode created OutboundTransfer to the {@code posted} status. The
847
     * OutboundTransfer must already be in the {@code processing} state.
848
     */
849
    public OutboundTransfer post(OutboundTransferPostParams params, RequestOptions options)
850
        throws StripeException {
851
      String path =
1✔
852
          String.format(
1✔
853
              "/v1/test_helpers/treasury/outbound_transfers/%s/post",
854
              ApiResource.urlEncodeId(this.resource.getId()));
1✔
855
      ApiResource.checkNullTypedParams(path, params);
1✔
856
      ApiRequest request =
1✔
857
          new ApiRequest(
858
              BaseAddress.API,
859
              ApiResource.RequestMethod.POST,
860
              path,
861
              ApiRequestParams.paramsToMap(params),
1✔
862
              options);
863
      return resource.getResponseGetter().request(request, OutboundTransfer.class);
1✔
864
    }
865

866
    /**
867
     * Transitions a test mode created OutboundTransfer to the {@code returned} status. The
868
     * OutboundTransfer must already be in the {@code processing} state.
869
     */
870
    public OutboundTransfer returnOutboundTransfer() throws StripeException {
871
      return returnOutboundTransfer((Map<String, Object>) null, (RequestOptions) null);
×
872
    }
873

874
    /**
875
     * Transitions a test mode created OutboundTransfer to the {@code returned} status. The
876
     * OutboundTransfer must already be in the {@code processing} state.
877
     */
878
    public OutboundTransfer returnOutboundTransfer(RequestOptions options) throws StripeException {
879
      return returnOutboundTransfer((Map<String, Object>) null, options);
×
880
    }
881

882
    /**
883
     * Transitions a test mode created OutboundTransfer to the {@code returned} status. The
884
     * OutboundTransfer must already be in the {@code processing} state.
885
     */
886
    public OutboundTransfer returnOutboundTransfer(Map<String, Object> params)
887
        throws StripeException {
888
      return returnOutboundTransfer(params, (RequestOptions) null);
×
889
    }
890

891
    /**
892
     * Transitions a test mode created OutboundTransfer to the {@code returned} status. The
893
     * OutboundTransfer must already be in the {@code processing} state.
894
     */
895
    public OutboundTransfer returnOutboundTransfer(
896
        Map<String, Object> params, RequestOptions options) throws StripeException {
897
      String path =
×
898
          String.format(
×
899
              "/v1/test_helpers/treasury/outbound_transfers/%s/return",
900
              ApiResource.urlEncodeId(this.resource.getId()));
×
901
      ApiRequest request =
×
902
          new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
903
      return resource.getResponseGetter().request(request, OutboundTransfer.class);
×
904
    }
905

906
    /**
907
     * Transitions a test mode created OutboundTransfer to the {@code returned} status. The
908
     * OutboundTransfer must already be in the {@code processing} state.
909
     */
910
    public OutboundTransfer returnOutboundTransfer(
911
        OutboundTransferReturnOutboundTransferParams params) throws StripeException {
912
      return returnOutboundTransfer(params, (RequestOptions) null);
1✔
913
    }
914

915
    /**
916
     * Transitions a test mode created OutboundTransfer to the {@code returned} status. The
917
     * OutboundTransfer must already be in the {@code processing} state.
918
     */
919
    public OutboundTransfer returnOutboundTransfer(
920
        OutboundTransferReturnOutboundTransferParams params, RequestOptions options)
921
        throws StripeException {
922
      String path =
1✔
923
          String.format(
1✔
924
              "/v1/test_helpers/treasury/outbound_transfers/%s/return",
925
              ApiResource.urlEncodeId(this.resource.getId()));
1✔
926
      ApiResource.checkNullTypedParams(path, params);
1✔
927
      ApiRequest request =
1✔
928
          new ApiRequest(
929
              BaseAddress.API,
930
              ApiResource.RequestMethod.POST,
931
              path,
932
              ApiRequestParams.paramsToMap(params),
1✔
933
              options);
934
      return resource.getResponseGetter().request(request, OutboundTransfer.class);
1✔
935
    }
936
  }
937

938
  @Override
939
  public void setResponseGetter(StripeResponseGetter responseGetter) {
940
    super.setResponseGetter(responseGetter);
1✔
941
    trySetResponseGetter(destinationPaymentMethodDetails, responseGetter);
1✔
942
    trySetResponseGetter(networkDetails, responseGetter);
1✔
943
    trySetResponseGetter(returnedDetails, responseGetter);
1✔
944
    trySetResponseGetter(statusTransitions, responseGetter);
1✔
945
    trySetResponseGetter(trackingDetails, responseGetter);
1✔
946
    trySetResponseGetter(transaction, responseGetter);
1✔
947
  }
1✔
948
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc