From 25492a8e47bda19a2944d1d449832bef7c668c47 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 28 Jul 2023 09:24:58 -0700 Subject: [PATCH] Update generated code (#1693) * Update generated code for v425 * Update generated code for v426 * Update generated code for v426 * Update generated code for v431 * Update generated code for v433 * Update generated code for v434 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- account.go | 22 ++++++++++++++++++++-- client/api.go | 4 ++-- example/generated_examples_test.go | 7 +++++++ file/client.go | 11 ++++++++--- invoice.go | 8 ++++++++ paymentintent.go | 4 ++-- paymentmethod.go | 2 +- person.go | 2 +- quote/client.go | 14 ++++++++++++-- setupintent.go | 4 ++-- 11 files changed, 64 insertions(+), 16 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index ae2bb14615..e3059d5b46 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v425 \ No newline at end of file +v434 \ No newline at end of file diff --git a/account.go b/account.go index 239bc9efb9..705ea4c424 100644 --- a/account.go +++ b/account.go @@ -177,10 +177,20 @@ type AccountParams struct { Type *string `form:"type"` } +// An estimate of the monthly revenue of the business. Only accepted for accounts in Brazil and India. +type AccountBusinessProfileMonthlyEstimatedRevenueParams struct { + // A non-negative integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + Amount *int64 `form:"amount"` + // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + Currency *string `form:"currency"` +} + // Business information about the account. type AccountBusinessProfileParams struct { // [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. MCC *string `form:"mcc"` + // An estimate of the monthly revenue of the business. Only accepted for accounts in Brazil and India. + MonthlyEstimatedRevenue *AccountBusinessProfileMonthlyEstimatedRevenueParams `form:"monthly_estimated_revenue"` // The customer-facing business name. Name *string `form:"name"` // Internal-only description of the product sold by, or service provided by, the business. Used by Stripe for risk and underwriting purposes. @@ -830,10 +840,18 @@ func (p *AccountExternalAccountParams) AppendTo(body *form.Values, keyParts []st } } +type AccountBusinessProfileMonthlyEstimatedRevenue struct { + // A non-negative integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + Amount int64 `json:"amount"` + // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + Currency Currency `json:"currency"` +} + // Business information about the account. type AccountBusinessProfile struct { // [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. - MCC string `json:"mcc"` + MCC string `json:"mcc"` + MonthlyEstimatedRevenue *AccountBusinessProfileMonthlyEstimatedRevenue `json:"monthly_estimated_revenue"` // The customer-facing business name. Name string `json:"name"` // Internal-only description of the product sold or service provided by the business. It's used by Stripe for risk and underwriting purposes. @@ -1251,7 +1269,7 @@ type Account struct { // This is an object representing a person associated with a Stripe account. // // A platform cannot access a Standard or Express account's persons after the account starts onboarding, such as after generating an account link for the account. - // See the [Standard onboarding](https://stripe.com/docs/connect/standard-accounts) or [Express onboarding documentation](https://stripe.com/docs/connect/express-accounts) for information about platform pre-filling and account onboarding steps. + // See the [Standard onboarding](https://stripe.com/docs/connect/standard-accounts) or [Express onboarding documentation](https://stripe.com/docs/connect/express-accounts) for information about platform prefilling and account onboarding steps. // // Related guide: [Handling identity verification with the API](https://stripe.com/docs/connect/identity-verification-api#person-information) Individual *Person `json:"individual"` diff --git a/client/api.go b/client/api.go index ae1abb3880..e7e9787e45 100644 --- a/client/api.go +++ b/client/api.go @@ -366,7 +366,7 @@ func (a *API) Init(key string, backends *stripe.Backends) { a.Events = &event.Client{B: backends.API, Key: key} a.FeeRefunds = &feerefund.Client{B: backends.API, Key: key} a.FileLinks = &filelink.Client{B: backends.API, Key: key} - a.Files = &file.Client{B: backends.Uploads, Key: key} + a.Files = &file.Client{B: backends.Uploads, BUploads: backends.Uploads, Key: key} a.FinancialConnectionsAccounts = &financialconnectionsaccount.Client{B: backends.API, Key: key} a.FinancialConnectionsSessions = &financialconnectionssession.Client{B: backends.API, Key: key} a.IdentityVerificationReports = &identityverificationreport.Client{B: backends.API, Key: key} @@ -391,7 +391,7 @@ func (a *API) Init(key string, backends *stripe.Backends) { a.Prices = &price.Client{B: backends.API, Key: key} a.Products = &product.Client{B: backends.API, Key: key} a.PromotionCodes = &promotioncode.Client{B: backends.API, Key: key} - a.Quotes = "e.Client{B: backends.API, PDFBackend: backends.Uploads, Key: key} + a.Quotes = "e.Client{B: backends.API, BUploads: backends.Uploads, Key: key} a.RadarEarlyFraudWarnings = &radarearlyfraudwarning.Client{B: backends.API, Key: key} a.RadarValueListItems = &radarvaluelistitem.Client{B: backends.API, Key: key} a.RadarValueLists = &radarvaluelist.Client{B: backends.API, Key: key} diff --git a/example/generated_examples_test.go b/example/generated_examples_test.go index 536ed73576..e00a20b653 100644 --- a/example/generated_examples_test.go +++ b/example/generated_examples_test.go @@ -3251,3 +3251,10 @@ func TestTaxCalculationCreate(t *testing.T) { assert.NotNil(t, result) assert.Nil(t, err) } + +func TestQuotePDF(t *testing.T) { + params := &stripe.QuotePDFParams{} + result, err := quote.PDF("qt_xxxxxxxxxxxxx", params) + assert.NotNil(t, result) + assert.Nil(t, err) +} diff --git a/file/client.go b/file/client.go index a10e27471c..959af39d05 100644 --- a/file/client.go +++ b/file/client.go @@ -17,8 +17,9 @@ import ( // Client is used to invoke /files APIs. type Client struct { - B stripe.Backend - Key string + B stripe.Backend + BUploads stripe.Backend + Key string } // New creates a new file. @@ -98,5 +99,9 @@ func (i *Iter) FileList() *stripe.FileList { } func getC() Client { - return Client{stripe.GetBackend(stripe.UploadsBackend), stripe.Key} + return Client{ + stripe.GetBackend(stripe.UploadsBackend), + stripe.GetBackend(stripe.UploadsBackend), + stripe.Key, + } } diff --git a/invoice.go b/invoice.go index caab1cc622..5058b59679 100644 --- a/invoice.go +++ b/invoice.go @@ -1114,6 +1114,12 @@ type InvoiceStatusTransitions struct { VoidedAt int64 `json:"voided_at"` } +// Details about the subscription that created this invoice. +type InvoiceSubscriptionDetails struct { + // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will reflect the metadata of the subscription at the time of invoice creation. *Note: This attribute is populated only for invoices created on or after June 29, 2023.* + Metadata map[string]string `json:"metadata"` +} + // Indicates which line items triggered a threshold invoice. type InvoiceThresholdReasonItemReason struct { // The IDs of the line items that triggered the threshold invoice. @@ -1326,6 +1332,8 @@ type Invoice struct { StatusTransitions *InvoiceStatusTransitions `json:"status_transitions"` // The subscription that this invoice was prepared for, if any. Subscription *Subscription `json:"subscription"` + // Details about the subscription that created this invoice. + SubscriptionDetails *InvoiceSubscriptionDetails `json:"subscription_details"` // Only set for upcoming invoices that preview prorations. The time used to calculate prorations. SubscriptionProrationDate int64 `json:"subscription_proration_date"` // Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated diff --git a/paymentintent.go b/paymentintent.go index f001d2ba93..b6a151a43c 100644 --- a/paymentintent.go +++ b/paymentintent.go @@ -1337,7 +1337,7 @@ type PaymentIntentPaymentMethodOptionsLinkParams struct { // // If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. CaptureMethod *string `form:"capture_method"` - // Token used for persistent Link logins. + // [Deprecated] This is a legacy parameter that no longer has any function. PersistentToken *string `form:"persistent_token"` // Indicates that you intend to make future payments with this PaymentIntent's payment method. // @@ -2453,7 +2453,7 @@ type PaymentIntentPaymentMethodOptionsKonbini struct { type PaymentIntentPaymentMethodOptionsLink struct { // Controls when the funds will be captured from the customer's account. CaptureMethod PaymentIntentPaymentMethodOptionsLinkCaptureMethod `json:"capture_method"` - // Token used for persistent Link logins. + // [Deprecated] This is a legacy parameter that no longer has any function. PersistentToken string `json:"persistent_token"` // Indicates that you intend to make future payments with this PaymentIntent's payment method. // diff --git a/paymentmethod.go b/paymentmethod.go index 2563044f0a..1b1685e919 100644 --- a/paymentmethod.go +++ b/paymentmethod.go @@ -807,7 +807,7 @@ type PaymentMethodLink struct { Country string `json:"country"` // Account owner's email address. Email string `json:"email"` - // Token used for persistent Link logins. + // [Deprecated] This is a legacy parameter that no longer has any function. PersistentToken string `json:"persistent_token"` } type PaymentMethodOXXO struct{} diff --git a/person.go b/person.go index 32e0fb2d3c..7905a3507e 100644 --- a/person.go +++ b/person.go @@ -392,7 +392,7 @@ type PersonVerification struct { // This is an object representing a person associated with a Stripe account. // // A platform cannot access a Standard or Express account's persons after the account starts onboarding, such as after generating an account link for the account. -// See the [Standard onboarding](https://stripe.com/docs/connect/standard-accounts) or [Express onboarding documentation](https://stripe.com/docs/connect/express-accounts) for information about platform pre-filling and account onboarding steps. +// See the [Standard onboarding](https://stripe.com/docs/connect/standard-accounts) or [Express onboarding documentation](https://stripe.com/docs/connect/express-accounts) for information about platform prefilling and account onboarding steps. // // Related guide: [Handling identity verification with the API](https://stripe.com/docs/connect/identity-verification-api#person-information) type Person struct { diff --git a/quote/client.go b/quote/client.go index 3703e2075d..493f904390 100644 --- a/quote/client.go +++ b/quote/client.go @@ -18,6 +18,7 @@ import ( type Client struct { B stripe.Backend PDFBackend stripe.Backend + BUploads stripe.Backend Key string } @@ -107,7 +108,11 @@ func PDF(id string, params *stripe.QuotePDFParams) (*stripe.APIStream, error) { func (c Client) PDF(id string, params *stripe.QuotePDFParams) (*stripe.APIStream, error) { path := stripe.FormatURLPath("/v1/quotes/%s/pdf", id) stream := &stripe.APIStream{} - err := c.PDFBackend.CallStreaming(http.MethodGet, path, c.Key, params, stream) + backend := c.PDFBackend + if backend == nil { + backend = c.BUploads + } + err := backend.CallStreaming(http.MethodGet, path, c.Key, params, stream) return stream, err } @@ -220,5 +225,10 @@ func (i *LineItemIter) LineItemList() *stripe.LineItemList { } func getC() Client { - return Client{stripe.GetBackend(stripe.APIBackend), stripe.GetBackend(stripe.UploadsBackend), stripe.Key} + return Client{ + stripe.GetBackend(stripe.APIBackend), + stripe.GetBackend(stripe.UploadsBackend), + stripe.GetBackend(stripe.UploadsBackend), + stripe.Key, + } } diff --git a/setupintent.go b/setupintent.go index 16339af37a..03cdc8b829 100644 --- a/setupintent.go +++ b/setupintent.go @@ -591,7 +591,7 @@ type SetupIntentPaymentMethodOptionsCardParams struct { // If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. type SetupIntentPaymentMethodOptionsLinkParams struct { - // Token used for persistent Link logins. + // [Deprecated] This is a legacy parameter that no longer has any function. PersistentToken *string `form:"persistent_token"` } @@ -1151,7 +1151,7 @@ type SetupIntentPaymentMethodOptionsCard struct { RequestThreeDSecure SetupIntentPaymentMethodOptionsCardRequestThreeDSecure `json:"request_three_d_secure"` } type SetupIntentPaymentMethodOptionsLink struct { - // Token used for persistent Link logins. + // [Deprecated] This is a legacy parameter that no longer has any function. PersistentToken string `json:"persistent_token"` } type SetupIntentPaymentMethodOptionsPaypal struct {