Skip to content

Commit

Permalink
Update generated code (#1729)
Browse files Browse the repository at this point in the history
* Update generated code for v515

* Update generated code for v516

* Update generated code for v517

* Update generated code for v519

* Update generated code for v520

* Update generated code for v522

* Update generated code for v522

* Update generated code for v523

* Update generated code for v524

* Update generated code for v525

* Update generated code for v525

* Update generated code for v525

* Update generated code for v526

* Update generated code for v526

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
Co-authored-by: Richard Marmorstein <[email protected]>
  • Loading branch information
stripe-openapi[bot] and richardm-stripe authored Sep 14, 2023
1 parent 745ca66 commit 54238ea
Show file tree
Hide file tree
Showing 14 changed files with 673 additions and 8 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v512
v526
10 changes: 5 additions & 5 deletions balance.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (p *BalanceParams) AddExpand(f string) {
p.Expand = append(p.Expand, &f)
}

// Funds that are available to be transferred or paid out, whether automatically by Stripe or explicitly via the [Transfers API](https://stripe.com/docs/api#transfers) or [Payouts API](https://stripe.com/docs/api#payouts). The available balance for each currency and payment type can be found in the `source_types` property.
// Available funds that you can transfer or pay out automatically by Stripe or explicitly through the [Transfers API](https://stripe.com/docs/api#transfers) or [Payouts API](https://stripe.com/docs/api#payouts). You can find the available balance for each currency and payment type in the `source_types` property.
type Amount struct {
// Balance amount.
Amount int64 `json:"amount"`
Expand All @@ -56,17 +56,17 @@ type BalanceIssuing struct {
// Related guide: [Understanding Connect account balances](https://stripe.com/docs/connect/account-balances)
type Balance struct {
APIResource
// Funds that are available to be transferred or paid out, whether automatically by Stripe or explicitly via the [Transfers API](https://stripe.com/docs/api#transfers) or [Payouts API](https://stripe.com/docs/api#payouts). The available balance for each currency and payment type can be found in the `source_types` property.
// Available funds that you can transfer or pay out automatically by Stripe or explicitly through the [Transfers API](https://stripe.com/docs/api#transfers) or [Payouts API](https://stripe.com/docs/api#payouts). You can find the available balance for each currency and payment type in the `source_types` property.
Available []*Amount `json:"available"`
// Funds held due to negative balances on connected Custom accounts. The connect reserve balance for each currency and payment type can be found in the `source_types` property.
// Funds held due to negative balances on connected Custom accounts. You can find the connect reserve balance for each currency and payment type in the `source_types` property.
ConnectReserved []*Amount `json:"connect_reserved"`
// Funds that can be paid out using Instant Payouts.
// Funds that you can pay out using Instant Payouts.
InstantAvailable []*Amount `json:"instant_available"`
Issuing *BalanceIssuing `json:"issuing"`
// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
Livemode bool `json:"livemode"`
// String representing the object's type. Objects of the same type share the same value.
Object string `json:"object"`
// Funds that are not yet available in the balance. The pending balance for each currency, and for each payment type, can be found in the `source_types` property.
// Funds that aren't available in the balance yet. You can find the pending balance for each currency and each payment type in the `source_types` property.
Pending []*Amount `json:"pending"`
}
8 changes: 8 additions & 0 deletions client/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ import (
terminallocation "github.com/stripe/stripe-go/v75/terminal/location"
terminalreader "github.com/stripe/stripe-go/v75/terminal/reader"
testhelperscustomer "github.com/stripe/stripe-go/v75/testhelpers/customer"
testhelpersissuingauthorization "github.com/stripe/stripe-go/v75/testhelpers/issuing/authorization"
testhelpersissuingcard "github.com/stripe/stripe-go/v75/testhelpers/issuing/card"
testhelpersissuingtransaction "github.com/stripe/stripe-go/v75/testhelpers/issuing/transaction"
testhelpersrefund "github.com/stripe/stripe-go/v75/testhelpers/refund"
testhelpersterminalreader "github.com/stripe/stripe-go/v75/testhelpers/terminal/reader"
testhelperstestclock "github.com/stripe/stripe-go/v75/testhelpers/testclock"
Expand Down Expand Up @@ -282,8 +284,12 @@ type API struct {
TerminalReaders *terminalreader.Client
// TestHelpersCustomers is the client used to invoke /customers APIs.
TestHelpersCustomers *testhelperscustomer.Client
// TestHelpersIssuingAuthorizations is the client used to invoke /issuing/authorizations APIs.
TestHelpersIssuingAuthorizations *testhelpersissuingauthorization.Client
// TestHelpersIssuingCards is the client used to invoke /issuing/cards APIs.
TestHelpersIssuingCards *testhelpersissuingcard.Client
// TestHelpersIssuingTransactions is the client used to invoke /issuing/transactions APIs.
TestHelpersIssuingTransactions *testhelpersissuingtransaction.Client
// TestHelpersRefunds is the client used to invoke /refunds APIs.
TestHelpersRefunds *testhelpersrefund.Client
// TestHelpersTerminalReaders is the client used to invoke /terminal/readers APIs.
Expand Down Expand Up @@ -427,7 +433,9 @@ func (a *API) Init(key string, backends *stripe.Backends) {
a.TerminalLocations = &terminallocation.Client{B: backends.API, Key: key}
a.TerminalReaders = &terminalreader.Client{B: backends.API, Key: key}
a.TestHelpersCustomers = &testhelperscustomer.Client{B: backends.API, Key: key}
a.TestHelpersIssuingAuthorizations = &testhelpersissuingauthorization.Client{B: backends.API, Key: key}
a.TestHelpersIssuingCards = &testhelpersissuingcard.Client{B: backends.API, Key: key}
a.TestHelpersIssuingTransactions = &testhelpersissuingtransaction.Client{B: backends.API, Key: key}
a.TestHelpersRefunds = &testhelpersrefund.Client{B: backends.API, Key: key}
a.TestHelpersTerminalReaders = &testhelpersterminalreader.Client{B: backends.API, Key: key}
a.TestHelpersTestClocks = &testhelperstestclock.Client{B: backends.API, Key: key}
Expand Down
2 changes: 2 additions & 0 deletions ephemeralkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ type EphemeralKeyParams struct {
Expand []*string `form:"expand"`
// The ID of the Issuing Card you'd like to access using the resulting ephemeral key.
IssuingCard *string `form:"issuing_card"`
// A single-use token, created by Stripe.js, used for creating ephemeral keys for Issuing Cards without exchanging sensitive information.
Nonce *string `form:"nonce"`
// The ID of the Identity VerificationSession you'd like to access using the resulting ephemeral key
VerificationSession *string `form:"verification_session"`
StripeVersion *string `form:"-"` // This goes in the `Stripe-Version` header
Expand Down
1 change: 1 addition & 0 deletions error.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ const (
ErrorCodeShippingCalculationFailed ErrorCode = "shipping_calculation_failed"
ErrorCodeStateUnsupported ErrorCode = "state_unsupported"
ErrorCodeStatusTransitionInvalid ErrorCode = "status_transition_invalid"
ErrorCodeStripeTaxInactive ErrorCode = "stripe_tax_inactive"
ErrorCodeTLSVersionUnsupported ErrorCode = "tls_version_unsupported"
ErrorCodeTaxIDInvalid ErrorCode = "tax_id_invalid"
ErrorCodeTaxesCalculationFailed ErrorCode = "taxes_calculation_failed"
Expand Down
2 changes: 2 additions & 0 deletions issuing_authorization.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ func (p *IssuingAuthorizationDeclineParams) AddMetadata(key string, value string
type IssuingAuthorizationAmountDetails struct {
// The fee charged by the ATM for the cash withdrawal.
ATMFee int64 `json:"atm_fee"`
// The amount of cash requested by the cardholder.
CashbackAmount int64 `json:"cashback_amount"`
}
type IssuingAuthorizationMerchantData struct {
// A categorization of the seller's type of business. See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values.
Expand Down
2 changes: 2 additions & 0 deletions issuing_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ func (p *IssuingTransactionParams) AddMetadata(key string, value string) {
type IssuingTransactionAmountDetails struct {
// The fee charged by the ATM for the cash withdrawal.
ATMFee int64 `json:"atm_fee"`
// The amount of cash requested by the cardholder.
CashbackAmount int64 `json:"cashback_amount"`
}

// The legs of the trip.
Expand Down
2 changes: 1 addition & 1 deletion paymentintent.go
Original file line number Diff line number Diff line change
Expand Up @@ -1679,7 +1679,7 @@ type PaymentIntentParams struct {
AutomaticPaymentMethods *PaymentIntentAutomaticPaymentMethodsParams `form:"automatic_payment_methods"`
// Controls when the funds will be captured from the customer's account.
CaptureMethod *string `form:"capture_method"`
// The client secret of the PaymentIntent. Required if a publishable key is used to retrieve the source.
// The client secret of the PaymentIntent. It's required if you use a publishable key to retrieve the source.
ClientSecret *string `form:"client_secret"`
// Set to `true` to attempt to [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent immediately. This parameter defaults to `false`. When creating and confirming a PaymentIntent at the same time, parameters available in the [confirm](https://stripe.com/docs/api/payment_intents/confirm) API may also be provided.
Confirm *bool `form:"confirm"`
Expand Down
2 changes: 1 addition & 1 deletion taxid.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const (
TaxIDVerificationStatusVerified TaxIDVerificationStatus = "verified"
)

// Creates a new TaxID object for a customer.
// Creates a new tax_id object for a customer.
type TaxIDParams struct {
Params `form:"*"`
Customer *string `form:"-"` // Included in URL
Expand Down
2 changes: 2 additions & 0 deletions terminal_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ type TerminalReaderListParams struct {
Expand []*string `form:"expand"`
// A location ID to filter the response list to only readers at the specific location
Location *string `form:"location"`
// Filters readers by serial number
SerialNumber *string `form:"serial_number"`
// A status filter to filter readers to only offline or online readers
Status *string `form:"status"`
}
Expand Down
106 changes: 106 additions & 0 deletions testhelpers/issuing/authorization/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
//
//
// File generated from our OpenAPI spec
//
//

// Package authorization provides the /issuing/authorizations APIs
package authorization

import (
"net/http"

stripe "github.com/stripe/stripe-go/v75"
)

// Client is used to invoke /issuing/authorizations APIs.
type Client struct {
B stripe.Backend
Key string
}

// New creates a new issuing authorization.
func New(params *stripe.TestHelpersIssuingAuthorizationParams) (*stripe.IssuingAuthorization, error) {
return getC().New(params)
}

// New creates a new issuing authorization.
func (c Client) New(params *stripe.TestHelpersIssuingAuthorizationParams) (*stripe.IssuingAuthorization, error) {
authorization := &stripe.IssuingAuthorization{}
err := c.B.Call(
http.MethodPost,
"/v1/test_helpers/issuing/authorizations",
c.Key,
params,
authorization,
)
return authorization, err
}

// Capture is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/capture` API.
func Capture(id string, params *stripe.TestHelpersIssuingAuthorizationCaptureParams) (*stripe.IssuingAuthorization, error) {
return getC().Capture(id, params)
}

// Capture is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/capture` API.
func (c Client) Capture(id string, params *stripe.TestHelpersIssuingAuthorizationCaptureParams) (*stripe.IssuingAuthorization, error) {
path := stripe.FormatURLPath(
"/v1/test_helpers/issuing/authorizations/%s/capture",
id,
)
authorization := &stripe.IssuingAuthorization{}
err := c.B.Call(http.MethodPost, path, c.Key, params, authorization)
return authorization, err
}

// Expire is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/expire` API.
func Expire(id string, params *stripe.TestHelpersIssuingAuthorizationExpireParams) (*stripe.IssuingAuthorization, error) {
return getC().Expire(id, params)
}

// Expire is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/expire` API.
func (c Client) Expire(id string, params *stripe.TestHelpersIssuingAuthorizationExpireParams) (*stripe.IssuingAuthorization, error) {
path := stripe.FormatURLPath(
"/v1/test_helpers/issuing/authorizations/%s/expire",
id,
)
authorization := &stripe.IssuingAuthorization{}
err := c.B.Call(http.MethodPost, path, c.Key, params, authorization)
return authorization, err
}

// Increment is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/increment` API.
func Increment(id string, params *stripe.TestHelpersIssuingAuthorizationIncrementParams) (*stripe.IssuingAuthorization, error) {
return getC().Increment(id, params)
}

// Increment is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/increment` API.
func (c Client) Increment(id string, params *stripe.TestHelpersIssuingAuthorizationIncrementParams) (*stripe.IssuingAuthorization, error) {
path := stripe.FormatURLPath(
"/v1/test_helpers/issuing/authorizations/%s/increment",
id,
)
authorization := &stripe.IssuingAuthorization{}
err := c.B.Call(http.MethodPost, path, c.Key, params, authorization)
return authorization, err
}

// Reverse is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/reverse` API.
func Reverse(id string, params *stripe.TestHelpersIssuingAuthorizationReverseParams) (*stripe.IssuingAuthorization, error) {
return getC().Reverse(id, params)
}

// Reverse is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/reverse` API.
func (c Client) Reverse(id string, params *stripe.TestHelpersIssuingAuthorizationReverseParams) (*stripe.IssuingAuthorization, error) {
path := stripe.FormatURLPath(
"/v1/test_helpers/issuing/authorizations/%s/reverse",
id,
)
authorization := &stripe.IssuingAuthorization{}
err := c.B.Call(http.MethodPost, path, c.Key, params, authorization)
return authorization, err
}

func getC() Client {
return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key}
}
76 changes: 76 additions & 0 deletions testhelpers/issuing/transaction/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
//
//
// File generated from our OpenAPI spec
//
//

// Package transaction provides the /issuing/transactions APIs
package transaction

import (
"net/http"

stripe "github.com/stripe/stripe-go/v75"
)

// Client is used to invoke /issuing/transactions APIs.
type Client struct {
B stripe.Backend
Key string
}

// CreateForceCapture is the method for the `POST /v1/test_helpers/issuing/transactions/create_force_capture` API.
func CreateForceCapture(params *stripe.TestHelpersIssuingTransactionCreateForceCaptureParams) (*stripe.IssuingTransaction, error) {
return getC().CreateForceCapture(params)
}

// CreateForceCapture is the method for the `POST /v1/test_helpers/issuing/transactions/create_force_capture` API.
func (c Client) CreateForceCapture(params *stripe.TestHelpersIssuingTransactionCreateForceCaptureParams) (*stripe.IssuingTransaction, error) {
transaction := &stripe.IssuingTransaction{}
err := c.B.Call(
http.MethodPost,
"/v1/test_helpers/issuing/transactions/create_force_capture",
c.Key,
params,
transaction,
)
return transaction, err
}

// CreateUnlinkedRefund is the method for the `POST /v1/test_helpers/issuing/transactions/create_unlinked_refund` API.
func CreateUnlinkedRefund(params *stripe.TestHelpersIssuingTransactionCreateUnlinkedRefundParams) (*stripe.IssuingTransaction, error) {
return getC().CreateUnlinkedRefund(params)
}

// CreateUnlinkedRefund is the method for the `POST /v1/test_helpers/issuing/transactions/create_unlinked_refund` API.
func (c Client) CreateUnlinkedRefund(params *stripe.TestHelpersIssuingTransactionCreateUnlinkedRefundParams) (*stripe.IssuingTransaction, error) {
transaction := &stripe.IssuingTransaction{}
err := c.B.Call(
http.MethodPost,
"/v1/test_helpers/issuing/transactions/create_unlinked_refund",
c.Key,
params,
transaction,
)
return transaction, err
}

// Refund is the method for the `POST /v1/test_helpers/issuing/transactions/{transaction}/refund` API.
func Refund(id string, params *stripe.TestHelpersIssuingTransactionRefundParams) (*stripe.IssuingTransaction, error) {
return getC().Refund(id, params)
}

// Refund is the method for the `POST /v1/test_helpers/issuing/transactions/{transaction}/refund` API.
func (c Client) Refund(id string, params *stripe.TestHelpersIssuingTransactionRefundParams) (*stripe.IssuingTransaction, error) {
path := stripe.FormatURLPath(
"/v1/test_helpers/issuing/transactions/%s/refund",
id,
)
transaction := &stripe.IssuingTransaction{}
err := c.B.Call(http.MethodPost, path, c.Key, params, transaction)
return transaction, err
}

func getC() Client {
return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key}
}
Loading

0 comments on commit 54238ea

Please sign in to comment.