From ffc9de12d0fdabdb3c7c905028adf1578eced725 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 9 Jun 2022 12:42:02 -0700 Subject: [PATCH] Codegen for openapi v154 --- OPENAPI_VERSION | 2 +- account.go | 30 ++++++++++++++++ customer.go | 20 +++++++++-- fundinginstructions.go | 47 ++++++++++++++++++++++-- invoice.go | 17 +++++++-- paymentintent.go | 81 +++++++++++++++++++++++++++++++++++++----- paymentmethod.go | 4 +-- price.go | 28 ++++++++++++++- sub.go | 17 +++++++-- 9 files changed, 225 insertions(+), 21 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 0b9a2a89f2..d377f60ad0 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v152 \ No newline at end of file +v154 \ No newline at end of file diff --git a/account.go b/account.go index 07f6bcc46b..96ce5e146b 100644 --- a/account.go +++ b/account.go @@ -798,6 +798,22 @@ type AccountSettingsPayoutsParams struct { StatementDescriptor *string `form:"statement_descriptor"` } +// Details on the account's acceptance of the Stripe Treasury Services Agreement. +type AccountSettingsTreasuryTOSAcceptanceParams struct { + // The Unix timestamp marking when the account representative accepted the service agreement. + Date *int64 `form:"date"` + // The IP address from which the account representative accepted the service agreement. + IP *string `form:"ip"` + // The user agent of the browser from which the account representative accepted the service agreement. + UserAgent *string `form:"user_agent"` +} + +// Settings specific to the account's Treasury FinancialAccounts. +type AccountSettingsTreasuryParams struct { + // Details on the account's acceptance of the Stripe Treasury Services Agreement. + TOSAcceptance *AccountSettingsTreasuryTOSAcceptanceParams `form:"tos_acceptance"` +} + // Options for customizing how the account functions within Stripe. type AccountSettingsParams struct { BACSDebitPayments *AccountSettingsBACSDebitPaymentsParams `form:"bacs_debit_payments"` @@ -812,6 +828,8 @@ type AccountSettingsParams struct { Payments *AccountSettingsPaymentsParams `form:"payments"` // Settings specific to the account's payouts. Payouts *AccountSettingsPayoutsParams `form:"payouts"` + // Settings specific to the account's Treasury FinancialAccounts. + Treasury *AccountSettingsTreasuryParams `form:"treasury"` } // Returns a list of accounts connected to your platform via [Connect](https://stripe.com/docs/connect). If you're not a platform, the list is empty. @@ -1168,6 +1186,17 @@ type AccountSettingsSEPADebitPayments struct { // SEPA creditor identifier that identifies the company making the payment. CreditorID string `json:"creditor_id"` } +type AccountSettingsTreasuryTOSAcceptance struct { + // The Unix timestamp marking when the account representative accepted the service agreement. + Date int64 `json:"date"` + // The IP address from which the account representative accepted the service agreement. + IP string `json:"ip"` + // The user agent of the browser from which the account representative accepted the service agreement. + UserAgent string `json:"user_agent"` +} +type AccountSettingsTreasury struct { + TOSAcceptance *AccountSettingsTreasuryTOSAcceptance `json:"tos_acceptance"` +} // Options for customizing how the account functions within Stripe. type AccountSettings struct { @@ -1179,6 +1208,7 @@ type AccountSettings struct { Payments *AccountSettingsPayments `json:"payments"` Payouts *AccountSettingsPayouts `json:"payouts"` SEPADebitPayments *AccountSettingsSEPADebitPayments `json:"sepa_debit_payments"` + Treasury *AccountSettingsTreasury `json:"treasury"` } // This is an object representing a Stripe account. You can retrieve it to see diff --git a/customer.go b/customer.go index 8653c52f1f..8005a30462 100644 --- a/customer.go +++ b/customer.go @@ -90,6 +90,12 @@ type CustomerInvoiceCustomFieldParams struct { Value *string `form:"value"` } +// Default options for invoice PDF rendering for this customer. +type CustomerInvoiceSettingsRenderingOptionsParams struct { + // How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + AmountTaxDisplay *string `form:"amount_tax_display"` +} + // Default invoice settings for this customer. type CustomerInvoiceSettingsParams struct { // Default custom fields to be displayed on invoices for this customer. When updating, pass an empty string to remove previously-defined fields. @@ -98,6 +104,8 @@ type CustomerInvoiceSettingsParams struct { DefaultPaymentMethod *string `form:"default_payment_method"` // Default footer to be displayed on invoices for this customer. Footer *string `form:"footer"` + // Default options for invoice PDF rendering for this customer. + RenderingOptions *CustomerInvoiceSettingsRenderingOptionsParams `form:"rendering_options"` } // The customer's shipping information. Appears on invoices emailed to this customer. @@ -189,17 +197,25 @@ type CustomerListPaymentMethodsParams struct { Type *string `form:"type"` } -// Retrieves a PaymentMethod object. +// Retrieves a PaymentMethod object for a given Customer. type CustomerRetrievePaymentMethodParams struct { Params `form:"*"` Customer *string `form:"-"` // Included in URL } +// Configuration for eu_bank_transfer funding type. +type CustomerCreateFundingInstructionsBankTransferEUBankTransferParams struct { + // The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. + Country *string `form:"country"` +} + // Additional parameters for `bank_transfer` funding types type CustomerCreateFundingInstructionsBankTransferParams struct { + // Configuration for eu_bank_transfer funding type. + EUBankTransfer *CustomerCreateFundingInstructionsBankTransferEUBankTransferParams `form:"eu_bank_transfer"` // List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. // - // Permitted values include: `zengin`. + // Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. RequestedAddressTypes []*string `form:"requested_address_types"` // The type of the `bank_transfer` Type *string `form:"type"` diff --git a/fundinginstructions.go b/fundinginstructions.go index eb39e18ffd..c772622d91 100644 --- a/fundinginstructions.go +++ b/fundinginstructions.go @@ -11,7 +11,10 @@ type FundingInstructionsBankTransferFinancialAddressSupportedNetwork string // List of values that FundingInstructionsBankTransferFinancialAddressSupportedNetwork can take const ( + FundingInstructionsBankTransferFinancialAddressSupportedNetworkBACS FundingInstructionsBankTransferFinancialAddressSupportedNetwork = "bacs" + FundingInstructionsBankTransferFinancialAddressSupportedNetworkFPS FundingInstructionsBankTransferFinancialAddressSupportedNetwork = "fps" FundingInstructionsBankTransferFinancialAddressSupportedNetworkSepa FundingInstructionsBankTransferFinancialAddressSupportedNetwork = "sepa" + FundingInstructionsBankTransferFinancialAddressSupportedNetworkSpei FundingInstructionsBankTransferFinancialAddressSupportedNetwork = "spei" FundingInstructionsBankTransferFinancialAddressSupportedNetworkZengin FundingInstructionsBankTransferFinancialAddressSupportedNetwork = "zengin" ) @@ -20,8 +23,10 @@ type FundingInstructionsBankTransferFinancialAddressType string // List of values that FundingInstructionsBankTransferFinancialAddressType can take const ( - FundingInstructionsBankTransferFinancialAddressTypeIban FundingInstructionsBankTransferFinancialAddressType = "iban" - FundingInstructionsBankTransferFinancialAddressTypeZengin FundingInstructionsBankTransferFinancialAddressType = "zengin" + FundingInstructionsBankTransferFinancialAddressTypeIban FundingInstructionsBankTransferFinancialAddressType = "iban" + FundingInstructionsBankTransferFinancialAddressTypeSortCode FundingInstructionsBankTransferFinancialAddressType = "sort_code" + FundingInstructionsBankTransferFinancialAddressTypeSpei FundingInstructionsBankTransferFinancialAddressType = "spei" + FundingInstructionsBankTransferFinancialAddressTypeZengin FundingInstructionsBankTransferFinancialAddressType = "zengin" ) // The bank_transfer type @@ -41,6 +46,38 @@ const ( FundingInstructionsFundingTypeBankTransfer FundingInstructionsFundingType = "bank_transfer" ) +// Iban Records contain E.U. bank account details per the SEPA format. +type FundingInstructionsBankTransferFinancialAddressIban struct { + // The name of the person or business that owns the bank account + AccountHolderName string `json:"account_holder_name"` + // The BIC/SWIFT code of the account. + Bic string `json:"bic"` + // Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + Country string `json:"country"` + // The IBAN of the account. + Iban string `json:"iban"` +} + +// Sort Code Records contain U.K. bank account details per the sort code format. +type FundingInstructionsBankTransferFinancialAddressSortCode struct { + // The name of the person or business that owns the bank account + AccountHolderName string `json:"account_holder_name"` + // The account number + AccountNumber string `json:"account_number"` + // The six-digit sort code + SortCode string `json:"sort_code"` +} + +// SPEI Records contain Mexico bank account details per the SPEI format. +type FundingInstructionsBankTransferFinancialAddressSpei struct { + // The three-digit bank code + BankCode string `json:"bank_code"` + // The short banking institution name + BankName string `json:"bank_name"` + // The CLABE number + Clabe string `json:"clabe"` +} + // Zengin Records contain Japan bank account details per the Zengin format. type FundingInstructionsBankTransferFinancialAddressZengin struct { // The account holder name @@ -61,6 +98,12 @@ type FundingInstructionsBankTransferFinancialAddressZengin struct { // A list of financial addresses that can be used to fund a particular balance type FundingInstructionsBankTransferFinancialAddress struct { + // Iban Records contain E.U. bank account details per the SEPA format. + Iban *FundingInstructionsBankTransferFinancialAddressIban `json:"iban"` + // Sort Code Records contain U.K. bank account details per the sort code format. + SortCode *FundingInstructionsBankTransferFinancialAddressSortCode `json:"sort_code"` + // SPEI Records contain Mexico bank account details per the SPEI format. + Spei *FundingInstructionsBankTransferFinancialAddressSpei `json:"spei"` // The payment networks supported by this FinancialAddress SupportedNetworks []FundingInstructionsBankTransferFinancialAddressSupportedNetwork `json:"supported_networks"` // The type of financial address diff --git a/invoice.go b/invoice.go index 9e0c2dbdcb..bdfd414566 100644 --- a/invoice.go +++ b/invoice.go @@ -218,9 +218,17 @@ type InvoicePaymentSettingsPaymentMethodOptionsCardParams struct { RequestThreeDSecure *string `form:"request_three_d_secure"` } +// Configuration for eu_bank_transfer funding type. +type InvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEUBankTransferParams struct { + // The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. + Country *string `form:"country"` +} + // Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. type InvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferParams struct { - // The bank transfer type that can be used for funding. Permitted values include: `jp_bank_transfer`. + // Configuration for eu_bank_transfer funding type. + EUBankTransfer *InvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEUBankTransferParams `form:"eu_bank_transfer"` + // The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. Type *string `form:"type"` } @@ -555,8 +563,13 @@ type InvoicePaymentSettingsPaymentMethodOptionsCard struct { // We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. RequestThreeDSecure InvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure `json:"request_three_d_secure"` } +type InvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEUBankTransfer struct { + // The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. + Country string `json:"country"` +} type InvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer struct { - // The bank transfer type that can be used for funding. Permitted values include: `jp_bank_transfer`. + EUBankTransfer *InvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEUBankTransfer `json:"eu_bank_transfer"` + // The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. Type string `json:"type"` } diff --git a/paymentintent.go b/paymentintent.go index 1bc69a2ec1..84393ef708 100644 --- a/paymentintent.go +++ b/paymentintent.go @@ -44,7 +44,10 @@ type PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressSuppo // List of values that PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressSupportedNetwork can take const ( + PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressSupportedNetworkBACS PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressSupportedNetwork = "bacs" + PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressSupportedNetworkFPS PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressSupportedNetwork = "fps" PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressSupportedNetworkSepa PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressSupportedNetwork = "sepa" + PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressSupportedNetworkSpei PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressSupportedNetwork = "spei" PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressSupportedNetworkZengin PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressSupportedNetwork = "zengin" ) @@ -53,8 +56,10 @@ type PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressType // List of values that PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressType can take const ( - PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressTypeIban PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressType = "iban" - PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressTypeZengin PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressType = "zengin" + PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressTypeIban PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressType = "iban" + PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressTypeSortCode PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressType = "sort_code" + PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressTypeSpei PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressType = "spei" + PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressTypeZengin PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressType = "zengin" ) // Type of bank transfer @@ -62,7 +67,10 @@ type PaymentIntentNextActionDisplayBankTransferInstructionsType string // List of values that PaymentIntentNextActionDisplayBankTransferInstructionsType can take const ( + PaymentIntentNextActionDisplayBankTransferInstructionsTypeEUBankTransfer PaymentIntentNextActionDisplayBankTransferInstructionsType = "eu_bank_transfer" + PaymentIntentNextActionDisplayBankTransferInstructionsTypeGBBankTransfer PaymentIntentNextActionDisplayBankTransferInstructionsType = "gb_bank_transfer" PaymentIntentNextActionDisplayBankTransferInstructionsTypeJPBankTransfer PaymentIntentNextActionDisplayBankTransferInstructionsType = "jp_bank_transfer" + PaymentIntentNextActionDisplayBankTransferInstructionsTypeMXBankTransfer PaymentIntentNextActionDisplayBankTransferInstructionsType = "mx_bank_transfer" ) // Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`. @@ -324,20 +332,27 @@ const ( // List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. // -// Permitted values include: `zengin`. +// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. type PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressType string // List of values that PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressType can take const ( - PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypeZengin PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressType = "zengin" + PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypeIban PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressType = "iban" + PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypeSepa PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressType = "sepa" + PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypeSortCode PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressType = "sort_code" + PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypeSpei PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressType = "spei" + PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypeZengin PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressType = "zengin" ) -// The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `jp_bank_transfer`. +// The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. type PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType string // List of values that PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType can take const ( + PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferTypeEUBankTransfer PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType = "eu_bank_transfer" + PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferTypeGBBankTransfer PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType = "gb_bank_transfer" PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferTypeJPBankTransfer PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType = "jp_bank_transfer" + PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferTypeMXBankTransfer PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType = "mx_bank_transfer" ) // The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. @@ -993,14 +1008,19 @@ type PaymentIntentPaymentMethodOptionsCardPresentParams struct { // Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. RequestIncrementalAuthorizationSupport *bool `form:"request_incremental_authorization_support"` } +type PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferEUBankTransferParams struct { + // The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. + Country *string `form:"country"` +} // Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. type PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferParams struct { + EUBankTransfer *PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferEUBankTransferParams `form:"eu_bank_transfer"` // List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. // - // Permitted values include: `zengin`. + // Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. RequestedAddressTypes []*string `form:"requested_address_types"` - // The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `jp_bank_transfer`. + // The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. Type *string `form:"type"` } @@ -1645,6 +1665,38 @@ type PaymentIntentNextActionCardAwaitNotification struct { CustomerApprovalRequired bool `json:"customer_approval_required"` } +// Iban Records contain E.U. bank account details per the SEPA format. +type PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressIban struct { + // The name of the person or business that owns the bank account + AccountHolderName string `json:"account_holder_name"` + // The BIC/SWIFT code of the account. + Bic string `json:"bic"` + // Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + Country string `json:"country"` + // The IBAN of the account. + Iban string `json:"iban"` +} + +// Sort Code Records contain U.K. bank account details per the sort code format. +type PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressSortCode struct { + // The name of the person or business that owns the bank account + AccountHolderName string `json:"account_holder_name"` + // The account number + AccountNumber string `json:"account_number"` + // The six-digit sort code + SortCode string `json:"sort_code"` +} + +// SPEI Records contain Mexico bank account details per the SPEI format. +type PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressSpei struct { + // The three-digit bank code + BankCode string `json:"bank_code"` + // The short banking institution name + BankName string `json:"bank_name"` + // The CLABE number + Clabe string `json:"clabe"` +} + // Zengin Records contain Japan bank account details per the Zengin format. type PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressZengin struct { // The account holder name @@ -1665,6 +1717,12 @@ type PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressZengi // A list of financial addresses that can be used to fund the customer balance type PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddress struct { + // Iban Records contain E.U. bank account details per the SEPA format. + Iban *PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressIban `json:"iban"` + // Sort Code Records contain U.K. bank account details per the sort code format. + SortCode *PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressSortCode `json:"sort_code"` + // SPEI Records contain Mexico bank account details per the SPEI format. + Spei *PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressSpei `json:"spei"` // The payment networks supported by this FinancialAddress SupportedNetworks []PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressSupportedNetwork `json:"supported_networks"` // The type of financial address @@ -1980,12 +2038,17 @@ type PaymentIntentPaymentMethodOptionsCardPresent struct { // Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. RequestIncrementalAuthorizationSupport bool `json:"request_incremental_authorization_support"` } +type PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferEUBankTransfer struct { + // The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. + Country string `json:"country"` +} type PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer struct { + EUBankTransfer *PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferEUBankTransfer `json:"eu_bank_transfer"` // List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. // - // Permitted values include: `zengin`. + // Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. RequestedAddressTypes []PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressType `json:"requested_address_types"` - // The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `jp_bank_transfer`. + // The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. Type PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType `json:"type"` } type PaymentIntentPaymentMethodOptionsCustomerBalance struct { diff --git a/paymentmethod.go b/paymentmethod.go index 2a7cd88724..412e551b7d 100644 --- a/paymentmethod.go +++ b/paymentmethod.go @@ -363,10 +363,10 @@ type PaymentMethodParams struct { PaymentMethod *string `form:"payment_method"` } -// Returns a list of PaymentMethods. For listing a customer's payment methods, you should use [List a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer_list) +// Returns a list of PaymentMethods attached to the StripeAccount. For listing a customer's payment methods, you should use [List a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer_list) type PaymentMethodListParams struct { ListParams `form:"*"` - // The ID of the customer whose PaymentMethods will be retrieved. If not provided, the response list will be empty. + // The ID of the customer whose PaymentMethods will be retrieved. Customer *string `form:"customer"` // A required filter on the list, based on the object `type` field. Type *string `form:"type"` diff --git a/price.go b/price.go index 22b34f9dea..a6c7dddd14 100644 --- a/price.go +++ b/price.go @@ -127,6 +127,18 @@ type PriceListParams struct { Type *string `form:"type"` } +// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. +type PriceCustomUnitAmountParams struct { + // Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. + Enabled *bool `form:"enabled"` + // The maximum unit amount the customer can specify for this item. + Maximum *int64 `form:"maximum"` + // The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. + Minimum *int64 `form:"minimum"` + // The starting unit amount which can be updated by the customer. + Preset *int64 `form:"preset"` +} + // These fields can be used to create a new product that this price will belong to. type PriceProductDataParams struct { // Whether the product is currently available for purchase. Defaults to `true`. @@ -200,6 +212,8 @@ type PriceParams struct { BillingScheme *string `form:"billing_scheme"` // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Currency *string `form:"currency"` + // When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + CustomUnitAmount *PriceCustomUnitAmountParams `form:"custom_unit_amount"` // A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters. LookupKey *string `form:"lookup_key"` // A brief description of the price, hidden from customers. @@ -226,6 +240,16 @@ type PriceParams struct { UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` } +// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. +type PriceCustomUnitAmount struct { + // The maximum unit amount the customer can specify for this item. + Maximum int64 `json:"maximum"` + // The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. + Minimum int64 `json:"minimum"` + // The starting unit amount which can be updated by the customer. + Preset int64 `json:"preset"` +} + // The recurring components of a price such as `interval` and `usage_type`. type PriceRecurring struct { // Specifies a usage aggregation strategy for prices of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`. @@ -278,7 +302,9 @@ type Price struct { Created int64 `json:"created"` // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Currency Currency `json:"currency"` - Deleted bool `json:"deleted"` + // When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + CustomUnitAmount *PriceCustomUnitAmount `json:"custom_unit_amount"` + Deleted bool `json:"deleted"` // Unique identifier for the object. ID string `json:"id"` // Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. diff --git a/sub.go b/sub.go index a38523b4c7..8ac1d53ce1 100644 --- a/sub.go +++ b/sub.go @@ -309,9 +309,17 @@ type SubscriptionPaymentSettingsPaymentMethodOptionsCardParams struct { RequestThreeDSecure *string `form:"request_three_d_secure"` } +// Configuration for eu_bank_transfer funding type. +type SubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEUBankTransferParams struct { + // The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. + Country *string `form:"country"` +} + // Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. type SubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferParams struct { - // The bank transfer type that can be used for funding. Permitted values include: `jp_bank_transfer`. + // Configuration for eu_bank_transfer funding type. + EUBankTransfer *SubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEUBankTransferParams `form:"eu_bank_transfer"` + // The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. Type *string `form:"type"` } @@ -549,8 +557,13 @@ type SubscriptionPaymentSettingsPaymentMethodOptionsCard struct { // We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. RequestThreeDSecure SubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure `json:"request_three_d_secure"` } +type SubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEUBankTransfer struct { + // The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. + Country string `json:"country"` +} type SubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer struct { - // The bank transfer type that can be used for funding. Permitted values include: `jp_bank_transfer`. + EUBankTransfer *SubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEUBankTransfer `json:"eu_bank_transfer"` + // The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. Type string `json:"type"` }