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

stripe / stripe-java / #16380

30 Aug 2024 07:54PM UTC coverage: 12.882% (-0.004%) from 12.886%
#16380

push

github

web-flow
Merge from master after the changes to not pass api_mode from individual methods (#1857)

* Generate SDK for OpenAPI spec version 1230 (#1856)

* Bump version to 26.9.0

* No need for APIMode to be passed around from individual API methods (#1855)

* Generated code

* Update the code around raw request

* Update the v2 tests to use v2 path

16 of 23 new or added lines in 7 files covered. (69.57%)

706 existing lines in 213 files now uncovered.

18468 of 143365 relevant lines covered (12.88%)

0.13 hits per line

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

35.09
/src/main/java/com/stripe/model/SetupIntent.java
1
// File generated from our OpenAPI spec
2
package com.stripe.model;
3

4
import com.google.gson.annotations.SerializedName;
5
import com.stripe.exception.StripeException;
6
import com.stripe.net.ApiRequest;
7
import com.stripe.net.ApiRequestParams;
8
import com.stripe.net.ApiResource;
9
import com.stripe.net.BaseAddress;
10
import com.stripe.net.RequestOptions;
11
import com.stripe.net.StripeResponseGetter;
12
import com.stripe.param.SetupIntentCancelParams;
13
import com.stripe.param.SetupIntentConfirmParams;
14
import com.stripe.param.SetupIntentCreateParams;
15
import com.stripe.param.SetupIntentListParams;
16
import com.stripe.param.SetupIntentRetrieveParams;
17
import com.stripe.param.SetupIntentUpdateParams;
18
import com.stripe.param.SetupIntentVerifyMicrodepositsParams;
19
import java.util.List;
20
import java.util.Map;
21
import lombok.EqualsAndHashCode;
22
import lombok.Getter;
23
import lombok.Setter;
24

25
/**
26
 * A SetupIntent guides you through the process of setting up and saving a customer's payment
27
 * credentials for future payments. For example, you can use a SetupIntent to set up and save your
28
 * customer's card without immediately collecting a payment. Later, you can use <a
29
 * href="https://stripe.com/docs/api#payment_intents">PaymentIntents</a> to drive the payment flow.
30
 *
31
 * <p>Create a SetupIntent when you're ready to collect your customer's payment credentials. Don't
32
 * maintain long-lived, unconfirmed SetupIntents because they might not be valid. The SetupIntent
33
 * transitions through multiple <a
34
 * href="https://docs.stripe.com/payments/intents#intent-statuses">statuses</a> as it guides you
35
 * through the setup process.
36
 *
37
 * <p>Successful SetupIntents result in payment credentials that are optimized for future payments.
38
 * For example, cardholders in <a
39
 * href="https://stripe.com/guides/strong-customer-authentication">certain regions</a> might need to
40
 * be run through <a href="https://docs.stripe.com/strong-customer-authentication">Strong Customer
41
 * Authentication</a> during payment method collection to streamline later <a
42
 * href="https://docs.stripe.com/payments/setup-intents">off-session payments</a>. If you use the
43
 * SetupIntent with a <a
44
 * href="https://stripe.com/docs/api#setup_intent_object-customer">Customer</a>, it automatically
45
 * attaches the resulting payment method to that Customer after successful setup. We recommend using
46
 * SetupIntents or <a
47
 * href="https://stripe.com/docs/api#payment_intent_object-setup_future_usage">setup_future_usage</a>
48
 * on PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment
49
 * methods.
50
 *
51
 * <p>By using SetupIntents, you can reduce friction for your customers, even as regulations change
52
 * over time.
53
 *
54
 * <p>Related guide: <a href="https://docs.stripe.com/payments/setup-intents">Setup Intents API</a>
55
 */
56
@Getter
57
@Setter
58
@EqualsAndHashCode(callSuper = false)
59
public class SetupIntent extends ApiResource implements HasId, MetadataStore<SetupIntent> {
1✔
60
  /** ID of the Connect application that created the SetupIntent. */
61
  @SerializedName("application")
62
  @Getter(lombok.AccessLevel.NONE)
63
  @Setter(lombok.AccessLevel.NONE)
64
  ExpandableField<Application> application;
65

66
  /**
67
   * If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.
68
   *
69
   * <p>It can only be used for this Stripe Account’s own money movement flows like InboundTransfer
70
   * and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer,
71
   * and defaults to false when attaching a PaymentMethod to a Customer.
72
   */
73
  @SerializedName("attach_to_self")
74
  Boolean attachToSelf;
75

76
  /** Settings for dynamic payment methods compatible with this Setup Intent. */
77
  @SerializedName("automatic_payment_methods")
78
  AutomaticPaymentMethods automaticPaymentMethods;
79

80
  /**
81
   * Reason for cancellation of this SetupIntent, one of {@code abandoned}, {@code
82
   * requested_by_customer}, or {@code duplicate}.
83
   */
84
  @SerializedName("cancellation_reason")
85
  String cancellationReason;
86

87
  /**
88
   * The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.
89
   *
90
   * <p>The client secret can be used to complete payment setup from your frontend. It should not be
91
   * stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS
92
   * enabled on any page that includes the client secret.
93
   */
94
  @SerializedName("client_secret")
95
  String clientSecret;
96

97
  /** Time at which the object was created. Measured in seconds since the Unix epoch. */
98
  @SerializedName("created")
99
  Long created;
100

101
  /**
102
   * ID of the Customer this SetupIntent belongs to, if one exists.
103
   *
104
   * <p>If present, the SetupIntent's payment method will be attached to the Customer on successful
105
   * setup. Payment methods attached to other Customers cannot be used with this SetupIntent.
106
   */
107
  @SerializedName("customer")
108
  @Getter(lombok.AccessLevel.NONE)
109
  @Setter(lombok.AccessLevel.NONE)
110
  ExpandableField<Customer> customer;
111

112
  /** An arbitrary string attached to the object. Often useful for displaying to users. */
113
  @SerializedName("description")
114
  String description;
115

116
  /**
117
   * Indicates the directions of money movement for which this payment method is intended to be
118
   * used.
119
   *
120
   * <p>Include {@code inbound} if you intend to use the payment method as the origin to pull funds
121
   * from. Include {@code outbound} if you intend to use the payment method as the destination to
122
   * send funds to. You can include both if you intend to use the payment method for both purposes.
123
   */
124
  @SerializedName("flow_directions")
125
  List<String> flowDirections;
126

127
  /** Unique identifier for the object. */
128
  @Getter(onMethod_ = {@Override})
129
  @SerializedName("id")
130
  String id;
131

132
  /** The error encountered in the previous SetupIntent confirmation. */
133
  @SerializedName("last_setup_error")
134
  StripeError lastSetupError;
135

136
  /** The most recent SetupAttempt for this SetupIntent. */
137
  @SerializedName("latest_attempt")
138
  @Getter(lombok.AccessLevel.NONE)
139
  @Setter(lombok.AccessLevel.NONE)
140
  ExpandableField<SetupAttempt> latestAttempt;
141

142
  /**
143
   * Has the value {@code true} if the object exists in live mode or the value {@code false} if the
144
   * object exists in test mode.
145
   */
146
  @SerializedName("livemode")
147
  Boolean livemode;
148

149
  /** ID of the multi use Mandate generated by the SetupIntent. */
150
  @SerializedName("mandate")
151
  @Getter(lombok.AccessLevel.NONE)
152
  @Setter(lombok.AccessLevel.NONE)
153
  ExpandableField<Mandate> mandate;
154

155
  /**
156
   * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
157
   * to an object. This can be useful for storing additional information about the object in a
158
   * structured format.
159
   */
160
  @Getter(onMethod_ = {@Override})
161
  @SerializedName("metadata")
162
  Map<String, String> metadata;
163

164
  /**
165
   * If present, this property tells you what actions you need to take in order for your customer to
166
   * continue payment setup.
167
   */
168
  @SerializedName("next_action")
169
  NextAction nextAction;
170

171
  /**
172
   * String representing the object's type. Objects of the same type share the same value.
173
   *
174
   * <p>Equal to {@code setup_intent}.
175
   */
176
  @SerializedName("object")
177
  String object;
178

179
  /** The account (if any) for which the setup is intended. */
180
  @SerializedName("on_behalf_of")
181
  @Getter(lombok.AccessLevel.NONE)
182
  @Setter(lombok.AccessLevel.NONE)
183
  ExpandableField<Account> onBehalfOf;
184

185
  /**
186
   * ID of the payment method used with this SetupIntent. If the payment method is {@code
187
   * card_present} and isn't a digital wallet, then the <a
188
   * href="https://docs.stripe.com/api/setup_attempts/object#setup_attempt_object-payment_method_details-card_present-generated_card">generated_card</a>
189
   * associated with the {@code latest_attempt} is attached to the Customer instead.
190
   */
191
  @SerializedName("payment_method")
192
  @Getter(lombok.AccessLevel.NONE)
193
  @Setter(lombok.AccessLevel.NONE)
194
  ExpandableField<PaymentMethod> paymentMethod;
195

196
  /** Information about the payment method configuration used for this Setup Intent. */
197
  @SerializedName("payment_method_configuration_details")
198
  PaymentMethodConfigurationDetails paymentMethodConfigurationDetails;
199

200
  /** Payment method-specific configuration for this SetupIntent. */
201
  @SerializedName("payment_method_options")
202
  PaymentMethodOptions paymentMethodOptions;
203

204
  /** The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. */
205
  @SerializedName("payment_method_types")
206
  List<String> paymentMethodTypes;
207

208
  /** ID of the single_use Mandate generated by the SetupIntent. */
209
  @SerializedName("single_use_mandate")
210
  @Getter(lombok.AccessLevel.NONE)
211
  @Setter(lombok.AccessLevel.NONE)
212
  ExpandableField<Mandate> singleUseMandate;
213

214
  /**
215
   * <a href="https://stripe.com/docs/payments/intents#intent-statuses">Status</a> of this
216
   * SetupIntent, one of {@code requires_payment_method}, {@code requires_confirmation}, {@code
217
   * requires_action}, {@code processing}, {@code canceled}, or {@code succeeded}.
218
   */
219
  @SerializedName("status")
220
  String status;
221

222
  /**
223
   * Indicates how the payment method is intended to be used in the future.
224
   *
225
   * <p>Use {@code on_session} if you intend to only reuse the payment method when the customer is
226
   * in your checkout flow. Use {@code off_session} if your customer may or may not be in your
227
   * checkout flow. If not provided, this value defaults to {@code off_session}.
228
   */
229
  @SerializedName("usage")
230
  String usage;
231

232
  /** Get ID of expandable {@code application} object. */
233
  public String getApplication() {
234
    return (this.application != null) ? this.application.getId() : null;
×
235
  }
236

237
  public void setApplication(String id) {
238
    this.application = ApiResource.setExpandableFieldId(id, this.application);
×
239
  }
×
240

241
  /** Get expanded {@code application}. */
242
  public Application getApplicationObject() {
243
    return (this.application != null) ? this.application.getExpanded() : null;
×
244
  }
245

246
  public void setApplicationObject(Application expandableObject) {
247
    this.application = new ExpandableField<Application>(expandableObject.getId(), expandableObject);
×
248
  }
×
249

250
  /** Get ID of expandable {@code customer} object. */
251
  public String getCustomer() {
252
    return (this.customer != null) ? this.customer.getId() : null;
×
253
  }
254

255
  public void setCustomer(String id) {
256
    this.customer = ApiResource.setExpandableFieldId(id, this.customer);
×
257
  }
×
258

259
  /** Get expanded {@code customer}. */
260
  public Customer getCustomerObject() {
261
    return (this.customer != null) ? this.customer.getExpanded() : null;
×
262
  }
263

264
  public void setCustomerObject(Customer expandableObject) {
265
    this.customer = new ExpandableField<Customer>(expandableObject.getId(), expandableObject);
×
266
  }
×
267

268
  /** Get ID of expandable {@code latestAttempt} object. */
269
  public String getLatestAttempt() {
270
    return (this.latestAttempt != null) ? this.latestAttempt.getId() : null;
×
271
  }
272

273
  public void setLatestAttempt(String id) {
274
    this.latestAttempt = ApiResource.setExpandableFieldId(id, this.latestAttempt);
×
275
  }
×
276

277
  /** Get expanded {@code latestAttempt}. */
278
  public SetupAttempt getLatestAttemptObject() {
279
    return (this.latestAttempt != null) ? this.latestAttempt.getExpanded() : null;
×
280
  }
281

282
  public void setLatestAttemptObject(SetupAttempt expandableObject) {
283
    this.latestAttempt =
×
284
        new ExpandableField<SetupAttempt>(expandableObject.getId(), expandableObject);
×
285
  }
×
286

287
  /** Get ID of expandable {@code mandate} object. */
288
  public String getMandate() {
289
    return (this.mandate != null) ? this.mandate.getId() : null;
×
290
  }
291

292
  public void setMandate(String id) {
293
    this.mandate = ApiResource.setExpandableFieldId(id, this.mandate);
×
294
  }
×
295

296
  /** Get expanded {@code mandate}. */
297
  public Mandate getMandateObject() {
298
    return (this.mandate != null) ? this.mandate.getExpanded() : null;
×
299
  }
300

301
  public void setMandateObject(Mandate expandableObject) {
302
    this.mandate = new ExpandableField<Mandate>(expandableObject.getId(), expandableObject);
×
303
  }
×
304

305
  /** Get ID of expandable {@code onBehalfOf} object. */
306
  public String getOnBehalfOf() {
307
    return (this.onBehalfOf != null) ? this.onBehalfOf.getId() : null;
×
308
  }
309

310
  public void setOnBehalfOf(String id) {
311
    this.onBehalfOf = ApiResource.setExpandableFieldId(id, this.onBehalfOf);
×
312
  }
×
313

314
  /** Get expanded {@code onBehalfOf}. */
315
  public Account getOnBehalfOfObject() {
316
    return (this.onBehalfOf != null) ? this.onBehalfOf.getExpanded() : null;
×
317
  }
318

319
  public void setOnBehalfOfObject(Account expandableObject) {
320
    this.onBehalfOf = new ExpandableField<Account>(expandableObject.getId(), expandableObject);
×
321
  }
×
322

323
  /** Get ID of expandable {@code paymentMethod} object. */
324
  public String getPaymentMethod() {
325
    return (this.paymentMethod != null) ? this.paymentMethod.getId() : null;
×
326
  }
327

328
  public void setPaymentMethod(String id) {
329
    this.paymentMethod = ApiResource.setExpandableFieldId(id, this.paymentMethod);
×
330
  }
×
331

332
  /** Get expanded {@code paymentMethod}. */
333
  public PaymentMethod getPaymentMethodObject() {
334
    return (this.paymentMethod != null) ? this.paymentMethod.getExpanded() : null;
×
335
  }
336

337
  public void setPaymentMethodObject(PaymentMethod expandableObject) {
338
    this.paymentMethod =
×
339
        new ExpandableField<PaymentMethod>(expandableObject.getId(), expandableObject);
×
340
  }
×
341

342
  /** Get ID of expandable {@code singleUseMandate} object. */
343
  public String getSingleUseMandate() {
344
    return (this.singleUseMandate != null) ? this.singleUseMandate.getId() : null;
×
345
  }
346

347
  public void setSingleUseMandate(String id) {
348
    this.singleUseMandate = ApiResource.setExpandableFieldId(id, this.singleUseMandate);
×
349
  }
×
350

351
  /** Get expanded {@code singleUseMandate}. */
352
  public Mandate getSingleUseMandateObject() {
353
    return (this.singleUseMandate != null) ? this.singleUseMandate.getExpanded() : null;
×
354
  }
355

356
  public void setSingleUseMandateObject(Mandate expandableObject) {
357
    this.singleUseMandate =
×
358
        new ExpandableField<Mandate>(expandableObject.getId(), expandableObject);
×
359
  }
×
360

361
  /**
362
   * You can cancel a SetupIntent object when it’s in one of these statuses: {@code
363
   * requires_payment_method}, {@code requires_confirmation}, or {@code requires_action}.
364
   *
365
   * <p>After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an
366
   * error. You can’t cancel the SetupIntent for a Checkout Session. <a
367
   * href="https://stripe.com/docs/api/checkout/sessions/expire">Expire the Checkout Session</a>
368
   * instead.
369
   */
370
  public SetupIntent cancel() throws StripeException {
371
    return cancel((Map<String, Object>) null, (RequestOptions) null);
×
372
  }
373

374
  /**
375
   * You can cancel a SetupIntent object when it’s in one of these statuses: {@code
376
   * requires_payment_method}, {@code requires_confirmation}, or {@code requires_action}.
377
   *
378
   * <p>After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an
379
   * error. You can’t cancel the SetupIntent for a Checkout Session. <a
380
   * href="https://stripe.com/docs/api/checkout/sessions/expire">Expire the Checkout Session</a>
381
   * instead.
382
   */
383
  public SetupIntent cancel(RequestOptions options) throws StripeException {
384
    return cancel((Map<String, Object>) null, options);
×
385
  }
386

387
  /**
388
   * You can cancel a SetupIntent object when it’s in one of these statuses: {@code
389
   * requires_payment_method}, {@code requires_confirmation}, or {@code requires_action}.
390
   *
391
   * <p>After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an
392
   * error. You can’t cancel the SetupIntent for a Checkout Session. <a
393
   * href="https://stripe.com/docs/api/checkout/sessions/expire">Expire the Checkout Session</a>
394
   * instead.
395
   */
396
  public SetupIntent cancel(Map<String, Object> params) throws StripeException {
397
    return cancel(params, (RequestOptions) null);
×
398
  }
399

400
  /**
401
   * You can cancel a SetupIntent object when it’s in one of these statuses: {@code
402
   * requires_payment_method}, {@code requires_confirmation}, or {@code requires_action}.
403
   *
404
   * <p>After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an
405
   * error. You can’t cancel the SetupIntent for a Checkout Session. <a
406
   * href="https://stripe.com/docs/api/checkout/sessions/expire">Expire the Checkout Session</a>
407
   * instead.
408
   */
409
  public SetupIntent cancel(Map<String, Object> params, RequestOptions options)
410
      throws StripeException {
411
    String path =
×
412
        String.format("/v1/setup_intents/%s/cancel", ApiResource.urlEncodeId(this.getId()));
×
413
    ApiRequest request =
×
414
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
UNCOV
415
    return getResponseGetter().request(request, SetupIntent.class);
×
416
  }
417

418
  /**
419
   * You can cancel a SetupIntent object when it’s in one of these statuses: {@code
420
   * requires_payment_method}, {@code requires_confirmation}, or {@code requires_action}.
421
   *
422
   * <p>After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an
423
   * error. You can’t cancel the SetupIntent for a Checkout Session. <a
424
   * href="https://stripe.com/docs/api/checkout/sessions/expire">Expire the Checkout Session</a>
425
   * instead.
426
   */
427
  public SetupIntent cancel(SetupIntentCancelParams params) throws StripeException {
428
    return cancel(params, (RequestOptions) null);
1✔
429
  }
430

431
  /**
432
   * You can cancel a SetupIntent object when it’s in one of these statuses: {@code
433
   * requires_payment_method}, {@code requires_confirmation}, or {@code requires_action}.
434
   *
435
   * <p>After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an
436
   * error. You can’t cancel the SetupIntent for a Checkout Session. <a
437
   * href="https://stripe.com/docs/api/checkout/sessions/expire">Expire the Checkout Session</a>
438
   * instead.
439
   */
440
  public SetupIntent cancel(SetupIntentCancelParams params, RequestOptions options)
441
      throws StripeException {
442
    String path =
1✔
443
        String.format("/v1/setup_intents/%s/cancel", ApiResource.urlEncodeId(this.getId()));
1✔
444
    ApiResource.checkNullTypedParams(path, params);
1✔
445
    ApiRequest request =
1✔
446
        new ApiRequest(
447
            BaseAddress.API,
448
            ApiResource.RequestMethod.POST,
449
            path,
450
            ApiRequestParams.paramsToMap(params),
1✔
451
            options);
452
    return getResponseGetter().request(request, SetupIntent.class);
1✔
453
  }
454

455
  /**
456
   * Confirm that your customer intends to set up the current or provided payment method. For
457
   * example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment
458
   * method management page on your website.
459
   *
460
   * <p>If the selected payment method does not require any additional steps from the customer, the
461
   * SetupIntent will transition to the {@code succeeded} status.
462
   *
463
   * <p>Otherwise, it will transition to the {@code requires_action} status and suggest additional
464
   * actions via {@code next_action}. If setup fails, the SetupIntent will transition to the {@code
465
   * requires_payment_method} status or the {@code canceled} status if the confirmation limit is
466
   * reached.
467
   */
468
  public SetupIntent confirm() throws StripeException {
469
    return confirm((Map<String, Object>) null, (RequestOptions) null);
×
470
  }
471

472
  /**
473
   * Confirm that your customer intends to set up the current or provided payment method. For
474
   * example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment
475
   * method management page on your website.
476
   *
477
   * <p>If the selected payment method does not require any additional steps from the customer, the
478
   * SetupIntent will transition to the {@code succeeded} status.
479
   *
480
   * <p>Otherwise, it will transition to the {@code requires_action} status and suggest additional
481
   * actions via {@code next_action}. If setup fails, the SetupIntent will transition to the {@code
482
   * requires_payment_method} status or the {@code canceled} status if the confirmation limit is
483
   * reached.
484
   */
485
  public SetupIntent confirm(RequestOptions options) throws StripeException {
486
    return confirm((Map<String, Object>) null, options);
×
487
  }
488

489
  /**
490
   * Confirm that your customer intends to set up the current or provided payment method. For
491
   * example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment
492
   * method management page on your website.
493
   *
494
   * <p>If the selected payment method does not require any additional steps from the customer, the
495
   * SetupIntent will transition to the {@code succeeded} status.
496
   *
497
   * <p>Otherwise, it will transition to the {@code requires_action} status and suggest additional
498
   * actions via {@code next_action}. If setup fails, the SetupIntent will transition to the {@code
499
   * requires_payment_method} status or the {@code canceled} status if the confirmation limit is
500
   * reached.
501
   */
502
  public SetupIntent confirm(Map<String, Object> params) throws StripeException {
503
    return confirm(params, (RequestOptions) null);
×
504
  }
505

506
  /**
507
   * Confirm that your customer intends to set up the current or provided payment method. For
508
   * example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment
509
   * method management page on your website.
510
   *
511
   * <p>If the selected payment method does not require any additional steps from the customer, the
512
   * SetupIntent will transition to the {@code succeeded} status.
513
   *
514
   * <p>Otherwise, it will transition to the {@code requires_action} status and suggest additional
515
   * actions via {@code next_action}. If setup fails, the SetupIntent will transition to the {@code
516
   * requires_payment_method} status or the {@code canceled} status if the confirmation limit is
517
   * reached.
518
   */
519
  public SetupIntent confirm(Map<String, Object> params, RequestOptions options)
520
      throws StripeException {
521
    String path =
×
522
        String.format("/v1/setup_intents/%s/confirm", ApiResource.urlEncodeId(this.getId()));
×
523
    ApiRequest request =
×
524
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
UNCOV
525
    return getResponseGetter().request(request, SetupIntent.class);
×
526
  }
527

528
  /**
529
   * Confirm that your customer intends to set up the current or provided payment method. For
530
   * example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment
531
   * method management page on your website.
532
   *
533
   * <p>If the selected payment method does not require any additional steps from the customer, the
534
   * SetupIntent will transition to the {@code succeeded} status.
535
   *
536
   * <p>Otherwise, it will transition to the {@code requires_action} status and suggest additional
537
   * actions via {@code next_action}. If setup fails, the SetupIntent will transition to the {@code
538
   * requires_payment_method} status or the {@code canceled} status if the confirmation limit is
539
   * reached.
540
   */
541
  public SetupIntent confirm(SetupIntentConfirmParams params) throws StripeException {
542
    return confirm(params, (RequestOptions) null);
1✔
543
  }
544

545
  /**
546
   * Confirm that your customer intends to set up the current or provided payment method. For
547
   * example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment
548
   * method management page on your website.
549
   *
550
   * <p>If the selected payment method does not require any additional steps from the customer, the
551
   * SetupIntent will transition to the {@code succeeded} status.
552
   *
553
   * <p>Otherwise, it will transition to the {@code requires_action} status and suggest additional
554
   * actions via {@code next_action}. If setup fails, the SetupIntent will transition to the {@code
555
   * requires_payment_method} status or the {@code canceled} status if the confirmation limit is
556
   * reached.
557
   */
558
  public SetupIntent confirm(SetupIntentConfirmParams params, RequestOptions options)
559
      throws StripeException {
560
    String path =
1✔
561
        String.format("/v1/setup_intents/%s/confirm", ApiResource.urlEncodeId(this.getId()));
1✔
562
    ApiResource.checkNullTypedParams(path, params);
1✔
563
    ApiRequest request =
1✔
564
        new ApiRequest(
565
            BaseAddress.API,
566
            ApiResource.RequestMethod.POST,
567
            path,
568
            ApiRequestParams.paramsToMap(params),
1✔
569
            options);
570
    return getResponseGetter().request(request, SetupIntent.class);
1✔
571
  }
572

573
  /**
574
   * Creates a SetupIntent object.
575
   *
576
   * <p>After you create the SetupIntent, attach a payment method and <a
577
   * href="https://stripe.com/docs/api/setup_intents/confirm">confirm</a> it to collect any required
578
   * permissions to charge the payment method later.
579
   */
580
  public static SetupIntent create(Map<String, Object> params) throws StripeException {
581
    return create(params, (RequestOptions) null);
×
582
  }
583

584
  /**
585
   * Creates a SetupIntent object.
586
   *
587
   * <p>After you create the SetupIntent, attach a payment method and <a
588
   * href="https://stripe.com/docs/api/setup_intents/confirm">confirm</a> it to collect any required
589
   * permissions to charge the payment method later.
590
   */
591
  public static SetupIntent create(Map<String, Object> params, RequestOptions options)
592
      throws StripeException {
593
    String path = "/v1/setup_intents";
×
594
    ApiRequest request =
×
595
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
UNCOV
596
    return getGlobalResponseGetter().request(request, SetupIntent.class);
×
597
  }
598

599
  /**
600
   * Creates a SetupIntent object.
601
   *
602
   * <p>After you create the SetupIntent, attach a payment method and <a
603
   * href="https://stripe.com/docs/api/setup_intents/confirm">confirm</a> it to collect any required
604
   * permissions to charge the payment method later.
605
   */
606
  public static SetupIntent create(SetupIntentCreateParams params) throws StripeException {
607
    return create(params, (RequestOptions) null);
1✔
608
  }
609

610
  /**
611
   * Creates a SetupIntent object.
612
   *
613
   * <p>After you create the SetupIntent, attach a payment method and <a
614
   * href="https://stripe.com/docs/api/setup_intents/confirm">confirm</a> it to collect any required
615
   * permissions to charge the payment method later.
616
   */
617
  public static SetupIntent create(SetupIntentCreateParams params, RequestOptions options)
618
      throws StripeException {
619
    String path = "/v1/setup_intents";
1✔
620
    ApiResource.checkNullTypedParams(path, params);
1✔
621
    ApiRequest request =
1✔
622
        new ApiRequest(
623
            BaseAddress.API,
624
            ApiResource.RequestMethod.POST,
625
            path,
626
            ApiRequestParams.paramsToMap(params),
1✔
627
            options);
628
    return getGlobalResponseGetter().request(request, SetupIntent.class);
1✔
629
  }
630

631
  /** Returns a list of SetupIntents. */
632
  public static SetupIntentCollection list(Map<String, Object> params) throws StripeException {
633
    return list(params, (RequestOptions) null);
×
634
  }
635

636
  /** Returns a list of SetupIntents. */
637
  public static SetupIntentCollection list(Map<String, Object> params, RequestOptions options)
638
      throws StripeException {
639
    String path = "/v1/setup_intents";
×
640
    ApiRequest request =
×
641
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
UNCOV
642
    return getGlobalResponseGetter().request(request, SetupIntentCollection.class);
×
643
  }
644

645
  /** Returns a list of SetupIntents. */
646
  public static SetupIntentCollection list(SetupIntentListParams params) throws StripeException {
647
    return list(params, (RequestOptions) null);
1✔
648
  }
649

650
  /** Returns a list of SetupIntents. */
651
  public static SetupIntentCollection list(SetupIntentListParams params, RequestOptions options)
652
      throws StripeException {
653
    String path = "/v1/setup_intents";
1✔
654
    ApiResource.checkNullTypedParams(path, params);
1✔
655
    ApiRequest request =
1✔
656
        new ApiRequest(
657
            BaseAddress.API,
658
            ApiResource.RequestMethod.GET,
659
            path,
660
            ApiRequestParams.paramsToMap(params),
1✔
661
            options);
662
    return getGlobalResponseGetter().request(request, SetupIntentCollection.class);
1✔
663
  }
664

665
  /**
666
   * Retrieves the details of a SetupIntent that has previously been created.
667
   *
668
   * <p>Client-side retrieval using a publishable key is allowed when the {@code client_secret} is
669
   * provided in the query string.
670
   *
671
   * <p>When retrieved with a publishable key, only a subset of properties will be returned. Please
672
   * refer to the <a href="https://stripe.com/docs/api#setup_intent_object">SetupIntent</a> object
673
   * reference for more details.
674
   */
675
  public static SetupIntent retrieve(String intent) throws StripeException {
676
    return retrieve(intent, (Map<String, Object>) null, (RequestOptions) null);
1✔
677
  }
678

679
  /**
680
   * Retrieves the details of a SetupIntent that has previously been created.
681
   *
682
   * <p>Client-side retrieval using a publishable key is allowed when the {@code client_secret} is
683
   * provided in the query string.
684
   *
685
   * <p>When retrieved with a publishable key, only a subset of properties will be returned. Please
686
   * refer to the <a href="https://stripe.com/docs/api#setup_intent_object">SetupIntent</a> object
687
   * reference for more details.
688
   */
689
  public static SetupIntent retrieve(String intent, RequestOptions options) throws StripeException {
690
    return retrieve(intent, (Map<String, Object>) null, options);
×
691
  }
692

693
  /**
694
   * Retrieves the details of a SetupIntent that has previously been created.
695
   *
696
   * <p>Client-side retrieval using a publishable key is allowed when the {@code client_secret} is
697
   * provided in the query string.
698
   *
699
   * <p>When retrieved with a publishable key, only a subset of properties will be returned. Please
700
   * refer to the <a href="https://stripe.com/docs/api#setup_intent_object">SetupIntent</a> object
701
   * reference for more details.
702
   */
703
  public static SetupIntent retrieve(
704
      String intent, Map<String, Object> params, RequestOptions options) throws StripeException {
705
    String path = String.format("/v1/setup_intents/%s", ApiResource.urlEncodeId(intent));
1✔
706
    ApiRequest request =
1✔
707
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
708
    return getGlobalResponseGetter().request(request, SetupIntent.class);
1✔
709
  }
710

711
  /**
712
   * Retrieves the details of a SetupIntent that has previously been created.
713
   *
714
   * <p>Client-side retrieval using a publishable key is allowed when the {@code client_secret} is
715
   * provided in the query string.
716
   *
717
   * <p>When retrieved with a publishable key, only a subset of properties will be returned. Please
718
   * refer to the <a href="https://stripe.com/docs/api#setup_intent_object">SetupIntent</a> object
719
   * reference for more details.
720
   */
721
  public static SetupIntent retrieve(
722
      String intent, SetupIntentRetrieveParams params, RequestOptions options)
723
      throws StripeException {
724
    String path = String.format("/v1/setup_intents/%s", ApiResource.urlEncodeId(intent));
×
725
    ApiResource.checkNullTypedParams(path, params);
×
726
    ApiRequest request =
×
727
        new ApiRequest(
728
            BaseAddress.API,
729
            ApiResource.RequestMethod.GET,
730
            path,
731
            ApiRequestParams.paramsToMap(params),
×
732
            options);
UNCOV
733
    return getGlobalResponseGetter().request(request, SetupIntent.class);
×
734
  }
735

736
  /** Updates a SetupIntent object. */
737
  @Override
738
  public SetupIntent update(Map<String, Object> params) throws StripeException {
739
    return update(params, (RequestOptions) null);
×
740
  }
741

742
  /** Updates a SetupIntent object. */
743
  @Override
744
  public SetupIntent update(Map<String, Object> params, RequestOptions options)
745
      throws StripeException {
746
    String path = String.format("/v1/setup_intents/%s", ApiResource.urlEncodeId(this.getId()));
×
747
    ApiRequest request =
×
748
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
UNCOV
749
    return getResponseGetter().request(request, SetupIntent.class);
×
750
  }
751

752
  /** Updates a SetupIntent object. */
753
  public SetupIntent update(SetupIntentUpdateParams params) throws StripeException {
754
    return update(params, (RequestOptions) null);
1✔
755
  }
756

757
  /** Updates a SetupIntent object. */
758
  public SetupIntent update(SetupIntentUpdateParams params, RequestOptions options)
759
      throws StripeException {
760
    String path = String.format("/v1/setup_intents/%s", ApiResource.urlEncodeId(this.getId()));
1✔
761
    ApiResource.checkNullTypedParams(path, params);
1✔
762
    ApiRequest request =
1✔
763
        new ApiRequest(
764
            BaseAddress.API,
765
            ApiResource.RequestMethod.POST,
766
            path,
767
            ApiRequestParams.paramsToMap(params),
1✔
768
            options);
769
    return getResponseGetter().request(request, SetupIntent.class);
1✔
770
  }
771

772
  /** Verifies microdeposits on a SetupIntent object. */
773
  public SetupIntent verifyMicrodeposits() throws StripeException {
774
    return verifyMicrodeposits((Map<String, Object>) null, (RequestOptions) null);
×
775
  }
776

777
  /** Verifies microdeposits on a SetupIntent object. */
778
  public SetupIntent verifyMicrodeposits(RequestOptions options) throws StripeException {
779
    return verifyMicrodeposits((Map<String, Object>) null, options);
×
780
  }
781

782
  /** Verifies microdeposits on a SetupIntent object. */
783
  public SetupIntent verifyMicrodeposits(Map<String, Object> params) throws StripeException {
784
    return verifyMicrodeposits(params, (RequestOptions) null);
×
785
  }
786

787
  /** Verifies microdeposits on a SetupIntent object. */
788
  public SetupIntent verifyMicrodeposits(Map<String, Object> params, RequestOptions options)
789
      throws StripeException {
790
    String path =
×
791
        String.format(
×
792
            "/v1/setup_intents/%s/verify_microdeposits", ApiResource.urlEncodeId(this.getId()));
×
793
    ApiRequest request =
×
794
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
UNCOV
795
    return getResponseGetter().request(request, SetupIntent.class);
×
796
  }
797

798
  /** Verifies microdeposits on a SetupIntent object. */
799
  public SetupIntent verifyMicrodeposits(SetupIntentVerifyMicrodepositsParams params)
800
      throws StripeException {
801
    return verifyMicrodeposits(params, (RequestOptions) null);
1✔
802
  }
803

804
  /** Verifies microdeposits on a SetupIntent object. */
805
  public SetupIntent verifyMicrodeposits(
806
      SetupIntentVerifyMicrodepositsParams params, RequestOptions options) throws StripeException {
807
    String path =
1✔
808
        String.format(
1✔
809
            "/v1/setup_intents/%s/verify_microdeposits", ApiResource.urlEncodeId(this.getId()));
1✔
810
    ApiResource.checkNullTypedParams(path, params);
1✔
811
    ApiRequest request =
1✔
812
        new ApiRequest(
813
            BaseAddress.API,
814
            ApiResource.RequestMethod.POST,
815
            path,
816
            ApiRequestParams.paramsToMap(params),
1✔
817
            options);
818
    return getResponseGetter().request(request, SetupIntent.class);
1✔
819
  }
820

821
  @Getter
822
  @Setter
823
  @EqualsAndHashCode(callSuper = false)
824
  public static class AutomaticPaymentMethods extends StripeObject {
×
825
    /**
826
     * Controls whether this SetupIntent will accept redirect-based payment methods.
827
     *
828
     * <p>Redirect-based payment methods may require your customer to be redirected to a payment
829
     * method's app or site for authentication or additional steps. To <a
830
     * href="https://stripe.com/docs/api/setup_intents/confirm">confirm</a> this SetupIntent, you
831
     * may be required to provide a {@code return_url} to redirect customers back to your site after
832
     * they authenticate or complete the setup.
833
     *
834
     * <p>One of {@code always}, or {@code never}.
835
     */
836
    @SerializedName("allow_redirects")
837
    String allowRedirects;
838

839
    /** Automatically calculates compatible payment methods. */
840
    @SerializedName("enabled")
841
    Boolean enabled;
842
  }
843

844
  @Getter
845
  @Setter
846
  @EqualsAndHashCode(callSuper = false)
847
  public static class NextAction extends StripeObject {
×
848
    @SerializedName("cashapp_handle_redirect_or_display_qr_code")
849
    CashappHandleRedirectOrDisplayQrCode cashappHandleRedirectOrDisplayQrCode;
850

851
    @SerializedName("redirect_to_url")
852
    RedirectToUrl redirectToUrl;
853

854
    /**
855
     * Type of the next action to perform, one of {@code redirect_to_url}, {@code use_stripe_sdk},
856
     * {@code alipay_handle_redirect}, {@code oxxo_display_details}, or {@code
857
     * verify_with_microdeposits}.
858
     */
859
    @SerializedName("type")
860
    String type;
861

862
    /**
863
     * When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this
864
     * dictionary to invoke authentication flows. The shape of the contents is subject to change and
865
     * is only intended to be used by Stripe.js.
866
     */
867
    @SerializedName("use_stripe_sdk")
868
    Map<String, Object> useStripeSdk;
869

870
    @SerializedName("verify_with_microdeposits")
871
    VerifyWithMicrodeposits verifyWithMicrodeposits;
872

873
    @Getter
874
    @Setter
875
    @EqualsAndHashCode(callSuper = false)
876
    public static class CashappHandleRedirectOrDisplayQrCode extends StripeObject {
×
877
      /**
878
       * The URL to the hosted Cash App Pay instructions page, which allows customers to view the QR
879
       * code, and supports QR code refreshing on expiration.
880
       */
881
      @SerializedName("hosted_instructions_url")
882
      String hostedInstructionsUrl;
883

884
      /** The url for mobile redirect based auth. */
885
      @SerializedName("mobile_auth_url")
886
      String mobileAuthUrl;
887

888
      @SerializedName("qr_code")
889
      QrCode qrCode;
890

891
      @Getter
892
      @Setter
893
      @EqualsAndHashCode(callSuper = false)
894
      public static class QrCode extends StripeObject {
×
895
        /** The date (unix timestamp) when the QR code expires. */
896
        @SerializedName("expires_at")
897
        Long expiresAt;
898

899
        /** The image_url_png string used to render QR code. */
900
        @SerializedName("image_url_png")
901
        String imageUrlPng;
902

903
        /** The image_url_svg string used to render QR code. */
904
        @SerializedName("image_url_svg")
905
        String imageUrlSvg;
906
      }
907
    }
908

909
    @Getter
910
    @Setter
911
    @EqualsAndHashCode(callSuper = false)
912
    public static class RedirectToUrl extends StripeObject {
×
913
      /**
914
       * If the customer does not exit their browser while authenticating, they will be redirected
915
       * to this specified URL after completion.
916
       */
917
      @SerializedName("return_url")
918
      String returnUrl;
919

920
      /** The URL you must redirect your customer to in order to authenticate. */
921
      @SerializedName("url")
922
      String url;
923
    }
924

925
    @Getter
926
    @Setter
927
    @EqualsAndHashCode(callSuper = false)
928
    public static class VerifyWithMicrodeposits extends StripeObject {
×
929
      /** The timestamp when the microdeposits are expected to land. */
930
      @SerializedName("arrival_date")
931
      Long arrivalDate;
932

933
      /**
934
       * The URL for the hosted verification page, which allows customers to verify their bank
935
       * account.
936
       */
937
      @SerializedName("hosted_verification_url")
938
      String hostedVerificationUrl;
939

940
      /**
941
       * The type of the microdeposit sent to the customer. Used to distinguish between different
942
       * verification methods.
943
       *
944
       * <p>One of {@code amounts}, or {@code descriptor_code}.
945
       */
946
      @SerializedName("microdeposit_type")
947
      String microdepositType;
948
    }
949
  }
950

951
  @Getter
952
  @Setter
953
  @EqualsAndHashCode(callSuper = false)
954
  public static class PaymentMethodConfigurationDetails extends StripeObject implements HasId {
×
955
    /** ID of the payment method configuration used. */
956
    @Getter(onMethod_ = {@Override})
957
    @SerializedName("id")
958
    String id;
959

960
    /** ID of the parent payment method configuration used. */
961
    @SerializedName("parent")
962
    String parent;
963
  }
964

965
  @Getter
966
  @Setter
967
  @EqualsAndHashCode(callSuper = false)
968
  public static class PaymentMethodOptions extends StripeObject {
1✔
969
    @SerializedName("acss_debit")
970
    AcssDebit acssDebit;
971

972
    @SerializedName("amazon_pay")
973
    AmazonPay amazonPay;
974

975
    @SerializedName("bacs_debit")
976
    BacsDebit bacsDebit;
977

978
    @SerializedName("card")
979
    Card card;
980

981
    @SerializedName("card_present")
982
    CardPresent cardPresent;
983

984
    @SerializedName("link")
985
    Link link;
986

987
    @SerializedName("paypal")
988
    Paypal paypal;
989

990
    @SerializedName("payto")
991
    Payto payto;
992

993
    @SerializedName("sepa_debit")
994
    SepaDebit sepaDebit;
995

996
    @SerializedName("us_bank_account")
997
    UsBankAccount usBankAccount;
998

999
    @Getter
1000
    @Setter
1001
    @EqualsAndHashCode(callSuper = false)
1002
    public static class AcssDebit extends StripeObject {
×
1003
      /**
1004
       * Currency supported by the bank account
1005
       *
1006
       * <p>One of {@code cad}, or {@code usd}.
1007
       */
1008
      @SerializedName("currency")
1009
      String currency;
1010

1011
      @SerializedName("mandate_options")
1012
      MandateOptions mandateOptions;
1013

1014
      /**
1015
       * Bank account verification method.
1016
       *
1017
       * <p>One of {@code automatic}, {@code instant}, or {@code microdeposits}.
1018
       */
1019
      @SerializedName("verification_method")
1020
      String verificationMethod;
1021

1022
      @Getter
1023
      @Setter
1024
      @EqualsAndHashCode(callSuper = false)
1025
      public static class MandateOptions extends StripeObject {
×
1026
        /** A URL for custom mandate text. */
1027
        @SerializedName("custom_mandate_url")
1028
        String customMandateUrl;
1029

1030
        /** List of Stripe products where this mandate can be selected automatically. */
1031
        @SerializedName("default_for")
1032
        List<String> defaultFor;
1033

1034
        /**
1035
         * Description of the interval. Only required if the 'payment_schedule' parameter is
1036
         * 'interval' or 'combined'.
1037
         */
1038
        @SerializedName("interval_description")
1039
        String intervalDescription;
1040

1041
        /**
1042
         * Payment schedule for the mandate.
1043
         *
1044
         * <p>One of {@code combined}, {@code interval}, or {@code sporadic}.
1045
         */
1046
        @SerializedName("payment_schedule")
1047
        String paymentSchedule;
1048

1049
        /**
1050
         * Transaction type of the mandate.
1051
         *
1052
         * <p>One of {@code business}, or {@code personal}.
1053
         */
1054
        @SerializedName("transaction_type")
1055
        String transactionType;
1056
      }
1057
    }
1058

1059
    @Getter
1060
    @Setter
1061
    @EqualsAndHashCode(callSuper = false)
1062
    public static class AmazonPay extends StripeObject {}
×
1063

1064
    @Getter
1065
    @Setter
1066
    @EqualsAndHashCode(callSuper = false)
1067
    public static class BacsDebit extends StripeObject {
×
1068
      @SerializedName("mandate_options")
1069
      MandateOptions mandateOptions;
1070

1071
      @Getter
1072
      @Setter
1073
      @EqualsAndHashCode(callSuper = false)
1074
      public static class MandateOptions extends StripeObject {}
×
1075
    }
1076

1077
    @Getter
1078
    @Setter
1079
    @EqualsAndHashCode(callSuper = false)
1080
    public static class Card extends StripeObject {
×
1081
      /** Configuration options for setting up an eMandate for cards issued in India. */
1082
      @SerializedName("mandate_options")
1083
      MandateOptions mandateOptions;
1084

1085
      /**
1086
       * Selected network to process this SetupIntent on. Depends on the available networks of the
1087
       * card attached to the setup intent. Can be only set confirm-time.
1088
       */
1089
      @SerializedName("network")
1090
      String network;
1091

1092
      /**
1093
       * We strongly recommend that you rely on our SCA Engine to automatically prompt your
1094
       * customers for authentication based on risk level and <a
1095
       * href="https://stripe.com/docs/strong-customer-authentication">other requirements</a>.
1096
       * However, if you wish to request 3D Secure based on logic from your own fraud engine,
1097
       * provide this option. If not provided, this value defaults to {@code automatic}. Read our
1098
       * guide on <a
1099
       * href="https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds">manually
1100
       * requesting 3D Secure</a> for more information on how this configuration interacts with
1101
       * Radar and our SCA Engine.
1102
       *
1103
       * <p>One of {@code any}, {@code automatic}, or {@code challenge}.
1104
       */
1105
      @SerializedName("request_three_d_secure")
1106
      String requestThreeDSecure;
1107

1108
      @Getter
1109
      @Setter
1110
      @EqualsAndHashCode(callSuper = false)
1111
      public static class MandateOptions extends StripeObject {
×
1112
        /** Amount to be charged for future payments. */
1113
        @SerializedName("amount")
1114
        Long amount;
1115

1116
        /**
1117
         * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param
1118
         * refers to the exact amount to be charged in future payments. If {@code maximum}, the
1119
         * amount charged can be up to the value passed for the {@code amount} param.
1120
         */
1121
        @SerializedName("amount_type")
1122
        String amountType;
1123

1124
        /**
1125
         * Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency
1126
         * code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported
1127
         * currency</a>.
1128
         */
1129
        @SerializedName("currency")
1130
        String currency;
1131

1132
        /**
1133
         * A description of the mandate or subscription that is meant to be displayed to the
1134
         * customer.
1135
         */
1136
        @SerializedName("description")
1137
        String description;
1138

1139
        /**
1140
         * End date of the mandate or subscription. If not provided, the mandate will be active
1141
         * until canceled. If provided, end date should be after start date.
1142
         */
1143
        @SerializedName("end_date")
1144
        Long endDate;
1145

1146
        /**
1147
         * Specifies payment frequency. One of {@code day}, {@code week}, {@code month}, {@code
1148
         * year}, or {@code sporadic}.
1149
         */
1150
        @SerializedName("interval")
1151
        String interval;
1152

1153
        /**
1154
         * The number of intervals between payments. For example, {@code interval=month} and {@code
1155
         * interval_count=3} indicates one payment every three months. Maximum of one year interval
1156
         * allowed (1 year, 12 months, or 52 weeks). This parameter is optional when {@code
1157
         * interval=sporadic}.
1158
         */
1159
        @SerializedName("interval_count")
1160
        Long intervalCount;
1161

1162
        /** Unique identifier for the mandate or subscription. */
1163
        @SerializedName("reference")
1164
        String reference;
1165

1166
        /**
1167
         * Start date of the mandate or subscription. Start date should not be lesser than
1168
         * yesterday.
1169
         */
1170
        @SerializedName("start_date")
1171
        Long startDate;
1172

1173
        /** Specifies the type of mandates supported. Possible values are {@code india}. */
1174
        @SerializedName("supported_types")
1175
        List<String> supportedTypes;
1176
      }
1177
    }
1178

1179
    @Getter
1180
    @Setter
1181
    @EqualsAndHashCode(callSuper = false)
1182
    public static class CardPresent extends StripeObject {}
×
1183

1184
    @Getter
1185
    @Setter
1186
    @EqualsAndHashCode(callSuper = false)
1187
    public static class Link extends StripeObject {
×
1188
      /** [Deprecated] This is a legacy parameter that no longer has any function. */
1189
      @SerializedName("persistent_token")
1190
      @Deprecated
1191
      String persistentToken;
1192
    }
1193

1194
    @Getter
1195
    @Setter
1196
    @EqualsAndHashCode(callSuper = false)
1197
    public static class Paypal extends StripeObject {
×
1198
      /**
1199
       * The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents
1200
       * the mandate between the merchant and the customer.
1201
       */
1202
      @SerializedName("billing_agreement_id")
1203
      String billingAgreementId;
1204

1205
      /**
1206
       * Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency
1207
       * code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported
1208
       * currency</a>.
1209
       */
1210
      @SerializedName("currency")
1211
      String currency;
1212

1213
      /**
1214
       * The Stripe connected account IDs of the sellers on the platform for this transaction
1215
       * (optional). Only allowed when <a
1216
       * href="https://stripe.com/docs/connect/separate-charges-and-transfers">separate charges and
1217
       * transfers</a> are used.
1218
       */
1219
      @SerializedName("subsellers")
1220
      List<String> subsellers;
1221
    }
1222

1223
    @Getter
1224
    @Setter
1225
    @EqualsAndHashCode(callSuper = false)
1226
    public static class Payto extends StripeObject {
×
1227
      @SerializedName("mandate_options")
1228
      MandateOptions mandateOptions;
1229

1230
      @Getter
1231
      @Setter
1232
      @EqualsAndHashCode(callSuper = false)
1233
      public static class MandateOptions extends StripeObject {
×
1234
        /**
1235
         * Amount that will be collected. It is required when {@code amount_type} is {@code fixed}.
1236
         */
1237
        @SerializedName("amount")
1238
        Long amount;
1239

1240
        /**
1241
         * The type of amount that will be collected. The amount charged must be exact or up to the
1242
         * value of {@code amount} param for {@code fixed} or {@code maximum} type respectively.
1243
         *
1244
         * <p>One of {@code fixed}, or {@code maximum}.
1245
         */
1246
        @SerializedName("amount_type")
1247
        String amountType;
1248

1249
        /**
1250
         * Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no
1251
         * end date.
1252
         */
1253
        @SerializedName("end_date")
1254
        String endDate;
1255

1256
        /**
1257
         * The periodicity at which payments will be collected.
1258
         *
1259
         * <p>One of {@code adhoc}, {@code annual}, {@code daily}, {@code fortnightly}, {@code
1260
         * monthly}, {@code quarterly}, {@code semi_annual}, or {@code weekly}.
1261
         */
1262
        @SerializedName("payment_schedule")
1263
        String paymentSchedule;
1264

1265
        /**
1266
         * The number of payments that will be made during a payment period. Defaults to 1 except
1267
         * for when {@code payment_schedule} is {@code adhoc}. In that case, it defaults to no
1268
         * limit.
1269
         */
1270
        @SerializedName("payments_per_period")
1271
        Long paymentsPerPeriod;
1272

1273
        /**
1274
         * The purpose for which payments are made. Defaults to retail.
1275
         *
1276
         * <p>One of {@code dependant_support}, {@code government}, {@code loan}, {@code mortgage},
1277
         * {@code other}, {@code pension}, {@code personal}, {@code retail}, {@code salary}, {@code
1278
         * tax}, or {@code utility}.
1279
         */
1280
        @SerializedName("purpose")
1281
        String purpose;
1282

1283
        /**
1284
         * Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to
1285
         * confirmation time.
1286
         */
1287
        @SerializedName("start_date")
1288
        String startDate;
1289
      }
1290
    }
1291

1292
    @Getter
1293
    @Setter
1294
    @EqualsAndHashCode(callSuper = false)
1295
    public static class SepaDebit extends StripeObject {
×
1296
      @SerializedName("mandate_options")
1297
      MandateOptions mandateOptions;
1298

1299
      @Getter
1300
      @Setter
1301
      @EqualsAndHashCode(callSuper = false)
1302
      public static class MandateOptions extends StripeObject {}
×
1303
    }
1304

1305
    @Getter
1306
    @Setter
1307
    @EqualsAndHashCode(callSuper = false)
1308
    public static class UsBankAccount extends StripeObject {
×
1309
      @SerializedName("financial_connections")
1310
      FinancialConnections financialConnections;
1311

1312
      @SerializedName("mandate_options")
1313
      MandateOptions mandateOptions;
1314

1315
      /**
1316
       * Bank account verification method.
1317
       *
1318
       * <p>One of {@code automatic}, {@code instant}, or {@code microdeposits}.
1319
       */
1320
      @SerializedName("verification_method")
1321
      String verificationMethod;
1322

1323
      @Getter
1324
      @Setter
1325
      @EqualsAndHashCode(callSuper = false)
1326
      public static class FinancialConnections extends StripeObject {
×
1327
        @SerializedName("filters")
1328
        Filters filters;
1329

1330
        @SerializedName("manual_entry")
1331
        ManualEntry manualEntry;
1332

1333
        /**
1334
         * The list of permissions to request. The {@code payment_method} permission must be
1335
         * included.
1336
         */
1337
        @SerializedName("permissions")
1338
        List<String> permissions;
1339

1340
        /** Data features requested to be retrieved upon account creation. */
1341
        @SerializedName("prefetch")
1342
        List<String> prefetch;
1343

1344
        /**
1345
         * For webview integrations only. Upon completing OAuth login in the native browser, the
1346
         * user will be redirected to this URL to return to your app.
1347
         */
1348
        @SerializedName("return_url")
1349
        String returnUrl;
1350

1351
        @Getter
1352
        @Setter
1353
        @EqualsAndHashCode(callSuper = false)
1354
        public static class Filters extends StripeObject {
×
1355
          /**
1356
           * The account subcategories to use to filter for possible accounts to link. Valid
1357
           * subcategories are {@code checking} and {@code savings}.
1358
           */
1359
          @SerializedName("account_subcategories")
1360
          List<String> accountSubcategories;
1361

1362
          /** The institution to use to filter for possible accounts to link. */
1363
          @SerializedName("institution")
1364
          String institution;
1365
        }
1366

1367
        @Getter
1368
        @Setter
1369
        @EqualsAndHashCode(callSuper = false)
1370
        public static class ManualEntry extends StripeObject {
×
1371
          /**
1372
           * Settings for configuring manual entry of account details.
1373
           *
1374
           * <p>One of {@code automatic}, or {@code custom}.
1375
           */
1376
          @SerializedName("mode")
1377
          String mode;
1378
        }
1379
      }
1380

1381
      @Getter
1382
      @Setter
1383
      @EqualsAndHashCode(callSuper = false)
1384
      public static class MandateOptions extends StripeObject {
×
1385
        /**
1386
         * Mandate collection method
1387
         *
1388
         * <p>Equal to {@code paper}.
1389
         */
1390
        @SerializedName("collection_method")
1391
        String collectionMethod;
1392
      }
1393
    }
1394
  }
1395

1396
  @Override
1397
  public void setResponseGetter(StripeResponseGetter responseGetter) {
1398
    super.setResponseGetter(responseGetter);
1✔
1399
    trySetResponseGetter(application, responseGetter);
1✔
1400
    trySetResponseGetter(automaticPaymentMethods, responseGetter);
1✔
1401
    trySetResponseGetter(customer, responseGetter);
1✔
1402
    trySetResponseGetter(lastSetupError, responseGetter);
1✔
1403
    trySetResponseGetter(latestAttempt, responseGetter);
1✔
1404
    trySetResponseGetter(mandate, responseGetter);
1✔
1405
    trySetResponseGetter(nextAction, responseGetter);
1✔
1406
    trySetResponseGetter(onBehalfOf, responseGetter);
1✔
1407
    trySetResponseGetter(paymentMethod, responseGetter);
1✔
1408
    trySetResponseGetter(paymentMethodConfigurationDetails, responseGetter);
1✔
1409
    trySetResponseGetter(paymentMethodOptions, responseGetter);
1✔
1410
    trySetResponseGetter(singleUseMandate, responseGetter);
1✔
1411
  }
1✔
1412
}
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

© 2026 Coveralls, Inc