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 bank on eps/p24 #1236

Merged
merged 2 commits into from
Jan 11, 2021
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
2 changes: 2 additions & 0 deletions charge.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ type ChargePaymentMethodDetailsCardPresent struct {

// ChargePaymentMethodDetailsEps represents details about the EPS PaymentMethod.
type ChargePaymentMethodDetailsEps struct {
Bank string `json:"bank"`
VerifiedName string `json:"verified_name"`
}

Expand Down Expand Up @@ -505,6 +506,7 @@ type ChargePaymentMethodDetailsOXXO struct {

// ChargePaymentMethodDetailsP24 represents details about the P24 PaymentMethod.
type ChargePaymentMethodDetailsP24 struct {
Bank string `json:"bank"`
Reference string `json:"reference"`
VerifiedName string `json:"verified_name"`
}
Expand Down
2 changes: 2 additions & 0 deletions paymentintent.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,12 @@ type PaymentIntentPaymentMethodDataParams struct {
AUBECSDebit *PaymentMethodAUBECSDebitParams `form:"au_becs_debit"`
BillingDetails *BillingDetailsParams `form:"billing_details"`
Card *PaymentMethodCardParams `form:"card"`
EPS *PaymentMethodEPSParams `form:"eps"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arg, it looks like this should be "EPS", but it's called Eps on Charge. We should probably keep it the same between the two just for the sake of consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's Eps on Charge, but unfortunately it is also EPS in paymentmethod.go and account.go and I think it is probably better to be consistent with that?
ptal @brandur

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's Eps on Charge, but unfortunately it is also EPS in paymentmethod.go and account.go and I think it is probably better to be consistent with that?

Ah, fair. Yep, let's go with EPS then.

FPX *PaymentMethodFPXParams `form:"fpx"`
Grabpay *PaymentMethodGrabpayParams `form:"grabpay"`
Ideal *PaymentMethodIdealParams `form:"ideal"`
OXXO *PaymentMethodOXXOParams `form:"oxxo"`
P24 *PaymentMethodP24Params `form:"p24"`
SepaDebit *PaymentMethodSepaDebitParams `form:"sepa_debit"`
Type *string `form:"type"`
}
Expand Down
5 changes: 4 additions & 1 deletion paymentmethod.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ type PaymentMethodCardParams struct {
// PaymentMethodEPSParams is the set of parameters allowed for the `eps` hash when creating a
// PaymentMethod of type EPS.
type PaymentMethodEPSParams struct {
Bank *string `form:"bank"`
}

// PaymentMethodFPXParams is the set of parameters allowed for the `fpx` hash when creating a
Expand Down Expand Up @@ -164,7 +165,8 @@ type PaymentMethodOXXOParams struct {
// PaymentMethodP24Params is the set of parameters allowed for the `p24` hash when creating a
// PaymentMethod of type P24.
type PaymentMethodP24Params struct {
Bank *string `form:"bank"`
Bank *string `form:"bank"`
TOSShownAndAccepted *bool `form:"tos_shown_and_accepted"`
}

// PaymentMethodSepaDebitParams is the set of parameters allowed for the `sepa_debit` hash when
Expand Down Expand Up @@ -308,6 +310,7 @@ type PaymentMethodCardPresent struct {

// PaymentMethodEPS represents the EPS properties.
type PaymentMethodEPS struct {
Bank string `json:"bank"`
}

// PaymentMethodFPX represents FPX-specific properties (Malaysia Only).
Expand Down
28 changes: 15 additions & 13 deletions subschedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ type SubscriptionScheduleInvoiceSettingsParams struct {
// SubscriptionScheduleDefaultSettingsParams is the set of parameters
// representing the subscription schedule’s default settings.
type SubscriptionScheduleDefaultSettingsParams struct {
Params `form:"*"`
BillingCycleAnchor *string `form:"billing_cycle_anchor"`
BillingThresholds *SubscriptionBillingThresholdsParams `form:"billing_thresholds"`
CollectionMethod *string `form:"collection_method"`
DefaultPaymentMethod *string `form:"default_payment_method"`
InvoiceSettings *SubscriptionScheduleInvoiceSettingsParams `form:"invoice_settings"`
TransferData *SubscriptionTransferDataParams `form:"transfer_data"`
Params `form:"*"`
ApplicationFeePercent *float64 `form:"application_fee_percent,high_precision"`
BillingCycleAnchor *string `form:"billing_cycle_anchor"`
BillingThresholds *SubscriptionBillingThresholdsParams `form:"billing_thresholds"`
CollectionMethod *string `form:"collection_method"`
DefaultPaymentMethod *string `form:"default_payment_method"`
InvoiceSettings *SubscriptionScheduleInvoiceSettingsParams `form:"invoice_settings"`
TransferData *SubscriptionTransferDataParams `form:"transfer_data"`
}

// SubscriptionSchedulePhaseAddInvoiceItemPriceDataRecurringParams is a structure representing the
Expand Down Expand Up @@ -185,12 +186,13 @@ type SubscriptionScheduleInvoiceSettings struct {
// SubscriptionScheduleDefaultSettings is a structure representing the
// subscription schedule’s default settings.
type SubscriptionScheduleDefaultSettings struct {
BillingCycleAnchor SubscriptionSchedulePhaseBillingCycleAnchor `json:"billing_cycle_anchor"`
BillingThresholds *SubscriptionBillingThresholds `json:"billing_thresholds"`
CollectionMethod SubscriptionCollectionMethod `json:"collection_method"`
DefaultPaymentMethod *PaymentMethod `json:"default_payment_method"`
InvoiceSettings *SubscriptionScheduleInvoiceSettings `json:"invoice_settings"`
TransferData *SubscriptionTransferData `json:"transfer_data"`
ApplicationFeePercent float64 `json:"application_fee_percent,string"`
BillingCycleAnchor SubscriptionSchedulePhaseBillingCycleAnchor `json:"billing_cycle_anchor"`
BillingThresholds *SubscriptionBillingThresholds `json:"billing_thresholds"`
CollectionMethod SubscriptionCollectionMethod `json:"collection_method"`
DefaultPaymentMethod *PaymentMethod `json:"default_payment_method"`
InvoiceSettings *SubscriptionScheduleInvoiceSettings `json:"invoice_settings"`
TransferData *SubscriptionTransferData `json:"transfer_data"`
}

// SubscriptionSchedulePhaseAddInvoiceItem represents the invoice items to add when the phase starts.
Expand Down