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

Fix typo in property name for PaymentMethodOptions #909

Merged
merged 1 commit into from
Jul 29, 2019
Merged
Show file tree
Hide file tree
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
26 changes: 16 additions & 10 deletions paymentintent.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,19 @@ type PaymentIntentConfirmParams struct {
Params `form:"*"`
// This parameter expects a boolean but used to take an enum so we're adding support for both
// until the next major version (TODO).
OffSession interface{} `form:"off_session"`
PaymentMethod *string `form:"payment_method"`
OffSession interface{} `form:"off_session"`
PaymentMethod *string `form:"payment_method"`
PaymentMethodOptions *PaymentIntentPaymentMethodOptionsParams `form:"payment_method_options"`
PaymentMethodTypes []*string `form:"payment_method_types"`
ReceiptEmail *string `form:"receipt_email"`
ReturnURL *string `form:"return_url"`
SavePaymentMethod *bool `form:"save_payment_method"`
SetupFutureUsage *string `form:"setup_future_usage"`
Shipping *ShippingDetailsParams `form:"shipping"`
Source *string `form:"source"`

// TODO: remove the following parameter in the next major version
PayentMethodOptions *PaymentIntentPaymentMethodOptionsParams `form:"payment_method_options"`
PaymentMethodTypes []*string `form:"payment_method_types"`
ReceiptEmail *string `form:"receipt_email"`
ReturnURL *string `form:"return_url"`
SavePaymentMethod *bool `form:"save_payment_method"`
SetupFutureUsage *string `form:"setup_future_usage"`
Shipping *ShippingDetailsParams `form:"shipping"`
Source *string `form:"source"`
}

// PaymentIntentPaymentMethodOptionsCardParams represents the card-specific options applied to a
Expand Down Expand Up @@ -155,7 +158,7 @@ type PaymentIntentParams struct {
Description *string `form:"description"`
OnBehalfOf *string `form:"on_behalf_of"`
PaymentMethod *string `form:"payment_method"`
PayentMethodOptions *PaymentIntentPaymentMethodOptionsParams `form:"payment_method_options"`
PaymentMethodOptions *PaymentIntentPaymentMethodOptionsParams `form:"payment_method_options"`
PaymentMethodTypes []*string `form:"payment_method_types"`
ReceiptEmail *string `form:"receipt_email"`
ReturnURL *string `form:"return_url"`
Expand All @@ -170,6 +173,9 @@ type PaymentIntentParams struct {
// This parameter only works if you confirm on creation. It also expects a boolean but used to
// take an enum so we're adding support for both until the next major version (TODO).
OffSession interface{} `form:"off_session"`

// TODO: remove the following parameter in the next major version
PayentMethodOptions *PaymentIntentPaymentMethodOptionsParams `form:"payment_method_options"`
}

// PaymentIntentListParams is the set of parameters that can be used when listing payment intents.
Expand Down
30 changes: 18 additions & 12 deletions setupintent.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,13 @@ type SetupIntentCancelParams struct {

// SetupIntentConfirmParams is the set of parameters that can be used when confirming a setup intent.
type SetupIntentConfirmParams struct {
Params `form:"*"`
PaymentMethod *string `form:"payment_method"`
Params `form:"*"`
PaymentMethod *string `form:"payment_method"`
PaymentMethodOptions *SetupIntentPaymentMethodOptionsParams `form:"payment_method_options"`
ReturnURL *string `form:"return_url"`

// TODO: remove the following parameter in the next major version
PayentMethodOptions *SetupIntentPaymentMethodOptionsParams `form:"payment_method_options"`
ReturnURL *string `form:"return_url"`
}

// SetupIntentPaymentMethodOptionsCardParams represents the card-specific options applied to a
Expand All @@ -86,16 +89,19 @@ type SetupIntentPaymentMethodOptionsParams struct {

// SetupIntentParams is the set of parameters that can be used when handling a setup intent.
type SetupIntentParams struct {
Params `form:"*"`
Confirm *bool `form:"confirm"`
Customer *string `form:"customer"`
Description *string `form:"description"`
OnBehalfOf *string `form:"on_behalf_of"`
PaymentMethod *string `form:"payment_method"`
Params `form:"*"`
Confirm *bool `form:"confirm"`
Customer *string `form:"customer"`
Description *string `form:"description"`
OnBehalfOf *string `form:"on_behalf_of"`
PaymentMethod *string `form:"payment_method"`
PaymentMethodOptions *SetupIntentPaymentMethodOptionsParams `form:"payment_method_options"`
PaymentMethodTypes []*string `form:"payment_method_types"`
ReturnURL *string `form:"return_url"`
Usage *string `form:"usage"`

// TODO: remove the following parameter in the next major version
PayentMethodOptions *SetupIntentPaymentMethodOptionsParams `form:"payment_method_options"`
PaymentMethodTypes []*string `form:"payment_method_types"`
ReturnURL *string `form:"return_url"`
Usage *string `form:"usage"`
}

// SetupIntentListParams is the set of parameters that can be used when listing setup intents.
Expand Down