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

stripe / stripe-java / #15928

09 May 2024 07:43PM UTC coverage: 13.164% (-0.08%) from 13.243%
#15928

push

github

web-flow
Merge pull request #1800 from stripe/latest-codegen-beta

Update generated code for beta

12 of 790 new or added lines in 28 files covered. (1.52%)

6939 existing lines in 21 files now uncovered.

18370 of 139550 relevant lines covered (13.16%)

0.13 hits per line

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

43.51
/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.ApiMode;
12
import com.stripe.net.ApiRequest;
13
import com.stripe.net.ApiRequestParams;
14
import com.stripe.net.ApiResource;
15
import com.stripe.net.BaseAddress;
16
import com.stripe.net.RequestOptions;
17
import com.stripe.net.StripeResponseGetter;
18
import com.stripe.param.treasury.OutboundTransferCancelParams;
19
import com.stripe.param.treasury.OutboundTransferCreateParams;
20
import com.stripe.param.treasury.OutboundTransferFailParams;
21
import com.stripe.param.treasury.OutboundTransferListParams;
22
import com.stripe.param.treasury.OutboundTransferPostParams;
23
import com.stripe.param.treasury.OutboundTransferRetrieveParams;
24
import com.stripe.param.treasury.OutboundTransferReturnOutboundTransferParams;
25
import com.stripe.param.treasury.OutboundTransferUpdateParams;
26
import java.util.Map;
27
import lombok.EqualsAndHashCode;
28
import lombok.Getter;
29
import lombok.Setter;
30

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

50
  /** Returns {@code true} if the object can be canceled, and {@code false} otherwise. */
51
  @SerializedName("cancelable")
52
  Boolean cancelable;
53

54
  /** Time at which the object was created. Measured in seconds since the Unix epoch. */
55
  @SerializedName("created")
56
  Long created;
57

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

65
  /** An arbitrary string attached to the object. Often useful for displaying to users. */
66
  @SerializedName("description")
67
  String description;
68

69
  /** The PaymentMethod used as the payment instrument for an OutboundTransfer. */
70
  @SerializedName("destination_payment_method")
71
  String destinationPaymentMethod;
72

73
  @SerializedName("destination_payment_method_details")
74
  DestinationPaymentMethodDetails destinationPaymentMethodDetails;
75

76
  /** The date when funds are expected to arrive in the destination account. */
77
  @SerializedName("expected_arrival_date")
78
  Long expectedArrivalDate;
79

80
  /** The FinancialAccount that funds were pulled from. */
81
  @SerializedName("financial_account")
82
  String financialAccount;
83

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

92
  /** Unique identifier for the object. */
93
  @Getter(onMethod_ = {@Override})
94
  @SerializedName("id")
95
  String id;
96

97
  /**
98
   * Has the value {@code true} if the object exists in live mode or the value {@code false} if the
99
   * object exists in test mode.
100
   */
101
  @SerializedName("livemode")
102
  Boolean livemode;
103

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

112
  /** Details about the network used for the OutboundTransfer. */
113
  @SerializedName("network_details")
114
  NetworkDetails networkDetails;
115

116
  /**
117
   * String representing the object's type. Objects of the same type share the same value.
118
   *
119
   * <p>Equal to {@code treasury.outbound_transfer}.
120
   */
121
  @SerializedName("object")
122
  String object;
123

124
  /** Details about a returned OutboundTransfer. Only set when the status is {@code returned}. */
125
  @SerializedName("returned_details")
126
  ReturnedDetails returnedDetails;
127

128
  /** Information about the OutboundTransfer to be sent to the recipient account. */
129
  @SerializedName("statement_descriptor")
130
  String statementDescriptor;
131

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

146
  @SerializedName("status_transitions")
147
  StatusTransitions statusTransitions;
148

149
  /** Details about network-specific tracking information if available. */
150
  @SerializedName("tracking_details")
151
  TrackingDetails trackingDetails;
152

153
  /** The Transaction associated with this object. */
154
  @SerializedName("transaction")
155
  @Getter(lombok.AccessLevel.NONE)
156
  @Setter(lombok.AccessLevel.NONE)
157
  ExpandableField<Transaction> transaction;
158

159
  /** Get ID of expandable {@code transaction} object. */
160
  public String getTransaction() {
161
    return (this.transaction != null) ? this.transaction.getId() : null;
×
162
  }
163

164
  public void setTransaction(String id) {
165
    this.transaction = ApiResource.setExpandableFieldId(id, this.transaction);
×
166
  }
×
167

168
  /** Get expanded {@code transaction}. */
169
  public Transaction getTransactionObject() {
170
    return (this.transaction != null) ? this.transaction.getExpanded() : null;
×
171
  }
172

173
  public void setTransactionObject(Transaction expandableObject) {
174
    this.transaction = new ExpandableField<Transaction>(expandableObject.getId(), expandableObject);
×
175
  }
×
176

177
  /** An OutboundTransfer can be canceled if the funds have not yet been paid out. */
178
  public OutboundTransfer cancel() throws StripeException {
179
    return cancel((Map<String, Object>) null, (RequestOptions) null);
×
180
  }
181

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

187
  /** An OutboundTransfer can be canceled if the funds have not yet been paid out. */
188
  public OutboundTransfer cancel(Map<String, Object> params) throws StripeException {
189
    return cancel(params, (RequestOptions) null);
×
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, RequestOptions options)
194
      throws StripeException {
195
    String path =
×
196
        String.format(
×
197
            "/v1/treasury/outbound_transfers/%s/cancel", ApiResource.urlEncodeId(this.getId()));
×
198
    ApiRequest request =
×
199
        new ApiRequest(
200
            BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options, ApiMode.V1);
201
    return getResponseGetter().request(request, OutboundTransfer.class);
×
202
  }
203

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

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

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

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

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

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

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

269
  /** Returns a list of OutboundTransfers sent from the specified FinancialAccount. */
270
  public static OutboundTransferCollection list(Map<String, Object> params, RequestOptions options)
271
      throws StripeException {
272
    String path = "/v1/treasury/outbound_transfers";
×
273
    ApiRequest request =
×
274
        new ApiRequest(
275
            BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options, ApiMode.V1);
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
            ApiMode.V1);
298
    return getGlobalResponseGetter().request(request, OutboundTransferCollection.class);
1✔
299
  }
300

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

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

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

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

356
  @Getter
357
  @Setter
358
  @EqualsAndHashCode(callSuper = false)
359
  public static class DestinationPaymentMethodDetails extends StripeObject {
1✔
360
    @SerializedName("billing_details")
361
    BillingDetails billingDetails;
362

363
    /**
364
     * The type of the payment method used in the OutboundTransfer.
365
     *
366
     * <p>Equal to {@code us_bank_account}.
367
     */
368
    @SerializedName("type")
369
    String type;
370

371
    @SerializedName("us_bank_account")
372
    UsBankAccount usBankAccount;
373

374
    @Getter
375
    @Setter
376
    @EqualsAndHashCode(callSuper = false)
377
    public static class BillingDetails extends StripeObject {
1✔
378
      @SerializedName("address")
379
      Address address;
380

381
      /** Email address. */
382
      @SerializedName("email")
383
      String email;
384

385
      /** Full name. */
386
      @SerializedName("name")
387
      String name;
388
    }
389

390
    @Getter
391
    @Setter
392
    @EqualsAndHashCode(callSuper = false)
393
    public static class UsBankAccount extends StripeObject {
1✔
394
      /**
395
       * Account holder type: individual or company.
396
       *
397
       * <p>One of {@code company}, or {@code individual}.
398
       */
399
      @SerializedName("account_holder_type")
400
      String accountHolderType;
401

402
      /**
403
       * Account type: checkings or savings. Defaults to checking if omitted.
404
       *
405
       * <p>One of {@code checking}, or {@code savings}.
406
       */
407
      @SerializedName("account_type")
408
      String accountType;
409

410
      /** Name of the bank associated with the bank account. */
411
      @SerializedName("bank_name")
412
      String bankName;
413

414
      /**
415
       * Uniquely identifies this particular bank account. You can use this attribute to check
416
       * whether two bank accounts are the same.
417
       */
418
      @SerializedName("fingerprint")
419
      String fingerprint;
420

421
      /** Last four digits of the bank account number. */
422
      @SerializedName("last4")
423
      String last4;
424

425
      /** ID of the mandate used to make this payment. */
426
      @SerializedName("mandate")
427
      @Getter(lombok.AccessLevel.NONE)
428
      @Setter(lombok.AccessLevel.NONE)
429
      ExpandableField<Mandate> mandate;
430

431
      /**
432
       * The network rails used. See the <a
433
       * href="https://stripe.com/docs/treasury/money-movement/timelines">docs</a> to learn more
434
       * about money movement timelines for each network type.
435
       *
436
       * <p>One of {@code ach}, or {@code us_domestic_wire}.
437
       */
438
      @SerializedName("network")
439
      String network;
440

441
      /** Routing number of the bank account. */
442
      @SerializedName("routing_number")
443
      String routingNumber;
444

445
      /** Get ID of expandable {@code mandate} object. */
446
      public String getMandate() {
447
        return (this.mandate != null) ? this.mandate.getId() : null;
×
448
      }
449

450
      public void setMandate(String id) {
451
        this.mandate = ApiResource.setExpandableFieldId(id, this.mandate);
×
452
      }
×
453

454
      /** Get expanded {@code mandate}. */
455
      public Mandate getMandateObject() {
456
        return (this.mandate != null) ? this.mandate.getExpanded() : null;
×
457
      }
458

459
      public void setMandateObject(Mandate expandableObject) {
460
        this.mandate = new ExpandableField<Mandate>(expandableObject.getId(), expandableObject);
×
461
      }
×
462
    }
463
  }
464

465
  @Getter
466
  @Setter
467
  @EqualsAndHashCode(callSuper = false)
468
  public static class NetworkDetails extends StripeObject {
×
469
    /** Details about an ACH transaction. */
470
    @SerializedName("ach")
471
    Ach ach;
472

473
    /**
474
     * The type of flow that originated the OutboundTransfer.
475
     *
476
     * <p>Equal to {@code ach}.
477
     */
478
    @SerializedName("type")
479
    String type;
480

481
    @Getter
482
    @Setter
483
    @EqualsAndHashCode(callSuper = false)
484
    public static class Ach extends StripeObject {
×
485
      /** ACH Addenda record. */
486
      @SerializedName("addenda")
487
      String addenda;
488
    }
489
  }
490

491
  @Getter
492
  @Setter
493
  @EqualsAndHashCode(callSuper = false)
494
  public static class ReturnedDetails extends StripeObject {
×
495
    /**
496
     * Reason for the return.
497
     *
498
     * <p>One of {@code account_closed}, {@code account_frozen}, {@code bank_account_restricted},
499
     * {@code bank_ownership_changed}, {@code declined}, {@code incorrect_account_holder_name},
500
     * {@code invalid_account_number}, {@code invalid_currency}, {@code no_account}, or {@code
501
     * other}.
502
     */
503
    @SerializedName("code")
504
    String code;
505

506
    /** The Transaction associated with this object. */
507
    @SerializedName("transaction")
508
    @Getter(lombok.AccessLevel.NONE)
509
    @Setter(lombok.AccessLevel.NONE)
510
    ExpandableField<Transaction> transaction;
511

512
    /** Get ID of expandable {@code transaction} object. */
513
    public String getTransaction() {
514
      return (this.transaction != null) ? this.transaction.getId() : null;
×
515
    }
516

517
    public void setTransaction(String id) {
518
      this.transaction = ApiResource.setExpandableFieldId(id, this.transaction);
×
519
    }
×
520

521
    /** Get expanded {@code transaction}. */
522
    public Transaction getTransactionObject() {
523
      return (this.transaction != null) ? this.transaction.getExpanded() : null;
×
524
    }
525

526
    public void setTransactionObject(Transaction expandableObject) {
527
      this.transaction =
×
528
          new ExpandableField<Transaction>(expandableObject.getId(), expandableObject);
×
529
    }
×
530
  }
531

532
  @Getter
533
  @Setter
534
  @EqualsAndHashCode(callSuper = false)
535
  public static class StatusTransitions extends StripeObject {
1✔
536
    /** Timestamp describing when an OutboundTransfer changed status to {@code canceled}. */
537
    @SerializedName("canceled_at")
538
    Long canceledAt;
539

540
    /** Timestamp describing when an OutboundTransfer changed status to {@code failed}. */
541
    @SerializedName("failed_at")
542
    Long failedAt;
543

544
    /** Timestamp describing when an OutboundTransfer changed status to {@code posted}. */
545
    @SerializedName("posted_at")
546
    Long postedAt;
547

548
    /** Timestamp describing when an OutboundTransfer changed status to {@code returned}. */
549
    @SerializedName("returned_at")
550
    Long returnedAt;
551
  }
552

553
  @Getter
554
  @Setter
555
  @EqualsAndHashCode(callSuper = false)
NEW
556
  public static class TrackingDetails extends StripeObject {
×
557
    @SerializedName("ach")
558
    Ach ach;
559

560
    /**
561
     * The US bank account network used to send funds.
562
     *
563
     * <p>One of {@code ach}, or {@code us_domestic_wire}.
564
     */
565
    @SerializedName("type")
566
    String type;
567

568
    @SerializedName("us_domestic_wire")
569
    UsDomesticWire usDomesticWire;
570

571
    @Getter
572
    @Setter
573
    @EqualsAndHashCode(callSuper = false)
NEW
574
    public static class Ach extends StripeObject {
×
575
      /** ACH trace ID of the OutboundTransfer for transfers sent over the {@code ach} network. */
576
      @SerializedName("trace_id")
577
      String traceId;
578
    }
579

580
    @Getter
581
    @Setter
582
    @EqualsAndHashCode(callSuper = false)
NEW
583
    public static class UsDomesticWire extends StripeObject {
×
584
      /**
585
       * IMAD of the OutboundTransfer for transfers sent over the {@code us_domestic_wire} network.
586
       */
587
      @SerializedName("imad")
588
      String imad;
589

590
      /**
591
       * OMAD of the OutboundTransfer for transfers sent over the {@code us_domestic_wire} network.
592
       */
593
      @SerializedName("omad")
594
      String omad;
595
    }
596
  }
597

598
  public TestHelpers getTestHelpers() {
599
    return new TestHelpers(this);
1✔
600
  }
601

602
  public static class TestHelpers {
603
    private final OutboundTransfer resource;
604

605
    private TestHelpers(OutboundTransfer resource) {
1✔
606
      this.resource = resource;
1✔
607
    }
1✔
608

609
    /**
610
     * Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must
611
     * not be cancelable, and cannot be in the {@code canceled} or {@code failed} states.
612
     */
613
    public OutboundTransfer update(Map<String, Object> params) throws StripeException {
NEW
614
      return update(params, (RequestOptions) null);
×
615
    }
616

617
    /**
618
     * Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must
619
     * not be cancelable, and cannot be in the {@code canceled} or {@code failed} states.
620
     */
621
    public OutboundTransfer update(Map<String, Object> params, RequestOptions options)
622
        throws StripeException {
NEW
623
      String path =
×
NEW
624
          String.format(
×
625
              "/v1/test_helpers/treasury/outbound_transfers/%s",
NEW
626
              ApiResource.urlEncodeId(this.resource.getId()));
×
NEW
627
      ApiRequest request =
×
628
          new ApiRequest(
629
              BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options, ApiMode.V1);
NEW
630
      return resource.getResponseGetter().request(request, OutboundTransfer.class);
×
631
    }
632

633
    /**
634
     * Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must
635
     * not be cancelable, and cannot be in the {@code canceled} or {@code failed} states.
636
     */
637
    public OutboundTransfer update(OutboundTransferUpdateParams params) throws StripeException {
NEW
638
      return update(params, (RequestOptions) null);
×
639
    }
640

641
    /**
642
     * Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must
643
     * not be cancelable, and cannot be in the {@code canceled} or {@code failed} states.
644
     */
645
    public OutboundTransfer update(OutboundTransferUpdateParams params, RequestOptions options)
646
        throws StripeException {
NEW
647
      String path =
×
NEW
648
          String.format(
×
649
              "/v1/test_helpers/treasury/outbound_transfers/%s",
NEW
650
              ApiResource.urlEncodeId(this.resource.getId()));
×
NEW
651
      ApiResource.checkNullTypedParams(path, params);
×
NEW
652
      ApiRequest request =
×
653
          new ApiRequest(
654
              BaseAddress.API,
655
              ApiResource.RequestMethod.POST,
656
              path,
NEW
657
              ApiRequestParams.paramsToMap(params),
×
658
              options,
659
              ApiMode.V1);
NEW
660
      return resource.getResponseGetter().request(request, OutboundTransfer.class);
×
661
    }
662

663
    /**
664
     * Transitions a test mode created OutboundTransfer to the {@code failed} status. The
665
     * OutboundTransfer must already be in the {@code processing} state.
666
     */
667
    public OutboundTransfer fail() throws StripeException {
668
      return fail((Map<String, Object>) null, (RequestOptions) null);
×
669
    }
670

671
    /**
672
     * Transitions a test mode created OutboundTransfer to the {@code failed} status. The
673
     * OutboundTransfer must already be in the {@code processing} state.
674
     */
675
    public OutboundTransfer fail(RequestOptions options) throws StripeException {
676
      return fail((Map<String, Object>) null, options);
×
677
    }
678

679
    /**
680
     * Transitions a test mode created OutboundTransfer to the {@code failed} status. The
681
     * OutboundTransfer must already be in the {@code processing} state.
682
     */
683
    public OutboundTransfer fail(Map<String, Object> params) throws StripeException {
684
      return fail(params, (RequestOptions) null);
×
685
    }
686

687
    /**
688
     * Transitions a test mode created OutboundTransfer to the {@code failed} status. The
689
     * OutboundTransfer must already be in the {@code processing} state.
690
     */
691
    public OutboundTransfer fail(Map<String, Object> params, RequestOptions options)
692
        throws StripeException {
693
      String path =
×
694
          String.format(
×
695
              "/v1/test_helpers/treasury/outbound_transfers/%s/fail",
696
              ApiResource.urlEncodeId(this.resource.getId()));
×
697
      ApiRequest request =
×
698
          new ApiRequest(
699
              BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options, ApiMode.V1);
700
      return resource.getResponseGetter().request(request, OutboundTransfer.class);
×
701
    }
702

703
    /**
704
     * Transitions a test mode created OutboundTransfer to the {@code failed} status. The
705
     * OutboundTransfer must already be in the {@code processing} state.
706
     */
707
    public OutboundTransfer fail(OutboundTransferFailParams params) throws StripeException {
708
      return fail(params, (RequestOptions) null);
1✔
709
    }
710

711
    /**
712
     * Transitions a test mode created OutboundTransfer to the {@code failed} status. The
713
     * OutboundTransfer must already be in the {@code processing} state.
714
     */
715
    public OutboundTransfer fail(OutboundTransferFailParams params, RequestOptions options)
716
        throws StripeException {
717
      String path =
1✔
718
          String.format(
1✔
719
              "/v1/test_helpers/treasury/outbound_transfers/%s/fail",
720
              ApiResource.urlEncodeId(this.resource.getId()));
1✔
721
      ApiResource.checkNullTypedParams(path, params);
1✔
722
      ApiRequest request =
1✔
723
          new ApiRequest(
724
              BaseAddress.API,
725
              ApiResource.RequestMethod.POST,
726
              path,
727
              ApiRequestParams.paramsToMap(params),
1✔
728
              options,
729
              ApiMode.V1);
730
      return resource.getResponseGetter().request(request, OutboundTransfer.class);
1✔
731
    }
732

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

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

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

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

773
    /**
774
     * Transitions a test mode created OutboundTransfer to the {@code posted} status. The
775
     * OutboundTransfer must already be in the {@code processing} state.
776
     */
777
    public OutboundTransfer post(OutboundTransferPostParams params) throws StripeException {
778
      return post(params, (RequestOptions) null);
1✔
779
    }
780

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

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

811
    /**
812
     * Transitions a test mode created OutboundTransfer to the {@code returned} status. The
813
     * OutboundTransfer must already be in the {@code processing} state.
814
     */
815
    public OutboundTransfer returnOutboundTransfer(RequestOptions options) throws StripeException {
816
      return returnOutboundTransfer((Map<String, Object>) null, options);
×
817
    }
818

819
    /**
820
     * Transitions a test mode created OutboundTransfer to the {@code returned} status. The
821
     * OutboundTransfer must already be in the {@code processing} state.
822
     */
823
    public OutboundTransfer returnOutboundTransfer(Map<String, Object> params)
824
        throws StripeException {
825
      return returnOutboundTransfer(params, (RequestOptions) null);
×
826
    }
827

828
    /**
829
     * Transitions a test mode created OutboundTransfer to the {@code returned} status. The
830
     * OutboundTransfer must already be in the {@code processing} state.
831
     */
832
    public OutboundTransfer returnOutboundTransfer(
833
        Map<String, Object> params, RequestOptions options) throws StripeException {
834
      String path =
×
835
          String.format(
×
836
              "/v1/test_helpers/treasury/outbound_transfers/%s/return",
837
              ApiResource.urlEncodeId(this.resource.getId()));
×
838
      ApiRequest request =
×
839
          new ApiRequest(
840
              BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options, ApiMode.V1);
841
      return resource.getResponseGetter().request(request, OutboundTransfer.class);
×
842
    }
843

844
    /**
845
     * Transitions a test mode created OutboundTransfer to the {@code returned} status. The
846
     * OutboundTransfer must already be in the {@code processing} state.
847
     */
848
    public OutboundTransfer returnOutboundTransfer(
849
        OutboundTransferReturnOutboundTransferParams params) throws StripeException {
850
      return returnOutboundTransfer(params, (RequestOptions) null);
1✔
851
    }
852

853
    /**
854
     * Transitions a test mode created OutboundTransfer to the {@code returned} status. The
855
     * OutboundTransfer must already be in the {@code processing} state.
856
     */
857
    public OutboundTransfer returnOutboundTransfer(
858
        OutboundTransferReturnOutboundTransferParams params, RequestOptions options)
859
        throws StripeException {
860
      String path =
1✔
861
          String.format(
1✔
862
              "/v1/test_helpers/treasury/outbound_transfers/%s/return",
863
              ApiResource.urlEncodeId(this.resource.getId()));
1✔
864
      ApiResource.checkNullTypedParams(path, params);
1✔
865
      ApiRequest request =
1✔
866
          new ApiRequest(
867
              BaseAddress.API,
868
              ApiResource.RequestMethod.POST,
869
              path,
870
              ApiRequestParams.paramsToMap(params),
1✔
871
              options,
872
              ApiMode.V1);
873
      return resource.getResponseGetter().request(request, OutboundTransfer.class);
1✔
874
    }
875
  }
876

877
  @Override
878
  public void setResponseGetter(StripeResponseGetter responseGetter) {
879
    super.setResponseGetter(responseGetter);
1✔
880
    trySetResponseGetter(destinationPaymentMethodDetails, responseGetter);
1✔
881
    trySetResponseGetter(networkDetails, responseGetter);
1✔
882
    trySetResponseGetter(returnedDetails, responseGetter);
1✔
883
    trySetResponseGetter(statusTransitions, responseGetter);
1✔
884
    trySetResponseGetter(trackingDetails, responseGetter);
1✔
885
    trySetResponseGetter(transaction, responseGetter);
1✔
886
  }
1✔
887
}
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