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

stripe / stripe-java / #16365

29 Aug 2024 06:39AM UTC coverage: 16.372% (-0.008%) from 16.38%
#16365

Pull #1855

github

web-flow
Merge f5eb6ef4b into a6080c2d9
Pull Request #1855: No need for APIMode to be passed around from individual API methods

16 of 86 new or added lines in 6 files covered. (18.6%)

513 existing lines in 170 files now uncovered.

18149 of 110857 relevant lines covered (16.37%)

0.16 hits per line

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

52.42
/src/main/java/com/stripe/model/treasury/InboundTransfer.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.InboundTransferCancelParams;
18
import com.stripe.param.treasury.InboundTransferCreateParams;
19
import com.stripe.param.treasury.InboundTransferFailParams;
20
import com.stripe.param.treasury.InboundTransferListParams;
21
import com.stripe.param.treasury.InboundTransferRetrieveParams;
22
import com.stripe.param.treasury.InboundTransferReturnInboundTransferParams;
23
import com.stripe.param.treasury.InboundTransferSucceedParams;
24
import java.util.Map;
25
import lombok.EqualsAndHashCode;
26
import lombok.Getter;
27
import lombok.Setter;
28

29
/**
30
 * Use <a
31
 * href="https://stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers">InboundTransfers</a>
32
 * to add funds to your <a
33
 * href="https://stripe.com/docs/api#financial_accounts">FinancialAccount</a> via a PaymentMethod
34
 * that is owned by you. The funds will be transferred via an ACH debit.
35
 */
36
@Getter
37
@Setter
38
@EqualsAndHashCode(callSuper = false)
39
public class InboundTransfer extends ApiResource implements HasId {
1✔
40
  /** Amount (in cents) transferred. */
41
  @SerializedName("amount")
42
  Long amount;
43

44
  /** Returns {@code true} if the InboundTransfer is able to be canceled. */
45
  @SerializedName("cancelable")
46
  Boolean cancelable;
47

48
  /** Time at which the object was created. Measured in seconds since the Unix epoch. */
49
  @SerializedName("created")
50
  Long created;
51

52
  /**
53
   * Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>,
54
   * in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
55
   */
56
  @SerializedName("currency")
57
  String currency;
58

59
  /** An arbitrary string attached to the object. Often useful for displaying to users. */
60
  @SerializedName("description")
61
  String description;
62

63
  /** Details about this InboundTransfer's failure. Only set when status is {@code failed}. */
64
  @SerializedName("failure_details")
65
  FailureDetails failureDetails;
66

67
  /** The FinancialAccount that received the funds. */
68
  @SerializedName("financial_account")
69
  String financialAccount;
70

71
  /**
72
   * A <a href="https://stripe.com/docs/treasury/moving-money/regulatory-receipts">hosted
73
   * transaction receipt</a> URL that is provided when money movement is considered regulated under
74
   * Stripe's money transmission licenses.
75
   */
76
  @SerializedName("hosted_regulatory_receipt_url")
77
  String hostedRegulatoryReceiptUrl;
78

79
  /** Unique identifier for the object. */
80
  @Getter(onMethod_ = {@Override})
81
  @SerializedName("id")
82
  String id;
83

84
  @SerializedName("linked_flows")
85
  LinkedFlows linkedFlows;
86

87
  /**
88
   * Has the value {@code true} if the object exists in live mode or the value {@code false} if the
89
   * object exists in test mode.
90
   */
91
  @SerializedName("livemode")
92
  Boolean livemode;
93

94
  /**
95
   * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
96
   * to an object. This can be useful for storing additional information about the object in a
97
   * structured format.
98
   */
99
  @SerializedName("metadata")
100
  Map<String, String> metadata;
101

102
  /**
103
   * String representing the object's type. Objects of the same type share the same value.
104
   *
105
   * <p>Equal to {@code treasury.inbound_transfer}.
106
   */
107
  @SerializedName("object")
108
  String object;
109

110
  /** The origin payment method to be debited for an InboundTransfer. */
111
  @SerializedName("origin_payment_method")
112
  String originPaymentMethod;
113

114
  /** Details about the PaymentMethod for an InboundTransfer. */
115
  @SerializedName("origin_payment_method_details")
116
  OriginPaymentMethodDetails originPaymentMethodDetails;
117

118
  /**
119
   * Returns {@code true} if the funds for an InboundTransfer were returned after the
120
   * InboundTransfer went to the {@code succeeded} state.
121
   */
122
  @SerializedName("returned")
123
  Boolean returned;
124

125
  /**
126
   * Statement descriptor shown when funds are debited from the source. Not all payment networks
127
   * support {@code statement_descriptor}.
128
   */
129
  @SerializedName("statement_descriptor")
130
  String statementDescriptor;
131

132
  /**
133
   * Status of the InboundTransfer: {@code processing}, {@code succeeded}, {@code failed}, and
134
   * {@code canceled}. An InboundTransfer is {@code processing} if it is created and pending. The
135
   * status changes to {@code succeeded} once the funds have been &quot;confirmed&quot; and a {@code
136
   * transaction} is created and posted. The status changes to {@code failed} if the transfer fails.
137
   *
138
   * <p>One of {@code canceled}, {@code failed}, {@code processing}, or {@code succeeded}.
139
   */
140
  @SerializedName("status")
141
  String status;
142

143
  @SerializedName("status_transitions")
144
  StatusTransitions statusTransitions;
145

146
  /** The Transaction associated with this object. */
147
  @SerializedName("transaction")
148
  @Getter(lombok.AccessLevel.NONE)
149
  @Setter(lombok.AccessLevel.NONE)
150
  ExpandableField<Transaction> transaction;
151

152
  /** Get ID of expandable {@code transaction} object. */
153
  public String getTransaction() {
154
    return (this.transaction != null) ? this.transaction.getId() : null;
×
155
  }
156

157
  public void setTransaction(String id) {
158
    this.transaction = ApiResource.setExpandableFieldId(id, this.transaction);
×
159
  }
×
160

161
  /** Get expanded {@code transaction}. */
162
  public Transaction getTransactionObject() {
163
    return (this.transaction != null) ? this.transaction.getExpanded() : null;
×
164
  }
165

166
  public void setTransactionObject(Transaction expandableObject) {
167
    this.transaction = new ExpandableField<Transaction>(expandableObject.getId(), expandableObject);
×
168
  }
×
169

170
  /** Cancels an InboundTransfer. */
171
  public InboundTransfer cancel() throws StripeException {
172
    return cancel((Map<String, Object>) null, (RequestOptions) null);
×
173
  }
174

175
  /** Cancels an InboundTransfer. */
176
  public InboundTransfer cancel(RequestOptions options) throws StripeException {
177
    return cancel((Map<String, Object>) null, options);
×
178
  }
179

180
  /** Cancels an InboundTransfer. */
181
  public InboundTransfer cancel(Map<String, Object> params) throws StripeException {
182
    return cancel(params, (RequestOptions) null);
×
183
  }
184

185
  /** Cancels an InboundTransfer. */
186
  public InboundTransfer cancel(Map<String, Object> params, RequestOptions options)
187
      throws StripeException {
188
    String path =
×
189
        String.format(
×
190
            "/v1/treasury/inbound_transfers/%s/cancel", ApiResource.urlEncodeId(this.getId()));
×
191
    ApiRequest request =
×
192
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
UNCOV
193
    return getResponseGetter().request(request, InboundTransfer.class);
×
194
  }
195

196
  /** Cancels an InboundTransfer. */
197
  public InboundTransfer cancel(InboundTransferCancelParams params) throws StripeException {
198
    return cancel(params, (RequestOptions) null);
1✔
199
  }
200

201
  /** Cancels an InboundTransfer. */
202
  public InboundTransfer cancel(InboundTransferCancelParams params, RequestOptions options)
203
      throws StripeException {
204
    String path =
1✔
205
        String.format(
1✔
206
            "/v1/treasury/inbound_transfers/%s/cancel", ApiResource.urlEncodeId(this.getId()));
1✔
207
    ApiResource.checkNullTypedParams(path, params);
1✔
208
    ApiRequest request =
1✔
209
        new ApiRequest(
210
            BaseAddress.API,
211
            ApiResource.RequestMethod.POST,
212
            path,
213
            ApiRequestParams.paramsToMap(params),
1✔
214
            options);
215
    return getResponseGetter().request(request, InboundTransfer.class);
1✔
216
  }
217

218
  /** Creates an InboundTransfer. */
219
  public static InboundTransfer create(Map<String, Object> params) throws StripeException {
220
    return create(params, (RequestOptions) null);
×
221
  }
222

223
  /** Creates an InboundTransfer. */
224
  public static InboundTransfer create(Map<String, Object> params, RequestOptions options)
225
      throws StripeException {
226
    String path = "/v1/treasury/inbound_transfers";
×
227
    ApiRequest request =
×
228
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
UNCOV
229
    return getGlobalResponseGetter().request(request, InboundTransfer.class);
×
230
  }
231

232
  /** Creates an InboundTransfer. */
233
  public static InboundTransfer create(InboundTransferCreateParams params) throws StripeException {
234
    return create(params, (RequestOptions) null);
1✔
235
  }
236

237
  /** Creates an InboundTransfer. */
238
  public static InboundTransfer create(InboundTransferCreateParams params, RequestOptions options)
239
      throws StripeException {
240
    String path = "/v1/treasury/inbound_transfers";
1✔
241
    ApiResource.checkNullTypedParams(path, params);
1✔
242
    ApiRequest request =
1✔
243
        new ApiRequest(
244
            BaseAddress.API,
245
            ApiResource.RequestMethod.POST,
246
            path,
247
            ApiRequestParams.paramsToMap(params),
1✔
248
            options);
249
    return getGlobalResponseGetter().request(request, InboundTransfer.class);
1✔
250
  }
251

252
  /** Returns a list of InboundTransfers sent from the specified FinancialAccount. */
253
  public static InboundTransferCollection list(Map<String, Object> params) throws StripeException {
254
    return list(params, (RequestOptions) null);
×
255
  }
256

257
  /** Returns a list of InboundTransfers sent from the specified FinancialAccount. */
258
  public static InboundTransferCollection list(Map<String, Object> params, RequestOptions options)
259
      throws StripeException {
260
    String path = "/v1/treasury/inbound_transfers";
×
261
    ApiRequest request =
×
262
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
UNCOV
263
    return getGlobalResponseGetter().request(request, InboundTransferCollection.class);
×
264
  }
265

266
  /** Returns a list of InboundTransfers sent from the specified FinancialAccount. */
267
  public static InboundTransferCollection list(InboundTransferListParams params)
268
      throws StripeException {
269
    return list(params, (RequestOptions) null);
1✔
270
  }
271

272
  /** Returns a list of InboundTransfers sent from the specified FinancialAccount. */
273
  public static InboundTransferCollection list(
274
      InboundTransferListParams params, RequestOptions options) throws StripeException {
275
    String path = "/v1/treasury/inbound_transfers";
1✔
276
    ApiResource.checkNullTypedParams(path, params);
1✔
277
    ApiRequest request =
1✔
278
        new ApiRequest(
279
            BaseAddress.API,
280
            ApiResource.RequestMethod.GET,
281
            path,
282
            ApiRequestParams.paramsToMap(params),
1✔
283
            options);
284
    return getGlobalResponseGetter().request(request, InboundTransferCollection.class);
1✔
285
  }
286

287
  /** Retrieves the details of an existing InboundTransfer. */
288
  public static InboundTransfer retrieve(String id) throws StripeException {
289
    return retrieve(id, (Map<String, Object>) null, (RequestOptions) null);
1✔
290
  }
291

292
  /** Retrieves the details of an existing InboundTransfer. */
293
  public static InboundTransfer retrieve(String id, RequestOptions options) throws StripeException {
294
    return retrieve(id, (Map<String, Object>) null, options);
×
295
  }
296

297
  /** Retrieves the details of an existing InboundTransfer. */
298
  public static InboundTransfer retrieve(
299
      String id, Map<String, Object> params, RequestOptions options) throws StripeException {
300
    String path = String.format("/v1/treasury/inbound_transfers/%s", ApiResource.urlEncodeId(id));
1✔
301
    ApiRequest request =
1✔
302
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
303
    return getGlobalResponseGetter().request(request, InboundTransfer.class);
1✔
304
  }
305

306
  /** Retrieves the details of an existing InboundTransfer. */
307
  public static InboundTransfer retrieve(
308
      String id, InboundTransferRetrieveParams params, RequestOptions options)
309
      throws StripeException {
310
    String path = String.format("/v1/treasury/inbound_transfers/%s", ApiResource.urlEncodeId(id));
×
311
    ApiResource.checkNullTypedParams(path, params);
×
312
    ApiRequest request =
×
313
        new ApiRequest(
314
            BaseAddress.API,
315
            ApiResource.RequestMethod.GET,
316
            path,
317
            ApiRequestParams.paramsToMap(params),
×
318
            options);
UNCOV
319
    return getGlobalResponseGetter().request(request, InboundTransfer.class);
×
320
  }
321

322
  @Getter
323
  @Setter
324
  @EqualsAndHashCode(callSuper = false)
325
  public static class FailureDetails extends StripeObject {
×
326
    /**
327
     * Reason for the failure.
328
     *
329
     * <p>One of {@code account_closed}, {@code account_frozen}, {@code bank_account_restricted},
330
     * {@code bank_ownership_changed}, {@code debit_not_authorized}, {@code
331
     * incorrect_account_holder_address}, {@code incorrect_account_holder_name}, {@code
332
     * incorrect_account_holder_tax_id}, {@code insufficient_funds}, {@code invalid_account_number},
333
     * {@code invalid_currency}, {@code no_account}, or {@code other}.
334
     */
335
    @SerializedName("code")
336
    String code;
337
  }
338

339
  @Getter
340
  @Setter
341
  @EqualsAndHashCode(callSuper = false)
342
  public static class LinkedFlows extends StripeObject {
1✔
343
    /**
344
     * If funds for this flow were returned after the flow went to the {@code succeeded} state, this
345
     * field contains a reference to the ReceivedDebit return.
346
     */
347
    @SerializedName("received_debit")
348
    String receivedDebit;
349
  }
350

351
  @Getter
352
  @Setter
353
  @EqualsAndHashCode(callSuper = false)
354
  public static class OriginPaymentMethodDetails extends StripeObject {
1✔
355
    @SerializedName("billing_details")
356
    BillingDetails billingDetails;
357

358
    /**
359
     * The type of the payment method used in the InboundTransfer.
360
     *
361
     * <p>Equal to {@code us_bank_account}.
362
     */
363
    @SerializedName("type")
364
    String type;
365

366
    @SerializedName("us_bank_account")
367
    UsBankAccount usBankAccount;
368

369
    @Getter
370
    @Setter
371
    @EqualsAndHashCode(callSuper = false)
372
    public static class BillingDetails extends StripeObject {
1✔
373
      @SerializedName("address")
374
      Address address;
375

376
      /** Email address. */
377
      @SerializedName("email")
378
      String email;
379

380
      /** Full name. */
381
      @SerializedName("name")
382
      String name;
383
    }
384

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

397
      /**
398
       * Account type: checkings or savings. Defaults to checking if omitted.
399
       *
400
       * <p>One of {@code checking}, or {@code savings}.
401
       */
402
      @SerializedName("account_type")
403
      String accountType;
404

405
      /** Name of the bank associated with the bank account. */
406
      @SerializedName("bank_name")
407
      String bankName;
408

409
      /**
410
       * Uniquely identifies this particular bank account. You can use this attribute to check
411
       * whether two bank accounts are the same.
412
       */
413
      @SerializedName("fingerprint")
414
      String fingerprint;
415

416
      /** Last four digits of the bank account number. */
417
      @SerializedName("last4")
418
      String last4;
419

420
      /** ID of the mandate used to make this payment. */
421
      @SerializedName("mandate")
422
      @Getter(lombok.AccessLevel.NONE)
423
      @Setter(lombok.AccessLevel.NONE)
424
      ExpandableField<Mandate> mandate;
425

426
      /**
427
       * The network rails used. See the <a
428
       * href="https://stripe.com/docs/treasury/money-movement/timelines">docs</a> to learn more
429
       * about money movement timelines for each network type.
430
       *
431
       * <p>Equal to {@code ach}.
432
       */
433
      @SerializedName("network")
434
      String network;
435

436
      /** Routing number of the bank account. */
437
      @SerializedName("routing_number")
438
      String routingNumber;
439

440
      /** Get ID of expandable {@code mandate} object. */
441
      public String getMandate() {
442
        return (this.mandate != null) ? this.mandate.getId() : null;
×
443
      }
444

445
      public void setMandate(String id) {
446
        this.mandate = ApiResource.setExpandableFieldId(id, this.mandate);
×
447
      }
×
448

449
      /** Get expanded {@code mandate}. */
450
      public Mandate getMandateObject() {
451
        return (this.mandate != null) ? this.mandate.getExpanded() : null;
×
452
      }
453

454
      public void setMandateObject(Mandate expandableObject) {
455
        this.mandate = new ExpandableField<Mandate>(expandableObject.getId(), expandableObject);
×
456
      }
×
457
    }
458
  }
459

460
  @Getter
461
  @Setter
462
  @EqualsAndHashCode(callSuper = false)
463
  public static class StatusTransitions extends StripeObject {
1✔
464
    /** Timestamp describing when an InboundTransfer changed status to {@code canceled}. */
465
    @SerializedName("canceled_at")
466
    Long canceledAt;
467

468
    /** Timestamp describing when an InboundTransfer changed status to {@code failed}. */
469
    @SerializedName("failed_at")
470
    Long failedAt;
471

472
    /** Timestamp describing when an InboundTransfer changed status to {@code succeeded}. */
473
    @SerializedName("succeeded_at")
474
    Long succeededAt;
475
  }
476

477
  public TestHelpers getTestHelpers() {
478
    return new TestHelpers(this);
1✔
479
  }
480

481
  public static class TestHelpers {
482
    private final InboundTransfer resource;
483

484
    private TestHelpers(InboundTransfer resource) {
1✔
485
      this.resource = resource;
1✔
486
    }
1✔
487

488
    /**
489
     * Transitions a test mode created InboundTransfer to the {@code failed} status. The
490
     * InboundTransfer must already be in the {@code processing} state.
491
     */
492
    public InboundTransfer fail() throws StripeException {
493
      return fail((Map<String, Object>) null, (RequestOptions) null);
×
494
    }
495

496
    /**
497
     * Transitions a test mode created InboundTransfer to the {@code failed} status. The
498
     * InboundTransfer must already be in the {@code processing} state.
499
     */
500
    public InboundTransfer fail(RequestOptions options) throws StripeException {
501
      return fail((Map<String, Object>) null, options);
×
502
    }
503

504
    /**
505
     * Transitions a test mode created InboundTransfer to the {@code failed} status. The
506
     * InboundTransfer must already be in the {@code processing} state.
507
     */
508
    public InboundTransfer fail(Map<String, Object> params) throws StripeException {
509
      return fail(params, (RequestOptions) null);
×
510
    }
511

512
    /**
513
     * Transitions a test mode created InboundTransfer to the {@code failed} status. The
514
     * InboundTransfer must already be in the {@code processing} state.
515
     */
516
    public InboundTransfer fail(Map<String, Object> params, RequestOptions options)
517
        throws StripeException {
518
      String path =
×
519
          String.format(
×
520
              "/v1/test_helpers/treasury/inbound_transfers/%s/fail",
521
              ApiResource.urlEncodeId(this.resource.getId()));
×
522
      ApiRequest request =
×
523
          new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
UNCOV
524
      return resource.getResponseGetter().request(request, InboundTransfer.class);
×
525
    }
526

527
    /**
528
     * Transitions a test mode created InboundTransfer to the {@code failed} status. The
529
     * InboundTransfer must already be in the {@code processing} state.
530
     */
531
    public InboundTransfer fail(InboundTransferFailParams params) throws StripeException {
532
      return fail(params, (RequestOptions) null);
1✔
533
    }
534

535
    /**
536
     * Transitions a test mode created InboundTransfer to the {@code failed} status. The
537
     * InboundTransfer must already be in the {@code processing} state.
538
     */
539
    public InboundTransfer fail(InboundTransferFailParams params, RequestOptions options)
540
        throws StripeException {
541
      String path =
1✔
542
          String.format(
1✔
543
              "/v1/test_helpers/treasury/inbound_transfers/%s/fail",
544
              ApiResource.urlEncodeId(this.resource.getId()));
1✔
545
      ApiResource.checkNullTypedParams(path, params);
1✔
546
      ApiRequest request =
1✔
547
          new ApiRequest(
548
              BaseAddress.API,
549
              ApiResource.RequestMethod.POST,
550
              path,
551
              ApiRequestParams.paramsToMap(params),
1✔
552
              options);
553
      return resource.getResponseGetter().request(request, InboundTransfer.class);
1✔
554
    }
555

556
    /**
557
     * Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a
558
     * ReceivedDebit. The InboundTransfer must already be in the {@code succeeded} state.
559
     */
560
    public InboundTransfer returnInboundTransfer() throws StripeException {
561
      return returnInboundTransfer((Map<String, Object>) null, (RequestOptions) null);
×
562
    }
563

564
    /**
565
     * Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a
566
     * ReceivedDebit. The InboundTransfer must already be in the {@code succeeded} state.
567
     */
568
    public InboundTransfer returnInboundTransfer(RequestOptions options) throws StripeException {
569
      return returnInboundTransfer((Map<String, Object>) null, options);
×
570
    }
571

572
    /**
573
     * Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a
574
     * ReceivedDebit. The InboundTransfer must already be in the {@code succeeded} state.
575
     */
576
    public InboundTransfer returnInboundTransfer(Map<String, Object> params)
577
        throws StripeException {
578
      return returnInboundTransfer(params, (RequestOptions) null);
×
579
    }
580

581
    /**
582
     * Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a
583
     * ReceivedDebit. The InboundTransfer must already be in the {@code succeeded} state.
584
     */
585
    public InboundTransfer returnInboundTransfer(Map<String, Object> params, RequestOptions options)
586
        throws StripeException {
587
      String path =
×
588
          String.format(
×
589
              "/v1/test_helpers/treasury/inbound_transfers/%s/return",
590
              ApiResource.urlEncodeId(this.resource.getId()));
×
591
      ApiRequest request =
×
592
          new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
UNCOV
593
      return resource.getResponseGetter().request(request, InboundTransfer.class);
×
594
    }
595

596
    /**
597
     * Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a
598
     * ReceivedDebit. The InboundTransfer must already be in the {@code succeeded} state.
599
     */
600
    public InboundTransfer returnInboundTransfer(InboundTransferReturnInboundTransferParams params)
601
        throws StripeException {
602
      return returnInboundTransfer(params, (RequestOptions) null);
1✔
603
    }
604

605
    /**
606
     * Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a
607
     * ReceivedDebit. The InboundTransfer must already be in the {@code succeeded} state.
608
     */
609
    public InboundTransfer returnInboundTransfer(
610
        InboundTransferReturnInboundTransferParams params, RequestOptions options)
611
        throws StripeException {
612
      String path =
1✔
613
          String.format(
1✔
614
              "/v1/test_helpers/treasury/inbound_transfers/%s/return",
615
              ApiResource.urlEncodeId(this.resource.getId()));
1✔
616
      ApiResource.checkNullTypedParams(path, params);
1✔
617
      ApiRequest request =
1✔
618
          new ApiRequest(
619
              BaseAddress.API,
620
              ApiResource.RequestMethod.POST,
621
              path,
622
              ApiRequestParams.paramsToMap(params),
1✔
623
              options);
624
      return resource.getResponseGetter().request(request, InboundTransfer.class);
1✔
625
    }
626

627
    /**
628
     * Transitions a test mode created InboundTransfer to the {@code succeeded} status. The
629
     * InboundTransfer must already be in the {@code processing} state.
630
     */
631
    public InboundTransfer succeed() throws StripeException {
632
      return succeed((Map<String, Object>) null, (RequestOptions) null);
×
633
    }
634

635
    /**
636
     * Transitions a test mode created InboundTransfer to the {@code succeeded} status. The
637
     * InboundTransfer must already be in the {@code processing} state.
638
     */
639
    public InboundTransfer succeed(RequestOptions options) throws StripeException {
640
      return succeed((Map<String, Object>) null, options);
×
641
    }
642

643
    /**
644
     * Transitions a test mode created InboundTransfer to the {@code succeeded} status. The
645
     * InboundTransfer must already be in the {@code processing} state.
646
     */
647
    public InboundTransfer succeed(Map<String, Object> params) throws StripeException {
648
      return succeed(params, (RequestOptions) null);
×
649
    }
650

651
    /**
652
     * Transitions a test mode created InboundTransfer to the {@code succeeded} status. The
653
     * InboundTransfer must already be in the {@code processing} state.
654
     */
655
    public InboundTransfer succeed(Map<String, Object> params, RequestOptions options)
656
        throws StripeException {
657
      String path =
×
658
          String.format(
×
659
              "/v1/test_helpers/treasury/inbound_transfers/%s/succeed",
660
              ApiResource.urlEncodeId(this.resource.getId()));
×
661
      ApiRequest request =
×
662
          new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
UNCOV
663
      return resource.getResponseGetter().request(request, InboundTransfer.class);
×
664
    }
665

666
    /**
667
     * Transitions a test mode created InboundTransfer to the {@code succeeded} status. The
668
     * InboundTransfer must already be in the {@code processing} state.
669
     */
670
    public InboundTransfer succeed(InboundTransferSucceedParams params) throws StripeException {
671
      return succeed(params, (RequestOptions) null);
1✔
672
    }
673

674
    /**
675
     * Transitions a test mode created InboundTransfer to the {@code succeeded} status. The
676
     * InboundTransfer must already be in the {@code processing} state.
677
     */
678
    public InboundTransfer succeed(InboundTransferSucceedParams params, RequestOptions options)
679
        throws StripeException {
680
      String path =
1✔
681
          String.format(
1✔
682
              "/v1/test_helpers/treasury/inbound_transfers/%s/succeed",
683
              ApiResource.urlEncodeId(this.resource.getId()));
1✔
684
      ApiResource.checkNullTypedParams(path, params);
1✔
685
      ApiRequest request =
1✔
686
          new ApiRequest(
687
              BaseAddress.API,
688
              ApiResource.RequestMethod.POST,
689
              path,
690
              ApiRequestParams.paramsToMap(params),
1✔
691
              options);
692
      return resource.getResponseGetter().request(request, InboundTransfer.class);
1✔
693
    }
694
  }
695

696
  @Override
697
  public void setResponseGetter(StripeResponseGetter responseGetter) {
698
    super.setResponseGetter(responseGetter);
1✔
699
    trySetResponseGetter(failureDetails, responseGetter);
1✔
700
    trySetResponseGetter(linkedFlows, responseGetter);
1✔
701
    trySetResponseGetter(originPaymentMethodDetails, responseGetter);
1✔
702
    trySetResponseGetter(statusTransitions, responseGetter);
1✔
703
    trySetResponseGetter(transaction, responseGetter);
1✔
704
  }
1✔
705
}
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

© 2024 Coveralls, Inc