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

stripe / stripe-java / #16707

14 Dec 2024 12:12AM UTC coverage: 15.91% (-0.08%) from 15.988%
#16707

Pull #1931

github

web-flow
Merge 90c2dfd77 into cf528f2c8
Pull Request #1931: Update generated code

43 of 1442 new or added lines in 28 files covered. (2.98%)

137 existing lines in 17 files now uncovered.

18625 of 117068 relevant lines covered (15.91%)

0.16 hits per line

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

35.71
/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
  /**
197
   * Information about the <a
198
   * href="https://stripe.com/docs/api/payment_method_configurations">payment method
199
   * configuration</a> used for this Setup Intent.
200
   */
201
  @SerializedName("payment_method_configuration_details")
202
  PaymentMethodConfigurationDetails paymentMethodConfigurationDetails;
203

204
  /** Payment method-specific configuration for this SetupIntent. */
205
  @SerializedName("payment_method_options")
206
  PaymentMethodOptions paymentMethodOptions;
207

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

212
  /** ID of the single_use Mandate generated by the SetupIntent. */
213
  @SerializedName("single_use_mandate")
214
  @Getter(lombok.AccessLevel.NONE)
215
  @Setter(lombok.AccessLevel.NONE)
216
  ExpandableField<Mandate> singleUseMandate;
217

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

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

236
  /** Get ID of expandable {@code application} object. */
237
  public String getApplication() {
238
    return (this.application != null) ? this.application.getId() : null;
×
239
  }
240

241
  public void setApplication(String id) {
242
    this.application = ApiResource.setExpandableFieldId(id, this.application);
×
243
  }
×
244

245
  /** Get expanded {@code application}. */
246
  public Application getApplicationObject() {
247
    return (this.application != null) ? this.application.getExpanded() : null;
×
248
  }
249

250
  public void setApplicationObject(Application expandableObject) {
251
    this.application = new ExpandableField<Application>(expandableObject.getId(), expandableObject);
×
252
  }
×
253

254
  /** Get ID of expandable {@code customer} object. */
255
  public String getCustomer() {
256
    return (this.customer != null) ? this.customer.getId() : null;
×
257
  }
258

259
  public void setCustomer(String id) {
260
    this.customer = ApiResource.setExpandableFieldId(id, this.customer);
×
261
  }
×
262

263
  /** Get expanded {@code customer}. */
264
  public Customer getCustomerObject() {
265
    return (this.customer != null) ? this.customer.getExpanded() : null;
×
266
  }
267

268
  public void setCustomerObject(Customer expandableObject) {
269
    this.customer = new ExpandableField<Customer>(expandableObject.getId(), expandableObject);
×
270
  }
×
271

272
  /** Get ID of expandable {@code latestAttempt} object. */
273
  public String getLatestAttempt() {
274
    return (this.latestAttempt != null) ? this.latestAttempt.getId() : null;
×
275
  }
276

277
  public void setLatestAttempt(String id) {
278
    this.latestAttempt = ApiResource.setExpandableFieldId(id, this.latestAttempt);
×
279
  }
×
280

281
  /** Get expanded {@code latestAttempt}. */
282
  public SetupAttempt getLatestAttemptObject() {
283
    return (this.latestAttempt != null) ? this.latestAttempt.getExpanded() : null;
×
284
  }
285

286
  public void setLatestAttemptObject(SetupAttempt expandableObject) {
287
    this.latestAttempt =
×
288
        new ExpandableField<SetupAttempt>(expandableObject.getId(), expandableObject);
×
289
  }
×
290

291
  /** Get ID of expandable {@code mandate} object. */
292
  public String getMandate() {
293
    return (this.mandate != null) ? this.mandate.getId() : null;
×
294
  }
295

296
  public void setMandate(String id) {
297
    this.mandate = ApiResource.setExpandableFieldId(id, this.mandate);
×
298
  }
×
299

300
  /** Get expanded {@code mandate}. */
301
  public Mandate getMandateObject() {
302
    return (this.mandate != null) ? this.mandate.getExpanded() : null;
×
303
  }
304

305
  public void setMandateObject(Mandate expandableObject) {
306
    this.mandate = new ExpandableField<Mandate>(expandableObject.getId(), expandableObject);
×
307
  }
×
308

309
  /** Get ID of expandable {@code onBehalfOf} object. */
310
  public String getOnBehalfOf() {
311
    return (this.onBehalfOf != null) ? this.onBehalfOf.getId() : null;
×
312
  }
313

314
  public void setOnBehalfOf(String id) {
315
    this.onBehalfOf = ApiResource.setExpandableFieldId(id, this.onBehalfOf);
×
316
  }
×
317

318
  /** Get expanded {@code onBehalfOf}. */
319
  public Account getOnBehalfOfObject() {
320
    return (this.onBehalfOf != null) ? this.onBehalfOf.getExpanded() : null;
×
321
  }
322

323
  public void setOnBehalfOfObject(Account expandableObject) {
324
    this.onBehalfOf = new ExpandableField<Account>(expandableObject.getId(), expandableObject);
×
325
  }
×
326

327
  /** Get ID of expandable {@code paymentMethod} object. */
328
  public String getPaymentMethod() {
329
    return (this.paymentMethod != null) ? this.paymentMethod.getId() : null;
×
330
  }
331

332
  public void setPaymentMethod(String id) {
333
    this.paymentMethod = ApiResource.setExpandableFieldId(id, this.paymentMethod);
×
334
  }
×
335

336
  /** Get expanded {@code paymentMethod}. */
337
  public PaymentMethod getPaymentMethodObject() {
338
    return (this.paymentMethod != null) ? this.paymentMethod.getExpanded() : null;
×
339
  }
340

341
  public void setPaymentMethodObject(PaymentMethod expandableObject) {
342
    this.paymentMethod =
×
343
        new ExpandableField<PaymentMethod>(expandableObject.getId(), expandableObject);
×
344
  }
×
345

346
  /** Get ID of expandable {@code singleUseMandate} object. */
347
  public String getSingleUseMandate() {
348
    return (this.singleUseMandate != null) ? this.singleUseMandate.getId() : null;
×
349
  }
350

351
  public void setSingleUseMandate(String id) {
352
    this.singleUseMandate = ApiResource.setExpandableFieldId(id, this.singleUseMandate);
×
353
  }
×
354

355
  /** Get expanded {@code singleUseMandate}. */
356
  public Mandate getSingleUseMandateObject() {
357
    return (this.singleUseMandate != null) ? this.singleUseMandate.getExpanded() : null;
×
358
  }
359

360
  public void setSingleUseMandateObject(Mandate expandableObject) {
361
    this.singleUseMandate =
×
362
        new ExpandableField<Mandate>(expandableObject.getId(), expandableObject);
×
363
  }
×
364

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

635
  /** Returns a list of SetupIntents. */
636
  public static SetupIntentCollection list(Map<String, Object> params) throws StripeException {
637
    return list(params, (RequestOptions) null);
×
638
  }
639

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

649
  /** Returns a list of SetupIntents. */
650
  public static SetupIntentCollection list(SetupIntentListParams params) throws StripeException {
651
    return list(params, (RequestOptions) null);
1✔
652
  }
653

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

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

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

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

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

740
  /** Updates a SetupIntent object. */
741
  @Override
742
  public SetupIntent update(Map<String, Object> params) throws StripeException {
743
    return update(params, (RequestOptions) null);
×
744
  }
745

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

756
  /** Updates a SetupIntent object. */
757
  public SetupIntent update(SetupIntentUpdateParams params) throws StripeException {
758
    return update(params, (RequestOptions) null);
1✔
759
  }
760

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

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

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

786
  /** Verifies microdeposits on a SetupIntent object. */
787
  public SetupIntent verifyMicrodeposits(Map<String, Object> params) throws StripeException {
788
    return verifyMicrodeposits(params, (RequestOptions) null);
×
789
  }
790

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

802
  /** Verifies microdeposits on a SetupIntent object. */
803
  public SetupIntent verifyMicrodeposits(SetupIntentVerifyMicrodepositsParams params)
804
      throws StripeException {
805
    return verifyMicrodeposits(params, (RequestOptions) null);
1✔
806
  }
807

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

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

847
    /** Automatically calculates compatible payment methods. */
848
    @SerializedName("enabled")
849
    Boolean enabled;
850
  }
851

852
  /**
853
   * For more details about NextAction, please refer to the <a
854
   * href="https://docs.stripe.com/api">API Reference.</a>
855
   */
856
  @Getter
857
  @Setter
858
  @EqualsAndHashCode(callSuper = false)
859
  public static class NextAction extends StripeObject {
×
860
    @SerializedName("cashapp_handle_redirect_or_display_qr_code")
861
    CashappHandleRedirectOrDisplayQrCode cashappHandleRedirectOrDisplayQrCode;
862

863
    @SerializedName("redirect_to_url")
864
    RedirectToUrl redirectToUrl;
865

866
    /**
867
     * Type of the next action to perform, one of {@code redirect_to_url}, {@code use_stripe_sdk},
868
     * {@code alipay_handle_redirect}, {@code oxxo_display_details}, or {@code
869
     * verify_with_microdeposits}.
870
     */
871
    @SerializedName("type")
872
    String type;
873

874
    /**
875
     * When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this
876
     * dictionary to invoke authentication flows. The shape of the contents is subject to change and
877
     * is only intended to be used by Stripe.js.
878
     */
879
    @SerializedName("use_stripe_sdk")
880
    Map<String, Object> useStripeSdk;
881

882
    @SerializedName("verify_with_microdeposits")
883
    VerifyWithMicrodeposits verifyWithMicrodeposits;
884

885
    /**
886
     * For more details about CashappHandleRedirectOrDisplayQrCode, please refer to the <a
887
     * href="https://docs.stripe.com/api">API Reference.</a>
888
     */
889
    @Getter
890
    @Setter
891
    @EqualsAndHashCode(callSuper = false)
892
    public static class CashappHandleRedirectOrDisplayQrCode extends StripeObject {
×
893
      /**
894
       * The URL to the hosted Cash App Pay instructions page, which allows customers to view the QR
895
       * code, and supports QR code refreshing on expiration.
896
       */
897
      @SerializedName("hosted_instructions_url")
898
      String hostedInstructionsUrl;
899

900
      /** The url for mobile redirect based auth. */
901
      @SerializedName("mobile_auth_url")
902
      String mobileAuthUrl;
903

904
      @SerializedName("qr_code")
905
      QrCode qrCode;
906

907
      /**
908
       * For more details about QrCode, please refer to the <a
909
       * href="https://docs.stripe.com/api">API Reference.</a>
910
       */
911
      @Getter
912
      @Setter
913
      @EqualsAndHashCode(callSuper = false)
914
      public static class QrCode extends StripeObject {
×
915
        /** The date (unix timestamp) when the QR code expires. */
916
        @SerializedName("expires_at")
917
        Long expiresAt;
918

919
        /** The image_url_png string used to render QR code. */
920
        @SerializedName("image_url_png")
921
        String imageUrlPng;
922

923
        /** The image_url_svg string used to render QR code. */
924
        @SerializedName("image_url_svg")
925
        String imageUrlSvg;
926
      }
927
    }
928

929
    /**
930
     * For more details about RedirectToUrl, please refer to the <a
931
     * href="https://docs.stripe.com/api">API Reference.</a>
932
     */
933
    @Getter
934
    @Setter
935
    @EqualsAndHashCode(callSuper = false)
936
    public static class RedirectToUrl extends StripeObject {
×
937
      /**
938
       * If the customer does not exit their browser while authenticating, they will be redirected
939
       * to this specified URL after completion.
940
       */
941
      @SerializedName("return_url")
942
      String returnUrl;
943

944
      /** The URL you must redirect your customer to in order to authenticate. */
945
      @SerializedName("url")
946
      String url;
947
    }
948

949
    /**
950
     * For more details about VerifyWithMicrodeposits, please refer to the <a
951
     * href="https://docs.stripe.com/api">API Reference.</a>
952
     */
953
    @Getter
954
    @Setter
955
    @EqualsAndHashCode(callSuper = false)
956
    public static class VerifyWithMicrodeposits extends StripeObject {
×
957
      /** The timestamp when the microdeposits are expected to land. */
958
      @SerializedName("arrival_date")
959
      Long arrivalDate;
960

961
      /**
962
       * The URL for the hosted verification page, which allows customers to verify their bank
963
       * account.
964
       */
965
      @SerializedName("hosted_verification_url")
966
      String hostedVerificationUrl;
967

968
      /**
969
       * The type of the microdeposit sent to the customer. Used to distinguish between different
970
       * verification methods.
971
       *
972
       * <p>One of {@code amounts}, or {@code descriptor_code}.
973
       */
974
      @SerializedName("microdeposit_type")
975
      String microdepositType;
976
    }
977
  }
978

979
  /**
980
   * For more details about PaymentMethodConfigurationDetails, please refer to the <a
981
   * href="https://docs.stripe.com/api">API Reference.</a>
982
   */
983
  @Getter
984
  @Setter
985
  @EqualsAndHashCode(callSuper = false)
986
  public static class PaymentMethodConfigurationDetails extends StripeObject implements HasId {
×
987
    /** ID of the payment method configuration used. */
988
    @Getter(onMethod_ = {@Override})
989
    @SerializedName("id")
990
    String id;
991

992
    /** ID of the parent payment method configuration used. */
993
    @SerializedName("parent")
994
    String parent;
995
  }
996

997
  /**
998
   * For more details about PaymentMethodOptions, please refer to the <a
999
   * href="https://docs.stripe.com/api">API Reference.</a>
1000
   */
1001
  @Getter
1002
  @Setter
1003
  @EqualsAndHashCode(callSuper = false)
1004
  public static class PaymentMethodOptions extends StripeObject {
1✔
1005
    @SerializedName("acss_debit")
1006
    AcssDebit acssDebit;
1007

1008
    @SerializedName("amazon_pay")
1009
    AmazonPay amazonPay;
1010

1011
    @SerializedName("bacs_debit")
1012
    BacsDebit bacsDebit;
1013

1014
    @SerializedName("card")
1015
    Card card;
1016

1017
    @SerializedName("card_present")
1018
    CardPresent cardPresent;
1019

1020
    @SerializedName("link")
1021
    Link link;
1022

1023
    @SerializedName("paypal")
1024
    Paypal paypal;
1025

1026
    @SerializedName("sepa_debit")
1027
    SepaDebit sepaDebit;
1028

1029
    @SerializedName("us_bank_account")
1030
    UsBankAccount usBankAccount;
1031

1032
    /**
1033
     * For more details about AcssDebit, please refer to the <a
1034
     * href="https://docs.stripe.com/api">API Reference.</a>
1035
     */
1036
    @Getter
1037
    @Setter
1038
    @EqualsAndHashCode(callSuper = false)
1039
    public static class AcssDebit extends StripeObject {
×
1040
      /**
1041
       * Currency supported by the bank account
1042
       *
1043
       * <p>One of {@code cad}, or {@code usd}.
1044
       */
1045
      @SerializedName("currency")
1046
      String currency;
1047

1048
      @SerializedName("mandate_options")
1049
      MandateOptions mandateOptions;
1050

1051
      /**
1052
       * Bank account verification method.
1053
       *
1054
       * <p>One of {@code automatic}, {@code instant}, or {@code microdeposits}.
1055
       */
1056
      @SerializedName("verification_method")
1057
      String verificationMethod;
1058

1059
      /**
1060
       * For more details about MandateOptions, please refer to the <a
1061
       * href="https://docs.stripe.com/api">API Reference.</a>
1062
       */
1063
      @Getter
1064
      @Setter
1065
      @EqualsAndHashCode(callSuper = false)
1066
      public static class MandateOptions extends StripeObject {
×
1067
        /** A URL for custom mandate text. */
1068
        @SerializedName("custom_mandate_url")
1069
        String customMandateUrl;
1070

1071
        /** List of Stripe products where this mandate can be selected automatically. */
1072
        @SerializedName("default_for")
1073
        List<String> defaultFor;
1074

1075
        /**
1076
         * Description of the interval. Only required if the 'payment_schedule' parameter is
1077
         * 'interval' or 'combined'.
1078
         */
1079
        @SerializedName("interval_description")
1080
        String intervalDescription;
1081

1082
        /**
1083
         * Payment schedule for the mandate.
1084
         *
1085
         * <p>One of {@code combined}, {@code interval}, or {@code sporadic}.
1086
         */
1087
        @SerializedName("payment_schedule")
1088
        String paymentSchedule;
1089

1090
        /**
1091
         * Transaction type of the mandate.
1092
         *
1093
         * <p>One of {@code business}, or {@code personal}.
1094
         */
1095
        @SerializedName("transaction_type")
1096
        String transactionType;
1097
      }
1098
    }
1099

1100
    /**
1101
     * For more details about AmazonPay, please refer to the <a
1102
     * href="https://docs.stripe.com/api">API Reference.</a>
1103
     */
1104
    @Getter
1105
    @Setter
1106
    @EqualsAndHashCode(callSuper = false)
1107
    public static class AmazonPay extends StripeObject {}
×
1108

1109
    /**
1110
     * For more details about BacsDebit, please refer to the <a
1111
     * href="https://docs.stripe.com/api">API Reference.</a>
1112
     */
1113
    @Getter
1114
    @Setter
1115
    @EqualsAndHashCode(callSuper = false)
1116
    public static class BacsDebit extends StripeObject {
×
1117
      @SerializedName("mandate_options")
1118
      MandateOptions mandateOptions;
1119

1120
      /**
1121
       * For more details about MandateOptions, please refer to the <a
1122
       * href="https://docs.stripe.com/api">API Reference.</a>
1123
       */
1124
      @Getter
1125
      @Setter
1126
      @EqualsAndHashCode(callSuper = false)
NEW
1127
      public static class MandateOptions extends StripeObject {
×
1128
        /**
1129
         * Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must
1130
         * consist of only uppercase letters, numbers, spaces, or the following special characters:
1131
         * '/', '_', '-', '&amp;', '.'. Cannot begin with 'DDIC' or 'STRIPE'.
1132
         */
1133
        @SerializedName("reference_prefix")
1134
        String referencePrefix;
1135
      }
1136
    }
1137

1138
    /**
1139
     * For more details about Card, please refer to the <a href="https://docs.stripe.com/api">API
1140
     * Reference.</a>
1141
     */
1142
    @Getter
1143
    @Setter
1144
    @EqualsAndHashCode(callSuper = false)
1145
    public static class Card extends StripeObject {
×
1146
      /** Configuration options for setting up an eMandate for cards issued in India. */
1147
      @SerializedName("mandate_options")
1148
      MandateOptions mandateOptions;
1149

1150
      /**
1151
       * Selected network to process this SetupIntent on. Depends on the available networks of the
1152
       * card attached to the setup intent. Can be only set confirm-time.
1153
       */
1154
      @SerializedName("network")
1155
      String network;
1156

1157
      /**
1158
       * We strongly recommend that you rely on our SCA Engine to automatically prompt your
1159
       * customers for authentication based on risk level and <a
1160
       * href="https://stripe.com/docs/strong-customer-authentication">other requirements</a>.
1161
       * However, if you wish to request 3D Secure based on logic from your own fraud engine,
1162
       * provide this option. If not provided, this value defaults to {@code automatic}. Read our
1163
       * guide on <a
1164
       * href="https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds">manually
1165
       * requesting 3D Secure</a> for more information on how this configuration interacts with
1166
       * Radar and our SCA Engine.
1167
       *
1168
       * <p>One of {@code any}, {@code automatic}, or {@code challenge}.
1169
       */
1170
      @SerializedName("request_three_d_secure")
1171
      String requestThreeDSecure;
1172

1173
      /**
1174
       * For more details about MandateOptions, please refer to the <a
1175
       * href="https://docs.stripe.com/api">API Reference.</a>
1176
       */
1177
      @Getter
1178
      @Setter
1179
      @EqualsAndHashCode(callSuper = false)
1180
      public static class MandateOptions extends StripeObject {
×
1181
        /** Amount to be charged for future payments. */
1182
        @SerializedName("amount")
1183
        Long amount;
1184

1185
        /**
1186
         * One of {@code fixed} or {@code maximum}. If {@code fixed}, the {@code amount} param
1187
         * refers to the exact amount to be charged in future payments. If {@code maximum}, the
1188
         * amount charged can be up to the value passed for the {@code amount} param.
1189
         */
1190
        @SerializedName("amount_type")
1191
        String amountType;
1192

1193
        /**
1194
         * Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency
1195
         * code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported
1196
         * currency</a>.
1197
         */
1198
        @SerializedName("currency")
1199
        String currency;
1200

1201
        /**
1202
         * A description of the mandate or subscription that is meant to be displayed to the
1203
         * customer.
1204
         */
1205
        @SerializedName("description")
1206
        String description;
1207

1208
        /**
1209
         * End date of the mandate or subscription. If not provided, the mandate will be active
1210
         * until canceled. If provided, end date should be after start date.
1211
         */
1212
        @SerializedName("end_date")
1213
        Long endDate;
1214

1215
        /**
1216
         * Specifies payment frequency. One of {@code day}, {@code week}, {@code month}, {@code
1217
         * year}, or {@code sporadic}.
1218
         */
1219
        @SerializedName("interval")
1220
        String interval;
1221

1222
        /**
1223
         * The number of intervals between payments. For example, {@code interval=month} and {@code
1224
         * interval_count=3} indicates one payment every three months. Maximum of one year interval
1225
         * allowed (1 year, 12 months, or 52 weeks). This parameter is optional when {@code
1226
         * interval=sporadic}.
1227
         */
1228
        @SerializedName("interval_count")
1229
        Long intervalCount;
1230

1231
        /** Unique identifier for the mandate or subscription. */
1232
        @SerializedName("reference")
1233
        String reference;
1234

1235
        /**
1236
         * Start date of the mandate or subscription. Start date should not be lesser than
1237
         * yesterday.
1238
         */
1239
        @SerializedName("start_date")
1240
        Long startDate;
1241

1242
        /** Specifies the type of mandates supported. Possible values are {@code india}. */
1243
        @SerializedName("supported_types")
1244
        List<String> supportedTypes;
1245
      }
1246
    }
1247

1248
    /**
1249
     * For more details about CardPresent, please refer to the <a
1250
     * href="https://docs.stripe.com/api">API Reference.</a>
1251
     */
1252
    @Getter
1253
    @Setter
1254
    @EqualsAndHashCode(callSuper = false)
1255
    public static class CardPresent extends StripeObject {}
×
1256

1257
    /**
1258
     * For more details about Link, please refer to the <a href="https://docs.stripe.com/api">API
1259
     * Reference.</a>
1260
     */
1261
    @Getter
1262
    @Setter
1263
    @EqualsAndHashCode(callSuper = false)
1264
    public static class Link extends StripeObject {
×
1265
      /** [Deprecated] This is a legacy parameter that no longer has any function. */
1266
      @SerializedName("persistent_token")
1267
      @Deprecated
1268
      String persistentToken;
1269
    }
1270

1271
    /**
1272
     * For more details about Paypal, please refer to the <a href="https://docs.stripe.com/api">API
1273
     * Reference.</a>
1274
     */
1275
    @Getter
1276
    @Setter
1277
    @EqualsAndHashCode(callSuper = false)
1278
    public static class Paypal extends StripeObject {
×
1279
      /**
1280
       * The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents
1281
       * the mandate between the merchant and the customer.
1282
       */
1283
      @SerializedName("billing_agreement_id")
1284
      String billingAgreementId;
1285
    }
1286

1287
    /**
1288
     * For more details about SepaDebit, please refer to the <a
1289
     * href="https://docs.stripe.com/api">API Reference.</a>
1290
     */
1291
    @Getter
1292
    @Setter
1293
    @EqualsAndHashCode(callSuper = false)
1294
    public static class SepaDebit extends StripeObject {
×
1295
      @SerializedName("mandate_options")
1296
      MandateOptions mandateOptions;
1297

1298
      /**
1299
       * For more details about MandateOptions, please refer to the <a
1300
       * href="https://docs.stripe.com/api">API Reference.</a>
1301
       */
1302
      @Getter
1303
      @Setter
1304
      @EqualsAndHashCode(callSuper = false)
NEW
1305
      public static class MandateOptions extends StripeObject {
×
1306
        /**
1307
         * Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must
1308
         * consist of only uppercase letters, numbers, spaces, or the following special characters:
1309
         * '/', '_', '-', '&amp;', '.'. Cannot begin with 'STRIPE'.
1310
         */
1311
        @SerializedName("reference_prefix")
1312
        String referencePrefix;
1313
      }
1314
    }
1315

1316
    /**
1317
     * For more details about UsBankAccount, please refer to the <a
1318
     * href="https://docs.stripe.com/api">API Reference.</a>
1319
     */
1320
    @Getter
1321
    @Setter
1322
    @EqualsAndHashCode(callSuper = false)
1323
    public static class UsBankAccount extends StripeObject {
×
1324
      @SerializedName("financial_connections")
1325
      FinancialConnections financialConnections;
1326

1327
      @SerializedName("mandate_options")
1328
      MandateOptions mandateOptions;
1329

1330
      /**
1331
       * Bank account verification method.
1332
       *
1333
       * <p>One of {@code automatic}, {@code instant}, or {@code microdeposits}.
1334
       */
1335
      @SerializedName("verification_method")
1336
      String verificationMethod;
1337

1338
      /**
1339
       * For more details about FinancialConnections, please refer to the <a
1340
       * href="https://docs.stripe.com/api">API Reference.</a>
1341
       */
1342
      @Getter
1343
      @Setter
1344
      @EqualsAndHashCode(callSuper = false)
1345
      public static class FinancialConnections extends StripeObject {
×
1346
        @SerializedName("filters")
1347
        Filters filters;
1348

1349
        /**
1350
         * The list of permissions to request. The {@code payment_method} permission must be
1351
         * included.
1352
         */
1353
        @SerializedName("permissions")
1354
        List<String> permissions;
1355

1356
        /** Data features requested to be retrieved upon account creation. */
1357
        @SerializedName("prefetch")
1358
        List<String> prefetch;
1359

1360
        /**
1361
         * For webview integrations only. Upon completing OAuth login in the native browser, the
1362
         * user will be redirected to this URL to return to your app.
1363
         */
1364
        @SerializedName("return_url")
1365
        String returnUrl;
1366

1367
        /**
1368
         * For more details about Filters, please refer to the <a
1369
         * href="https://docs.stripe.com/api">API Reference.</a>
1370
         */
1371
        @Getter
1372
        @Setter
1373
        @EqualsAndHashCode(callSuper = false)
1374
        public static class Filters extends StripeObject {
×
1375
          /**
1376
           * The account subcategories to use to filter for possible accounts to link. Valid
1377
           * subcategories are {@code checking} and {@code savings}.
1378
           */
1379
          @SerializedName("account_subcategories")
1380
          List<String> accountSubcategories;
1381
        }
1382
      }
1383

1384
      /**
1385
       * For more details about MandateOptions, please refer to the <a
1386
       * href="https://docs.stripe.com/api">API Reference.</a>
1387
       */
1388
      @Getter
1389
      @Setter
1390
      @EqualsAndHashCode(callSuper = false)
1391
      public static class MandateOptions extends StripeObject {
×
1392
        /**
1393
         * Mandate collection method
1394
         *
1395
         * <p>Equal to {@code paper}.
1396
         */
1397
        @SerializedName("collection_method")
1398
        String collectionMethod;
1399
      }
1400
    }
1401
  }
1402

1403
  @Override
1404
  public void setResponseGetter(StripeResponseGetter responseGetter) {
1405
    super.setResponseGetter(responseGetter);
1✔
1406
    trySetResponseGetter(application, responseGetter);
1✔
1407
    trySetResponseGetter(automaticPaymentMethods, responseGetter);
1✔
1408
    trySetResponseGetter(customer, responseGetter);
1✔
1409
    trySetResponseGetter(lastSetupError, responseGetter);
1✔
1410
    trySetResponseGetter(latestAttempt, responseGetter);
1✔
1411
    trySetResponseGetter(mandate, responseGetter);
1✔
1412
    trySetResponseGetter(nextAction, responseGetter);
1✔
1413
    trySetResponseGetter(onBehalfOf, responseGetter);
1✔
1414
    trySetResponseGetter(paymentMethod, responseGetter);
1✔
1415
    trySetResponseGetter(paymentMethodConfigurationDetails, responseGetter);
1✔
1416
    trySetResponseGetter(paymentMethodOptions, responseGetter);
1✔
1417
    trySetResponseGetter(singleUseMandate, responseGetter);
1✔
1418
  }
1✔
1419
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc