From 0196e5331414d9d26f65691322f3a4ae6da78121 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 14:53:48 -0700 Subject: [PATCH 1/5] Update generated code (#1912) * Update generated code for v1249 * Update generated code for v1250 * Update generated code for v1255 * Update generated code for v1257 * Update generated code for v1259 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: jar-stripe --- OPENAPI_VERSION | 2 +- checkout_session.go | 13 ++++ client/api.go | 4 + customer.go | 4 + invoice.go | 8 ++ invoicerenderingtemplate.go | 93 +++++++++++++++++++++++ invoicerenderingtemplate/client.go | 118 +++++++++++++++++++++++++++++ issuing_card.go | 1 + paymentlink.go | 13 +++- quote.go | 4 +- subscription.go | 12 ++- terminal_location.go | 2 +- 12 files changed, 265 insertions(+), 9 deletions(-) create mode 100644 invoicerenderingtemplate.go create mode 100644 invoicerenderingtemplate/client.go diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 340c4578c3..b39b96e379 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1246 \ No newline at end of file +v1259 \ No newline at end of file diff --git a/checkout_session.go b/checkout_session.go index 3f27393fb7..bc5a769a5c 100644 --- a/checkout_session.go +++ b/checkout_session.go @@ -893,6 +893,15 @@ const ( CheckoutSessionSubmitTypePay CheckoutSessionSubmitType = "pay" ) +// Indicates whether a tax ID is required on the payment page +type CheckoutSessionTaxIDCollectionRequired string + +// List of values that CheckoutSessionTaxIDCollectionRequired can take +const ( + CheckoutSessionTaxIDCollectionRequiredIfSupported CheckoutSessionTaxIDCollectionRequired = "if_supported" + CheckoutSessionTaxIDCollectionRequiredNever CheckoutSessionTaxIDCollectionRequired = "never" +) + // The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. type CheckoutSessionTotalDetailsBreakdownTaxTaxabilityReason string @@ -2092,6 +2101,8 @@ func (p *CheckoutSessionSubscriptionDataParams) AddMetadata(key string, value st type CheckoutSessionTaxIDCollectionParams struct { // Enable tax ID collection during checkout. Defaults to `false`. Enabled *bool `form:"enabled"` + // Describes whether a tax ID is required during checkout. Defaults to `never`. + Required *string `form:"required"` } // Creates a Session object. @@ -2993,6 +3004,8 @@ type CheckoutSessionShippingOption struct { type CheckoutSessionTaxIDCollection struct { // Indicates whether tax ID collection is enabled for the session Enabled bool `json:"enabled"` + // Indicates whether a tax ID is required on the payment page + Required CheckoutSessionTaxIDCollectionRequired `json:"required"` } // The aggregated discounts. diff --git a/client/api.go b/client/api.go index 886bcdad39..5cb9cfa08b 100644 --- a/client/api.go +++ b/client/api.go @@ -58,6 +58,7 @@ import ( "github.com/stripe/stripe-go/v79/invoice" "github.com/stripe/stripe-go/v79/invoiceitem" "github.com/stripe/stripe-go/v79/invoicelineitem" + "github.com/stripe/stripe-go/v79/invoicerenderingtemplate" issuingauthorization "github.com/stripe/stripe-go/v79/issuing/authorization" issuingcard "github.com/stripe/stripe-go/v79/issuing/card" issuingcardholder "github.com/stripe/stripe-go/v79/issuing/cardholder" @@ -241,6 +242,8 @@ type API struct { InvoiceItems *invoiceitem.Client // InvoiceLineItems is the client used to invoke /invoices/{invoice}/lines APIs. InvoiceLineItems *invoicelineitem.Client + // InvoiceRenderingTemplates is the client used to invoke /invoice_rendering_templates APIs. + InvoiceRenderingTemplates *invoicerenderingtemplate.Client // Invoices is the client used to invoke /invoices APIs. Invoices *invoice.Client // IssuingAuthorizations is the client used to invoke /issuing/authorizations APIs. @@ -469,6 +472,7 @@ func (a *API) Init(key string, backends *stripe.Backends) { a.IdentityVerificationSessions = &identityverificationsession.Client{B: backends.API, Key: key} a.InvoiceItems = &invoiceitem.Client{B: backends.API, Key: key} a.InvoiceLineItems = &invoicelineitem.Client{B: backends.API, Key: key} + a.InvoiceRenderingTemplates = &invoicerenderingtemplate.Client{B: backends.API, Key: key} a.Invoices = &invoice.Client{B: backends.API, Key: key} a.IssuingAuthorizations = &issuingauthorization.Client{B: backends.API, Key: key} a.IssuingCardholders = &issuingcardholder.Client{B: backends.API, Key: key} diff --git a/customer.go b/customer.go index 37a7746776..4958a6eddd 100644 --- a/customer.go +++ b/customer.go @@ -133,6 +133,8 @@ type CustomerInvoiceSettingsCustomFieldParams struct { type CustomerInvoiceSettingsRenderingOptionsParams struct { // How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. AmountTaxDisplay *string `form:"amount_tax_display"` + // ID of the invoice rendering template to use for future invoices. + Template *string `form:"template"` } // Default invoice settings for this customer. @@ -295,6 +297,8 @@ type CustomerInvoiceSettingsCustomField struct { type CustomerInvoiceSettingsRenderingOptions struct { // How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. AmountTaxDisplay string `json:"amount_tax_display"` + // ID of the invoice rendering template to be used for this customer's invoices. If set, the template will be used on all invoices for this customer unless a template is set directly on the invoice. + Template string `json:"template"` } type CustomerInvoiceSettings struct { // Default custom fields to be displayed on invoices for this customer. diff --git a/invoice.go b/invoice.go index 03c04db777..c7c7d60228 100644 --- a/invoice.go +++ b/invoice.go @@ -521,6 +521,10 @@ type InvoiceRenderingParams struct { AmountTaxDisplay *string `form:"amount_tax_display"` // Invoice pdf rendering options PDF *InvoiceRenderingPDFParams `form:"pdf"` + // ID of the invoice rendering template to use for this invoice. + Template *string `form:"template"` + // The specific version of invoice rendering template to use for this invoice. + TemplateVersion *int64 `form:"template_version"` } // The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. @@ -3021,6 +3025,10 @@ type InvoiceRendering struct { AmountTaxDisplay string `json:"amount_tax_display"` // Invoice pdf rendering options PDF *InvoiceRenderingPDF `json:"pdf"` + // ID of the rendering template that the invoice is formatted by. + Template string `json:"template"` + // Version of the rendering template that the invoice is using. + TemplateVersion int64 `json:"template_version"` } // The taxes applied to the shipping rate. diff --git a/invoicerenderingtemplate.go b/invoicerenderingtemplate.go new file mode 100644 index 0000000000..9f038b6db4 --- /dev/null +++ b/invoicerenderingtemplate.go @@ -0,0 +1,93 @@ +// +// +// File generated from our OpenAPI spec +// +// + +package stripe + +// The status of the template, one of `active` or `archived`. +type InvoiceRenderingTemplateStatus string + +// List of values that InvoiceRenderingTemplateStatus can take +const ( + InvoiceRenderingTemplateStatusActive InvoiceRenderingTemplateStatus = "active" + InvoiceRenderingTemplateStatusArchived InvoiceRenderingTemplateStatus = "archived" +) + +// List all templates, ordered by creation date, with the most recently created template appearing first. +type InvoiceRenderingTemplateListParams struct { + ListParams `form:"*"` + // Specifies which fields in the response should be expanded. + Expand []*string `form:"expand"` + Status *string `form:"status"` +} + +// AddExpand appends a new field to expand. +func (p *InvoiceRenderingTemplateListParams) AddExpand(f string) { + p.Expand = append(p.Expand, &f) +} + +// Retrieves an invoice rendering template with the given ID. It by default returns the latest version of the template. Optionally, specify a version to see previous versions. +type InvoiceRenderingTemplateParams struct { + Params `form:"*"` + // Specifies which fields in the response should be expanded. + Expand []*string `form:"expand"` + Version *int64 `form:"version"` +} + +// AddExpand appends a new field to expand. +func (p *InvoiceRenderingTemplateParams) AddExpand(f string) { + p.Expand = append(p.Expand, &f) +} + +// Updates the status of an invoice rendering template to ‘archived' so no new Stripe objects (customers, invoices, etc.) can reference it. The template can also no longer be updated. However, if the template is already set on a Stripe object, it will continue to be applied on invoices generated by it. +type InvoiceRenderingTemplateArchiveParams struct { + Params `form:"*"` + // Specifies which fields in the response should be expanded. + Expand []*string `form:"expand"` +} + +// AddExpand appends a new field to expand. +func (p *InvoiceRenderingTemplateArchiveParams) AddExpand(f string) { + p.Expand = append(p.Expand, &f) +} + +// Unarchive an invoice rendering template so it can be used on new Stripe objects again. +type InvoiceRenderingTemplateUnarchiveParams struct { + Params `form:"*"` + // Specifies which fields in the response should be expanded. + Expand []*string `form:"expand"` +} + +// AddExpand appends a new field to expand. +func (p *InvoiceRenderingTemplateUnarchiveParams) AddExpand(f string) { + p.Expand = append(p.Expand, &f) +} + +type InvoiceRenderingTemplate struct { + APIResource + // Time at which the object was created. Measured in seconds since the Unix epoch. + Created int64 `json:"created"` + // Unique identifier for the object. + ID string `json:"id"` + // 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"` + // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + Metadata map[string]string `json:"metadata"` + // A brief description of the template, hidden from customers + Nickname string `json:"nickname"` + // String representing the object's type. Objects of the same type share the same value. + Object string `json:"object"` + // The status of the template, one of `active` or `archived`. + Status InvoiceRenderingTemplateStatus `json:"status"` + // Version of this template; version increases by one when an update on the template changes any field that controls invoice rendering + Version int64 `json:"version"` +} + +// InvoiceRenderingTemplateList is a list of InvoiceRenderingTemplates as retrieved from a list endpoint. +type InvoiceRenderingTemplateList struct { + APIResource + ListMeta + Data []*InvoiceRenderingTemplate `json:"data"` +} diff --git a/invoicerenderingtemplate/client.go b/invoicerenderingtemplate/client.go new file mode 100644 index 0000000000..bd77ff5f1a --- /dev/null +++ b/invoicerenderingtemplate/client.go @@ -0,0 +1,118 @@ +// +// +// File generated from our OpenAPI spec +// +// + +// Package invoicerenderingtemplate provides the /invoice_rendering_templates APIs +package invoicerenderingtemplate + +import ( + "net/http" + + stripe "github.com/stripe/stripe-go/v79" + "github.com/stripe/stripe-go/v79/form" +) + +// Client is used to invoke /invoice_rendering_templates APIs. +type Client struct { + B stripe.Backend + Key string +} + +// Retrieves an invoice rendering template with the given ID. It by default returns the latest version of the template. Optionally, specify a version to see previous versions. +func Get(id string, params *stripe.InvoiceRenderingTemplateParams) (*stripe.InvoiceRenderingTemplate, error) { + return getC().Get(id, params) +} + +// Retrieves an invoice rendering template with the given ID. It by default returns the latest version of the template. Optionally, specify a version to see previous versions. +func (c Client) Get(id string, params *stripe.InvoiceRenderingTemplateParams) (*stripe.InvoiceRenderingTemplate, error) { + path := stripe.FormatURLPath("/v1/invoice_rendering_templates/%s", id) + invoicerenderingtemplate := &stripe.InvoiceRenderingTemplate{} + err := c.B.Call(http.MethodGet, path, c.Key, params, invoicerenderingtemplate) + return invoicerenderingtemplate, err +} + +// Updates the status of an invoice rendering template to ‘archived' so no new Stripe objects (customers, invoices, etc.) can reference it. The template can also no longer be updated. However, if the template is already set on a Stripe object, it will continue to be applied on invoices generated by it. +func Archive(id string, params *stripe.InvoiceRenderingTemplateArchiveParams) (*stripe.InvoiceRenderingTemplate, error) { + return getC().Archive(id, params) +} + +// Updates the status of an invoice rendering template to ‘archived' so no new Stripe objects (customers, invoices, etc.) can reference it. The template can also no longer be updated. However, if the template is already set on a Stripe object, it will continue to be applied on invoices generated by it. +func (c Client) Archive(id string, params *stripe.InvoiceRenderingTemplateArchiveParams) (*stripe.InvoiceRenderingTemplate, error) { + path := stripe.FormatURLPath("/v1/invoice_rendering_templates/%s/archive", id) + invoicerenderingtemplate := &stripe.InvoiceRenderingTemplate{} + err := c.B.Call( + http.MethodPost, + path, + c.Key, + params, + invoicerenderingtemplate, + ) + return invoicerenderingtemplate, err +} + +// Unarchive an invoice rendering template so it can be used on new Stripe objects again. +func Unarchive(id string, params *stripe.InvoiceRenderingTemplateUnarchiveParams) (*stripe.InvoiceRenderingTemplate, error) { + return getC().Unarchive(id, params) +} + +// Unarchive an invoice rendering template so it can be used on new Stripe objects again. +func (c Client) Unarchive(id string, params *stripe.InvoiceRenderingTemplateUnarchiveParams) (*stripe.InvoiceRenderingTemplate, error) { + path := stripe.FormatURLPath( + "/v1/invoice_rendering_templates/%s/unarchive", + id, + ) + invoicerenderingtemplate := &stripe.InvoiceRenderingTemplate{} + err := c.B.Call( + http.MethodPost, + path, + c.Key, + params, + invoicerenderingtemplate, + ) + return invoicerenderingtemplate, err +} + +// List all templates, ordered by creation date, with the most recently created template appearing first. +func List(params *stripe.InvoiceRenderingTemplateListParams) *Iter { + return getC().List(params) +} + +// List all templates, ordered by creation date, with the most recently created template appearing first. +func (c Client) List(listParams *stripe.InvoiceRenderingTemplateListParams) *Iter { + return &Iter{ + Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { + list := &stripe.InvoiceRenderingTemplateList{} + err := c.B.CallRaw(http.MethodGet, "/v1/invoice_rendering_templates", c.Key, b, p, list) + + ret := make([]interface{}, len(list.Data)) + for i, v := range list.Data { + ret[i] = v + } + + return ret, list, err + }), + } +} + +// Iter is an iterator for invoice rendering templates. +type Iter struct { + *stripe.Iter +} + +// InvoiceRenderingTemplate returns the invoice rendering template which the iterator is currently pointing to. +func (i *Iter) InvoiceRenderingTemplate() *stripe.InvoiceRenderingTemplate { + return i.Current().(*stripe.InvoiceRenderingTemplate) +} + +// InvoiceRenderingTemplateList returns the current list object which the iterator is +// currently using. List objects will change as new API calls are made to +// continue pagination. +func (i *Iter) InvoiceRenderingTemplateList() *stripe.InvoiceRenderingTemplateList { + return i.List().(*stripe.InvoiceRenderingTemplateList) +} + +func getC() Client { + return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key} +} diff --git a/issuing_card.go b/issuing_card.go index 5f7fc53de1..c69bb47221 100644 --- a/issuing_card.go +++ b/issuing_card.go @@ -81,6 +81,7 @@ const ( IssuingCardShippingStatusPending IssuingCardShippingStatus = "pending" IssuingCardShippingStatusReturned IssuingCardShippingStatus = "returned" IssuingCardShippingStatusShipped IssuingCardShippingStatus = "shipped" + IssuingCardShippingStatusSubmitted IssuingCardShippingStatus = "submitted" ) // Packaging options. diff --git a/paymentlink.go b/paymentlink.go index 195e72e196..9d19dc01a6 100644 --- a/paymentlink.go +++ b/paymentlink.go @@ -198,6 +198,14 @@ const ( PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethodPause PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod = "pause" ) +type PaymentLinkTaxIDCollectionRequired string + +// List of values that PaymentLinkTaxIDCollectionRequired can take +const ( + PaymentLinkTaxIDCollectionRequiredIfSupported PaymentLinkTaxIDCollectionRequired = "if_supported" + PaymentLinkTaxIDCollectionRequiredNever PaymentLinkTaxIDCollectionRequired = "never" +) + // Returns a list of your payment links. type PaymentLinkListParams struct { ListParams `form:"*"` @@ -566,6 +574,8 @@ func (p *PaymentLinkSubscriptionDataParams) AddMetadata(key string, value string type PaymentLinkTaxIDCollectionParams struct { // Enable tax ID collection during checkout. Defaults to `false`. Enabled *bool `form:"enabled"` + // Describes whether a tax ID is required during checkout. Defaults to `never`. + Required *string `form:"required"` } // The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. @@ -930,7 +940,8 @@ type PaymentLinkSubscriptionData struct { } type PaymentLinkTaxIDCollection struct { // Indicates whether tax ID collection is enabled for the session. - Enabled bool `json:"enabled"` + Enabled bool `json:"enabled"` + Required PaymentLinkTaxIDCollectionRequired `json:"required"` } // The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. diff --git a/quote.go b/quote.go index 9a42469d88..9e03fc5b3f 100644 --- a/quote.go +++ b/quote.go @@ -170,7 +170,7 @@ type QuoteAutomaticTaxParams struct { Liability *QuoteAutomaticTaxLiabilityParams `form:"liability"` } -// The discounts applied to the quote. You can only set up to one discount. +// The discounts applied to the quote. type QuoteDiscountParams struct { // ID of the coupon to create a new discount for. Coupon *string `form:"coupon"` @@ -310,7 +310,7 @@ type QuoteParams struct { DefaultTaxRates []*string `form:"default_tax_rates"` // A description that will be displayed on the quote PDF. If no value is passed, the default description configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used. Description *string `form:"description"` - // The discounts applied to the quote. You can only set up to one discount. + // The discounts applied to the quote. Discounts []*QuoteDiscountParams `form:"discounts"` // Specifies which fields in the response should be expanded. Expand []*string `form:"expand"` diff --git a/subscription.go b/subscription.go index da0f815e9a..38f9fc9ba6 100644 --- a/subscription.go +++ b/subscription.go @@ -716,10 +716,14 @@ type SubscriptionListParams struct { // Only return subscriptions that were created during the given date interval. Created *int64 `form:"created"` // Only return subscriptions that were created during the given date interval. - CreatedRange *RangeQueryParams `form:"created"` - CurrentPeriodEnd *int64 `form:"current_period_end"` - CurrentPeriodEndRange *RangeQueryParams `form:"current_period_end"` - CurrentPeriodStart *int64 `form:"current_period_start"` + CreatedRange *RangeQueryParams `form:"created"` + // Only return subscriptions whose current_period_end falls within the given date interval. + CurrentPeriodEnd *int64 `form:"current_period_end"` + // Only return subscriptions whose current_period_end falls within the given date interval. + CurrentPeriodEndRange *RangeQueryParams `form:"current_period_end"` + // Only return subscriptions whose current_period_start falls within the given date interval. + CurrentPeriodStart *int64 `form:"current_period_start"` + // Only return subscriptions whose current_period_start falls within the given date interval. CurrentPeriodStartRange *RangeQueryParams `form:"current_period_start"` // The ID of the customer whose subscriptions will be retrieved. Customer *string `form:"customer"` diff --git a/terminal_location.go b/terminal_location.go index dbbceaebb5..1b8cecd221 100644 --- a/terminal_location.go +++ b/terminal_location.go @@ -15,7 +15,7 @@ type TerminalLocationParams struct { Address *AddressParams `form:"address"` // The ID of a configuration that will be used to customize all readers in this location. ConfigurationOverrides *string `form:"configuration_overrides"` - // A name for the location. + // A name for the location. Maximum length is 1000 characters. DisplayName *string `form:"display_name"` // Specifies which fields in the response should be expanded. Expand []*string `form:"expand"` From dd499c2e520147c408c3d99b49554157d588dce8 Mon Sep 17 00:00:00 2001 From: Helen Ye Date: Thu, 12 Sep 2024 18:05:59 -0400 Subject: [PATCH 2/5] Bump version to 79.11.0 --- CHANGELOG.md | 11 +++++++++++ VERSION | 2 +- stripe.go | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9557c175a..e316c949a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## 79.11.0 - 2024-09-12 +* [#1912](https://github.com/stripe/stripe-go/pull/1912) Update generated code + * Add support for new resource `InvoiceRenderingTemplate` + * Add support for `Archive`, `Get`, `List`, and `Unarchive` methods on resource `InvoiceRenderingTemplate` + * Add support for `Required` on `CheckoutSessionTaxIdCollectionParams`, `CheckoutSessionTaxIdCollection`, `PaymentLinkTaxIdCollectionParams`, and `PaymentLinkTaxIdCollection` + * Add support for `Template` on `CustomerInvoiceSettingsRenderingOptionsParams`, `CustomerInvoiceSettingsRenderingOptions`, `InvoiceRenderingParams`, and `InvoiceRendering` + * Add support for `TemplateVersion` on `InvoiceRenderingParams` and `InvoiceRendering` + * Add support for new value `submitted` on enum `IssuingCardShippingStatus` +* [#1914](https://github.com/stripe/stripe-go/pull/1914) Add newer Go versions to test matrix +* [#1913](https://github.com/stripe/stripe-go/pull/1913) Use pinned version of tools in Makefile and ci.yml + ## 79.10.0 - 2024-09-05 * [#1906](https://github.com/stripe/stripe-go/pull/1906) Update generated code * Add support for `SubscriptionItem` and `Subscription` on `BillingAlertFilterParams` diff --git a/VERSION b/VERSION index 5e6bb89792..b94c5306df 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -79.10.0 +79.11.0 diff --git a/stripe.go b/stripe.go index 48f5f588f4..0c329c955c 100644 --- a/stripe.go +++ b/stripe.go @@ -1280,7 +1280,7 @@ func StringSlice(v []string) []*string { // // clientversion is the binding version -const clientversion = "79.10.0" +const clientversion = "79.11.0" // defaultHTTPTimeout is the default timeout on the http.Client used by the library. // This is chosen to be consistent with the other Stripe language libraries and From 88e2878262f4bd5f1b5a67140c836d48dc95b4fb Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 18 Sep 2024 09:11:54 -0700 Subject: [PATCH 3/5] Update generated code (#1918) * Update generated code for v1254 * Update generated code for v1261 * Update generated code for v1263 * Update generated code for v1266 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- bankaccount.go | 2 ++ charge.go | 14 +++++++++++++ dispute.go | 27 ++++++++++++++++++------ error.go | 1 + invoice.go | 6 ++++-- invoicerenderingtemplate.go | 2 ++ tax_registration.go | 41 ++++++++++++++++++++++++++++++++++++- 8 files changed, 85 insertions(+), 10 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index b39b96e379..1f205edf7b 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1259 \ No newline at end of file +v1266 \ No newline at end of file diff --git a/bankaccount.go b/bankaccount.go index 4f8ba10047..b5b7e2d45d 100644 --- a/bankaccount.go +++ b/bankaccount.go @@ -124,6 +124,7 @@ const ( BankAccountFutureRequirementsErrorCodeVerificationMissingOwners BankAccountFutureRequirementsErrorCode = "verification_missing_owners" BankAccountFutureRequirementsErrorCodeVerificationRequiresAdditionalMemorandumOfAssociations BankAccountFutureRequirementsErrorCode = "verification_requires_additional_memorandum_of_associations" BankAccountFutureRequirementsErrorCodeVerificationRequiresAdditionalProofOfRegistration BankAccountFutureRequirementsErrorCode = "verification_requires_additional_proof_of_registration" + BankAccountFutureRequirementsErrorCodeVerificationSupportability BankAccountFutureRequirementsErrorCode = "verification_supportability" ) // The code for the type of error. @@ -220,6 +221,7 @@ const ( BankAccountRequirementsErrorCodeVerificationMissingOwners BankAccountRequirementsErrorCode = "verification_missing_owners" BankAccountRequirementsErrorCodeVerificationRequiresAdditionalMemorandumOfAssociations BankAccountRequirementsErrorCode = "verification_requires_additional_memorandum_of_associations" BankAccountRequirementsErrorCodeVerificationRequiresAdditionalProofOfRegistration BankAccountRequirementsErrorCode = "verification_requires_additional_proof_of_registration" + BankAccountRequirementsErrorCodeVerificationSupportability BankAccountRequirementsErrorCode = "verification_supportability" ) // For bank accounts, possible values are `new`, `validated`, `verified`, `verification_failed`, or `errored`. A bank account that hasn't had any activity or validation performed is `new`. If Stripe can determine that the bank account exists, its status will be `validated`. Note that there often isn't enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be `verified`. If the verification failed for any reason, such as microdeposit failure, the status will be `verification_failed`. If a payout sent to this bank account fails, we'll set the status to `errored` and will not continue to send [scheduled payouts](https://stripe.com/docs/payouts#payout-schedule) until the bank details are updated. diff --git a/charge.go b/charge.go index 79f61999eb..0b0cb25bbc 100644 --- a/charge.go +++ b/charge.go @@ -1067,7 +1067,21 @@ type ChargePaymentMethodDetailsInteracPresent struct { // The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) Issuer string `json:"issuer"` } + +// The payer's address +type ChargePaymentMethodDetailsKlarnaPayerDetailsAddress struct { + // The payer address country + Country string `json:"country"` +} + +// The payer details for this transaction. +type ChargePaymentMethodDetailsKlarnaPayerDetails struct { + // The payer's address + Address *ChargePaymentMethodDetailsKlarnaPayerDetailsAddress `json:"address"` +} type ChargePaymentMethodDetailsKlarna struct { + // The payer details for this transaction. + PayerDetails *ChargePaymentMethodDetailsKlarnaPayerDetails `json:"payer_details"` // The Klarna payment method used for this transaction. // Can be one of `pay_later`, `pay_now`, `pay_with_financing`, or `pay_in_installments` PaymentMethodCategory ChargePaymentMethodDetailsKlarnaPaymentMethodCategory `json:"payment_method_category"` diff --git a/dispute.go b/dispute.go index 4394652cd2..7efc8001f2 100644 --- a/dispute.go +++ b/dispute.go @@ -8,6 +8,15 @@ package stripe import "encoding/json" +// The AmazonPay dispute type, chargeback or claim +type DisputePaymentMethodDetailsAmazonPayDisputeType string + +// List of values that DisputePaymentMethodDetailsAmazonPayDisputeType can take +const ( + DisputePaymentMethodDetailsAmazonPayDisputeTypeChargeback DisputePaymentMethodDetailsAmazonPayDisputeType = "chargeback" + DisputePaymentMethodDetailsAmazonPayDisputeTypeClaim DisputePaymentMethodDetailsAmazonPayDisputeType = "claim" +) + // The type of dispute opened. Different case types may have varying fees and financial impact. type DisputePaymentMethodDetailsCardCaseType string @@ -22,9 +31,10 @@ type DisputePaymentMethodDetailsType string // List of values that DisputePaymentMethodDetailsType can take const ( - DisputePaymentMethodDetailsTypeCard DisputePaymentMethodDetailsType = "card" - DisputePaymentMethodDetailsTypeKlarna DisputePaymentMethodDetailsType = "klarna" - DisputePaymentMethodDetailsTypePaypal DisputePaymentMethodDetailsType = "paypal" + DisputePaymentMethodDetailsTypeAmazonPay DisputePaymentMethodDetailsType = "amazon_pay" + DisputePaymentMethodDetailsTypeCard DisputePaymentMethodDetailsType = "card" + DisputePaymentMethodDetailsTypeKlarna DisputePaymentMethodDetailsType = "klarna" + DisputePaymentMethodDetailsTypePaypal DisputePaymentMethodDetailsType = "paypal" ) // Reason given by cardholder for dispute. Possible values are `bank_cannot_process`, `check_returned`, `credit_not_processed`, `customer_initiated`, `debit_not_authorized`, `duplicate`, `fraudulent`, `general`, `incorrect_account_details`, `insufficient_funds`, `product_not_received`, `product_unacceptable`, `subscription_canceled`, or `unrecognized`. Learn more about [dispute reasons](https://stripe.com/docs/disputes/categories). @@ -232,6 +242,10 @@ type DisputeEvidenceDetails struct { // The number of times evidence has been submitted. Typically, you may only submit evidence once. SubmissionCount int64 `json:"submission_count"` } +type DisputePaymentMethodDetailsAmazonPay struct { + // The AmazonPay dispute type, chargeback or claim + DisputeType DisputePaymentMethodDetailsAmazonPayDisputeType `json:"dispute_type"` +} type DisputePaymentMethodDetailsCard struct { // Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. Brand string `json:"brand"` @@ -251,9 +265,10 @@ type DisputePaymentMethodDetailsPaypal struct { ReasonCode string `json:"reason_code"` } type DisputePaymentMethodDetails struct { - Card *DisputePaymentMethodDetailsCard `json:"card"` - Klarna *DisputePaymentMethodDetailsKlarna `json:"klarna"` - Paypal *DisputePaymentMethodDetailsPaypal `json:"paypal"` + AmazonPay *DisputePaymentMethodDetailsAmazonPay `json:"amazon_pay"` + Card *DisputePaymentMethodDetailsCard `json:"card"` + Klarna *DisputePaymentMethodDetailsKlarna `json:"klarna"` + Paypal *DisputePaymentMethodDetailsPaypal `json:"paypal"` // Payment method type. Type DisputePaymentMethodDetailsType `json:"type"` } diff --git a/error.go b/error.go index 1d3e4e2539..32e8505602 100644 --- a/error.go +++ b/error.go @@ -184,6 +184,7 @@ const ( ErrorCodeTerminalLocationCountryUnsupported ErrorCode = "terminal_location_country_unsupported" ErrorCodeTerminalReaderBusy ErrorCode = "terminal_reader_busy" ErrorCodeTerminalReaderHardwareFault ErrorCode = "terminal_reader_hardware_fault" + ErrorCodeTerminalReaderInvalidLocationForActivation ErrorCode = "terminal_reader_invalid_location_for_activation" ErrorCodeTerminalReaderInvalidLocationForPayment ErrorCode = "terminal_reader_invalid_location_for_payment" ErrorCodeTerminalReaderOffline ErrorCode = "terminal_reader_offline" ErrorCodeTerminalReaderTimeout ErrorCode = "terminal_reader_timeout" diff --git a/invoice.go b/invoice.go index c7c7d60228..76c27de045 100644 --- a/invoice.go +++ b/invoice.go @@ -3177,8 +3177,10 @@ type Invoice struct { // Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the `invoice.created` webhook, for example, so you might not want to display that invoice as unpaid to your users. Attempted bool `json:"attempted"` // Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action. - AutoAdvance bool `json:"auto_advance"` - AutomaticTax *InvoiceAutomaticTax `json:"automatic_tax"` + AutoAdvance bool `json:"auto_advance"` + // The time when this invoice is currently scheduled to be automatically finalized. The field will be `null` if the invoice is not scheduled to finalize in the future. If the invoice is not in the draft state, this field will always be `null` - see `finalized_at` for the time when an already-finalized invoice was finalized. + AutomaticallyFinalizesAt int64 `json:"automatically_finalizes_at"` + AutomaticTax *InvoiceAutomaticTax `json:"automatic_tax"` // Indicates the reason why the invoice was created. // // * `manual`: Unrelated to a subscription, for example, created via the invoice editor. diff --git a/invoicerenderingtemplate.go b/invoicerenderingtemplate.go index 9f038b6db4..e797719c45 100644 --- a/invoicerenderingtemplate.go +++ b/invoicerenderingtemplate.go @@ -65,6 +65,8 @@ func (p *InvoiceRenderingTemplateUnarchiveParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } +// Invoice Rendering Templates are used to configure how invoices are rendered on surfaces like the PDF. Invoice Rendering Templates +// can be created from within the Dashboard, and they can be used over the API when creating invoices. type InvoiceRenderingTemplate struct { APIResource // Time at which the object was created. Measured in seconds since the Unix epoch. diff --git a/tax_registration.go b/tax_registration.go index 6ff44d5edf..9978bcb9fa 100644 --- a/tax_registration.go +++ b/tax_registration.go @@ -758,6 +758,16 @@ const ( TaxRegistrationCountryOptionsTRTypeSimplified TaxRegistrationCountryOptionsTRType = "simplified" ) +// The type of the election for the state sales tax registration. +type TaxRegistrationCountryOptionsUSStateSalesTaxElectionType string + +// List of values that TaxRegistrationCountryOptionsUSStateSalesTaxElectionType can take +const ( + TaxRegistrationCountryOptionsUSStateSalesTaxElectionTypeLocalUseTax TaxRegistrationCountryOptionsUSStateSalesTaxElectionType = "local_use_tax" + TaxRegistrationCountryOptionsUSStateSalesTaxElectionTypeSimplifiedSellersUseTax TaxRegistrationCountryOptionsUSStateSalesTaxElectionType = "simplified_sellers_use_tax" + TaxRegistrationCountryOptionsUSStateSalesTaxElectionTypeSingleLocalUseTax TaxRegistrationCountryOptionsUSStateSalesTaxElectionType = "single_local_use_tax" +) + // Type of registration in the US. type TaxRegistrationCountryOptionsUSType string @@ -1363,6 +1373,20 @@ type TaxRegistrationCountryOptionsUSLocalLeaseTaxParams struct { Jurisdiction *string `form:"jurisdiction"` } +// Elections for the state sales tax registration. +type TaxRegistrationCountryOptionsUSStateSalesTaxElectionParams struct { + // A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. Supported FIPS codes are: `003` (Allegheny County) and `60000` (Philadelphia City). + Jurisdiction *string `form:"jurisdiction"` + // The type of the election for the state sales tax registration. + Type *string `form:"type"` +} + +// Options for the state sales tax registration. +type TaxRegistrationCountryOptionsUSStateSalesTaxParams struct { + // Elections for the state sales tax registration. + Elections []*TaxRegistrationCountryOptionsUSStateSalesTaxElectionParams `form:"elections"` +} + // Options for the registration in US. type TaxRegistrationCountryOptionsUSParams struct { // Options for the local amusement tax registration. @@ -1371,6 +1395,8 @@ type TaxRegistrationCountryOptionsUSParams struct { LocalLeaseTax *TaxRegistrationCountryOptionsUSLocalLeaseTaxParams `form:"local_lease_tax"` // Two-letter US state code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). State *string `form:"state"` + // Options for the state sales tax registration. + StateSalesTax *TaxRegistrationCountryOptionsUSStateSalesTaxParams `form:"state_sales_tax"` // Type of registration to be created in the US. Type *string `form:"type"` } @@ -1895,11 +1921,24 @@ type TaxRegistrationCountryOptionsUSLocalLeaseTax struct { // A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. Jurisdiction string `json:"jurisdiction"` } + +// Elections for the state sales tax registration. +type TaxRegistrationCountryOptionsUSStateSalesTaxElection struct { + // A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. + Jurisdiction string `json:"jurisdiction"` + // The type of the election for the state sales tax registration. + Type TaxRegistrationCountryOptionsUSStateSalesTaxElectionType `json:"type"` +} +type TaxRegistrationCountryOptionsUSStateSalesTax struct { + // Elections for the state sales tax registration. + Elections []*TaxRegistrationCountryOptionsUSStateSalesTaxElection `json:"elections"` +} type TaxRegistrationCountryOptionsUS struct { LocalAmusementTax *TaxRegistrationCountryOptionsUSLocalAmusementTax `json:"local_amusement_tax"` LocalLeaseTax *TaxRegistrationCountryOptionsUSLocalLeaseTax `json:"local_lease_tax"` // Two-letter US state code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). - State string `json:"state"` + State string `json:"state"` + StateSalesTax *TaxRegistrationCountryOptionsUSStateSalesTax `json:"state_sales_tax"` // Type of registration in the US. Type TaxRegistrationCountryOptionsUSType `json:"type"` } From a3ed1717370a5f3f9997d5695be4df63ecc67db4 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 18 Sep 2024 11:30:17 -0700 Subject: [PATCH 4/5] Update generated code (#1919) Update generated code for v1267 Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- treasury_receiveddebit.go | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 1f205edf7b..5f5b311191 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1266 \ No newline at end of file +v1267 \ No newline at end of file diff --git a/treasury_receiveddebit.go b/treasury_receiveddebit.go index 4f9b6ba2d0..57fdc54666 100644 --- a/treasury_receiveddebit.go +++ b/treasury_receiveddebit.go @@ -11,10 +11,11 @@ type TreasuryReceivedDebitFailureCode string // List of values that TreasuryReceivedDebitFailureCode can take const ( - TreasuryReceivedDebitFailureCodeAccountClosed TreasuryReceivedDebitFailureCode = "account_closed" - TreasuryReceivedDebitFailureCodeAccountFrozen TreasuryReceivedDebitFailureCode = "account_frozen" - TreasuryReceivedDebitFailureCodeInsufficientFunds TreasuryReceivedDebitFailureCode = "insufficient_funds" - TreasuryReceivedDebitFailureCodeOther TreasuryReceivedDebitFailureCode = "other" + TreasuryReceivedDebitFailureCodeAccountClosed TreasuryReceivedDebitFailureCode = "account_closed" + TreasuryReceivedDebitFailureCodeAccountFrozen TreasuryReceivedDebitFailureCode = "account_frozen" + TreasuryReceivedDebitFailureCodeInsufficientFunds TreasuryReceivedDebitFailureCode = "insufficient_funds" + TreasuryReceivedDebitFailureCodeInternationalTransaction TreasuryReceivedDebitFailureCode = "international_transaction" + TreasuryReceivedDebitFailureCodeOther TreasuryReceivedDebitFailureCode = "other" ) // Set when `type` is `balance`. From e9fb4fb69f087ba661ac635f9cd5b8d4b4b809a6 Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Wed, 18 Sep 2024 11:38:07 -0700 Subject: [PATCH 5/5] Bump version to 79.12.0 --- CHANGELOG.md | 14 ++++++++++++-- VERSION | 2 +- stripe.go | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e316c949a6..c6636e73cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## 79.12.0 - 2024-09-18 +* [#1919](https://github.com/stripe/stripe-go/pull/1919) Update generated code + * Add support for new value `international_transaction` on enum `TreasuryReceivedDebitFailureCode` +* [#1918](https://github.com/stripe/stripe-go/pull/1918) Update generated code + * Add support for new value `verification_supportability` on enums `AccountFutureRequirementsErrorsCode`, `AccountRequirementsErrorsCode`, `BankAccountFutureRequirementsErrorsCode`, and `BankAccountRequirementsErrorsCode` + * Add support for new value `terminal_reader_invalid_location_for_activation` on enums `InvoiceLastFinalizationErrorCode`, `PaymentIntentLastPaymentErrorCode`, `SetupAttemptSetupErrorCode`, `SetupIntentLastSetupErrorCode`, and `StripeErrorCode` + * Add support for `PayerDetails` on `ChargePaymentMethodDetailsKlarna` + * Add support for `AmazonPay` on `DisputePaymentMethodDetails` + * Add support for new value `amazon_pay` on enum `DisputePaymentMethodDetailsType` + * Add support for `AutomaticallyFinalizesAt` on `Invoice` + * Add support for `StateSalesTax` on `TaxRegistrationCountryOptionsUsParams` and `TaxRegistrationCountryOptionsUs` + ## 79.11.0 - 2024-09-12 * [#1912](https://github.com/stripe/stripe-go/pull/1912) Update generated code * Add support for new resource `InvoiceRenderingTemplate` @@ -8,8 +20,6 @@ * Add support for `Template` on `CustomerInvoiceSettingsRenderingOptionsParams`, `CustomerInvoiceSettingsRenderingOptions`, `InvoiceRenderingParams`, and `InvoiceRendering` * Add support for `TemplateVersion` on `InvoiceRenderingParams` and `InvoiceRendering` * Add support for new value `submitted` on enum `IssuingCardShippingStatus` -* [#1914](https://github.com/stripe/stripe-go/pull/1914) Add newer Go versions to test matrix -* [#1913](https://github.com/stripe/stripe-go/pull/1913) Use pinned version of tools in Makefile and ci.yml ## 79.10.0 - 2024-09-05 * [#1906](https://github.com/stripe/stripe-go/pull/1906) Update generated code diff --git a/VERSION b/VERSION index b94c5306df..6e94e17a23 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -79.11.0 +79.12.0 diff --git a/stripe.go b/stripe.go index 0c329c955c..74c695d98d 100644 --- a/stripe.go +++ b/stripe.go @@ -1280,7 +1280,7 @@ func StringSlice(v []string) []*string { // // clientversion is the binding version -const clientversion = "79.11.0" +const clientversion = "79.12.0" // defaultHTTPTimeout is the default timeout on the http.Client used by the library. // This is chosen to be consistent with the other Stripe language libraries and