Skip to content

Commit

Permalink
Add support for Mandate on PaymentIntent
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-stripe committed Nov 5, 2019
1 parent 907ac1e commit 8045783
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions paymentintent.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ type PaymentIntentCaptureParams struct {
// PaymentIntentConfirmParams is the set of parameters that can be used when confirming a payment intent.
type PaymentIntentConfirmParams struct {
Params `form:"*"`
Mandate *string `form:"mandate"`
MandateData *PaymentIntentMandateDataParams `form:"mandate_data"`
OffSession *bool `form:"off_session"`
PaymentMethod *string `form:"payment_method"`
PaymentMethodOptions *PaymentIntentPaymentMethodOptionsParams `form:"payment_method_options"`
Expand All @@ -137,6 +139,33 @@ type PaymentIntentConfirmParams struct {
UseStripeSDK *bool `form:"use_stripe_sdk"`
}

// PaymentIntentMandateDataCustomerAcceptanceOfflineParams is the set of parameters for the customer
// acceptance of an offline mandate.
type PaymentIntentMandateDataCustomerAcceptanceOfflineParams struct {
}

// PaymentIntentMandateDataCustomerAcceptanceOnlineParams is the set of parameters for the customer
// acceptance of an online mandate.
type PaymentIntentMandateDataCustomerAcceptanceOnlineParams struct {
IPAddress *string `form:"ip_address"`
UserAgent *string `form:"user_agent"`
}

// PaymentIntentMandateDataCustomerAcceptanceParams is the set of parameters for the customer
// acceptance of a mandate.
type PaymentIntentMandateDataCustomerAcceptanceParams struct {
AcceptedAt int64 `form:"accepted_at"`
Offline *PaymentIntentMandateDataCustomerAcceptanceOfflineParams `form:"offline"`
Online *PaymentIntentMandateDataCustomerAcceptanceOnlineParams `form:"online"`
Type MandateCustomerAcceptanceType `form:"type"`
}

// PaymentIntentMandateDataParams is the set of parameters controlling the creation of the mandate
// associated with this PaymentIntent.
type PaymentIntentMandateDataParams struct {
CustomerAcceptance *PaymentIntentMandateDataCustomerAcceptanceParams `form:"customer_acceptance"`
}

// PaymentIntentPaymentMethodOptionsCardInstallmentsPlanParams represents details about the
// installment plan chosen for this payment intent.
type PaymentIntentPaymentMethodOptionsCardInstallmentsPlanParams struct {
Expand Down Expand Up @@ -183,6 +212,8 @@ type PaymentIntentParams struct {
Currency *string `form:"currency"`
Customer *string `form:"customer"`
Description *string `form:"description"`
Mandate *string `form:"mandate"`
MandateData *PaymentIntentMandateDataParams `form:"mandate_data"`
OnBehalfOf *string `form:"on_behalf_of"`
PaymentMethod *string `form:"payment_method"`
PaymentMethodOptions *PaymentIntentPaymentMethodOptionsParams `form:"payment_method_options"`
Expand Down

0 comments on commit 8045783

Please sign in to comment.