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 PaymentMethodData on PaymentIntent #1090

Merged
merged 1 commit into from
Jun 15, 2020
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 paymentintent.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ type PaymentIntentConfirmParams struct {
MandateData *PaymentIntentMandateDataParams `form:"mandate_data"`
OffSession *bool `form:"off_session"`
PaymentMethod *string `form:"payment_method"`
PaymentMethodData *PaymentIntentPaymentMethodDataParams `form:"payment_method_data"`
PaymentMethodOptions *PaymentIntentPaymentMethodOptionsParams `form:"payment_method_options"`
PaymentMethodTypes []*string `form:"payment_method_types"`
ReceiptEmail *string `form:"receipt_email"`
Expand Down Expand Up @@ -164,6 +165,18 @@ type PaymentIntentMandateDataParams struct {
CustomerAcceptance *PaymentIntentMandateDataCustomerAcceptanceParams `form:"customer_acceptance"`
}

// PaymentIntentPaymentMethodDataParams represents the type-specific parameters associated with a
// payment method on payment intent.
type PaymentIntentPaymentMethodDataParams struct {
AUBECSDebit *PaymentMethodAUBECSDebitParams `form:"au_becs_debit"`
BillingDetails *BillingDetailsParams `form:"billing_details"`
Card *PaymentMethodCardParams `form:"card"`
FPX *PaymentMethodFPXParams `form:"fpx"`
Ideal *PaymentMethodIdealParams `form:"ideal"`
SepaDebit *PaymentMethodSepaDebitParams `form:"sepa_debit"`
Type *string `form:"type"`
}

// PaymentIntentPaymentMethodOptionsBancontactParams represents the bancontact-specific options
// applied to a PaymentIntent.
type PaymentIntentPaymentMethodOptionsBancontactParams struct {
Expand Down Expand Up @@ -222,6 +235,7 @@ type PaymentIntentParams struct {
MandateData *PaymentIntentMandateDataParams `form:"mandate_data"`
OnBehalfOf *string `form:"on_behalf_of"`
PaymentMethod *string `form:"payment_method"`
PaymentMethodData *PaymentIntentPaymentMethodDataParams `form:"payment_method_data"`
PaymentMethodOptions *PaymentIntentPaymentMethodOptionsParams `form:"payment_method_options"`
PaymentMethodTypes []*string `form:"payment_method_types"`
ReceiptEmail *string `form:"receipt_email"`
Expand Down