From ccd0e01e8a9ab90eefc1b8043a8f3b3159eba510 Mon Sep 17 00:00:00 2001 From: Remi Jannel Date: Mon, 20 Jul 2020 15:32:41 -0700 Subject: [PATCH 1/2] Add support for `Capabilities` on `Account` create and update --- account.go | 89 +++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 75 insertions(+), 14 deletions(-) diff --git a/account.go b/account.go index f8afc4c383..1de2310343 100644 --- a/account.go +++ b/account.go @@ -150,6 +150,64 @@ type AccountBusinessProfileParams struct { URL *string `form:"url"` } +// AccountCapabilitiesAUBECSDebitPaymentsParams represent allowed parameters to configure the AU BECS Debit capability on an account. +type AccountCapabilitiesAUBECSDebitPaymentsParams struct { + Requested *bool `form:"requested"` +} + +// AccountCapabilitiesBACSDebitPaymentsParams represent allowed parameters to configure the BACS Debit capability on an account. +type AccountCapabilitiesBACSDebitPaymentsParams struct { + Requested *bool `form:"requested"` +} + +// AccountCapabilitiesCardIssuingParams represent allowed parameters to configure the Issuing capability on an account. +type AccountCapabilitiesCardIssuingParams struct { + Requested *bool `form:"requested"` +} + +// AccountCapabilitiesCardPaymentsParams represent allowed parameters to configure the card payments capability on an account. +type AccountCapabilitiesCardPaymentsParams struct { + Requested *bool `form:"requested"` +} + +// AccountCapabilitiesJCBPaymentsParams represent allowed parameters to configure the JCB payments capability on an account. +type AccountCapabilitiesJCBPaymentsParams struct { + Requested *bool `form:"requested"` +} + +// AccountCapabilitiesLegacyPaymentsParams represent allowed parameters to configure the legacy payments capability on an account. +type AccountCapabilitiesLegacyPaymentsParams struct { + Requested *bool `form:"requested"` +} + +// AccountCapabilitiesTaxReportingUs1099KParams represent allowed parameters to configure the 1099-K capability on an account. +type AccountCapabilitiesTaxReportingUs1099KParams struct { + Requested *bool `form:"requested"` +} + +// AccountCapabilitiesTaxReportingUs1099MISCParams represent allowed parameters to configure the 1099-Misc capability on an account. +type AccountCapabilitiesTaxReportingUs1099MISCParams struct { + Requested *bool `form:"requested"` +} + +// AccountCapabilitiesTransfersParams represent allowed parameters to configure the transfers capability on an account. +type AccountCapabilitiesTransfersParams struct { + Requested *bool `form:"requested"` +} + +// AccountCapabilitiesParams represent allowed parameters to configure capabilities on an account. +type AccountCapabilitiesParams struct { + AUBECSDebitPayments *AccountCapabilitiesAUBECSDebitPaymentsParams `form:"au_becs_debit_payments"` + BACSDebitPayments *AccountCapabilitiesBACSDebitPaymentsParams `form:"bacs_debit_payments"` + CardIssuing *AccountCapabilitiesCardIssuingParams `form:"card_issuing"` + CardPayments *AccountCapabilitiesCardPaymentsParams `form:"card_payments"` + JCBPayments *AccountCapabilitiesJCBPaymentsParams `form:"jcb_payments"` + LegacyPayments *AccountCapabilitiesLegacyPaymentsParams `form:"legacy_payments"` + TaxReportingUs1099K *AccountCapabilitiesTaxReportingUs1099KParams `form:"tax_reporting_us_1099_k"` + TaxReportingUs1099MISC *AccountCapabilitiesTaxReportingUs1099MISCParams `form:"tax_reporting_us_1099_misc"` + Transfers *AccountCapabilitiesTransfersParams `form:"transfers"` +} + // AccountCompanyVerificationDocumentParams are the parameters allowed to pass for a document // verifying a company. type AccountCompanyVerificationDocumentParams struct { @@ -262,20 +320,23 @@ func (p *PayoutScheduleParams) AppendTo(body *form.Values, keyParts []string) { // AccountParams are the parameters allowed during account creation/updates. type AccountParams struct { - Params `form:"*"` - AccountToken *string `form:"account_token"` - BusinessProfile *AccountBusinessProfileParams `form:"business_profile"` - BusinessType *string `form:"business_type"` - Company *AccountCompanyParams `form:"company"` - Country *string `form:"country"` - DefaultCurrency *string `form:"default_currency"` - Email *string `form:"email"` - ExternalAccount *AccountExternalAccountParams `form:"external_account"` - Individual *PersonParams `form:"individual"` - RequestedCapabilities []*string `form:"requested_capabilities"` - Settings *AccountSettingsParams `form:"settings"` - TOSAcceptance *AccountTOSAcceptanceParams `form:"tos_acceptance"` - Type *string `form:"type"` + Params `form:"*"` + AccountToken *string `form:"account_token"` + BusinessProfile *AccountBusinessProfileParams `form:"business_profile"` + BusinessType *string `form:"business_type"` + Capabilities *AccountCapabilitiesParams `form:"capabilities"` + Company *AccountCompanyParams `form:"company"` + Country *string `form:"country"` + DefaultCurrency *string `form:"default_currency"` + Email *string `form:"email"` + ExternalAccount *AccountExternalAccountParams `form:"external_account"` + Individual *PersonParams `form:"individual"` + Settings *AccountSettingsParams `form:"settings"` + TOSAcceptance *AccountTOSAcceptanceParams `form:"tos_acceptance"` + Type *string `form:"type"` + + // This parameter is deprecated. Prefer using Capabilities instead. + RequestedCapabilities []*string `form:"requested_capabilities"` } // AccountAddressParams represents an address during account creation/updates. From 17c6c316c75fcb984a6bbe4d4143331f6cf259df Mon Sep 17 00:00:00 2001 From: Remi Jannel Date: Mon, 20 Jul 2020 15:32:41 -0700 Subject: [PATCH 2/2] Add support for `Capabilities` on `Account` create and update --- account.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/account.go b/account.go index 1de2310343..f4cf4a7a27 100644 --- a/account.go +++ b/account.go @@ -180,13 +180,13 @@ type AccountCapabilitiesLegacyPaymentsParams struct { Requested *bool `form:"requested"` } -// AccountCapabilitiesTaxReportingUs1099KParams represent allowed parameters to configure the 1099-K capability on an account. -type AccountCapabilitiesTaxReportingUs1099KParams struct { +// AccountCapabilitiesTaxReportingUS1099KParams represent allowed parameters to configure the 1099-K capability on an account. +type AccountCapabilitiesTaxReportingUS1099KParams struct { Requested *bool `form:"requested"` } -// AccountCapabilitiesTaxReportingUs1099MISCParams represent allowed parameters to configure the 1099-Misc capability on an account. -type AccountCapabilitiesTaxReportingUs1099MISCParams struct { +// AccountCapabilitiesTaxReportingUS1099MISCParams represent allowed parameters to configure the 1099-Misc capability on an account. +type AccountCapabilitiesTaxReportingUS1099MISCParams struct { Requested *bool `form:"requested"` } @@ -203,8 +203,8 @@ type AccountCapabilitiesParams struct { CardPayments *AccountCapabilitiesCardPaymentsParams `form:"card_payments"` JCBPayments *AccountCapabilitiesJCBPaymentsParams `form:"jcb_payments"` LegacyPayments *AccountCapabilitiesLegacyPaymentsParams `form:"legacy_payments"` - TaxReportingUs1099K *AccountCapabilitiesTaxReportingUs1099KParams `form:"tax_reporting_us_1099_k"` - TaxReportingUs1099MISC *AccountCapabilitiesTaxReportingUs1099MISCParams `form:"tax_reporting_us_1099_misc"` + TaxReportingUS1099K *AccountCapabilitiesTaxReportingUS1099KParams `form:"tax_reporting_us_1099_k"` + TaxReportingUS1099MISC *AccountCapabilitiesTaxReportingUS1099MISCParams `form:"tax_reporting_us_1099_misc"` Transfers *AccountCapabilitiesTransfersParams `form:"transfers"` }