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

stripe / stripe-java / #16673

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

push

github

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

Update generated code for beta

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

16 existing lines in 9 files now uncovered.

18861 of 152217 relevant lines covered (12.39%)

0.12 hits per line

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

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
  /**
631
   * For more details about AutomaticTax, please refer to the <a
632
   * href="https://docs.stripe.com/api">API Reference.</a>
633
   */
634
  @Getter
635
  @Setter
636
  @EqualsAndHashCode(callSuper = false)
637
  public static class AutomaticTax extends StripeObject {
×
638
    /** Whether Stripe automatically computes tax on this Order. */
639
    @SerializedName("enabled")
640
    Boolean enabled;
641

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

651
  /**
652
   * For more details about BillingDetails, please refer to the <a
653
   * href="https://docs.stripe.com/api">API Reference.</a>
654
   */
655
  @Getter
656
  @Setter
657
  @EqualsAndHashCode(callSuper = false)
658
  public static class BillingDetails extends StripeObject {
×
659
    /** Billing address for the order. */
660
    @SerializedName("address")
661
    Address address;
662

663
    /** Email address for the order. */
664
    @SerializedName("email")
665
    String email;
666

667
    /** Full name for the order. */
668
    @SerializedName("name")
669
    String name;
670

671
    /** Billing phone number for the order (including extension). */
672
    @SerializedName("phone")
673
    String phone;
674
  }
675

676
  /**
677
   * For more details about Credit, please refer to the <a href="https://docs.stripe.com/api">API
678
   * Reference.</a>
679
   */
680
  @Getter
681
  @Setter
682
  @EqualsAndHashCode(callSuper = false)
683
  public static class Credit extends StripeObject {
×
684
    /** The amount of this credit to apply to the order. */
685
    @SerializedName("amount")
686
    Long amount;
687

688
    /** Details for a gift card. */
689
    @SerializedName("gift_card")
690
    GiftCard giftCard;
691

692
    /** Line items on this order that are ineligible for this credit. */
693
    @SerializedName("ineligible_line_items")
694
    List<String> ineligibleLineItems;
695

696
    /**
697
     * The type of credit to apply to the order, only {@code gift_card} currently supported.
698
     *
699
     * <p>Equal to {@code gift_card}.
700
     */
701
    @SerializedName("type")
702
    String type;
703

704
    /**
705
     * For more details about GiftCard, please refer to the <a
706
     * href="https://docs.stripe.com/api">API Reference.</a>
707
     */
708
    @Getter
709
    @Setter
710
    @EqualsAndHashCode(callSuper = false)
711
    public static class GiftCard extends StripeObject {
×
712
      /** The token of the gift card applied to the order. */
713
      @SerializedName("card")
714
      String card;
715
    }
716
  }
717

718
  /**
719
   * For more details about Payment, please refer to the <a href="https://docs.stripe.com/api">API
720
   * Reference.</a>
721
   */
722
  @Getter
723
  @Setter
724
  @EqualsAndHashCode(callSuper = false)
725
  public static class Payment extends StripeObject {
×
726
    /** ID of the payment intent associated with this order. Null when the order is {@code open}. */
727
    @SerializedName("payment_intent")
728
    @Getter(lombok.AccessLevel.NONE)
729
    @Setter(lombok.AccessLevel.NONE)
730
    ExpandableField<PaymentIntent> paymentIntent;
731

732
    /** Settings describing how the order should configure generated PaymentIntents. */
733
    @SerializedName("settings")
734
    Settings settings;
735

736
    /**
737
     * The status of the underlying payment associated with this order, if any. Null when the order
738
     * is {@code open}.
739
     *
740
     * <p>One of {@code canceled}, {@code complete}, {@code not_required}, {@code processing},
741
     * {@code requires_action}, {@code requires_capture}, {@code requires_confirmation}, or {@code
742
     * requires_payment_method}.
743
     */
744
    @SerializedName("status")
745
    String status;
746

747
    /** Get ID of expandable {@code paymentIntent} object. */
748
    public String getPaymentIntent() {
749
      return (this.paymentIntent != null) ? this.paymentIntent.getId() : null;
×
750
    }
751

752
    public void setPaymentIntent(String id) {
753
      this.paymentIntent = ApiResource.setExpandableFieldId(id, this.paymentIntent);
×
754
    }
×
755

756
    /** Get expanded {@code paymentIntent}. */
757
    public PaymentIntent getPaymentIntentObject() {
758
      return (this.paymentIntent != null) ? this.paymentIntent.getExpanded() : null;
×
759
    }
760

761
    public void setPaymentIntentObject(PaymentIntent expandableObject) {
762
      this.paymentIntent =
×
763
          new ExpandableField<PaymentIntent>(expandableObject.getId(), expandableObject);
×
764
    }
×
765

766
    /**
767
     * For more details about Settings, please refer to the <a
768
     * href="https://docs.stripe.com/api">API Reference.</a>
769
     */
770
    @Getter
771
    @Setter
772
    @EqualsAndHashCode(callSuper = false)
773
    public static class Settings extends StripeObject {
×
774
      /**
775
       * The amount of the application fee (if any) that will be requested to be applied to the
776
       * payment and transferred to the application owner's Stripe account.
777
       */
778
      @SerializedName("application_fee_amount")
779
      Long applicationFeeAmount;
780

781
      /**
782
       * Indicates whether order has been opted into using <a
783
       * href="https://dashboard.stripe.com/settings/payment_methods">Stripe Dashboard</a> to manage
784
       * payment method types.
785
       */
786
      @SerializedName("automatic_payment_methods")
787
      AutomaticPaymentMethods automaticPaymentMethods;
788

789
      /** PaymentMethod-specific configuration to provide to the order's PaymentIntent. */
790
      @SerializedName("payment_method_options")
791
      PaymentMethodOptions paymentMethodOptions;
792

793
      /**
794
       * The list of <a href="https://stripe.com/docs/payments/payment-methods/overview">payment
795
       * method types</a> to provide to the order's PaymentIntent. Do not include this attribute if
796
       * you prefer to manage your payment methods from the <a
797
       * href="https://dashboard.stripe.com/settings/payment_methods">Stripe Dashboard</a>.
798
       */
799
      @SerializedName("payment_method_types")
800
      List<String> paymentMethodTypes;
801

802
      /** The URL to redirect the customer to after they authenticate their payment. */
803
      @SerializedName("return_url")
804
      String returnUrl;
805

806
      /**
807
       * For non-card charges, you can use this value as the complete description that appears on
808
       * your customers' statements. Must contain at least one letter, maximum 22 characters.
809
       */
810
      @SerializedName("statement_descriptor")
811
      String statementDescriptor;
812

813
      /**
814
       * Provides information about a card payment that customers see on their statements.
815
       * Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on
816
       * the account to form the complete statement descriptor. Maximum 22 characters for the
817
       * concatenated descriptor.
818
       */
819
      @SerializedName("statement_descriptor_suffix")
820
      String statementDescriptorSuffix;
821

822
      /** Provides configuration for completing a transfer for the order after it is paid. */
823
      @SerializedName("transfer_data")
824
      TransferData transferData;
825

826
      /**
827
       * For more details about AutomaticPaymentMethods, please refer to the <a
828
       * href="https://docs.stripe.com/api">API Reference.</a>
829
       */
830
      @Getter
831
      @Setter
832
      @EqualsAndHashCode(callSuper = false)
833
      public static class AutomaticPaymentMethods extends StripeObject {
×
834
        /**
835
         * Whether this Order has been opted into managing payment method types via the <a
836
         * href="https://dashboard.stripe.com/settings/payment_methods">Stripe Dashboard</a>.
837
         */
838
        @SerializedName("enabled")
839
        Boolean enabled;
840
      }
841

842
      /**
843
       * For more details about PaymentMethodOptions, please refer to the <a
844
       * href="https://docs.stripe.com/api">API Reference.</a>
845
       */
846
      @Getter
847
      @Setter
848
      @EqualsAndHashCode(callSuper = false)
849
      public static class PaymentMethodOptions extends StripeObject {
×
850
        @SerializedName("acss_debit")
851
        AcssDebit acssDebit;
852

853
        @SerializedName("afterpay_clearpay")
854
        AfterpayClearpay afterpayClearpay;
855

856
        @SerializedName("alipay")
857
        Alipay alipay;
858

859
        @SerializedName("bancontact")
860
        Bancontact bancontact;
861

862
        @SerializedName("card")
863
        Card card;
864

865
        @SerializedName("customer_balance")
866
        CustomerBalance customerBalance;
867

868
        @SerializedName("ideal")
869
        Ideal ideal;
870

871
        @SerializedName("klarna")
872
        Klarna klarna;
873

874
        @SerializedName("link")
875
        Link link;
876

877
        @SerializedName("oxxo")
878
        Oxxo oxxo;
879

880
        @SerializedName("p24")
881
        P24 p24;
882

883
        @SerializedName("paypal")
884
        Paypal paypal;
885

886
        @SerializedName("sepa_debit")
887
        SepaDebit sepaDebit;
888

889
        @SerializedName("sofort")
890
        Sofort sofort;
891

892
        @SerializedName("wechat_pay")
893
        WechatPay wechatPay;
894

895
        /**
896
         * For more details about AcssDebit, please refer to the <a
897
         * href="https://docs.stripe.com/api">API Reference.</a>
898
         */
899
        @Getter
900
        @Setter
901
        @EqualsAndHashCode(callSuper = false)
902
        public static class AcssDebit extends StripeObject {
×
903
          @SerializedName("mandate_options")
904
          MandateOptions mandateOptions;
905

906
          /**
907
           * Indicates that you intend to make future payments with this PaymentIntent's payment
908
           * method.
909
           *
910
           * <p>If you provide a Customer with the PaymentIntent, you can use this parameter to <a
911
           * href="https://stripe.com/payments/save-during-payment">attach the payment method</a> to
912
           * the Customer after the PaymentIntent is confirmed and the customer completes any
913
           * required actions. If you don't provide a Customer, you can still <a
914
           * href="https://stripe.com/api/payment_methods/attach">attach</a> the payment method to a
915
           * Customer after the transaction completes.
916
           *
917
           * <p>If the payment method is {@code card_present} and isn't a digital wallet, Stripe
918
           * creates and attaches a <a
919
           * href="https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card">generated_card</a>
920
           * payment method representing the card to the Customer instead.
921
           *
922
           * <p>When processing card payments, Stripe uses {@code setup_future_usage} to help you
923
           * comply with regional legislation and network rules, such as <a
924
           * href="https://stripe.com/strong-customer-authentication">SCA</a>.
925
           *
926
           * <p>One of {@code none}, {@code off_session}, or {@code on_session}.
927
           */
928
          @SerializedName("setup_future_usage")
929
          String setupFutureUsage;
930

931
          /**
932
           * Bank account verification method.
933
           *
934
           * <p>One of {@code automatic}, {@code instant}, or {@code microdeposits}.
935
           */
936
          @SerializedName("verification_method")
937
          String verificationMethod;
938

939
          /**
940
           * For more details about MandateOptions, please refer to the <a
941
           * href="https://docs.stripe.com/api">API Reference.</a>
942
           */
943
          @Getter
944
          @Setter
945
          @EqualsAndHashCode(callSuper = false)
946
          public static class MandateOptions extends StripeObject {
×
947
            /** A URL for custom mandate text. */
948
            @SerializedName("custom_mandate_url")
949
            String customMandateUrl;
950

951
            /**
952
             * Description of the interval. Only required if the 'payment_schedule' parameter is
953
             * 'interval' or 'combined'.
954
             */
955
            @SerializedName("interval_description")
956
            String intervalDescription;
957

958
            /**
959
             * Payment schedule for the mandate.
960
             *
961
             * <p>One of {@code combined}, {@code interval}, or {@code sporadic}.
962
             */
963
            @SerializedName("payment_schedule")
964
            String paymentSchedule;
965

966
            /**
967
             * Transaction type of the mandate.
968
             *
969
             * <p>One of {@code business}, or {@code personal}.
970
             */
971
            @SerializedName("transaction_type")
972
            String transactionType;
973
          }
974
        }
975

976
        /**
977
         * For more details about AfterpayClearpay, please refer to the <a
978
         * href="https://docs.stripe.com/api">API Reference.</a>
979
         */
980
        @Getter
981
        @Setter
982
        @EqualsAndHashCode(callSuper = false)
983
        public static class AfterpayClearpay extends StripeObject {
×
984
          /**
985
           * Controls when the funds will be captured from the customer's account.
986
           *
987
           * <p>One of {@code automatic}, {@code automatic_async}, or {@code manual}.
988
           */
989
          @SerializedName("capture_method")
990
          String captureMethod;
991

992
          /**
993
           * Order identifier shown to the user in Afterpay's online portal. We recommend using a
994
           * value that helps you answer any questions a customer might have about the payment. The
995
           * identifier is limited to 128 characters and may contain only letters, digits,
996
           * underscores, backslashes and dashes.
997
           */
998
          @SerializedName("reference")
999
          String reference;
1000

1001
          /**
1002
           * Indicates that you intend to make future payments with the payment method.
1003
           *
1004
           * <p>Providing this parameter will <a
1005
           * href="https://stripe.com/docs/payments/save-during-payment">attach the payment
1006
           * method</a> to the order's Customer, if present, after the order's PaymentIntent is
1007
           * confirmed and any required actions from the user are complete. If no Customer was
1008
           * provided, the payment method can still be <a
1009
           * href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer
1010
           * after the transaction completes.
1011
           *
1012
           * <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
1013
           * dynamically optimize your payment flow and comply with regional legislation and network
1014
           * rules, such as <a
1015
           * href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
1016
           *
1017
           * <p>If {@code setup_future_usage} is already set and you are performing a request using
1018
           * a publishable key, you may only update the value from {@code on_session} to {@code
1019
           * off_session}.
1020
           *
1021
           * <p>Equal to {@code none}.
1022
           */
1023
          @SerializedName("setup_future_usage")
1024
          String setupFutureUsage;
1025
        }
1026

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

1061
        /**
1062
         * For more details about Bancontact, please refer to the <a
1063
         * href="https://docs.stripe.com/api">API Reference.</a>
1064
         */
1065
        @Getter
1066
        @Setter
1067
        @EqualsAndHashCode(callSuper = false)
1068
        public static class Bancontact extends StripeObject {
×
1069
          /**
1070
           * Preferred language of the Bancontact authorization page that the customer is redirected
1071
           * to.
1072
           *
1073
           * <p>One of {@code de}, {@code en}, {@code fr}, or {@code nl}.
1074
           */
1075
          @SerializedName("preferred_language")
1076
          String preferredLanguage;
1077

1078
          /**
1079
           * Indicates that you intend to make future payments with this PaymentIntent's payment
1080
           * method.
1081
           *
1082
           * <p>If you provide a Customer with the PaymentIntent, you can use this parameter to <a
1083
           * href="https://stripe.com/payments/save-during-payment">attach the payment method</a> to
1084
           * the Customer after the PaymentIntent is confirmed and the customer completes any
1085
           * required actions. If you don't provide a Customer, you can still <a
1086
           * href="https://stripe.com/api/payment_methods/attach">attach</a> the payment method to a
1087
           * Customer after the transaction completes.
1088
           *
1089
           * <p>If the payment method is {@code card_present} and isn't a digital wallet, Stripe
1090
           * creates and attaches a <a
1091
           * href="https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card">generated_card</a>
1092
           * payment method representing the card to the Customer instead.
1093
           *
1094
           * <p>When processing card payments, Stripe uses {@code setup_future_usage} to help you
1095
           * comply with regional legislation and network rules, such as <a
1096
           * href="https://stripe.com/strong-customer-authentication">SCA</a>.
1097
           *
1098
           * <p>One of {@code none}, or {@code off_session}.
1099
           */
1100
          @SerializedName("setup_future_usage")
1101
          String setupFutureUsage;
1102
        }
1103

1104
        /**
1105
         * For more details about Card, please refer to the <a
1106
         * href="https://docs.stripe.com/api">API Reference.</a>
1107
         */
1108
        @Getter
1109
        @Setter
1110
        @EqualsAndHashCode(callSuper = false)
1111
        public static class Card extends StripeObject {
×
1112
          /**
1113
           * Controls when the funds will be captured from the customer's account.
1114
           *
1115
           * <p>One of {@code automatic}, {@code automatic_async}, or {@code manual}.
1116
           */
1117
          @SerializedName("capture_method")
1118
          String captureMethod;
1119

1120
          /**
1121
           * Indicates that you intend to make future payments with the payment method.
1122
           *
1123
           * <p>Providing this parameter will <a
1124
           * href="https://stripe.com/docs/payments/save-during-payment">attach the payment
1125
           * method</a> to the order's Customer, if present, after the order's PaymentIntent is
1126
           * confirmed and any required actions from the user are complete. If no Customer was
1127
           * provided, the payment method can still be <a
1128
           * href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer
1129
           * after the transaction completes.
1130
           *
1131
           * <p>When processing card payments, Stripe also uses {@code setup_future_usage} to
1132
           * dynamically optimize your payment flow and comply with regional legislation and network
1133
           * rules, such as <a
1134
           * href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
1135
           *
1136
           * <p>If {@code setup_future_usage} is already set and you are performing a request using
1137
           * a publishable key, you may only update the value from {@code on_session} to {@code
1138
           * off_session}.
1139
           *
1140
           * <p>One of {@code none}, {@code off_session}, or {@code on_session}.
1141
           */
1142
          @SerializedName("setup_future_usage")
1143
          String setupFutureUsage;
1144
        }
1145

1146
        /**
1147
         * For more details about CustomerBalance, please refer to the <a
1148
         * href="https://docs.stripe.com/api">API Reference.</a>
1149
         */
1150
        @Getter
1151
        @Setter
1152
        @EqualsAndHashCode(callSuper = false)
1153
        public static class CustomerBalance extends StripeObject {
×
1154
          @SerializedName("bank_transfer")
1155
          BankTransfer bankTransfer;
1156

1157
          /**
1158
           * The funding method type to be used when there are not enough funds in the customer
1159
           * balance. Permitted values include: {@code bank_transfer}.
1160
           *
1161
           * <p>Equal to {@code bank_transfer}.
1162
           */
1163
          @SerializedName("funding_type")
1164
          String fundingType;
1165

1166
          /**
1167
           * Indicates that you intend to make future payments with this PaymentIntent's payment
1168
           * method.
1169
           *
1170
           * <p>If you provide a Customer with the PaymentIntent, you can use this parameter to <a
1171
           * href="https://stripe.com/payments/save-during-payment">attach the payment method</a> to
1172
           * the Customer after the PaymentIntent is confirmed and the customer completes any
1173
           * required actions. If you don't provide a Customer, you can still <a
1174
           * href="https://stripe.com/api/payment_methods/attach">attach</a> the payment method to a
1175
           * Customer after the transaction completes.
1176
           *
1177
           * <p>If the payment method is {@code card_present} and isn't a digital wallet, Stripe
1178
           * creates and attaches a <a
1179
           * href="https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card">generated_card</a>
1180
           * payment method representing the card to the Customer instead.
1181
           *
1182
           * <p>When processing card payments, Stripe uses {@code setup_future_usage} to help you
1183
           * comply with regional legislation and network rules, such as <a
1184
           * href="https://stripe.com/strong-customer-authentication">SCA</a>.
1185
           *
1186
           * <p>Equal to {@code none}.
1187
           */
1188
          @SerializedName("setup_future_usage")
1189
          String setupFutureUsage;
1190

1191
          /**
1192
           * For more details about BankTransfer, please refer to the <a
1193
           * href="https://docs.stripe.com/api">API Reference.</a>
1194
           */
1195
          @Getter
1196
          @Setter
1197
          @EqualsAndHashCode(callSuper = false)
1198
          public static class BankTransfer extends StripeObject {
×
1199
            @SerializedName("eu_bank_transfer")
1200
            EuBankTransfer euBankTransfer;
1201

1202
            /**
1203
             * List of address types that should be returned in the financial_addresses response. If
1204
             * not specified, all valid types will be returned.
1205
             *
1206
             * <p>Permitted values include: {@code sort_code}, {@code zengin}, {@code iban}, or
1207
             * {@code spei}.
1208
             */
1209
            @SerializedName("requested_address_types")
1210
            List<String> requestedAddressTypes;
1211

1212
            /**
1213
             * The bank transfer type that this PaymentIntent is allowed to use for funding
1214
             * Permitted values include: {@code eu_bank_transfer}, {@code gb_bank_transfer}, {@code
1215
             * jp_bank_transfer}, {@code mx_bank_transfer}, or {@code us_bank_transfer}.
1216
             *
1217
             * <p>One of {@code eu_bank_transfer}, {@code gb_bank_transfer}, {@code
1218
             * jp_bank_transfer}, {@code mx_bank_transfer}, or {@code us_bank_transfer}.
1219
             */
1220
            @SerializedName("type")
1221
            String type;
1222

1223
            /**
1224
             * For more details about EuBankTransfer, please refer to the <a
1225
             * href="https://docs.stripe.com/api">API Reference.</a>
1226
             */
1227
            @Getter
1228
            @Setter
1229
            @EqualsAndHashCode(callSuper = false)
1230
            public static class EuBankTransfer extends StripeObject {
×
1231
              /**
1232
               * The desired country code of the bank account information. Permitted values include:
1233
               * {@code BE}, {@code DE}, {@code ES}, {@code FR}, {@code IE}, or {@code NL}.
1234
               *
1235
               * <p>One of {@code BE}, {@code DE}, {@code ES}, {@code FR}, {@code IE}, or {@code
1236
               * NL}.
1237
               */
1238
              @SerializedName("country")
1239
              String country;
1240
            }
1241
          }
1242
        }
1243

1244
        /**
1245
         * For more details about Ideal, please refer to the <a
1246
         * href="https://docs.stripe.com/api">API Reference.</a>
1247
         */
1248
        @Getter
1249
        @Setter
1250
        @EqualsAndHashCode(callSuper = false)
1251
        public static class Ideal extends StripeObject {
×
1252
          /**
1253
           * Indicates that you intend to make future payments with this PaymentIntent's payment
1254
           * method.
1255
           *
1256
           * <p>If you provide a Customer with the PaymentIntent, you can use this parameter to <a
1257
           * href="https://stripe.com/payments/save-during-payment">attach the payment method</a> to
1258
           * the Customer after the PaymentIntent is confirmed and the customer completes any
1259
           * required actions. If you don't provide a Customer, you can still <a
1260
           * href="https://stripe.com/api/payment_methods/attach">attach</a> the payment method to a
1261
           * Customer after the transaction completes.
1262
           *
1263
           * <p>If the payment method is {@code card_present} and isn't a digital wallet, Stripe
1264
           * creates and attaches a <a
1265
           * href="https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card">generated_card</a>
1266
           * payment method representing the card to the Customer instead.
1267
           *
1268
           * <p>When processing card payments, Stripe uses {@code setup_future_usage} to help you
1269
           * comply with regional legislation and network rules, such as <a
1270
           * href="https://stripe.com/strong-customer-authentication">SCA</a>.
1271
           *
1272
           * <p>One of {@code none}, or {@code off_session}.
1273
           */
1274
          @SerializedName("setup_future_usage")
1275
          String setupFutureUsage;
1276
        }
1277

1278
        /**
1279
         * For more details about Klarna, please refer to the <a
1280
         * href="https://docs.stripe.com/api">API Reference.</a>
1281
         */
1282
        @Getter
1283
        @Setter
1284
        @EqualsAndHashCode(callSuper = false)
1285
        public static class Klarna extends StripeObject {
×
1286
          /**
1287
           * Controls when the funds will be captured from the customer's account.
1288
           *
1289
           * <p>Equal to {@code manual}.
1290
           */
1291
          @SerializedName("capture_method")
1292
          String captureMethod;
1293

1294
          /** Preferred locale of the Klarna checkout page that the customer is redirected to. */
1295
          @SerializedName("preferred_locale")
1296
          String preferredLocale;
1297

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

1324
        /**
1325
         * For more details about Link, please refer to the <a
1326
         * href="https://docs.stripe.com/api">API Reference.</a>
1327
         */
1328
        @Getter
1329
        @Setter
1330
        @EqualsAndHashCode(callSuper = false)
1331
        public static class Link extends StripeObject {
×
1332
          /**
1333
           * Controls when the funds will be captured from the customer's account.
1334
           *
1335
           * <p>Equal to {@code manual}.
1336
           */
1337
          @SerializedName("capture_method")
1338
          String captureMethod;
1339

1340
          /** [Deprecated] This is a legacy parameter that no longer has any function. */
1341
          @SerializedName("persistent_token")
1342
          @Deprecated
1343
          String persistentToken;
1344

1345
          /**
1346
           * Indicates that you intend to make future payments with this PaymentIntent's payment
1347
           * method.
1348
           *
1349
           * <p>If you provide a Customer with the PaymentIntent, you can use this parameter to <a
1350
           * href="https://stripe.com/payments/save-during-payment">attach the payment method</a> to
1351
           * the Customer after the PaymentIntent is confirmed and the customer completes any
1352
           * required actions. If you don't provide a Customer, you can still <a
1353
           * href="https://stripe.com/api/payment_methods/attach">attach</a> the payment method to a
1354
           * Customer after the transaction completes.
1355
           *
1356
           * <p>If the payment method is {@code card_present} and isn't a digital wallet, Stripe
1357
           * creates and attaches a <a
1358
           * href="https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card">generated_card</a>
1359
           * payment method representing the card to the Customer instead.
1360
           *
1361
           * <p>When processing card payments, Stripe uses {@code setup_future_usage} to help you
1362
           * comply with regional legislation and network rules, such as <a
1363
           * href="https://stripe.com/strong-customer-authentication">SCA</a>.
1364
           *
1365
           * <p>One of {@code none}, or {@code off_session}.
1366
           */
1367
          @SerializedName("setup_future_usage")
1368
          String setupFutureUsage;
1369
        }
1370

1371
        /**
1372
         * For more details about Oxxo, please refer to the <a
1373
         * href="https://docs.stripe.com/api">API Reference.</a>
1374
         */
1375
        @Getter
1376
        @Setter
1377
        @EqualsAndHashCode(callSuper = false)
1378
        public static class Oxxo extends StripeObject {
×
1379
          /**
1380
           * The number of calendar days before an OXXO invoice expires. For example, if you create
1381
           * an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will
1382
           * expire on Wednesday at 23:59 America/Mexico_City time.
1383
           */
1384
          @SerializedName("expires_after_days")
1385
          Long expiresAfterDays;
1386

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

1413
        /**
1414
         * For more details about P24, please refer to the <a href="https://docs.stripe.com/api">API
1415
         * Reference.</a>
1416
         */
1417
        @Getter
1418
        @Setter
1419
        @EqualsAndHashCode(callSuper = false)
1420
        public static class P24 extends StripeObject {
×
1421
          /**
1422
           * Indicates that you intend to make future payments with this PaymentIntent's payment
1423
           * method.
1424
           *
1425
           * <p>If you provide a Customer with the PaymentIntent, you can use this parameter to <a
1426
           * href="https://stripe.com/payments/save-during-payment">attach the payment method</a> to
1427
           * the Customer after the PaymentIntent is confirmed and the customer completes any
1428
           * required actions. If you don't provide a Customer, you can still <a
1429
           * href="https://stripe.com/api/payment_methods/attach">attach</a> the payment method to a
1430
           * Customer after the transaction completes.
1431
           *
1432
           * <p>If the payment method is {@code card_present} and isn't a digital wallet, Stripe
1433
           * creates and attaches a <a
1434
           * href="https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card">generated_card</a>
1435
           * payment method representing the card to the Customer instead.
1436
           *
1437
           * <p>When processing card payments, Stripe uses {@code setup_future_usage} to help you
1438
           * comply with regional legislation and network rules, such as <a
1439
           * href="https://stripe.com/strong-customer-authentication">SCA</a>.
1440
           *
1441
           * <p>Equal to {@code none}.
1442
           */
1443
          @SerializedName("setup_future_usage")
1444
          String setupFutureUsage;
1445
        }
1446

1447
        /**
1448
         * For more details about Paypal, please refer to the <a
1449
         * href="https://docs.stripe.com/api">API Reference.</a>
1450
         */
1451
        @Getter
1452
        @Setter
1453
        @EqualsAndHashCode(callSuper = false)
1454
        public static class Paypal extends StripeObject {
×
1455
          /**
1456
           * Controls when the funds will be captured from the customer's account.
1457
           *
1458
           * <p>Equal to {@code manual}.
1459
           */
1460
          @SerializedName("capture_method")
1461
          String captureMethod;
1462

1463
          /** The line items purchased by the customer. */
1464
          @SerializedName("line_items")
1465
          List<Order.Payment.Settings.PaymentMethodOptions.Paypal.LineItem> lineItems;
1466

1467
          /** Preferred locale of the PayPal checkout page that the customer is redirected to. */
1468
          @SerializedName("preferred_locale")
1469
          String preferredLocale;
1470

1471
          /**
1472
           * A reference of the PayPal transaction visible to customer which is mapped to PayPal's
1473
           * invoice ID. This must be a globally unique ID if you have configured in your PayPal
1474
           * settings to block multiple payments per invoice ID.
1475
           */
1476
          @SerializedName("reference")
1477
          String reference;
1478

1479
          /**
1480
           * A reference of the PayPal transaction visible to customer which is mapped to PayPal's
1481
           * invoice ID. This must be a globally unique ID if you have configured in your PayPal
1482
           * settings to block multiple payments per invoice ID.
1483
           */
1484
          @SerializedName("reference_id")
1485
          String referenceId;
1486

1487
          /**
1488
           * Indicates that you intend to make future payments with this PaymentIntent's payment
1489
           * method.
1490
           *
1491
           * <p>If you provide a Customer with the PaymentIntent, you can use this parameter to <a
1492
           * href="https://stripe.com/payments/save-during-payment">attach the payment method</a> to
1493
           * the Customer after the PaymentIntent is confirmed and the customer completes any
1494
           * required actions. If you don't provide a Customer, you can still <a
1495
           * href="https://stripe.com/api/payment_methods/attach">attach</a> the payment method to a
1496
           * Customer after the transaction completes.
1497
           *
1498
           * <p>If the payment method is {@code card_present} and isn't a digital wallet, Stripe
1499
           * creates and attaches a <a
1500
           * href="https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card">generated_card</a>
1501
           * payment method representing the card to the Customer instead.
1502
           *
1503
           * <p>When processing card payments, Stripe uses {@code setup_future_usage} to help you
1504
           * comply with regional legislation and network rules, such as <a
1505
           * href="https://stripe.com/strong-customer-authentication">SCA</a>.
1506
           *
1507
           * <p>One of {@code none}, or {@code off_session}.
1508
           */
1509
          @SerializedName("setup_future_usage")
1510
          String setupFutureUsage;
1511

1512
          /**
1513
           * The Stripe connected account IDs of the sellers on the platform for this transaction
1514
           * (optional). Only allowed when <a
1515
           * href="https://stripe.com/docs/connect/separate-charges-and-transfers">separate charges
1516
           * and transfers</a> are used.
1517
           */
1518
          @SerializedName("subsellers")
1519
          List<String> subsellers;
1520

1521
          /**
1522
           * For more details about LineItem, please refer to the <a
1523
           * href="https://docs.stripe.com/api">API Reference.</a>
1524
           */
1525
          @Getter
1526
          @Setter
1527
          @EqualsAndHashCode(callSuper = false)
1528
          public static class LineItem extends StripeObject {
×
1529
            /**
1530
             * Type of the line item.
1531
             *
1532
             * <p>One of {@code digital_goods}, {@code donation}, or {@code physical_goods}.
1533
             */
1534
            @SerializedName("category")
1535
            String category;
1536

1537
            /** Description of the line item. */
1538
            @SerializedName("description")
1539
            String description;
1540

1541
            /** Descriptive name of the line item. */
1542
            @SerializedName("name")
1543
            String name;
1544

1545
            /** Quantity of the line item. Cannot be a negative number. */
1546
            @SerializedName("quantity")
1547
            Long quantity;
1548

1549
            /** Client facing stock keeping unit, article number or similar. */
1550
            @SerializedName("sku")
1551
            String sku;
1552

1553
            /**
1554
             * The Stripe account ID of the connected account that sells the item. This is only
1555
             * needed when using <a
1556
             * href="https://docs.stripe.com/connect/separate-charges-and-transfers">Separate
1557
             * Charges and Transfers</a>.
1558
             */
1559
            @SerializedName("sold_by")
1560
            String soldBy;
1561

1562
            @SerializedName("tax")
1563
            Tax tax;
1564

1565
            /**
1566
             * Price for a single unit of the line item in minor units. Cannot be a negative number.
1567
             */
1568
            @SerializedName("unit_amount")
1569
            Long unitAmount;
1570

1571
            /**
1572
             * For more details about Tax, please refer to the <a
1573
             * href="https://docs.stripe.com/api">API Reference.</a>
1574
             */
1575
            @Getter
1576
            @Setter
1577
            @EqualsAndHashCode(callSuper = false)
1578
            public static class Tax extends StripeObject {
×
1579
              /**
1580
               * The tax for a single unit of the line item in minor units. Cannot be a negative
1581
               * number.
1582
               */
1583
              @SerializedName("amount")
1584
              Long amount;
1585

1586
              /**
1587
               * The tax behavior for the line item.
1588
               *
1589
               * <p>One of {@code exclusive}, or {@code inclusive}.
1590
               */
1591
              @SerializedName("behavior")
1592
              String behavior;
1593
            }
1594
          }
1595
        }
1596

1597
        /**
1598
         * For more details about SepaDebit, please refer to the <a
1599
         * href="https://docs.stripe.com/api">API Reference.</a>
1600
         */
1601
        @Getter
1602
        @Setter
1603
        @EqualsAndHashCode(callSuper = false)
1604
        public static class SepaDebit extends StripeObject {
×
1605
          @SerializedName("mandate_options")
1606
          MandateOptions mandateOptions;
1607

1608
          /**
1609
           * Indicates that you intend to make future payments with this PaymentIntent's payment
1610
           * method.
1611
           *
1612
           * <p>If you provide a Customer with the PaymentIntent, you can use this parameter to <a
1613
           * href="https://stripe.com/payments/save-during-payment">attach the payment method</a> to
1614
           * the Customer after the PaymentIntent is confirmed and the customer completes any
1615
           * required actions. If you don't provide a Customer, you can still <a
1616
           * href="https://stripe.com/api/payment_methods/attach">attach</a> the payment method to a
1617
           * Customer after the transaction completes.
1618
           *
1619
           * <p>If the payment method is {@code card_present} and isn't a digital wallet, Stripe
1620
           * creates and attaches a <a
1621
           * href="https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card">generated_card</a>
1622
           * payment method representing the card to the Customer instead.
1623
           *
1624
           * <p>When processing card payments, Stripe uses {@code setup_future_usage} to help you
1625
           * comply with regional legislation and network rules, such as <a
1626
           * href="https://stripe.com/strong-customer-authentication">SCA</a>.
1627
           *
1628
           * <p>One of {@code none}, {@code off_session}, or {@code on_session}.
1629
           */
1630
          @SerializedName("setup_future_usage")
1631
          String setupFutureUsage;
1632

1633
          /**
1634
           * For more details about MandateOptions, please refer to the <a
1635
           * href="https://docs.stripe.com/api">API Reference.</a>
1636
           */
1637
          @Getter
1638
          @Setter
1639
          @EqualsAndHashCode(callSuper = false)
NEW
1640
          public static class MandateOptions extends StripeObject {
×
1641
            /**
1642
             * Prefix used to generate the Mandate reference. Must be at most 12 characters long.
1643
             * Must consist of only uppercase letters, numbers, spaces, or the following special
1644
             * characters: '/', '_', '-', '&amp;', '.'. Cannot begin with 'STRIPE'.
1645
             */
1646
            @SerializedName("reference_prefix")
1647
            String referencePrefix;
1648
          }
1649
        }
1650

1651
        /**
1652
         * For more details about Sofort, please refer to the <a
1653
         * href="https://docs.stripe.com/api">API Reference.</a>
1654
         */
1655
        @Getter
1656
        @Setter
1657
        @EqualsAndHashCode(callSuper = false)
1658
        public static class Sofort extends StripeObject {
×
1659
          /**
1660
           * Preferred language of the SOFORT authorization page that the customer is redirected to.
1661
           *
1662
           * <p>One of {@code de}, {@code en}, {@code es}, {@code fr}, {@code it}, {@code nl}, or
1663
           * {@code pl}.
1664
           */
1665
          @SerializedName("preferred_language")
1666
          String preferredLanguage;
1667

1668
          /**
1669
           * Indicates that you intend to make future payments with this PaymentIntent's payment
1670
           * method.
1671
           *
1672
           * <p>If you provide a Customer with the PaymentIntent, you can use this parameter to <a
1673
           * href="https://stripe.com/payments/save-during-payment">attach the payment method</a> to
1674
           * the Customer after the PaymentIntent is confirmed and the customer completes any
1675
           * required actions. If you don't provide a Customer, you can still <a
1676
           * href="https://stripe.com/api/payment_methods/attach">attach</a> the payment method to a
1677
           * Customer after the transaction completes.
1678
           *
1679
           * <p>If the payment method is {@code card_present} and isn't a digital wallet, Stripe
1680
           * creates and attaches a <a
1681
           * href="https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card">generated_card</a>
1682
           * payment method representing the card to the Customer instead.
1683
           *
1684
           * <p>When processing card payments, Stripe uses {@code setup_future_usage} to help you
1685
           * comply with regional legislation and network rules, such as <a
1686
           * href="https://stripe.com/strong-customer-authentication">SCA</a>.
1687
           *
1688
           * <p>One of {@code none}, or {@code off_session}.
1689
           */
1690
          @SerializedName("setup_future_usage")
1691
          String setupFutureUsage;
1692
        }
1693

1694
        /**
1695
         * For more details about WechatPay, please refer to the <a
1696
         * href="https://docs.stripe.com/api">API Reference.</a>
1697
         */
1698
        @Getter
1699
        @Setter
1700
        @EqualsAndHashCode(callSuper = false)
1701
        public static class WechatPay extends StripeObject {
×
1702
          /** The app ID registered with WeChat Pay. Only required when client is ios or android. */
1703
          @SerializedName("app_id")
1704
          String appId;
1705

1706
          /**
1707
           * The client type that the end customer will pay from
1708
           *
1709
           * <p>One of {@code android}, {@code ios}, or {@code web}.
1710
           */
1711
          @SerializedName("client")
1712
          String client;
1713

1714
          /**
1715
           * Indicates that you intend to make future payments with this PaymentIntent's payment
1716
           * method.
1717
           *
1718
           * <p>If you provide a Customer with the PaymentIntent, you can use this parameter to <a
1719
           * href="https://stripe.com/payments/save-during-payment">attach the payment method</a> to
1720
           * the Customer after the PaymentIntent is confirmed and the customer completes any
1721
           * required actions. If you don't provide a Customer, you can still <a
1722
           * href="https://stripe.com/api/payment_methods/attach">attach</a> the payment method to a
1723
           * Customer after the transaction completes.
1724
           *
1725
           * <p>If the payment method is {@code card_present} and isn't a digital wallet, Stripe
1726
           * creates and attaches a <a
1727
           * href="https://stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card">generated_card</a>
1728
           * payment method representing the card to the Customer instead.
1729
           *
1730
           * <p>When processing card payments, Stripe uses {@code setup_future_usage} to help you
1731
           * comply with regional legislation and network rules, such as <a
1732
           * href="https://stripe.com/strong-customer-authentication">SCA</a>.
1733
           *
1734
           * <p>Equal to {@code none}.
1735
           */
1736
          @SerializedName("setup_future_usage")
1737
          String setupFutureUsage;
1738
        }
1739
      }
1740

1741
      /**
1742
       * For more details about TransferData, please refer to the <a
1743
       * href="https://docs.stripe.com/api">API Reference.</a>
1744
       */
1745
      @Getter
1746
      @Setter
1747
      @EqualsAndHashCode(callSuper = false)
1748
      public static class TransferData extends StripeObject {
×
1749
        /**
1750
         * The amount that will be transferred automatically when the order is paid. If no amount is
1751
         * set, the full amount is transferred. There cannot be any line items with recurring prices
1752
         * when using this field.
1753
         */
1754
        @SerializedName("amount")
1755
        Long amount;
1756

1757
        /** ID of the Connected account receiving the transfer. */
1758
        @SerializedName("destination")
1759
        @Getter(lombok.AccessLevel.NONE)
1760
        @Setter(lombok.AccessLevel.NONE)
1761
        ExpandableField<Account> destination;
1762

1763
        /** Get ID of expandable {@code destination} object. */
1764
        public String getDestination() {
1765
          return (this.destination != null) ? this.destination.getId() : null;
×
1766
        }
1767

1768
        public void setDestination(String id) {
1769
          this.destination = ApiResource.setExpandableFieldId(id, this.destination);
×
1770
        }
×
1771

1772
        /** Get expanded {@code destination}. */
1773
        public Account getDestinationObject() {
1774
          return (this.destination != null) ? this.destination.getExpanded() : null;
×
1775
        }
1776

1777
        public void setDestinationObject(Account expandableObject) {
1778
          this.destination =
×
1779
              new ExpandableField<Account>(expandableObject.getId(), expandableObject);
×
1780
        }
×
1781
      }
1782
    }
1783
  }
1784

1785
  /**
1786
   * For more details about ShippingCost, please refer to the <a
1787
   * href="https://docs.stripe.com/api">API Reference.</a>
1788
   */
1789
  @Getter
1790
  @Setter
1791
  @EqualsAndHashCode(callSuper = false)
1792
  public static class ShippingCost extends StripeObject {
×
1793
    /** Total shipping cost before any discounts or taxes are applied. */
1794
    @SerializedName("amount_subtotal")
1795
    Long amountSubtotal;
1796

1797
    /** Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0. */
1798
    @SerializedName("amount_tax")
1799
    Long amountTax;
1800

1801
    /** Total shipping cost after discounts and taxes are applied. */
1802
    @SerializedName("amount_total")
1803
    Long amountTotal;
1804

1805
    /** The ID of the ShippingRate for this order. */
1806
    @SerializedName("shipping_rate")
1807
    @Getter(lombok.AccessLevel.NONE)
1808
    @Setter(lombok.AccessLevel.NONE)
1809
    ExpandableField<ShippingRate> shippingRate;
1810

1811
    /** The taxes applied to the shipping rate. */
1812
    @SerializedName("taxes")
1813
    List<Order.ShippingCost.Tax> taxes;
1814

1815
    /** Get ID of expandable {@code shippingRate} object. */
1816
    public String getShippingRate() {
1817
      return (this.shippingRate != null) ? this.shippingRate.getId() : null;
×
1818
    }
1819

1820
    public void setShippingRate(String id) {
1821
      this.shippingRate = ApiResource.setExpandableFieldId(id, this.shippingRate);
×
1822
    }
×
1823

1824
    /** Get expanded {@code shippingRate}. */
1825
    public ShippingRate getShippingRateObject() {
1826
      return (this.shippingRate != null) ? this.shippingRate.getExpanded() : null;
×
1827
    }
1828

1829
    public void setShippingRateObject(ShippingRate expandableObject) {
1830
      this.shippingRate =
×
1831
          new ExpandableField<ShippingRate>(expandableObject.getId(), expandableObject);
×
1832
    }
×
1833

1834
    /**
1835
     * For more details about Tax, please refer to the <a href="https://docs.stripe.com/api">API
1836
     * Reference.</a>
1837
     */
1838
    @Getter
1839
    @Setter
1840
    @EqualsAndHashCode(callSuper = false)
1841
    public static class Tax extends StripeObject {
×
1842
      /** Amount of tax applied for this rate. */
1843
      @SerializedName("amount")
1844
      Long amount;
1845

1846
      /**
1847
       * Tax rates can be applied to <a
1848
       * href="https://stripe.com/docs/billing/invoices/tax-rates">invoices</a>, <a
1849
       * href="https://stripe.com/docs/billing/subscriptions/taxes">subscriptions</a> and <a
1850
       * href="https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates">Checkout
1851
       * Sessions</a> to collect tax.
1852
       *
1853
       * <p>Related guide: <a href="https://stripe.com/docs/billing/taxes/tax-rates">Tax rates</a>
1854
       */
1855
      @SerializedName("rate")
1856
      TaxRate rate;
1857

1858
      /**
1859
       * The reasoning behind this tax, for example, if the product is tax exempt. The possible
1860
       * values for this field may be extended as new tax rules are supported.
1861
       *
1862
       * <p>One of {@code customer_exempt}, {@code not_collecting}, {@code not_subject_to_tax},
1863
       * {@code not_supported}, {@code portion_product_exempt}, {@code portion_reduced_rated},
1864
       * {@code portion_standard_rated}, {@code product_exempt}, {@code product_exempt_holiday},
1865
       * {@code proportionally_rated}, {@code reduced_rated}, {@code reverse_charge}, {@code
1866
       * standard_rated}, {@code taxable_basis_reduced}, or {@code zero_rated}.
1867
       */
1868
      @SerializedName("taxability_reason")
1869
      String taxabilityReason;
1870

1871
      /** The amount on which tax is calculated, in cents (or local equivalent). */
1872
      @SerializedName("taxable_amount")
1873
      Long taxableAmount;
1874
    }
1875
  }
1876

1877
  /**
1878
   * For more details about ShippingDetails, please refer to the <a
1879
   * href="https://docs.stripe.com/api">API Reference.</a>
1880
   */
1881
  @Getter
1882
  @Setter
1883
  @EqualsAndHashCode(callSuper = false)
1884
  public static class ShippingDetails extends StripeObject {
×
1885
    /** Recipient shipping address. Required if the order includes products that are shippable. */
1886
    @SerializedName("address")
1887
    Address address;
1888

1889
    /** Recipient name. */
1890
    @SerializedName("name")
1891
    String name;
1892

1893
    /** Recipient phone (including extension). */
1894
    @SerializedName("phone")
1895
    String phone;
1896
  }
1897

1898
  /**
1899
   * For more details about TaxDetails, please refer to the <a
1900
   * href="https://docs.stripe.com/api">API Reference.</a>
1901
   */
1902
  @Getter
1903
  @Setter
1904
  @EqualsAndHashCode(callSuper = false)
1905
  public static class TaxDetails extends StripeObject {
×
1906
    /**
1907
     * Describes the purchaser's tax exemption status. One of {@code none}, {@code exempt}, or
1908
     * {@code reverse}.
1909
     */
1910
    @SerializedName("tax_exempt")
1911
    String taxExempt;
1912

1913
    /** The purchaser's tax IDs to be used in calculation of tax for this Order. */
1914
    @SerializedName("tax_ids")
1915
    List<Order.TaxDetails.TaxId> taxIds;
1916

1917
    /**
1918
     * For more details about TaxId, please refer to the <a href="https://docs.stripe.com/api">API
1919
     * Reference.</a>
1920
     */
1921
    @Getter
1922
    @Setter
1923
    @EqualsAndHashCode(callSuper = false)
1924
    public static class TaxId extends StripeObject {
×
1925
      /**
1926
       * The type of the tax ID, one of {@code ad_nrt}, {@code ar_cuit}, {@code eu_vat}, {@code
1927
       * bo_tin}, {@code br_cnpj}, {@code br_cpf}, {@code cn_tin}, {@code co_nit}, {@code cr_tin},
1928
       * {@code do_rcn}, {@code ec_ruc}, {@code eu_oss_vat}, {@code hr_oib}, {@code pe_ruc}, {@code
1929
       * ro_tin}, {@code rs_pib}, {@code sv_nit}, {@code uy_ruc}, {@code ve_rif}, {@code vn_tin},
1930
       * {@code gb_vat}, {@code nz_gst}, {@code au_abn}, {@code au_arn}, {@code in_gst}, {@code
1931
       * no_vat}, {@code no_voec}, {@code za_vat}, {@code ch_vat}, {@code mx_rfc}, {@code sg_uen},
1932
       * {@code ru_inn}, {@code ru_kpp}, {@code ca_bn}, {@code hk_br}, {@code es_cif}, {@code
1933
       * tw_vat}, {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code li_uid},
1934
       * {@code li_vat}, {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code
1935
       * ca_gst_hst}, {@code ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst},
1936
       * {@code sg_gst}, {@code ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code
1937
       * my_frp}, {@code il_vat}, {@code ge_vat}, {@code ua_vat}, {@code is_vat}, {@code bg_uic},
1938
       * {@code hu_tin}, {@code si_tin}, {@code ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code
1939
       * ph_tin}, {@code bh_vat}, {@code kz_bin}, {@code ng_tin}, {@code om_vat}, {@code de_stn},
1940
       * {@code ch_uid}, {@code tz_vat}, {@code uz_vat}, {@code uz_tin}, {@code md_vat}, {@code
1941
       * ma_vat}, {@code by_tin}, or {@code unknown}.
1942
       */
1943
      @SerializedName("type")
1944
      String type;
1945

1946
      /** The value of the tax ID. */
1947
      @SerializedName("value")
1948
      String value;
1949
    }
1950
  }
1951

1952
  /**
1953
   * For more details about TotalDetails, please refer to the <a
1954
   * href="https://docs.stripe.com/api">API Reference.</a>
1955
   */
1956
  @Getter
1957
  @Setter
1958
  @EqualsAndHashCode(callSuper = false)
1959
  public static class TotalDetails extends StripeObject {
×
1960
    @SerializedName("amount_credit")
1961
    Long amountCredit;
1962

1963
    /** This is the sum of all the discounts. */
1964
    @SerializedName("amount_discount")
1965
    Long amountDiscount;
1966

1967
    /** This is the sum of all the shipping amounts. */
1968
    @SerializedName("amount_shipping")
1969
    Long amountShipping;
1970

1971
    /** This is the sum of all the tax amounts. */
1972
    @SerializedName("amount_tax")
1973
    Long amountTax;
1974

1975
    @SerializedName("breakdown")
1976
    Breakdown breakdown;
1977

1978
    /**
1979
     * For more details about Breakdown, please refer to the <a
1980
     * href="https://docs.stripe.com/api">API Reference.</a>
1981
     */
1982
    @Getter
1983
    @Setter
1984
    @EqualsAndHashCode(callSuper = false)
1985
    public static class Breakdown extends StripeObject {
×
1986
      /** The aggregated discounts. */
1987
      @SerializedName("discounts")
1988
      List<Order.TotalDetails.Breakdown.Discount> discounts;
1989

1990
      /** The aggregated tax amounts by rate. */
1991
      @SerializedName("taxes")
1992
      List<Order.TotalDetails.Breakdown.Tax> taxes;
1993

1994
      /**
1995
       * For more details about Discount, please refer to the <a
1996
       * href="https://docs.stripe.com/api">API Reference.</a>
1997
       */
1998
      @Getter
1999
      @Setter
2000
      @EqualsAndHashCode(callSuper = false)
2001
      public static class Discount extends StripeObject {
×
2002
        /** The amount discounted. */
2003
        @SerializedName("amount")
2004
        Long amount;
2005

2006
        /**
2007
         * A discount represents the actual application of a <a
2008
         * href="https://stripe.com/docs/api#coupons">coupon</a> or <a
2009
         * href="https://stripe.com/docs/api#promotion_codes">promotion code</a>. It contains
2010
         * information about when the discount began, when it will end, and what it is applied to.
2011
         *
2012
         * <p>Related guide: <a
2013
         * href="https://stripe.com/docs/billing/subscriptions/discounts">Applying discounts to
2014
         * subscriptions</a>
2015
         */
2016
        @SerializedName("discount")
2017
        com.stripe.model.Discount discount;
2018
      }
2019

2020
      /**
2021
       * For more details about Tax, please refer to the <a href="https://docs.stripe.com/api">API
2022
       * Reference.</a>
2023
       */
2024
      @Getter
2025
      @Setter
2026
      @EqualsAndHashCode(callSuper = false)
2027
      public static class Tax extends StripeObject {
×
2028
        /** Amount of tax applied for this rate. */
2029
        @SerializedName("amount")
2030
        Long amount;
2031

2032
        /**
2033
         * Tax rates can be applied to <a
2034
         * href="https://stripe.com/docs/billing/invoices/tax-rates">invoices</a>, <a
2035
         * href="https://stripe.com/docs/billing/subscriptions/taxes">subscriptions</a> and <a
2036
         * href="https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates">Checkout
2037
         * Sessions</a> to collect tax.
2038
         *
2039
         * <p>Related guide: <a href="https://stripe.com/docs/billing/taxes/tax-rates">Tax rates</a>
2040
         */
2041
        @SerializedName("rate")
2042
        TaxRate rate;
2043

2044
        /**
2045
         * The reasoning behind this tax, for example, if the product is tax exempt. The possible
2046
         * values for this field may be extended as new tax rules are supported.
2047
         *
2048
         * <p>One of {@code customer_exempt}, {@code not_collecting}, {@code not_subject_to_tax},
2049
         * {@code not_supported}, {@code portion_product_exempt}, {@code portion_reduced_rated},
2050
         * {@code portion_standard_rated}, {@code product_exempt}, {@code product_exempt_holiday},
2051
         * {@code proportionally_rated}, {@code reduced_rated}, {@code reverse_charge}, {@code
2052
         * standard_rated}, {@code taxable_basis_reduced}, or {@code zero_rated}.
2053
         */
2054
        @SerializedName("taxability_reason")
2055
        String taxabilityReason;
2056

2057
        /** The amount on which tax is calculated, in cents (or local equivalent). */
2058
        @SerializedName("taxable_amount")
2059
        Long taxableAmount;
2060
      }
2061
    }
2062
  }
2063

2064
  @Override
2065
  public void setResponseGetter(StripeResponseGetter responseGetter) {
2066
    super.setResponseGetter(responseGetter);
×
2067
    trySetResponseGetter(application, responseGetter);
×
2068
    trySetResponseGetter(automaticTax, responseGetter);
×
2069
    trySetResponseGetter(billingDetails, responseGetter);
×
2070
    trySetResponseGetter(customer, responseGetter);
×
2071
    trySetResponseGetter(lineItems, responseGetter);
×
2072
    trySetResponseGetter(payment, responseGetter);
×
2073
    trySetResponseGetter(shippingCost, responseGetter);
×
2074
    trySetResponseGetter(shippingDetails, responseGetter);
×
2075
    trySetResponseGetter(taxDetails, responseGetter);
×
2076
    trySetResponseGetter(totalDetails, responseGetter);
×
2077
  }
×
2078
}
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