Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Discounts to CheckoutSessionParams #1210

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions checkout_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ type CheckoutSessionLineItemPriceDataParams struct {
UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"`
}

// CheckoutSessionDiscountParams is the set of parameters allowed for discounts on
// a checkout session.
type CheckoutSessionDiscountParams struct {
Coupon *string `form:"coupon"`
PromotionCode *string `form:"promotion_code"`
}

// CheckoutSessionLineItemParams is the set of parameters allowed for a line item
// on a checkout session.
type CheckoutSessionLineItemParams struct {
Expand Down Expand Up @@ -151,6 +158,7 @@ type CheckoutSessionParams struct {
ClientReferenceID *string `form:"client_reference_id"`
Customer *string `form:"customer"`
CustomerEmail *string `form:"customer_email"`
Discounts []*CheckoutSessionDiscountParams `form:"discounts"`
LineItems []*CheckoutSessionLineItemParams `form:"line_items"`
Locale *string `form:"locale"`
Mode *string `form:"mode"`
Expand Down