Skip to content

Commit

Permalink
Add support for Metadata for PaymentIntentData and `SubscriptionD…
Browse files Browse the repository at this point in the history
…ata` on Checkout `Session`
  • Loading branch information
remi-stripe committed May 7, 2020
1 parent b842c9d commit 07d858b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions checkout/session/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ func TestCheckoutSessionNew(t *testing.T) {
},
PaymentIntentData: &stripe.CheckoutSessionPaymentIntentDataParams{
Description: stripe.String("description"),
Metadata: map[string]string{
"attr1": "val1",
"attr2": "val2",
},
Shipping: &stripe.ShippingDetailsParams{
Address: &stripe.AddressParams{
Line1: stripe.String("line1"),
Expand All @@ -51,6 +55,10 @@ func TestCheckoutSessionNew(t *testing.T) {
Quantity: stripe.Int64(2),
},
},
Metadata: map[string]string{
"attr1": "val1",
"attr2": "val2",
},
},
SuccessURL: stripe.String("https://stripe.com/success"),
})
Expand Down
2 changes: 2 additions & 0 deletions checkout_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ type CheckoutSessionPaymentIntentDataParams struct {
ApplicationFeeAmount *int64 `form:"application_fee_amount"`
CaptureMethod *string `form:"capture_method"`
Description *string `form:"description"`
Metadata map[string]string `form:"metadata"`
OnBehalfOf *string `form:"on_behalf_of"`
ReceiptEmail *string `form:"receipt_email"`
SetupFutureUsage *string `form:"setup_future_usage"`
Expand Down Expand Up @@ -101,6 +102,7 @@ type CheckoutSessionSubscriptionDataParams struct {
Coupon *string `form:"coupon"`
DefaultTaxRates []*string `form:"default_tax_rates"`
Items []*CheckoutSessionSubscriptionDataItemsParams `form:"items"`
Metadata map[string]string `form:"metadata"`
TrialEnd *int64 `form:"trial_end"`
TrialFromPlan *bool `form:"trial_from_plan"`
TrialPeriodDays *int64 `form:"trial_period_days"`
Expand Down

0 comments on commit 07d858b

Please sign in to comment.