Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated code #1688

Merged
merged 5 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v408
v417
2 changes: 2 additions & 0 deletions charge.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,8 @@ type ChargePaymentMethodDetailsACSSDebit struct {
}
type ChargePaymentMethodDetailsAffirm struct{}
type ChargePaymentMethodDetailsAfterpayClearpay struct {
// The Afterpay order ID associated with this payment intent.
OrderID string `json:"order_id"`
// Order identifier shown to the merchant in Afterpay's online portal.
Reference string `json:"reference"`
}
Expand Down
4 changes: 4 additions & 0 deletions client/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ import (
"github.com/stripe/stripe-go/v74/subscriptionitem"
"github.com/stripe/stripe-go/v74/subscriptionschedule"
taxcalculation "github.com/stripe/stripe-go/v74/tax/calculation"
taxsettings "github.com/stripe/stripe-go/v74/tax/settings"
taxtransaction "github.com/stripe/stripe-go/v74/tax/transaction"
"github.com/stripe/stripe-go/v74/taxcode"
"github.com/stripe/stripe-go/v74/taxid"
Expand Down Expand Up @@ -261,6 +262,8 @@ type API struct {
TaxIDs *taxid.Client
// TaxRates is the client used to invoke /tax_rates APIs.
TaxRates *taxrate.Client
// TaxSettings is the client used to invoke /tax/settings APIs.
TaxSettings *taxsettings.Client
// TaxTransactions is the client used to invoke /tax/transactions APIs.
TaxTransactions *taxtransaction.Client
// TerminalConfigurations is the client used to invoke /terminal/configurations APIs.
Expand Down Expand Up @@ -409,6 +412,7 @@ func (a *API) Init(key string, backends *stripe.Backends) {
a.TaxCodes = &taxcode.Client{B: backends.API, Key: key}
a.TaxIDs = &taxid.Client{B: backends.API, Key: key}
a.TaxRates = &taxrate.Client{B: backends.API, Key: key}
a.TaxSettings = &taxsettings.Client{B: backends.API, Key: key}
a.TaxTransactions = &taxtransaction.Client{B: backends.API, Key: key}
a.TerminalConfigurations = &terminalconfiguration.Client{B: backends.API, Key: key}
a.TerminalConnectionTokens = &terminalconnectiontoken.Client{B: backends.API, Key: key}
Expand Down
1 change: 1 addition & 0 deletions error.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const (
ErrorCodeInvalidNumber ErrorCode = "invalid_number"
ErrorCodeInvalidSourceUsage ErrorCode = "invalid_source_usage"
ErrorCodeInvalidSwipeData ErrorCode = "invalid_swipe_data"
ErrorCodeInvalidTaxLocation ErrorCode = "invalid_tax_location"
ErrorCodeInvoiceNoCustomerLineItems ErrorCode = "invoice_no_customer_line_items"
ErrorCodeInvoiceNoPaymentMethodTypes ErrorCode = "invoice_no_payment_method_types"
ErrorCodeInvoiceNoSubscriptionLineItems ErrorCode = "invoice_no_subscription_line_items"
Expand Down
19 changes: 19 additions & 0 deletions paymentintent.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ package stripe

import "encoding/json"

// Controls whether this PaymentIntent will accept redirect-based payment methods.
//
// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment.
type PaymentIntentAutomaticPaymentMethodsAllowRedirects string

// List of values that PaymentIntentAutomaticPaymentMethodsAllowRedirects can take
const (
PaymentIntentAutomaticPaymentMethodsAllowRedirectsAlways PaymentIntentAutomaticPaymentMethodsAllowRedirects = "always"
PaymentIntentAutomaticPaymentMethodsAllowRedirectsNever PaymentIntentAutomaticPaymentMethodsAllowRedirects = "never"
)

// Reason for cancellation of this PaymentIntent, either user-provided (`duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`) or generated by Stripe internally (`failed_invoice`, `void_invoice`, or `automatic`).
type PaymentIntentCancellationReason string

Expand Down Expand Up @@ -751,6 +762,10 @@ type PaymentIntentSearchParams struct {

// When enabled, this PaymentIntent will accept payment methods that you have enabled in the Dashboard and are compatible with this PaymentIntent's other parameters.
type PaymentIntentAutomaticPaymentMethodsParams struct {
// Controls whether this PaymentIntent will accept redirect-based payment methods.
//
// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment.
AllowRedirects *string `form:"allow_redirects"`
// Whether this feature is enabled.
Enabled *bool `form:"enabled"`
}
Expand Down Expand Up @@ -1877,6 +1892,10 @@ type PaymentIntentAmountDetails struct {

// Settings to configure compatible payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods)
type PaymentIntentAutomaticPaymentMethods struct {
// Controls whether this PaymentIntent will accept redirect-based payment methods.
//
// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment.
AllowRedirects PaymentIntentAutomaticPaymentMethodsAllowRedirects `json:"allow_redirects"`
// Automatically calculates compatible payment methods
Enabled bool `json:"enabled"`
}
Expand Down
19 changes: 19 additions & 0 deletions setupintent.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ package stripe

import "encoding/json"

// Controls whether this SetupIntent will accept redirect-based payment methods.
//
// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. To [confirm](https://stripe.com/docs/api/setup_intents/confirm) this SetupIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the setup.
type SetupIntentAutomaticPaymentMethodsAllowRedirects string

// List of values that SetupIntentAutomaticPaymentMethodsAllowRedirects can take
const (
SetupIntentAutomaticPaymentMethodsAllowRedirectsAlways SetupIntentAutomaticPaymentMethodsAllowRedirects = "always"
SetupIntentAutomaticPaymentMethodsAllowRedirectsNever SetupIntentAutomaticPaymentMethodsAllowRedirects = "never"
)

// Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`.
type SetupIntentCancellationReason string

Expand Down Expand Up @@ -221,6 +232,10 @@ const (

// When enabled, this SetupIntent will accept payment methods that you have enabled in the Dashboard and are compatible with this SetupIntent's other parameters.
type SetupIntentAutomaticPaymentMethodsParams struct {
// Controls whether this SetupIntent will accept redirect-based payment methods.
//
// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. To [confirm](https://stripe.com/docs/api/setup_intents/confirm) this SetupIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the setup.
AllowRedirects *string `form:"allow_redirects"`
// Whether this feature is enabled.
Enabled *bool `form:"enabled"`
}
Expand Down Expand Up @@ -1010,6 +1025,10 @@ type SetupIntentVerifyMicrodepositsParams struct {

// Settings for automatic payment methods compatible with this Setup Intent
type SetupIntentAutomaticPaymentMethods struct {
// Controls whether this SetupIntent will accept redirect-based payment methods.
//
// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. To [confirm](https://stripe.com/docs/api/setup_intents/confirm) this SetupIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the setup.
AllowRedirects SetupIntentAutomaticPaymentMethodsAllowRedirects `json:"allow_redirects"`
// Automatically calculates compatible payment methods
Enabled bool `json:"enabled"`
}
Expand Down
48 changes: 48 additions & 0 deletions tax/settings/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
//
//
// File generated from our OpenAPI spec
//
//

// Package settings provides the /tax/settings APIs
package settings

import (
"net/http"

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

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

// Get returns the details of a tax settings.
func Get(params *stripe.TaxSettingsParams) (*stripe.TaxSettings, error) {
return getC().Get(params)
}

// Get returns the details of a tax settings.
func (c Client) Get(params *stripe.TaxSettingsParams) (*stripe.TaxSettings, error) {
settings := &stripe.TaxSettings{}
err := c.B.Call(http.MethodGet, "/v1/tax/settings", c.Key, params, settings)
return settings, err
}

// Update updates a tax settings's properties.
func Update(params *stripe.TaxSettingsParams) (*stripe.TaxSettings, error) {
return getC().Update(params)
}

// Update updates a tax settings's properties.
func (c Client) Update(params *stripe.TaxSettingsParams) (*stripe.TaxSettings, error) {
settings := &stripe.TaxSettings{}
err := c.B.Call(http.MethodPost, "/v1/tax/settings", c.Key, params, settings)
return settings, err
}

func getC() Client {
return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key}
}
46 changes: 25 additions & 21 deletions tax_calculation.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,18 @@ type TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxType string

// List of values that TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxType can take
const (
TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxTypeGST TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxType = "gst"
TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxTypeHST TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxType = "hst"
TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxTypeIGST TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxType = "igst"
TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxTypeJCT TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxType = "jct"
TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxTypeLeaseTax TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxType = "lease_tax"
TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxTypePST TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxType = "pst"
TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxTypeQST TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxType = "qst"
TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxTypeRST TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxType = "rst"
TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxTypeSalesTax TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxType = "sales_tax"
TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxTypeVAT TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxType = "vat"
TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxTypeAmusementTax TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxType = "amusement_tax"
TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxTypeCommunicationsTax TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxType = "communications_tax"
TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxTypeGST TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxType = "gst"
TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxTypeHST TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxType = "hst"
TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxTypeIGST TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxType = "igst"
TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxTypeJCT TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxType = "jct"
TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxTypeLeaseTax TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxType = "lease_tax"
TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxTypePST TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxType = "pst"
TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxTypeQST TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxType = "qst"
TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxTypeRST TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxType = "rst"
TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxTypeSalesTax TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxType = "sales_tax"
TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxTypeVAT TaxCalculationShippingCostTaxBreakdownTaxRateDetailsTaxType = "vat"
)

// 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.
Expand Down Expand Up @@ -172,16 +174,18 @@ type TaxCalculationTaxBreakdownTaxRateDetailsTaxType string

// List of values that TaxCalculationTaxBreakdownTaxRateDetailsTaxType can take
const (
TaxCalculationTaxBreakdownTaxRateDetailsTaxTypeGST TaxCalculationTaxBreakdownTaxRateDetailsTaxType = "gst"
TaxCalculationTaxBreakdownTaxRateDetailsTaxTypeHST TaxCalculationTaxBreakdownTaxRateDetailsTaxType = "hst"
TaxCalculationTaxBreakdownTaxRateDetailsTaxTypeIGST TaxCalculationTaxBreakdownTaxRateDetailsTaxType = "igst"
TaxCalculationTaxBreakdownTaxRateDetailsTaxTypeJCT TaxCalculationTaxBreakdownTaxRateDetailsTaxType = "jct"
TaxCalculationTaxBreakdownTaxRateDetailsTaxTypeLeaseTax TaxCalculationTaxBreakdownTaxRateDetailsTaxType = "lease_tax"
TaxCalculationTaxBreakdownTaxRateDetailsTaxTypePST TaxCalculationTaxBreakdownTaxRateDetailsTaxType = "pst"
TaxCalculationTaxBreakdownTaxRateDetailsTaxTypeQST TaxCalculationTaxBreakdownTaxRateDetailsTaxType = "qst"
TaxCalculationTaxBreakdownTaxRateDetailsTaxTypeRST TaxCalculationTaxBreakdownTaxRateDetailsTaxType = "rst"
TaxCalculationTaxBreakdownTaxRateDetailsTaxTypeSalesTax TaxCalculationTaxBreakdownTaxRateDetailsTaxType = "sales_tax"
TaxCalculationTaxBreakdownTaxRateDetailsTaxTypeVAT TaxCalculationTaxBreakdownTaxRateDetailsTaxType = "vat"
TaxCalculationTaxBreakdownTaxRateDetailsTaxTypeAmusementTax TaxCalculationTaxBreakdownTaxRateDetailsTaxType = "amusement_tax"
TaxCalculationTaxBreakdownTaxRateDetailsTaxTypeCommunicationsTax TaxCalculationTaxBreakdownTaxRateDetailsTaxType = "communications_tax"
TaxCalculationTaxBreakdownTaxRateDetailsTaxTypeGST TaxCalculationTaxBreakdownTaxRateDetailsTaxType = "gst"
TaxCalculationTaxBreakdownTaxRateDetailsTaxTypeHST TaxCalculationTaxBreakdownTaxRateDetailsTaxType = "hst"
TaxCalculationTaxBreakdownTaxRateDetailsTaxTypeIGST TaxCalculationTaxBreakdownTaxRateDetailsTaxType = "igst"
TaxCalculationTaxBreakdownTaxRateDetailsTaxTypeJCT TaxCalculationTaxBreakdownTaxRateDetailsTaxType = "jct"
TaxCalculationTaxBreakdownTaxRateDetailsTaxTypeLeaseTax TaxCalculationTaxBreakdownTaxRateDetailsTaxType = "lease_tax"
TaxCalculationTaxBreakdownTaxRateDetailsTaxTypePST TaxCalculationTaxBreakdownTaxRateDetailsTaxType = "pst"
TaxCalculationTaxBreakdownTaxRateDetailsTaxTypeQST TaxCalculationTaxBreakdownTaxRateDetailsTaxType = "qst"
TaxCalculationTaxBreakdownTaxRateDetailsTaxTypeRST TaxCalculationTaxBreakdownTaxRateDetailsTaxType = "rst"
TaxCalculationTaxBreakdownTaxRateDetailsTaxTypeSalesTax TaxCalculationTaxBreakdownTaxRateDetailsTaxType = "sales_tax"
TaxCalculationTaxBreakdownTaxRateDetailsTaxTypeVAT TaxCalculationTaxBreakdownTaxRateDetailsTaxType = "vat"
)

// The reasoning behind this tax, for example, if the product is tax exempt. We might extend the possible values for this field to support new tax rules.
Expand Down Expand Up @@ -340,7 +344,7 @@ type TaxCalculationShippingCost struct {
Amount int64 `json:"amount"`
// The amount of tax calculated for shipping, in integer cents.
AmountTax int64 `json:"amount_tax"`
// The ID of an existing [ShippingRate](https://stripe.com/docs/api/shipping_rates/object)
// The ID of an existing [ShippingRate](https://stripe.com/docs/api/shipping_rates/object).
ShippingRate string `json:"shipping_rate"`
// Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes.
TaxBehavior TaxCalculationShippingCostTaxBehavior `json:"tax_behavior"`
Expand Down
Loading