Skip to content

Commit

Permalink
Add support for tax rates with Checkout Sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
cjavilla-stripe committed Feb 24, 2020
1 parent 223b6d5 commit a129153
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 5 additions & 2 deletions checkout_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -81,15 +82,17 @@ 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
// creation on a checkout session.
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"`
Expand Down
2 changes: 1 addition & 1 deletion testing/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit a129153

Please sign in to comment.