diff --git a/charge.go b/charge.go index 95116c63a3..b3202d1948 100644 --- a/charge.go +++ b/charge.go @@ -274,12 +274,14 @@ type ChargePaymentMethodDetailsBACSDebit struct { // ChargePaymentMethodDetailsBancontact represents details about the Bancontact PaymentMethod. type ChargePaymentMethodDetailsBancontact struct { - BankCode string `json:"bank_code"` - BankName string `json:"bank_name"` - Bic string `json:"bic"` - IbanLast4 string `json:"iban_last4"` - PreferredLanguage string `json:"preferred_language"` - VerifiedName string `json:"verified_name"` + BankCode string `json:"bank_code"` + BankName string `json:"bank_name"` + Bic string `json:"bic"` + IbanLast4 string `json:"iban_last4"` + PreferredLanguage string `json:"preferred_language"` + VerifiedName string `json:"verified_name"` + GeneratedSepaDebit *PaymentMethod `json:"generated_sepa_debit"` + GeneratedSepaDebitMandate *Mandate `json:"generated_sepa_debit_mandate"` } // ChargePaymentMethodDetailsCardChecks represents the checks associated with the charge's Card @@ -428,10 +430,12 @@ type ChargePaymentMethodDetailsGiropay struct { // ChargePaymentMethodDetailsIdeal represents details about the Ideal PaymentMethod. type ChargePaymentMethodDetailsIdeal struct { - Bank string `json:"bank"` - Bic string `json:"bic"` - IbanLast4 string `json:"iban_last4"` - VerifiedName string `json:"verified_name"` + Bank string `json:"bank"` + Bic string `json:"bic"` + IbanLast4 string `json:"iban_last4"` + VerifiedName string `json:"verified_name"` + GeneratedSepaDebit *PaymentMethod `json:"generated_sepa_debit"` + GeneratedSepaDebitMandate *Mandate `json:"generated_sepa_debit_mandate"` } // ChargePaymentMethodDetailsInteracPresent represents details about the InteracPresent PaymentMethod. @@ -497,12 +501,14 @@ type ChargePaymentMethodDetailsSepaDebit struct { // ChargePaymentMethodDetailsSofort represents details about the Sofort PaymentMethod. type ChargePaymentMethodDetailsSofort struct { - BankCode string `json:"bank_code"` - BankName string `json:"bank_name"` - Bic string `json:"bic"` - Country string `json:"country"` - IbanLast4 string `json:"iban_last4"` - VerifiedName string `json:"verified_name"` + BankCode string `json:"bank_code"` + BankName string `json:"bank_name"` + Bic string `json:"bic"` + Country string `json:"country"` + IbanLast4 string `json:"iban_last4"` + VerifiedName string `json:"verified_name"` + GeneratedSepaDebit *PaymentMethod `json:"generated_sepa_debit"` + GeneratedSepaDebitMandate *Mandate `json:"generated_sepa_debit_mandate"` } // ChargePaymentMethodDetailsStripeAccount represents details about the StripeAccount PaymentMethod. diff --git a/paymentmethod.go b/paymentmethod.go index a5b7bd2465..c23247f86b 100644 --- a/paymentmethod.go +++ b/paymentmethod.go @@ -327,13 +327,21 @@ type PaymentMethodOXXO struct { type PaymentMethodP24 struct { } +// PaymentMethodSepaDebitGeneratedFrom represents information about the object +// that generated this PaymentMethod +type PaymentMethodSepaDebitGeneratedFrom struct { + Charge *Charge `json:"charge"` + SetupAttempt *SetupAttempt `json:"setup_attempt"` +} + // PaymentMethodSepaDebit represents the SEPA-debit-specific properties. type PaymentMethodSepaDebit struct { - BankCode string `json:"bank_code"` - BranchCode string `json:"branch_code"` - Country string `json:"country"` - Fingerprint string `json:"fingerprint"` - Last4 string `json:"last4"` + BankCode string `json:"bank_code"` + BranchCode string `json:"branch_code"` + Country string `json:"country"` + Fingerprint string `json:"fingerprint"` + Last4 string `json:"last4"` + GeneratedFrom *PaymentMethodSepaDebitGeneratedFrom `json:"generated_from"` } // PaymentMethodSofort represents the Sofort-specific properties. diff --git a/setupattempt.go b/setupattempt.go index 01a0e9b606..e63051144a 100644 --- a/setupattempt.go +++ b/setupattempt.go @@ -85,15 +85,52 @@ type SetupAttemptPaymentMethodDetailsCardThreeDSecure struct { Version string `json:"version"` } +// SetupAttemptPaymentMethodDetailsBancontact represents details about the Bancontact PaymentMethod. +type SetupAttemptPaymentMethodDetailsBancontact struct { + BankCode string `json:"bank_code"` + BankName string `json:"bank_name"` + Bic string `json:"bic"` + GeneratedSepaDebit *PaymentMethod `json:"generated_sepa_debit"` + GeneratedSepaDebitMandate *Mandate `json:"generated_sepa_debit_mandate"` + IbanLast4 string `json:"iban_last4"` + PreferredLanguage string `json:"preferred_language"` + VerifiedName string `json:"verified_name"` +} + // SetupAttemptPaymentMethodDetailsCard represents details about the Card PaymentMethod. type SetupAttemptPaymentMethodDetailsCard struct { ThreeDSecure *SetupAttemptPaymentMethodDetailsCardThreeDSecure `json:"three_d_secure"` } +// SetupAttemptPaymentMethodDetailsBancontact represents details about the Bancontact PaymentMethod. +type SetupAttemptPaymentMethodDetailsIdeal struct { + Bank string `json:"bank"` + Bic string `json:"bic"` + GeneratedSepaDebit *PaymentMethod `json:"generated_sepa_debit"` + GeneratedSepaDebitMandate *Mandate `json:"generated_sepa_debit_mandate"` + IbanLast4 string `json:"iban_last4"` + VerifiedName string `json:"verified_name"` +} + +// SetupAttemptPaymentMethodDetailsBancontact represents details about the Bancontact PaymentMethod. +type SetupAttemptPaymentMethodDetailsSofort struct { + BankCode string `json:"bank_code"` + BankName string `json:"bank_name"` + Bic string `json:"bic"` + GeneratedSepaDebit *PaymentMethod `json:"generated_sepa_debit"` + GeneratedSepaDebitMandate *Mandate `json:"generated_sepa_debit_mandate"` + IbanLast4 string `json:"iban_last4"` + PreferredLanguage string `json:"preferred_language"` + VerifiedName string `json:"verified_name"` +} + // SetupAttemptPaymentMethodDetails represents the details about the PaymentMethod associated with the setup attempt. type SetupAttemptPaymentMethodDetails struct { - Card *SetupAttemptPaymentMethodDetailsCard `json:"card"` - Type SetupAttemptPaymentMethodDetailsType `json:"type"` + Bancontact *SetupAttemptPaymentMethodDetailsBancontact `json:"bancontact"` + Card *SetupAttemptPaymentMethodDetailsCard `json:"card"` + Ideal *SetupAttemptPaymentMethodDetailsIdeal `json:"ideal"` + Sofort *SetupAttemptPaymentMethodDetailsSofort `json:"sofort"` + Type SetupAttemptPaymentMethodDetailsType `json:"type"` } // SetupAttempt is the resource representing a Stripe setup attempt.