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

stripe / stripe-java / #16517

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

push

github

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

Update generated code for beta

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

91 existing lines in 27 files now uncovered.

18753 of 147196 relevant lines covered (12.74%)

0.13 hits per line

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

38.46
/src/main/java/com/stripe/model/tax/Calculation.java
1
// File generated from our OpenAPI spec
2
package com.stripe.model.tax;
3

4
import com.google.gson.annotations.SerializedName;
5
import com.stripe.exception.StripeException;
6
import com.stripe.model.HasId;
7
import com.stripe.model.StripeObject;
8
import com.stripe.net.ApiRequest;
9
import com.stripe.net.ApiRequestParams;
10
import com.stripe.net.ApiResource;
11
import com.stripe.net.BaseAddress;
12
import com.stripe.net.RequestOptions;
13
import com.stripe.net.StripeResponseGetter;
14
import com.stripe.param.tax.CalculationCreateParams;
15
import com.stripe.param.tax.CalculationListLineItemsParams;
16
import com.stripe.param.tax.CalculationRetrieveParams;
17
import java.util.List;
18
import java.util.Map;
19
import lombok.EqualsAndHashCode;
20
import lombok.Getter;
21
import lombok.Setter;
22

23
/**
24
 * A Tax Calculation allows you to calculate the tax to collect from your customer.
25
 *
26
 * <p>Related guide: <a href="https://stripe.com/docs/tax/custom">Calculate tax in your custom
27
 * payment flow</a>
28
 */
29
@Getter
30
@Setter
31
@EqualsAndHashCode(callSuper = false)
32
public class Calculation extends ApiResource implements HasId {
1✔
33
  /**
34
   * Total amount after taxes in the <a
35
   * href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a>.
36
   */
37
  @SerializedName("amount_total")
38
  Long amountTotal;
39

40
  /**
41
   * Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>,
42
   * in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
43
   */
44
  @SerializedName("currency")
45
  String currency;
46

47
  /**
48
   * The ID of an existing <a href="https://stripe.com/docs/api/customers/object">Customer</a> used
49
   * for the resource.
50
   */
51
  @SerializedName("customer")
52
  String customer;
53

54
  @SerializedName("customer_details")
55
  CustomerDetails customerDetails;
56

57
  /** Timestamp of date at which the tax calculation will expire. */
58
  @SerializedName("expires_at")
59
  Long expiresAt;
60

61
  /** Unique identifier for the calculation. */
62
  @Getter(onMethod_ = {@Override})
63
  @SerializedName("id")
64
  String id;
65

66
  /** The list of items the customer is purchasing. */
67
  @SerializedName("line_items")
68
  CalculationLineItemCollection lineItems;
69

70
  /**
71
   * Has the value {@code true} if the object exists in live mode or the value {@code false} if the
72
   * object exists in test mode.
73
   */
74
  @SerializedName("livemode")
75
  Boolean livemode;
76

77
  /**
78
   * String representing the object's type. Objects of the same type share the same value.
79
   *
80
   * <p>Equal to {@code tax.calculation}.
81
   */
82
  @SerializedName("object")
83
  String object;
84

85
  /** The details of the ship from location, such as the address. */
86
  @SerializedName("ship_from_details")
87
  ShipFromDetails shipFromDetails;
88

89
  /** The shipping cost details for the calculation. */
90
  @SerializedName("shipping_cost")
91
  ShippingCost shippingCost;
92

93
  /** The amount of tax to be collected on top of the line item prices. */
94
  @SerializedName("tax_amount_exclusive")
95
  Long taxAmountExclusive;
96

97
  /** The amount of tax already included in the line item prices. */
98
  @SerializedName("tax_amount_inclusive")
99
  Long taxAmountInclusive;
100

101
  /** Breakdown of individual tax amounts that add up to the total. */
102
  @SerializedName("tax_breakdown")
103
  List<Calculation.TaxBreakdown> taxBreakdown;
104

105
  /** Timestamp of date at which the tax rules and rates in effect applies for the calculation. */
106
  @SerializedName("tax_date")
107
  Long taxDate;
108

109
  /** Calculates tax based on the input and returns a Tax {@code Calculation} object. */
110
  public static Calculation create(Map<String, Object> params) throws StripeException {
111
    return create(params, (RequestOptions) null);
×
112
  }
113

114
  /** Calculates tax based on the input and returns a Tax {@code Calculation} object. */
115
  public static Calculation create(Map<String, Object> params, RequestOptions options)
116
      throws StripeException {
117
    String path = "/v1/tax/calculations";
×
118
    ApiRequest request =
×
119
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
120
    return getGlobalResponseGetter().request(request, Calculation.class);
×
121
  }
122

123
  /** Calculates tax based on the input and returns a Tax {@code Calculation} object. */
124
  public static Calculation create(CalculationCreateParams params) throws StripeException {
125
    return create(params, (RequestOptions) null);
1✔
126
  }
127

128
  /** Calculates tax based on the input and returns a Tax {@code Calculation} object. */
129
  public static Calculation create(CalculationCreateParams params, RequestOptions options)
130
      throws StripeException {
131
    String path = "/v1/tax/calculations";
1✔
132
    ApiResource.checkNullTypedParams(path, params);
1✔
133
    ApiRequest request =
1✔
134
        new ApiRequest(
135
            BaseAddress.API,
136
            ApiResource.RequestMethod.POST,
137
            path,
138
            ApiRequestParams.paramsToMap(params),
1✔
139
            options);
140
    return getGlobalResponseGetter().request(request, Calculation.class);
1✔
141
  }
142

143
  /**
144
   * Retrieves the line items of a tax calculation as a collection, if the calculation hasn’t
145
   * expired.
146
   */
147
  public CalculationLineItemCollection listLineItems() throws StripeException {
148
    return listLineItems((Map<String, Object>) null, (RequestOptions) null);
×
149
  }
150

151
  /**
152
   * Retrieves the line items of a tax calculation as a collection, if the calculation hasn’t
153
   * expired.
154
   */
155
  public CalculationLineItemCollection listLineItems(Map<String, Object> params)
156
      throws StripeException {
157
    return listLineItems(params, (RequestOptions) null);
×
158
  }
159

160
  /**
161
   * Retrieves the line items of a tax calculation as a collection, if the calculation hasn’t
162
   * expired.
163
   */
164
  public CalculationLineItemCollection listLineItems(
165
      Map<String, Object> params, RequestOptions options) throws StripeException {
166
    String path =
×
167
        String.format("/v1/tax/calculations/%s/line_items", ApiResource.urlEncodeId(this.getId()));
×
168
    ApiRequest request =
×
169
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
170
    return getResponseGetter().request(request, CalculationLineItemCollection.class);
×
171
  }
172

173
  /**
174
   * Retrieves the line items of a tax calculation as a collection, if the calculation hasn’t
175
   * expired.
176
   */
177
  public CalculationLineItemCollection listLineItems(CalculationListLineItemsParams params)
178
      throws StripeException {
179
    return listLineItems(params, (RequestOptions) null);
×
180
  }
181

182
  /**
183
   * Retrieves the line items of a tax calculation as a collection, if the calculation hasn’t
184
   * expired.
185
   */
186
  public CalculationLineItemCollection listLineItems(
187
      CalculationListLineItemsParams params, RequestOptions options) throws StripeException {
188
    String path =
×
189
        String.format("/v1/tax/calculations/%s/line_items", ApiResource.urlEncodeId(this.getId()));
×
190
    ApiResource.checkNullTypedParams(path, params);
×
191
    ApiRequest request =
×
192
        new ApiRequest(
193
            BaseAddress.API,
194
            ApiResource.RequestMethod.GET,
195
            path,
196
            ApiRequestParams.paramsToMap(params),
×
197
            options);
198
    return getResponseGetter().request(request, CalculationLineItemCollection.class);
×
199
  }
200

201
  /** Retrieves a Tax {@code Calculation} object, if the calculation hasn’t expired. */
202
  public static Calculation retrieve(String calculation) throws StripeException {
203
    return retrieve(calculation, (Map<String, Object>) null, (RequestOptions) null);
×
204
  }
205

206
  /** Retrieves a Tax {@code Calculation} object, if the calculation hasn’t expired. */
207
  public static Calculation retrieve(String calculation, RequestOptions options)
208
      throws StripeException {
209
    return retrieve(calculation, (Map<String, Object>) null, options);
×
210
  }
211

212
  /** Retrieves a Tax {@code Calculation} object, if the calculation hasn’t expired. */
213
  public static Calculation retrieve(
214
      String calculation, Map<String, Object> params, RequestOptions options)
215
      throws StripeException {
216
    String path = String.format("/v1/tax/calculations/%s", ApiResource.urlEncodeId(calculation));
×
217
    ApiRequest request =
×
218
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
219
    return getGlobalResponseGetter().request(request, Calculation.class);
×
220
  }
221

222
  /** Retrieves a Tax {@code Calculation} object, if the calculation hasn’t expired. */
223
  public static Calculation retrieve(
224
      String calculation, CalculationRetrieveParams params, RequestOptions options)
225
      throws StripeException {
226
    String path = String.format("/v1/tax/calculations/%s", ApiResource.urlEncodeId(calculation));
×
227
    ApiResource.checkNullTypedParams(path, params);
×
228
    ApiRequest request =
×
229
        new ApiRequest(
230
            BaseAddress.API,
231
            ApiResource.RequestMethod.GET,
232
            path,
233
            ApiRequestParams.paramsToMap(params),
×
234
            options);
235
    return getGlobalResponseGetter().request(request, Calculation.class);
×
236
  }
237

238
  @Getter
239
  @Setter
240
  @EqualsAndHashCode(callSuper = false)
241
  public static class CustomerDetails extends StripeObject {
1✔
242
    /** The customer's postal address (for example, home or business location). */
243
    @SerializedName("address")
244
    Address address;
245

246
    /**
247
     * The type of customer address provided.
248
     *
249
     * <p>One of {@code billing}, or {@code shipping}.
250
     */
251
    @SerializedName("address_source")
252
    String addressSource;
253

254
    /** The customer's IP address (IPv4 or IPv6). */
255
    @SerializedName("ip_address")
256
    String ipAddress;
257

258
    /** The customer's tax IDs (for example, EU VAT numbers). */
259
    @SerializedName("tax_ids")
260
    List<Calculation.CustomerDetails.TaxId> taxIds;
261

262
    /**
263
     * The taxability override used for taxation.
264
     *
265
     * <p>One of {@code customer_exempt}, {@code none}, or {@code reverse_charge}.
266
     */
267
    @SerializedName("taxability_override")
268
    String taxabilityOverride;
269

270
    @Getter
271
    @Setter
272
    @EqualsAndHashCode(callSuper = false)
273
    public static class Address extends StripeObject {
1✔
274
      /** City, district, suburb, town, or village. */
275
      @SerializedName("city")
276
      String city;
277

278
      /**
279
       * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
280
       * 3166-1 alpha-2</a>).
281
       */
282
      @SerializedName("country")
283
      String country;
284

285
      /** Address line 1 (e.g., street, PO Box, or company name). */
286
      @SerializedName("line1")
287
      String line1;
288

289
      /** Address line 2 (e.g., apartment, suite, unit, or building). */
290
      @SerializedName("line2")
291
      String line2;
292

293
      /** ZIP or postal code. */
294
      @SerializedName("postal_code")
295
      String postalCode;
296

297
      /**
298
       * State/province as an <a href="https://en.wikipedia.org/wiki/ISO_3166-2">ISO 3166-2</a>
299
       * subdivision code, without country prefix. Example: &quot;NY&quot; or &quot;TX&quot;.
300
       */
301
      @SerializedName("state")
302
      String state;
303
    }
304

305
    @Getter
306
    @Setter
307
    @EqualsAndHashCode(callSuper = false)
308
    public static class TaxId extends StripeObject {
×
309
      /**
310
       * The type of the tax ID, one of {@code ad_nrt}, {@code ar_cuit}, {@code eu_vat}, {@code
311
       * bo_tin}, {@code br_cnpj}, {@code br_cpf}, {@code cn_tin}, {@code co_nit}, {@code cr_tin},
312
       * {@code do_rcn}, {@code ec_ruc}, {@code eu_oss_vat}, {@code hr_oib}, {@code pe_ruc}, {@code
313
       * ro_tin}, {@code rs_pib}, {@code sv_nit}, {@code uy_ruc}, {@code ve_rif}, {@code vn_tin},
314
       * {@code gb_vat}, {@code nz_gst}, {@code au_abn}, {@code au_arn}, {@code in_gst}, {@code
315
       * no_vat}, {@code no_voec}, {@code za_vat}, {@code ch_vat}, {@code mx_rfc}, {@code sg_uen},
316
       * {@code ru_inn}, {@code ru_kpp}, {@code ca_bn}, {@code hk_br}, {@code es_cif}, {@code
317
       * tw_vat}, {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code li_uid},
318
       * {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code ca_gst_hst}, {@code
319
       * ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, {@code sg_gst}, {@code
320
       * ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code my_frp}, {@code il_vat},
321
       * {@code ge_vat}, {@code ua_vat}, {@code is_vat}, {@code bg_uic}, {@code hu_tin}, {@code
322
       * si_tin}, {@code ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code ph_tin}, {@code bh_vat},
323
       * {@code kz_bin}, {@code ng_tin}, {@code om_vat}, {@code de_stn}, {@code ch_uid}, {@code
324
       * tz_vat}, {@code uz_vat}, {@code uz_tin}, {@code md_vat}, {@code ma_vat}, {@code by_tin}, or
325
       * {@code unknown}.
326
       */
327
      @SerializedName("type")
328
      String type;
329

330
      /** The value of the tax ID. */
331
      @SerializedName("value")
332
      String value;
333
    }
334
  }
335

336
  @Getter
337
  @Setter
338
  @EqualsAndHashCode(callSuper = false)
339
  public static class ShipFromDetails extends StripeObject {
1✔
340
    @SerializedName("address")
341
    Address address;
342

343
    @Getter
344
    @Setter
345
    @EqualsAndHashCode(callSuper = false)
346
    public static class Address extends StripeObject {
1✔
347
      /** City, district, suburb, town, or village. */
348
      @SerializedName("city")
349
      String city;
350

351
      /**
352
       * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
353
       * 3166-1 alpha-2</a>).
354
       */
355
      @SerializedName("country")
356
      String country;
357

358
      /** Address line 1 (e.g., street, PO Box, or company name). */
359
      @SerializedName("line1")
360
      String line1;
361

362
      /** Address line 2 (e.g., apartment, suite, unit, or building). */
363
      @SerializedName("line2")
364
      String line2;
365

366
      /** ZIP or postal code. */
367
      @SerializedName("postal_code")
368
      String postalCode;
369

370
      /**
371
       * State/province as an <a href="https://en.wikipedia.org/wiki/ISO_3166-2">ISO 3166-2</a>
372
       * subdivision code, without country prefix. Example: &quot;NY&quot; or &quot;TX&quot;.
373
       */
374
      @SerializedName("state")
375
      String state;
376
    }
377
  }
378

379
  @Getter
380
  @Setter
381
  @EqualsAndHashCode(callSuper = false)
382
  public static class ShippingCost extends StripeObject {
1✔
383
    /**
384
     * The shipping amount in the <a href="https://stripe.com/docs/currencies#zero-decimal">smallest
385
     * currency unit</a>. If {@code tax_behavior=inclusive}, then this amount includes taxes.
386
     * Otherwise, taxes were calculated on top of this amount.
387
     */
388
    @SerializedName("amount")
389
    Long amount;
390

391
    /**
392
     * The amount of tax calculated for shipping, in the <a
393
     * href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a>.
394
     */
395
    @SerializedName("amount_tax")
396
    Long amountTax;
397

398
    /**
399
     * The ID of an existing <a
400
     * href="https://stripe.com/docs/api/shipping_rates/object">ShippingRate</a>.
401
     */
402
    @SerializedName("shipping_rate")
403
    String shippingRate;
404

405
    /**
406
     * Specifies whether the {@code amount} includes taxes. If {@code tax_behavior=inclusive}, then
407
     * the amount includes taxes.
408
     *
409
     * <p>One of {@code exclusive}, or {@code inclusive}.
410
     */
411
    @SerializedName("tax_behavior")
412
    String taxBehavior;
413

414
    /** Detailed account of taxes relevant to shipping cost. */
415
    @SerializedName("tax_breakdown")
416
    List<Calculation.ShippingCost.TaxBreakdown> taxBreakdown;
417

418
    /**
419
     * The <a href="https://stripe.com/docs/tax/tax-categories">tax code</a> ID used for shipping.
420
     */
421
    @SerializedName("tax_code")
422
    String taxCode;
423

424
    @Getter
425
    @Setter
426
    @EqualsAndHashCode(callSuper = false)
427
    public static class TaxBreakdown extends StripeObject {
×
428
      /**
429
       * The amount of tax, in the <a
430
       * href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a>.
431
       */
432
      @SerializedName("amount")
433
      Long amount;
434

435
      @SerializedName("jurisdiction")
436
      Jurisdiction jurisdiction;
437

438
      /**
439
       * Indicates whether the jurisdiction was determined by the origin (merchant's address) or
440
       * destination (customer's address).
441
       *
442
       * <p>One of {@code destination}, or {@code origin}.
443
       */
444
      @SerializedName("sourcing")
445
      String sourcing;
446

447
      /**
448
       * Details regarding the rate for this tax. This field will be {@code null} when the tax is
449
       * not imposed, for example if the product is exempt from tax.
450
       */
451
      @SerializedName("tax_rate_details")
452
      TaxRateDetails taxRateDetails;
453

454
      /**
455
       * The reasoning behind this tax, for example, if the product is tax exempt. The possible
456
       * values for this field may be extended as new tax rules are supported.
457
       *
458
       * <p>One of {@code customer_exempt}, {@code not_collecting}, {@code not_subject_to_tax},
459
       * {@code not_supported}, {@code portion_product_exempt}, {@code portion_reduced_rated},
460
       * {@code portion_standard_rated}, {@code product_exempt}, {@code product_exempt_holiday},
461
       * {@code proportionally_rated}, {@code reduced_rated}, {@code reverse_charge}, {@code
462
       * standard_rated}, {@code taxable_basis_reduced}, or {@code zero_rated}.
463
       */
464
      @SerializedName("taxability_reason")
465
      String taxabilityReason;
466

467
      /**
468
       * The amount on which tax is calculated, in the <a
469
       * href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a>.
470
       */
471
      @SerializedName("taxable_amount")
472
      Long taxableAmount;
473

474
      @Getter
475
      @Setter
476
      @EqualsAndHashCode(callSuper = false)
477
      public static class Jurisdiction extends StripeObject {
×
478
        /**
479
         * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
480
         * 3166-1 alpha-2</a>).
481
         */
482
        @SerializedName("country")
483
        String country;
484

485
        /** A human-readable name for the jurisdiction imposing the tax. */
486
        @SerializedName("display_name")
487
        String displayName;
488

489
        /**
490
         * Indicates the level of the jurisdiction imposing the tax.
491
         *
492
         * <p>One of {@code city}, {@code country}, {@code county}, {@code district}, or {@code
493
         * state}.
494
         */
495
        @SerializedName("level")
496
        String level;
497

498
        /**
499
         * <a href="https://en.wikipedia.org/wiki/ISO_3166-2:US">ISO 3166-2 subdivision code</a>,
500
         * without country prefix. For example, &quot;NY&quot; for New York, United States.
501
         */
502
        @SerializedName("state")
503
        String state;
504
      }
505

506
      @Getter
507
      @Setter
508
      @EqualsAndHashCode(callSuper = false)
509
      public static class TaxRateDetails extends StripeObject {
×
510
        /**
511
         * A localized display name for tax type, intended to be human-readable. For example,
512
         * &quot;Local Sales and Use Tax&quot;, &quot;Value-added tax (VAT)&quot;, or
513
         * &quot;Umsatzsteuer (USt.)&quot;.
514
         */
515
        @SerializedName("display_name")
516
        String displayName;
517

518
        /**
519
         * The tax rate percentage as a string. For example, 8.5% is represented as &quot;8.5&quot;.
520
         */
521
        @SerializedName("percentage_decimal")
522
        String percentageDecimal;
523

524
        /**
525
         * The tax type, such as {@code vat} or {@code sales_tax}.
526
         *
527
         * <p>One of {@code amusement_tax}, {@code communications_tax}, {@code gst}, {@code hst},
528
         * {@code igst}, {@code jct}, {@code lease_tax}, {@code pst}, {@code qst}, {@code
529
         * retail_delivery_fee}, {@code rst}, {@code sales_tax}, or {@code vat}.
530
         */
531
        @SerializedName("tax_type")
532
        String taxType;
533
      }
534
    }
535
  }
536

537
  @Getter
538
  @Setter
539
  @EqualsAndHashCode(callSuper = false)
540
  public static class TaxBreakdown extends StripeObject {
1✔
541
    /**
542
     * The amount of tax, in the <a href="https://stripe.com/docs/currencies#zero-decimal">smallest
543
     * currency unit</a>.
544
     */
545
    @SerializedName("amount")
546
    Long amount;
547

548
    /** Specifies whether the tax amount is included in the line item amount. */
549
    @SerializedName("inclusive")
550
    Boolean inclusive;
551

552
    @SerializedName("tax_rate_details")
553
    TaxRateDetails taxRateDetails;
554

555
    /**
556
     * The reasoning behind this tax, for example, if the product is tax exempt. We might extend the
557
     * possible values for this field to support new tax rules.
558
     *
559
     * <p>One of {@code customer_exempt}, {@code not_collecting}, {@code not_subject_to_tax}, {@code
560
     * not_supported}, {@code portion_product_exempt}, {@code portion_reduced_rated}, {@code
561
     * portion_standard_rated}, {@code product_exempt}, {@code product_exempt_holiday}, {@code
562
     * proportionally_rated}, {@code reduced_rated}, {@code reverse_charge}, {@code standard_rated},
563
     * {@code taxable_basis_reduced}, or {@code zero_rated}.
564
     */
565
    @SerializedName("taxability_reason")
566
    String taxabilityReason;
567

568
    /**
569
     * The amount on which tax is calculated, in the <a
570
     * href="https://stripe.com/docs/currencies#zero-decimal">smallest currency unit</a>.
571
     */
572
    @SerializedName("taxable_amount")
573
    Long taxableAmount;
574

575
    @Getter
576
    @Setter
577
    @EqualsAndHashCode(callSuper = false)
578
    public static class TaxRateDetails extends StripeObject {
1✔
579
      /**
580
       * Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
581
       * 3166-1 alpha-2</a>).
582
       */
583
      @SerializedName("country")
584
      String country;
585

586
      /**
587
       * The amount of the tax rate when the {@code rate_type} is {@code flat_amount}. Tax rates
588
       * with {@code rate_type} {@code percentage} can vary based on the transaction, resulting in
589
       * this field being {@code null}. This field exposes the amount and currency of the flat tax
590
       * rate.
591
       */
592
      @SerializedName("flat_amount")
593
      FlatAmount flatAmount;
594

595
      /** The tax rate percentage as a string. For example, 8.5% is represented as {@code "8.5"}. */
596
      @SerializedName("percentage_decimal")
597
      String percentageDecimal;
598

599
      /**
600
       * Indicates the type of tax rate applied to the taxable amount. This value can be {@code
601
       * null} when no tax applies to the location.
602
       *
603
       * <p>One of {@code flat_amount}, or {@code percentage}.
604
       */
605
      @SerializedName("rate_type")
606
      String rateType;
607

608
      /** State, county, province, or region. */
609
      @SerializedName("state")
610
      String state;
611

612
      /**
613
       * The tax type, such as {@code vat} or {@code sales_tax}.
614
       *
615
       * <p>One of {@code amusement_tax}, {@code communications_tax}, {@code gst}, {@code hst},
616
       * {@code igst}, {@code jct}, {@code lease_tax}, {@code pst}, {@code qst}, {@code
617
       * retail_delivery_fee}, {@code rst}, {@code sales_tax}, or {@code vat}.
618
       */
619
      @SerializedName("tax_type")
620
      String taxType;
621

622
      /**
623
       * The amount of the tax rate when the {@code rate_type`` is }flat_amount{@code . Tax rates
624
       * with }rate_type{@code }percentage{@code can vary based on the transaction, resulting in
625
       * this field being}null`. This field exposes the amount and currency of the flat tax rate.
626
       */
627
      @Getter
628
      @Setter
629
      @EqualsAndHashCode(callSuper = false)
NEW
630
      public static class FlatAmount extends StripeObject {
×
631
        /**
632
         * Amount of the tax when the {@code rate_type} is {@code flat_amount}. This positive
633
         * integer represents how much to charge in the smallest currency unit (e.g., 100 cents to
634
         * charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The amount value supports
635
         * up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).
636
         */
637
        @SerializedName("amount")
638
        Long amount;
639

640
        /** Three-letter ISO currency code, in lowercase. */
641
        @SerializedName("currency")
642
        String currency;
643
      }
644
    }
645
  }
646

647
  @Override
648
  public void setResponseGetter(StripeResponseGetter responseGetter) {
649
    super.setResponseGetter(responseGetter);
1✔
650
    trySetResponseGetter(customerDetails, responseGetter);
1✔
651
    trySetResponseGetter(lineItems, responseGetter);
1✔
652
    trySetResponseGetter(shipFromDetails, responseGetter);
1✔
653
    trySetResponseGetter(shippingCost, responseGetter);
1✔
654
  }
1✔
655
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc