From b269e742012e20a7934ddf998aa71bbbf212a243 Mon Sep 17 00:00:00 2001 From: Remi Jannel Date: Sun, 3 May 2020 19:30:07 -0700 Subject: [PATCH] Add support for `PaymentMethodData` on `PaymentIntent` --- paymentintent.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/paymentintent.go b/paymentintent.go index e4ed09daed..b429b3a2e8 100644 --- a/paymentintent.go +++ b/paymentintent.go @@ -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"` @@ -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 { @@ -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"`