Skip to content

Commit

Permalink
Update generated code (#1886)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
stripe-openapi[bot] authored Jul 11, 2024
1 parent 231273f commit 196340a
Show file tree
Hide file tree
Showing 7 changed files with 184 additions and 13 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1116
v1123
2 changes: 1 addition & 1 deletion billingportal_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
14 changes: 14 additions & 0 deletions confirmationtoken.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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.
Expand Down
122 changes: 122 additions & 0 deletions customersession.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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"`
}
Expand All @@ -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.
Expand All @@ -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"`
}
Expand Down
5 changes: 0 additions & 5 deletions error.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
Loading

0 comments on commit 196340a

Please sign in to comment.