diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 55b7a77b11..4ee3ea09e2 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v793 \ No newline at end of file +v808 \ No newline at end of file diff --git a/account.go b/account.go index 21a0485a5c..f7ecad2a54 100644 --- a/account.go +++ b/account.go @@ -174,9 +174,7 @@ type AccountParams struct { Expand []*string `form:"expand"` // A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation. // - // By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. - // - // Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. + // By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. After you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. ExternalAccount *AccountExternalAccountParams `form:"external_account"` // Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. Individual *PersonParams `form:"individual"` @@ -434,6 +432,12 @@ type AccountCapabilitiesSofortPaymentsParams struct { Requested *bool `form:"requested"` } +// The swish_payments capability. +type AccountCapabilitiesSwishPaymentsParams struct { + // Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + Requested *bool `form:"requested"` +} + // The tax_reporting_us_1099_k capability. type AccountCapabilitiesTaxReportingUS1099KParams struct { // Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. @@ -534,6 +538,8 @@ type AccountCapabilitiesParams struct { SEPADebitPayments *AccountCapabilitiesSEPADebitPaymentsParams `form:"sepa_debit_payments"` // The sofort_payments capability. SofortPayments *AccountCapabilitiesSofortPaymentsParams `form:"sofort_payments"` + // The swish_payments capability. + SwishPayments *AccountCapabilitiesSwishPaymentsParams `form:"swish_payments"` // The tax_reporting_us_1099_k capability. TaxReportingUS1099K *AccountCapabilitiesTaxReportingUS1099KParams `form:"tax_reporting_us_1099_k"` // The tax_reporting_us_1099_misc capability. @@ -800,6 +806,12 @@ type AccountSettingsCardPaymentsParams struct { StatementDescriptorPrefixKanji *string `form:"statement_descriptor_prefix_kanji"` } +// Settings specific to the account's use of Invoices. +type AccountSettingsInvoicesParams struct { + // The list of default Account Tax IDs to automatically include on invoices. Account Tax IDs get added when an invoice is finalized. + DefaultAccountTaxIDs []*string `form:"default_account_tax_ids"` +} + // Settings that apply across payment methods for charging on the account. type AccountSettingsPaymentsParams struct { // The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. @@ -866,6 +878,8 @@ type AccountSettingsParams struct { CardIssuing *AccountSettingsCardIssuingParams `form:"card_issuing"` // Settings specific to card charging on the account. CardPayments *AccountSettingsCardPaymentsParams `form:"card_payments"` + // Settings specific to the account's use of Invoices. + Invoices *AccountSettingsInvoicesParams `form:"invoices"` // Settings that apply across payment methods for charging on the account. Payments *AccountSettingsPaymentsParams `form:"payments"` // Settings specific to the account's payouts. @@ -1019,6 +1033,8 @@ type AccountCapabilities struct { SEPADebitPayments AccountCapabilityStatus `json:"sepa_debit_payments"` // The status of the Sofort payments capability of the account, or whether the account can directly process Sofort charges. SofortPayments AccountCapabilityStatus `json:"sofort_payments"` + // The status of the Swish capability of the account, or whether the account can directly process Swish payments. + SwishPayments AccountCapabilityStatus `json:"swish_payments"` // The status of the tax reporting 1099-K (US) capability of the account. TaxReportingUS1099K AccountCapabilityStatus `json:"tax_reporting_us_1099_k"` // The status of the tax reporting 1099-MISC (US) capability of the account. @@ -1256,6 +1272,10 @@ type AccountSettingsDashboard struct { // The timezone used in the Stripe Dashboard for this account. A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). Timezone string `json:"timezone"` } +type AccountSettingsInvoices struct { + // The list of default Account Tax IDs to automatically include on invoices. Account Tax IDs get added when an invoice is finalized. + DefaultAccountTaxIDs []*TaxID `json:"default_account_tax_ids"` +} type AccountSettingsPayments struct { // The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. StatementDescriptor string `json:"statement_descriptor"` @@ -1308,6 +1328,7 @@ type AccountSettings struct { CardIssuing *AccountSettingsCardIssuing `json:"card_issuing"` CardPayments *AccountSettingsCardPayments `json:"card_payments"` Dashboard *AccountSettingsDashboard `json:"dashboard"` + Invoices *AccountSettingsInvoices `json:"invoices"` Payments *AccountSettingsPayments `json:"payments"` Payouts *AccountSettingsPayouts `json:"payouts"` SEPADebitPayments *AccountSettingsSEPADebitPayments `json:"sepa_debit_payments"` diff --git a/charge.go b/charge.go index 2303627edd..6a8458296c 100644 --- a/charge.go +++ b/charge.go @@ -268,6 +268,7 @@ const ( ChargePaymentMethodDetailsTypeP24 ChargePaymentMethodDetailsType = "p24" ChargePaymentMethodDetailsTypeSEPADebit ChargePaymentMethodDetailsType = "sepa_debit" ChargePaymentMethodDetailsTypeSofort ChargePaymentMethodDetailsType = "sofort" + ChargePaymentMethodDetailsTypeSwish ChargePaymentMethodDetailsType = "swish" ChargePaymentMethodDetailsTypeStripeAccount ChargePaymentMethodDetailsType = "stripe_account" ChargePaymentMethodDetailsTypeWeChat ChargePaymentMethodDetailsType = "wechat" ) @@ -1140,6 +1141,14 @@ type ChargePaymentMethodDetailsSofort struct { VerifiedName string `json:"verified_name"` } type ChargePaymentMethodDetailsStripeAccount struct{} +type ChargePaymentMethodDetailsSwish struct { + // Uniquely identifies the payer's Swish account. You can use this attribute to check whether two Swish transactions were paid for by the same payer + Fingerprint string `json:"fingerprint"` + // Payer bank reference number for the payment + PaymentReference string `json:"payment_reference"` + // The last four digits of the Swish account phone number + VerifiedPhoneLast4 string `json:"verified_phone_last4"` +} type ChargePaymentMethodDetailsUSBankAccount struct { // Account holder type: individual or company. AccountHolderType ChargePaymentMethodDetailsUSBankAccountAccountHolderType `json:"account_holder_type"` @@ -1201,6 +1210,7 @@ type ChargePaymentMethodDetails struct { SEPADebit *ChargePaymentMethodDetailsSEPADebit `json:"sepa_debit"` Sofort *ChargePaymentMethodDetailsSofort `json:"sofort"` StripeAccount *ChargePaymentMethodDetailsStripeAccount `json:"stripe_account"` + Swish *ChargePaymentMethodDetailsSwish `json:"swish"` // The type of transaction-specific details of the payment method used in the payment, one of `ach_credit_transfer`, `ach_debit`, `acss_debit`, `alipay`, `au_becs_debit`, `bancontact`, `card`, `card_present`, `eps`, `giropay`, `ideal`, `klarna`, `multibanco`, `p24`, `sepa_debit`, `sofort`, `stripe_account`, or `wechat`. // An additional hash is included on `payment_method_details` with a name matching this value. // It contains information specific to the payment method. diff --git a/checkout_session.go b/checkout_session.go index 3b9aec8dd2..305dc38104 100644 --- a/checkout_session.go +++ b/checkout_session.go @@ -716,8 +716,7 @@ const ( // Describes the type of transaction being performed by Checkout in order to customize // relevant text on the page, such as the submit button. `submit_type` can only be -// specified on Checkout Sessions in `payment` mode, but not Checkout Sessions -// in `subscription` or `setup` mode. Possible values are `auto`, `pay`, `book`, `donate`. If blank or `auto`, `pay` is used. +// specified on Checkout Sessions in `payment` mode. If blank or `auto`, `pay` is used. type CheckoutSessionSubmitType string // List of values that CheckoutSessionSubmitType can take @@ -1508,6 +1507,12 @@ type CheckoutSessionPaymentMethodOptionsSofortParams struct { SetupFutureUsage *string `form:"setup_future_usage"` } +// contains details about the Swish payment method options. +type CheckoutSessionPaymentMethodOptionsSwishParams struct { + // The order reference that will be displayed to customers in the Swish application. Defaults to the `id` of the Payment Intent. + Reference *string `form:"reference"` +} + // Additional fields for Financial Connections Session creation type CheckoutSessionPaymentMethodOptionsUSBankAccountFinancialConnectionsParams struct { // The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. @@ -1600,6 +1605,8 @@ type CheckoutSessionPaymentMethodOptionsParams struct { SEPADebit *CheckoutSessionPaymentMethodOptionsSEPADebitParams `form:"sepa_debit"` // contains details about the Sofort payment method options. Sofort *CheckoutSessionPaymentMethodOptionsSofortParams `form:"sofort"` + // contains details about the Swish payment method options. + Swish *CheckoutSessionPaymentMethodOptionsSwishParams `form:"swish"` // contains details about the Us Bank Account payment method options. USBankAccount *CheckoutSessionPaymentMethodOptionsUSBankAccountParams `form:"us_bank_account"` // contains details about the WeChat Pay payment method options. @@ -1921,8 +1928,7 @@ type CheckoutSessionParams struct { ShippingOptions []*CheckoutSessionShippingOptionParams `form:"shipping_options"` // Describes the type of transaction being performed by Checkout in order to customize // relevant text on the page, such as the submit button. `submit_type` can only be - // specified on Checkout Sessions in `payment` mode, but not Checkout Sessions - // in `subscription` or `setup` mode. Possible values are `auto`, `pay`, `book`, `donate`. If blank or `auto`, `pay` is used. + // specified on Checkout Sessions in `payment` mode. If blank or `auto`, `pay` is used. SubmitType *string `form:"submit_type"` // A subset of parameters to be passed to subscription creation for Checkout Sessions in `subscription` mode. SubscriptionData *CheckoutSessionSubscriptionDataParams `form:"subscription_data"` @@ -2475,6 +2481,10 @@ type CheckoutSessionPaymentMethodOptionsSofort struct { // When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). SetupFutureUsage CheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage `json:"setup_future_usage"` } +type CheckoutSessionPaymentMethodOptionsSwish struct { + // The order reference that will be displayed to customers in the Swish application. Defaults to the `id` of the Payment Intent. + Reference string `json:"reference"` +} type CheckoutSessionPaymentMethodOptionsUSBankAccountFinancialConnections struct { // The list of permissions to request. The `payment_method` permission must be included. Permissions []CheckoutSessionPaymentMethodOptionsUSBankAccountFinancialConnectionsPermission `json:"permissions"` @@ -2524,6 +2534,7 @@ type CheckoutSessionPaymentMethodOptions struct { RevolutPay *CheckoutSessionPaymentMethodOptionsRevolutPay `json:"revolut_pay"` SEPADebit *CheckoutSessionPaymentMethodOptionsSEPADebit `json:"sepa_debit"` Sofort *CheckoutSessionPaymentMethodOptionsSofort `json:"sofort"` + Swish *CheckoutSessionPaymentMethodOptionsSwish `json:"swish"` USBankAccount *CheckoutSessionPaymentMethodOptionsUSBankAccount `json:"us_bank_account"` } type CheckoutSessionPhoneNumberCollection struct { @@ -2741,8 +2752,7 @@ type CheckoutSession struct { Status CheckoutSessionStatus `json:"status"` // Describes the type of transaction being performed by Checkout in order to customize // relevant text on the page, such as the submit button. `submit_type` can only be - // specified on Checkout Sessions in `payment` mode, but not Checkout Sessions - // in `subscription` or `setup` mode. Possible values are `auto`, `pay`, `book`, `donate`. If blank or `auto`, `pay` is used. + // specified on Checkout Sessions in `payment` mode. If blank or `auto`, `pay` is used. SubmitType CheckoutSessionSubmitType `json:"submit_type"` // The ID of the subscription for Checkout Sessions in `subscription` mode. Subscription *Subscription `json:"subscription"` diff --git a/client/api.go b/client/api.go index ca461c743b..fa3b51a4ce 100644 --- a/client/api.go +++ b/client/api.go @@ -288,7 +288,7 @@ type API struct { TaxCalculations *taxcalculation.Client // TaxCodes is the client used to invoke /tax_codes APIs. TaxCodes *taxcode.Client - // TaxIDs is the client used to invoke /customers/{customer}/tax_ids APIs. + // TaxIDs is the client used to invoke /tax_ids APIs. TaxIDs *taxid.Client // TaxRates is the client used to invoke /tax_rates APIs. TaxRates *taxrate.Client diff --git a/paymentintent.go b/paymentintent.go index 02f26b54e9..5fc8e35891 100644 --- a/paymentintent.go +++ b/paymentintent.go @@ -688,6 +688,18 @@ const ( PaymentIntentPaymentMethodOptionsSofortSetupFutureUsageOffSession PaymentIntentPaymentMethodOptionsSofortSetupFutureUsage = "off_session" ) +// Indicates that you intend to make future payments with this PaymentIntent's payment method. +// +// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +// +// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +type PaymentIntentPaymentMethodOptionsSwishSetupFutureUsage string + +// List of values that PaymentIntentPaymentMethodOptionsSwishSetupFutureUsage can take +const ( + PaymentIntentPaymentMethodOptionsSwishSetupFutureUsageNone PaymentIntentPaymentMethodOptionsSwishSetupFutureUsage = "none" +) + // The list of permissions to request. The `payment_method` permission must be included. type PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermission string @@ -1011,6 +1023,8 @@ type PaymentIntentPaymentMethodDataParams struct { SEPADebit *PaymentMethodSEPADebitParams `form:"sepa_debit"` // If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. Sofort *PaymentMethodSofortParams `form:"sofort"` + // If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + Swish *PaymentMethodSwishParams `form:"swish"` // The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. Type *string `form:"type"` // If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. @@ -1634,6 +1648,20 @@ type PaymentIntentPaymentMethodOptionsSofortParams struct { SetupFutureUsage *string `form:"setup_future_usage"` } +// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. +type PaymentIntentPaymentMethodOptionsSwishParams struct { + // The order ID displayed in the Swish app after the payment is authorized. + Reference *string `form:"reference"` + // Indicates that you intend to make future payments with this PaymentIntent's payment method. + // + // Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + // + // When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + // + // If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + SetupFutureUsage *string `form:"setup_future_usage"` +} + // Additional fields for Financial Connections Session creation type PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsParams struct { // The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. @@ -1770,6 +1798,8 @@ type PaymentIntentPaymentMethodOptionsParams struct { SEPADebit *PaymentIntentPaymentMethodOptionsSEPADebitParams `form:"sepa_debit"` // If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. Sofort *PaymentIntentPaymentMethodOptionsSofortParams `form:"sofort"` + // If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. + Swish *PaymentIntentPaymentMethodOptionsSwishParams `form:"swish"` // If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. USBankAccount *PaymentIntentPaymentMethodOptionsUSBankAccountParams `form:"us_bank_account"` // If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. @@ -2420,6 +2450,21 @@ type PaymentIntentNextActionRedirectToURL struct { // The URL you must redirect your customer to in order to authenticate the payment. URL string `json:"url"` } +type PaymentIntentNextActionSwishHandleRedirectOrDisplayQRCodeQRCode struct { + // The raw data string used to generate QR code, it should be used together with QR code library. + Data string `json:"data"` + // The image_url_png string used to render QR code + ImageURLPNG string `json:"image_url_png"` + // The image_url_svg string used to render QR code + ImageURLSVG string `json:"image_url_svg"` +} +type PaymentIntentNextActionSwishHandleRedirectOrDisplayQRCode struct { + // The URL to the hosted Swish instructions page, which allows customers to view the QR code. + HostedInstructionsURL string `json:"hosted_instructions_url"` + // The url for mobile redirect based auth + MobileAuthURL string `json:"mobile_auth_url"` + QRCode *PaymentIntentNextActionSwishHandleRedirectOrDisplayQRCodeQRCode `json:"qr_code"` +} // When confirming a PaymentIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js. type PaymentIntentNextActionUseStripeSDK struct{} @@ -2477,6 +2522,7 @@ type PaymentIntentNextAction struct { PixDisplayQRCode *PaymentIntentNextActionPixDisplayQRCode `json:"pix_display_qr_code"` PromptPayDisplayQRCode *PaymentIntentNextActionPromptPayDisplayQRCode `json:"promptpay_display_qr_code"` RedirectToURL *PaymentIntentNextActionRedirectToURL `json:"redirect_to_url"` + SwishHandleRedirectOrDisplayQRCode *PaymentIntentNextActionSwishHandleRedirectOrDisplayQRCode `json:"swish_handle_redirect_or_display_qr_code"` // 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`. Type PaymentIntentNextActionType `json:"type"` // When confirming a PaymentIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js. @@ -2864,6 +2910,16 @@ type PaymentIntentPaymentMethodOptionsSofort struct { // When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). SetupFutureUsage PaymentIntentPaymentMethodOptionsSofortSetupFutureUsage `json:"setup_future_usage"` } +type PaymentIntentPaymentMethodOptionsSwish struct { + // The order ID displayed in the Swish app after the payment is authorized. + Reference string `json:"reference"` + // Indicates that you intend to make future payments with this PaymentIntent's payment method. + // + // Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + // + // When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + SetupFutureUsage PaymentIntentPaymentMethodOptionsSwishSetupFutureUsage `json:"setup_future_usage"` +} type PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnections struct { // The list of permissions to request. The `payment_method` permission must be included. Permissions []PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPermission `json:"permissions"` @@ -2944,6 +3000,7 @@ type PaymentIntentPaymentMethodOptions struct { RevolutPay *PaymentIntentPaymentMethodOptionsRevolutPay `json:"revolut_pay"` SEPADebit *PaymentIntentPaymentMethodOptionsSEPADebit `json:"sepa_debit"` Sofort *PaymentIntentPaymentMethodOptionsSofort `json:"sofort"` + Swish *PaymentIntentPaymentMethodOptionsSwish `json:"swish"` USBankAccount *PaymentIntentPaymentMethodOptionsUSBankAccount `json:"us_bank_account"` WeChatPay *PaymentIntentPaymentMethodOptionsWeChatPay `json:"wechat_pay"` Zip *PaymentIntentPaymentMethodOptionsZip `json:"zip"` diff --git a/paymentlink.go b/paymentlink.go index dbfe1bf784..b5938efbd8 100644 --- a/paymentlink.go +++ b/paymentlink.go @@ -159,6 +159,7 @@ const ( PaymentLinkPaymentMethodTypePromptPay PaymentLinkPaymentMethodType = "promptpay" PaymentLinkPaymentMethodTypeSEPADebit PaymentLinkPaymentMethodType = "sepa_debit" PaymentLinkPaymentMethodTypeSofort PaymentLinkPaymentMethodType = "sofort" + PaymentLinkPaymentMethodTypeSwish PaymentLinkPaymentMethodType = "swish" PaymentLinkPaymentMethodTypeUSBankAccount PaymentLinkPaymentMethodType = "us_bank_account" PaymentLinkPaymentMethodTypeWeChatPay PaymentLinkPaymentMethodType = "wechat_pay" ) diff --git a/paymentmethod.go b/paymentmethod.go index b88e0c8ceb..748e8a91c6 100644 --- a/paymentmethod.go +++ b/paymentmethod.go @@ -73,7 +73,7 @@ const ( PaymentMethodCardNetworksAvailableUnknown PaymentMethodCardNetworksAvailable = "unknown" ) -// The preferred network for the card. +// The preferred network for the card. Can be `cartes_bancaires`, `mastercard`, `visa` or `invalid_preference` if requested network is not valid for the card. type PaymentMethodCardNetworksPreferred string // List of values that PaymentMethodCardNetworksPreferred can take @@ -173,6 +173,7 @@ const ( PaymentMethodTypeRevolutPay PaymentMethodType = "revolut_pay" PaymentMethodTypeSEPADebit PaymentMethodType = "sepa_debit" PaymentMethodTypeSofort PaymentMethodType = "sofort" + PaymentMethodTypeSwish PaymentMethodType = "swish" PaymentMethodTypeUSBankAccount PaymentMethodType = "us_bank_account" PaymentMethodTypeWeChatPay PaymentMethodType = "wechat_pay" PaymentMethodTypeZip PaymentMethodType = "zip" @@ -425,6 +426,9 @@ type PaymentMethodSofortParams struct { Country *string `form:"country"` } +// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. +type PaymentMethodSwishParams struct{} + // If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. type PaymentMethodUSBankAccountParams struct { // Account holder type: individual or company. @@ -518,6 +522,8 @@ type PaymentMethodParams struct { SEPADebit *PaymentMethodSEPADebitParams `form:"sepa_debit"` // If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. Sofort *PaymentMethodSofortParams `form:"sofort"` + // If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + Swish *PaymentMethodSwishParams `form:"swish"` // The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. Type *string `form:"type"` // If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. @@ -647,7 +653,7 @@ type PaymentMethodCardChecks struct { type PaymentMethodCardNetworks struct { // All available networks for the card. Available []PaymentMethodCardNetworksAvailable `json:"available"` - // The preferred network for the card. + // The preferred network for the card. Can be `cartes_bancaires`, `mastercard`, `visa` or `invalid_preference` if requested network is not valid for the card. Preferred PaymentMethodCardNetworksPreferred `json:"preferred"` } @@ -902,6 +908,7 @@ type PaymentMethodSofort struct { // Two-letter ISO code representing the country the bank account is located in. Country string `json:"country"` } +type PaymentMethodSwish struct{} // Contains information about US bank account networks that can be used. type PaymentMethodUSBankAccountNetworks struct { @@ -997,6 +1004,7 @@ type PaymentMethod struct { RevolutPay *PaymentMethodRevolutPay `json:"revolut_pay"` SEPADebit *PaymentMethodSEPADebit `json:"sepa_debit"` Sofort *PaymentMethodSofort `json:"sofort"` + Swish *PaymentMethodSwish `json:"swish"` // The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. Type PaymentMethodType `json:"type"` USBankAccount *PaymentMethodUSBankAccount `json:"us_bank_account"` diff --git a/refund.go b/refund.go index 8d1becd1c3..f7dcbec28e 100644 --- a/refund.go +++ b/refund.go @@ -204,6 +204,12 @@ type RefundDestinationDetailsPaypal struct{} type RefundDestinationDetailsPix struct{} type RefundDestinationDetailsRevolut struct{} type RefundDestinationDetailsSofort struct{} +type RefundDestinationDetailsSwish struct { + // The reference assigned to the refund. + Reference string `json:"reference"` + // Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + ReferenceStatus string `json:"reference_status"` +} type RefundDestinationDetailsTHBankTransfer struct { // The reference assigned to the refund. Reference string `json:"reference"` @@ -242,6 +248,7 @@ type RefundDestinationDetails struct { Pix *RefundDestinationDetailsPix `json:"pix"` Revolut *RefundDestinationDetailsRevolut `json:"revolut"` Sofort *RefundDestinationDetailsSofort `json:"sofort"` + Swish *RefundDestinationDetailsSwish `json:"swish"` THBankTransfer *RefundDestinationDetailsTHBankTransfer `json:"th_bank_transfer"` // The type of transaction-specific details of the payment method used in the refund (e.g., `card`). An additional hash is included on `destination_details` with a name matching this value. It contains information specific to the refund transaction. Type string `json:"type"` diff --git a/setupintent.go b/setupintent.go index 0e21504ce1..39931a2cc6 100644 --- a/setupintent.go +++ b/setupintent.go @@ -449,6 +449,9 @@ type SetupIntentPaymentMethodDataSofortParams struct { Country *string `form:"country"` } +// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. +type SetupIntentPaymentMethodDataSwishParams struct{} + // If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. type SetupIntentPaymentMethodDataUSBankAccountParams struct { // Account holder type: individual or company. @@ -536,6 +539,8 @@ type SetupIntentPaymentMethodDataParams struct { SEPADebit *SetupIntentPaymentMethodDataSEPADebitParams `form:"sepa_debit"` // If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. Sofort *SetupIntentPaymentMethodDataSofortParams `form:"sofort"` + // If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + Swish *SetupIntentPaymentMethodDataSwishParams `form:"swish"` // The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. Type *string `form:"type"` // If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. @@ -995,6 +1000,9 @@ type SetupIntentConfirmPaymentMethodDataSofortParams struct { Country *string `form:"country"` } +// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. +type SetupIntentConfirmPaymentMethodDataSwishParams struct{} + // If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. type SetupIntentConfirmPaymentMethodDataUSBankAccountParams struct { // Account holder type: individual or company. @@ -1082,6 +1090,8 @@ type SetupIntentConfirmPaymentMethodDataParams struct { SEPADebit *SetupIntentConfirmPaymentMethodDataSEPADebitParams `form:"sepa_debit"` // If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. Sofort *SetupIntentConfirmPaymentMethodDataSofortParams `form:"sofort"` + // If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + Swish *SetupIntentConfirmPaymentMethodDataSwishParams `form:"swish"` // The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. Type *string `form:"type"` // If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. diff --git a/subscription.go b/subscription.go index c059a40e11..6b3668a404 100644 --- a/subscription.go +++ b/subscription.go @@ -446,6 +446,8 @@ type SubscriptionInvoiceSettingsIssuerParams struct { // All invoices will be billed using the specified settings. type SubscriptionInvoiceSettingsParams struct { + // The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription. + AccountTaxIDs []*string `form:"account_tax_ids"` // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. Issuer *SubscriptionInvoiceSettingsIssuerParams `form:"issuer"` } diff --git a/subscriptionschedule.go b/subscriptionschedule.go index f08ba4cc78..eadabe9e49 100644 --- a/subscriptionschedule.go +++ b/subscriptionschedule.go @@ -122,6 +122,8 @@ type SubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerParams struct { // All invoices will be billed using the specified settings. type SubscriptionScheduleDefaultSettingsInvoiceSettingsParams struct { + // The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule. + AccountTaxIDs []*string `form:"account_tax_ids"` // Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `collection_method=charge_automatically`. DaysUntilDue *int64 `form:"days_until_due"` // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. @@ -191,6 +193,8 @@ type SubscriptionSchedulePhaseInvoiceSettingsIssuerParams struct { // All invoices will be billed using the specified settings. type SubscriptionSchedulePhaseInvoiceSettingsParams struct { + // The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. + AccountTaxIDs []*string `form:"account_tax_ids"` // Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. DaysUntilDue *int64 `form:"days_until_due"` // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. @@ -386,6 +390,8 @@ type SubscriptionScheduleDefaultSettingsInvoiceSettingsIssuer struct { Type SubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType `json:"type"` } type SubscriptionScheduleDefaultSettingsInvoiceSettings struct { + // The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule. + AccountTaxIDs []*TaxID `json:"account_tax_ids"` // Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. DaysUntilDue int64 `json:"days_until_due"` Issuer *SubscriptionScheduleDefaultSettingsInvoiceSettingsIssuer `json:"issuer"` @@ -431,6 +437,8 @@ type SubscriptionSchedulePhaseInvoiceSettingsIssuer struct { // The invoice settings applicable during this phase. type SubscriptionSchedulePhaseInvoiceSettings struct { + // The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. + AccountTaxIDs []*TaxID `json:"account_tax_ids"` // Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. DaysUntilDue int64 `json:"days_until_due"` // The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. diff --git a/tax_calculation.go b/tax_calculation.go index 287f1c71ad..25282d43de 100644 --- a/tax_calculation.go +++ b/tax_calculation.go @@ -248,7 +248,7 @@ type TaxCalculationCustomerDetailsParams struct { // A list of items the customer is purchasing. type TaxCalculationLineItemParams struct { - // A positive integer in cents representing the line item's total price. If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount. + // A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) representing the line item's total price. If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount. Amount *int64 `form:"amount"` // If provided, the product's `tax_code` will be used as the line item's `tax_code`. Product *string `form:"product"` @@ -264,7 +264,7 @@ type TaxCalculationLineItemParams struct { // Shipping cost details to be used for the calculation. type TaxCalculationShippingCostParams struct { - // A positive integer in cents representing the shipping charge. If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount. + // A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) representing the shipping charge. If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount. Amount *int64 `form:"amount"` // If provided, the [shipping rate](https://stripe.com/docs/api/shipping_rates/object)'s `amount`, `tax_code` and `tax_behavior` are used. If you provide a shipping rate, then you cannot pass the `amount`, `tax_code`, or `tax_behavior` parameters. ShippingRate *string `form:"shipping_rate"` @@ -340,14 +340,14 @@ type TaxCalculationShippingCostTaxBreakdownTaxRateDetails struct { // Detailed account of taxes relevant to shipping cost. type TaxCalculationShippingCostTaxBreakdown struct { - // The amount of tax, in integer cents. + // The amount of tax, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). Amount int64 `json:"amount"` Jurisdiction *TaxCalculationShippingCostTaxBreakdownJurisdiction `json:"jurisdiction"` // Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). Sourcing TaxCalculationShippingCostTaxBreakdownSourcing `json:"sourcing"` // The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. TaxabilityReason TaxCalculationShippingCostTaxBreakdownTaxabilityReason `json:"taxability_reason"` - // The amount on which tax is calculated, in integer cents. + // The amount on which tax is calculated, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). TaxableAmount int64 `json:"taxable_amount"` // Details regarding the rate for this tax. This field will be `null` when the tax is not imposed, for example if the product is exempt from tax. TaxRateDetails *TaxCalculationShippingCostTaxBreakdownTaxRateDetails `json:"tax_rate_details"` @@ -355,9 +355,9 @@ type TaxCalculationShippingCostTaxBreakdown struct { // The shipping cost details for the calculation. type TaxCalculationShippingCost struct { - // The shipping amount in integer cents. If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. + // The shipping amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. Amount int64 `json:"amount"` - // The amount of tax calculated for shipping, in integer cents. + // The amount of tax calculated for shipping, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). AmountTax int64 `json:"amount_tax"` // The ID of an existing [ShippingRate](https://stripe.com/docs/api/shipping_rates/object). ShippingRate string `json:"shipping_rate"` @@ -381,13 +381,13 @@ type TaxCalculationTaxBreakdownTaxRateDetails struct { // Breakdown of individual tax amounts that add up to the total. type TaxCalculationTaxBreakdown struct { - // The amount of tax, in integer cents. + // The amount of tax, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). Amount int64 `json:"amount"` // Specifies whether the tax amount is included in the line item amount. Inclusive bool `json:"inclusive"` // The reasoning behind this tax, for example, if the product is tax exempt. We might extend the possible values for this field to support new tax rules. TaxabilityReason TaxCalculationTaxBreakdownTaxabilityReason `json:"taxability_reason"` - // The amount on which tax is calculated, in integer cents. + // The amount on which tax is calculated, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). TaxableAmount int64 `json:"taxable_amount"` TaxRateDetails *TaxCalculationTaxBreakdownTaxRateDetails `json:"tax_rate_details"` } diff --git a/tax_calculationlineitem.go b/tax_calculationlineitem.go index 919103daee..6bf2fba4e7 100644 --- a/tax_calculationlineitem.go +++ b/tax_calculationlineitem.go @@ -100,22 +100,22 @@ type TaxCalculationLineItemTaxBreakdownTaxRateDetails struct { // Detailed account of taxes relevant to this line item. type TaxCalculationLineItemTaxBreakdown struct { - // The amount of tax, in integer cents. + // The amount of tax, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). Amount int64 `json:"amount"` Jurisdiction *TaxCalculationLineItemTaxBreakdownJurisdiction `json:"jurisdiction"` // Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). Sourcing TaxCalculationLineItemTaxBreakdownSourcing `json:"sourcing"` // The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. TaxabilityReason TaxCalculationLineItemTaxBreakdownTaxabilityReason `json:"taxability_reason"` - // The amount on which tax is calculated, in integer cents. + // The amount on which tax is calculated, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). TaxableAmount int64 `json:"taxable_amount"` // Details regarding the rate for this tax. This field will be `null` when the tax is not imposed, for example if the product is exempt from tax. TaxRateDetails *TaxCalculationLineItemTaxBreakdownTaxRateDetails `json:"tax_rate_details"` } type TaxCalculationLineItem struct { - // The line item amount in integer cents. If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. + // The line item amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. Amount int64 `json:"amount"` - // The amount of tax calculated for this line item, in integer cents. + // The amount of tax calculated for this line item, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). AmountTax int64 `json:"amount_tax"` // Unique identifier for the object. ID string `json:"id"` diff --git a/tax_transaction.go b/tax_transaction.go index e3163789fc..f442c06b5c 100644 --- a/tax_transaction.go +++ b/tax_transaction.go @@ -233,9 +233,9 @@ func (p *TaxTransactionCreateFromCalculationParams) AddMetadata(key string, valu // The line item amounts to reverse. type TaxTransactionCreateReversalLineItemParams struct { - // The amount to reverse, in negative integer cents. + // The amount to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. Amount *int64 `form:"amount"` - // The amount of tax to reverse, in negative integer cents. + // The amount of tax to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. AmountTax *int64 `form:"amount_tax"` // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Metadata map[string]string `form:"metadata"` @@ -258,9 +258,9 @@ func (p *TaxTransactionCreateReversalLineItemParams) AddMetadata(key string, val // The shipping cost to reverse. type TaxTransactionCreateReversalShippingCostParams struct { - // The amount to reverse, in negative integer cents. + // The amount to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. Amount *int64 `form:"amount"` - // The amount of tax to reverse, in negative integer cents. + // The amount of tax to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. AmountTax *int64 `form:"amount_tax"` } @@ -269,7 +269,7 @@ type TaxTransactionCreateReversalParams struct { Params `form:"*"` // Specifies which fields in the response should be expanded. Expand []*string `form:"expand"` - // A flat amount to reverse across the entire transaction, in negative integer cents. This value represents the total amount to refund from the transaction, including taxes. + // A flat amount to reverse across the entire transaction, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. This value represents the total amount to refund from the transaction, including taxes. FlatAmount *int64 `form:"flat_amount"` // The line item amounts to reverse. LineItems []*TaxTransactionCreateReversalLineItemParams `form:"line_items"` @@ -347,14 +347,14 @@ type TaxTransactionShippingCostTaxBreakdownTaxRateDetails struct { // Detailed account of taxes relevant to shipping cost. (It is not populated for the transaction resource object and will be removed in the next API version.) type TaxTransactionShippingCostTaxBreakdown struct { - // The amount of tax, in integer cents. + // The amount of tax, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). Amount int64 `json:"amount"` Jurisdiction *TaxTransactionShippingCostTaxBreakdownJurisdiction `json:"jurisdiction"` // Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). Sourcing TaxTransactionShippingCostTaxBreakdownSourcing `json:"sourcing"` // The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. TaxabilityReason TaxTransactionShippingCostTaxBreakdownTaxabilityReason `json:"taxability_reason"` - // The amount on which tax is calculated, in integer cents. + // The amount on which tax is calculated, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). TaxableAmount int64 `json:"taxable_amount"` // Details regarding the rate for this tax. This field will be `null` when the tax is not imposed, for example if the product is exempt from tax. TaxRateDetails *TaxTransactionShippingCostTaxBreakdownTaxRateDetails `json:"tax_rate_details"` @@ -362,9 +362,9 @@ type TaxTransactionShippingCostTaxBreakdown struct { // The shipping cost details for the transaction. type TaxTransactionShippingCost struct { - // The shipping amount in integer cents. If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. + // The shipping amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. Amount int64 `json:"amount"` - // The amount of tax calculated for shipping, in integer cents. + // The amount of tax calculated for shipping, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). AmountTax int64 `json:"amount_tax"` // The ID of an existing [ShippingRate](https://stripe.com/docs/api/shipping_rates/object). ShippingRate string `json:"shipping_rate"` diff --git a/tax_transactionlineitem.go b/tax_transactionlineitem.go index 272a171d08..c0f1f49199 100644 --- a/tax_transactionlineitem.go +++ b/tax_transactionlineitem.go @@ -30,9 +30,9 @@ type TaxTransactionLineItemReversal struct { OriginalLineItem string `json:"original_line_item"` } type TaxTransactionLineItem struct { - // The line item amount in integer cents. If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. + // The line item amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. Amount int64 `json:"amount"` - // The amount of tax calculated for this line item, in integer cents. + // The amount of tax calculated for this line item, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). AmountTax int64 `json:"amount_tax"` // Unique identifier for the object. ID string `json:"id"` diff --git a/taxid.go b/taxid.go index fd199c885b..e0785070c3 100644 --- a/taxid.go +++ b/taxid.go @@ -8,6 +8,17 @@ package stripe import "encoding/json" +// Type of owner referenced. +type TaxIDOwnerType string + +// List of values that TaxIDOwnerType can take +const ( + TaxIDOwnerTypeAccount TaxIDOwnerType = "account" + TaxIDOwnerTypeApplication TaxIDOwnerType = "application" + TaxIDOwnerTypeCustomer TaxIDOwnerType = "customer" + TaxIDOwnerTypeSelf TaxIDOwnerType = "self" +) + // Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. Note that some legacy tax IDs have type `unknown` type TaxIDType string @@ -123,6 +134,18 @@ func (p *TaxIDListParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } +// The account or customer the tax ID belongs to. +type TaxIDOwner struct { + // The account being referenced when `type` is `account`. + Account *Account `json:"account"` + // The Connect Application being referenced when `type` is `application`. + Application *Application `json:"application"` + // The customer being referenced when `type` is `customer`. + Customer *Customer `json:"customer"` + // Type of owner referenced. + Type TaxIDOwnerType `json:"type"` +} + // Tax ID verification information. type TaxIDVerification struct { // Verification status, one of `pending`, `verified`, `unverified`, or `unavailable`. @@ -152,6 +175,8 @@ type TaxID struct { Livemode bool `json:"livemode"` // String representing the object's type. Objects of the same type share the same value. Object string `json:"object"` + // The account or customer the tax ID belongs to. + Owner *TaxIDOwner `json:"owner"` // Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. Note that some legacy tax IDs have type `unknown` Type TaxIDType `json:"type"` // Value of the tax ID. diff --git a/taxid/client.go b/taxid/client.go index 8d1fa743b5..fd5ede8263 100644 --- a/taxid/client.go +++ b/taxid/client.go @@ -4,7 +4,7 @@ // // -// Package taxid provides the /customers/{customer}/tax_ids APIs +// Package taxid provides the /tax_ids APIs package taxid import ( @@ -15,7 +15,7 @@ import ( "github.com/stripe/stripe-go/v76/form" ) -// Client is used to invoke /customers/{customer}/tax_ids APIs. +// Client is used to invoke /tax_ids APIs. type Client struct { B stripe.Backend Key string diff --git a/taxrate.go b/taxrate.go index 8e97332f25..e9a9afd1c8 100644 --- a/taxrate.go +++ b/taxrate.go @@ -8,6 +8,19 @@ package stripe import "encoding/json" +// The level of the jurisdiction that imposes this tax rate. Will be `null` for manually defined tax rates. +type TaxRateJurisdictionLevel string + +// List of values that TaxRateJurisdictionLevel can take +const ( + TaxRateJurisdictionLevelCity TaxRateJurisdictionLevel = "city" + TaxRateJurisdictionLevelCountry TaxRateJurisdictionLevel = "country" + TaxRateJurisdictionLevelCounty TaxRateJurisdictionLevel = "county" + TaxRateJurisdictionLevelDistrict TaxRateJurisdictionLevel = "district" + TaxRateJurisdictionLevelMultiple TaxRateJurisdictionLevel = "multiple" + TaxRateJurisdictionLevelState TaxRateJurisdictionLevel = "state" +) + // The high-level tax type, such as `vat` or `sales_tax`. type TaxRateTaxType string @@ -114,6 +127,8 @@ type TaxRate struct { Inclusive bool `json:"inclusive"` // The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. Jurisdiction string `json:"jurisdiction"` + // The level of the jurisdiction that imposes this tax rate. Will be `null` for manually defined tax rates. + JurisdictionLevel TaxRateJurisdictionLevel `json:"jurisdiction_level"` // Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. Livemode bool `json:"livemode"` // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. diff --git a/terminal_reader.go b/terminal_reader.go index 23a77399ad..539a9691e0 100644 --- a/terminal_reader.go +++ b/terminal_reader.go @@ -58,6 +58,15 @@ const ( TerminalReaderDeviceTypeVerifoneP400 TerminalReaderDeviceType = "verifone_P400" ) +// The networking status of the reader. +type TerminalReaderStatus string + +// List of values that TerminalReaderStatus can take +const ( + TerminalReaderStatusOffline TerminalReaderStatus = "offline" + TerminalReaderStatusOnline TerminalReaderStatus = "online" +) + // Deletes a Reader object. type TerminalReaderParams struct { Params `form:"*"` @@ -375,7 +384,7 @@ type TerminalReader struct { // Serial number of the reader. SerialNumber string `json:"serial_number"` // The networking status of the reader. - Status string `json:"status"` + Status TerminalReaderStatus `json:"status"` } // TerminalReaderList is a list of Readers as retrieved from a list endpoint.