Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated code for beta #1947

Closed
wants to merge 9 commits into from
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@


## 81.0.0 - 2024-10-29

Historically, when upgrading webhooks to a new API version, you also had to upgrade your SDK version. Your webhook's API version needed to match the API version pinned by the SDK you were using to ensure successful deserialization of events. With the `2024-09-30.acacia` release, Stripe follows a [new API release process](https://stripe.com/blog/introducing-stripes-new-api-release-process). As a result, you can safely upgrade your webhook endpoints to any API version within a biannual release (like `acacia`) without upgrading the SDK.

However, [a bug](https://github.com/stripe/stripe-go/pull/1940) in the `80.x.y` SDK releases meant that webhook version upgrades from the SDK's pinned `2024-09-30.acacia` version to the new `2024-10-28.acacia` version would fail. Therefore, we are shipping SDK support for `2024-10-28.acacia` as a major version to enforce the idea that an SDK upgrade is also required. Future API versions in the `acacia` line will be released as minor versions.

* [#1931](https://github.com/stripe/stripe-go/pull/1931) This release changes the pinned API version to `2024-10-28.acacia`.
* Add support for new resource `V2.EventDestinations`
* Add support for `New`, `Retrieve`, `Update`, `List`, `Delete`, `Disable`, `Enable` and `Ping` methods on resource `V2.EventDestinations`
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1319
v1332
53 changes: 41 additions & 12 deletions account.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,19 +150,48 @@ const (
AccountExternalAccountTypeCard AccountExternalAccountType = "card"
)

// If the account is disabled, this string describes why. [Learn more about handling verification issues](https://stripe.com/docs/connect/handling-api-verification). Can be `action_required.requested_capabilities`, `requirements.past_due`, `requirements.pending_verification`, `listed`, `platform_paused`, `rejected.fraud`, `rejected.incomplete_verification`, `rejected.listed`, `rejected.other`, `rejected.terms_of_service`, `under_review`, or `other`.
// This is typed as an enum for consistency with `requirements.disabled_reason`.
type AccountFutureRequirementsDisabledReason string

// List of values that AccountFutureRequirementsDisabledReason can take
const (
AccountFutureRequirementsDisabledReasonActionRequiredRequestedCapabilities AccountFutureRequirementsDisabledReason = "action_required.requested_capabilities"
AccountFutureRequirementsDisabledReasonListed AccountFutureRequirementsDisabledReason = "listed"
AccountFutureRequirementsDisabledReasonOther AccountFutureRequirementsDisabledReason = "other"
AccountFutureRequirementsDisabledReasonPlatformPaused AccountFutureRequirementsDisabledReason = "platform_paused"
AccountFutureRequirementsDisabledReasonRejectedFraud AccountFutureRequirementsDisabledReason = "rejected.fraud"
AccountFutureRequirementsDisabledReasonRejectedIncompleteVerification AccountFutureRequirementsDisabledReason = "rejected.incomplete_verification"
AccountFutureRequirementsDisabledReasonRejectedListed AccountFutureRequirementsDisabledReason = "rejected.listed"
AccountFutureRequirementsDisabledReasonRejectedOther AccountFutureRequirementsDisabledReason = "rejected.other"
AccountFutureRequirementsDisabledReasonRejectedPlatformFraud AccountFutureRequirementsDisabledReason = "rejected.platform_fraud"
AccountFutureRequirementsDisabledReasonRejectedPlatformOther AccountFutureRequirementsDisabledReason = "rejected.platform_other"
AccountFutureRequirementsDisabledReasonRejectedPlatformTermsOfService AccountFutureRequirementsDisabledReason = "rejected.platform_terms_of_service"
AccountFutureRequirementsDisabledReasonRejectedTermsOfService AccountFutureRequirementsDisabledReason = "rejected.terms_of_service"
AccountFutureRequirementsDisabledReasonRequirementsPastDue AccountFutureRequirementsDisabledReason = "requirements.past_due"
AccountFutureRequirementsDisabledReasonRequirementsPendingVerification AccountFutureRequirementsDisabledReason = "requirements.pending_verification"
AccountFutureRequirementsDisabledReasonUnderReview AccountFutureRequirementsDisabledReason = "under_review"
)

// If the account is disabled, this enum describes why. [Learn more about handling verification issues](https://stripe.com/docs/connect/handling-api-verification).
type AccountRequirementsDisabledReason string

// List of values that AccountRequirementsDisabledReason can take
const (
AccountRequirementsDisabledReasonFieldsNeeded AccountRequirementsDisabledReason = "fields_needed"
AccountRequirementsDisabledReasonListed AccountRequirementsDisabledReason = "listed"
AccountRequirementsDisabledReasonOther AccountRequirementsDisabledReason = "other"
AccountRequirementsDisabledReasonRejectedFraud AccountRequirementsDisabledReason = "rejected.fraud"
AccountRequirementsDisabledReasonRejectedListed AccountRequirementsDisabledReason = "rejected.listed"
AccountRequirementsDisabledReasonRejectedOther AccountRequirementsDisabledReason = "rejected.other"
AccountRequirementsDisabledReasonRejectedTermsOfService AccountRequirementsDisabledReason = "rejected.terms_of_service"
AccountRequirementsDisabledReasonUnderReview AccountRequirementsDisabledReason = "under_review"
AccountRequirementsDisabledReasonActionRequiredRequestedCapabilities AccountRequirementsDisabledReason = "action_required.requested_capabilities"
AccountRequirementsDisabledReasonListed AccountRequirementsDisabledReason = "listed"
AccountRequirementsDisabledReasonOther AccountRequirementsDisabledReason = "other"
AccountRequirementsDisabledReasonPlatformPaused AccountRequirementsDisabledReason = "platform_paused"
AccountRequirementsDisabledReasonRejectedFraud AccountRequirementsDisabledReason = "rejected.fraud"
AccountRequirementsDisabledReasonRejectedIncompleteVerification AccountRequirementsDisabledReason = "rejected.incomplete_verification"
AccountRequirementsDisabledReasonRejectedListed AccountRequirementsDisabledReason = "rejected.listed"
AccountRequirementsDisabledReasonRejectedOther AccountRequirementsDisabledReason = "rejected.other"
AccountRequirementsDisabledReasonRejectedPlatformFraud AccountRequirementsDisabledReason = "rejected.platform_fraud"
AccountRequirementsDisabledReasonRejectedPlatformOther AccountRequirementsDisabledReason = "rejected.platform_other"
AccountRequirementsDisabledReasonRejectedPlatformTermsOfService AccountRequirementsDisabledReason = "rejected.platform_terms_of_service"
AccountRequirementsDisabledReasonRejectedTermsOfService AccountRequirementsDisabledReason = "rejected.terms_of_service"
AccountRequirementsDisabledReasonRequirementsPastDue AccountRequirementsDisabledReason = "requirements.past_due"
AccountRequirementsDisabledReasonRequirementsPendingVerification AccountRequirementsDisabledReason = "requirements.pending_verification"
AccountRequirementsDisabledReasonUnderReview AccountRequirementsDisabledReason = "under_review"
)

// How frequently funds will be paid out. One of `manual` (payouts only created via API call), `daily`, `weekly`, or `monthly`.
Expand Down Expand Up @@ -1659,8 +1688,8 @@ type AccountFutureRequirements struct {
CurrentDeadline int64 `json:"current_deadline"`
// Fields that need to be collected to keep the account enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash.
CurrentlyDue []string `json:"currently_due"`
// This is typed as a string for consistency with `requirements.disabled_reason`.
DisabledReason string `json:"disabled_reason"`
// This is typed as an enum for consistency with `requirements.disabled_reason`.
DisabledReason AccountFutureRequirementsDisabledReason `json:"disabled_reason"`
// Fields that are `currently_due` and need to be collected again because validation or verification failed.
Errors []*AccountFutureRequirementsError `json:"errors"`
// Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well.
Expand Down Expand Up @@ -1701,7 +1730,7 @@ type AccountRequirements struct {
CurrentDeadline int64 `json:"current_deadline"`
// Fields that need to be collected to keep the account enabled. If not collected by `current_deadline`, these fields appear in `past_due` as well, and the account is disabled.
CurrentlyDue []string `json:"currently_due"`
// If the account is disabled, this string describes why. [Learn more about handling verification issues](https://stripe.com/docs/connect/handling-api-verification). Can be `action_required.requested_capabilities`, `requirements.past_due`, `requirements.pending_verification`, `listed`, `platform_paused`, `rejected.fraud`, `rejected.incomplete_verification`, `rejected.listed`, `rejected.other`, `rejected.terms_of_service`, `under_review`, or `other`.
// If the account is disabled, this enum describes why. [Learn more about handling verification issues](https://stripe.com/docs/connect/handling-api-verification).
DisabledReason AccountRequirementsDisabledReason `json:"disabled_reason"`
// Fields that are `currently_due` and need to be collected again because validation or verification failed.
Errors []*AccountRequirementsError `json:"errors"`
Expand Down
20 changes: 16 additions & 4 deletions accountsession.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@ type AccountSessionComponentsFinancialAccountFeaturesParams struct {
DisableStripeUserAuthentication *bool `form:"disable_stripe_user_authentication"`
// Whether to allow external accounts to be linked for money transfer.
ExternalAccountCollection *bool `form:"external_account_collection"`
// Whether to allow money movement features.
MoneyMovement *bool `form:"money_movement"`
// Whether to allow sending money.
SendMoney *bool `form:"send_money"`
// Whether to allow transferring balance.
Expand All @@ -164,6 +162,8 @@ type AccountSessionComponentsFinancialAccountParams struct {
// The list of features enabled in the embedded component.
Features *AccountSessionComponentsFinancialAccountFeaturesParams `form:"features"`
}

// The list of features enabled in the embedded component.
type AccountSessionComponentsFinancialAccountTransactionsFeaturesParams struct {
// Whether to allow card spend dispute management features.
CardSpendDisputeManagement *bool `form:"card_spend_dispute_management"`
Expand All @@ -172,12 +172,22 @@ type AccountSessionComponentsFinancialAccountTransactionsFeaturesParams struct {
// Configuration for the financial account transactions component.
type AccountSessionComponentsFinancialAccountTransactionsParams struct {
// Whether the embedded component is enabled.
Enabled *bool `form:"enabled"`
Enabled *bool `form:"enabled"`
// The list of features enabled in the embedded component.
Features *AccountSessionComponentsFinancialAccountTransactionsFeaturesParams `form:"features"`
}

// The list of features enabled in the embedded component.
type AccountSessionComponentsIssuingCardFeaturesParams struct{}
type AccountSessionComponentsIssuingCardFeaturesParams struct {
// Whether to allow cardholder management features.
CardholderManagement *bool `form:"cardholder_management"`
// Whether to allow card management features.
CardManagement *bool `form:"card_management"`
// Whether to allow card spend dispute management features.
CardSpendDisputeManagement *bool `form:"card_spend_dispute_management"`
// Whether to allow spend control management features.
SpendControlManagement *bool `form:"spend_control_management"`
}

// Configuration for the issuing card component.
type AccountSessionComponentsIssuingCardParams struct {
Expand All @@ -195,6 +205,8 @@ type AccountSessionComponentsIssuingCardsListFeaturesParams struct {
CardManagement *bool `form:"card_management"`
// Whether to allow card spend dispute management features.
CardSpendDisputeManagement *bool `form:"card_spend_dispute_management"`
// Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts.
DisableStripeUserAuthentication *bool `form:"disable_stripe_user_authentication"`
// Whether to allow spend control management features.
SpendControlManagement *bool `form:"spend_control_management"`
}
Expand Down
12 changes: 6 additions & 6 deletions billing/creditgrant/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,38 +64,38 @@ func (c Client) Update(id string, params *stripe.BillingCreditGrantParams) (*str
return creditgrant, err
}

// Expires a credit grant
// Expires a credit grant.
func Expire(id string, params *stripe.BillingCreditGrantExpireParams) (*stripe.BillingCreditGrant, error) {
return getC().Expire(id, params)
}

// Expires a credit grant
// Expires a credit grant.
func (c Client) Expire(id string, params *stripe.BillingCreditGrantExpireParams) (*stripe.BillingCreditGrant, error) {
path := stripe.FormatURLPath("/v1/billing/credit_grants/%s/expire", id)
creditgrant := &stripe.BillingCreditGrant{}
err := c.B.Call(http.MethodPost, path, c.Key, params, creditgrant)
return creditgrant, err
}

// Voids a credit grant
// Voids a credit grant.
func VoidGrant(id string, params *stripe.BillingCreditGrantVoidGrantParams) (*stripe.BillingCreditGrant, error) {
return getC().VoidGrant(id, params)
}

// Voids a credit grant
// Voids a credit grant.
func (c Client) VoidGrant(id string, params *stripe.BillingCreditGrantVoidGrantParams) (*stripe.BillingCreditGrant, error) {
path := stripe.FormatURLPath("/v1/billing/credit_grants/%s/void", id)
creditgrant := &stripe.BillingCreditGrant{}
err := c.B.Call(http.MethodPost, path, c.Key, params, creditgrant)
return creditgrant, err
}

// Retrieve a list of credit grants
// Retrieve a list of credit grants.
func List(params *stripe.BillingCreditGrantListParams) *Iter {
return getC().List(params)
}

// Retrieve a list of credit grants
// Retrieve a list of credit grants.
func (c Client) List(listParams *stripe.BillingCreditGrantListParams) *Iter {
return &Iter{
Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) {
Expand Down
2 changes: 1 addition & 1 deletion billing_creditbalancesummary.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const (

// The billing credit applicability scope for which to fetch credit balance summary.
type BillingCreditBalanceSummaryFilterApplicabilityScopeParams struct {
// The price type to which credit grants can apply to. We currently only support `metered` price type.
// The price type for which credit grants can apply. We currently only support the `metered` price type.
PriceType *string `form:"price_type"`
}

Expand Down
Loading
Loading