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

stripe / stripe-java / #14884

05 Oct 2023 04:38PM UTC coverage: 15.937% (-0.08%) from 16.014%
#14884

Pull #1661

github-actions

web-flow
Merge d859a2e60 into 07bb5c960
Pull Request #1661: Update generated code for beta

642 of 642 new or added lines in 39 files covered. (100.0%)

17360 of 108931 relevant lines covered (15.94%)

0.16 hits per line

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

25.0
/src/main/java/com/stripe/model/checkout/Session.java
1
// File generated from our OpenAPI spec
2
package com.stripe.model.checkout;
3

4
import com.google.gson.annotations.SerializedName;
5
import com.stripe.exception.StripeException;
6
import com.stripe.model.Account;
7
import com.stripe.model.Address;
8
import com.stripe.model.Customer;
9
import com.stripe.model.Discount;
10
import com.stripe.model.ExpandableField;
11
import com.stripe.model.HasId;
12
import com.stripe.model.Invoice;
13
import com.stripe.model.LineItemCollection;
14
import com.stripe.model.PaymentIntent;
15
import com.stripe.model.PaymentLink;
16
import com.stripe.model.SetupIntent;
17
import com.stripe.model.ShippingDetails;
18
import com.stripe.model.ShippingRate;
19
import com.stripe.model.StripeObject;
20
import com.stripe.model.Subscription;
21
import com.stripe.model.TaxId;
22
import com.stripe.model.TaxRate;
23
import com.stripe.net.ApiMode;
24
import com.stripe.net.ApiRequestParams;
25
import com.stripe.net.ApiResource;
26
import com.stripe.net.BaseAddress;
27
import com.stripe.net.RequestOptions;
28
import com.stripe.net.StripeResponseGetter;
29
import com.stripe.param.checkout.SessionCreateParams;
30
import com.stripe.param.checkout.SessionExpireParams;
31
import com.stripe.param.checkout.SessionListLineItemsParams;
32
import com.stripe.param.checkout.SessionListParams;
33
import com.stripe.param.checkout.SessionRetrieveParams;
34
import java.math.BigDecimal;
35
import java.util.List;
36
import java.util.Map;
37
import java.util.stream.Collectors;
38
import lombok.EqualsAndHashCode;
39
import lombok.Getter;
40
import lombok.Setter;
41

42
/**
43
 * A Checkout Session represents your customer's session as they pay for one-time purchases or
44
 * subscriptions through <a href="https://stripe.com/docs/payments/checkout">Checkout</a> or <a
45
 * href="https://stripe.com/docs/payments/payment-links">Payment Links</a>. We recommend creating a
46
 * new Session each time your customer attempts to pay.
47
 *
48
 * <p>Once payment is successful, the Checkout Session will contain a reference to the <a
49
 * href="https://stripe.com/docs/api/customers">Customer</a>, and either the successful <a
50
 * href="https://stripe.com/docs/api/payment_intents">PaymentIntent</a> or an active <a
51
 * href="https://stripe.com/docs/api/subscriptions">Subscription</a>.
52
 *
53
 * <p>You can create a Checkout Session on your server and redirect to its URL to begin Checkout.
54
 *
55
 * <p>Related guide: <a href="https://stripe.com/docs/checkout/quickstart">Checkout quickstart</a>
56
 */
57
@Getter
58
@Setter
59
@EqualsAndHashCode(callSuper = false)
60
public class Session extends ApiResource implements HasId {
1✔
61
  /** When set, provides configuration for actions to take if this Checkout Session expires. */
62
  @SerializedName("after_expiration")
63
  AfterExpiration afterExpiration;
64

65
  /** Enables user redeemable promotion codes. */
66
  @SerializedName("allow_promotion_codes")
67
  Boolean allowPromotionCodes;
68

69
  /** Total of all items before discounts or taxes are applied. */
70
  @SerializedName("amount_subtotal")
71
  Long amountSubtotal;
72

73
  /** Total of all items after discounts and taxes are applied. */
74
  @SerializedName("amount_total")
75
  Long amountTotal;
76

77
  @SerializedName("automatic_tax")
78
  AutomaticTax automaticTax;
79

80
  /**
81
   * Describes whether Checkout should collect the customer's billing address.
82
   *
83
   * <p>One of {@code auto}, or {@code required}.
84
   */
85
  @SerializedName("billing_address_collection")
86
  String billingAddressCollection;
87

88
  /**
89
   * If set, Checkout displays a back button and customers will be directed to this URL if they
90
   * decide to cancel payment and return to your website.
91
   */
92
  @SerializedName("cancel_url")
93
  String cancelUrl;
94

95
  /**
96
   * A unique string to reference the Checkout Session. This can be a customer ID, a cart ID, or
97
   * similar, and can be used to reconcile the Session with your internal systems.
98
   */
99
  @SerializedName("client_reference_id")
100
  String clientReferenceId;
101

102
  /** Results of {@code consent_collection} for this session. */
103
  @SerializedName("consent")
104
  Consent consent;
105

106
  /**
107
   * When set, provides configuration for the Checkout Session to gather active consent from
108
   * customers.
109
   */
110
  @SerializedName("consent_collection")
111
  ConsentCollection consentCollection;
112

113
  /** Time at which the object was created. Measured in seconds since the Unix epoch. */
114
  @SerializedName("created")
115
  Long created;
116

117
  /**
118
   * Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>,
119
   * in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
120
   */
121
  @SerializedName("currency")
122
  String currency;
123

124
  /** Currency conversion details for automatic currency conversion sessions. */
125
  @SerializedName("currency_conversion")
126
  CurrencyConversion currencyConversion;
127

128
  /**
129
   * Collect additional information from your customer using custom fields. Up to 2 fields are
130
   * supported.
131
   */
132
  @SerializedName("custom_fields")
133
  List<Session.CustomField> customFields;
134

135
  @SerializedName("custom_text")
136
  CustomText customText;
137

138
  /**
139
   * The ID of the customer for this Session. For Checkout Sessions in {@code subscription} mode or
140
   * Checkout Sessions with {@code customer_creation} set as {@code always} in {@code payment} mode,
141
   * Checkout will create a new customer object based on information provided during the payment
142
   * flow unless an existing customer was provided when the Session was created.
143
   */
144
  @SerializedName("customer")
145
  @Getter(lombok.AccessLevel.NONE)
146
  @Setter(lombok.AccessLevel.NONE)
147
  ExpandableField<Customer> customer;
148

149
  /**
150
   * Configure whether a Checkout Session creates a Customer when the Checkout Session completes.
151
   *
152
   * <p>One of {@code always}, or {@code if_required}.
153
   */
154
  @SerializedName("customer_creation")
155
  String customerCreation;
156

157
  /**
158
   * The customer details including the customer's tax exempt status and the customer's tax IDs.
159
   * Only the customer's email is present on Sessions in {@code setup} mode.
160
   */
161
  @SerializedName("customer_details")
162
  CustomerDetails customerDetails;
163

164
  /**
165
   * If provided, this value will be used when the Customer object is created. If not provided,
166
   * customers will be asked to enter their email address. Use this parameter to prefill customer
167
   * data if you already have an email on file. To access information about the customer once the
168
   * payment flow is complete, use the {@code customer} attribute.
169
   */
170
  @SerializedName("customer_email")
171
  String customerEmail;
172

173
  /** The timestamp at which the Checkout Session will expire. */
174
  @SerializedName("expires_at")
175
  Long expiresAt;
176

177
  /** Unique identifier for the object. */
178
  @Getter(onMethod_ = {@Override})
179
  @SerializedName("id")
180
  String id;
181

182
  /** ID of the invoice created by the Checkout Session, if it exists. */
183
  @SerializedName("invoice")
184
  @Getter(lombok.AccessLevel.NONE)
185
  @Setter(lombok.AccessLevel.NONE)
186
  ExpandableField<Invoice> invoice;
187

188
  /** Details on the state of invoice creation for the Checkout Session. */
189
  @SerializedName("invoice_creation")
190
  InvoiceCreation invoiceCreation;
191

192
  /** The line items purchased by the customer. */
193
  @SerializedName("line_items")
194
  LineItemCollection lineItems;
195

196
  /**
197
   * Has the value {@code true} if the object exists in live mode or the value {@code false} if the
198
   * object exists in test mode.
199
   */
200
  @SerializedName("livemode")
201
  Boolean livemode;
202

203
  /**
204
   * The IETF language tag of the locale Checkout is displayed in. If blank or {@code auto}, the
205
   * browser's locale is used.
206
   *
207
   * <p>One of {@code auto}, {@code bg}, {@code cs}, {@code da}, {@code de}, {@code el}, {@code en},
208
   * {@code en-GB}, {@code es}, {@code es-419}, {@code et}, {@code fi}, {@code fil}, {@code fr},
209
   * {@code fr-CA}, {@code hr}, {@code hu}, {@code id}, {@code it}, {@code ja}, {@code ko}, {@code
210
   * lt}, {@code lv}, {@code ms}, {@code mt}, {@code nb}, {@code nl}, {@code pl}, {@code pt}, {@code
211
   * pt-BR}, {@code ro}, {@code ru}, {@code sk}, {@code sl}, {@code sv}, {@code th}, {@code tr},
212
   * {@code vi}, {@code zh}, {@code zh-HK}, or {@code zh-TW}.
213
   */
214
  @SerializedName("locale")
215
  String locale;
216

217
  /**
218
   * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
219
   * to an object. This can be useful for storing additional information about the object in a
220
   * structured format.
221
   */
222
  @SerializedName("metadata")
223
  Map<String, String> metadata;
224

225
  /**
226
   * The mode of the Checkout Session.
227
   *
228
   * <p>One of {@code payment}, {@code setup}, or {@code subscription}.
229
   */
230
  @SerializedName("mode")
231
  String mode;
232

233
  /**
234
   * String representing the object's type. Objects of the same type share the same value.
235
   *
236
   * <p>Equal to {@code checkout.session}.
237
   */
238
  @SerializedName("object")
239
  String object;
240

241
  /** The ID of the PaymentIntent for Checkout Sessions in {@code payment} mode. */
242
  @SerializedName("payment_intent")
243
  @Getter(lombok.AccessLevel.NONE)
244
  @Setter(lombok.AccessLevel.NONE)
245
  ExpandableField<PaymentIntent> paymentIntent;
246

247
  /** The ID of the Payment Link that created this Session. */
248
  @SerializedName("payment_link")
249
  @Getter(lombok.AccessLevel.NONE)
250
  @Setter(lombok.AccessLevel.NONE)
251
  ExpandableField<PaymentLink> paymentLink;
252

253
  /**
254
   * Configure whether a Checkout Session should collect a payment method.
255
   *
256
   * <p>One of {@code always}, or {@code if_required}.
257
   */
258
  @SerializedName("payment_method_collection")
259
  String paymentMethodCollection;
260

261
  /**
262
   * Information about the payment method configuration used for this Checkout session if using
263
   * dynamic payment methods.
264
   */
265
  @SerializedName("payment_method_configuration_details")
266
  PaymentMethodConfigurationDetails paymentMethodConfigurationDetails;
267

268
  /**
269
   * Payment-method-specific configuration for the PaymentIntent or SetupIntent of this
270
   * CheckoutSession.
271
   */
272
  @SerializedName("payment_method_options")
273
  PaymentMethodOptions paymentMethodOptions;
274

275
  /**
276
   * A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept.
277
   */
278
  @SerializedName("payment_method_types")
279
  List<String> paymentMethodTypes;
280

281
  /**
282
   * The payment status of the Checkout Session, one of {@code paid}, {@code unpaid}, or {@code
283
   * no_payment_required}. You can use this value to decide when to fulfill your customer's order.
284
   */
285
  @SerializedName("payment_status")
286
  String paymentStatus;
287

288
  @SerializedName("phone_number_collection")
289
  PhoneNumberCollection phoneNumberCollection;
290

291
  /** The ID of the original expired Checkout Session that triggered the recovery flow. */
292
  @SerializedName("recovered_from")
293
  String recoveredFrom;
294

295
  /** The ID of the SetupIntent for Checkout Sessions in {@code setup} mode. */
296
  @SerializedName("setup_intent")
297
  @Getter(lombok.AccessLevel.NONE)
298
  @Setter(lombok.AccessLevel.NONE)
299
  ExpandableField<SetupIntent> setupIntent;
300

301
  /**
302
   * When set, provides configuration for Checkout to collect a shipping address from a customer.
303
   */
304
  @SerializedName("shipping_address_collection")
305
  ShippingAddressCollection shippingAddressCollection;
306

307
  /** The details of the customer cost of shipping, including the customer chosen ShippingRate. */
308
  @SerializedName("shipping_cost")
309
  ShippingCost shippingCost;
310

311
  /** Shipping information for this Checkout Session. */
312
  @SerializedName("shipping_details")
313
  ShippingDetails shippingDetails;
314

315
  /** The shipping rate options applied to this Session. */
316
  @SerializedName("shipping_options")
317
  List<Session.ShippingOption> shippingOptions;
318

319
  /**
320
   * The status of the Checkout Session, one of {@code open}, {@code complete}, or {@code expired}.
321
   */
322
  @SerializedName("status")
323
  String status;
324

325
  /**
326
   * Describes the type of transaction being performed by Checkout in order to customize relevant
327
   * text on the page, such as the submit button. {@code submit_type} can only be specified on
328
   * Checkout Sessions in {@code payment} mode, but not Checkout Sessions in {@code subscription} or
329
   * {@code setup} mode.
330
   *
331
   * <p>One of {@code auto}, {@code book}, {@code donate}, or {@code pay}.
332
   */
333
  @SerializedName("submit_type")
334
  String submitType;
335

336
  /** The ID of the subscription for Checkout Sessions in {@code subscription} mode. */
337
  @SerializedName("subscription")
338
  @Getter(lombok.AccessLevel.NONE)
339
  @Setter(lombok.AccessLevel.NONE)
340
  ExpandableField<Subscription> subscription;
341

342
  /**
343
   * The URL the customer will be directed to after the payment or subscription creation is
344
   * successful.
345
   */
346
  @SerializedName("success_url")
347
  String successUrl;
348

349
  @SerializedName("tax_id_collection")
350
  TaxIdCollection taxIdCollection;
351

352
  /** Tax and discount details for the computed total amount. */
353
  @SerializedName("total_details")
354
  TotalDetails totalDetails;
355

356
  /**
357
   * The URL to the Checkout Session. Redirect customers to this URL to take them to Checkout. If
358
   * you’re using <a href="https://stripe.com/docs/payments/checkout/custom-domains">Custom
359
   * Domains</a>, the URL will use your subdomain. Otherwise, it’ll use {@code checkout.stripe.com.}
360
   * This value is only present when the session is active.
361
   */
362
  @SerializedName("url")
363
  String url;
364

365
  /** Get ID of expandable {@code customer} object. */
366
  public String getCustomer() {
367
    return (this.customer != null) ? this.customer.getId() : null;
×
368
  }
369

370
  public void setCustomer(String id) {
371
    this.customer = ApiResource.setExpandableFieldId(id, this.customer);
×
372
  }
×
373

374
  /** Get expanded {@code customer}. */
375
  public Customer getCustomerObject() {
376
    return (this.customer != null) ? this.customer.getExpanded() : null;
×
377
  }
378

379
  public void setCustomerObject(Customer expandableObject) {
380
    this.customer = new ExpandableField<Customer>(expandableObject.getId(), expandableObject);
×
381
  }
×
382

383
  /** Get ID of expandable {@code invoice} object. */
384
  public String getInvoice() {
385
    return (this.invoice != null) ? this.invoice.getId() : null;
×
386
  }
387

388
  public void setInvoice(String id) {
389
    this.invoice = ApiResource.setExpandableFieldId(id, this.invoice);
×
390
  }
×
391

392
  /** Get expanded {@code invoice}. */
393
  public Invoice getInvoiceObject() {
394
    return (this.invoice != null) ? this.invoice.getExpanded() : null;
×
395
  }
396

397
  public void setInvoiceObject(Invoice expandableObject) {
398
    this.invoice = new ExpandableField<Invoice>(expandableObject.getId(), expandableObject);
×
399
  }
×
400

401
  /** Get ID of expandable {@code paymentIntent} object. */
402
  public String getPaymentIntent() {
403
    return (this.paymentIntent != null) ? this.paymentIntent.getId() : null;
×
404
  }
405

406
  public void setPaymentIntent(String id) {
407
    this.paymentIntent = ApiResource.setExpandableFieldId(id, this.paymentIntent);
×
408
  }
×
409

410
  /** Get expanded {@code paymentIntent}. */
411
  public PaymentIntent getPaymentIntentObject() {
412
    return (this.paymentIntent != null) ? this.paymentIntent.getExpanded() : null;
×
413
  }
414

415
  public void setPaymentIntentObject(PaymentIntent expandableObject) {
416
    this.paymentIntent =
×
417
        new ExpandableField<PaymentIntent>(expandableObject.getId(), expandableObject);
×
418
  }
×
419

420
  /** Get ID of expandable {@code paymentLink} object. */
421
  public String getPaymentLink() {
422
    return (this.paymentLink != null) ? this.paymentLink.getId() : null;
×
423
  }
424

425
  public void setPaymentLink(String id) {
426
    this.paymentLink = ApiResource.setExpandableFieldId(id, this.paymentLink);
×
427
  }
×
428

429
  /** Get expanded {@code paymentLink}. */
430
  public PaymentLink getPaymentLinkObject() {
431
    return (this.paymentLink != null) ? this.paymentLink.getExpanded() : null;
×
432
  }
433

434
  public void setPaymentLinkObject(PaymentLink expandableObject) {
435
    this.paymentLink = new ExpandableField<PaymentLink>(expandableObject.getId(), expandableObject);
×
436
  }
×
437

438
  /** Get ID of expandable {@code setupIntent} object. */
439
  public String getSetupIntent() {
440
    return (this.setupIntent != null) ? this.setupIntent.getId() : null;
×
441
  }
442

443
  public void setSetupIntent(String id) {
444
    this.setupIntent = ApiResource.setExpandableFieldId(id, this.setupIntent);
×
445
  }
×
446

447
  /** Get expanded {@code setupIntent}. */
448
  public SetupIntent getSetupIntentObject() {
449
    return (this.setupIntent != null) ? this.setupIntent.getExpanded() : null;
×
450
  }
451

452
  public void setSetupIntentObject(SetupIntent expandableObject) {
453
    this.setupIntent = new ExpandableField<SetupIntent>(expandableObject.getId(), expandableObject);
×
454
  }
×
455

456
  /** Get ID of expandable {@code subscription} object. */
457
  public String getSubscription() {
458
    return (this.subscription != null) ? this.subscription.getId() : null;
×
459
  }
460

461
  public void setSubscription(String id) {
462
    this.subscription = ApiResource.setExpandableFieldId(id, this.subscription);
×
463
  }
×
464

465
  /** Get expanded {@code subscription}. */
466
  public Subscription getSubscriptionObject() {
467
    return (this.subscription != null) ? this.subscription.getExpanded() : null;
×
468
  }
469

470
  public void setSubscriptionObject(Subscription expandableObject) {
471
    this.subscription =
×
472
        new ExpandableField<Subscription>(expandableObject.getId(), expandableObject);
×
473
  }
×
474

475
  /** Creates a Session object. */
476
  public static Session create(Map<String, Object> params) throws StripeException {
477
    return create(params, (RequestOptions) null);
×
478
  }
479

480
  /** Creates a Session object. */
481
  public static Session create(Map<String, Object> params, RequestOptions options)
482
      throws StripeException {
483
    String path = "/v1/checkout/sessions";
×
484
    return getGlobalResponseGetter()
×
485
        .request(
×
486
            BaseAddress.API,
487
            ApiResource.RequestMethod.POST,
488
            path,
489
            params,
490
            Session.class,
491
            options,
492
            ApiMode.V1);
493
  }
494

495
  /** Creates a Session object. */
496
  public static Session create(SessionCreateParams params) throws StripeException {
497
    return create(params, (RequestOptions) null);
1✔
498
  }
499

500
  /** Creates a Session object. */
501
  public static Session create(SessionCreateParams params, RequestOptions options)
502
      throws StripeException {
503
    String path = "/v1/checkout/sessions";
1✔
504
    ApiResource.checkNullTypedParams(path, params);
1✔
505
    return getGlobalResponseGetter()
1✔
506
        .request(
1✔
507
            BaseAddress.API,
508
            ApiResource.RequestMethod.POST,
509
            path,
510
            ApiRequestParams.paramsToMap(params),
1✔
511
            Session.class,
512
            options,
513
            ApiMode.V1);
514
  }
515

516
  /**
517
   * A Session can be expired when it is in one of these statuses: {@code open}
518
   *
519
   * <p>After it expires, a customer can’t complete a Session and customers loading the Session see
520
   * a message saying the Session is expired.
521
   */
522
  public Session expire() throws StripeException {
523
    return expire((Map<String, Object>) null, (RequestOptions) null);
×
524
  }
525

526
  /**
527
   * A Session can be expired when it is in one of these statuses: {@code open}
528
   *
529
   * <p>After it expires, a customer can’t complete a Session and customers loading the Session see
530
   * a message saying the Session is expired.
531
   */
532
  public Session expire(RequestOptions options) throws StripeException {
533
    return expire((Map<String, Object>) null, options);
×
534
  }
535

536
  /**
537
   * A Session can be expired when it is in one of these statuses: {@code open}
538
   *
539
   * <p>After it expires, a customer can’t complete a Session and customers loading the Session see
540
   * a message saying the Session is expired.
541
   */
542
  public Session expire(Map<String, Object> params) throws StripeException {
543
    return expire(params, (RequestOptions) null);
×
544
  }
545

546
  /**
547
   * A Session can be expired when it is in one of these statuses: {@code open}
548
   *
549
   * <p>After it expires, a customer can’t complete a Session and customers loading the Session see
550
   * a message saying the Session is expired.
551
   */
552
  public Session expire(Map<String, Object> params, RequestOptions options) throws StripeException {
553
    String path =
×
554
        String.format("/v1/checkout/sessions/%s/expire", ApiResource.urlEncodeId(this.getId()));
×
555
    return getResponseGetter()
×
556
        .request(
×
557
            BaseAddress.API,
558
            ApiResource.RequestMethod.POST,
559
            path,
560
            params,
561
            Session.class,
562
            options,
563
            ApiMode.V1);
564
  }
565

566
  /**
567
   * A Session can be expired when it is in one of these statuses: {@code open}
568
   *
569
   * <p>After it expires, a customer can’t complete a Session and customers loading the Session see
570
   * a message saying the Session is expired.
571
   */
572
  public Session expire(SessionExpireParams params) throws StripeException {
573
    return expire(params, (RequestOptions) null);
1✔
574
  }
575

576
  /**
577
   * A Session can be expired when it is in one of these statuses: {@code open}
578
   *
579
   * <p>After it expires, a customer can’t complete a Session and customers loading the Session see
580
   * a message saying the Session is expired.
581
   */
582
  public Session expire(SessionExpireParams params, RequestOptions options) throws StripeException {
583
    String path =
1✔
584
        String.format("/v1/checkout/sessions/%s/expire", ApiResource.urlEncodeId(this.getId()));
1✔
585
    ApiResource.checkNullTypedParams(path, params);
1✔
586
    return getResponseGetter()
1✔
587
        .request(
1✔
588
            BaseAddress.API,
589
            ApiResource.RequestMethod.POST,
590
            path,
591
            ApiRequestParams.paramsToMap(params),
1✔
592
            Session.class,
593
            options,
594
            ApiMode.V1);
595
  }
596

597
  /** Returns a list of Checkout Sessions. */
598
  public static SessionCollection list(Map<String, Object> params) throws StripeException {
599
    return list(params, (RequestOptions) null);
×
600
  }
601

602
  /** Returns a list of Checkout Sessions. */
603
  public static SessionCollection list(Map<String, Object> params, RequestOptions options)
604
      throws StripeException {
605
    String path = "/v1/checkout/sessions";
×
606
    return getGlobalResponseGetter()
×
607
        .request(
×
608
            BaseAddress.API,
609
            ApiResource.RequestMethod.GET,
610
            path,
611
            params,
612
            SessionCollection.class,
613
            options,
614
            ApiMode.V1);
615
  }
616

617
  /** Returns a list of Checkout Sessions. */
618
  public static SessionCollection list(SessionListParams params) throws StripeException {
619
    return list(params, (RequestOptions) null);
1✔
620
  }
621

622
  /** Returns a list of Checkout Sessions. */
623
  public static SessionCollection list(SessionListParams params, RequestOptions options)
624
      throws StripeException {
625
    String path = "/v1/checkout/sessions";
1✔
626
    ApiResource.checkNullTypedParams(path, params);
1✔
627
    return getGlobalResponseGetter()
1✔
628
        .request(
1✔
629
            BaseAddress.API,
630
            ApiResource.RequestMethod.GET,
631
            path,
632
            ApiRequestParams.paramsToMap(params),
1✔
633
            SessionCollection.class,
634
            options,
635
            ApiMode.V1);
636
  }
637

638
  /**
639
   * When retrieving a Checkout Session, there is an includable <strong>line_items</strong> property
640
   * containing the first handful of those items. There is also a URL where you can retrieve the
641
   * full (paginated) list of line items.
642
   */
643
  public LineItemCollection listLineItems() throws StripeException {
644
    return listLineItems((Map<String, Object>) null, (RequestOptions) null);
×
645
  }
646

647
  /**
648
   * When retrieving a Checkout Session, there is an includable <strong>line_items</strong> property
649
   * containing the first handful of those items. There is also a URL where you can retrieve the
650
   * full (paginated) list of line items.
651
   */
652
  public LineItemCollection listLineItems(Map<String, Object> params) throws StripeException {
653
    return listLineItems(params, (RequestOptions) null);
×
654
  }
655

656
  /**
657
   * When retrieving a Checkout Session, there is an includable <strong>line_items</strong> property
658
   * containing the first handful of those items. There is also a URL where you can retrieve the
659
   * full (paginated) list of line items.
660
   */
661
  public LineItemCollection listLineItems(Map<String, Object> params, RequestOptions options)
662
      throws StripeException {
663
    String path =
×
664
        String.format("/v1/checkout/sessions/%s/line_items", ApiResource.urlEncodeId(this.getId()));
×
665
    return getResponseGetter()
×
666
        .request(
×
667
            BaseAddress.API,
668
            ApiResource.RequestMethod.GET,
669
            path,
670
            params,
671
            LineItemCollection.class,
672
            options,
673
            ApiMode.V1);
674
  }
675

676
  /**
677
   * When retrieving a Checkout Session, there is an includable <strong>line_items</strong> property
678
   * containing the first handful of those items. There is also a URL where you can retrieve the
679
   * full (paginated) list of line items.
680
   */
681
  public LineItemCollection listLineItems(SessionListLineItemsParams params)
682
      throws StripeException {
683
    return listLineItems(params, (RequestOptions) null);
1✔
684
  }
685

686
  /**
687
   * When retrieving a Checkout Session, there is an includable <strong>line_items</strong> property
688
   * containing the first handful of those items. There is also a URL where you can retrieve the
689
   * full (paginated) list of line items.
690
   */
691
  public LineItemCollection listLineItems(SessionListLineItemsParams params, RequestOptions options)
692
      throws StripeException {
693
    String path =
1✔
694
        String.format("/v1/checkout/sessions/%s/line_items", ApiResource.urlEncodeId(this.getId()));
1✔
695
    ApiResource.checkNullTypedParams(path, params);
1✔
696
    return getResponseGetter()
1✔
697
        .request(
1✔
698
            BaseAddress.API,
699
            ApiResource.RequestMethod.GET,
700
            path,
701
            ApiRequestParams.paramsToMap(params),
1✔
702
            LineItemCollection.class,
703
            options,
704
            ApiMode.V1);
705
  }
706

707
  /** Retrieves a Session object. */
708
  public static Session retrieve(String session) throws StripeException {
709
    return retrieve(session, (Map<String, Object>) null, (RequestOptions) null);
1✔
710
  }
711

712
  /** Retrieves a Session object. */
713
  public static Session retrieve(String session, RequestOptions options) throws StripeException {
714
    return retrieve(session, (Map<String, Object>) null, options);
×
715
  }
716

717
  /** Retrieves a Session object. */
718
  public static Session retrieve(String session, Map<String, Object> params, RequestOptions options)
719
      throws StripeException {
720
    String path = String.format("/v1/checkout/sessions/%s", ApiResource.urlEncodeId(session));
1✔
721
    return getGlobalResponseGetter()
1✔
722
        .request(
1✔
723
            BaseAddress.API,
724
            ApiResource.RequestMethod.GET,
725
            path,
726
            params,
727
            Session.class,
728
            options,
729
            ApiMode.V1);
730
  }
731

732
  /** Retrieves a Session object. */
733
  public static Session retrieve(
734
      String session, SessionRetrieveParams params, RequestOptions options) throws StripeException {
735
    String path = String.format("/v1/checkout/sessions/%s", ApiResource.urlEncodeId(session));
×
736
    ApiResource.checkNullTypedParams(path, params);
×
737
    return getGlobalResponseGetter()
×
738
        .request(
×
739
            BaseAddress.API,
740
            ApiResource.RequestMethod.GET,
741
            path,
742
            ApiRequestParams.paramsToMap(params),
×
743
            Session.class,
744
            options,
745
            ApiMode.V1);
746
  }
747

748
  @Getter
749
  @Setter
750
  @EqualsAndHashCode(callSuper = false)
751
  public static class AfterExpiration extends StripeObject {
×
752
    /** When set, configuration used to recover the Checkout Session on expiry. */
753
    @SerializedName("recovery")
754
    Recovery recovery;
755

756
    @Getter
757
    @Setter
758
    @EqualsAndHashCode(callSuper = false)
759
    public static class Recovery extends StripeObject {
×
760
      /**
761
       * Enables user redeemable promotion codes on the recovered Checkout Sessions. Defaults to
762
       * {@code false}
763
       */
764
      @SerializedName("allow_promotion_codes")
765
      Boolean allowPromotionCodes;
766

767
      /**
768
       * If {@code true}, a recovery url will be generated to recover this Checkout Session if it
769
       * expires before a transaction is completed. It will be attached to the Checkout Session
770
       * object upon expiration.
771
       */
772
      @SerializedName("enabled")
773
      Boolean enabled;
774

775
      /** The timestamp at which the recovery URL will expire. */
776
      @SerializedName("expires_at")
777
      Long expiresAt;
778

779
      /**
780
       * URL that creates a new Checkout Session when clicked that is a copy of this expired
781
       * Checkout Session.
782
       */
783
      @SerializedName("url")
784
      String url;
785
    }
786
  }
787

788
  @Getter
789
  @Setter
790
  @EqualsAndHashCode(callSuper = false)
791
  public static class AutomaticTax extends StripeObject {
1✔
792
    /** Indicates whether automatic tax is enabled for the session. */
793
    @SerializedName("enabled")
794
    Boolean enabled;
795

796
    /**
797
     * The account that's liable for tax. If set, the business address and tax registrations
798
     * required to perform the tax calculation are loaded from this account. The tax transaction is
799
     * returned in the report of the connected account.
800
     */
801
    @SerializedName("liability")
802
    Liability liability;
803

804
    /**
805
     * The status of the most recent automated tax calculation for this session.
806
     *
807
     * <p>One of {@code complete}, {@code failed}, or {@code requires_location_inputs}.
808
     */
809
    @SerializedName("status")
810
    String status;
811

812
    @Getter
813
    @Setter
814
    @EqualsAndHashCode(callSuper = false)
815
    public static class Liability extends StripeObject {
×
816
      /** The connected account being referenced when {@code type} is {@code account}. */
817
      @SerializedName("account")
818
      @Getter(lombok.AccessLevel.NONE)
819
      @Setter(lombok.AccessLevel.NONE)
820
      ExpandableField<Account> account;
821

822
      /**
823
       * Type of the account referenced.
824
       *
825
       * <p>One of {@code account}, or {@code self}.
826
       */
827
      @SerializedName("type")
828
      String type;
829

830
      /** Get ID of expandable {@code account} object. */
831
      public String getAccount() {
832
        return (this.account != null) ? this.account.getId() : null;
×
833
      }
834

835
      public void setAccount(String id) {
836
        this.account = ApiResource.setExpandableFieldId(id, this.account);
×
837
      }
×
838

839
      /** Get expanded {@code account}. */
840
      public Account getAccountObject() {
841
        return (this.account != null) ? this.account.getExpanded() : null;
×
842
      }
843

844
      public void setAccountObject(Account expandableObject) {
845
        this.account = new ExpandableField<Account>(expandableObject.getId(), expandableObject);
×
846
      }
×
847
    }
848
  }
849

850
  @Getter
851
  @Setter
852
  @EqualsAndHashCode(callSuper = false)
853
  public static class Consent extends StripeObject {
×
854
    /**
855
     * If {@code opt_in}, the customer consents to receiving promotional communications from the
856
     * merchant about this Checkout Session.
857
     *
858
     * <p>One of {@code opt_in}, or {@code opt_out}.
859
     */
860
    @SerializedName("promotions")
861
    String promotions;
862

863
    /**
864
     * If {@code accepted}, the customer in this Checkout Session has agreed to the merchant's terms
865
     * of service.
866
     *
867
     * <p>Equal to {@code accepted}.
868
     */
869
    @SerializedName("terms_of_service")
870
    String termsOfService;
871
  }
872

873
  @Getter
874
  @Setter
875
  @EqualsAndHashCode(callSuper = false)
876
  public static class ConsentCollection extends StripeObject {
×
877
    /**
878
     * If set to {@code auto}, enables the collection of customer consent for promotional
879
     * communications. The Checkout Session will determine whether to display an option to opt into
880
     * promotional communication from the merchant depending on the customer's locale. Only
881
     * available to US merchants.
882
     *
883
     * <p>One of {@code auto}, or {@code none}.
884
     */
885
    @SerializedName("promotions")
886
    String promotions;
887

888
    /**
889
     * If set to {@code required}, it requires customers to accept the terms of service before being
890
     * able to pay.
891
     *
892
     * <p>One of {@code none}, or {@code required}.
893
     */
894
    @SerializedName("terms_of_service")
895
    String termsOfService;
896
  }
897

898
  @Getter
899
  @Setter
900
  @EqualsAndHashCode(callSuper = false)
901
  public static class CurrencyConversion extends StripeObject {
×
902
    /** Total of all items in source currency before discounts or taxes are applied. */
903
    @SerializedName("amount_subtotal")
904
    Long amountSubtotal;
905

906
    /** Total of all items in source currency after discounts and taxes are applied. */
907
    @SerializedName("amount_total")
908
    Long amountTotal;
909

910
    /** Exchange rate used to convert source currency amounts to customer currency amounts. */
911
    @SerializedName("fx_rate")
912
    BigDecimal fxRate;
913

914
    /** Creation currency of the CheckoutSession before localization. */
915
    @SerializedName("source_currency")
916
    String sourceCurrency;
917
  }
918

919
  @Getter
920
  @Setter
921
  @EqualsAndHashCode(callSuper = false)
922
  public static class CustomField extends StripeObject {
×
923
    /** Configuration for {@code type=dropdown} fields. */
924
    @SerializedName("dropdown")
925
    Dropdown dropdown;
926

927
    /**
928
     * String of your choice that your integration can use to reconcile this field. Must be unique
929
     * to this field, alphanumeric, and up to 200 characters.
930
     */
931
    @SerializedName("key")
932
    String key;
933

934
    @SerializedName("label")
935
    Label label;
936

937
    /** Configuration for {@code type=numeric} fields. */
938
    @SerializedName("numeric")
939
    Numeric numeric;
940

941
    /**
942
     * Whether the customer is required to complete the field before completing the Checkout
943
     * Session. Defaults to {@code false}.
944
     */
945
    @SerializedName("optional")
946
    Boolean optional;
947

948
    /** Configuration for {@code type=text} fields. */
949
    @SerializedName("text")
950
    Text text;
951

952
    /**
953
     * The type of the field.
954
     *
955
     * <p>One of {@code dropdown}, {@code numeric}, or {@code text}.
956
     */
957
    @SerializedName("type")
958
    String type;
959

960
    @Getter
961
    @Setter
962
    @EqualsAndHashCode(callSuper = false)
963
    public static class Dropdown extends StripeObject {
×
964
      /** The options available for the customer to select. Up to 200 options allowed. */
965
      @SerializedName("options")
966
      List<Session.CustomField.Dropdown.Option> options;
967

968
      /** The option selected by the customer. This will be the {@code value} for the option. */
969
      @SerializedName("value")
970
      String value;
971

972
      @Getter
973
      @Setter
974
      @EqualsAndHashCode(callSuper = false)
975
      public static class Option extends StripeObject {
×
976
        /** The label for the option, displayed to the customer. Up to 100 characters. */
977
        @SerializedName("label")
978
        String label;
979

980
        /**
981
         * The value for this option, not displayed to the customer, used by your integration to
982
         * reconcile the option selected by the customer. Must be unique to this option,
983
         * alphanumeric, and up to 100 characters.
984
         */
985
        @SerializedName("value")
986
        String value;
987
      }
988
    }
989

990
    @Getter
991
    @Setter
992
    @EqualsAndHashCode(callSuper = false)
993
    public static class Label extends StripeObject {
×
994
      /** Custom text for the label, displayed to the customer. Up to 50 characters. */
995
      @SerializedName("custom")
996
      String custom;
997

998
      /**
999
       * The type of the label.
1000
       *
1001
       * <p>Equal to {@code custom}.
1002
       */
1003
      @SerializedName("type")
1004
      String type;
1005
    }
1006

1007
    @Getter
1008
    @Setter
1009
    @EqualsAndHashCode(callSuper = false)
1010
    public static class Numeric extends StripeObject {
×
1011
      /** The maximum character length constraint for the customer's input. */
1012
      @SerializedName("maximum_length")
1013
      Long maximumLength;
1014

1015
      /** The minimum character length requirement for the customer's input. */
1016
      @SerializedName("minimum_length")
1017
      Long minimumLength;
1018

1019
      /** The value entered by the customer, containing only digits. */
1020
      @SerializedName("value")
1021
      String value;
1022
    }
1023

1024
    @Getter
1025
    @Setter
1026
    @EqualsAndHashCode(callSuper = false)
1027
    public static class Text extends StripeObject {
×
1028
      /** The maximum character length constraint for the customer's input. */
1029
      @SerializedName("maximum_length")
1030
      Long maximumLength;
1031

1032
      /** The minimum character length requirement for the customer's input. */
1033
      @SerializedName("minimum_length")
1034
      Long minimumLength;
1035

1036
      /** The value entered by the customer. */
1037
      @SerializedName("value")
1038
      String value;
1039
    }
1040
  }
1041

1042
  @Getter
1043
  @Setter
1044
  @EqualsAndHashCode(callSuper = false)
1045
  public static class CustomText extends StripeObject {
1✔
1046
    /** Custom text that should be displayed alongside shipping address collection. */
1047
    @SerializedName("shipping_address")
1048
    ShippingAddress shippingAddress;
1049

1050
    /** Custom text that should be displayed alongside the payment confirmation button. */
1051
    @SerializedName("submit")
1052
    Submit submit;
1053

1054
    /**
1055
     * Custom text that should be displayed in place of the default terms of service agreement text.
1056
     */
1057
    @SerializedName("terms_of_service_acceptance")
1058
    TermsOfServiceAcceptance termsOfServiceAcceptance;
1059

1060
    @Getter
1061
    @Setter
1062
    @EqualsAndHashCode(callSuper = false)
1063
    public static class ShippingAddress extends StripeObject {
×
1064
      /** Text may be up to 1200 characters in length. */
1065
      @SerializedName("message")
1066
      String message;
1067
    }
1068

1069
    @Getter
1070
    @Setter
1071
    @EqualsAndHashCode(callSuper = false)
1072
    public static class Submit extends StripeObject {
×
1073
      /** Text may be up to 1200 characters in length. */
1074
      @SerializedName("message")
1075
      String message;
1076
    }
1077

1078
    @Getter
1079
    @Setter
1080
    @EqualsAndHashCode(callSuper = false)
1081
    public static class TermsOfServiceAcceptance extends StripeObject {
×
1082
      /** Text may be up to 1200 characters in length. */
1083
      @SerializedName("message")
1084
      String message;
1085
    }
1086
  }
1087

1088
  @Getter
1089
  @Setter
1090
  @EqualsAndHashCode(callSuper = false)
1091
  public static class CustomerDetails extends StripeObject {
1✔
1092
    /**
1093
     * The customer's address after a completed Checkout Session. Note: This property is populated
1094
     * only for sessions on or after March 30, 2022.
1095
     */
1096
    @SerializedName("address")
1097
    Address address;
1098

1099
    /**
1100
     * The email associated with the Customer, if one exists, on the Checkout Session after a
1101
     * completed Checkout Session or at time of session expiry. Otherwise, if the customer has
1102
     * consented to promotional content, this value is the most recent valid email provided by the
1103
     * customer on the Checkout form.
1104
     */
1105
    @SerializedName("email")
1106
    String email;
1107

1108
    /**
1109
     * The customer's name after a completed Checkout Session. Note: This property is populated only
1110
     * for sessions on or after March 30, 2022.
1111
     */
1112
    @SerializedName("name")
1113
    String name;
1114

1115
    /** The customer's phone number after a completed Checkout Session. */
1116
    @SerializedName("phone")
1117
    String phone;
1118

1119
    /**
1120
     * The customer’s tax exempt status after a completed Checkout Session.
1121
     *
1122
     * <p>One of {@code exempt}, {@code none}, or {@code reverse}.
1123
     */
1124
    @SerializedName("tax_exempt")
1125
    String taxExempt;
1126

1127
    /** The customer’s tax IDs after a completed Checkout Session. */
1128
    @SerializedName("tax_ids")
1129
    List<Session.CustomerDetails.TaxId> taxIds;
1130

1131
    @Getter
1132
    @Setter
1133
    @EqualsAndHashCode(callSuper = false)
1134
    public static class TaxId extends StripeObject {
×
1135
      /**
1136
       * The type of the tax ID, one of {@code ad_nrt}, {@code ar_cuit}, {@code eu_vat}, {@code
1137
       * bo_tin}, {@code br_cnpj}, {@code br_cpf}, {@code cn_tin}, {@code co_nit}, {@code cr_tin},
1138
       * {@code do_rcn}, {@code ec_ruc}, {@code eu_oss_vat}, {@code pe_ruc}, {@code ro_tin}, {@code
1139
       * rs_pib}, {@code sv_nit}, {@code uy_ruc}, {@code ve_rif}, {@code vn_tin}, {@code gb_vat},
1140
       * {@code nz_gst}, {@code au_abn}, {@code au_arn}, {@code in_gst}, {@code no_vat}, {@code
1141
       * za_vat}, {@code ch_vat}, {@code mx_rfc}, {@code sg_uen}, {@code ru_inn}, {@code ru_kpp},
1142
       * {@code ca_bn}, {@code hk_br}, {@code es_cif}, {@code tw_vat}, {@code th_vat}, {@code
1143
       * jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code li_uid}, {@code my_itn}, {@code us_ein},
1144
       * {@code kr_brn}, {@code ca_qst}, {@code ca_gst_hst}, {@code ca_pst_bc}, {@code ca_pst_mb},
1145
       * {@code ca_pst_sk}, {@code my_sst}, {@code sg_gst}, {@code ae_trn}, {@code cl_tin}, {@code
1146
       * sa_vat}, {@code id_npwp}, {@code my_frp}, {@code il_vat}, {@code ge_vat}, {@code ua_vat},
1147
       * {@code is_vat}, {@code bg_uic}, {@code hu_tin}, {@code si_tin}, {@code ke_pin}, {@code
1148
       * tr_tin}, {@code eg_tin}, {@code ph_tin}, or {@code unknown}.
1149
       */
1150
      @SerializedName("type")
1151
      String type;
1152

1153
      /** The value of the tax ID. */
1154
      @SerializedName("value")
1155
      String value;
1156
    }
1157
  }
1158

1159
  @Getter
1160
  @Setter
1161
  @EqualsAndHashCode(callSuper = false)
1162
  public static class InvoiceCreation extends StripeObject {
×
1163
    /** Indicates whether invoice creation is enabled for the Checkout Session. */
1164
    @SerializedName("enabled")
1165
    Boolean enabled;
1166

1167
    @SerializedName("invoice_data")
1168
    InvoiceData invoiceData;
1169

1170
    @Getter
1171
    @Setter
1172
    @EqualsAndHashCode(callSuper = false)
1173
    public static class InvoiceData extends StripeObject {
×
1174
      /** The account tax IDs associated with the invoice. */
1175
      @SerializedName("account_tax_ids")
1176
      List<ExpandableField<TaxId>> accountTaxIds;
1177

1178
      /** Custom fields displayed on the invoice. */
1179
      @SerializedName("custom_fields")
1180
      List<Session.InvoiceCreation.InvoiceData.CustomField> customFields;
1181

1182
      /** An arbitrary string attached to the object. Often useful for displaying to users. */
1183
      @SerializedName("description")
1184
      String description;
1185

1186
      /** Footer displayed on the invoice. */
1187
      @SerializedName("footer")
1188
      String footer;
1189

1190
      /**
1191
       * The connected account that issues the invoice. The invoice is presented with the branding
1192
       * and support information of the specified account.
1193
       */
1194
      @SerializedName("issuer")
1195
      Issuer issuer;
1196

1197
      /**
1198
       * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can
1199
       * attach to an object. This can be useful for storing additional information about the object
1200
       * in a structured format.
1201
       */
1202
      @SerializedName("metadata")
1203
      Map<String, String> metadata;
1204

1205
      /** Options for invoice PDF rendering. */
1206
      @SerializedName("rendering_options")
1207
      RenderingOptions renderingOptions;
1208

1209
      /** Get IDs of expandable {@code accountTaxIds} object list. */
1210
      public List<String> getAccountTaxIds() {
1211
        return (this.accountTaxIds != null)
×
1212
            ? this.accountTaxIds.stream().map(x -> x.getId()).collect(Collectors.toList())
×
1213
            : null;
×
1214
      }
1215

1216
      public void setAccountTaxIds(List<String> ids) {
1217
        if (ids == null) {
×
1218
          this.accountTaxIds = null;
×
1219
          return;
×
1220
        }
1221
        if (this.accountTaxIds != null
×
1222
            && this.accountTaxIds.stream()
×
1223
                .map(x -> x.getId())
×
1224
                .collect(Collectors.toList())
×
1225
                .equals(ids)) {
×
1226
          // noop if the ids are equal to what are already present
1227
          return;
×
1228
        }
1229
        this.accountTaxIds =
×
1230
            (ids != null)
×
1231
                ? ids.stream()
×
1232
                    .map(id -> new ExpandableField<TaxId>(id, null))
×
1233
                    .collect(Collectors.toList())
×
1234
                : null;
×
1235
      }
×
1236

1237
      /** Get expanded {@code accountTaxIds}. */
1238
      public List<TaxId> getAccountTaxIdObjects() {
1239
        return (this.accountTaxIds != null)
×
1240
            ? this.accountTaxIds.stream().map(x -> x.getExpanded()).collect(Collectors.toList())
×
1241
            : null;
×
1242
      }
1243

1244
      public void setAccountTaxIdObjects(List<TaxId> objs) {
1245
        this.accountTaxIds =
×
1246
            objs != null
×
1247
                ? objs.stream()
×
1248
                    .map(x -> new ExpandableField<TaxId>(x.getId(), x))
×
1249
                    .collect(Collectors.toList())
×
1250
                : null;
×
1251
      }
×
1252

1253
      @Getter
1254
      @Setter
1255
      @EqualsAndHashCode(callSuper = false)
1256
      public static class CustomField extends StripeObject {
×
1257
        /** The name of the custom field. */
1258
        @SerializedName("name")
1259
        String name;
1260

1261
        /** The value of the custom field. */
1262
        @SerializedName("value")
1263
        String value;
1264
      }
1265

1266
      @Getter
1267
      @Setter
1268
      @EqualsAndHashCode(callSuper = false)
1269
      public static class Issuer extends StripeObject {
×
1270
        /** The connected account being referenced when {@code type} is {@code account}. */
1271
        @SerializedName("account")
1272
        @Getter(lombok.AccessLevel.NONE)
1273
        @Setter(lombok.AccessLevel.NONE)
1274
        ExpandableField<Account> account;
1275

1276
        /**
1277
         * Type of the account referenced.
1278
         *
1279
         * <p>One of {@code account}, or {@code self}.
1280
         */
1281
        @SerializedName("type")
1282
        String type;
1283

1284
        /** Get ID of expandable {@code account} object. */
1285
        public String getAccount() {
1286
          return (this.account != null) ? this.account.getId() : null;
×
1287
        }
1288

1289
        public void setAccount(String id) {
1290
          this.account = ApiResource.setExpandableFieldId(id, this.account);
×
1291
        }
×
1292

1293
        /** Get expanded {@code account}. */
1294
        public Account getAccountObject() {
1295
          return (this.account != null) ? this.account.getExpanded() : null;
×
1296
        }
1297

1298
        public void setAccountObject(Account expandableObject) {
1299
          this.account = new ExpandableField<Account>(expandableObject.getId(), expandableObject);
×
1300
        }
×
1301
      }
1302

1303
      @Getter
1304
      @Setter
1305
      @EqualsAndHashCode(callSuper = false)
1306
      public static class RenderingOptions extends StripeObject {
×
1307
        /**
1308
         * How line-item prices and amounts will be displayed with respect to tax on invoice PDFs.
1309
         */
1310
        @SerializedName("amount_tax_display")
1311
        String amountTaxDisplay;
1312
      }
1313
    }
1314
  }
1315

1316
  @Getter
1317
  @Setter
1318
  @EqualsAndHashCode(callSuper = false)
1319
  public static class PaymentMethodConfigurationDetails extends StripeObject implements HasId {
×
1320
    /** ID of the payment method configuration used. */
1321
    @Getter(onMethod_ = {@Override})
1322
    @SerializedName("id")
1323
    String id;
1324

1325
    /** ID of the parent payment method configuration used. */
1326
    @SerializedName("parent")
1327
    String parent;
1328
  }
1329

1330
  @Getter
1331
  @Setter
1332
  @EqualsAndHashCode(callSuper = false)
1333
  public static class PaymentMethodOptions extends StripeObject {
1✔
1334
    @SerializedName("acss_debit")
1335
    AcssDebit acssDebit;
1336

1337
    @SerializedName("affirm")
1338
    Affirm affirm;
1339

1340
    @SerializedName("afterpay_clearpay")
1341
    AfterpayClearpay afterpayClearpay;
1342

1343
    @SerializedName("alipay")
1344
    Alipay alipay;
1345

1346
    @SerializedName("au_becs_debit")
1347
    AuBecsDebit auBecsDebit;
1348

1349
    @SerializedName("bacs_debit")
1350
    BacsDebit bacsDebit;
1351

1352
    @SerializedName("bancontact")
1353
    Bancontact bancontact;
1354

1355
    @SerializedName("boleto")
1356
    Boleto boleto;
1357

1358
    @SerializedName("card")
1359
    Card card;
1360

1361
    @SerializedName("cashapp")
1362
    Cashapp cashapp;
1363

1364
    @SerializedName("customer_balance")
1365
    CustomerBalance customerBalance;
1366

1367
    @SerializedName("eps")
1368
    Eps eps;
1369

1370
    @SerializedName("fpx")
1371
    Fpx fpx;
1372

1373
    @SerializedName("giropay")
1374
    Giropay giropay;
1375

1376
    @SerializedName("grabpay")
1377
    Grabpay grabpay;
1378

1379
    @SerializedName("ideal")
1380
    Ideal ideal;
1381

1382
    @SerializedName("klarna")
1383
    Klarna klarna;
1384

1385
    @SerializedName("konbini")
1386
    Konbini konbini;
1387

1388
    @SerializedName("link")
1389
    Link link;
1390

1391
    @SerializedName("oxxo")
1392
    Oxxo oxxo;
1393

1394
    @SerializedName("p24")
1395
    P24 p24;
1396

1397
    @SerializedName("paynow")
1398
    Paynow paynow;
1399

1400
    @SerializedName("pix")
1401
    Pix pix;
1402

1403
    @SerializedName("sepa_debit")
1404
    SepaDebit sepaDebit;
1405

1406
    @SerializedName("sofort")
1407
    Sofort sofort;
1408

1409
    @SerializedName("us_bank_account")
1410
    UsBankAccount usBankAccount;
1411

1412
    @Getter
1413
    @Setter
1414
    @EqualsAndHashCode(callSuper = false)
1415
    public static class AcssDebit extends StripeObject {
×
1416
      /**
1417
       * Currency supported by the bank account. Returned when the Session is in {@code setup} mode.
1418
       *
1419
       * <p>One of {@code cad}, or {@code usd}.
1420
       */
1421
      @SerializedName("currency")
1422
      String currency;
1423

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

1427
      /**
1428
       * Indicates that you intend to make future payments with this PaymentIntent's payment method.
1429
       *
1430
       * <p>Providing this parameter will <a
1431
       * href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a>
1432
       * to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any
1433
       * required actions from the user are complete. If no Customer was provided, the payment
1434
       * method can still be <a
1435
       * href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after
1436
       * the transaction completes.
1437
       *
1438
       * <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
1439
       * dynamically optimize your payment flow and comply with regional legislation and network
1440
       * rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
1441
       *
1442
       * <p>One of {@code none}, {@code off_session}, or {@code on_session}.
1443
       */
1444
      @SerializedName("setup_future_usage")
1445
      String setupFutureUsage;
1446

1447
      /**
1448
       * Bank account verification method.
1449
       *
1450
       * <p>One of {@code automatic}, {@code instant}, or {@code microdeposits}.
1451
       */
1452
      @SerializedName("verification_method")
1453
      String verificationMethod;
1454

1455
      @Getter
1456
      @Setter
1457
      @EqualsAndHashCode(callSuper = false)
1458
      public static class MandateOptions extends StripeObject {
×
1459
        /** A URL for custom mandate text. */
1460
        @SerializedName("custom_mandate_url")
1461
        String customMandateUrl;
1462

1463
        /**
1464
         * List of Stripe products where this mandate can be selected automatically. Returned when
1465
         * the Session is in {@code setup} mode.
1466
         */
1467
        @SerializedName("default_for")
1468
        List<String> defaultFor;
1469

1470
        /**
1471
         * Description of the interval. Only required if the 'payment_schedule' parameter is
1472
         * 'interval' or 'combined'.
1473
         */
1474
        @SerializedName("interval_description")
1475
        String intervalDescription;
1476

1477
        /**
1478
         * Payment schedule for the mandate.
1479
         *
1480
         * <p>One of {@code combined}, {@code interval}, or {@code sporadic}.
1481
         */
1482
        @SerializedName("payment_schedule")
1483
        String paymentSchedule;
1484

1485
        /**
1486
         * Transaction type of the mandate.
1487
         *
1488
         * <p>One of {@code business}, or {@code personal}.
1489
         */
1490
        @SerializedName("transaction_type")
1491
        String transactionType;
1492
      }
1493
    }
1494

1495
    @Getter
1496
    @Setter
1497
    @EqualsAndHashCode(callSuper = false)
1498
    public static class Affirm extends StripeObject {
×
1499
      /**
1500
       * Indicates that you intend to make future payments with this PaymentIntent's payment method.
1501
       *
1502
       * <p>Providing this parameter will <a
1503
       * href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a>
1504
       * to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any
1505
       * required actions from the user are complete. If no Customer was provided, the payment
1506
       * method can still be <a
1507
       * href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after
1508
       * the transaction completes.
1509
       *
1510
       * <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
1511
       * dynamically optimize your payment flow and comply with regional legislation and network
1512
       * rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
1513
       *
1514
       * <p>Equal to {@code none}.
1515
       */
1516
      @SerializedName("setup_future_usage")
1517
      String setupFutureUsage;
1518
    }
1519

1520
    @Getter
1521
    @Setter
1522
    @EqualsAndHashCode(callSuper = false)
1523
    public static class AfterpayClearpay extends StripeObject {
×
1524
      /**
1525
       * Indicates that you intend to make future payments with this PaymentIntent's payment method.
1526
       *
1527
       * <p>Providing this parameter will <a
1528
       * href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a>
1529
       * to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any
1530
       * required actions from the user are complete. If no Customer was provided, the payment
1531
       * method can still be <a
1532
       * href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after
1533
       * the transaction completes.
1534
       *
1535
       * <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
1536
       * dynamically optimize your payment flow and comply with regional legislation and network
1537
       * rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
1538
       *
1539
       * <p>Equal to {@code none}.
1540
       */
1541
      @SerializedName("setup_future_usage")
1542
      String setupFutureUsage;
1543
    }
1544

1545
    @Getter
1546
    @Setter
1547
    @EqualsAndHashCode(callSuper = false)
1548
    public static class Alipay extends StripeObject {
×
1549
      /**
1550
       * Indicates that you intend to make future payments with this PaymentIntent's payment method.
1551
       *
1552
       * <p>Providing this parameter will <a
1553
       * href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a>
1554
       * to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any
1555
       * required actions from the user are complete. If no Customer was provided, the payment
1556
       * method can still be <a
1557
       * href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after
1558
       * the transaction completes.
1559
       *
1560
       * <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
1561
       * dynamically optimize your payment flow and comply with regional legislation and network
1562
       * rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
1563
       *
1564
       * <p>Equal to {@code none}.
1565
       */
1566
      @SerializedName("setup_future_usage")
1567
      String setupFutureUsage;
1568
    }
1569

1570
    @Getter
1571
    @Setter
1572
    @EqualsAndHashCode(callSuper = false)
1573
    public static class AuBecsDebit extends StripeObject {
×
1574
      /**
1575
       * Indicates that you intend to make future payments with this PaymentIntent's payment method.
1576
       *
1577
       * <p>Providing this parameter will <a
1578
       * href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a>
1579
       * to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any
1580
       * required actions from the user are complete. If no Customer was provided, the payment
1581
       * method can still be <a
1582
       * href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after
1583
       * the transaction completes.
1584
       *
1585
       * <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
1586
       * dynamically optimize your payment flow and comply with regional legislation and network
1587
       * rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
1588
       *
1589
       * <p>Equal to {@code none}.
1590
       */
1591
      @SerializedName("setup_future_usage")
1592
      String setupFutureUsage;
1593
    }
1594

1595
    @Getter
1596
    @Setter
1597
    @EqualsAndHashCode(callSuper = false)
1598
    public static class BacsDebit extends StripeObject {
×
1599
      /**
1600
       * Indicates that you intend to make future payments with this PaymentIntent's payment method.
1601
       *
1602
       * <p>Providing this parameter will <a
1603
       * href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a>
1604
       * to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any
1605
       * required actions from the user are complete. If no Customer was provided, the payment
1606
       * method can still be <a
1607
       * href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after
1608
       * the transaction completes.
1609
       *
1610
       * <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
1611
       * dynamically optimize your payment flow and comply with regional legislation and network
1612
       * rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
1613
       *
1614
       * <p>One of {@code none}, {@code off_session}, or {@code on_session}.
1615
       */
1616
      @SerializedName("setup_future_usage")
1617
      String setupFutureUsage;
1618
    }
1619

1620
    @Getter
1621
    @Setter
1622
    @EqualsAndHashCode(callSuper = false)
1623
    public static class Bancontact extends StripeObject {
×
1624
      /**
1625
       * Indicates that you intend to make future payments with this PaymentIntent's payment method.
1626
       *
1627
       * <p>Providing this parameter will <a
1628
       * href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a>
1629
       * to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any
1630
       * required actions from the user are complete. If no Customer was provided, the payment
1631
       * method can still be <a
1632
       * href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after
1633
       * the transaction completes.
1634
       *
1635
       * <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
1636
       * dynamically optimize your payment flow and comply with regional legislation and network
1637
       * rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
1638
       *
1639
       * <p>Equal to {@code none}.
1640
       */
1641
      @SerializedName("setup_future_usage")
1642
      String setupFutureUsage;
1643
    }
1644

1645
    @Getter
1646
    @Setter
1647
    @EqualsAndHashCode(callSuper = false)
1648
    public static class Boleto extends StripeObject {
×
1649
      /**
1650
       * The number of calendar days before a Boleto voucher expires. For example, if you create a
1651
       * Boleto voucher on Monday and you set expires_after_days to 2, the Boleto voucher will
1652
       * expire on Wednesday at 23:59 America/Sao_Paulo time.
1653
       */
1654
      @SerializedName("expires_after_days")
1655
      Long expiresAfterDays;
1656

1657
      /**
1658
       * Indicates that you intend to make future payments with this PaymentIntent's payment method.
1659
       *
1660
       * <p>Providing this parameter will <a
1661
       * href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a>
1662
       * to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any
1663
       * required actions from the user are complete. If no Customer was provided, the payment
1664
       * method can still be <a
1665
       * href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after
1666
       * the transaction completes.
1667
       *
1668
       * <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
1669
       * dynamically optimize your payment flow and comply with regional legislation and network
1670
       * rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
1671
       *
1672
       * <p>One of {@code none}, {@code off_session}, or {@code on_session}.
1673
       */
1674
      @SerializedName("setup_future_usage")
1675
      String setupFutureUsage;
1676
    }
1677

1678
    @Getter
1679
    @Setter
1680
    @EqualsAndHashCode(callSuper = false)
1681
    public static class Card extends StripeObject {
×
1682
      @SerializedName("installments")
1683
      Installments installments;
1684

1685
      /**
1686
       * Indicates that you intend to make future payments with this PaymentIntent's payment method.
1687
       *
1688
       * <p>Providing this parameter will <a
1689
       * href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a>
1690
       * to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any
1691
       * required actions from the user are complete. If no Customer was provided, the payment
1692
       * method can still be <a
1693
       * href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after
1694
       * the transaction completes.
1695
       *
1696
       * <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
1697
       * dynamically optimize your payment flow and comply with regional legislation and network
1698
       * rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
1699
       *
1700
       * <p>One of {@code none}, {@code off_session}, or {@code on_session}.
1701
       */
1702
      @SerializedName("setup_future_usage")
1703
      String setupFutureUsage;
1704

1705
      /**
1706
       * Provides information about a card payment that customers see on their statements.
1707
       * Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor
1708
       * that’s set on the account to form the complete statement descriptor. Maximum 22 characters.
1709
       * On card statements, the <em>concatenation</em> of both prefix and suffix (including
1710
       * separators) will appear truncated to 22 characters.
1711
       */
1712
      @SerializedName("statement_descriptor_suffix_kana")
1713
      String statementDescriptorSuffixKana;
1714

1715
      /**
1716
       * Provides information about a card payment that customers see on their statements.
1717
       * Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement
1718
       * descriptor that’s set on the account to form the complete statement descriptor. Maximum 17
1719
       * characters. On card statements, the <em>concatenation</em> of both prefix and suffix
1720
       * (including separators) will appear truncated to 17 characters.
1721
       */
1722
      @SerializedName("statement_descriptor_suffix_kanji")
1723
      String statementDescriptorSuffixKanji;
1724

1725
      @Getter
1726
      @Setter
1727
      @EqualsAndHashCode(callSuper = false)
1728
      public static class Installments extends StripeObject {
×
1729
        /** Indicates if installments are enabled. */
1730
        @SerializedName("enabled")
1731
        Boolean enabled;
1732
      }
1733
    }
1734

1735
    @Getter
1736
    @Setter
1737
    @EqualsAndHashCode(callSuper = false)
1738
    public static class Cashapp extends StripeObject {
×
1739
      /**
1740
       * Indicates that you intend to make future payments with this PaymentIntent's payment method.
1741
       *
1742
       * <p>Providing this parameter will <a
1743
       * href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a>
1744
       * to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any
1745
       * required actions from the user are complete. If no Customer was provided, the payment
1746
       * method can still be <a
1747
       * href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after
1748
       * the transaction completes.
1749
       *
1750
       * <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
1751
       * dynamically optimize your payment flow and comply with regional legislation and network
1752
       * rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
1753
       *
1754
       * <p>Equal to {@code none}.
1755
       */
1756
      @SerializedName("setup_future_usage")
1757
      String setupFutureUsage;
1758
    }
1759

1760
    @Getter
1761
    @Setter
1762
    @EqualsAndHashCode(callSuper = false)
1763
    public static class CustomerBalance extends StripeObject {
×
1764
      @SerializedName("bank_transfer")
1765
      BankTransfer bankTransfer;
1766

1767
      /**
1768
       * The funding method type to be used when there are not enough funds in the customer balance.
1769
       * Permitted values include: {@code bank_transfer}.
1770
       *
1771
       * <p>Equal to {@code bank_transfer}.
1772
       */
1773
      @SerializedName("funding_type")
1774
      String fundingType;
1775

1776
      /**
1777
       * Indicates that you intend to make future payments with this PaymentIntent's payment method.
1778
       *
1779
       * <p>Providing this parameter will <a
1780
       * href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a>
1781
       * to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any
1782
       * required actions from the user are complete. If no Customer was provided, the payment
1783
       * method can still be <a
1784
       * href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after
1785
       * the transaction completes.
1786
       *
1787
       * <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
1788
       * dynamically optimize your payment flow and comply with regional legislation and network
1789
       * rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
1790
       *
1791
       * <p>Equal to {@code none}.
1792
       */
1793
      @SerializedName("setup_future_usage")
1794
      String setupFutureUsage;
1795

1796
      @Getter
1797
      @Setter
1798
      @EqualsAndHashCode(callSuper = false)
1799
      public static class BankTransfer extends StripeObject {
×
1800
        @SerializedName("eu_bank_transfer")
1801
        EuBankTransfer euBankTransfer;
1802

1803
        /**
1804
         * List of address types that should be returned in the financial_addresses response. If not
1805
         * specified, all valid types will be returned.
1806
         *
1807
         * <p>Permitted values include: {@code sort_code}, {@code zengin}, {@code iban}, or {@code
1808
         * spei}.
1809
         */
1810
        @SerializedName("requested_address_types")
1811
        List<String> requestedAddressTypes;
1812

1813
        /**
1814
         * The bank transfer type that this PaymentIntent is allowed to use for funding Permitted
1815
         * values include: {@code eu_bank_transfer}, {@code gb_bank_transfer}, {@code
1816
         * jp_bank_transfer}, {@code mx_bank_transfer}, or {@code us_bank_transfer}.
1817
         *
1818
         * <p>One of {@code eu_bank_transfer}, {@code gb_bank_transfer}, {@code jp_bank_transfer},
1819
         * {@code mx_bank_transfer}, or {@code us_bank_transfer}.
1820
         */
1821
        @SerializedName("type")
1822
        String type;
1823

1824
        @Getter
1825
        @Setter
1826
        @EqualsAndHashCode(callSuper = false)
1827
        public static class EuBankTransfer extends StripeObject {
×
1828
          /**
1829
           * The desired country code of the bank account information. Permitted values include:
1830
           * {@code BE}, {@code DE}, {@code ES}, {@code FR}, {@code IE}, or {@code NL}.
1831
           *
1832
           * <p>One of {@code BE}, {@code DE}, {@code ES}, {@code FR}, {@code IE}, or {@code NL}.
1833
           */
1834
          @SerializedName("country")
1835
          String country;
1836
        }
1837
      }
1838
    }
1839

1840
    @Getter
1841
    @Setter
1842
    @EqualsAndHashCode(callSuper = false)
1843
    public static class Eps extends StripeObject {
×
1844
      /**
1845
       * Indicates that you intend to make future payments with this PaymentIntent's payment method.
1846
       *
1847
       * <p>Providing this parameter will <a
1848
       * href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a>
1849
       * to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any
1850
       * required actions from the user are complete. If no Customer was provided, the payment
1851
       * method can still be <a
1852
       * href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after
1853
       * the transaction completes.
1854
       *
1855
       * <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
1856
       * dynamically optimize your payment flow and comply with regional legislation and network
1857
       * rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
1858
       *
1859
       * <p>Equal to {@code none}.
1860
       */
1861
      @SerializedName("setup_future_usage")
1862
      String setupFutureUsage;
1863
    }
1864

1865
    @Getter
1866
    @Setter
1867
    @EqualsAndHashCode(callSuper = false)
1868
    public static class Fpx extends StripeObject {
×
1869
      /**
1870
       * Indicates that you intend to make future payments with this PaymentIntent's payment method.
1871
       *
1872
       * <p>Providing this parameter will <a
1873
       * href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a>
1874
       * to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any
1875
       * required actions from the user are complete. If no Customer was provided, the payment
1876
       * method can still be <a
1877
       * href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after
1878
       * the transaction completes.
1879
       *
1880
       * <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
1881
       * dynamically optimize your payment flow and comply with regional legislation and network
1882
       * rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
1883
       *
1884
       * <p>Equal to {@code none}.
1885
       */
1886
      @SerializedName("setup_future_usage")
1887
      String setupFutureUsage;
1888
    }
1889

1890
    @Getter
1891
    @Setter
1892
    @EqualsAndHashCode(callSuper = false)
1893
    public static class Giropay extends StripeObject {
×
1894
      /**
1895
       * Indicates that you intend to make future payments with this PaymentIntent's payment method.
1896
       *
1897
       * <p>Providing this parameter will <a
1898
       * href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a>
1899
       * to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any
1900
       * required actions from the user are complete. If no Customer was provided, the payment
1901
       * method can still be <a
1902
       * href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after
1903
       * the transaction completes.
1904
       *
1905
       * <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
1906
       * dynamically optimize your payment flow and comply with regional legislation and network
1907
       * rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
1908
       *
1909
       * <p>Equal to {@code none}.
1910
       */
1911
      @SerializedName("setup_future_usage")
1912
      String setupFutureUsage;
1913
    }
1914

1915
    @Getter
1916
    @Setter
1917
    @EqualsAndHashCode(callSuper = false)
1918
    public static class Grabpay extends StripeObject {
×
1919
      /**
1920
       * Indicates that you intend to make future payments with this PaymentIntent's payment method.
1921
       *
1922
       * <p>Providing this parameter will <a
1923
       * href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a>
1924
       * to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any
1925
       * required actions from the user are complete. If no Customer was provided, the payment
1926
       * method can still be <a
1927
       * href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after
1928
       * the transaction completes.
1929
       *
1930
       * <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
1931
       * dynamically optimize your payment flow and comply with regional legislation and network
1932
       * rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
1933
       *
1934
       * <p>Equal to {@code none}.
1935
       */
1936
      @SerializedName("setup_future_usage")
1937
      String setupFutureUsage;
1938
    }
1939

1940
    @Getter
1941
    @Setter
1942
    @EqualsAndHashCode(callSuper = false)
1943
    public static class Ideal extends StripeObject {
×
1944
      /**
1945
       * Indicates that you intend to make future payments with this PaymentIntent's payment method.
1946
       *
1947
       * <p>Providing this parameter will <a
1948
       * href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a>
1949
       * to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any
1950
       * required actions from the user are complete. If no Customer was provided, the payment
1951
       * method can still be <a
1952
       * href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after
1953
       * the transaction completes.
1954
       *
1955
       * <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
1956
       * dynamically optimize your payment flow and comply with regional legislation and network
1957
       * rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
1958
       *
1959
       * <p>Equal to {@code none}.
1960
       */
1961
      @SerializedName("setup_future_usage")
1962
      String setupFutureUsage;
1963
    }
1964

1965
    @Getter
1966
    @Setter
1967
    @EqualsAndHashCode(callSuper = false)
1968
    public static class Klarna extends StripeObject {
×
1969
      /**
1970
       * Indicates that you intend to make future payments with this PaymentIntent's payment method.
1971
       *
1972
       * <p>Providing this parameter will <a
1973
       * href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a>
1974
       * to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any
1975
       * required actions from the user are complete. If no Customer was provided, the payment
1976
       * method can still be <a
1977
       * href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after
1978
       * the transaction completes.
1979
       *
1980
       * <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
1981
       * dynamically optimize your payment flow and comply with regional legislation and network
1982
       * rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
1983
       *
1984
       * <p>One of {@code none}, {@code off_session}, or {@code on_session}.
1985
       */
1986
      @SerializedName("setup_future_usage")
1987
      String setupFutureUsage;
1988
    }
1989

1990
    @Getter
1991
    @Setter
1992
    @EqualsAndHashCode(callSuper = false)
1993
    public static class Konbini extends StripeObject {
×
1994
      /**
1995
       * The number of calendar days (between 1 and 60) after which Konbini payment instructions
1996
       * will expire. For example, if a PaymentIntent is confirmed with Konbini and {@code
1997
       * expires_after_days} set to 2 on Monday JST, the instructions will expire on Wednesday
1998
       * 23:59:59 JST.
1999
       */
2000
      @SerializedName("expires_after_days")
2001
      Long expiresAfterDays;
2002

2003
      /**
2004
       * Indicates that you intend to make future payments with this PaymentIntent's payment method.
2005
       *
2006
       * <p>Providing this parameter will <a
2007
       * href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a>
2008
       * to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any
2009
       * required actions from the user are complete. If no Customer was provided, the payment
2010
       * method can still be <a
2011
       * href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after
2012
       * the transaction completes.
2013
       *
2014
       * <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
2015
       * dynamically optimize your payment flow and comply with regional legislation and network
2016
       * rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
2017
       *
2018
       * <p>Equal to {@code none}.
2019
       */
2020
      @SerializedName("setup_future_usage")
2021
      String setupFutureUsage;
2022
    }
2023

2024
    @Getter
2025
    @Setter
2026
    @EqualsAndHashCode(callSuper = false)
2027
    public static class Link extends StripeObject {
×
2028
      /**
2029
       * Indicates that you intend to make future payments with this PaymentIntent's payment method.
2030
       *
2031
       * <p>Providing this parameter will <a
2032
       * href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a>
2033
       * to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any
2034
       * required actions from the user are complete. If no Customer was provided, the payment
2035
       * method can still be <a
2036
       * href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after
2037
       * the transaction completes.
2038
       *
2039
       * <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
2040
       * dynamically optimize your payment flow and comply with regional legislation and network
2041
       * rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
2042
       *
2043
       * <p>One of {@code none}, or {@code off_session}.
2044
       */
2045
      @SerializedName("setup_future_usage")
2046
      String setupFutureUsage;
2047
    }
2048

2049
    @Getter
2050
    @Setter
2051
    @EqualsAndHashCode(callSuper = false)
2052
    public static class Oxxo extends StripeObject {
×
2053
      /**
2054
       * The number of calendar days before an OXXO invoice expires. For example, if you create an
2055
       * OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on
2056
       * Wednesday at 23:59 America/Mexico_City time.
2057
       */
2058
      @SerializedName("expires_after_days")
2059
      Long expiresAfterDays;
2060

2061
      /**
2062
       * Indicates that you intend to make future payments with this PaymentIntent's payment method.
2063
       *
2064
       * <p>Providing this parameter will <a
2065
       * href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a>
2066
       * to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any
2067
       * required actions from the user are complete. If no Customer was provided, the payment
2068
       * method can still be <a
2069
       * href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after
2070
       * the transaction completes.
2071
       *
2072
       * <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
2073
       * dynamically optimize your payment flow and comply with regional legislation and network
2074
       * rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
2075
       *
2076
       * <p>Equal to {@code none}.
2077
       */
2078
      @SerializedName("setup_future_usage")
2079
      String setupFutureUsage;
2080
    }
2081

2082
    @Getter
2083
    @Setter
2084
    @EqualsAndHashCode(callSuper = false)
2085
    public static class P24 extends StripeObject {
×
2086
      /**
2087
       * Indicates that you intend to make future payments with this PaymentIntent's payment method.
2088
       *
2089
       * <p>Providing this parameter will <a
2090
       * href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a>
2091
       * to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any
2092
       * required actions from the user are complete. If no Customer was provided, the payment
2093
       * method can still be <a
2094
       * href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after
2095
       * the transaction completes.
2096
       *
2097
       * <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
2098
       * dynamically optimize your payment flow and comply with regional legislation and network
2099
       * rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
2100
       *
2101
       * <p>Equal to {@code none}.
2102
       */
2103
      @SerializedName("setup_future_usage")
2104
      String setupFutureUsage;
2105
    }
2106

2107
    @Getter
2108
    @Setter
2109
    @EqualsAndHashCode(callSuper = false)
2110
    public static class Paynow extends StripeObject {
×
2111
      /**
2112
       * Indicates that you intend to make future payments with this PaymentIntent's payment method.
2113
       *
2114
       * <p>Providing this parameter will <a
2115
       * href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a>
2116
       * to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any
2117
       * required actions from the user are complete. If no Customer was provided, the payment
2118
       * method can still be <a
2119
       * href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after
2120
       * the transaction completes.
2121
       *
2122
       * <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
2123
       * dynamically optimize your payment flow and comply with regional legislation and network
2124
       * rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
2125
       *
2126
       * <p>Equal to {@code none}.
2127
       */
2128
      @SerializedName("setup_future_usage")
2129
      String setupFutureUsage;
2130
    }
2131

2132
    @Getter
2133
    @Setter
2134
    @EqualsAndHashCode(callSuper = false)
2135
    public static class Pix extends StripeObject {
×
2136
      /** The number of seconds after which Pix payment will expire. */
2137
      @SerializedName("expires_after_seconds")
2138
      Long expiresAfterSeconds;
2139
    }
2140

2141
    @Getter
2142
    @Setter
2143
    @EqualsAndHashCode(callSuper = false)
2144
    public static class SepaDebit extends StripeObject {
×
2145
      /**
2146
       * Indicates that you intend to make future payments with this PaymentIntent's payment method.
2147
       *
2148
       * <p>Providing this parameter will <a
2149
       * href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a>
2150
       * to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any
2151
       * required actions from the user are complete. If no Customer was provided, the payment
2152
       * method can still be <a
2153
       * href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after
2154
       * the transaction completes.
2155
       *
2156
       * <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
2157
       * dynamically optimize your payment flow and comply with regional legislation and network
2158
       * rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
2159
       *
2160
       * <p>One of {@code none}, {@code off_session}, or {@code on_session}.
2161
       */
2162
      @SerializedName("setup_future_usage")
2163
      String setupFutureUsage;
2164
    }
2165

2166
    @Getter
2167
    @Setter
2168
    @EqualsAndHashCode(callSuper = false)
2169
    public static class Sofort extends StripeObject {
×
2170
      /**
2171
       * Indicates that you intend to make future payments with this PaymentIntent's payment method.
2172
       *
2173
       * <p>Providing this parameter will <a
2174
       * href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a>
2175
       * to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any
2176
       * required actions from the user are complete. If no Customer was provided, the payment
2177
       * method can still be <a
2178
       * href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after
2179
       * the transaction completes.
2180
       *
2181
       * <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
2182
       * dynamically optimize your payment flow and comply with regional legislation and network
2183
       * rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
2184
       *
2185
       * <p>Equal to {@code none}.
2186
       */
2187
      @SerializedName("setup_future_usage")
2188
      String setupFutureUsage;
2189
    }
2190

2191
    @Getter
2192
    @Setter
2193
    @EqualsAndHashCode(callSuper = false)
2194
    public static class UsBankAccount extends StripeObject {
×
2195
      @SerializedName("financial_connections")
2196
      FinancialConnections financialConnections;
2197

2198
      /**
2199
       * Indicates that you intend to make future payments with this PaymentIntent's payment method.
2200
       *
2201
       * <p>Providing this parameter will <a
2202
       * href="https://stripe.com/docs/payments/save-during-payment">attach the payment method</a>
2203
       * to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any
2204
       * required actions from the user are complete. If no Customer was provided, the payment
2205
       * method can still be <a
2206
       * href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer after
2207
       * the transaction completes.
2208
       *
2209
       * <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
2210
       * dynamically optimize your payment flow and comply with regional legislation and network
2211
       * rules, such as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
2212
       *
2213
       * <p>One of {@code none}, {@code off_session}, or {@code on_session}.
2214
       */
2215
      @SerializedName("setup_future_usage")
2216
      String setupFutureUsage;
2217

2218
      /**
2219
       * Bank account verification method.
2220
       *
2221
       * <p>One of {@code automatic}, or {@code instant}.
2222
       */
2223
      @SerializedName("verification_method")
2224
      String verificationMethod;
2225

2226
      @Getter
2227
      @Setter
2228
      @EqualsAndHashCode(callSuper = false)
2229
      public static class FinancialConnections extends StripeObject {
×
2230
        @SerializedName("manual_entry")
2231
        ManualEntry manualEntry;
2232

2233
        /**
2234
         * The list of permissions to request. The {@code payment_method} permission must be
2235
         * included.
2236
         */
2237
        @SerializedName("permissions")
2238
        List<String> permissions;
2239

2240
        /** Data features requested to be retrieved upon account creation. */
2241
        @SerializedName("prefetch")
2242
        List<String> prefetch;
2243

2244
        /**
2245
         * For webview integrations only. Upon completing OAuth login in the native browser, the
2246
         * user will be redirected to this URL to return to your app.
2247
         */
2248
        @SerializedName("return_url")
2249
        String returnUrl;
2250

2251
        @Getter
2252
        @Setter
2253
        @EqualsAndHashCode(callSuper = false)
2254
        public static class ManualEntry extends StripeObject {
×
2255
          /**
2256
           * Settings for configuring manual entry of account details.
2257
           *
2258
           * <p>One of {@code automatic}, or {@code custom}.
2259
           */
2260
          @SerializedName("mode")
2261
          String mode;
2262
        }
2263
      }
2264
    }
2265
  }
2266

2267
  @Getter
2268
  @Setter
2269
  @EqualsAndHashCode(callSuper = false)
2270
  public static class PhoneNumberCollection extends StripeObject {
1✔
2271
    /** Indicates whether phone number collection is enabled for the session. */
2272
    @SerializedName("enabled")
2273
    Boolean enabled;
2274
  }
2275

2276
  @Getter
2277
  @Setter
2278
  @EqualsAndHashCode(callSuper = false)
2279
  public static class ShippingAddressCollection extends StripeObject {
×
2280
    /**
2281
     * An array of two-letter ISO country codes representing which countries Checkout should provide
2282
     * as options for shipping locations. Unsupported country codes: {@code AS, CX, CC, CU, HM, IR,
2283
     * KP, MH, FM, NF, MP, PW, SD, SY, UM, VI}.
2284
     */
2285
    @SerializedName("allowed_countries")
2286
    List<String> allowedCountries;
2287
  }
2288

2289
  @Getter
2290
  @Setter
2291
  @EqualsAndHashCode(callSuper = false)
2292
  public static class ShippingCost extends StripeObject {
×
2293
    /** Total shipping cost before any discounts or taxes are applied. */
2294
    @SerializedName("amount_subtotal")
2295
    Long amountSubtotal;
2296

2297
    /** Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0. */
2298
    @SerializedName("amount_tax")
2299
    Long amountTax;
2300

2301
    /** Total shipping cost after discounts and taxes are applied. */
2302
    @SerializedName("amount_total")
2303
    Long amountTotal;
2304

2305
    /** The ID of the ShippingRate for this order. */
2306
    @SerializedName("shipping_rate")
2307
    @Getter(lombok.AccessLevel.NONE)
2308
    @Setter(lombok.AccessLevel.NONE)
2309
    ExpandableField<ShippingRate> shippingRate;
2310

2311
    /** The taxes applied to the shipping rate. */
2312
    @SerializedName("taxes")
2313
    List<Session.ShippingCost.Tax> taxes;
2314

2315
    /** Get ID of expandable {@code shippingRate} object. */
2316
    public String getShippingRate() {
2317
      return (this.shippingRate != null) ? this.shippingRate.getId() : null;
×
2318
    }
2319

2320
    public void setShippingRate(String id) {
2321
      this.shippingRate = ApiResource.setExpandableFieldId(id, this.shippingRate);
×
2322
    }
×
2323

2324
    /** Get expanded {@code shippingRate}. */
2325
    public ShippingRate getShippingRateObject() {
2326
      return (this.shippingRate != null) ? this.shippingRate.getExpanded() : null;
×
2327
    }
2328

2329
    public void setShippingRateObject(ShippingRate expandableObject) {
2330
      this.shippingRate =
×
2331
          new ExpandableField<ShippingRate>(expandableObject.getId(), expandableObject);
×
2332
    }
×
2333

2334
    @Getter
2335
    @Setter
2336
    @EqualsAndHashCode(callSuper = false)
2337
    public static class Tax extends StripeObject {
×
2338
      /** Amount of tax applied for this rate. */
2339
      @SerializedName("amount")
2340
      Long amount;
2341

2342
      /**
2343
       * Tax rates can be applied to <a
2344
       * href="https://stripe.com/docs/billing/invoices/tax-rates">invoices</a>, <a
2345
       * href="https://stripe.com/docs/billing/subscriptions/taxes">subscriptions</a> and <a
2346
       * href="https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates">Checkout
2347
       * Sessions</a> to collect tax.
2348
       *
2349
       * <p>Related guide: <a href="https://stripe.com/docs/billing/taxes/tax-rates">Tax rates</a>
2350
       */
2351
      @SerializedName("rate")
2352
      TaxRate rate;
2353

2354
      /**
2355
       * The reasoning behind this tax, for example, if the product is tax exempt. The possible
2356
       * values for this field may be extended as new tax rules are supported.
2357
       *
2358
       * <p>One of {@code customer_exempt}, {@code not_collecting}, {@code not_subject_to_tax},
2359
       * {@code not_supported}, {@code portion_product_exempt}, {@code portion_reduced_rated},
2360
       * {@code portion_standard_rated}, {@code product_exempt}, {@code product_exempt_holiday},
2361
       * {@code proportionally_rated}, {@code reduced_rated}, {@code reverse_charge}, {@code
2362
       * standard_rated}, {@code taxable_basis_reduced}, or {@code zero_rated}.
2363
       */
2364
      @SerializedName("taxability_reason")
2365
      String taxabilityReason;
2366

2367
      /** The amount on which tax is calculated, in cents (or local equivalent). */
2368
      @SerializedName("taxable_amount")
2369
      Long taxableAmount;
2370
    }
2371
  }
2372

2373
  @Getter
2374
  @Setter
2375
  @EqualsAndHashCode(callSuper = false)
2376
  public static class ShippingOption extends StripeObject {
×
2377
    /** A non-negative integer in cents representing how much to charge. */
2378
    @SerializedName("shipping_amount")
2379
    Long shippingAmount;
2380

2381
    /** The shipping rate. */
2382
    @SerializedName("shipping_rate")
2383
    @Getter(lombok.AccessLevel.NONE)
2384
    @Setter(lombok.AccessLevel.NONE)
2385
    ExpandableField<ShippingRate> shippingRate;
2386

2387
    /** Get ID of expandable {@code shippingRate} object. */
2388
    public String getShippingRate() {
2389
      return (this.shippingRate != null) ? this.shippingRate.getId() : null;
×
2390
    }
2391

2392
    public void setShippingRate(String id) {
2393
      this.shippingRate = ApiResource.setExpandableFieldId(id, this.shippingRate);
×
2394
    }
×
2395

2396
    /** Get expanded {@code shippingRate}. */
2397
    public ShippingRate getShippingRateObject() {
2398
      return (this.shippingRate != null) ? this.shippingRate.getExpanded() : null;
×
2399
    }
2400

2401
    public void setShippingRateObject(ShippingRate expandableObject) {
2402
      this.shippingRate =
×
2403
          new ExpandableField<ShippingRate>(expandableObject.getId(), expandableObject);
×
2404
    }
×
2405
  }
2406

2407
  @Getter
2408
  @Setter
2409
  @EqualsAndHashCode(callSuper = false)
2410
  public static class TaxIdCollection extends StripeObject {
×
2411
    /** Indicates whether tax ID collection is enabled for the session. */
2412
    @SerializedName("enabled")
2413
    Boolean enabled;
2414
  }
2415

2416
  @Getter
2417
  @Setter
2418
  @EqualsAndHashCode(callSuper = false)
2419
  public static class TotalDetails extends StripeObject {
×
2420
    /** This is the sum of all the discounts. */
2421
    @SerializedName("amount_discount")
2422
    Long amountDiscount;
2423

2424
    /** This is the sum of all the shipping amounts. */
2425
    @SerializedName("amount_shipping")
2426
    Long amountShipping;
2427

2428
    /** This is the sum of all the tax amounts. */
2429
    @SerializedName("amount_tax")
2430
    Long amountTax;
2431

2432
    @SerializedName("breakdown")
2433
    Breakdown breakdown;
2434

2435
    @Getter
2436
    @Setter
2437
    @EqualsAndHashCode(callSuper = false)
2438
    public static class Breakdown extends StripeObject {
×
2439
      /** The aggregated discounts. */
2440
      @SerializedName("discounts")
2441
      List<Session.TotalDetails.Breakdown.Discount> discounts;
2442

2443
      /** The aggregated tax amounts by rate. */
2444
      @SerializedName("taxes")
2445
      List<Session.TotalDetails.Breakdown.Tax> taxes;
2446

2447
      @Getter
2448
      @Setter
2449
      @EqualsAndHashCode(callSuper = false)
2450
      public static class Discount extends StripeObject {
×
2451
        /** The amount discounted. */
2452
        @SerializedName("amount")
2453
        Long amount;
2454

2455
        /**
2456
         * A discount represents the actual application of a <a
2457
         * href="https://stripe.com/docs/api#coupons">coupon</a> or <a
2458
         * href="https://stripe.com/docs/api#promotion_codes">promotion code</a>. It contains
2459
         * information about when the discount began, when it will end, and what it is applied to.
2460
         *
2461
         * <p>Related guide: <a
2462
         * href="https://stripe.com/docs/billing/subscriptions/discounts">Applying discounts to
2463
         * subscriptions</a>
2464
         */
2465
        @SerializedName("discount")
2466
        Discount discount;
2467
      }
2468

2469
      @Getter
2470
      @Setter
2471
      @EqualsAndHashCode(callSuper = false)
2472
      public static class Tax extends StripeObject {
×
2473
        /** Amount of tax applied for this rate. */
2474
        @SerializedName("amount")
2475
        Long amount;
2476

2477
        /**
2478
         * Tax rates can be applied to <a
2479
         * href="https://stripe.com/docs/billing/invoices/tax-rates">invoices</a>, <a
2480
         * href="https://stripe.com/docs/billing/subscriptions/taxes">subscriptions</a> and <a
2481
         * href="https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates">Checkout
2482
         * Sessions</a> to collect tax.
2483
         *
2484
         * <p>Related guide: <a href="https://stripe.com/docs/billing/taxes/tax-rates">Tax rates</a>
2485
         */
2486
        @SerializedName("rate")
2487
        TaxRate rate;
2488

2489
        /**
2490
         * The reasoning behind this tax, for example, if the product is tax exempt. The possible
2491
         * values for this field may be extended as new tax rules are supported.
2492
         *
2493
         * <p>One of {@code customer_exempt}, {@code not_collecting}, {@code not_subject_to_tax},
2494
         * {@code not_supported}, {@code portion_product_exempt}, {@code portion_reduced_rated},
2495
         * {@code portion_standard_rated}, {@code product_exempt}, {@code product_exempt_holiday},
2496
         * {@code proportionally_rated}, {@code reduced_rated}, {@code reverse_charge}, {@code
2497
         * standard_rated}, {@code taxable_basis_reduced}, or {@code zero_rated}.
2498
         */
2499
        @SerializedName("taxability_reason")
2500
        String taxabilityReason;
2501

2502
        /** The amount on which tax is calculated, in cents (or local equivalent). */
2503
        @SerializedName("taxable_amount")
2504
        Long taxableAmount;
2505
      }
2506
    }
2507
  }
2508

2509
  @Override
2510
  public void setResponseGetter(StripeResponseGetter responseGetter) {
2511
    super.setResponseGetter(responseGetter);
1✔
2512
    trySetResponseGetter(afterExpiration, responseGetter);
1✔
2513
    trySetResponseGetter(automaticTax, responseGetter);
1✔
2514
    trySetResponseGetter(consent, responseGetter);
1✔
2515
    trySetResponseGetter(consentCollection, responseGetter);
1✔
2516
    trySetResponseGetter(currencyConversion, responseGetter);
1✔
2517
    trySetResponseGetter(customText, responseGetter);
1✔
2518
    trySetResponseGetter(customer, responseGetter);
1✔
2519
    trySetResponseGetter(customerDetails, responseGetter);
1✔
2520
    trySetResponseGetter(invoice, responseGetter);
1✔
2521
    trySetResponseGetter(invoiceCreation, responseGetter);
1✔
2522
    trySetResponseGetter(lineItems, responseGetter);
1✔
2523
    trySetResponseGetter(paymentIntent, responseGetter);
1✔
2524
    trySetResponseGetter(paymentLink, responseGetter);
1✔
2525
    trySetResponseGetter(paymentMethodConfigurationDetails, responseGetter);
1✔
2526
    trySetResponseGetter(paymentMethodOptions, responseGetter);
1✔
2527
    trySetResponseGetter(phoneNumberCollection, responseGetter);
1✔
2528
    trySetResponseGetter(setupIntent, responseGetter);
1✔
2529
    trySetResponseGetter(shippingAddressCollection, responseGetter);
1✔
2530
    trySetResponseGetter(shippingCost, responseGetter);
1✔
2531
    trySetResponseGetter(shippingDetails, responseGetter);
1✔
2532
    trySetResponseGetter(subscription, responseGetter);
1✔
2533
    trySetResponseGetter(taxIdCollection, responseGetter);
1✔
2534
    trySetResponseGetter(totalDetails, responseGetter);
1✔
2535
  }
1✔
2536
}
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