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 submit_type to CheckoutSession #871

Merged
merged 1 commit into from
Jun 14, 2019
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
14 changes: 14 additions & 0 deletions checkout_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ import (
"encoding/json"
)

// CheckoutSessionSubmitType is the list of allowed values for the `submit_type`
// of a Session.
type CheckoutSessionSubmitType string

// List of values that CheckoutSessionSubmitType can take.
const (
CheckoutSessionSubmitTypeAuto CheckoutSessionSubmitType = "auto"
CheckoutSessionSubmitTypeBook CheckoutSessionSubmitType = "book"
CheckoutSessionSubmitTypeDonate CheckoutSessionSubmitType = "donate"
CheckoutSessionSubmitTypePay CheckoutSessionSubmitType = "pay"
)

// CheckoutSessionDisplayItemType is the list of allowed values for the display item type.
type CheckoutSessionDisplayItemType string

Expand Down Expand Up @@ -76,6 +88,7 @@ type CheckoutSessionParams struct {
PaymentIntentData *CheckoutSessionPaymentIntentDataParams `form:"payment_intent_data"`
PaymentMethodTypes []*string `form:"payment_method_types"`
SubscriptionData *CheckoutSessionSubscriptionDataParams `form:"subscription_data"`
SubmitType *string `form:"submit_type"`
SuccessURL *string `form:"success_url"`
}

Expand Down Expand Up @@ -113,6 +126,7 @@ type CheckoutSession struct {
PaymentIntent *PaymentIntent `json:"payment_intent"`
PaymentMethodTypes []string `json:"payment_method_types"`
Subscription *Subscription `json:"subscription"`
SubmitType CheckoutSessionSubmitType `json:"submit_type"`
SuccessURL string `json:"success_url"`
}

Expand Down