From 196340ab4ad6b140e92c013fce9e94b09ad4e98d Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 11:26:49 -0700 Subject: [PATCH 01/13] Update generated code (#1886) * Update generated code for v1117 * Update generated code for v1118 * Update generated code for v1120 * Update generated code for v1121 * Update generated code for v1123 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- billingportal_session.go | 2 +- confirmationtoken.go | 14 +++++ customersession.go | 122 +++++++++++++++++++++++++++++++++++++++ error.go | 5 -- issuing_card.go | 40 +++++++++++++ subscription/client.go | 12 ++-- 7 files changed, 184 insertions(+), 13 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index dbdf3c1cba..af6e368389 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1116 \ No newline at end of file +v1123 \ No newline at end of file diff --git a/billingportal_session.go b/billingportal_session.go index ad097fcc41..07ef744de6 100644 --- a/billingportal_session.go +++ b/billingportal_session.go @@ -253,7 +253,7 @@ type BillingPortalSessionFlow struct { // Create sessions on-demand when customers intend to manage their subscriptions // and billing details. // -// Learn more in the [integration guide](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal). +// Related guide: [Customer management](https://stripe.com/customer-management) type BillingPortalSession struct { APIResource // The configuration used by this session, describing the features available. diff --git a/confirmationtoken.go b/confirmationtoken.go index 835554486b..95886c7209 100644 --- a/confirmationtoken.go +++ b/confirmationtoken.go @@ -379,6 +379,18 @@ type ConfirmationTokenMandateData struct { // This hash contains details about the customer acceptance of the Mandate. CustomerAcceptance *ConfirmationTokenMandateDataCustomerAcceptance `json:"customer_acceptance"` } + +// This hash contains the card payment method options. +type ConfirmationTokenPaymentMethodOptionsCard struct { + // The `cvc_update` Token collected from the Payment Element. + CVCToken string `json:"cvc_token"` +} + +// Payment-method-specific configuration for this ConfirmationToken. +type ConfirmationTokenPaymentMethodOptions struct { + // This hash contains the card payment method options. + Card *ConfirmationTokenPaymentMethodOptionsCard `json:"card"` +} type ConfirmationTokenPaymentMethodPreviewACSSDebit struct { // Name of the bank associated with the bank account. BankName string `json:"bank_name"` @@ -915,6 +927,8 @@ type ConfirmationToken struct { Object string `json:"object"` // ID of the PaymentIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used. PaymentIntent string `json:"payment_intent"` + // Payment-method-specific configuration for this ConfirmationToken. + PaymentMethodOptions *ConfirmationTokenPaymentMethodOptions `json:"payment_method_options"` // Payment details collected by the Payment Element, used to create a PaymentMethod when a PaymentIntent or SetupIntent is confirmed with this ConfirmationToken. PaymentMethodPreview *ConfirmationTokenPaymentMethodPreview `json:"payment_method_preview"` // Return URL used to confirm the Intent. diff --git a/customersession.go b/customersession.go index 2c0c6ec622..8a67d08d97 100644 --- a/customersession.go +++ b/customersession.go @@ -6,12 +6,98 @@ package stripe +// A list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the Payment Element displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list. +// +// If not specified, defaults to ["always"]. In order to display all saved payment methods, specify ["always", "limited", "unspecified"]. +type CustomerSessionComponentsPaymentElementFeaturesPaymentMethodAllowRedisplayFilter string + +// List of values that CustomerSessionComponentsPaymentElementFeaturesPaymentMethodAllowRedisplayFilter can take +const ( + CustomerSessionComponentsPaymentElementFeaturesPaymentMethodAllowRedisplayFilterAlways CustomerSessionComponentsPaymentElementFeaturesPaymentMethodAllowRedisplayFilter = "always" + CustomerSessionComponentsPaymentElementFeaturesPaymentMethodAllowRedisplayFilterLimited CustomerSessionComponentsPaymentElementFeaturesPaymentMethodAllowRedisplayFilter = "limited" + CustomerSessionComponentsPaymentElementFeaturesPaymentMethodAllowRedisplayFilterUnspecified CustomerSessionComponentsPaymentElementFeaturesPaymentMethodAllowRedisplayFilter = "unspecified" +) + +// Controls whether or not the Payment Element shows saved payment methods. This parameter defaults to `disabled`. +type CustomerSessionComponentsPaymentElementFeaturesPaymentMethodRedisplay string + +// List of values that CustomerSessionComponentsPaymentElementFeaturesPaymentMethodRedisplay can take +const ( + CustomerSessionComponentsPaymentElementFeaturesPaymentMethodRedisplayDisabled CustomerSessionComponentsPaymentElementFeaturesPaymentMethodRedisplay = "disabled" + CustomerSessionComponentsPaymentElementFeaturesPaymentMethodRedisplayEnabled CustomerSessionComponentsPaymentElementFeaturesPaymentMethodRedisplay = "enabled" +) + +// Controls whether the Payment Element displays the option to remove a saved payment method. This parameter defaults to `disabled`. +// +// Allowing buyers to remove their saved payment methods impacts subscriptions that depend on that payment method. Removing the payment method detaches the [`customer` object](https://docs.stripe.com/api/payment_methods/object#payment_method_object-customer) from that [PaymentMethod](https://docs.stripe.com/api/payment_methods). +type CustomerSessionComponentsPaymentElementFeaturesPaymentMethodRemove string + +// List of values that CustomerSessionComponentsPaymentElementFeaturesPaymentMethodRemove can take +const ( + CustomerSessionComponentsPaymentElementFeaturesPaymentMethodRemoveDisabled CustomerSessionComponentsPaymentElementFeaturesPaymentMethodRemove = "disabled" + CustomerSessionComponentsPaymentElementFeaturesPaymentMethodRemoveEnabled CustomerSessionComponentsPaymentElementFeaturesPaymentMethodRemove = "enabled" +) + +// Controls whether the Payment Element displays a checkbox offering to save a new payment method. This parameter defaults to `disabled`. +// +// If a customer checks the box, the [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) value on the PaymentMethod is set to `'always'` at confirmation time. For PaymentIntents, the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value is also set to the value defined in `payment_method_save_usage`. +type CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSave string + +// List of values that CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSave can take +const ( + CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSaveDisabled CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSave = "disabled" + CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSaveEnabled CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSave = "enabled" +) + +// When using PaymentIntents and the customer checks the save checkbox, this field determines the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value used to confirm the PaymentIntent. +// +// When using SetupIntents, directly configure the [`usage`](https://docs.stripe.com/api/setup_intents/object#setup_intent_object-usage) value on SetupIntent creation. +type CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSaveUsage string + +// List of values that CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSaveUsage can take +const ( + CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSaveUsageOffSession CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSaveUsage = "off_session" + CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSaveUsageOnSession CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSaveUsage = "on_session" +) + // Configuration for buy button. type CustomerSessionComponentsBuyButtonParams struct { // Whether the buy button is enabled. Enabled *bool `form:"enabled"` } +// This hash defines whether the Payment Element supports certain features. +type CustomerSessionComponentsPaymentElementFeaturesParams struct { + // A list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the Payment Element displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list. + // + // If not specified, defaults to ["always"]. In order to display all saved payment methods, specify ["always", "limited", "unspecified"]. + PaymentMethodAllowRedisplayFilters []*string `form:"payment_method_allow_redisplay_filters"` + // Controls whether or not the Payment Element shows saved payment methods. This parameter defaults to `disabled`. + PaymentMethodRedisplay *string `form:"payment_method_redisplay"` + // Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `10`. + PaymentMethodRedisplayLimit *int64 `form:"payment_method_redisplay_limit"` + // Controls whether the Payment Element displays the option to remove a saved payment method. This parameter defaults to `disabled`. + // + // Allowing buyers to remove their saved payment methods impacts subscriptions that depend on that payment method. Removing the payment method detaches the [`customer` object](https://docs.stripe.com/api/payment_methods/object#payment_method_object-customer) from that [PaymentMethod](https://docs.stripe.com/api/payment_methods). + PaymentMethodRemove *string `form:"payment_method_remove"` + // Controls whether the Payment Element displays a checkbox offering to save a new payment method. This parameter defaults to `disabled`. + // + // If a customer checks the box, the [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) value on the PaymentMethod is set to `'always'` at confirmation time. For PaymentIntents, the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value is also set to the value defined in `payment_method_save_usage`. + PaymentMethodSave *string `form:"payment_method_save"` + // When using PaymentIntents and the customer checks the save checkbox, this field determines the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value used to confirm the PaymentIntent. + // + // When using SetupIntents, directly configure the [`usage`](https://docs.stripe.com/api/setup_intents/object#setup_intent_object-usage) value on SetupIntent creation. + PaymentMethodSaveUsage *string `form:"payment_method_save_usage"` +} + +// Configuration for the Payment Element. +type CustomerSessionComponentsPaymentElementParams struct { + // Whether the Payment Element is enabled. + Enabled *bool `form:"enabled"` + // This hash defines whether the Payment Element supports certain features. + Features *CustomerSessionComponentsPaymentElementFeaturesParams `form:"features"` +} + // Configuration for the pricing table. type CustomerSessionComponentsPricingTableParams struct { // Whether the pricing table is enabled. @@ -22,6 +108,8 @@ type CustomerSessionComponentsPricingTableParams struct { type CustomerSessionComponentsParams struct { // Configuration for buy button. BuyButton *CustomerSessionComponentsBuyButtonParams `form:"buy_button"` + // Configuration for the Payment Element. + PaymentElement *CustomerSessionComponentsPaymentElementParams `form:"payment_element"` // Configuration for the pricing table. PricingTable *CustomerSessionComponentsPricingTableParams `form:"pricing_table"` } @@ -48,6 +136,38 @@ type CustomerSessionComponentsBuyButton struct { Enabled bool `json:"enabled"` } +// This hash defines whether the Payment Element supports certain features. +type CustomerSessionComponentsPaymentElementFeatures struct { + // A list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the Payment Element displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list. + // + // If not specified, defaults to ["always"]. In order to display all saved payment methods, specify ["always", "limited", "unspecified"]. + PaymentMethodAllowRedisplayFilters []CustomerSessionComponentsPaymentElementFeaturesPaymentMethodAllowRedisplayFilter `json:"payment_method_allow_redisplay_filters"` + // Controls whether or not the Payment Element shows saved payment methods. This parameter defaults to `disabled`. + PaymentMethodRedisplay CustomerSessionComponentsPaymentElementFeaturesPaymentMethodRedisplay `json:"payment_method_redisplay"` + // Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `10`. + PaymentMethodRedisplayLimit int64 `json:"payment_method_redisplay_limit"` + // Controls whether the Payment Element displays the option to remove a saved payment method. This parameter defaults to `disabled`. + // + // Allowing buyers to remove their saved payment methods impacts subscriptions that depend on that payment method. Removing the payment method detaches the [`customer` object](https://docs.stripe.com/api/payment_methods/object#payment_method_object-customer) from that [PaymentMethod](https://docs.stripe.com/api/payment_methods). + PaymentMethodRemove CustomerSessionComponentsPaymentElementFeaturesPaymentMethodRemove `json:"payment_method_remove"` + // Controls whether the Payment Element displays a checkbox offering to save a new payment method. This parameter defaults to `disabled`. + // + // If a customer checks the box, the [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) value on the PaymentMethod is set to `'always'` at confirmation time. For PaymentIntents, the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value is also set to the value defined in `payment_method_save_usage`. + PaymentMethodSave CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSave `json:"payment_method_save"` + // When using PaymentIntents and the customer checks the save checkbox, this field determines the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value used to confirm the PaymentIntent. + // + // When using SetupIntents, directly configure the [`usage`](https://docs.stripe.com/api/setup_intents/object#setup_intent_object-usage) value on SetupIntent creation. + PaymentMethodSaveUsage CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSaveUsage `json:"payment_method_save_usage"` +} + +// This hash contains whether the Payment Element is enabled and the features it supports. +type CustomerSessionComponentsPaymentElement struct { + // Whether the Payment Element is enabled. + Enabled bool `json:"enabled"` + // This hash defines whether the Payment Element supports certain features. + Features *CustomerSessionComponentsPaymentElementFeatures `json:"features"` +} + // This hash contains whether the pricing table is enabled. type CustomerSessionComponentsPricingTable struct { // Whether the pricing table is enabled. @@ -58,6 +178,8 @@ type CustomerSessionComponentsPricingTable struct { type CustomerSessionComponents struct { // This hash contains whether the buy button is enabled. BuyButton *CustomerSessionComponentsBuyButton `json:"buy_button"` + // This hash contains whether the Payment Element is enabled and the features it supports. + PaymentElement *CustomerSessionComponentsPaymentElement `json:"payment_element"` // This hash contains whether the pricing table is enabled. PricingTable *CustomerSessionComponentsPricingTable `json:"pricing_table"` } diff --git a/error.go b/error.go index 1b115f3a22..1ed3cfefd7 100644 --- a/error.go +++ b/error.go @@ -46,10 +46,6 @@ const ( ErrorCodeBankAccountUnverified ErrorCode = "bank_account_unverified" ErrorCodeBankAccountVerificationFailed ErrorCode = "bank_account_verification_failed" ErrorCodeBillingInvalidMandate ErrorCode = "billing_invalid_mandate" - ErrorCodeBillingPolicyRemoteFunctionResponseInvalid ErrorCode = "billing_policy_remote_function_response_invalid" - ErrorCodeBillingPolicyRemoteFunctionTimeout ErrorCode = "billing_policy_remote_function_timeout" - ErrorCodeBillingPolicyRemoteFunctionUnexpectedStatusCode ErrorCode = "billing_policy_remote_function_unexpected_status_code" - ErrorCodeBillingPolicyRemoteFunctionUnreachable ErrorCode = "billing_policy_remote_function_unreachable" ErrorCodeBitcoinUpgradeRequired ErrorCode = "bitcoin_upgrade_required" ErrorCodeCaptureChargeAuthorizationExpired ErrorCode = "capture_charge_authorization_expired" ErrorCodeCaptureUnauthorizedPayment ErrorCode = "capture_unauthorized_payment" @@ -123,7 +119,6 @@ const ( ErrorCodeParametersExclusive ErrorCode = "parameters_exclusive" ErrorCodePaymentIntentActionRequired ErrorCode = "payment_intent_action_required" ErrorCodePaymentIntentAuthenticationFailure ErrorCode = "payment_intent_authentication_failure" - ErrorCodePaymentIntentFxQuoteInvalid ErrorCode = "payment_intent_fx_quote_invalid" ErrorCodePaymentIntentIncompatiblePaymentMethod ErrorCode = "payment_intent_incompatible_payment_method" ErrorCodePaymentIntentInvalidParameter ErrorCode = "payment_intent_invalid_parameter" ErrorCodePaymentIntentKonbiniRejectedConfirmationNumber ErrorCode = "payment_intent_konbini_rejected_confirmation_number" diff --git a/issuing_card.go b/issuing_card.go index e9ff10831a..5f7fc53de1 100644 --- a/issuing_card.go +++ b/issuing_card.go @@ -29,6 +29,26 @@ const ( IssuingCardReplacementReasonStolen IssuingCardReplacementReason = "stolen" ) +// The address validation capabilities to use. +type IssuingCardShippingAddressValidationMode string + +// List of values that IssuingCardShippingAddressValidationMode can take +const ( + IssuingCardShippingAddressValidationModeDisabled IssuingCardShippingAddressValidationMode = "disabled" + IssuingCardShippingAddressValidationModeNormalizationOnly IssuingCardShippingAddressValidationMode = "normalization_only" + IssuingCardShippingAddressValidationModeValidationAndNormalization IssuingCardShippingAddressValidationMode = "validation_and_normalization" +) + +// The validation result for the shipping address. +type IssuingCardShippingAddressValidationResult string + +// List of values that IssuingCardShippingAddressValidationResult can take +const ( + IssuingCardShippingAddressValidationResultIndeterminate IssuingCardShippingAddressValidationResult = "indeterminate" + IssuingCardShippingAddressValidationResultLikelyDeliverable IssuingCardShippingAddressValidationResult = "likely_deliverable" + IssuingCardShippingAddressValidationResultLikelyUndeliverable IssuingCardShippingAddressValidationResult = "likely_undeliverable" +) + // The delivery company that shipped a card. type IssuingCardShippingCarrier string @@ -159,6 +179,12 @@ type IssuingCardPINParams struct { EncryptedNumber *string `form:"encrypted_number"` } +// Address validation settings. +type IssuingCardShippingAddressValidationParams struct { + // The address validation capabilities to use. + Mode *string `form:"mode"` +} + // Customs information for the shipment. type IssuingCardShippingCustomsParams struct { // The Economic Operators Registration and Identification (EORI) number to use for Customs. Required for bulk shipments to Europe. @@ -169,6 +195,8 @@ type IssuingCardShippingCustomsParams struct { type IssuingCardShippingParams struct { // The address that the card is shipped to. Address *AddressParams `form:"address"` + // Address validation settings. + AddressValidation *IssuingCardShippingAddressValidationParams `form:"address_validation"` // Customs information for the shipment. Customs *IssuingCardShippingCustomsParams `form:"customs"` // The name printed on the shipping label when shipping the card. @@ -256,6 +284,16 @@ func (p *IssuingCardParams) AddMetadata(key string, value string) { p.Metadata[key] = value } +// Address validation details for the shipment. +type IssuingCardShippingAddressValidation struct { + // The address validation capabilities to use. + Mode IssuingCardShippingAddressValidationMode `json:"mode"` + // The normalized shipping address. + NormalizedAddress *Address `json:"normalized_address"` + // The validation result for the shipping address. + Result IssuingCardShippingAddressValidationResult `json:"result"` +} + // Additional information that may be required for clearing customs. type IssuingCardShippingCustoms struct { // A registration number used for customs in Europe. See [https://www.gov.uk/eori](https://www.gov.uk/eori) for the UK and [https://ec.europa.eu/taxation_customs/business/customs-procedures-import-and-export/customs-procedures/economic-operators-registration-and-identification-number-eori_en](https://ec.europa.eu/taxation_customs/business/customs-procedures-import-and-export/customs-procedures/economic-operators-registration-and-identification-number-eori_en) for the EU. @@ -265,6 +303,8 @@ type IssuingCardShippingCustoms struct { // Where and how the card will be shipped. type IssuingCardShipping struct { Address *Address `json:"address"` + // Address validation details for the shipment. + AddressValidation *IssuingCardShippingAddressValidation `json:"address_validation"` // The delivery company that shipped a card. Carrier IssuingCardShippingCarrier `json:"carrier"` // Additional information that may be required for clearing customs. diff --git a/subscription/client.go b/subscription/client.go index 229805d5e9..638891c786 100644 --- a/subscription/client.go +++ b/subscription/client.go @@ -65,17 +65,17 @@ func (c Client) Get(id string, params *stripe.SubscriptionParams) (*stripe.Subsc // Updates an existing subscription to match the specified parameters. // When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes. -// To preview how the proration is calculated, use the [upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) endpoint. +// To preview how the proration is calculated, use the [create preview](https://stripe.com/docs/api/invoices/create_preview) endpoint. // // By default, we prorate subscription changes. For example, if a customer signs up on May 1 for a 100 price, they'll be billed 100 immediately. If on May 15 they switch to a 200 price, then on June 1 they'll be billed 250 (200 for a renewal of her subscription, plus a 50 prorating adjustment for half of the previous month's 100 difference). Similarly, a downgrade generates a credit that is applied to the next invoice. We also prorate when you make quantity changes. // // Switching prices does not normally change the billing date or generate an immediate charge unless: // // The billing interval is changed (for example, from monthly to yearly). -// The subscription moves from free to paid, or paid to free. +// The subscription moves from free to paid. // A trial starts or ends. // -// In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. +// In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. Learn about how [Stripe immediately attempts payment for subscription changes](https://stripe.com/billing/subscriptions/upgrade-downgrade#immediate-payment). // // If you want to charge for an upgrade immediately, pass proration_behavior as always_invoice to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription's renewal date, you need to manually [invoice the customer](https://stripe.com/docs/api/invoices/create). // @@ -88,17 +88,17 @@ func Update(id string, params *stripe.SubscriptionParams) (*stripe.Subscription, // Updates an existing subscription to match the specified parameters. // When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes. -// To preview how the proration is calculated, use the [upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) endpoint. +// To preview how the proration is calculated, use the [create preview](https://stripe.com/docs/api/invoices/create_preview) endpoint. // // By default, we prorate subscription changes. For example, if a customer signs up on May 1 for a 100 price, they'll be billed 100 immediately. If on May 15 they switch to a 200 price, then on June 1 they'll be billed 250 (200 for a renewal of her subscription, plus a 50 prorating adjustment for half of the previous month's 100 difference). Similarly, a downgrade generates a credit that is applied to the next invoice. We also prorate when you make quantity changes. // // Switching prices does not normally change the billing date or generate an immediate charge unless: // // The billing interval is changed (for example, from monthly to yearly). -// The subscription moves from free to paid, or paid to free. +// The subscription moves from free to paid. // A trial starts or ends. // -// In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. +// In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. Learn about how [Stripe immediately attempts payment for subscription changes](https://stripe.com/billing/subscriptions/upgrade-downgrade#immediate-payment). // // If you want to charge for an upgrade immediately, pass proration_behavior as always_invoice to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription's renewal date, you need to manually [invoice the customer](https://stripe.com/docs/api/invoices/create). // From 083c24ad7c657d286c06e1c9d818342e148e9d28 Mon Sep 17 00:00:00 2001 From: David Brownman Date: Thu, 11 Jul 2024 11:46:00 -0700 Subject: [PATCH 02/13] Bump version to 79.3.0 --- CHANGELOG.md | 8 ++++++++ VERSION | 2 +- stripe.go | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 593e730b28..5ad9678199 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 79.3.0 - 2024-07-11 +* [#1886](https://github.com/stripe/stripe-go/pull/1886) Update generated code + * Remove support for values `billing_policy_remote_function_response_invalid`, `billing_policy_remote_function_timeout`, `billing_policy_remote_function_unexpected_status_code`, `billing_policy_remote_function_unreachable`, and `payment_intent_fx_quote_invalid` from enums `InvoiceLastFinalizationErrorCode`, `PaymentIntentLastPaymentErrorCode`, `SetupAttemptSetupErrorCode`, `SetupIntentLastSetupErrorCode`, and `StripeErrorCode` + * Add support for `PaymentMethodOptions` on `ConfirmationToken` + * Add support for `PaymentElement` on `CustomerSessionComponentsParams` and `CustomerSessionComponents` + * Add support for `AddressValidation` on `IssuingCardShippingParams` and `IssuingCardShipping` + * Add support for `Shipping` on `IssuingCardParams` + ## 79.2.0 - 2024-07-05 * [#1881](https://github.com/stripe/stripe-go/pull/1881) Update generated code * Add support for `AddLines`, `RemoveLines`, and `UpdateLines` methods on resource `Invoice` diff --git a/VERSION b/VERSION index 587ca66a10..ec15f5d7c6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -79.2.0 +79.3.0 diff --git a/stripe.go b/stripe.go index bb12148788..8032979589 100644 --- a/stripe.go +++ b/stripe.go @@ -1279,7 +1279,7 @@ func StringSlice(v []string) []*string { // // clientversion is the binding version -const clientversion = "79.2.0" +const clientversion = "79.3.0" // defaultHTTPTimeout is the default timeout on the http.Client used by the library. // This is chosen to be consistent with the other Stripe language libraries and From 21a782cf5ec285f1827359c039b166dc8933bad9 Mon Sep 17 00:00:00 2001 From: prathmesh-stripe <165320323+prathmesh-stripe@users.noreply.github.com> Date: Thu, 11 Jul 2024 16:55:52 -0400 Subject: [PATCH 03/13] Update changelog (#1888) --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ad9678199..6c607829b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ ## 79.3.0 - 2024-07-11 * [#1886](https://github.com/stripe/stripe-go/pull/1886) Update generated code - * Remove support for values `billing_policy_remote_function_response_invalid`, `billing_policy_remote_function_timeout`, `billing_policy_remote_function_unexpected_status_code`, `billing_policy_remote_function_unreachable`, and `payment_intent_fx_quote_invalid` from enums `InvoiceLastFinalizationErrorCode`, `PaymentIntentLastPaymentErrorCode`, `SetupAttemptSetupErrorCode`, `SetupIntentLastSetupErrorCode`, and `StripeErrorCode` + * ⚠️ Remove support for values `billing_policy_remote_function_response_invalid`, `billing_policy_remote_function_timeout`, `billing_policy_remote_function_unexpected_status_code`, and `billing_policy_remote_function_unreachable` from enums `InvoiceLastFinalizationErrorCode`, `PaymentIntentLastPaymentErrorCode`, `SetupAttemptSetupErrorCode`, `SetupIntentLastSetupErrorCode`, and `StripeErrorCode`. + * ⚠️ Remove support for value `payment_intent_fx_quote_invalid` from enum `StripeErrorCode`. The was mistakenly released last week. * Add support for `PaymentMethodOptions` on `ConfirmationToken` * Add support for `PaymentElement` on `CustomerSessionComponentsParams` and `CustomerSessionComponents` * Add support for `AddressValidation` on `IssuingCardShippingParams` and `IssuingCardShipping` From 044767bc56c2ecb1c02d7a2b1f919138b8e3da2a Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2024 05:07:31 +0000 Subject: [PATCH 04/13] Update generated code for v1126 --- OPENAPI_VERSION | 2 +- identity_verificationreport.go | 2 +- paymentmethoddomain.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index d8e31113a1..c903c35171 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1125 \ No newline at end of file +v1126 \ No newline at end of file diff --git a/identity_verificationreport.go b/identity_verificationreport.go index 7b16b4e668..f945716aaa 100644 --- a/identity_verificationreport.go +++ b/identity_verificationreport.go @@ -359,7 +359,7 @@ type IdentityVerificationReportSelfie struct { // API. To configure and create VerificationReports, use the // [VerificationSession](https://stripe.com/docs/api/identity/verification_sessions) API. // -// Related guides: [Accessing verification results](https://stripe.com/docs/identity/verification-sessions#results). +// Related guide: [Accessing verification results](https://stripe.com/docs/identity/verification-sessions#results). type IdentityVerificationReport struct { APIResource // A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. diff --git a/paymentmethoddomain.go b/paymentmethoddomain.go index 2630ed6871..3873191eab 100644 --- a/paymentmethoddomain.go +++ b/paymentmethoddomain.go @@ -150,7 +150,7 @@ type PaymentMethodDomainPaypal struct { // A payment method domain represents a web domain that you have registered with Stripe. // Stripe Elements use registered payment method domains to control where certain payment methods are shown. // -// Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). +// Related guide: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). type PaymentMethodDomain struct { APIResource // Indicates the status of a specific payment method on a payment method domain. From e53764e3ff645e4cdcbb35c5b8dde9d707cbefac Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2024 16:59:16 +0000 Subject: [PATCH 05/13] Update generated code for v1127 --- OPENAPI_VERSION | 2 +- subscription.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index c903c35171..e4da612756 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1126 \ No newline at end of file +v1127 \ No newline at end of file diff --git a/subscription.go b/subscription.go index e9536a15b3..755da4d8ab 100644 --- a/subscription.go +++ b/subscription.go @@ -214,7 +214,7 @@ const ( SubscriptionPaymentSettingsPaymentMethodTypeWeChatPay SubscriptionPaymentSettingsPaymentMethodType = "wechat_pay" ) -// Either `off`, or `on_subscription`. With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. +// Configure whether Stripe updates `subscription.default_payment_method` when payment succeeds. Defaults to `off`. type SubscriptionPaymentSettingsSaveDefaultPaymentMethod string // List of values that SubscriptionPaymentSettingsSaveDefaultPaymentMethod can take @@ -717,7 +717,7 @@ type SubscriptionPaymentSettingsParams struct { PaymentMethodOptions *SubscriptionPaymentSettingsPaymentMethodOptionsParams `form:"payment_method_options"` // The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). PaymentMethodTypes []*string `form:"payment_method_types"` - // Either `off`, or `on_subscription`. With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. + // Configure whether Stripe updates `subscription.default_payment_method` when payment succeeds. Defaults to `off` if unspecified. SaveDefaultPaymentMethod *string `form:"save_default_payment_method"` } @@ -1016,7 +1016,7 @@ type SubscriptionPaymentSettings struct { PaymentMethodOptions *SubscriptionPaymentSettingsPaymentMethodOptions `json:"payment_method_options"` // The list of payment method types to provide to every invoice created by the subscription. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). PaymentMethodTypes []SubscriptionPaymentSettingsPaymentMethodType `json:"payment_method_types"` - // Either `off`, or `on_subscription`. With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. + // Configure whether Stripe updates `subscription.default_payment_method` when payment succeeds. Defaults to `off`. SaveDefaultPaymentMethod SubscriptionPaymentSettingsSaveDefaultPaymentMethod `json:"save_default_payment_method"` } From 1f6aa2fd01254974d218a276f19cadf1b6d2b28a Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2024 19:13:10 +0000 Subject: [PATCH 06/13] Update generated code for v1128 --- OPENAPI_VERSION | 2 +- confirmationtoken.go | 24 +++++++++++++----------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index e4da612756..b157acd308 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1127 \ No newline at end of file +v1128 \ No newline at end of file diff --git a/confirmationtoken.go b/confirmationtoken.go index 48a539c27b..fd4d5f66e4 100644 --- a/confirmationtoken.go +++ b/confirmationtoken.go @@ -882,17 +882,19 @@ type ConfirmationTokenPaymentMethodPreview struct { AfterpayClearpay *ConfirmationTokenPaymentMethodPreviewAfterpayClearpay `json:"afterpay_clearpay"` Alipay *ConfirmationTokenPaymentMethodPreviewAlipay `json:"alipay"` // This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”. - AllowRedisplay ConfirmationTokenPaymentMethodPreviewAllowRedisplay `json:"allow_redisplay"` - AmazonPay *ConfirmationTokenPaymentMethodPreviewAmazonPay `json:"amazon_pay"` - AUBECSDebit *ConfirmationTokenPaymentMethodPreviewAUBECSDebit `json:"au_becs_debit"` - BACSDebit *ConfirmationTokenPaymentMethodPreviewBACSDebit `json:"bacs_debit"` - Bancontact *ConfirmationTokenPaymentMethodPreviewBancontact `json:"bancontact"` - BillingDetails *ConfirmationTokenPaymentMethodPreviewBillingDetails `json:"billing_details"` - BLIK *ConfirmationTokenPaymentMethodPreviewBLIK `json:"blik"` - Boleto *ConfirmationTokenPaymentMethodPreviewBoleto `json:"boleto"` - Card *ConfirmationTokenPaymentMethodPreviewCard `json:"card"` - CardPresent *ConfirmationTokenPaymentMethodPreviewCardPresent `json:"card_present"` - CashApp *ConfirmationTokenPaymentMethodPreviewCashApp `json:"cashapp"` + AllowRedisplay ConfirmationTokenPaymentMethodPreviewAllowRedisplay `json:"allow_redisplay"` + AmazonPay *ConfirmationTokenPaymentMethodPreviewAmazonPay `json:"amazon_pay"` + AUBECSDebit *ConfirmationTokenPaymentMethodPreviewAUBECSDebit `json:"au_becs_debit"` + BACSDebit *ConfirmationTokenPaymentMethodPreviewBACSDebit `json:"bacs_debit"` + Bancontact *ConfirmationTokenPaymentMethodPreviewBancontact `json:"bancontact"` + BillingDetails *ConfirmationTokenPaymentMethodPreviewBillingDetails `json:"billing_details"` + BLIK *ConfirmationTokenPaymentMethodPreviewBLIK `json:"blik"` + Boleto *ConfirmationTokenPaymentMethodPreviewBoleto `json:"boleto"` + Card *ConfirmationTokenPaymentMethodPreviewCard `json:"card"` + CardPresent *ConfirmationTokenPaymentMethodPreviewCardPresent `json:"card_present"` + CashApp *ConfirmationTokenPaymentMethodPreviewCashApp `json:"cashapp"` + // The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer. + Customer *Customer `json:"customer"` CustomerBalance *ConfirmationTokenPaymentMethodPreviewCustomerBalance `json:"customer_balance"` EPS *ConfirmationTokenPaymentMethodPreviewEPS `json:"eps"` FPX *ConfirmationTokenPaymentMethodPreviewFPX `json:"fpx"` From 1e2059fe1aa7b0c538d3692e7abbf33291e47161 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2024 20:41:28 +0000 Subject: [PATCH 07/13] Update generated code for v1129 --- OPENAPI_VERSION | 2 +- account.go | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index b157acd308..520404f9f7 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1128 \ No newline at end of file +v1129 \ No newline at end of file diff --git a/account.go b/account.go index 57d4b2efa8..593d820e76 100644 --- a/account.go +++ b/account.go @@ -959,6 +959,14 @@ type AccountSettingsBrandingParams struct { SecondaryColor *string `form:"secondary_color"` } +// Settings specific to the account's use of the Capital product. +type AccountSettingsCapitalParams struct { + // Per-currency mapping of user-selected destination accounts used to pay out loans. + PayoutDestination map[string]string `form:"payout_destination"` + // Per-currency mapping of all destination accounts eligible to receive Capital financing payouts. + PayoutDestinationSelector map[string][]*string `form:"payout_destination_selector"` +} + // Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://docs.stripe.com/issuing/connect/tos_acceptance). type AccountSettingsCardIssuingTOSAcceptanceParams struct { // The Unix timestamp marking when the account representative accepted the service agreement. @@ -1069,6 +1077,8 @@ type AccountSettingsParams struct { BACSDebitPayments *AccountSettingsBACSDebitPaymentsParams `form:"bacs_debit_payments"` // Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. Branding *AccountSettingsBrandingParams `form:"branding"` + // Settings specific to the account's use of the Capital product. + Capital *AccountSettingsCapitalParams `form:"capital"` // Settings specific to the account's use of the Card Issuing product. CardIssuing *AccountSettingsCardIssuingParams `form:"card_issuing"` // Settings specific to card charging on the account. @@ -1556,6 +1566,12 @@ type AccountSettingsBranding struct { // A CSS hex color value representing the secondary branding color for this account SecondaryColor string `json:"secondary_color"` } +type AccountSettingsCapital struct { + // Per-currency mapping of user-selected destination accounts used to pay out loans. + PayoutDestination map[string]string `json:"payout_destination"` + // Per-currency mapping of all destination accounts eligible to receive loan payouts. + PayoutDestinationSelector map[string][]string `json:"payout_destination_selector"` +} type AccountSettingsCardIssuingTOSAcceptance struct { // The Unix timestamp marking when the account representative accepted the service agreement. Date int64 `json:"date"` @@ -1645,6 +1661,7 @@ type AccountSettingsTreasury struct { type AccountSettings struct { BACSDebitPayments *AccountSettingsBACSDebitPayments `json:"bacs_debit_payments"` Branding *AccountSettingsBranding `json:"branding"` + Capital *AccountSettingsCapital `json:"capital"` CardIssuing *AccountSettingsCardIssuing `json:"card_issuing"` CardPayments *AccountSettingsCardPayments `json:"card_payments"` Dashboard *AccountSettingsDashboard `json:"dashboard"` From 7b2ab899c6a6ab69b994c93c0ef68d229239051f Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 08:40:14 +0000 Subject: [PATCH 08/13] Update generated code for v1130 --- OPENAPI_VERSION | 2 +- client/api.go | 4 ++ paymentintent.go | 113 +++++++++++++++++++++++++++++++++++++- tax/association/client.go | 42 ++++++++++++++ tax_association.go | 111 +++++++++++++++++++++++++++++++++++++ 5 files changed, 270 insertions(+), 2 deletions(-) create mode 100644 tax/association/client.go create mode 100644 tax_association.go diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 520404f9f7..0233d4f05b 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1129 \ No newline at end of file +v1130 \ No newline at end of file diff --git a/client/api.go b/client/api.go index c51e0068f8..9581e44f6b 100644 --- a/client/api.go +++ b/client/api.go @@ -113,6 +113,7 @@ import ( "github.com/stripe/stripe-go/v79/subscription" "github.com/stripe/stripe-go/v79/subscriptionitem" "github.com/stripe/stripe-go/v79/subscriptionschedule" + taxassociation "github.com/stripe/stripe-go/v79/tax/association" taxcalculation "github.com/stripe/stripe-go/v79/tax/calculation" taxform "github.com/stripe/stripe-go/v79/tax/form" taxregistration "github.com/stripe/stripe-go/v79/tax/registration" @@ -368,6 +369,8 @@ type API struct { Subscriptions *subscription.Client // SubscriptionSchedules is the client used to invoke /subscription_schedules APIs. SubscriptionSchedules *subscriptionschedule.Client + // TaxAssociations is the client used to invoke association related APIs. + TaxAssociations *taxassociation.Client // TaxCalculations is the client used to invoke /tax/calculations APIs. TaxCalculations *taxcalculation.Client // TaxCodes is the client used to invoke /tax_codes APIs. @@ -570,6 +573,7 @@ func (a *API) Init(key string, backends *stripe.Backends) { a.SubscriptionItems = &subscriptionitem.Client{B: backends.API, Key: key} a.Subscriptions = &subscription.Client{B: backends.API, Key: key} a.SubscriptionSchedules = &subscriptionschedule.Client{B: backends.API, Key: key} + a.TaxAssociations = &taxassociation.Client{B: backends.API, Key: key} a.TaxCalculations = &taxcalculation.Client{B: backends.API, Key: key} a.TaxCodes = &taxcode.Client{B: backends.API, Key: key} a.TaxForms = &taxform.Client{B: backends.API, BUploads: backends.Uploads, Key: key} diff --git a/paymentintent.go b/paymentintent.go index ead822b6ff..cdf20e5d72 100644 --- a/paymentintent.go +++ b/paymentintent.go @@ -1103,6 +1103,24 @@ func (p *PaymentIntentListParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } +// Tax arguments for automations +type PaymentIntentAsyncWorkflowsInputsTaxParams struct { + // The [TaxCalculation](https://stripe.com/docs/api/tax/calculations) id + Calculation *string `form:"calculation"` +} + +// Arguments passed in automations +type PaymentIntentAsyncWorkflowsInputsParams struct { + // Tax arguments for automations + Tax *PaymentIntentAsyncWorkflowsInputsTaxParams `form:"tax"` +} + +// Automations to be run during the PaymentIntent lifecycle +type PaymentIntentAsyncWorkflowsParams struct { + // Arguments passed in automations + Inputs *PaymentIntentAsyncWorkflowsInputsParams `form:"inputs"` +} + // When you enable this parameter, this PaymentIntent accepts payment methods that you enable in the Dashboard and that are compatible with this PaymentIntent's other parameters. type PaymentIntentAutomaticPaymentMethodsParams struct { // Controls whether this PaymentIntent will accept redirect-based payment methods. @@ -2540,6 +2558,8 @@ type PaymentIntentParams struct { Amount *int64 `form:"amount"` // The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). ApplicationFeeAmount *int64 `form:"application_fee_amount"` + // Automations to be run during the PaymentIntent lifecycle + AsyncWorkflows *PaymentIntentAsyncWorkflowsParams `form:"async_workflows"` // When you enable this parameter, this PaymentIntent accepts payment methods that you enable in the Dashboard and that are compatible with this PaymentIntent's other parameters. AutomaticPaymentMethods *PaymentIntentAutomaticPaymentMethodsParams `form:"automatic_payment_methods"` // Controls when the funds will be captured from the customer's account. @@ -2696,6 +2716,24 @@ func (p *PaymentIntentCancelParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } +// Tax arguments for automations +type PaymentIntentCaptureAsyncWorkflowsInputsTaxParams struct { + // The [TaxCalculation](https://stripe.com/docs/api/tax/calculations) id + Calculation *string `form:"calculation"` +} + +// Arguments passed in automations +type PaymentIntentCaptureAsyncWorkflowsInputsParams struct { + // Tax arguments for automations + Tax *PaymentIntentCaptureAsyncWorkflowsInputsTaxParams `form:"tax"` +} + +// Automations to be run during the PaymentIntent lifecycle +type PaymentIntentCaptureAsyncWorkflowsParams struct { + // Arguments passed in automations + Inputs *PaymentIntentCaptureAsyncWorkflowsInputsParams `form:"inputs"` +} + // Affiliate details for this purchase. type PaymentIntentCapturePaymentDetailsCarRentalAffiliateParams struct { // The name of the affiliate that originated the purchase. @@ -3017,6 +3055,8 @@ type PaymentIntentCaptureParams struct { AmountToCapture *int64 `form:"amount_to_capture"` // The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). ApplicationFeeAmount *int64 `form:"application_fee_amount"` + // Automations to be run during the PaymentIntent lifecycle + AsyncWorkflows *PaymentIntentCaptureAsyncWorkflowsParams `form:"async_workflows"` // Specifies which fields in the response should be expanded. Expand []*string `form:"expand"` // Defaults to `true`. When capturing a PaymentIntent, setting `final_capture` to `false` notifies Stripe to not release the remaining uncaptured funds to make sure that they're captured in future requests. You can only use this setting when [multicapture](https://stripe.com/docs/payments/multicapture) is available for PaymentIntents. @@ -3048,6 +3088,24 @@ func (p *PaymentIntentCaptureParams) AddMetadata(key string, value string) { p.Metadata[key] = value } +// Tax arguments for automations +type PaymentIntentConfirmAsyncWorkflowsInputsTaxParams struct { + // The [TaxCalculation](https://stripe.com/docs/api/tax/calculations) id + Calculation *string `form:"calculation"` +} + +// Arguments passed in automations +type PaymentIntentConfirmAsyncWorkflowsInputsParams struct { + // Tax arguments for automations + Tax *PaymentIntentConfirmAsyncWorkflowsInputsTaxParams `form:"tax"` +} + +// Automations to be run during the PaymentIntent lifecycle +type PaymentIntentConfirmAsyncWorkflowsParams struct { + // Arguments passed in automations + Inputs *PaymentIntentConfirmAsyncWorkflowsInputsParams `form:"inputs"` +} + // Affiliate details for this purchase. type PaymentIntentConfirmPaymentDetailsCarRentalAffiliateParams struct { // The name of the affiliate that originated the purchase. @@ -3390,6 +3448,8 @@ type PaymentIntentConfirmParams struct { Params `form:"*"` // The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). ApplicationFeeAmount *int64 `form:"application_fee_amount"` + // Automations to be run during the PaymentIntent lifecycle + AsyncWorkflows *PaymentIntentConfirmAsyncWorkflowsParams `form:"async_workflows"` // Controls when the funds will be captured from the customer's account. CaptureMethod *string `form:"capture_method"` // ID of the ConfirmationToken used to confirm this PaymentIntent. @@ -3444,6 +3504,24 @@ func (p *PaymentIntentConfirmParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } +// Tax arguments for automations +type PaymentIntentDecrementAuthorizationAsyncWorkflowsInputsTaxParams struct { + // The [TaxCalculation](https://stripe.com/docs/api/tax/calculations) id + Calculation *string `form:"calculation"` +} + +// Arguments passed in automations +type PaymentIntentDecrementAuthorizationAsyncWorkflowsInputsParams struct { + // Tax arguments for automations + Tax *PaymentIntentDecrementAuthorizationAsyncWorkflowsInputsTaxParams `form:"tax"` +} + +// Automations to be run during the PaymentIntent lifecycle +type PaymentIntentDecrementAuthorizationAsyncWorkflowsParams struct { + // Arguments passed in automations + Inputs *PaymentIntentDecrementAuthorizationAsyncWorkflowsInputsParams `form:"inputs"` +} + // The parameters used to automatically create a transfer after the payment is captured. // Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). type PaymentIntentDecrementAuthorizationTransferDataParams struct { @@ -3473,6 +3551,8 @@ type PaymentIntentDecrementAuthorizationParams struct { Amount *int64 `form:"amount"` // The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). ApplicationFeeAmount *int64 `form:"application_fee_amount"` + // Automations to be run during the PaymentIntent lifecycle + AsyncWorkflows *PaymentIntentDecrementAuthorizationAsyncWorkflowsParams `form:"async_workflows"` // An arbitrary string attached to the object. Often useful for displaying to users. Description *string `form:"description"` // Specifies which fields in the response should be expanded. @@ -3498,6 +3578,24 @@ func (p *PaymentIntentDecrementAuthorizationParams) AddMetadata(key string, valu p.Metadata[key] = value } +// Tax arguments for automations +type PaymentIntentIncrementAuthorizationAsyncWorkflowsInputsTaxParams struct { + // The [TaxCalculation](https://stripe.com/docs/api/tax/calculations) id + Calculation *string `form:"calculation"` +} + +// Arguments passed in automations +type PaymentIntentIncrementAuthorizationAsyncWorkflowsInputsParams struct { + // Tax arguments for automations + Tax *PaymentIntentIncrementAuthorizationAsyncWorkflowsInputsTaxParams `form:"tax"` +} + +// Automations to be run during the PaymentIntent lifecycle +type PaymentIntentIncrementAuthorizationAsyncWorkflowsParams struct { + // Arguments passed in automations + Inputs *PaymentIntentIncrementAuthorizationAsyncWorkflowsInputsParams `form:"inputs"` +} + // The parameters used to automatically create a transfer after the payment is captured. // Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). type PaymentIntentIncrementAuthorizationTransferDataParams struct { @@ -3535,6 +3633,8 @@ type PaymentIntentIncrementAuthorizationParams struct { Amount *int64 `form:"amount"` // The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). ApplicationFeeAmount *int64 `form:"application_fee_amount"` + // Automations to be run during the PaymentIntent lifecycle + AsyncWorkflows *PaymentIntentIncrementAuthorizationAsyncWorkflowsParams `form:"async_workflows"` // An arbitrary string attached to the object. Often useful for displaying to users. Description *string `form:"description"` // Specifies which fields in the response should be expanded. @@ -3585,6 +3685,16 @@ type PaymentIntentAmountDetailsTip struct { type PaymentIntentAmountDetails struct { Tip *PaymentIntentAmountDetailsTip `json:"tip"` } +type PaymentIntentAsyncWorkflowsInputsTax struct { + // The [TaxCalculation](https://stripe.com/docs/api/tax/calculations) id + Calculation string `json:"calculation"` +} +type PaymentIntentAsyncWorkflowsInputs struct { + Tax *PaymentIntentAsyncWorkflowsInputsTax `json:"tax"` +} +type PaymentIntentAsyncWorkflows struct { + Inputs *PaymentIntentAsyncWorkflowsInputs `json:"inputs"` +} // Settings to configure compatible payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods) type PaymentIntentAutomaticPaymentMethods struct { @@ -4690,7 +4800,8 @@ type PaymentIntent struct { // ID of the Connect application that created the PaymentIntent. Application *Application `json:"application"` // The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - ApplicationFeeAmount int64 `json:"application_fee_amount"` + ApplicationFeeAmount int64 `json:"application_fee_amount"` + AsyncWorkflows *PaymentIntentAsyncWorkflows `json:"async_workflows"` // Settings to configure compatible payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods) AutomaticPaymentMethods *PaymentIntentAutomaticPaymentMethods `json:"automatic_payment_methods"` // Populated when `status` is `canceled`, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch. diff --git a/tax/association/client.go b/tax/association/client.go new file mode 100644 index 0000000000..60904f9780 --- /dev/null +++ b/tax/association/client.go @@ -0,0 +1,42 @@ +// +// +// File generated from our OpenAPI spec +// +// + +// Package association provides the association related APIs +package association + +import ( + "net/http" + + stripe "github.com/stripe/stripe-go/v79" +) + +// Client is used to invoke association related APIs. +type Client struct { + B stripe.Backend + Key string +} + +// Finds a tax association object by PaymentIntent id. +func Find(params *stripe.TaxAssociationFindParams) (*stripe.TaxAssociation, error) { + return getC().Find(params) +} + +// Finds a tax association object by PaymentIntent id. +func (c Client) Find(params *stripe.TaxAssociationFindParams) (*stripe.TaxAssociation, error) { + association := &stripe.TaxAssociation{} + err := c.B.Call( + http.MethodGet, + "/v1/tax/associations/find", + c.Key, + params, + association, + ) + return association, err +} + +func getC() Client { + return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key} +} diff --git a/tax_association.go b/tax_association.go new file mode 100644 index 0000000000..fe87de9b98 --- /dev/null +++ b/tax_association.go @@ -0,0 +1,111 @@ +// +// +// File generated from our OpenAPI spec +// +// + +package stripe + +// Status of the Tax Association. +type TaxAssociationStatus string + +// List of values that TaxAssociationStatus can take +const ( + TaxAssociationStatusCommitted TaxAssociationStatus = "committed" + TaxAssociationStatusErrored TaxAssociationStatus = "errored" +) + +// Status of the attempted Tax Transaction reversal. +type TaxAssociationStatusDetailsCommittedReversalStatus string + +// List of values that TaxAssociationStatusDetailsCommittedReversalStatus can take +const ( + TaxAssociationStatusDetailsCommittedReversalStatusCommitted TaxAssociationStatusDetailsCommittedReversalStatus = "committed" + TaxAssociationStatusDetailsCommittedReversalStatusErrored TaxAssociationStatusDetailsCommittedReversalStatus = "errored" +) + +// Details on why we could not commit the reversal Tax Transaction +type TaxAssociationStatusDetailsCommittedReversalStatusDetailsErroredReason string + +// List of values that TaxAssociationStatusDetailsCommittedReversalStatusDetailsErroredReason can take +const ( + TaxAssociationStatusDetailsCommittedReversalStatusDetailsErroredReasonOriginalTransactionVoided TaxAssociationStatusDetailsCommittedReversalStatusDetailsErroredReason = "original_transaction_voided" + TaxAssociationStatusDetailsCommittedReversalStatusDetailsErroredReasonUniqueReferenceViolation TaxAssociationStatusDetailsCommittedReversalStatusDetailsErroredReason = "unique_reference_violation" +) + +// Details on why we could not commit the Tax Transaction +type TaxAssociationStatusDetailsErroredReason string + +// List of values that TaxAssociationStatusDetailsErroredReason can take +const ( + TaxAssociationStatusDetailsErroredReasonAnotherPaymentAssociatedWithCalculation TaxAssociationStatusDetailsErroredReason = "another_payment_associated_with_calculation" + TaxAssociationStatusDetailsErroredReasonCalculationExpired TaxAssociationStatusDetailsErroredReason = "calculation_expired" + TaxAssociationStatusDetailsErroredReasonCurrencyMismatch TaxAssociationStatusDetailsErroredReason = "currency_mismatch" + TaxAssociationStatusDetailsErroredReasonUniqueReferenceViolation TaxAssociationStatusDetailsErroredReason = "unique_reference_violation" +) + +// Finds a tax association object by PaymentIntent id. +type TaxAssociationFindParams struct { + Params `form:"*"` + // Specifies which fields in the response should be expanded. + Expand []*string `form:"expand"` + // Valid [PaymentIntent](https://stripe.com/docs/api/payment_intents/object) id + PaymentIntent *string `form:"payment_intent"` +} + +// AddExpand appends a new field to expand. +func (p *TaxAssociationFindParams) AddExpand(f string) { + p.Expand = append(p.Expand, &f) +} + +type TaxAssociationStatusDetailsCommittedReversalStatusDetailsCommitted struct { + // The [Tax Transaction](https://stripe.com/docs/api/tax/transaction/object) + Transaction string `json:"transaction"` +} +type TaxAssociationStatusDetailsCommittedReversalStatusDetailsErrored struct { + // Details on why we could not commit the reversal Tax Transaction + Reason TaxAssociationStatusDetailsCommittedReversalStatusDetailsErroredReason `json:"reason"` + // The [Refund](https://stripe.com/docs/api/refunds/object) ID that should have created a tax reversal. + RefundID string `json:"refund_id"` +} +type TaxAssociationStatusDetailsCommittedReversalStatusDetails struct { + Committed *TaxAssociationStatusDetailsCommittedReversalStatusDetailsCommitted `json:"committed"` + Errored *TaxAssociationStatusDetailsCommittedReversalStatusDetailsErrored `json:"errored"` +} + +// Attempts to create Tax Transaction reversals +type TaxAssociationStatusDetailsCommittedReversal struct { + // Status of the attempted Tax Transaction reversal. + Status TaxAssociationStatusDetailsCommittedReversalStatus `json:"status"` + StatusDetails *TaxAssociationStatusDetailsCommittedReversalStatusDetails `json:"status_details"` +} +type TaxAssociationStatusDetailsCommitted struct { + // Attempts to create Tax Transaction reversals + Reversals []*TaxAssociationStatusDetailsCommittedReversal `json:"reversals"` + // The [Tax Transaction](https://stripe.com/docs/api/tax/transaction/object) + Transaction string `json:"transaction"` +} +type TaxAssociationStatusDetailsErrored struct { + // Details on why we could not commit the Tax Transaction + Reason TaxAssociationStatusDetailsErroredReason `json:"reason"` +} +type TaxAssociationStatusDetails struct { + Committed *TaxAssociationStatusDetailsCommitted `json:"committed"` + Errored *TaxAssociationStatusDetailsErrored `json:"errored"` +} + +// A Tax Association exposes the Tax Transactions that Stripe attempted to create on your behalf based on the PaymentIntent input +type TaxAssociation struct { + APIResource + // The [Tax Calculation](https://stripe.com/docs/api/tax/calculations/object) that was included in PaymentIntent. + Calculation string `json:"calculation"` + // Unique identifier for the object. + ID string `json:"id"` + // String representing the object's type. Objects of the same type share the same value. + Object string `json:"object"` + // The [PaymentIntent](https://stripe.com/docs/api/payment_intents/object) that this Tax Association is tracking. + PaymentIntent string `json:"payment_intent"` + // Status of the Tax Association. + Status TaxAssociationStatus `json:"status"` + StatusDetails *TaxAssociationStatusDetails `json:"status_details"` +} From 55a29bea04128ad41a436fac162851dc27f2df73 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 16:46:12 +0000 Subject: [PATCH 09/13] Update generated code for v1131 --- OPENAPI_VERSION | 2 +- dispute.go | 6 ++++-- event.go | 2 +- event/client.go | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 0233d4f05b..87ed6dbb70 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1130 \ No newline at end of file +v1131 \ No newline at end of file diff --git a/dispute.go b/dispute.go index 92887bf81c..b4b9cc737f 100644 --- a/dispute.go +++ b/dispute.go @@ -109,8 +109,10 @@ const ( type DisputeListParams struct { ListParams `form:"*"` // Only return disputes associated to the charge specified by this charge ID. - Charge *string `form:"charge"` - Created *int64 `form:"created"` + Charge *string `form:"charge"` + // Only return disputes that were created during the given date interval. + Created *int64 `form:"created"` + // Only return disputes that were created during the given date interval. CreatedRange *RangeQueryParams `form:"created"` // Specifies which fields in the response should be expanded. Expand []*string `form:"expand"` diff --git a/event.go b/event.go index 2afefaa9f6..37016a1200 100644 --- a/event.go +++ b/event.go @@ -316,7 +316,7 @@ func (p *EventListParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } -// Retrieves the details of an event. Supply the unique identifier of the event, which you might have received in a webhook. +// Retrieves the details of an event if it was created in the last 30 days. Supply the unique identifier of the event, which you might have received in a webhook. type EventParams struct { Params `form:"*"` // Specifies which fields in the response should be expanded. diff --git a/event/client.go b/event/client.go index 791e9c7e18..d10e18cbae 100644 --- a/event/client.go +++ b/event/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Retrieves the details of an event. Supply the unique identifier of the event, which you might have received in a webhook. +// Retrieves the details of an event if it was created in the last 30 days. Supply the unique identifier of the event, which you might have received in a webhook. func Get(id string, params *stripe.EventParams) (*stripe.Event, error) { return getC().Get(id, params) } -// Retrieves the details of an event. Supply the unique identifier of the event, which you might have received in a webhook. +// Retrieves the details of an event if it was created in the last 30 days. Supply the unique identifier of the event, which you might have received in a webhook. func (c Client) Get(id string, params *stripe.EventParams) (*stripe.Event, error) { path := stripe.FormatURLPath("/v1/events/%s", id) event := &stripe.Event{} From 7092338cfbea0ac671b336dad1dbd14abe7fa4c0 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 17 Jul 2024 12:19:01 +0000 Subject: [PATCH 10/13] Update generated code for v1132 --- OPENAPI_VERSION | 2 +- invoice.go | 1 + quotepreviewinvoice.go | 1 + subscription.go | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 87ed6dbb70..73e167f6f8 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1131 \ No newline at end of file +v1132 \ No newline at end of file diff --git a/invoice.go b/invoice.go index da2916f406..b0c8f4f82d 100644 --- a/invoice.go +++ b/invoice.go @@ -183,6 +183,7 @@ const ( InvoicePaymentSettingsPaymentMethodTypeIDEAL InvoicePaymentSettingsPaymentMethodType = "ideal" InvoicePaymentSettingsPaymentMethodTypeKonbini InvoicePaymentSettingsPaymentMethodType = "konbini" InvoicePaymentSettingsPaymentMethodTypeLink InvoicePaymentSettingsPaymentMethodType = "link" + InvoicePaymentSettingsPaymentMethodTypeMultibanco InvoicePaymentSettingsPaymentMethodType = "multibanco" InvoicePaymentSettingsPaymentMethodTypeP24 InvoicePaymentSettingsPaymentMethodType = "p24" InvoicePaymentSettingsPaymentMethodTypePayNow InvoicePaymentSettingsPaymentMethodType = "paynow" InvoicePaymentSettingsPaymentMethodTypePaypal InvoicePaymentSettingsPaymentMethodType = "paypal" diff --git a/quotepreviewinvoice.go b/quotepreviewinvoice.go index 318ae42abf..3823dea675 100644 --- a/quotepreviewinvoice.go +++ b/quotepreviewinvoice.go @@ -302,6 +302,7 @@ const ( QuotePreviewInvoicePaymentSettingsPaymentMethodTypeIDEAL QuotePreviewInvoicePaymentSettingsPaymentMethodType = "ideal" QuotePreviewInvoicePaymentSettingsPaymentMethodTypeKonbini QuotePreviewInvoicePaymentSettingsPaymentMethodType = "konbini" QuotePreviewInvoicePaymentSettingsPaymentMethodTypeLink QuotePreviewInvoicePaymentSettingsPaymentMethodType = "link" + QuotePreviewInvoicePaymentSettingsPaymentMethodTypeMultibanco QuotePreviewInvoicePaymentSettingsPaymentMethodType = "multibanco" QuotePreviewInvoicePaymentSettingsPaymentMethodTypeP24 QuotePreviewInvoicePaymentSettingsPaymentMethodType = "p24" QuotePreviewInvoicePaymentSettingsPaymentMethodTypePayNow QuotePreviewInvoicePaymentSettingsPaymentMethodType = "paynow" QuotePreviewInvoicePaymentSettingsPaymentMethodTypePaypal QuotePreviewInvoicePaymentSettingsPaymentMethodType = "paypal" diff --git a/subscription.go b/subscription.go index 755da4d8ab..8249f26fd8 100644 --- a/subscription.go +++ b/subscription.go @@ -201,6 +201,7 @@ const ( SubscriptionPaymentSettingsPaymentMethodTypeIDEAL SubscriptionPaymentSettingsPaymentMethodType = "ideal" SubscriptionPaymentSettingsPaymentMethodTypeKonbini SubscriptionPaymentSettingsPaymentMethodType = "konbini" SubscriptionPaymentSettingsPaymentMethodTypeLink SubscriptionPaymentSettingsPaymentMethodType = "link" + SubscriptionPaymentSettingsPaymentMethodTypeMultibanco SubscriptionPaymentSettingsPaymentMethodType = "multibanco" SubscriptionPaymentSettingsPaymentMethodTypeP24 SubscriptionPaymentSettingsPaymentMethodType = "p24" SubscriptionPaymentSettingsPaymentMethodTypePayNow SubscriptionPaymentSettingsPaymentMethodType = "paynow" SubscriptionPaymentSettingsPaymentMethodTypePaypal SubscriptionPaymentSettingsPaymentMethodType = "paypal" From fe2697320c982216a76d96b9fda14837bda64591 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 17 Jul 2024 16:13:40 +0000 Subject: [PATCH 11/13] Update generated code for v1134 --- OPENAPI_VERSION | 2 +- terminal_reader.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 73e167f6f8..7a33bf6145 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1132 \ No newline at end of file +v1134 \ No newline at end of file diff --git a/terminal_reader.go b/terminal_reader.go index d04bceb079..152bb483ee 100644 --- a/terminal_reader.go +++ b/terminal_reader.go @@ -88,7 +88,7 @@ const ( TerminalReaderActionTypeSetReaderDisplay TerminalReaderActionType = "set_reader_display" ) -// Type of reader, one of `bbpos_wisepad3`, `stripe_m2`, `bbpos_chipper2x`, `bbpos_wisepos_e`, `verifone_P400`, `simulated_wisepos_e`, or `mobile_phone_reader`. +// Type of reader, one of `bbpos_wisepad3`, `stripe_m2`, `stripe_s700`, `bbpos_chipper2x`, `bbpos_wisepos_e`, `verifone_P400`, `simulated_wisepos_e`, or `mobile_phone_reader`. type TerminalReaderDeviceType string // List of values that TerminalReaderDeviceType can take @@ -99,6 +99,7 @@ const ( TerminalReaderDeviceTypeMobilePhoneReader TerminalReaderDeviceType = "mobile_phone_reader" TerminalReaderDeviceTypeSimulatedWisePOSE TerminalReaderDeviceType = "simulated_wisepos_e" TerminalReaderDeviceTypeStripeM2 TerminalReaderDeviceType = "stripe_m2" + TerminalReaderDeviceTypeStripeS700 TerminalReaderDeviceType = "stripe_s700" TerminalReaderDeviceTypeVerifoneP400 TerminalReaderDeviceType = "verifone_P400" ) @@ -706,7 +707,7 @@ type TerminalReader struct { Deleted bool `json:"deleted"` // The current software version of the reader. DeviceSwVersion string `json:"device_sw_version"` - // Type of reader, one of `bbpos_wisepad3`, `stripe_m2`, `bbpos_chipper2x`, `bbpos_wisepos_e`, `verifone_P400`, `simulated_wisepos_e`, or `mobile_phone_reader`. + // Type of reader, one of `bbpos_wisepad3`, `stripe_m2`, `stripe_s700`, `bbpos_chipper2x`, `bbpos_wisepos_e`, `verifone_P400`, `simulated_wisepos_e`, or `mobile_phone_reader`. DeviceType TerminalReaderDeviceType `json:"device_type"` // Unique identifier for the object. ID string `json:"id"` From 4e84a19296f29cc427f60f5459c0f45fdf8d0d73 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 17 Jul 2024 22:47:27 +0000 Subject: [PATCH 12/13] Update generated code for v1135 --- OPENAPI_VERSION | 2 +- event.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 7a33bf6145..6e73fe6859 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1134 \ No newline at end of file +v1135 \ No newline at end of file diff --git a/event.go b/event.go index 37016a1200..ee4cddf3d4 100644 --- a/event.go +++ b/event.go @@ -158,6 +158,7 @@ const ( EventTypeIssuingDisputeClosed EventType = "issuing_dispute.closed" EventTypeIssuingDisputeCreated EventType = "issuing_dispute.created" EventTypeIssuingDisputeFundsReinstated EventType = "issuing_dispute.funds_reinstated" + EventTypeIssuingDisputeFundsRescinded EventType = "issuing_dispute.funds_rescinded" EventTypeIssuingDisputeSubmitted EventType = "issuing_dispute.submitted" EventTypeIssuingDisputeUpdated EventType = "issuing_dispute.updated" EventTypeIssuingPersonalizationDesignActivated EventType = "issuing_personalization_design.activated" From 6f14a7c01c253d5561ab7e823fa0f6f0dcd44f6a Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 18 Jul 2024 17:26:36 +0000 Subject: [PATCH 13/13] Update generated code for v1136 --- OPENAPI_VERSION | 2 +- paymentmethodconfiguration.go | 47 +++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 6e73fe6859..73bccee5b6 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1135 \ No newline at end of file +v1136 \ No newline at end of file diff --git a/paymentmethodconfiguration.go b/paymentmethodconfiguration.go index 19a5e0321a..7076b82600 100644 --- a/paymentmethodconfiguration.go +++ b/paymentmethodconfiguration.go @@ -595,6 +595,25 @@ const ( PaymentMethodConfigurationPaypalDisplayPreferenceValueOn PaymentMethodConfigurationPaypalDisplayPreferenceValue = "on" ) +// The account's display preference. +type PaymentMethodConfigurationPaytoDisplayPreferencePreference string + +// List of values that PaymentMethodConfigurationPaytoDisplayPreferencePreference can take +const ( + PaymentMethodConfigurationPaytoDisplayPreferencePreferenceNone PaymentMethodConfigurationPaytoDisplayPreferencePreference = "none" + PaymentMethodConfigurationPaytoDisplayPreferencePreferenceOff PaymentMethodConfigurationPaytoDisplayPreferencePreference = "off" + PaymentMethodConfigurationPaytoDisplayPreferencePreferenceOn PaymentMethodConfigurationPaytoDisplayPreferencePreference = "on" +) + +// The effective display preference value. +type PaymentMethodConfigurationPaytoDisplayPreferenceValue string + +// List of values that PaymentMethodConfigurationPaytoDisplayPreferenceValue can take +const ( + PaymentMethodConfigurationPaytoDisplayPreferenceValueOff PaymentMethodConfigurationPaytoDisplayPreferenceValue = "off" + PaymentMethodConfigurationPaytoDisplayPreferenceValueOn PaymentMethodConfigurationPaytoDisplayPreferenceValue = "on" +) + // The account's display preference. type PaymentMethodConfigurationPromptPayDisplayPreferencePreference string @@ -1145,6 +1164,18 @@ type PaymentMethodConfigurationPaypalParams struct { DisplayPreference *PaymentMethodConfigurationPaypalDisplayPreferenceParams `form:"display_preference"` } +// Whether or not the payment method should be displayed. +type PaymentMethodConfigurationPaytoDisplayPreferenceParams struct { + // The account's preference for whether or not to display this payment method. + Preference *string `form:"preference"` +} + +// PayTo is a [real-time](https://docs.stripe.com/payments/real-time) payment method that enables customers in Australia to pay by providing their bank account details. Customers must accept a mandate authorizing you to debit their account. Check this [page](https://docs.stripe.com/payments/payto) for more details. +type PaymentMethodConfigurationPaytoParams struct { + // Whether or not the payment method should be displayed. + DisplayPreference *PaymentMethodConfigurationPaytoDisplayPreferenceParams `form:"display_preference"` +} + // Whether or not the payment method should be displayed. type PaymentMethodConfigurationPromptPayDisplayPreferenceParams struct { // The account's preference for whether or not to display this payment method. @@ -1316,6 +1347,8 @@ type PaymentMethodConfigurationParams struct { PayNow *PaymentMethodConfigurationPayNowParams `form:"paynow"` // PayPal, a digital wallet popular with customers in Europe, allows your customers worldwide to pay using their PayPal account. Check this [page](https://stripe.com/docs/payments/paypal) for more details. Paypal *PaymentMethodConfigurationPaypalParams `form:"paypal"` + // PayTo is a [real-time](https://docs.stripe.com/payments/real-time) payment method that enables customers in Australia to pay by providing their bank account details. Customers must accept a mandate authorizing you to debit their account. Check this [page](https://docs.stripe.com/payments/payto) for more details. + Payto *PaymentMethodConfigurationPaytoParams `form:"payto"` // PromptPay is a Thailand-based payment method that allows customers to make a payment using their preferred app from participating banks. Check this [page](https://stripe.com/docs/payments/promptpay) for more details. PromptPay *PaymentMethodConfigurationPromptPayParams `form:"promptpay"` // Revolut Pay, developed by Revolut, a global finance app, is a digital wallet payment method. Revolut Pay uses the customer's stored balance or cards to fund the payment, and offers the option for non-Revolut customers to save their details after their first purchase. @@ -1742,6 +1775,19 @@ type PaymentMethodConfigurationPaypal struct { Available bool `json:"available"` DisplayPreference *PaymentMethodConfigurationPaypalDisplayPreference `json:"display_preference"` } +type PaymentMethodConfigurationPaytoDisplayPreference struct { + // For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + Overridable bool `json:"overridable"` + // The account's display preference. + Preference PaymentMethodConfigurationPaytoDisplayPreferencePreference `json:"preference"` + // The effective display preference value. + Value PaymentMethodConfigurationPaytoDisplayPreferenceValue `json:"value"` +} +type PaymentMethodConfigurationPayto struct { + // Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + Available bool `json:"available"` + DisplayPreference *PaymentMethodConfigurationPaytoDisplayPreference `json:"display_preference"` +} type PaymentMethodConfigurationPromptPayDisplayPreference struct { // For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. Overridable bool `json:"overridable"` @@ -1910,6 +1956,7 @@ type PaymentMethodConfiguration struct { Parent string `json:"parent"` PayNow *PaymentMethodConfigurationPayNow `json:"paynow"` Paypal *PaymentMethodConfigurationPaypal `json:"paypal"` + Payto *PaymentMethodConfigurationPayto `json:"payto"` PromptPay *PaymentMethodConfigurationPromptPay `json:"promptpay"` RevolutPay *PaymentMethodConfigurationRevolutPay `json:"revolut_pay"` SEPADebit *PaymentMethodConfigurationSEPADebit `json:"sepa_debit"`