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

API Updates for beta branch #1585

Merged
merged 8 commits into from
Dec 15, 2022
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 74.3.0 - 2022-12-15
* [#1584](https://github.com/stripe/stripe-go/pull/1584) API Updates
* Add support for new value `invoice_overpaid` on enum `CustomerBalanceTransactionType`
* [#1581](https://github.com/stripe/stripe-go/pull/1581) API Updates

## 74.3.0-beta.1 - 2022-12-08
* [#1582](https://github.com/stripe/stripe-go/pull/1582) API Updates for beta branch
* Updated stable APIs to the latest version
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v213
v214
3 changes: 1 addition & 2 deletions balance.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ const (
)

// Retrieves the current account balance, based on the authentication that was used to make the request.
//
// For a sample request, see [Accounting for negative balances](https://stripe.com/docs/connect/account-balances#accounting-for-negative-balances).
// For a sample request, see [Accounting for negative balances](https://stripe.com/docs/connect/account-balances#accounting-for-negative-balances).
type BalanceParams struct {
Params `form:"*"`
}
Expand Down
2 changes: 1 addition & 1 deletion checkout_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,7 @@ type CheckoutSessionParams struct {
// When a Customer is not created, you can still retrieve email, address, and other customer data entered in Checkout
// with [customer_details](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-customer_details).
//
// Sessions that don't create Customers instead create [Guest Customers](https://support.stripe.com/questions/guest-customer-faq)
// Sessions that don't create Customers instead are grouped by [guest customers](https://stripe.com/docs/payments/checkout/guest-customers)
// in the Dashboard. Promotion codes limited to first time customers will return invalid for these Sessions.
//
// Can only be set in `payment` and `setup` mode.
Expand Down
8 changes: 8 additions & 0 deletions client/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,11 @@ import (
"github.com/stripe/stripe-go/v74/subscription"
"github.com/stripe/stripe-go/v74/subscriptionitem"
"github.com/stripe/stripe-go/v74/subscriptionschedule"
"github.com/stripe/stripe-go/v74/taxcalculation"
"github.com/stripe/stripe-go/v74/taxcode"
"github.com/stripe/stripe-go/v74/taxid"
"github.com/stripe/stripe-go/v74/taxrate"
"github.com/stripe/stripe-go/v74/taxtransaction"
terminalconfiguration "github.com/stripe/stripe-go/v74/terminal/configuration"
terminalconnectiontoken "github.com/stripe/stripe-go/v74/terminal/connectiontoken"
terminallocation "github.com/stripe/stripe-go/v74/terminal/location"
Expand Down Expand Up @@ -275,12 +277,16 @@ type API struct {
Subscriptions *subscription.Client
// SubscriptionSchedules is the client used to invoke /subscription_schedules APIs.
SubscriptionSchedules *subscriptionschedule.Client
// TaxCalculations is the client used to invoke /tax/calculations APIs.
TaxCalculations *taxcalculation.Client
// TaxCodes is the client used to invoke /tax_codes APIs.
TaxCodes *taxcode.Client
// TaxIDs is the client used to invoke /customers/{customer}/tax_ids APIs.
TaxIDs *taxid.Client
// TaxRates is the client used to invoke /tax_rates APIs.
TaxRates *taxrate.Client
// TaxTransactions is the client used to invoke /tax/transactions APIs.
TaxTransactions *taxtransaction.Client
// TerminalConfigurations is the client used to invoke /terminal/configurations APIs.
TerminalConfigurations *terminalconfiguration.Client
// TerminalConnectionTokens is the client used to invoke /terminal/connection_tokens APIs.
Expand Down Expand Up @@ -431,9 +437,11 @@ func (a *API) Init(key string, backends *stripe.Backends) {
a.SubscriptionItems = &subscriptionitem.Client{B: backends.API, Key: key}
a.Subscriptions = &subscription.Client{B: backends.API, Key: key}
a.SubscriptionSchedules = &subscriptionschedule.Client{B: backends.API, Key: key}
a.TaxCalculations = &taxcalculation.Client{B: backends.API, Key: key}
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.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}
a.TerminalLocations = &terminallocation.Client{B: backends.API, Key: key}
Expand Down
2 changes: 2 additions & 0 deletions creditnote.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@ type CreditNoteLineParams struct {
// its amount_due. For a status=paid invoice, a credit note does not affect its amount_due. Instead, it can result
// in any combination of the following:
//
//
// Refund: create a new refund (using refund_amount) or link an existing refund (using refund).
// Customer balance credit: credit the customer's balance (using credit_amount) which will be automatically applied to their next invoice when it's finalized.
// Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using out_of_band_amount).
//
//
// For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total.
//
// You may issue multiple credit notes for an invoice. Each credit note will increment the invoice's pre_payment_credit_notes_amount
Expand Down
5 changes: 3 additions & 2 deletions customerbalancetransaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package stripe

import "encoding/json"

// Transaction type: `adjustment`, `applied_to_invoice`, `credit_note`, `initial`, `invoice_too_large`, `invoice_too_small`, `unspent_receiver_credit`, or `unapplied_from_invoice`. See the [Customer Balance page](https://stripe.com/docs/billing/customer/balance#types) to learn more about transaction types.
// Transaction type: `adjustment`, `applied_to_invoice`, `credit_note`, `initial`, `invoice_overpaid`, `invoice_too_large`, `invoice_too_small`, `unspent_receiver_credit`, or `unapplied_from_invoice`. See the [Customer Balance page](https://stripe.com/docs/billing/customer/balance#types) to learn more about transaction types.
type CustomerBalanceTransactionType string

// List of values that CustomerBalanceTransactionType can take
Expand All @@ -17,6 +17,7 @@ const (
CustomerBalanceTransactionTypeAppliedToInvoice CustomerBalanceTransactionType = "applied_to_invoice"
CustomerBalanceTransactionTypeCreditNote CustomerBalanceTransactionType = "credit_note"
CustomerBalanceTransactionTypeInitial CustomerBalanceTransactionType = "initial"
CustomerBalanceTransactionTypeInvoiceOverpaid CustomerBalanceTransactionType = "invoice_overpaid"
CustomerBalanceTransactionTypeInvoiceTooLarge CustomerBalanceTransactionType = "invoice_too_large"
CustomerBalanceTransactionTypeInvoiceTooSmall CustomerBalanceTransactionType = "invoice_too_small"
CustomerBalanceTransactionTypeMigration CustomerBalanceTransactionType = "migration"
Expand Down Expand Up @@ -74,7 +75,7 @@ type CustomerBalanceTransaction struct {
Metadata map[string]string `json:"metadata"`
// String representing the object's type. Objects of the same type share the same value.
Object string `json:"object"`
// Transaction type: `adjustment`, `applied_to_invoice`, `credit_note`, `initial`, `invoice_too_large`, `invoice_too_small`, `unspent_receiver_credit`, or `unapplied_from_invoice`. See the [Customer Balance page](https://stripe.com/docs/billing/customer/balance#types) to learn more about transaction types.
// Transaction type: `adjustment`, `applied_to_invoice`, `credit_note`, `initial`, `invoice_overpaid`, `invoice_too_large`, `invoice_too_small`, `unspent_receiver_credit`, or `unapplied_from_invoice`. See the [Customer Balance page](https://stripe.com/docs/billing/customer/balance#types) to learn more about transaction types.
Type CustomerBalanceTransactionType `json:"type"`
}

Expand Down
14 changes: 7 additions & 7 deletions financialconnections_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,16 @@ const (

// If `category` is `cash`, one of:
//
// - `checking`
// - `savings`
// - `other`
// - `checking`
// - `savings`
// - `other`
//
// If `category` is `credit`, one of:
//
// - `mortgage`
// - `line_of_credit`
// - `credit_card`
// - `other`
// - `mortgage`
// - `line_of_credit`
// - `credit_card`
// - `other`
//
// If `category` is `investment` or `other`, this will be `other`.
type FinancialConnectionsAccountSubcategory string
Expand Down
20 changes: 19 additions & 1 deletion invoice.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ import (
"github.com/stripe/stripe-go/v74/form"
)

// Describes whether the quote line is affecting a new schedule or an existing schedule.
type InvoiceAppliesToType string

// List of values that InvoiceAppliesToType can take
const (
InvoiceAppliesToTypeNewReference InvoiceAppliesToType = "new_reference"
InvoiceAppliesToTypeSubscriptionSchedule InvoiceAppliesToType = "subscription_schedule"
)

// The status of the most recent automated tax calculation for this invoice.
type InvoiceAutomaticTaxStatus string

Expand Down Expand Up @@ -932,6 +941,14 @@ type InvoiceListLinesParams struct {
ListParams `form:"*"`
Invoice *string `form:"-"` // Included in URL
}
type InvoiceAppliesTo struct {
// A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule.
NewReference string `json:"new_reference"`
// The ID of the schedule the line applies to.
SubscriptionSchedule string `json:"subscription_schedule"`
// Describes whether the quote line is affecting a new schedule or an existing schedule.
Type InvoiceAppliesToType `json:"type"`
}
type InvoiceAutomaticTax struct {
// Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices.
Enabled bool `json:"enabled"`
Expand Down Expand Up @@ -1150,7 +1167,8 @@ type Invoice struct {
// ID of the Connect Application that created the invoice.
Application *Application `json:"application"`
// The fee in %s that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid.
ApplicationFeeAmount int64 `json:"application_fee_amount"`
ApplicationFeeAmount int64 `json:"application_fee_amount"`
AppliesTo *InvoiceAppliesTo `json:"applies_to"`
// Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule.
AttemptCount int64 `json:"attempt_count"`
// 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.
Expand Down
21 changes: 20 additions & 1 deletion invoicelineitem.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@

package stripe

// Describes whether the quote line is affecting a new schedule or an existing schedule.
type InvoiceLineItemAppliesToType string

// List of values that InvoiceLineItemAppliesToType can take
const (
InvoiceLineItemAppliesToTypeNewReference InvoiceLineItemAppliesToType = "new_reference"
InvoiceLineItemAppliesToTypeSubscriptionSchedule InvoiceLineItemAppliesToType = "subscription_schedule"
)

// A string identifying the type of the source of this line item, either an `invoiceitem` or a `subscription`.
type InvoiceLineItemType string

Expand All @@ -15,6 +24,15 @@ const (
InvoiceLineItemTypeSubscription InvoiceLineItemType = "subscription"
)

type InvoiceLineItemAppliesTo struct {
// A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule.
NewReference string `json:"new_reference"`
// The ID of the schedule the line applies to.
SubscriptionSchedule string `json:"subscription_schedule"`
// Describes whether the quote line is affecting a new schedule or an existing schedule.
Type InvoiceLineItemAppliesToType `json:"type"`
}

// The amount of discount calculated per discount for this line item.
type InvoiceLineItemDiscountAmount struct {
// The amount, in %s, of the discount.
Expand All @@ -40,7 +58,8 @@ type InvoiceLineItem struct {
// The amount, in %s.
Amount int64 `json:"amount"`
// The integer amount in %s representing the amount for this line item, excluding all tax and discounts.
AmountExcludingTax int64 `json:"amount_excluding_tax"`
AmountExcludingTax int64 `json:"amount_excluding_tax"`
AppliesTo *InvoiceLineItemAppliesTo `json:"applies_to"`
// 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"`
// An arbitrary string attached to the object. Often useful for displaying to users.
Expand Down
4 changes: 2 additions & 2 deletions paymentintent.go
Original file line number Diff line number Diff line change
Expand Up @@ -1714,11 +1714,11 @@ type PaymentIntentConfirmParams struct {
UseStripeSDK *bool `form:"use_stripe_sdk"`
}

// A PaymentIntent object can be canceled when it is in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action, or processing.
// A PaymentIntent object can be canceled when it is in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://stripe.com/docs/payments/intents), processing.
//
// Once canceled, no additional charges will be made by the PaymentIntent and any operations on the PaymentIntent will fail with an error. For PaymentIntents with status='requires_capture', the remaining amount_capturable will automatically be refunded.
//
// You cannot cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead
// You cannot cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead.
type PaymentIntentCancelParams struct {
Params `form:"*"`
// Reason for canceling this PaymentIntent. Possible values are `duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`
Expand Down
Loading