Skip to content

Commit

Permalink
Update generated code for beta (new) (#1623)
Browse files Browse the repository at this point in the history
  • Loading branch information
stripe-openapi[bot] authored Mar 23, 2023
1 parent bea1a7a commit f07465d
Show file tree
Hide file tree
Showing 15 changed files with 453 additions and 65 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v263
v277
2 changes: 2 additions & 0 deletions capital_financingsummary.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ type CapitalFinancingSummary struct {
// fee amount, withhold rate, remaining amount, paid amount, current repayment interval,
// repayment start date, and advance payout date.
Details *CapitalFinancingSummaryDetails `json:"details"`
// The Financing Offer ID this Financing Summary corresponds to
FinancingOffer string `json:"financing_offer"`
// The object type: financing_summary
Object string `json:"object"`
// Status of the Connected Account's financing. [/v1/capital/financing_summary](https://stripe.com/docs/api/capital/financing_summary) will only return `details` for `paid_out` financing.
Expand Down
2 changes: 2 additions & 0 deletions checkout_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -1670,6 +1670,8 @@ type CheckoutSessionCurrencyConversion struct {
AmountSubtotal int64 `json:"amount_subtotal"`
// Total of all items in source currency after discounts and taxes are applied.
AmountTotal int64 `json:"amount_total"`
// Exchange rate used to convert source currency amounts to customer currency amounts
FxRate float64 `json:"fx_rate,string"`
// Creation currency of the CheckoutSession before localization
SourceCurrency Currency `json:"source_currency"`
}
Expand Down
2 changes: 1 addition & 1 deletion dispute.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ type DisputeEvidence struct {
UncategorizedText string `json:"uncategorized_text"`
}
type DisputeEvidenceDetails struct {
// Date by which evidence must be submitted in order to successfully challenge dispute. Will be null if the customer's bank or credit card company doesn't allow a response for this particular dispute.
// Date by which evidence must be submitted in order to successfully challenge dispute. Will be 0 if the customer's bank or credit card company doesn't allow a response for this particular dispute.
DueBy int64 `json:"due_by"`
// Whether evidence has been staged for this dispute.
HasEvidence bool `json:"has_evidence"`
Expand Down
30 changes: 30 additions & 0 deletions example/generated_examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ import (
subscription "github.com/stripe/stripe-go/v74/subscription"
subscriptionitem "github.com/stripe/stripe-go/v74/subscriptionitem"
subscriptionschedule "github.com/stripe/stripe-go/v74/subscriptionschedule"
tax_calculation "github.com/stripe/stripe-go/v74/tax/calculation"
tax_transaction "github.com/stripe/stripe-go/v74/tax/transaction"
taxcode "github.com/stripe/stripe-go/v74/taxcode"
taxid "github.com/stripe/stripe-go/v74/taxid"
taxrate "github.com/stripe/stripe-go/v74/taxrate"
Expand Down Expand Up @@ -2808,3 +2810,31 @@ func TestWebhookEndpointUpdate(t *testing.T) {
result, _ := webhookendpoint.Update("we_xxxxxxxxxxxxx", params)
assert.NotNil(t, result)
}

func TestTaxTransactionCreateFromCalculation(t *testing.T) {
params := &stripe.TaxTransactionCreateFromCalculationParams{
Calculation: stripe.String("xxx"),
Reference: stripe.String("yyy"),
}
result, _ := tax_transaction.CreateFromCalculation(params)
assert.NotNil(t, result)
}

func TestTaxCalculationListLineItems(t *testing.T) {
params := &stripe.TaxCalculationListLineItemsParams{
Calculation: stripe.String("xxx"),
}
result := tax_calculation.ListLineItems(params)
assert.NotNil(t, result)
assert.Nil(t, result.Err())
}

func TestQuotePreviewInvoiceLines(t *testing.T) {
params := &stripe.QuotePreviewInvoiceLinesParams{
Quote: stripe.String("qt_xyz"),
PreviewInvoice: stripe.String("in_xyz"),
}
result := quote.PreviewInvoiceLines(params)
assert.NotNil(t, result)
assert.Nil(t, result.Err())
}
1 change: 1 addition & 0 deletions paymentlink.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ const (
PaymentLinkPaymentMethodTypeIDEAL PaymentLinkPaymentMethodType = "ideal"
PaymentLinkPaymentMethodTypeKlarna PaymentLinkPaymentMethodType = "klarna"
PaymentLinkPaymentMethodTypeKonbini PaymentLinkPaymentMethodType = "konbini"
PaymentLinkPaymentMethodTypeLink PaymentLinkPaymentMethodType = "link"
PaymentLinkPaymentMethodTypeOXXO PaymentLinkPaymentMethodType = "oxxo"
PaymentLinkPaymentMethodTypeP24 PaymentLinkPaymentMethodType = "p24"
PaymentLinkPaymentMethodTypePayNow PaymentLinkPaymentMethodType = "paynow"
Expand Down
16 changes: 16 additions & 0 deletions setupintent.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@ const (
SetupIntentUsageOnSession SetupIntentUsage = "on_session"
)

// 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 {
// Whether this feature is enabled.
Enabled *bool `form:"enabled"`
}

// If this is a Mandate accepted offline, this hash contains details about the offline acceptance.
type SetupIntentMandateDataCustomerAcceptanceOfflineParams struct{}

Expand Down Expand Up @@ -678,6 +684,8 @@ type SetupIntentParams struct {
//
// It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.
AttachToSelf *bool `form:"attach_to_self"`
// When enabled, this SetupIntent will accept payment methods that you have enabled in the Dashboard and are compatible with this SetupIntent's other parameters.
AutomaticPaymentMethods *SetupIntentAutomaticPaymentMethodsParams `form:"automatic_payment_methods"`
// The client secret of the SetupIntent. Required if a publishable key is used to retrieve the SetupIntent.
ClientSecret *string `form:"client_secret"`
// Set to `true` to attempt to confirm this SetupIntent immediately. This parameter defaults to `false`. If the payment method attached is a card, a return_url may be provided in case additional authentication is required.
Expand Down Expand Up @@ -1027,6 +1035,12 @@ type SetupIntentVerifyMicrodepositsParams struct {
// A six-character code starting with SM present in the microdeposit sent to the bank account.
DescriptorCode *string `form:"descriptor_code"`
}

// Settings for automatic payment methods compatible with this Setup Intent
type SetupIntentAutomaticPaymentMethods struct {
// Automatically calculates compatible payment methods
Enabled bool `json:"enabled"`
}
type SetupIntentNextActionCashAppHandleRedirectOrDisplayQRCodeQRCode struct {
// The date (unix timestamp) when the QR code expires.
ExpiresAt int64 `json:"expires_at"`
Expand Down Expand Up @@ -1215,6 +1229,8 @@ type SetupIntent struct {
//
// It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.
AttachToSelf bool `json:"attach_to_self"`
// Settings for automatic payment methods compatible with this Setup Intent
AutomaticPaymentMethods *SetupIntentAutomaticPaymentMethods `json:"automatic_payment_methods"`
// Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`.
CancellationReason SetupIntentCancellationReason `json:"cancellation_reason"`
// The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.
Expand Down
16 changes: 8 additions & 8 deletions tax/calculation/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (c Client) ListLineItems(listParams *stripe.TaxCalculationListLineItemsPara
)
return &LineItemIter{
Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) {
list := &stripe.LineItemList{}
list := &stripe.TaxCalculationLineItemList{}
err := c.B.CallRaw(http.MethodGet, path, c.Key, b, p, list)

ret := make([]interface{}, len(list.Data))
Expand All @@ -64,21 +64,21 @@ func (c Client) ListLineItems(listParams *stripe.TaxCalculationListLineItemsPara
}
}

// LineItemIter is an iterator for line items.
// LineItemIter is an iterator for tax calculation line items.
type LineItemIter struct {
*stripe.Iter
}

// LineItem returns the line item which the iterator is currently pointing to.
func (i *LineItemIter) LineItem() *stripe.LineItem {
return i.Current().(*stripe.LineItem)
// TaxCalculationLineItem returns the tax calculation line item which the iterator is currently pointing to.
func (i *LineItemIter) TaxCalculationLineItem() *stripe.TaxCalculationLineItem {
return i.Current().(*stripe.TaxCalculationLineItem)
}

// LineItemList returns the current list object which the iterator is
// TaxCalculationLineItemList 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 *LineItemIter) LineItemList() *stripe.LineItemList {
return i.List().(*stripe.LineItemList)
func (i *LineItemIter) TaxCalculationLineItemList() *stripe.TaxCalculationLineItemList {
return i.List().(*stripe.TaxCalculationLineItemList)
}

func getC() Client {
Expand Down
16 changes: 8 additions & 8 deletions tax/transaction/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (c Client) ListLineItems(listParams *stripe.TaxTransactionListLineItemsPara
)
return &LineItemIter{
Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) {
list := &stripe.LineItemList{}
list := &stripe.TaxTransactionLineItemList{}
err := c.B.CallRaw(http.MethodGet, path, c.Key, b, p, list)

ret := make([]interface{}, len(list.Data))
Expand All @@ -113,21 +113,21 @@ func (c Client) ListLineItems(listParams *stripe.TaxTransactionListLineItemsPara
}
}

// LineItemIter is an iterator for line items.
// LineItemIter is an iterator for tax transaction line items.
type LineItemIter struct {
*stripe.Iter
}

// LineItem returns the line item which the iterator is currently pointing to.
func (i *LineItemIter) LineItem() *stripe.LineItem {
return i.Current().(*stripe.LineItem)
// TaxTransactionLineItem returns the tax transaction line item which the iterator is currently pointing to.
func (i *LineItemIter) TaxTransactionLineItem() *stripe.TaxTransactionLineItem {
return i.Current().(*stripe.TaxTransactionLineItem)
}

// LineItemList returns the current list object which the iterator is
// TaxTransactionLineItemList 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 *LineItemIter) LineItemList() *stripe.LineItemList {
return i.List().(*stripe.LineItemList)
func (i *LineItemIter) TaxTransactionLineItemList() *stripe.TaxTransactionLineItemList {
return i.List().(*stripe.TaxTransactionLineItemList)
}

func getC() Client {
Expand Down
Loading

0 comments on commit f07465d

Please sign in to comment.