Skip to content

Commit

Permalink
Merge pull request #1210 from stripe/richardm-add-discounts-to-checko…
Browse files Browse the repository at this point in the history
…utsession-create

Add support for `Discounts` to `CheckoutSessionParams`
  • Loading branch information
richardm-stripe authored Oct 14, 2020
2 parents 10b4823 + 82ef17a commit 87c32f6
Showing 1 changed file with 8 additions and 0 deletions.
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

0 comments on commit 87c32f6

Please sign in to comment.