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

stripe / stripe-java / #16517

08 Oct 2024 06:27PM UTC coverage: 12.74% (-0.2%) from 12.899%
#16517

push

github

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

Update generated code for beta

53 of 2404 new or added lines in 50 files covered. (2.2%)

91 existing lines in 27 files now uncovered.

18753 of 147196 relevant lines covered (12.74%)

0.13 hits per line

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

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

4
import com.google.gson.annotations.SerializedName;
5
import com.stripe.exception.StripeException;
6
import com.stripe.net.ApiRequest;
7
import com.stripe.net.ApiRequestParams;
8
import com.stripe.net.ApiResource;
9
import com.stripe.net.BaseAddress;
10
import com.stripe.net.RequestOptions;
11
import com.stripe.net.StripeResponseGetter;
12
import com.stripe.param.OrderCancelParams;
13
import com.stripe.param.OrderCreateParams;
14
import com.stripe.param.OrderListLineItemsParams;
15
import com.stripe.param.OrderListParams;
16
import com.stripe.param.OrderReopenParams;
17
import com.stripe.param.OrderRetrieveParams;
18
import com.stripe.param.OrderSubmitParams;
19
import com.stripe.param.OrderUpdateParams;
20
import java.util.List;
21
import java.util.Map;
22
import java.util.stream.Collectors;
23
import lombok.EqualsAndHashCode;
24
import lombok.Getter;
25
import lombok.Setter;
26

27
/**
28
 * An Order describes a purchase being made by a customer, including the products & quantities
29
 * being purchased, the order status, the payment information, and the billing/shipping details.
30
 *
31
 * <p>Related guide: <a href="https://stripe.com/docs/orders">Orders overview</a>
32
 */
33
@Getter
34
@Setter
35
@EqualsAndHashCode(callSuper = false)
36
public class Order extends ApiResource implements HasId, MetadataStore<Order> {
×
37
  @SerializedName("amount_remaining")
38
  Long amountRemaining;
39

40
  /**
41
   * Order cost before any discounts or taxes are applied. A positive integer representing the
42
   * subtotal of the order in the <a href="https://stripe.com/docs/currencies#zero-decimal">smallest
43
   * currency unit</a> (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal
44
   * currency).
45
   */
46
  @SerializedName("amount_subtotal")
47
  Long amountSubtotal;
48

49
  /**
50
   * Total order cost after discounts and taxes are applied. A positive integer representing the
51
   * cost of the order in the <a href="https://stripe.com/docs/currencies#zero-decimal">smallest
52
   * currency unit</a> (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal
53
   * currency). To submit an order, the total must be either 0 or at least $0.50 USD or <a
54
   * href="https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts">equivalent in
55
   * charge currency</a>.
56
   */
57
  @SerializedName("amount_total")
58
  Long amountTotal;
59

60
  /** ID of the Connect application that created the Order, if any. */
61
  @SerializedName("application")
62
  @Getter(lombok.AccessLevel.NONE)
63
  @Setter(lombok.AccessLevel.NONE)
64
  ExpandableField<Application> application;
65

66
  @SerializedName("automatic_tax")
67
  AutomaticTax automaticTax;
68

69
  /** Customer billing details associated with the order. */
70
  @SerializedName("billing_details")
71
  BillingDetails billingDetails;
72

73
  /**
74
   * The client secret of this Order. Used for client-side retrieval using a publishable key.
75
   *
76
   * <p>The client secret can be used to complete a payment for an Order from your frontend. It
77
   * should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer.
78
   * Make sure that you have TLS enabled on any page that includes the client secret.
79
   *
80
   * <p>Refer to our docs for <a
81
   * href="https://stripe.com/docs/orders-beta/create-and-process">creating and processing an
82
   * order</a> to learn about how client_secret should be handled.
83
   */
84
  @SerializedName("client_secret")
85
  String clientSecret;
86

87
  /** Time at which the object was created. Measured in seconds since the Unix epoch. */
88
  @SerializedName("created")
89
  Long created;
90

91
  /** The credits applied to the Order. At most 10 credits can be applied to an Order. */
92
  @SerializedName("credits")
93
  List<Order.Credit> credits;
94

95
  /**
96
   * Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>,
97
   * in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
98
   */
99
  @SerializedName("currency")
100
  String currency;
101

102
  /** The customer which this orders belongs to. */
103
  @SerializedName("customer")
104
  @Getter(lombok.AccessLevel.NONE)
105
  @Setter(lombok.AccessLevel.NONE)
106
  ExpandableField<Customer> customer;
107

108
  /** An arbitrary string attached to the object. Often useful for displaying to users. */
109
  @SerializedName("description")
110
  String description;
111

112
  /** The discounts applied to the order. Use {@code expand[]=discounts} to expand each discount. */
113
  @SerializedName("discounts")
114
  List<ExpandableField<com.stripe.model.Discount>> discounts;
115

116
  /** Unique identifier for the object. */
117
  @Getter(onMethod_ = {@Override})
118
  @SerializedName("id")
119
  String id;
120

121
  /** A recent IP address of the purchaser used for tax reporting and tax location inference. */
122
  @SerializedName("ip_address")
123
  String ipAddress;
124

125
  /**
126
   * A list of line items the customer is ordering. Each line item includes information about the
127
   * product, the quantity, and the resulting cost. There is a maximum of 100 line items.
128
   */
129
  @SerializedName("line_items")
130
  LineItemCollection lineItems;
131

132
  /**
133
   * Has the value {@code true} if the object exists in live mode or the value {@code false} if the
134
   * object exists in test mode.
135
   */
136
  @SerializedName("livemode")
137
  Boolean livemode;
138

139
  /**
140
   * Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach
141
   * to an object. This can be useful for storing additional information about the object in a
142
   * structured format.
143
   */
144
  @Getter(onMethod_ = {@Override})
145
  @SerializedName("metadata")
146
  Map<String, String> metadata;
147

148
  /**
149
   * String representing the object's type. Objects of the same type share the same value.
150
   *
151
   * <p>Equal to {@code order}.
152
   */
153
  @SerializedName("object")
154
  String object;
155

156
  @SerializedName("payment")
157
  Payment payment;
158

159
  /** The details of the customer cost of shipping, including the customer chosen ShippingRate. */
160
  @SerializedName("shipping_cost")
161
  ShippingCost shippingCost;
162

163
  /** Customer shipping information associated with the order. */
164
  @SerializedName("shipping_details")
165
  ShippingDetails shippingDetails;
166

167
  /**
168
   * The overall status of the order.
169
   *
170
   * <p>One of {@code canceled}, {@code complete}, {@code open}, {@code processing}, or {@code
171
   * submitted}.
172
   */
173
  @SerializedName("status")
174
  String status;
175

176
  @SerializedName("tax_details")
177
  TaxDetails taxDetails;
178

179
  @SerializedName("total_details")
180
  TotalDetails totalDetails;
181

182
  /** Get ID of expandable {@code application} object. */
183
  public String getApplication() {
184
    return (this.application != null) ? this.application.getId() : null;
×
185
  }
186

187
  public void setApplication(String id) {
188
    this.application = ApiResource.setExpandableFieldId(id, this.application);
×
189
  }
×
190

191
  /** Get expanded {@code application}. */
192
  public Application getApplicationObject() {
193
    return (this.application != null) ? this.application.getExpanded() : null;
×
194
  }
195

196
  public void setApplicationObject(Application expandableObject) {
197
    this.application = new ExpandableField<Application>(expandableObject.getId(), expandableObject);
×
198
  }
×
199

200
  /** Get ID of expandable {@code customer} object. */
201
  public String getCustomer() {
202
    return (this.customer != null) ? this.customer.getId() : null;
×
203
  }
204

205
  public void setCustomer(String id) {
206
    this.customer = ApiResource.setExpandableFieldId(id, this.customer);
×
207
  }
×
208

209
  /** Get expanded {@code customer}. */
210
  public Customer getCustomerObject() {
211
    return (this.customer != null) ? this.customer.getExpanded() : null;
×
212
  }
213

214
  public void setCustomerObject(Customer expandableObject) {
215
    this.customer = new ExpandableField<Customer>(expandableObject.getId(), expandableObject);
×
216
  }
×
217

218
  /** Get IDs of expandable {@code discounts} object list. */
219
  public List<String> getDiscounts() {
220
    return (this.discounts != null)
×
221
        ? this.discounts.stream().map(x -> x.getId()).collect(Collectors.toList())
×
222
        : null;
×
223
  }
224

225
  public void setDiscounts(List<String> ids) {
226
    if (ids == null) {
×
227
      this.discounts = null;
×
228
      return;
×
229
    }
230
    if (this.discounts != null
×
231
        && this.discounts.stream().map(x -> x.getId()).collect(Collectors.toList()).equals(ids)) {
×
232
      // noop if the ids are equal to what are already present
233
      return;
×
234
    }
235
    this.discounts =
×
236
        (ids != null)
×
237
            ? ids.stream()
×
238
                .map(id -> new ExpandableField<com.stripe.model.Discount>(id, null))
×
239
                .collect(Collectors.toList())
×
240
            : null;
×
241
  }
×
242

243
  /** Get expanded {@code discounts}. */
244
  public List<com.stripe.model.Discount> getDiscountObjects() {
245
    return (this.discounts != null)
×
246
        ? this.discounts.stream().map(x -> x.getExpanded()).collect(Collectors.toList())
×
247
        : null;
×
248
  }
249

250
  public void setDiscountObjects(List<com.stripe.model.Discount> objs) {
251
    this.discounts =
×
252
        objs != null
×
253
            ? objs.stream()
×
254
                .map(x -> new ExpandableField<com.stripe.model.Discount>(x.getId(), x))
×
255
                .collect(Collectors.toList())
×
256
            : null;
×
257
  }
×
258

259
  /** Cancels the order as well as the payment intent if one is attached. */
260
  public Order cancel() throws StripeException {
261
    return cancel((Map<String, Object>) null, (RequestOptions) null);
×
262
  }
263

264
  /** Cancels the order as well as the payment intent if one is attached. */
265
  public Order cancel(RequestOptions options) throws StripeException {
266
    return cancel((Map<String, Object>) null, options);
×
267
  }
268

269
  /** Cancels the order as well as the payment intent if one is attached. */
270
  public Order cancel(Map<String, Object> params) throws StripeException {
271
    return cancel(params, (RequestOptions) null);
×
272
  }
273

274
  /** Cancels the order as well as the payment intent if one is attached. */
275
  public Order cancel(Map<String, Object> params, RequestOptions options) throws StripeException {
276
    String path = String.format("/v1/orders/%s/cancel", ApiResource.urlEncodeId(this.getId()));
×
277
    ApiRequest request =
×
278
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
279
    return getResponseGetter().request(request, Order.class);
×
280
  }
281

282
  /** Cancels the order as well as the payment intent if one is attached. */
283
  public Order cancel(OrderCancelParams params) throws StripeException {
284
    return cancel(params, (RequestOptions) null);
×
285
  }
286

287
  /** Cancels the order as well as the payment intent if one is attached. */
288
  public Order cancel(OrderCancelParams params, RequestOptions options) throws StripeException {
289
    String path = String.format("/v1/orders/%s/cancel", ApiResource.urlEncodeId(this.getId()));
×
290
    ApiResource.checkNullTypedParams(path, params);
×
291
    ApiRequest request =
×
292
        new ApiRequest(
293
            BaseAddress.API,
294
            ApiResource.RequestMethod.POST,
295
            path,
296
            ApiRequestParams.paramsToMap(params),
×
297
            options);
298
    return getResponseGetter().request(request, Order.class);
×
299
  }
300

301
  /** Creates a new {@code open} order object. */
302
  public static Order create(Map<String, Object> params) throws StripeException {
303
    return create(params, (RequestOptions) null);
×
304
  }
305

306
  /** Creates a new {@code open} order object. */
307
  public static Order create(Map<String, Object> params, RequestOptions options)
308
      throws StripeException {
309
    String path = "/v1/orders";
×
310
    ApiRequest request =
×
311
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
312
    return getGlobalResponseGetter().request(request, Order.class);
×
313
  }
314

315
  /** Creates a new {@code open} order object. */
316
  public static Order create(OrderCreateParams params) throws StripeException {
317
    return create(params, (RequestOptions) null);
×
318
  }
319

320
  /** Creates a new {@code open} order object. */
321
  public static Order create(OrderCreateParams params, RequestOptions options)
322
      throws StripeException {
323
    String path = "/v1/orders";
×
324
    ApiResource.checkNullTypedParams(path, params);
×
325
    ApiRequest request =
×
326
        new ApiRequest(
327
            BaseAddress.API,
328
            ApiResource.RequestMethod.POST,
329
            path,
330
            ApiRequestParams.paramsToMap(params),
×
331
            options);
332
    return getGlobalResponseGetter().request(request, Order.class);
×
333
  }
334

335
  /**
336
   * Returns a list of your orders. The orders are returned sorted by creation date, with the most
337
   * recently created orders appearing first.
338
   */
339
  public static OrderCollection list(Map<String, Object> params) throws StripeException {
340
    return list(params, (RequestOptions) null);
×
341
  }
342

343
  /**
344
   * Returns a list of your orders. The orders are returned sorted by creation date, with the most
345
   * recently created orders appearing first.
346
   */
347
  public static OrderCollection list(Map<String, Object> params, RequestOptions options)
348
      throws StripeException {
349
    String path = "/v1/orders";
×
350
    ApiRequest request =
×
351
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
352
    return getGlobalResponseGetter().request(request, OrderCollection.class);
×
353
  }
354

355
  /**
356
   * Returns a list of your orders. The orders are returned sorted by creation date, with the most
357
   * recently created orders appearing first.
358
   */
359
  public static OrderCollection list(OrderListParams params) throws StripeException {
360
    return list(params, (RequestOptions) null);
×
361
  }
362

363
  /**
364
   * Returns a list of your orders. The orders are returned sorted by creation date, with the most
365
   * recently created orders appearing first.
366
   */
367
  public static OrderCollection list(OrderListParams params, RequestOptions options)
368
      throws StripeException {
369
    String path = "/v1/orders";
×
370
    ApiResource.checkNullTypedParams(path, params);
×
371
    ApiRequest request =
×
372
        new ApiRequest(
373
            BaseAddress.API,
374
            ApiResource.RequestMethod.GET,
375
            path,
376
            ApiRequestParams.paramsToMap(params),
×
377
            options);
378
    return getGlobalResponseGetter().request(request, OrderCollection.class);
×
379
  }
380

381
  /**
382
   * When retrieving an order, there is an includable <strong>line_items</strong> property
383
   * containing the first handful of those items. There is also a URL where you can retrieve the
384
   * full (paginated) list of line items.
385
   */
386
  public LineItemCollection listLineItems() throws StripeException {
387
    return listLineItems((Map<String, Object>) null, (RequestOptions) null);
×
388
  }
389

390
  /**
391
   * When retrieving an order, there is an includable <strong>line_items</strong> property
392
   * containing the first handful of those items. There is also a URL where you can retrieve the
393
   * full (paginated) list of line items.
394
   */
395
  public LineItemCollection listLineItems(Map<String, Object> params) throws StripeException {
396
    return listLineItems(params, (RequestOptions) null);
×
397
  }
398

399
  /**
400
   * When retrieving an order, there is an includable <strong>line_items</strong> property
401
   * containing the first handful of those items. There is also a URL where you can retrieve the
402
   * full (paginated) list of line items.
403
   */
404
  public LineItemCollection listLineItems(Map<String, Object> params, RequestOptions options)
405
      throws StripeException {
406
    String path = String.format("/v1/orders/%s/line_items", ApiResource.urlEncodeId(this.getId()));
×
407
    ApiRequest request =
×
408
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
409
    return getResponseGetter().request(request, LineItemCollection.class);
×
410
  }
411

412
  /**
413
   * When retrieving an order, there is an includable <strong>line_items</strong> property
414
   * containing the first handful of those items. There is also a URL where you can retrieve the
415
   * full (paginated) list of line items.
416
   */
417
  public LineItemCollection listLineItems(OrderListLineItemsParams params) throws StripeException {
418
    return listLineItems(params, (RequestOptions) null);
×
419
  }
420

421
  /**
422
   * When retrieving an order, there is an includable <strong>line_items</strong> property
423
   * containing the first handful of those items. There is also a URL where you can retrieve the
424
   * full (paginated) list of line items.
425
   */
426
  public LineItemCollection listLineItems(OrderListLineItemsParams params, RequestOptions options)
427
      throws StripeException {
428
    String path = String.format("/v1/orders/%s/line_items", ApiResource.urlEncodeId(this.getId()));
×
429
    ApiResource.checkNullTypedParams(path, params);
×
430
    ApiRequest request =
×
431
        new ApiRequest(
432
            BaseAddress.API,
433
            ApiResource.RequestMethod.GET,
434
            path,
435
            ApiRequestParams.paramsToMap(params),
×
436
            options);
437
    return getResponseGetter().request(request, LineItemCollection.class);
×
438
  }
439

440
  /** Reopens a {@code submitted} order. */
441
  public Order reopen() throws StripeException {
442
    return reopen((Map<String, Object>) null, (RequestOptions) null);
×
443
  }
444

445
  /** Reopens a {@code submitted} order. */
446
  public Order reopen(RequestOptions options) throws StripeException {
447
    return reopen((Map<String, Object>) null, options);
×
448
  }
449

450
  /** Reopens a {@code submitted} order. */
451
  public Order reopen(Map<String, Object> params) throws StripeException {
452
    return reopen(params, (RequestOptions) null);
×
453
  }
454

455
  /** Reopens a {@code submitted} order. */
456
  public Order reopen(Map<String, Object> params, RequestOptions options) throws StripeException {
457
    String path = String.format("/v1/orders/%s/reopen", ApiResource.urlEncodeId(this.getId()));
×
458
    ApiRequest request =
×
459
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
460
    return getResponseGetter().request(request, Order.class);
×
461
  }
462

463
  /** Reopens a {@code submitted} order. */
464
  public Order reopen(OrderReopenParams params) throws StripeException {
465
    return reopen(params, (RequestOptions) null);
×
466
  }
467

468
  /** Reopens a {@code submitted} order. */
469
  public Order reopen(OrderReopenParams params, RequestOptions options) throws StripeException {
470
    String path = String.format("/v1/orders/%s/reopen", ApiResource.urlEncodeId(this.getId()));
×
471
    ApiResource.checkNullTypedParams(path, params);
×
472
    ApiRequest request =
×
473
        new ApiRequest(
474
            BaseAddress.API,
475
            ApiResource.RequestMethod.POST,
476
            path,
477
            ApiRequestParams.paramsToMap(params),
×
478
            options);
479
    return getResponseGetter().request(request, Order.class);
×
480
  }
481

482
  /**
483
   * Retrieves the details of an existing order. Supply the unique order ID from either an order
484
   * creation request or the order list, and Stripe will return the corresponding order information.
485
   */
486
  public static Order retrieve(String id) throws StripeException {
487
    return retrieve(id, (Map<String, Object>) null, (RequestOptions) null);
×
488
  }
489

490
  /**
491
   * Retrieves the details of an existing order. Supply the unique order ID from either an order
492
   * creation request or the order list, and Stripe will return the corresponding order information.
493
   */
494
  public static Order retrieve(String id, RequestOptions options) throws StripeException {
495
    return retrieve(id, (Map<String, Object>) null, options);
×
496
  }
497

498
  /**
499
   * Retrieves the details of an existing order. Supply the unique order ID from either an order
500
   * creation request or the order list, and Stripe will return the corresponding order information.
501
   */
502
  public static Order retrieve(String id, Map<String, Object> params, RequestOptions options)
503
      throws StripeException {
504
    String path = String.format("/v1/orders/%s", ApiResource.urlEncodeId(id));
×
505
    ApiRequest request =
×
506
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
507
    return getGlobalResponseGetter().request(request, Order.class);
×
508
  }
509

510
  /**
511
   * Retrieves the details of an existing order. Supply the unique order ID from either an order
512
   * creation request or the order list, and Stripe will return the corresponding order information.
513
   */
514
  public static Order retrieve(String id, OrderRetrieveParams params, RequestOptions options)
515
      throws StripeException {
516
    String path = String.format("/v1/orders/%s", ApiResource.urlEncodeId(id));
×
517
    ApiResource.checkNullTypedParams(path, params);
×
518
    ApiRequest request =
×
519
        new ApiRequest(
520
            BaseAddress.API,
521
            ApiResource.RequestMethod.GET,
522
            path,
523
            ApiRequestParams.paramsToMap(params),
×
524
            options);
525
    return getGlobalResponseGetter().request(request, Order.class);
×
526
  }
527

528
  /**
529
   * Submitting an Order transitions the status to {@code processing} and creates a PaymentIntent
530
   * object so the order can be paid. If the Order has an {@code amount_total} of 0, no
531
   * PaymentIntent object will be created. Once the order is submitted, its contents cannot be
532
   * changed, unless the <a href="https://stripe.com/docs/api#reopen_order">reopen</a> method is
533
   * called.
534
   */
535
  public Order submit(Map<String, Object> params) throws StripeException {
536
    return submit(params, (RequestOptions) null);
×
537
  }
538

539
  /**
540
   * Submitting an Order transitions the status to {@code processing} and creates a PaymentIntent
541
   * object so the order can be paid. If the Order has an {@code amount_total} of 0, no
542
   * PaymentIntent object will be created. Once the order is submitted, its contents cannot be
543
   * changed, unless the <a href="https://stripe.com/docs/api#reopen_order">reopen</a> method is
544
   * called.
545
   */
546
  public Order submit(Map<String, Object> params, RequestOptions options) throws StripeException {
547
    String path = String.format("/v1/orders/%s/submit", ApiResource.urlEncodeId(this.getId()));
×
548
    ApiRequest request =
×
549
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
550
    return getResponseGetter().request(request, Order.class);
×
551
  }
552

553
  /**
554
   * Submitting an Order transitions the status to {@code processing} and creates a PaymentIntent
555
   * object so the order can be paid. If the Order has an {@code amount_total} of 0, no
556
   * PaymentIntent object will be created. Once the order is submitted, its contents cannot be
557
   * changed, unless the <a href="https://stripe.com/docs/api#reopen_order">reopen</a> method is
558
   * called.
559
   */
560
  public Order submit(OrderSubmitParams params) throws StripeException {
561
    return submit(params, (RequestOptions) null);
×
562
  }
563

564
  /**
565
   * Submitting an Order transitions the status to {@code processing} and creates a PaymentIntent
566
   * object so the order can be paid. If the Order has an {@code amount_total} of 0, no
567
   * PaymentIntent object will be created. Once the order is submitted, its contents cannot be
568
   * changed, unless the <a href="https://stripe.com/docs/api#reopen_order">reopen</a> method is
569
   * called.
570
   */
571
  public Order submit(OrderSubmitParams params, RequestOptions options) throws StripeException {
572
    String path = String.format("/v1/orders/%s/submit", ApiResource.urlEncodeId(this.getId()));
×
573
    ApiResource.checkNullTypedParams(path, params);
×
574
    ApiRequest request =
×
575
        new ApiRequest(
576
            BaseAddress.API,
577
            ApiResource.RequestMethod.POST,
578
            path,
579
            ApiRequestParams.paramsToMap(params),
×
580
            options);
581
    return getResponseGetter().request(request, Order.class);
×
582
  }
583

584
  /**
585
   * Updates the specific order by setting the values of the parameters passed. Any parameters not
586
   * provided will be left unchanged.
587
   */
588
  @Override
589
  public Order update(Map<String, Object> params) throws StripeException {
590
    return update(params, (RequestOptions) null);
×
591
  }
592

593
  /**
594
   * Updates the specific order by setting the values of the parameters passed. Any parameters not
595
   * provided will be left unchanged.
596
   */
597
  @Override
598
  public Order update(Map<String, Object> params, RequestOptions options) throws StripeException {
599
    String path = String.format("/v1/orders/%s", ApiResource.urlEncodeId(this.getId()));
×
600
    ApiRequest request =
×
601
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
602
    return getResponseGetter().request(request, Order.class);
×
603
  }
604

605
  /**
606
   * Updates the specific order by setting the values of the parameters passed. Any parameters not
607
   * provided will be left unchanged.
608
   */
609
  public Order update(OrderUpdateParams params) throws StripeException {
610
    return update(params, (RequestOptions) null);
×
611
  }
612

613
  /**
614
   * Updates the specific order by setting the values of the parameters passed. Any parameters not
615
   * provided will be left unchanged.
616
   */
617
  public Order update(OrderUpdateParams params, RequestOptions options) throws StripeException {
618
    String path = String.format("/v1/orders/%s", ApiResource.urlEncodeId(this.getId()));
×
619
    ApiResource.checkNullTypedParams(path, params);
×
620
    ApiRequest request =
×
621
        new ApiRequest(
622
            BaseAddress.API,
623
            ApiResource.RequestMethod.POST,
624
            path,
625
            ApiRequestParams.paramsToMap(params),
×
626
            options);
627
    return getResponseGetter().request(request, Order.class);
×
628
  }
629

630
  @Getter
631
  @Setter
632
  @EqualsAndHashCode(callSuper = false)
633
  public static class AutomaticTax extends StripeObject {
×
634
    /** Whether Stripe automatically computes tax on this Order. */
635
    @SerializedName("enabled")
636
    Boolean enabled;
637

638
    /**
639
     * The status of the most recent automated tax calculation for this Order.
640
     *
641
     * <p>One of {@code complete}, {@code failed}, or {@code requires_location_inputs}.
642
     */
643
    @SerializedName("status")
644
    String status;
645
  }
646

647
  @Getter
648
  @Setter
649
  @EqualsAndHashCode(callSuper = false)
650
  public static class BillingDetails extends StripeObject {
×
651
    /** Billing address for the order. */
652
    @SerializedName("address")
653
    Address address;
654

655
    /** Email address for the order. */
656
    @SerializedName("email")
657
    String email;
658

659
    /** Full name for the order. */
660
    @SerializedName("name")
661
    String name;
662

663
    /** Billing phone number for the order (including extension). */
664
    @SerializedName("phone")
665
    String phone;
666
  }
667

668
  @Getter
669
  @Setter
670
  @EqualsAndHashCode(callSuper = false)
671
  public static class Credit extends StripeObject {
×
672
    /** The amount of this credit to apply to the order. */
673
    @SerializedName("amount")
674
    Long amount;
675

676
    /** Details for a gift card. */
677
    @SerializedName("gift_card")
678
    GiftCard giftCard;
679

680
    /** Line items on this order that are ineligible for this credit. */
681
    @SerializedName("ineligible_line_items")
682
    List<String> ineligibleLineItems;
683

684
    /**
685
     * The type of credit to apply to the order, only {@code gift_card} currently supported.
686
     *
687
     * <p>Equal to {@code gift_card}.
688
     */
689
    @SerializedName("type")
690
    String type;
691

692
    @Getter
693
    @Setter
694
    @EqualsAndHashCode(callSuper = false)
695
    public static class GiftCard extends StripeObject {
×
696
      /** The token of the gift card applied to the order. */
697
      @SerializedName("card")
698
      String card;
699
    }
700
  }
701

702
  @Getter
703
  @Setter
704
  @EqualsAndHashCode(callSuper = false)
705
  public static class Payment extends StripeObject {
×
706
    /** ID of the payment intent associated with this order. Null when the order is {@code open}. */
707
    @SerializedName("payment_intent")
708
    @Getter(lombok.AccessLevel.NONE)
709
    @Setter(lombok.AccessLevel.NONE)
710
    ExpandableField<PaymentIntent> paymentIntent;
711

712
    /** Settings describing how the order should configure generated PaymentIntents. */
713
    @SerializedName("settings")
714
    Settings settings;
715

716
    /**
717
     * The status of the underlying payment associated with this order, if any. Null when the order
718
     * is {@code open}.
719
     *
720
     * <p>One of {@code canceled}, {@code complete}, {@code not_required}, {@code processing},
721
     * {@code requires_action}, {@code requires_capture}, {@code requires_confirmation}, or {@code
722
     * requires_payment_method}.
723
     */
724
    @SerializedName("status")
725
    String status;
726

727
    /** Get ID of expandable {@code paymentIntent} object. */
728
    public String getPaymentIntent() {
729
      return (this.paymentIntent != null) ? this.paymentIntent.getId() : null;
×
730
    }
731

732
    public void setPaymentIntent(String id) {
733
      this.paymentIntent = ApiResource.setExpandableFieldId(id, this.paymentIntent);
×
734
    }
×
735

736
    /** Get expanded {@code paymentIntent}. */
737
    public PaymentIntent getPaymentIntentObject() {
738
      return (this.paymentIntent != null) ? this.paymentIntent.getExpanded() : null;
×
739
    }
740

741
    public void setPaymentIntentObject(PaymentIntent expandableObject) {
742
      this.paymentIntent =
×
743
          new ExpandableField<PaymentIntent>(expandableObject.getId(), expandableObject);
×
744
    }
×
745

746
    @Getter
747
    @Setter
748
    @EqualsAndHashCode(callSuper = false)
749
    public static class Settings extends StripeObject {
×
750
      /**
751
       * The amount of the application fee (if any) that will be requested to be applied to the
752
       * payment and transferred to the application owner's Stripe account.
753
       */
754
      @SerializedName("application_fee_amount")
755
      Long applicationFeeAmount;
756

757
      /**
758
       * Indicates whether order has been opted into using <a
759
       * href="https://dashboard.stripe.com/settings/payment_methods">Stripe Dashboard</a> to manage
760
       * payment method types.
761
       */
762
      @SerializedName("automatic_payment_methods")
763
      AutomaticPaymentMethods automaticPaymentMethods;
764

765
      /** PaymentMethod-specific configuration to provide to the order's PaymentIntent. */
766
      @SerializedName("payment_method_options")
767
      PaymentMethodOptions paymentMethodOptions;
768

769
      /**
770
       * The list of <a href="https://stripe.com/docs/payments/payment-methods/overview">payment
771
       * method types</a> to provide to the order's PaymentIntent. Do not include this attribute if
772
       * you prefer to manage your payment methods from the <a
773
       * href="https://dashboard.stripe.com/settings/payment_methods">Stripe Dashboard</a>.
774
       */
775
      @SerializedName("payment_method_types")
776
      List<String> paymentMethodTypes;
777

778
      /** The URL to redirect the customer to after they authenticate their payment. */
779
      @SerializedName("return_url")
780
      String returnUrl;
781

782
      /**
783
       * For non-card charges, you can use this value as the complete description that appears on
784
       * your customers' statements. Must contain at least one letter, maximum 22 characters.
785
       */
786
      @SerializedName("statement_descriptor")
787
      String statementDescriptor;
788

789
      /**
790
       * Provides information about a card payment that customers see on their statements.
791
       * Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on
792
       * the account to form the complete statement descriptor. Maximum 22 characters for the
793
       * concatenated descriptor.
794
       */
795
      @SerializedName("statement_descriptor_suffix")
796
      String statementDescriptorSuffix;
797

798
      /** Provides configuration for completing a transfer for the order after it is paid. */
799
      @SerializedName("transfer_data")
800
      TransferData transferData;
801

802
      @Getter
803
      @Setter
804
      @EqualsAndHashCode(callSuper = false)
805
      public static class AutomaticPaymentMethods extends StripeObject {
×
806
        /**
807
         * Whether this Order has been opted into managing payment method types via the <a
808
         * href="https://dashboard.stripe.com/settings/payment_methods">Stripe Dashboard</a>.
809
         */
810
        @SerializedName("enabled")
811
        Boolean enabled;
812
      }
813

814
      @Getter
815
      @Setter
816
      @EqualsAndHashCode(callSuper = false)
817
      public static class PaymentMethodOptions extends StripeObject {
×
818
        @SerializedName("acss_debit")
819
        AcssDebit acssDebit;
820

821
        @SerializedName("afterpay_clearpay")
822
        AfterpayClearpay afterpayClearpay;
823

824
        @SerializedName("alipay")
825
        Alipay alipay;
826

827
        @SerializedName("bancontact")
828
        Bancontact bancontact;
829

830
        @SerializedName("card")
831
        Card card;
832

833
        @SerializedName("customer_balance")
834
        CustomerBalance customerBalance;
835

836
        @SerializedName("ideal")
837
        Ideal ideal;
838

839
        @SerializedName("klarna")
840
        Klarna klarna;
841

842
        @SerializedName("link")
843
        Link link;
844

845
        @SerializedName("oxxo")
846
        Oxxo oxxo;
847

848
        @SerializedName("p24")
849
        P24 p24;
850

851
        @SerializedName("paypal")
852
        Paypal paypal;
853

854
        @SerializedName("sepa_debit")
855
        SepaDebit sepaDebit;
856

857
        @SerializedName("sofort")
858
        Sofort sofort;
859

860
        @SerializedName("wechat_pay")
861
        WechatPay wechatPay;
862

863
        @Getter
864
        @Setter
865
        @EqualsAndHashCode(callSuper = false)
866
        public static class AcssDebit extends StripeObject {
×
867
          @SerializedName("mandate_options")
868
          MandateOptions mandateOptions;
869

870
          /**
871
           * Indicates that you intend to make future payments with this PaymentIntent's payment
872
           * method.
873
           *
874
           * <p>If you provide a Customer with the PaymentIntent, you can use this parameter to <a
875
           * href="https://stripe.com/payments/save-during-payment">attach the payment method</a> to
876
           * the Customer after the PaymentIntent is confirmed and the customer completes any
877
           * required actions. If you don't provide a Customer, you can still <a
878
           * href="https://stripe.com/api/payment_methods/attach">attach</a> the payment method to a
879
           * Customer after the transaction completes.
880
           *
881
           * <p>If the payment method is {@code card_present} and isn't a digital wallet, Stripe
882
           * creates and attaches a <a
883
           * href="https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card">generated_card</a>
884
           * payment method representing the card to the Customer instead.
885
           *
886
           * <p>When processing card payments, Stripe uses {@code setup_future_usage} to help you
887
           * comply with regional legislation and network rules, such as <a
888
           * href="https://stripe.com/strong-customer-authentication">SCA</a>.
889
           *
890
           * <p>One of {@code none}, {@code off_session}, or {@code on_session}.
891
           */
892
          @SerializedName("setup_future_usage")
893
          String setupFutureUsage;
894

895
          /**
896
           * Bank account verification method.
897
           *
898
           * <p>One of {@code automatic}, {@code instant}, or {@code microdeposits}.
899
           */
900
          @SerializedName("verification_method")
901
          String verificationMethod;
902

903
          @Getter
904
          @Setter
905
          @EqualsAndHashCode(callSuper = false)
906
          public static class MandateOptions extends StripeObject {
×
907
            /** A URL for custom mandate text. */
908
            @SerializedName("custom_mandate_url")
909
            String customMandateUrl;
910

911
            /**
912
             * Description of the interval. Only required if the 'payment_schedule' parameter is
913
             * 'interval' or 'combined'.
914
             */
915
            @SerializedName("interval_description")
916
            String intervalDescription;
917

918
            /**
919
             * Payment schedule for the mandate.
920
             *
921
             * <p>One of {@code combined}, {@code interval}, or {@code sporadic}.
922
             */
923
            @SerializedName("payment_schedule")
924
            String paymentSchedule;
925

926
            /**
927
             * Transaction type of the mandate.
928
             *
929
             * <p>One of {@code business}, or {@code personal}.
930
             */
931
            @SerializedName("transaction_type")
932
            String transactionType;
933
          }
934
        }
935

936
        @Getter
937
        @Setter
938
        @EqualsAndHashCode(callSuper = false)
939
        public static class AfterpayClearpay extends StripeObject {
×
940
          /**
941
           * Controls when the funds will be captured from the customer's account.
942
           *
943
           * <p>One of {@code automatic}, {@code automatic_async}, or {@code manual}.
944
           */
945
          @SerializedName("capture_method")
946
          String captureMethod;
947

948
          /**
949
           * Order identifier shown to the user in Afterpay's online portal. We recommend using a
950
           * value that helps you answer any questions a customer might have about the payment. The
951
           * identifier is limited to 128 characters and may contain only letters, digits,
952
           * underscores, backslashes and dashes.
953
           */
954
          @SerializedName("reference")
955
          String reference;
956

957
          /**
958
           * Indicates that you intend to make future payments with the payment method.
959
           *
960
           * <p>Providing this parameter will <a
961
           * href="https://stripe.com/docs/payments/save-during-payment">attach the payment
962
           * method</a> to the order's Customer, if present, after the order's PaymentIntent is
963
           * confirmed and any required actions from the user are complete. If no Customer was
964
           * provided, the payment method can still be <a
965
           * href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer
966
           * after the transaction completes.
967
           *
968
           * <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
969
           * dynamically optimize your payment flow and comply with regional legislation and network
970
           * rules, such as <a
971
           * href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
972
           *
973
           * <p>If {@code setup_future_usage} is already set and you are performing a request using
974
           * a publishable key, you may only update the value from {@code on_session} to {@code
975
           * off_session}.
976
           *
977
           * <p>Equal to {@code none}.
978
           */
979
          @SerializedName("setup_future_usage")
980
          String setupFutureUsage;
981
        }
982

983
        @Getter
984
        @Setter
985
        @EqualsAndHashCode(callSuper = false)
986
        public static class Alipay extends StripeObject {
×
987
          /**
988
           * Indicates that you intend to make future payments with this PaymentIntent's payment
989
           * method.
990
           *
991
           * <p>If you provide a Customer with the PaymentIntent, you can use this parameter to <a
992
           * href="https://stripe.com/payments/save-during-payment">attach the payment method</a> to
993
           * the Customer after the PaymentIntent is confirmed and the customer completes any
994
           * required actions. If you don't provide a Customer, you can still <a
995
           * href="https://stripe.com/api/payment_methods/attach">attach</a> the payment method to a
996
           * Customer after the transaction completes.
997
           *
998
           * <p>If the payment method is {@code card_present} and isn't a digital wallet, Stripe
999
           * creates and attaches a <a
1000
           * href="https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card">generated_card</a>
1001
           * payment method representing the card to the Customer instead.
1002
           *
1003
           * <p>When processing card payments, Stripe uses {@code setup_future_usage} to help you
1004
           * comply with regional legislation and network rules, such as <a
1005
           * href="https://stripe.com/strong-customer-authentication">SCA</a>.
1006
           *
1007
           * <p>One of {@code none}, or {@code off_session}.
1008
           */
1009
          @SerializedName("setup_future_usage")
1010
          String setupFutureUsage;
1011
        }
1012

1013
        @Getter
1014
        @Setter
1015
        @EqualsAndHashCode(callSuper = false)
1016
        public static class Bancontact extends StripeObject {
×
1017
          /**
1018
           * Preferred language of the Bancontact authorization page that the customer is redirected
1019
           * to.
1020
           *
1021
           * <p>One of {@code de}, {@code en}, {@code fr}, or {@code nl}.
1022
           */
1023
          @SerializedName("preferred_language")
1024
          String preferredLanguage;
1025

1026
          /**
1027
           * Indicates that you intend to make future payments with this PaymentIntent's payment
1028
           * method.
1029
           *
1030
           * <p>If you provide a Customer with the PaymentIntent, you can use this parameter to <a
1031
           * href="https://stripe.com/payments/save-during-payment">attach the payment method</a> to
1032
           * the Customer after the PaymentIntent is confirmed and the customer completes any
1033
           * required actions. If you don't provide a Customer, you can still <a
1034
           * href="https://stripe.com/api/payment_methods/attach">attach</a> the payment method to a
1035
           * Customer after the transaction completes.
1036
           *
1037
           * <p>If the payment method is {@code card_present} and isn't a digital wallet, Stripe
1038
           * creates and attaches a <a
1039
           * href="https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card">generated_card</a>
1040
           * payment method representing the card to the Customer instead.
1041
           *
1042
           * <p>When processing card payments, Stripe uses {@code setup_future_usage} to help you
1043
           * comply with regional legislation and network rules, such as <a
1044
           * href="https://stripe.com/strong-customer-authentication">SCA</a>.
1045
           *
1046
           * <p>One of {@code none}, or {@code off_session}.
1047
           */
1048
          @SerializedName("setup_future_usage")
1049
          String setupFutureUsage;
1050
        }
1051

1052
        @Getter
1053
        @Setter
1054
        @EqualsAndHashCode(callSuper = false)
1055
        public static class Card extends StripeObject {
×
1056
          /**
1057
           * Controls when the funds will be captured from the customer's account.
1058
           *
1059
           * <p>One of {@code automatic}, {@code automatic_async}, or {@code manual}.
1060
           */
1061
          @SerializedName("capture_method")
1062
          String captureMethod;
1063

1064
          /**
1065
           * Indicates that you intend to make future payments with the payment method.
1066
           *
1067
           * <p>Providing this parameter will <a
1068
           * href="https://stripe.com/docs/payments/save-during-payment">attach the payment
1069
           * method</a> to the order's Customer, if present, after the order's PaymentIntent is
1070
           * confirmed and any required actions from the user are complete. If no Customer was
1071
           * provided, the payment method can still be <a
1072
           * href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer
1073
           * after the transaction completes.
1074
           *
1075
           * <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
1076
           * dynamically optimize your payment flow and comply with regional legislation and network
1077
           * rules, such as <a
1078
           * href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
1079
           *
1080
           * <p>If {@code setup_future_usage} is already set and you are performing a request using
1081
           * a publishable key, you may only update the value from {@code on_session} to {@code
1082
           * off_session}.
1083
           *
1084
           * <p>One of {@code none}, {@code off_session}, or {@code on_session}.
1085
           */
1086
          @SerializedName("setup_future_usage")
1087
          String setupFutureUsage;
1088
        }
1089

1090
        @Getter
1091
        @Setter
1092
        @EqualsAndHashCode(callSuper = false)
1093
        public static class CustomerBalance extends StripeObject {
×
1094
          @SerializedName("bank_transfer")
1095
          BankTransfer bankTransfer;
1096

1097
          /**
1098
           * The funding method type to be used when there are not enough funds in the customer
1099
           * balance. Permitted values include: {@code bank_transfer}.
1100
           *
1101
           * <p>Equal to {@code bank_transfer}.
1102
           */
1103
          @SerializedName("funding_type")
1104
          String fundingType;
1105

1106
          /**
1107
           * Indicates that you intend to make future payments with this PaymentIntent's payment
1108
           * method.
1109
           *
1110
           * <p>If you provide a Customer with the PaymentIntent, you can use this parameter to <a
1111
           * href="https://stripe.com/payments/save-during-payment">attach the payment method</a> to
1112
           * the Customer after the PaymentIntent is confirmed and the customer completes any
1113
           * required actions. If you don't provide a Customer, you can still <a
1114
           * href="https://stripe.com/api/payment_methods/attach">attach</a> the payment method to a
1115
           * Customer after the transaction completes.
1116
           *
1117
           * <p>If the payment method is {@code card_present} and isn't a digital wallet, Stripe
1118
           * creates and attaches a <a
1119
           * href="https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card">generated_card</a>
1120
           * payment method representing the card to the Customer instead.
1121
           *
1122
           * <p>When processing card payments, Stripe uses {@code setup_future_usage} to help you
1123
           * comply with regional legislation and network rules, such as <a
1124
           * href="https://stripe.com/strong-customer-authentication">SCA</a>.
1125
           *
1126
           * <p>Equal to {@code none}.
1127
           */
1128
          @SerializedName("setup_future_usage")
1129
          String setupFutureUsage;
1130

1131
          @Getter
1132
          @Setter
1133
          @EqualsAndHashCode(callSuper = false)
1134
          public static class BankTransfer extends StripeObject {
×
1135
            @SerializedName("eu_bank_transfer")
1136
            EuBankTransfer euBankTransfer;
1137

1138
            /**
1139
             * List of address types that should be returned in the financial_addresses response. If
1140
             * not specified, all valid types will be returned.
1141
             *
1142
             * <p>Permitted values include: {@code sort_code}, {@code zengin}, {@code iban}, or
1143
             * {@code spei}.
1144
             */
1145
            @SerializedName("requested_address_types")
1146
            List<String> requestedAddressTypes;
1147

1148
            /**
1149
             * The bank transfer type that this PaymentIntent is allowed to use for funding
1150
             * Permitted values include: {@code eu_bank_transfer}, {@code gb_bank_transfer}, {@code
1151
             * jp_bank_transfer}, {@code mx_bank_transfer}, or {@code us_bank_transfer}.
1152
             *
1153
             * <p>One of {@code eu_bank_transfer}, {@code gb_bank_transfer}, {@code
1154
             * jp_bank_transfer}, {@code mx_bank_transfer}, or {@code us_bank_transfer}.
1155
             */
1156
            @SerializedName("type")
1157
            String type;
1158

1159
            @Getter
1160
            @Setter
1161
            @EqualsAndHashCode(callSuper = false)
1162
            public static class EuBankTransfer extends StripeObject {
×
1163
              /**
1164
               * The desired country code of the bank account information. Permitted values include:
1165
               * {@code BE}, {@code DE}, {@code ES}, {@code FR}, {@code IE}, or {@code NL}.
1166
               *
1167
               * <p>One of {@code BE}, {@code DE}, {@code ES}, {@code FR}, {@code IE}, or {@code
1168
               * NL}.
1169
               */
1170
              @SerializedName("country")
1171
              String country;
1172
            }
1173
          }
1174
        }
1175

1176
        @Getter
1177
        @Setter
1178
        @EqualsAndHashCode(callSuper = false)
1179
        public static class Ideal extends StripeObject {
×
1180
          /**
1181
           * Indicates that you intend to make future payments with this PaymentIntent's payment
1182
           * method.
1183
           *
1184
           * <p>If you provide a Customer with the PaymentIntent, you can use this parameter to <a
1185
           * href="https://stripe.com/payments/save-during-payment">attach the payment method</a> to
1186
           * the Customer after the PaymentIntent is confirmed and the customer completes any
1187
           * required actions. If you don't provide a Customer, you can still <a
1188
           * href="https://stripe.com/api/payment_methods/attach">attach</a> the payment method to a
1189
           * Customer after the transaction completes.
1190
           *
1191
           * <p>If the payment method is {@code card_present} and isn't a digital wallet, Stripe
1192
           * creates and attaches a <a
1193
           * href="https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card">generated_card</a>
1194
           * payment method representing the card to the Customer instead.
1195
           *
1196
           * <p>When processing card payments, Stripe uses {@code setup_future_usage} to help you
1197
           * comply with regional legislation and network rules, such as <a
1198
           * href="https://stripe.com/strong-customer-authentication">SCA</a>.
1199
           *
1200
           * <p>One of {@code none}, or {@code off_session}.
1201
           */
1202
          @SerializedName("setup_future_usage")
1203
          String setupFutureUsage;
1204
        }
1205

1206
        @Getter
1207
        @Setter
1208
        @EqualsAndHashCode(callSuper = false)
1209
        public static class Klarna extends StripeObject {
×
1210
          /**
1211
           * Controls when the funds will be captured from the customer's account.
1212
           *
1213
           * <p>Equal to {@code manual}.
1214
           */
1215
          @SerializedName("capture_method")
1216
          String captureMethod;
1217

1218
          /** Preferred locale of the Klarna checkout page that the customer is redirected to. */
1219
          @SerializedName("preferred_locale")
1220
          String preferredLocale;
1221

1222
          /**
1223
           * Indicates that you intend to make future payments with this PaymentIntent's payment
1224
           * method.
1225
           *
1226
           * <p>If you provide a Customer with the PaymentIntent, you can use this parameter to <a
1227
           * href="https://stripe.com/payments/save-during-payment">attach the payment method</a> to
1228
           * the Customer after the PaymentIntent is confirmed and the customer completes any
1229
           * required actions. If you don't provide a Customer, you can still <a
1230
           * href="https://stripe.com/api/payment_methods/attach">attach</a> the payment method to a
1231
           * Customer after the transaction completes.
1232
           *
1233
           * <p>If the payment method is {@code card_present} and isn't a digital wallet, Stripe
1234
           * creates and attaches a <a
1235
           * href="https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card">generated_card</a>
1236
           * payment method representing the card to the Customer instead.
1237
           *
1238
           * <p>When processing card payments, Stripe uses {@code setup_future_usage} to help you
1239
           * comply with regional legislation and network rules, such as <a
1240
           * href="https://stripe.com/strong-customer-authentication">SCA</a>.
1241
           *
1242
           * <p>Equal to {@code none}.
1243
           */
1244
          @SerializedName("setup_future_usage")
1245
          String setupFutureUsage;
1246
        }
1247

1248
        @Getter
1249
        @Setter
1250
        @EqualsAndHashCode(callSuper = false)
1251
        public static class Link extends StripeObject {
×
1252
          /**
1253
           * Controls when the funds will be captured from the customer's account.
1254
           *
1255
           * <p>Equal to {@code manual}.
1256
           */
1257
          @SerializedName("capture_method")
1258
          String captureMethod;
1259

1260
          /** [Deprecated] This is a legacy parameter that no longer has any function. */
1261
          @SerializedName("persistent_token")
1262
          @Deprecated
1263
          String persistentToken;
1264

1265
          /**
1266
           * Indicates that you intend to make future payments with this PaymentIntent's payment
1267
           * method.
1268
           *
1269
           * <p>If you provide a Customer with the PaymentIntent, you can use this parameter to <a
1270
           * href="https://stripe.com/payments/save-during-payment">attach the payment method</a> to
1271
           * the Customer after the PaymentIntent is confirmed and the customer completes any
1272
           * required actions. If you don't provide a Customer, you can still <a
1273
           * href="https://stripe.com/api/payment_methods/attach">attach</a> the payment method to a
1274
           * Customer after the transaction completes.
1275
           *
1276
           * <p>If the payment method is {@code card_present} and isn't a digital wallet, Stripe
1277
           * creates and attaches a <a
1278
           * href="https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card">generated_card</a>
1279
           * payment method representing the card to the Customer instead.
1280
           *
1281
           * <p>When processing card payments, Stripe uses {@code setup_future_usage} to help you
1282
           * comply with regional legislation and network rules, such as <a
1283
           * href="https://stripe.com/strong-customer-authentication">SCA</a>.
1284
           *
1285
           * <p>One of {@code none}, or {@code off_session}.
1286
           */
1287
          @SerializedName("setup_future_usage")
1288
          String setupFutureUsage;
1289
        }
1290

1291
        @Getter
1292
        @Setter
1293
        @EqualsAndHashCode(callSuper = false)
1294
        public static class Oxxo extends StripeObject {
×
1295
          /**
1296
           * The number of calendar days before an OXXO invoice expires. For example, if you create
1297
           * an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will
1298
           * expire on Wednesday at 23:59 America/Mexico_City time.
1299
           */
1300
          @SerializedName("expires_after_days")
1301
          Long expiresAfterDays;
1302

1303
          /**
1304
           * Indicates that you intend to make future payments with this PaymentIntent's payment
1305
           * method.
1306
           *
1307
           * <p>If you provide a Customer with the PaymentIntent, you can use this parameter to <a
1308
           * href="https://stripe.com/payments/save-during-payment">attach the payment method</a> to
1309
           * the Customer after the PaymentIntent is confirmed and the customer completes any
1310
           * required actions. If you don't provide a Customer, you can still <a
1311
           * href="https://stripe.com/api/payment_methods/attach">attach</a> the payment method to a
1312
           * Customer after the transaction completes.
1313
           *
1314
           * <p>If the payment method is {@code card_present} and isn't a digital wallet, Stripe
1315
           * creates and attaches a <a
1316
           * href="https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card">generated_card</a>
1317
           * payment method representing the card to the Customer instead.
1318
           *
1319
           * <p>When processing card payments, Stripe uses {@code setup_future_usage} to help you
1320
           * comply with regional legislation and network rules, such as <a
1321
           * href="https://stripe.com/strong-customer-authentication">SCA</a>.
1322
           *
1323
           * <p>Equal to {@code none}.
1324
           */
1325
          @SerializedName("setup_future_usage")
1326
          String setupFutureUsage;
1327
        }
1328

1329
        @Getter
1330
        @Setter
1331
        @EqualsAndHashCode(callSuper = false)
1332
        public static class P24 extends StripeObject {
×
1333
          /**
1334
           * Indicates that you intend to make future payments with this PaymentIntent's payment
1335
           * method.
1336
           *
1337
           * <p>If you provide a Customer with the PaymentIntent, you can use this parameter to <a
1338
           * href="https://stripe.com/payments/save-during-payment">attach the payment method</a> to
1339
           * the Customer after the PaymentIntent is confirmed and the customer completes any
1340
           * required actions. If you don't provide a Customer, you can still <a
1341
           * href="https://stripe.com/api/payment_methods/attach">attach</a> the payment method to a
1342
           * Customer after the transaction completes.
1343
           *
1344
           * <p>If the payment method is {@code card_present} and isn't a digital wallet, Stripe
1345
           * creates and attaches a <a
1346
           * href="https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card">generated_card</a>
1347
           * payment method representing the card to the Customer instead.
1348
           *
1349
           * <p>When processing card payments, Stripe uses {@code setup_future_usage} to help you
1350
           * comply with regional legislation and network rules, such as <a
1351
           * href="https://stripe.com/strong-customer-authentication">SCA</a>.
1352
           *
1353
           * <p>Equal to {@code none}.
1354
           */
1355
          @SerializedName("setup_future_usage")
1356
          String setupFutureUsage;
1357
        }
1358

1359
        @Getter
1360
        @Setter
1361
        @EqualsAndHashCode(callSuper = false)
1362
        public static class Paypal extends StripeObject {
×
1363
          /**
1364
           * Controls when the funds will be captured from the customer's account.
1365
           *
1366
           * <p>Equal to {@code manual}.
1367
           */
1368
          @SerializedName("capture_method")
1369
          String captureMethod;
1370

1371
          /** The line items purchased by the customer. */
1372
          @SerializedName("line_items")
1373
          List<Order.Payment.Settings.PaymentMethodOptions.Paypal.LineItem> lineItems;
1374

1375
          /** Preferred locale of the PayPal checkout page that the customer is redirected to. */
1376
          @SerializedName("preferred_locale")
1377
          String preferredLocale;
1378

1379
          /**
1380
           * A reference of the PayPal transaction visible to customer which is mapped to PayPal's
1381
           * invoice ID. This must be a globally unique ID if you have configured in your PayPal
1382
           * settings to block multiple payments per invoice ID.
1383
           */
1384
          @SerializedName("reference")
1385
          String reference;
1386

1387
          /**
1388
           * A reference of the PayPal transaction visible to customer which is mapped to PayPal's
1389
           * invoice ID. This must be a globally unique ID if you have configured in your PayPal
1390
           * settings to block multiple payments per invoice ID.
1391
           */
1392
          @SerializedName("reference_id")
1393
          String referenceId;
1394

1395
          /**
1396
           * Indicates that you intend to make future payments with this PaymentIntent's payment
1397
           * method.
1398
           *
1399
           * <p>If you provide a Customer with the PaymentIntent, you can use this parameter to <a
1400
           * href="https://stripe.com/payments/save-during-payment">attach the payment method</a> to
1401
           * the Customer after the PaymentIntent is confirmed and the customer completes any
1402
           * required actions. If you don't provide a Customer, you can still <a
1403
           * href="https://stripe.com/api/payment_methods/attach">attach</a> the payment method to a
1404
           * Customer after the transaction completes.
1405
           *
1406
           * <p>If the payment method is {@code card_present} and isn't a digital wallet, Stripe
1407
           * creates and attaches a <a
1408
           * href="https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card">generated_card</a>
1409
           * payment method representing the card to the Customer instead.
1410
           *
1411
           * <p>When processing card payments, Stripe uses {@code setup_future_usage} to help you
1412
           * comply with regional legislation and network rules, such as <a
1413
           * href="https://stripe.com/strong-customer-authentication">SCA</a>.
1414
           *
1415
           * <p>One of {@code none}, or {@code off_session}.
1416
           */
1417
          @SerializedName("setup_future_usage")
1418
          String setupFutureUsage;
1419

1420
          /**
1421
           * The Stripe connected account IDs of the sellers on the platform for this transaction
1422
           * (optional). Only allowed when <a
1423
           * href="https://stripe.com/docs/connect/separate-charges-and-transfers">separate charges
1424
           * and transfers</a> are used.
1425
           */
1426
          @SerializedName("subsellers")
1427
          List<String> subsellers;
1428

1429
          @Getter
1430
          @Setter
1431
          @EqualsAndHashCode(callSuper = false)
NEW
1432
          public static class LineItem extends StripeObject {
×
1433
            /**
1434
             * Type of the line item.
1435
             *
1436
             * <p>One of {@code digital_goods}, {@code donation}, or {@code physical_goods}.
1437
             */
1438
            @SerializedName("category")
1439
            String category;
1440

1441
            /** Description of the line item. */
1442
            @SerializedName("description")
1443
            String description;
1444

1445
            /** Descriptive name of the line item. */
1446
            @SerializedName("name")
1447
            String name;
1448

1449
            /** Quantity of the line item. Cannot be a negative number. */
1450
            @SerializedName("quantity")
1451
            Long quantity;
1452

1453
            /** Client facing stock keeping unit, article number or similar. */
1454
            @SerializedName("sku")
1455
            String sku;
1456

1457
            /**
1458
             * The Stripe account ID of the connected account that sells the item. This is only
1459
             * needed when using <a
1460
             * href="https://docs.stripe.com/connect/separate-charges-and-transfers">Separate
1461
             * Charges and Transfers</a>.
1462
             */
1463
            @SerializedName("sold_by")
1464
            String soldBy;
1465

1466
            @SerializedName("tax")
1467
            Tax tax;
1468

1469
            /**
1470
             * Price for a single unit of the line item in minor units. Cannot be a negative number.
1471
             */
1472
            @SerializedName("unit_amount")
1473
            Long unitAmount;
1474

1475
            @Getter
1476
            @Setter
1477
            @EqualsAndHashCode(callSuper = false)
NEW
1478
            public static class Tax extends StripeObject {
×
1479
              /**
1480
               * The tax for a single unit of the line item in minor units. Cannot be a negative
1481
               * number.
1482
               */
1483
              @SerializedName("amount")
1484
              Long amount;
1485

1486
              /**
1487
               * The tax behavior for the line item.
1488
               *
1489
               * <p>One of {@code exclusive}, or {@code inclusive}.
1490
               */
1491
              @SerializedName("behavior")
1492
              String behavior;
1493
            }
1494
          }
1495
        }
1496

1497
        @Getter
1498
        @Setter
1499
        @EqualsAndHashCode(callSuper = false)
1500
        public static class SepaDebit extends StripeObject {
×
1501
          @SerializedName("mandate_options")
1502
          MandateOptions mandateOptions;
1503

1504
          /**
1505
           * Indicates that you intend to make future payments with this PaymentIntent's payment
1506
           * method.
1507
           *
1508
           * <p>If you provide a Customer with the PaymentIntent, you can use this parameter to <a
1509
           * href="https://stripe.com/payments/save-during-payment">attach the payment method</a> to
1510
           * the Customer after the PaymentIntent is confirmed and the customer completes any
1511
           * required actions. If you don't provide a Customer, you can still <a
1512
           * href="https://stripe.com/api/payment_methods/attach">attach</a> the payment method to a
1513
           * Customer after the transaction completes.
1514
           *
1515
           * <p>If the payment method is {@code card_present} and isn't a digital wallet, Stripe
1516
           * creates and attaches a <a
1517
           * href="https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card">generated_card</a>
1518
           * payment method representing the card to the Customer instead.
1519
           *
1520
           * <p>When processing card payments, Stripe uses {@code setup_future_usage} to help you
1521
           * comply with regional legislation and network rules, such as <a
1522
           * href="https://stripe.com/strong-customer-authentication">SCA</a>.
1523
           *
1524
           * <p>One of {@code none}, {@code off_session}, or {@code on_session}.
1525
           */
1526
          @SerializedName("setup_future_usage")
1527
          String setupFutureUsage;
1528

1529
          @Getter
1530
          @Setter
1531
          @EqualsAndHashCode(callSuper = false)
1532
          public static class MandateOptions extends StripeObject {}
×
1533
        }
1534

1535
        @Getter
1536
        @Setter
1537
        @EqualsAndHashCode(callSuper = false)
1538
        public static class Sofort extends StripeObject {
×
1539
          /**
1540
           * Preferred language of the SOFORT authorization page that the customer is redirected to.
1541
           *
1542
           * <p>One of {@code de}, {@code en}, {@code es}, {@code fr}, {@code it}, {@code nl}, or
1543
           * {@code pl}.
1544
           */
1545
          @SerializedName("preferred_language")
1546
          String preferredLanguage;
1547

1548
          /**
1549
           * Indicates that you intend to make future payments with this PaymentIntent's payment
1550
           * method.
1551
           *
1552
           * <p>If you provide a Customer with the PaymentIntent, you can use this parameter to <a
1553
           * href="https://stripe.com/payments/save-during-payment">attach the payment method</a> to
1554
           * the Customer after the PaymentIntent is confirmed and the customer completes any
1555
           * required actions. If you don't provide a Customer, you can still <a
1556
           * href="https://stripe.com/api/payment_methods/attach">attach</a> the payment method to a
1557
           * Customer after the transaction completes.
1558
           *
1559
           * <p>If the payment method is {@code card_present} and isn't a digital wallet, Stripe
1560
           * creates and attaches a <a
1561
           * href="https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card">generated_card</a>
1562
           * payment method representing the card to the Customer instead.
1563
           *
1564
           * <p>When processing card payments, Stripe uses {@code setup_future_usage} to help you
1565
           * comply with regional legislation and network rules, such as <a
1566
           * href="https://stripe.com/strong-customer-authentication">SCA</a>.
1567
           *
1568
           * <p>One of {@code none}, or {@code off_session}.
1569
           */
1570
          @SerializedName("setup_future_usage")
1571
          String setupFutureUsage;
1572
        }
1573

1574
        @Getter
1575
        @Setter
1576
        @EqualsAndHashCode(callSuper = false)
1577
        public static class WechatPay extends StripeObject {
×
1578
          /** The app ID registered with WeChat Pay. Only required when client is ios or android. */
1579
          @SerializedName("app_id")
1580
          String appId;
1581

1582
          /**
1583
           * The client type that the end customer will pay from
1584
           *
1585
           * <p>One of {@code android}, {@code ios}, or {@code web}.
1586
           */
1587
          @SerializedName("client")
1588
          String client;
1589

1590
          /**
1591
           * Indicates that you intend to make future payments with this PaymentIntent's payment
1592
           * method.
1593
           *
1594
           * <p>If you provide a Customer with the PaymentIntent, you can use this parameter to <a
1595
           * href="https://stripe.com/payments/save-during-payment">attach the payment method</a> to
1596
           * the Customer after the PaymentIntent is confirmed and the customer completes any
1597
           * required actions. If you don't provide a Customer, you can still <a
1598
           * href="https://stripe.com/api/payment_methods/attach">attach</a> the payment method to a
1599
           * Customer after the transaction completes.
1600
           *
1601
           * <p>If the payment method is {@code card_present} and isn't a digital wallet, Stripe
1602
           * creates and attaches a <a
1603
           * href="https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card">generated_card</a>
1604
           * payment method representing the card to the Customer instead.
1605
           *
1606
           * <p>When processing card payments, Stripe uses {@code setup_future_usage} to help you
1607
           * comply with regional legislation and network rules, such as <a
1608
           * href="https://stripe.com/strong-customer-authentication">SCA</a>.
1609
           *
1610
           * <p>Equal to {@code none}.
1611
           */
1612
          @SerializedName("setup_future_usage")
1613
          String setupFutureUsage;
1614
        }
1615
      }
1616

1617
      @Getter
1618
      @Setter
1619
      @EqualsAndHashCode(callSuper = false)
1620
      public static class TransferData extends StripeObject {
×
1621
        /**
1622
         * The amount that will be transferred automatically when the order is paid. If no amount is
1623
         * set, the full amount is transferred. There cannot be any line items with recurring prices
1624
         * when using this field.
1625
         */
1626
        @SerializedName("amount")
1627
        Long amount;
1628

1629
        /** ID of the Connected account receiving the transfer. */
1630
        @SerializedName("destination")
1631
        @Getter(lombok.AccessLevel.NONE)
1632
        @Setter(lombok.AccessLevel.NONE)
1633
        ExpandableField<Account> destination;
1634

1635
        /** Get ID of expandable {@code destination} object. */
1636
        public String getDestination() {
1637
          return (this.destination != null) ? this.destination.getId() : null;
×
1638
        }
1639

1640
        public void setDestination(String id) {
1641
          this.destination = ApiResource.setExpandableFieldId(id, this.destination);
×
1642
        }
×
1643

1644
        /** Get expanded {@code destination}. */
1645
        public Account getDestinationObject() {
1646
          return (this.destination != null) ? this.destination.getExpanded() : null;
×
1647
        }
1648

1649
        public void setDestinationObject(Account expandableObject) {
1650
          this.destination =
×
1651
              new ExpandableField<Account>(expandableObject.getId(), expandableObject);
×
1652
        }
×
1653
      }
1654
    }
1655
  }
1656

1657
  @Getter
1658
  @Setter
1659
  @EqualsAndHashCode(callSuper = false)
1660
  public static class ShippingCost extends StripeObject {
×
1661
    /** Total shipping cost before any discounts or taxes are applied. */
1662
    @SerializedName("amount_subtotal")
1663
    Long amountSubtotal;
1664

1665
    /** Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0. */
1666
    @SerializedName("amount_tax")
1667
    Long amountTax;
1668

1669
    /** Total shipping cost after discounts and taxes are applied. */
1670
    @SerializedName("amount_total")
1671
    Long amountTotal;
1672

1673
    /** The ID of the ShippingRate for this order. */
1674
    @SerializedName("shipping_rate")
1675
    @Getter(lombok.AccessLevel.NONE)
1676
    @Setter(lombok.AccessLevel.NONE)
1677
    ExpandableField<ShippingRate> shippingRate;
1678

1679
    /** The taxes applied to the shipping rate. */
1680
    @SerializedName("taxes")
1681
    List<Order.ShippingCost.Tax> taxes;
1682

1683
    /** Get ID of expandable {@code shippingRate} object. */
1684
    public String getShippingRate() {
1685
      return (this.shippingRate != null) ? this.shippingRate.getId() : null;
×
1686
    }
1687

1688
    public void setShippingRate(String id) {
1689
      this.shippingRate = ApiResource.setExpandableFieldId(id, this.shippingRate);
×
1690
    }
×
1691

1692
    /** Get expanded {@code shippingRate}. */
1693
    public ShippingRate getShippingRateObject() {
1694
      return (this.shippingRate != null) ? this.shippingRate.getExpanded() : null;
×
1695
    }
1696

1697
    public void setShippingRateObject(ShippingRate expandableObject) {
1698
      this.shippingRate =
×
1699
          new ExpandableField<ShippingRate>(expandableObject.getId(), expandableObject);
×
1700
    }
×
1701

1702
    @Getter
1703
    @Setter
1704
    @EqualsAndHashCode(callSuper = false)
1705
    public static class Tax extends StripeObject {
×
1706
      /** Amount of tax applied for this rate. */
1707
      @SerializedName("amount")
1708
      Long amount;
1709

1710
      /**
1711
       * Tax rates can be applied to <a
1712
       * href="https://stripe.com/docs/billing/invoices/tax-rates">invoices</a>, <a
1713
       * href="https://stripe.com/docs/billing/subscriptions/taxes">subscriptions</a> and <a
1714
       * href="https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates">Checkout
1715
       * Sessions</a> to collect tax.
1716
       *
1717
       * <p>Related guide: <a href="https://stripe.com/docs/billing/taxes/tax-rates">Tax rates</a>
1718
       */
1719
      @SerializedName("rate")
1720
      TaxRate rate;
1721

1722
      /**
1723
       * The reasoning behind this tax, for example, if the product is tax exempt. The possible
1724
       * values for this field may be extended as new tax rules are supported.
1725
       *
1726
       * <p>One of {@code customer_exempt}, {@code not_collecting}, {@code not_subject_to_tax},
1727
       * {@code not_supported}, {@code portion_product_exempt}, {@code portion_reduced_rated},
1728
       * {@code portion_standard_rated}, {@code product_exempt}, {@code product_exempt_holiday},
1729
       * {@code proportionally_rated}, {@code reduced_rated}, {@code reverse_charge}, {@code
1730
       * standard_rated}, {@code taxable_basis_reduced}, or {@code zero_rated}.
1731
       */
1732
      @SerializedName("taxability_reason")
1733
      String taxabilityReason;
1734

1735
      /** The amount on which tax is calculated, in cents (or local equivalent). */
1736
      @SerializedName("taxable_amount")
1737
      Long taxableAmount;
1738
    }
1739
  }
1740

1741
  @Getter
1742
  @Setter
1743
  @EqualsAndHashCode(callSuper = false)
1744
  public static class ShippingDetails extends StripeObject {
×
1745
    /** Recipient shipping address. Required if the order includes products that are shippable. */
1746
    @SerializedName("address")
1747
    Address address;
1748

1749
    /** Recipient name. */
1750
    @SerializedName("name")
1751
    String name;
1752

1753
    /** Recipient phone (including extension). */
1754
    @SerializedName("phone")
1755
    String phone;
1756
  }
1757

1758
  @Getter
1759
  @Setter
1760
  @EqualsAndHashCode(callSuper = false)
1761
  public static class TaxDetails extends StripeObject {
×
1762
    /**
1763
     * Describes the purchaser's tax exemption status. One of {@code none}, {@code exempt}, or
1764
     * {@code reverse}.
1765
     */
1766
    @SerializedName("tax_exempt")
1767
    String taxExempt;
1768

1769
    /** The purchaser's tax IDs to be used in calculation of tax for this Order. */
1770
    @SerializedName("tax_ids")
1771
    List<Order.TaxDetails.TaxId> taxIds;
1772

1773
    @Getter
1774
    @Setter
1775
    @EqualsAndHashCode(callSuper = false)
1776
    public static class TaxId extends StripeObject {
×
1777
      /**
1778
       * The type of the tax ID, one of {@code ad_nrt}, {@code ar_cuit}, {@code eu_vat}, {@code
1779
       * bo_tin}, {@code br_cnpj}, {@code br_cpf}, {@code cn_tin}, {@code co_nit}, {@code cr_tin},
1780
       * {@code do_rcn}, {@code ec_ruc}, {@code eu_oss_vat}, {@code hr_oib}, {@code pe_ruc}, {@code
1781
       * ro_tin}, {@code rs_pib}, {@code sv_nit}, {@code uy_ruc}, {@code ve_rif}, {@code vn_tin},
1782
       * {@code gb_vat}, {@code nz_gst}, {@code au_abn}, {@code au_arn}, {@code in_gst}, {@code
1783
       * no_vat}, {@code no_voec}, {@code za_vat}, {@code ch_vat}, {@code mx_rfc}, {@code sg_uen},
1784
       * {@code ru_inn}, {@code ru_kpp}, {@code ca_bn}, {@code hk_br}, {@code es_cif}, {@code
1785
       * tw_vat}, {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code li_uid},
1786
       * {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code ca_gst_hst}, {@code
1787
       * ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, {@code sg_gst}, {@code
1788
       * ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code my_frp}, {@code il_vat},
1789
       * {@code ge_vat}, {@code ua_vat}, {@code is_vat}, {@code bg_uic}, {@code hu_tin}, {@code
1790
       * si_tin}, {@code ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code ph_tin}, {@code bh_vat},
1791
       * {@code kz_bin}, {@code ng_tin}, {@code om_vat}, {@code de_stn}, {@code ch_uid}, {@code
1792
       * tz_vat}, {@code uz_vat}, {@code uz_tin}, {@code md_vat}, {@code ma_vat}, {@code by_tin}, or
1793
       * {@code unknown}.
1794
       */
1795
      @SerializedName("type")
1796
      String type;
1797

1798
      /** The value of the tax ID. */
1799
      @SerializedName("value")
1800
      String value;
1801
    }
1802
  }
1803

1804
  @Getter
1805
  @Setter
1806
  @EqualsAndHashCode(callSuper = false)
1807
  public static class TotalDetails extends StripeObject {
×
1808
    @SerializedName("amount_credit")
1809
    Long amountCredit;
1810

1811
    /** This is the sum of all the discounts. */
1812
    @SerializedName("amount_discount")
1813
    Long amountDiscount;
1814

1815
    /** This is the sum of all the shipping amounts. */
1816
    @SerializedName("amount_shipping")
1817
    Long amountShipping;
1818

1819
    /** This is the sum of all the tax amounts. */
1820
    @SerializedName("amount_tax")
1821
    Long amountTax;
1822

1823
    @SerializedName("breakdown")
1824
    Breakdown breakdown;
1825

1826
    @Getter
1827
    @Setter
1828
    @EqualsAndHashCode(callSuper = false)
1829
    public static class Breakdown extends StripeObject {
×
1830
      /** The aggregated discounts. */
1831
      @SerializedName("discounts")
1832
      List<Order.TotalDetails.Breakdown.Discount> discounts;
1833

1834
      /** The aggregated tax amounts by rate. */
1835
      @SerializedName("taxes")
1836
      List<Order.TotalDetails.Breakdown.Tax> taxes;
1837

1838
      @Getter
1839
      @Setter
1840
      @EqualsAndHashCode(callSuper = false)
1841
      public static class Discount extends StripeObject {
×
1842
        /** The amount discounted. */
1843
        @SerializedName("amount")
1844
        Long amount;
1845

1846
        /**
1847
         * A discount represents the actual application of a <a
1848
         * href="https://stripe.com/docs/api#coupons">coupon</a> or <a
1849
         * href="https://stripe.com/docs/api#promotion_codes">promotion code</a>. It contains
1850
         * information about when the discount began, when it will end, and what it is applied to.
1851
         *
1852
         * <p>Related guide: <a
1853
         * href="https://stripe.com/docs/billing/subscriptions/discounts">Applying discounts to
1854
         * subscriptions</a>
1855
         */
1856
        @SerializedName("discount")
1857
        com.stripe.model.Discount discount;
1858
      }
1859

1860
      @Getter
1861
      @Setter
1862
      @EqualsAndHashCode(callSuper = false)
1863
      public static class Tax extends StripeObject {
×
1864
        /** Amount of tax applied for this rate. */
1865
        @SerializedName("amount")
1866
        Long amount;
1867

1868
        /**
1869
         * Tax rates can be applied to <a
1870
         * href="https://stripe.com/docs/billing/invoices/tax-rates">invoices</a>, <a
1871
         * href="https://stripe.com/docs/billing/subscriptions/taxes">subscriptions</a> and <a
1872
         * href="https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates">Checkout
1873
         * Sessions</a> to collect tax.
1874
         *
1875
         * <p>Related guide: <a href="https://stripe.com/docs/billing/taxes/tax-rates">Tax rates</a>
1876
         */
1877
        @SerializedName("rate")
1878
        TaxRate rate;
1879

1880
        /**
1881
         * The reasoning behind this tax, for example, if the product is tax exempt. The possible
1882
         * values for this field may be extended as new tax rules are supported.
1883
         *
1884
         * <p>One of {@code customer_exempt}, {@code not_collecting}, {@code not_subject_to_tax},
1885
         * {@code not_supported}, {@code portion_product_exempt}, {@code portion_reduced_rated},
1886
         * {@code portion_standard_rated}, {@code product_exempt}, {@code product_exempt_holiday},
1887
         * {@code proportionally_rated}, {@code reduced_rated}, {@code reverse_charge}, {@code
1888
         * standard_rated}, {@code taxable_basis_reduced}, or {@code zero_rated}.
1889
         */
1890
        @SerializedName("taxability_reason")
1891
        String taxabilityReason;
1892

1893
        /** The amount on which tax is calculated, in cents (or local equivalent). */
1894
        @SerializedName("taxable_amount")
1895
        Long taxableAmount;
1896
      }
1897
    }
1898
  }
1899

1900
  @Override
1901
  public void setResponseGetter(StripeResponseGetter responseGetter) {
1902
    super.setResponseGetter(responseGetter);
×
1903
    trySetResponseGetter(application, responseGetter);
×
1904
    trySetResponseGetter(automaticTax, responseGetter);
×
1905
    trySetResponseGetter(billingDetails, responseGetter);
×
1906
    trySetResponseGetter(customer, responseGetter);
×
1907
    trySetResponseGetter(lineItems, responseGetter);
×
1908
    trySetResponseGetter(payment, responseGetter);
×
1909
    trySetResponseGetter(shippingCost, responseGetter);
×
1910
    trySetResponseGetter(shippingDetails, responseGetter);
×
1911
    trySetResponseGetter(taxDetails, responseGetter);
×
1912
    trySetResponseGetter(totalDetails, responseGetter);
×
1913
  }
×
1914
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc