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

stripe / stripe-java / #16673

05 Dec 2024 09:19PM UTC coverage: 12.391% (-0.009%) from 12.4%
#16673

push

github

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

Update generated code for beta

1 of 148 new or added lines in 16 files covered. (0.68%)

16 existing lines in 9 files now uncovered.

18861 of 152217 relevant lines covered (12.39%)

0.12 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
  /**
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("payto")
1027
    Payto payto;
1028

1029
    @SerializedName("sepa_debit")
1030
    SepaDebit sepaDebit;
1031

1032
    @SerializedName("us_bank_account")
1033
    UsBankAccount usBankAccount;
1034

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

1051
      @SerializedName("mandate_options")
1052
      MandateOptions mandateOptions;
1053

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

1234
        /** Unique identifier for the mandate or subscription. */
1235
        @SerializedName("reference")
1236
        String reference;
1237

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

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

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

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

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

1289
      /**
1290
       * Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency
1291
       * code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported
1292
       * currency</a>.
1293
       */
1294
      @SerializedName("currency")
1295
      String currency;
1296

1297
      /**
1298
       * The Stripe connected account IDs of the sellers on the platform for this transaction
1299
       * (optional). Only allowed when <a
1300
       * href="https://stripe.com/docs/connect/separate-charges-and-transfers">separate charges and
1301
       * transfers</a> are used.
1302
       */
1303
      @SerializedName("subsellers")
1304
      List<String> subsellers;
1305
    }
1306

1307
    /**
1308
     * For more details about Payto, please refer to the <a href="https://docs.stripe.com/api">API
1309
     * Reference.</a>
1310
     */
1311
    @Getter
1312
    @Setter
1313
    @EqualsAndHashCode(callSuper = false)
1314
    public static class Payto extends StripeObject {
×
1315
      @SerializedName("mandate_options")
1316
      MandateOptions mandateOptions;
1317

1318
      /**
1319
       * For more details about MandateOptions, please refer to the <a
1320
       * href="https://docs.stripe.com/api">API Reference.</a>
1321
       */
1322
      @Getter
1323
      @Setter
1324
      @EqualsAndHashCode(callSuper = false)
1325
      public static class MandateOptions extends StripeObject {
×
1326
        /**
1327
         * Amount that will be collected. It is required when {@code amount_type} is {@code fixed}.
1328
         */
1329
        @SerializedName("amount")
1330
        Long amount;
1331

1332
        /**
1333
         * The type of amount that will be collected. The amount charged must be exact or up to the
1334
         * value of {@code amount} param for {@code fixed} or {@code maximum} type respectively.
1335
         *
1336
         * <p>One of {@code fixed}, or {@code maximum}.
1337
         */
1338
        @SerializedName("amount_type")
1339
        String amountType;
1340

1341
        /**
1342
         * Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no
1343
         * end date.
1344
         */
1345
        @SerializedName("end_date")
1346
        String endDate;
1347

1348
        /**
1349
         * The periodicity at which payments will be collected.
1350
         *
1351
         * <p>One of {@code adhoc}, {@code annual}, {@code daily}, {@code fortnightly}, {@code
1352
         * monthly}, {@code quarterly}, {@code semi_annual}, or {@code weekly}.
1353
         */
1354
        @SerializedName("payment_schedule")
1355
        String paymentSchedule;
1356

1357
        /**
1358
         * The number of payments that will be made during a payment period. Defaults to 1 except
1359
         * for when {@code payment_schedule} is {@code adhoc}. In that case, it defaults to no
1360
         * limit.
1361
         */
1362
        @SerializedName("payments_per_period")
1363
        Long paymentsPerPeriod;
1364

1365
        /**
1366
         * The purpose for which payments are made. Defaults to retail.
1367
         *
1368
         * <p>One of {@code dependant_support}, {@code government}, {@code loan}, {@code mortgage},
1369
         * {@code other}, {@code pension}, {@code personal}, {@code retail}, {@code salary}, {@code
1370
         * tax}, or {@code utility}.
1371
         */
1372
        @SerializedName("purpose")
1373
        String purpose;
1374

1375
        /**
1376
         * Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to
1377
         * confirmation time.
1378
         */
1379
        @SerializedName("start_date")
1380
        String startDate;
1381
      }
1382
    }
1383

1384
    /**
1385
     * For more details about SepaDebit, 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 SepaDebit extends StripeObject {
×
1392
      @SerializedName("mandate_options")
1393
      MandateOptions mandateOptions;
1394

1395
      /**
1396
       * For more details about MandateOptions, please refer to the <a
1397
       * href="https://docs.stripe.com/api">API Reference.</a>
1398
       */
1399
      @Getter
1400
      @Setter
1401
      @EqualsAndHashCode(callSuper = false)
NEW
1402
      public static class MandateOptions extends StripeObject {
×
1403
        /**
1404
         * Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must
1405
         * consist of only uppercase letters, numbers, spaces, or the following special characters:
1406
         * '/', '_', '-', '&amp;', '.'. Cannot begin with 'STRIPE'.
1407
         */
1408
        @SerializedName("reference_prefix")
1409
        String referencePrefix;
1410
      }
1411
    }
1412

1413
    /**
1414
     * For more details about UsBankAccount, please refer to the <a
1415
     * href="https://docs.stripe.com/api">API Reference.</a>
1416
     */
1417
    @Getter
1418
    @Setter
1419
    @EqualsAndHashCode(callSuper = false)
1420
    public static class UsBankAccount extends StripeObject {
×
1421
      @SerializedName("financial_connections")
1422
      FinancialConnections financialConnections;
1423

1424
      @SerializedName("mandate_options")
1425
      MandateOptions mandateOptions;
1426

1427
      /**
1428
       * Bank account verification method.
1429
       *
1430
       * <p>One of {@code automatic}, {@code instant}, or {@code microdeposits}.
1431
       */
1432
      @SerializedName("verification_method")
1433
      String verificationMethod;
1434

1435
      /**
1436
       * For more details about FinancialConnections, please refer to the <a
1437
       * href="https://docs.stripe.com/api">API Reference.</a>
1438
       */
1439
      @Getter
1440
      @Setter
1441
      @EqualsAndHashCode(callSuper = false)
1442
      public static class FinancialConnections extends StripeObject {
×
1443
        @SerializedName("filters")
1444
        Filters filters;
1445

1446
        @SerializedName("manual_entry")
1447
        ManualEntry manualEntry;
1448

1449
        /**
1450
         * The list of permissions to request. The {@code payment_method} permission must be
1451
         * included.
1452
         */
1453
        @SerializedName("permissions")
1454
        List<String> permissions;
1455

1456
        /** Data features requested to be retrieved upon account creation. */
1457
        @SerializedName("prefetch")
1458
        List<String> prefetch;
1459

1460
        /**
1461
         * For webview integrations only. Upon completing OAuth login in the native browser, the
1462
         * user will be redirected to this URL to return to your app.
1463
         */
1464
        @SerializedName("return_url")
1465
        String returnUrl;
1466

1467
        /**
1468
         * For more details about Filters, please refer to the <a
1469
         * href="https://docs.stripe.com/api">API Reference.</a>
1470
         */
1471
        @Getter
1472
        @Setter
1473
        @EqualsAndHashCode(callSuper = false)
1474
        public static class Filters extends StripeObject {
×
1475
          /**
1476
           * The account subcategories to use to filter for possible accounts to link. Valid
1477
           * subcategories are {@code checking} and {@code savings}.
1478
           */
1479
          @SerializedName("account_subcategories")
1480
          List<String> accountSubcategories;
1481

1482
          /** The institution to use to filter for possible accounts to link. */
1483
          @SerializedName("institution")
1484
          String institution;
1485
        }
1486

1487
        /**
1488
         * For more details about ManualEntry, please refer to the <a
1489
         * href="https://docs.stripe.com/api">API Reference.</a>
1490
         */
1491
        @Getter
1492
        @Setter
1493
        @EqualsAndHashCode(callSuper = false)
1494
        public static class ManualEntry extends StripeObject {
×
1495
          /**
1496
           * Settings for configuring manual entry of account details.
1497
           *
1498
           * <p>One of {@code automatic}, or {@code custom}.
1499
           */
1500
          @SerializedName("mode")
1501
          String mode;
1502
        }
1503
      }
1504

1505
      /**
1506
       * For more details about MandateOptions, please refer to the <a
1507
       * href="https://docs.stripe.com/api">API Reference.</a>
1508
       */
1509
      @Getter
1510
      @Setter
1511
      @EqualsAndHashCode(callSuper = false)
1512
      public static class MandateOptions extends StripeObject {
×
1513
        /**
1514
         * Mandate collection method
1515
         *
1516
         * <p>Equal to {@code paper}.
1517
         */
1518
        @SerializedName("collection_method")
1519
        String collectionMethod;
1520
      }
1521
    }
1522
  }
1523

1524
  @Override
1525
  public void setResponseGetter(StripeResponseGetter responseGetter) {
1526
    super.setResponseGetter(responseGetter);
1✔
1527
    trySetResponseGetter(application, responseGetter);
1✔
1528
    trySetResponseGetter(automaticPaymentMethods, responseGetter);
1✔
1529
    trySetResponseGetter(customer, responseGetter);
1✔
1530
    trySetResponseGetter(lastSetupError, responseGetter);
1✔
1531
    trySetResponseGetter(latestAttempt, responseGetter);
1✔
1532
    trySetResponseGetter(mandate, responseGetter);
1✔
1533
    trySetResponseGetter(nextAction, responseGetter);
1✔
1534
    trySetResponseGetter(onBehalfOf, responseGetter);
1✔
1535
    trySetResponseGetter(paymentMethod, responseGetter);
1✔
1536
    trySetResponseGetter(paymentMethodConfigurationDetails, responseGetter);
1✔
1537
    trySetResponseGetter(paymentMethodOptions, responseGetter);
1✔
1538
    trySetResponseGetter(singleUseMandate, responseGetter);
1✔
1539
  }
1✔
1540
}
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