Skip to content

Commit

Permalink
Merge pull request #1973 from stripe/latest-codegen-beta
Browse files Browse the repository at this point in the history
Update generated code for beta
  • Loading branch information
stripe-openapi[bot] authored Feb 7, 2025
2 parents bc56296 + 11b4be4 commit 56fca0e
Show file tree
Hide file tree
Showing 128 changed files with 445 additions and 1,027 deletions.
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
# Changelog

## 81.3.1 - 2025-02-03
* [#1980](https://github.com/stripe/stripe-go/pull/1980) Update generated code
* ⚠️ Fix acronym `JPY` in TerminalConfiguration that were not correctly capitalized

## 81.3.0 - 2025-01-27
* [#1965](https://github.com/stripe/stripe-go/pull/1965) Update generated code
* Add support for `Close` method on resource `Treasury.FinancialAccount`
* Add support for `PayByBankPayments` on `AccountCapabilitiesParams` and `AccountCapabilities`
* Add support for `DirectorshipDeclaration` and `OwnershipExemptionReason` on `AccountCompanyParams`, `AccountCompany`, and `TokenAccountCompanyParams`
* Add support for `ProofOfUltimateBeneficialOwnership` on `AccountDocumentsParams`
* Add support for `FinancialAccount` on `AccountSessionComponentsParams`, `AccountSessionComponents`, and `TreasuryOutboundTransferDestinationPaymentMethodDetails`
* Add support for `FinancialAccountTransactions`, `IssuingCard`, and `IssuingCardsList` on `AccountSessionComponentsParams` and `AccountSessionComponents`
* Add support for `AdviceCode` on `ChargeOutcome`, `InvoiceLastFinalizationError`, `PaymentIntentLastPaymentError`, `SetupAttemptSetupError`, `SetupIntentLastSetupError`, and `StripeError`
* Add support for `PayByBank` on `ChargePaymentMethodDetails`, `CheckoutSessionPaymentMethodOptionsParams`, `ConfirmationTokenPaymentMethodDataParams`, `ConfirmationTokenPaymentMethodPreview`, `PaymentIntentConfirmPaymentMethodDataParams`, `PaymentIntentConfirmPaymentMethodOptionsParams`, `PaymentIntentPaymentMethodDataParams`, `PaymentIntentPaymentMethodOptionsParams`, `PaymentIntentPaymentMethodOptions`, `PaymentMethodConfigurationParams`, `PaymentMethodConfiguration`, `PaymentMethodParams`, `PaymentMethod`, `SetupIntentConfirmPaymentMethodDataParams`, and `SetupIntentPaymentMethodDataParams`
* Add support for `Country` on `ChargePaymentMethodDetailsPaypal`, `ConfirmationTokenPaymentMethodPreviewPaypal`, and `PaymentMethodPaypal`
* Add support for `Discounts` on `CheckoutSession`
* Add support for new value `SD` on enums `CheckoutSessionShippingAddressCollectionAllowedCountries` and `PaymentLinkShippingAddressCollectionAllowedCountries`
* Add support for new value `pay_by_bank` on enums `ConfirmationTokenPaymentMethodPreviewType` and `PaymentMethodType`
* Add support for `PhoneNumberCollection` on `PaymentLinkParams`
* Add support for new value `pay_by_bank` on enum `PaymentLinkPaymentMethodTypes`
* Add support for `Jpy` on `TerminalConfigurationTippingParams` and `TerminalConfigurationTipping`
* Add support for `Nickname` on `TreasuryFinancialAccountParams` and `TreasuryFinancialAccount`
* Add support for `ForwardingSettings` on `TreasuryFinancialAccountParams`
* Add support for `IsDefault` on `TreasuryFinancialAccount`
* Add support for `DestinationPaymentMethodData` on `TreasuryOutboundTransferParams`
* Change type of `TreasuryOutboundTransferDestinationPaymentMethodDetailsType` from `literal('us_bank_account')` to `enum('financial_account'|'us_bank_account')`
* Add support for `OutboundTransfer` on `TreasuryReceivedCreditLinkedFlowsSourceFlowDetails`
* Add support for new value `outbound_transfer` on enum `TreasuryReceivedCreditLinkedFlowsSourceFlowDetailsType`
* [#1970](https://github.com/stripe/stripe-go/pull/1970) fix justfile ordering bug
* [#1969](https://github.com/stripe/stripe-go/pull/1969) pin CI and fix formatting
* [#1964](https://github.com/stripe/stripe-go/pull/1964) add justfile, update readme, remove coveralls
* [#1967](https://github.com/stripe/stripe-go/pull/1967) Added CONTRIBUTING.md file
* [#1962](https://github.com/stripe/stripe-go/pull/1962) Added pull request template

## 81.3.0-beta.3 - 2025-01-23
* [#1971](https://github.com/stripe/stripe-go/pull/1971) Update generated code for beta
* Remove support for `StripeAccount` on `TerminalReaderActionCollectPaymentMethod`, `TerminalReaderActionConfirmPaymentIntent`, `TerminalReaderActionProcessPaymentIntent`, and `TerminalReaderActionRefundPayment`
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1460
v1472
17 changes: 17 additions & 0 deletions account.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,21 @@ const (
AccountRequirementsDisabledReasonUnderReview AccountRequirementsDisabledReason = "under_review"
)

// Represents the rejected reason of the account. Empty if account is not rejected, or rejected by Stripe. Please see [this page for more details](https://stripe.com/docs/connect/)
type AccountRiskControlsRejectedReason string

// List of values that AccountRiskControlsRejectedReason can take
const (
AccountRiskControlsRejectedReasonCredit AccountRiskControlsRejectedReason = "credit"
AccountRiskControlsRejectedReasonFraud AccountRiskControlsRejectedReason = "fraud"
AccountRiskControlsRejectedReasonFraudNoIntentToFulfill AccountRiskControlsRejectedReason = "fraud_no_intent_to_fulfill"
AccountRiskControlsRejectedReasonFraudOther AccountRiskControlsRejectedReason = "fraud_other"
AccountRiskControlsRejectedReasonFraudPaymentMethodCasher AccountRiskControlsRejectedReason = "fraud_payment_method_casher"
AccountRiskControlsRejectedReasonFraudPaymentMethodTester AccountRiskControlsRejectedReason = "fraud_payment_method_tester"
AccountRiskControlsRejectedReasonOther AccountRiskControlsRejectedReason = "other"
AccountRiskControlsRejectedReasonTermsOfService AccountRiskControlsRejectedReason = "terms_of_service"
)

// How frequently funds will be paid out. One of `manual` (payouts only created via API call), `daily`, `weekly`, or `monthly`.
type AccountSettingsPayoutsScheduleInterval string

Expand Down Expand Up @@ -1814,6 +1829,8 @@ type AccountRiskControlsPayouts struct {
type AccountRiskControls struct {
Charges *AccountRiskControlsCharges `json:"charges"`
Payouts *AccountRiskControlsPayouts `json:"payouts"`
// Represents the rejected reason of the account. Empty if account is not rejected, or rejected by Stripe. Please see [this page for more details](https://stripe.com/docs/connect/)
RejectedReason AccountRiskControlsRejectedReason `json:"rejected_reason"`
}
type AccountSettingsBACSDebitPayments struct {
// The Bacs Direct Debit display name for this account. For payments made with Bacs Direct Debit, this name appears on the mandate as the statement descriptor. Mobile banking apps display it as the name of the business. To use custom branding, set the Bacs Direct Debit Display Name during or right after creation. Custom branding incurs an additional monthly fee for the platform. The fee appears 5 business days after requesting Bacs. If you don't set the display name before requesting Bacs capability, it's automatically set as "Stripe" and the account is onboarded to Stripe branding, which is free.
Expand Down
7 changes: 1 addition & 6 deletions accountlink/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@ func New(params *stripe.AccountLinkParams) (*stripe.AccountLink, error) {
func (c Client) New(params *stripe.AccountLinkParams) (*stripe.AccountLink, error) {
accountlink := &stripe.AccountLink{}
err := c.B.Call(
http.MethodPost,
"/v1/account_links",
c.Key,
params,
accountlink,
)
http.MethodPost, "/v1/account_links", c.Key, params, accountlink)
return accountlink, err
}

Expand Down
13 changes: 13 additions & 0 deletions accountsession.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,17 @@ type AccountSessionComponentsPayoutsListParams struct {
// The list of features enabled in the embedded component.
Features *AccountSessionComponentsPayoutsListFeaturesParams `form:"features"`
}

// The list of features enabled in the embedded component.
type AccountSessionComponentsProductTaxCodeSelectorFeaturesParams struct{}

// Configuration for the product tax code selector embedded component.
type AccountSessionComponentsProductTaxCodeSelectorParams struct {
// Whether the embedded component is enabled.
Enabled *bool `form:"enabled"`
// The list of features enabled in the embedded component.
Features *AccountSessionComponentsProductTaxCodeSelectorFeaturesParams `form:"features"`
}
type AccountSessionComponentsRecipientsFeaturesParams struct {
// Whether to allow sending money.
SendMoney *bool `form:"send_money"`
Expand Down Expand Up @@ -416,6 +427,8 @@ type AccountSessionComponentsParams struct {
Payouts *AccountSessionComponentsPayoutsParams `form:"payouts"`
// Configuration for the payouts list embedded component.
PayoutsList *AccountSessionComponentsPayoutsListParams `form:"payouts_list"`
// Configuration for the product tax code selector embedded component.
ProductTaxCodeSelector *AccountSessionComponentsProductTaxCodeSelectorParams `form:"product_tax_code_selector"`
// Configuration for the recipients component.
Recipients *AccountSessionComponentsRecipientsParams `form:"recipients"`
// Configuration for the reporting chart embedded component.
Expand Down
7 changes: 1 addition & 6 deletions accountsession/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@ func New(params *stripe.AccountSessionParams) (*stripe.AccountSession, error) {
func (c Client) New(params *stripe.AccountSessionParams) (*stripe.AccountSession, error) {
accountsession := &stripe.AccountSession{}
err := c.B.Call(
http.MethodPost,
"/v1/account_sessions",
c.Key,
params,
accountsession,
)
http.MethodPost, "/v1/account_sessions", c.Key, params, accountsession)
return accountsession, err
}

Expand Down
7 changes: 1 addition & 6 deletions applepaydomain/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,7 @@ func New(params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain, error) {
func (c Client) New(params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain, error) {
applepaydomain := &stripe.ApplePayDomain{}
err := c.B.Call(
http.MethodPost,
"/v1/apple_pay/domains",
c.Key,
params,
applepaydomain,
)
http.MethodPost, "/v1/apple_pay/domains", c.Key, params, applepaydomain)
return applepaydomain, err
}

Expand Down
14 changes: 2 additions & 12 deletions apps/secret/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,7 @@ func DeleteWhere(params *stripe.AppsSecretDeleteWhereParams) (*stripe.AppsSecret
func (c Client) DeleteWhere(params *stripe.AppsSecretDeleteWhereParams) (*stripe.AppsSecret, error) {
secret := &stripe.AppsSecret{}
err := c.B.Call(
http.MethodPost,
"/v1/apps/secrets/delete",
c.Key,
params,
secret,
)
http.MethodPost, "/v1/apps/secrets/delete", c.Key, params, secret)
return secret, err
}

Expand All @@ -59,12 +54,7 @@ func Find(params *stripe.AppsSecretFindParams) (*stripe.AppsSecret, error) {
func (c Client) Find(params *stripe.AppsSecretFindParams) (*stripe.AppsSecret, error) {
secret := &stripe.AppsSecret{}
err := c.B.Call(
http.MethodGet,
"/v1/apps/secrets/find",
c.Key,
params,
secret,
)
http.MethodGet, "/v1/apps/secrets/find", c.Key, params, secret)
return secret, err
}

Expand Down
6 changes: 3 additions & 3 deletions balance.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ type Amount struct {
SourceTypes map[BalanceSourceType]int64 `json:"source_types"`
}
type BalanceInstantAvailableNetAvailableSourceTypes struct {
// Amount for bank account.
// Amount coming from [legacy US ACH payments](https://docs.stripe.com/ach-deprecated).
BankAccount int64 `json:"bank_account"`
// Amount for card.
// Amount coming from most payment methods, including cards as well as [non-legacy bank debits](https://docs.stripe.com/payments/bank-debits).
Card int64 `json:"card"`
// Amount for FPX.
// Amount coming from [FPX](https://docs.stripe.com/payments/fpx), a Malaysian payment method.
FPX int64 `json:"fpx"`
}

Expand Down
5 changes: 2 additions & 3 deletions bankaccount.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,8 @@ func (p *BankAccountParams) AppendToAsSourceOrExternalAccount(body *form.Values)

if p.DefaultForCurrency != nil {
body.Add(
"default_for_currency",
strconv.FormatBool(BoolValue(p.DefaultForCurrency)),
)
"default_for_currency", strconv.FormatBool(
BoolValue(p.DefaultForCurrency)))
}
} else {
body.Add(sourceType+"[object]", "bank_account")
Expand Down
7 changes: 1 addition & 6 deletions billing/creditbalancesummary/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@ func Get(params *stripe.BillingCreditBalanceSummaryParams) (*stripe.BillingCredi
func (c Client) Get(params *stripe.BillingCreditBalanceSummaryParams) (*stripe.BillingCreditBalanceSummary, error) {
creditbalancesummary := &stripe.BillingCreditBalanceSummary{}
err := c.B.Call(
http.MethodGet,
"/v1/billing/credit_balance_summary",
c.Key,
params,
creditbalancesummary,
)
http.MethodGet, "/v1/billing/credit_balance_summary", c.Key, params, creditbalancesummary)
return creditbalancesummary, err
}

Expand Down
7 changes: 1 addition & 6 deletions billing/creditgrant/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,7 @@ func New(params *stripe.BillingCreditGrantParams) (*stripe.BillingCreditGrant, e
func (c Client) New(params *stripe.BillingCreditGrantParams) (*stripe.BillingCreditGrant, error) {
creditgrant := &stripe.BillingCreditGrant{}
err := c.B.Call(
http.MethodPost,
"/v1/billing/credit_grants",
c.Key,
params,
creditgrant,
)
http.MethodPost, "/v1/billing/credit_grants", c.Key, params, creditgrant)
return creditgrant, err
}

Expand Down
7 changes: 1 addition & 6 deletions billing/meterevent/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@ func New(params *stripe.BillingMeterEventParams) (*stripe.BillingMeterEvent, err
func (c Client) New(params *stripe.BillingMeterEventParams) (*stripe.BillingMeterEvent, error) {
meterevent := &stripe.BillingMeterEvent{}
err := c.B.Call(
http.MethodPost,
"/v1/billing/meter_events",
c.Key,
params,
meterevent,
)
http.MethodPost, "/v1/billing/meter_events", c.Key, params, meterevent)
return meterevent, err
}

Expand Down
7 changes: 1 addition & 6 deletions billing/metereventadjustment/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@ func New(params *stripe.BillingMeterEventAdjustmentParams) (*stripe.BillingMeter
func (c Client) New(params *stripe.BillingMeterEventAdjustmentParams) (*stripe.BillingMeterEventAdjustment, error) {
metereventadjustment := &stripe.BillingMeterEventAdjustment{}
err := c.B.Call(
http.MethodPost,
"/v1/billing/meter_event_adjustments",
c.Key,
params,
metereventadjustment,
)
http.MethodPost, "/v1/billing/meter_event_adjustments", c.Key, params, metereventadjustment)
return metereventadjustment, err
}

Expand Down
4 changes: 1 addition & 3 deletions billing/metereventsummary/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ func List(params *stripe.BillingMeterEventSummaryListParams) *Iter {
// Retrieve a list of billing meter event summaries.
func (c Client) List(listParams *stripe.BillingMeterEventSummaryListParams) *Iter {
path := stripe.FormatURLPath(
"/v1/billing/meters/%s/event_summaries",
stripe.StringValue(listParams.ID),
)
"/v1/billing/meters/%s/event_summaries", stripe.StringValue(listParams.ID))
return &Iter{
Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) {
list := &stripe.BillingMeterEventSummaryList{}
Expand Down
8 changes: 8 additions & 0 deletions billing_creditbalancesummary.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,16 @@ const (
BillingCreditBalanceSummaryBalanceLedgerBalanceTypeMonetary BillingCreditBalanceSummaryBalanceLedgerBalanceType = "monetary"
)

// A list of prices that the credit grant can apply to. We currently only support the `metered` prices.
type BillingCreditBalanceSummaryFilterApplicabilityScopePriceParams struct {
// The price ID this credit grant should apply to.
ID *string `form:"id"`
}

// The billing credit applicability scope for which to fetch credit balance summary.
type BillingCreditBalanceSummaryFilterApplicabilityScopeParams struct {
// A list of prices that the credit grant can apply to. We currently only support the `metered` prices.
Prices []*BillingCreditBalanceSummaryFilterApplicabilityScopePriceParams `form:"prices"`
// The price type that credit grants can apply to. We currently only support the `metered` price type.
PriceType *string `form:"price_type"`
}
Expand Down
16 changes: 16 additions & 0 deletions billing_creditgrant.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,16 @@ type BillingCreditGrantAmountParams struct {
Type *string `form:"type"`
}

// A list of prices that the credit grant can apply to. We currently only support the `metered` prices.
type BillingCreditGrantApplicabilityConfigScopePriceParams struct {
// The price ID this credit grant should apply to.
ID *string `form:"id"`
}

// Specify the scope of this applicability config.
type BillingCreditGrantApplicabilityConfigScopeParams struct {
// A list of prices that the credit grant can apply to. We currently only support the `metered` prices.
Prices []*BillingCreditGrantApplicabilityConfigScopePriceParams `form:"prices"`
// The price type that credit grants can apply to. We currently only support the `metered` price type.
PriceType *string `form:"price_type"`
}
Expand Down Expand Up @@ -149,7 +157,15 @@ type BillingCreditGrantAmount struct {
// The type of this amount. We currently only support `monetary` billing credits.
Type BillingCreditGrantAmountType `json:"type"`
}

// The prices that credit grants can apply to. We currently only support `metered` prices. This refers to prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them.
type BillingCreditGrantApplicabilityConfigScopePrice struct {
// Unique identifier for the object.
ID string `json:"id"`
}
type BillingCreditGrantApplicabilityConfigScope struct {
// The prices that credit grants can apply to. We currently only support `metered` prices. This refers to prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them.
Prices []*BillingCreditGrantApplicabilityConfigScopePrice `json:"prices"`
// The price type that credit grants can apply to. We currently only support the `metered` price type. This refers to prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them.
PriceType BillingCreditGrantApplicabilityConfigScopePriceType `json:"price_type"`
}
Expand Down
2 changes: 2 additions & 0 deletions billing_metereventsummary.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ func (p *BillingMeterEventSummaryListParams) AddExpand(f string) {

// A billing meter event summary represents an aggregated view of a customer's billing meter events within a specified timeframe. It indicates how much
// usage was accrued by a customer for that period.
//
// Note: Meters events are aggregated asynchronously so the meter event summaries provide an eventually consistent view of the reported usage.
type BillingMeterEventSummary struct {
// Aggregated value of all the events within `start_time` (inclusive) and `end_time` (inclusive). The aggregation strategy is defined on meter via `default_aggregation`.
AggregatedValue float64 `json:"aggregated_value"`
Expand Down
7 changes: 1 addition & 6 deletions billingportal/configuration/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,7 @@ func New(params *stripe.BillingPortalConfigurationParams) (*stripe.BillingPortal
func (c Client) New(params *stripe.BillingPortalConfigurationParams) (*stripe.BillingPortalConfiguration, error) {
configuration := &stripe.BillingPortalConfiguration{}
err := c.B.Call(
http.MethodPost,
"/v1/billing_portal/configurations",
c.Key,
params,
configuration,
)
http.MethodPost, "/v1/billing_portal/configurations", c.Key, params, configuration)
return configuration, err
}

Expand Down
7 changes: 1 addition & 6 deletions billingportal/session/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@ func New(params *stripe.BillingPortalSessionParams) (*stripe.BillingPortalSessio
func (c Client) New(params *stripe.BillingPortalSessionParams) (*stripe.BillingPortalSession, error) {
session := &stripe.BillingPortalSession{}
err := c.B.Call(
http.MethodPost,
"/v1/billing_portal/sessions",
c.Key,
params,
session,
)
http.MethodPost, "/v1/billing_portal/sessions", c.Key, params, session)
return session, err
}

Expand Down
Loading

0 comments on commit 56fca0e

Please sign in to comment.