From a129153069f1fd55e8d69bc740d5ea84e0fb464c Mon Sep 17 00:00:00 2001 From: CJ Avilla Date: Mon, 24 Feb 2020 14:12:15 -0800 Subject: [PATCH] Add support for tax rates with Checkout Sessions --- .travis.yml | 2 +- checkout_session.go | 7 +++++-- testing/testing.go | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3199ef434d..9f8495e6e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,7 @@ cache: env: global: # If changing this number, please also change it in `testing/testing.go`. - - STRIPE_MOCK_VERSION=0.80.0 + - STRIPE_MOCK_VERSION=0.81.0 go: - "1.9.x" diff --git a/checkout_session.go b/checkout_session.go index ec99f39c69..4f3748d516 100644 --- a/checkout_session.go +++ b/checkout_session.go @@ -45,6 +45,7 @@ type CheckoutSessionLineItemParams struct { Images []*string `form:"images"` Name *string `form:"name"` Quantity *int64 `form:"quantity"` + TaxRates []*string `form:"tax_rates"` } // CheckoutSessionPaymentIntentDataTransferDataParams is the set of parameters allowed for the @@ -81,8 +82,9 @@ type CheckoutSessionSetupIntentDataParams struct { // CheckoutSessionSubscriptionDataItemsParams is the set of parameters allowed for one item on a // checkout session associated with a subscription. type CheckoutSessionSubscriptionDataItemsParams struct { - Plan *string `form:"plan"` - Quantity *int64 `form:"quantity"` + Plan *string `form:"plan"` + Quantity *int64 `form:"quantity"` + TaxRates []*string `form:"tax_rates"` } // CheckoutSessionSubscriptionDataParams is the set of parameters allowed for the subscription @@ -90,6 +92,7 @@ type CheckoutSessionSubscriptionDataItemsParams struct { type CheckoutSessionSubscriptionDataParams struct { Params `form:"*"` ApplicationFeePercent *float64 `form:"application_fee_percent"` + DefaultTaxRates []*string `form:"default_tax_rates"` Items []*CheckoutSessionSubscriptionDataItemsParams `form:"items"` TrialEnd *int64 `form:"trial_end"` TrialFromPlan *bool `form:"trial_from_plan"` diff --git a/testing/testing.go b/testing/testing.go index 8e994a2aec..7ab4bb1729 100644 --- a/testing/testing.go +++ b/testing/testing.go @@ -25,7 +25,7 @@ const ( // added in a more recent version of stripe-mock, we can show people a // better error message instead of the test suite crashing with a bunch of // confusing 404 errors or the like. - MockMinimumVersion = "0.80.0" + MockMinimumVersion = "0.81.0" // TestMerchantID is a token that can be used to represent a merchant ID in // simple tests.