Skip to content

Commit

Permalink
Merge pull request #1857 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] committed May 9, 2024
2 parents 02de663 + efce995 commit e3b9083
Show file tree
Hide file tree
Showing 161 changed files with 2,103 additions and 1,146 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@
* Add support for `Multibanco` on `CheckoutSessionPaymentMethodOptionsParams` and `CheckoutSessionPaymentMethodOptions`
* Add support for new value `rechnung` on enums `ConfirmationTokenPaymentMethodPreviewType` and `PaymentMethodType`

## 78.5.0 - 2024-05-02
* [#1853](https://github.com/stripe/stripe-go/pull/1853) Update generated code
* Add support for new value `shipping_address_invalid` on enums `InvoiceLastFinalizationErrorCode`, `PaymentIntentLastPaymentErrorCode`, `SetupAttemptSetupErrorCode`, `SetupIntentLastSetupErrorCode`, and `StripeErrorCode`
* Add support for `Paypal` on `DisputePaymentMethodDetails`
* Change type of `DisputePaymentMethodDetailsType` from `literal('card')` to `enum('card'|'paypal')`
* Change type of `EntitlementsFeatureMetadataParams` from `map(string: string)` to `emptyable(map(string: string))`
* Add support for `PaymentMethodTypes` on `PaymentIntentConfirmParams`
* Add support for `ShipFromDetails` on `TaxCalculationParams`, `TaxCalculation`, and `TaxTransaction`
* Add support for `Bh`, `Eg`, `Ge`, `Ke`, `Kz`, `Ng`, and `Om` on `TaxRegistrationCountryOptionsParams` and `TaxRegistrationCountryOptions`
* [#1856](https://github.com/stripe/stripe-go/pull/1856) Deprecate Go methods and Params
- Mark as deprecated the `Approve` and `Decline` methods on `issuing/authorization/client.go`. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
- Mark as deprecated the `persistent_token` property on `ConfirmationTokenPaymentMethodPreviewLink.persistent_token`, `PaymentIntentPaymentMethodOptionsLink`, `PaymentIntentPaymentMethodOptionsLinkParams`, `PaymentMethodLink`, `SetupIntentPaymentMethodOptionsCard`, `SetupIntentPaymentMethodOptionsLinkParams`. This is a legacy parameter that no longer has any function.

## 78.5.0-beta.1 - 2024-04-25
* [#1850](https://github.com/stripe/stripe-go/pull/1850) Update generated code for beta
* Add support for `PaymentMethodSettings` on `AccountSessionComponentsParams`
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1008
v1020
2 changes: 1 addition & 1 deletion account.go
Original file line number Diff line number Diff line change
Expand Up @@ -1634,7 +1634,7 @@ type Account struct {
// Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts).
DefaultCurrency Currency `json:"default_currency"`
Deleted bool `json:"deleted"`
// Whether account details have been submitted. Accounts with Stripe Dashboard access, which includes Standard accounts, cannot receive payouts before this is true.
// Whether account details have been submitted. Accounts with Stripe Dashboard access, which includes Standard accounts, cannot receive payouts before this is true. Accounts where this is false should be directed to [an onboarding flow](https://stripe.com/connect/onboarding) to finish submitting account details.
DetailsSubmitted bool `json:"details_submitted"`
// An email address associated with the account. It's not used for authentication and Stripe doesn't market to this field without explicit approval from the platform.
Email string `json:"email"`
Expand Down
74 changes: 62 additions & 12 deletions account/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,22 @@ type Client struct {
Key string
}

// New creates a new account.
// With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users.
// To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings).
//
// If you've already collected information for your connected accounts, you [can prefill that information](https://stripe.com/docs/connect/best-practices#onboarding) when
// creating the account. Connect Onboarding won't ask for the prefilled information during account onboarding.
// You can prefill any information on the account.
func New(params *stripe.AccountParams) (*stripe.Account, error) {
return getC().New(params)
}

// New creates a new account.
// With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users.
// To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings).
//
// If you've already collected information for your connected accounts, you [can prefill that information](https://stripe.com/docs/connect/best-practices#onboarding) when
// creating the account. Connect Onboarding won't ask for the prefilled information during account onboarding.
// You can prefill any information on the account.
func (c Client) New(params *stripe.AccountParams) (*stripe.Account, error) {
account := &stripe.Account{}
err := c.B.Call(http.MethodPost, "/v1/accounts", c.Key, params, account)
Expand All @@ -44,64 +54,104 @@ func (c Client) Get() (*stripe.Account, error) {
return account, err
}

// GetByID returns the details of an account.
// Retrieves the details of an account.
func GetByID(id string, params *stripe.AccountParams) (*stripe.Account, error) {
return getC().GetByID(id, params)
}

// GetByID returns the details of an account.
// Retrieves the details of an account.
func (c Client) GetByID(id string, params *stripe.AccountParams) (*stripe.Account, error) {
path := stripe.FormatURLPath("/v1/accounts/%s", id)
account := &stripe.Account{}
err := c.B.Call(http.MethodGet, path, c.Key, params, account)
return account, err
}

// Update updates an account's properties.
// Updates a [connected account](https://stripe.com/connect/accounts) by setting the values of the parameters passed. Any parameters not provided are
// left unchanged.
//
// For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection)
// is application, which includes Custom accounts, you can update any information on the account.
//
// For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection)
// is stripe, which includes Standard and Express accounts, you can update all information until you create
// an [Account Link or <a href="/api/account_sessions">Account Session](https://stripe.com/api/account_links) to start Connect onboarding,
// after which some properties can no longer be updated.
//
// To update your own account, use the [Dashboard](https://dashboard.stripe.com/settings/account). Refer to our
// [Connect](https://stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts.
func Update(id string, params *stripe.AccountParams) (*stripe.Account, error) {
return getC().Update(id, params)
}

// Update updates an account's properties.
// Updates a [connected account](https://stripe.com/connect/accounts) by setting the values of the parameters passed. Any parameters not provided are
// left unchanged.
//
// For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection)
// is application, which includes Custom accounts, you can update any information on the account.
//
// For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection)
// is stripe, which includes Standard and Express accounts, you can update all information until you create
// an [Account Link or <a href="/api/account_sessions">Account Session](https://stripe.com/api/account_links) to start Connect onboarding,
// after which some properties can no longer be updated.
//
// To update your own account, use the [Dashboard](https://dashboard.stripe.com/settings/account). Refer to our
// [Connect](https://stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts.
func (c Client) Update(id string, params *stripe.AccountParams) (*stripe.Account, error) {
path := stripe.FormatURLPath("/v1/accounts/%s", id)
account := &stripe.Account{}
err := c.B.Call(http.MethodPost, path, c.Key, params, account)
return account, err
}

// Del removes an account.
// With [Connect](https://stripe.com/connect), you can delete accounts you manage.
//
// Test-mode accounts can be deleted at any time.
//
// Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero.
//
// If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead.
func Del(id string, params *stripe.AccountParams) (*stripe.Account, error) {
return getC().Del(id, params)
}

// Del removes an account.
// With [Connect](https://stripe.com/connect), you can delete accounts you manage.
//
// Test-mode accounts can be deleted at any time.
//
// Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero.
//
// If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead.
func (c Client) Del(id string, params *stripe.AccountParams) (*stripe.Account, error) {
path := stripe.FormatURLPath("/v1/accounts/%s", id)
account := &stripe.Account{}
err := c.B.Call(http.MethodDelete, path, c.Key, params, account)
return account, err
}

// Reject is the method for the `POST /v1/accounts/{account}/reject` API.
// With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious.
//
// Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero.
func Reject(id string, params *stripe.AccountRejectParams) (*stripe.Account, error) {
return getC().Reject(id, params)
}

// Reject is the method for the `POST /v1/accounts/{account}/reject` API.
// With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious.
//
// Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero.
func (c Client) Reject(id string, params *stripe.AccountRejectParams) (*stripe.Account, error) {
path := stripe.FormatURLPath("/v1/accounts/%s/reject", id)
account := &stripe.Account{}
err := c.B.Call(http.MethodPost, path, c.Key, params, account)
return account, err
}

// List returns a list of accounts.
// Returns a list of accounts connected to your platform via [Connect](https://stripe.com/docs/connect). If you're not a platform, the list is empty.
func List(params *stripe.AccountListParams) *Iter {
return getC().List(params)
}

// List returns a list of accounts.
// Returns a list of accounts connected to your platform via [Connect](https://stripe.com/docs/connect). If you're not a platform, the list is empty.
func (c Client) List(listParams *stripe.AccountListParams) *Iter {
return &Iter{
Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) {
Expand Down
4 changes: 2 additions & 2 deletions accountlink/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ type Client struct {
Key string
}

// New creates a new account link.
// Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow.
func New(params *stripe.AccountLinkParams) (*stripe.AccountLink, error) {
return getC().New(params)
}

// New creates a new account link.
// Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow.
func (c Client) New(params *stripe.AccountLinkParams) (*stripe.AccountLink, error) {
accountlink := &stripe.AccountLink{}
err := c.B.Call(
Expand Down
12 changes: 6 additions & 6 deletions accountnotice/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,38 +20,38 @@ type Client struct {
Key string
}

// Get returns the details of an account notice.
// Retrieves an AccountNotice object.
func Get(id string, params *stripe.AccountNoticeParams) (*stripe.AccountNotice, error) {
return getC().Get(id, params)
}

// Get returns the details of an account notice.
// Retrieves an AccountNotice object.
func (c Client) Get(id string, params *stripe.AccountNoticeParams) (*stripe.AccountNotice, error) {
path := stripe.FormatURLPath("/v1/account_notices/%s", id)
accountnotice := &stripe.AccountNotice{}
err := c.B.Call(http.MethodGet, path, c.Key, params, accountnotice)
return accountnotice, err
}

// Update updates an account notice's properties.
// Updates an AccountNotice object.
func Update(id string, params *stripe.AccountNoticeParams) (*stripe.AccountNotice, error) {
return getC().Update(id, params)
}

// Update updates an account notice's properties.
// Updates an AccountNotice object.
func (c Client) Update(id string, params *stripe.AccountNoticeParams) (*stripe.AccountNotice, error) {
path := stripe.FormatURLPath("/v1/account_notices/%s", id)
accountnotice := &stripe.AccountNotice{}
err := c.B.Call(http.MethodPost, path, c.Key, params, accountnotice)
return accountnotice, err
}

// List returns a list of account notices.
// Retrieves a list of AccountNotice objects. The objects are sorted in descending order by creation date, with the most-recently-created object appearing first.
func List(params *stripe.AccountNoticeListParams) *Iter {
return getC().List(params)
}

// List returns a list of account notices.
// Retrieves a list of AccountNotice objects. The objects are sorted in descending order by creation date, with the most-recently-created object appearing first.
func (c Client) List(listParams *stripe.AccountNoticeListParams) *Iter {
return &Iter{
Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) {
Expand Down
4 changes: 2 additions & 2 deletions accountsession/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ type Client struct {
Key string
}

// New creates a new account session.
// Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access.
func New(params *stripe.AccountSessionParams) (*stripe.AccountSession, error) {
return getC().New(params)
}

// New creates a new account session.
// Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access.
func (c Client) New(params *stripe.AccountSessionParams) (*stripe.AccountSession, error) {
accountsession := &stripe.AccountSession{}
err := c.B.Call(
Expand Down
16 changes: 8 additions & 8 deletions applepaydomain/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ type Client struct {
Key string
}

// New creates a new apple pay domain.
// Create an apple pay domain.
func New(params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain, error) {
return getC().New(params)
}

// New creates a new apple pay domain.
// Create an apple pay domain.
func (c Client) New(params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain, error) {
applepaydomain := &stripe.ApplePayDomain{}
err := c.B.Call(
Expand All @@ -38,38 +38,38 @@ func (c Client) New(params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain
return applepaydomain, err
}

// Get returns the details of an apple pay domain.
// Retrieve an apple pay domain.
func Get(id string, params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain, error) {
return getC().Get(id, params)
}

// Get returns the details of an apple pay domain.
// Retrieve an apple pay domain.
func (c Client) Get(id string, params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain, error) {
path := stripe.FormatURLPath("/v1/apple_pay/domains/%s", id)
applepaydomain := &stripe.ApplePayDomain{}
err := c.B.Call(http.MethodGet, path, c.Key, params, applepaydomain)
return applepaydomain, err
}

// Del removes an apple pay domain.
// Delete an apple pay domain.
func Del(id string, params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain, error) {
return getC().Del(id, params)
}

// Del removes an apple pay domain.
// Delete an apple pay domain.
func (c Client) Del(id string, params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain, error) {
path := stripe.FormatURLPath("/v1/apple_pay/domains/%s", id)
applepaydomain := &stripe.ApplePayDomain{}
err := c.B.Call(http.MethodDelete, path, c.Key, params, applepaydomain)
return applepaydomain, err
}

// List returns a list of apple pay domains.
// List apple pay domains.
func List(params *stripe.ApplePayDomainListParams) *Iter {
return getC().List(params)
}

// List returns a list of apple pay domains.
// List apple pay domains.
func (c Client) List(listParams *stripe.ApplePayDomainListParams) *Iter {
return &Iter{
Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) {
Expand Down
8 changes: 4 additions & 4 deletions applicationfee/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,25 @@ type Client struct {
Key string
}

// Get returns the details of an application fee.
// Retrieves the details of an application fee that your account has collected. The same information is returned when refunding the application fee.
func Get(id string, params *stripe.ApplicationFeeParams) (*stripe.ApplicationFee, error) {
return getC().Get(id, params)
}

// Get returns the details of an application fee.
// Retrieves the details of an application fee that your account has collected. The same information is returned when refunding the application fee.
func (c Client) Get(id string, params *stripe.ApplicationFeeParams) (*stripe.ApplicationFee, error) {
path := stripe.FormatURLPath("/v1/application_fees/%s", id)
applicationfee := &stripe.ApplicationFee{}
err := c.B.Call(http.MethodGet, path, c.Key, params, applicationfee)
return applicationfee, err
}

// List returns a list of application fees.
// Returns a list of application fees you've previously collected. The application fees are returned in sorted order, with the most recent fees appearing first.
func List(params *stripe.ApplicationFeeListParams) *Iter {
return getC().List(params)
}

// List returns a list of application fees.
// Returns a list of application fees you've previously collected. The application fees are returned in sorted order, with the most recent fees appearing first.
func (c Client) List(listParams *stripe.ApplicationFeeListParams) *Iter {
return &Iter{
Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) {
Expand Down

0 comments on commit e3b9083

Please sign in to comment.