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 #1702

Merged
merged 5 commits into from
Aug 10, 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 @@
v446
v457
2 changes: 2 additions & 0 deletions account.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const (
AccountCompanyStructureGovernmentInstrumentality AccountCompanyStructure = "government_instrumentality"
AccountCompanyStructureGovernmentalUnit AccountCompanyStructure = "governmental_unit"
AccountCompanyStructureIncorporatedNonProfit AccountCompanyStructure = "incorporated_non_profit"
AccountCompanyStructureIncorporatedPartnership AccountCompanyStructure = "incorporated_partnership"
AccountCompanyStructureLimitedLiabilityPartnership AccountCompanyStructure = "limited_liability_partnership"
AccountCompanyStructureLLC AccountCompanyStructure = "llc"
AccountCompanyStructureMultiMemberLLC AccountCompanyStructure = "multi_member_llc"
Expand All @@ -57,6 +58,7 @@ const (
AccountCompanyStructureTaxExemptGovernmentInstrumentality AccountCompanyStructure = "tax_exempt_government_instrumentality"
AccountCompanyStructureUnincorporatedAssociation AccountCompanyStructure = "unincorporated_association"
AccountCompanyStructureUnincorporatedNonProfit AccountCompanyStructure = "unincorporated_non_profit"
AccountCompanyStructureUnincorporatedPartnership AccountCompanyStructure = "unincorporated_partnership"
)

// One of `document_corrupt`, `document_expired`, `document_failed_copy`, `document_failed_greyscale`, `document_failed_other`, `document_failed_test_mode`, `document_fraudulent`, `document_incomplete`, `document_invalid`, `document_manipulated`, `document_not_readable`, `document_not_uploaded`, `document_type_not_supported`, or `document_too_large`. A machine-readable code specifying the verification state for this document.
Expand Down
7 changes: 4 additions & 3 deletions balancetransaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const (
BalanceTransactionStatusPending BalanceTransactionStatus = "pending"
)

// Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. [Learn more](https://stripe.com/docs/reports/balance-transaction-types) about balance transaction types and what they represent. If you are looking to classify transactions for accounting purposes, you might want to consider `reporting_category` instead.
// Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. [Learn more](https://stripe.com/docs/reports/balance-transaction-types) about balance transaction types and what they represent. If you are looking to classify transactions for accounting purposes, you might want to consider `reporting_category` instead.
type BalanceTransactionType string

// List of values that BalanceTransactionType can take
Expand All @@ -90,6 +90,7 @@ const (
BalanceTransactionTypePayment BalanceTransactionType = "payment"
BalanceTransactionTypePaymentFailureRefund BalanceTransactionType = "payment_failure_refund"
BalanceTransactionTypePaymentRefund BalanceTransactionType = "payment_refund"
BalanceTransactionTypePaymentReversal BalanceTransactionType = "payment_reversal"
BalanceTransactionTypePayout BalanceTransactionType = "payout"
BalanceTransactionTypePayoutCancel BalanceTransactionType = "payout_cancel"
BalanceTransactionTypePayoutFailure BalanceTransactionType = "payout_failure"
Expand Down Expand Up @@ -125,7 +126,7 @@ type BalanceTransactionListParams struct {
Payout *string `form:"payout"`
// Only returns the original transaction.
Source *string `form:"source"`
// Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`.
// Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`.
Type *string `form:"type"`
}

Expand Down Expand Up @@ -184,7 +185,7 @@ type BalanceTransaction struct {
Source *BalanceTransactionSource `json:"source"`
// If the transaction's net funds are available in the Stripe balance yet. Either `available` or `pending`.
Status BalanceTransactionStatus `json:"status"`
// Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. [Learn more](https://stripe.com/docs/reports/balance-transaction-types) about balance transaction types and what they represent. If you are looking to classify transactions for accounting purposes, you might want to consider `reporting_category` instead.
// Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. [Learn more](https://stripe.com/docs/reports/balance-transaction-types) about balance transaction types and what they represent. If you are looking to classify transactions for accounting purposes, you might want to consider `reporting_category` instead.
Type BalanceTransactionType `json:"type"`
}
type BalanceTransactionSource struct {
Expand Down
2 changes: 1 addition & 1 deletion billingportal_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ type BillingPortalSessionParams struct {
Customer *string `form:"customer"`
// Information about a specific flow for the customer to go through. See the [docs](https://stripe.com/docs/customer-management/portal-deep-links) to learn more about using customer portal deep links and flows.
FlowData *BillingPortalSessionFlowDataParams `form:"flow_data"`
// The IETF language tag of the locale Customer Portal is displayed in. If blank or auto, the customer's `preferred_locales` or browser's locale is used.
// The IETF language tag of the locale customer portal is displayed in. If blank or auto, the customer's `preferred_locales` or browser's locale is used.
Locale *string `form:"locale"`
// The `on_behalf_of` account to use for this session. When specified, only subscriptions and invoices with this `on_behalf_of` account appear in the portal. For more information, see the [docs](https://stripe.com/docs/connect/separate-charges-and-transfers#on-behalf-of). Use the [Accounts API](https://stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account's branding settings, which the portal displays.
OnBehalfOf *string `form:"on_behalf_of"`
Expand Down
1 change: 1 addition & 0 deletions creditnotelineitem.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type CreditNoteLineItemDiscountAmount struct {

// CreditNoteLineItem is the resource representing a Stripe credit note line item.
// For more details see https://stripe.com/docs/api/credit_notes/line_item
// The credit note line item object
type CreditNoteLineItem struct {
// The integer amount in cents (or local equivalent) representing the gross amount being credited for this line item, excluding (exclusive) tax and discounts.
Amount int64 `json:"amount"`
Expand Down
29 changes: 28 additions & 1 deletion customercashbalancetransaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

package stripe

import "encoding/json"

// The funding method type used to fund the customer balance. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
type CustomerCashBalanceTransactionFundedBankTransferType string

Expand Down Expand Up @@ -33,6 +35,7 @@ type CustomerCashBalanceTransactionType string

// List of values that CustomerCashBalanceTransactionType can take
const (
CustomerCashBalanceTransactionTypeAdjustedForOverdraft CustomerCashBalanceTransactionType = "adjusted_for_overdraft"
CustomerCashBalanceTransactionTypeAppliedToPayment CustomerCashBalanceTransactionType = "applied_to_payment"
CustomerCashBalanceTransactionTypeFunded CustomerCashBalanceTransactionType = "funded"
CustomerCashBalanceTransactionTypeFundingReversed CustomerCashBalanceTransactionType = "funding_reversed"
Expand All @@ -53,6 +56,10 @@ type CustomerCashBalanceTransactionListParams struct {
ListParams `form:"*"`
Customer *string `form:"-"` // Included in URL
}
type CustomerCashBalanceTransactionAdjustedForOverdraft struct {
// The [Cash Balance Transaction](https://stripe.com/docs/api/cash_balance_transactions/object) that brought the customer balance negative, triggering the clawback of funds.
LinkedTransaction *CustomerCashBalanceTransaction `json:"linked_transaction"`
}
type CustomerCashBalanceTransactionAppliedToPayment struct {
// The [Payment Intent](https://stripe.com/docs/api/payment_intents/object) that funds were applied to.
PaymentIntent *PaymentIntent `json:"payment_intent"`
Expand Down Expand Up @@ -115,7 +122,8 @@ type CustomerCashBalanceTransactionUnappliedFromPayment struct {
// to payments, and refunds to the customer.
type CustomerCashBalanceTransaction struct {
APIResource
AppliedToPayment *CustomerCashBalanceTransactionAppliedToPayment `json:"applied_to_payment"`
AdjustedForOverdraft *CustomerCashBalanceTransactionAdjustedForOverdraft `json:"adjusted_for_overdraft"`
AppliedToPayment *CustomerCashBalanceTransactionAppliedToPayment `json:"applied_to_payment"`
// Time at which the object was created. Measured in seconds since the Unix epoch.
Created int64 `json:"created"`
// 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).
Expand Down Expand Up @@ -145,3 +153,22 @@ type CustomerCashBalanceTransactionList struct {
ListMeta
Data []*CustomerCashBalanceTransaction `json:"data"`
}

// UnmarshalJSON handles deserialization of a CustomerCashBalanceTransaction.
// This custom unmarshaling is needed because the resulting
// property may be an id or the full struct if it was expanded.
func (c *CustomerCashBalanceTransaction) UnmarshalJSON(data []byte) error {
if id, ok := ParseID(data); ok {
c.ID = id
return nil
}

type customerCashBalanceTransaction CustomerCashBalanceTransaction
var v customerCashBalanceTransaction
if err := json.Unmarshal(data, &v); err != nil {
return err
}

*c = CustomerCashBalanceTransaction(v)
return nil
}
4 changes: 3 additions & 1 deletion taxrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ type TaxRate struct {
Description string `json:"description"`
// The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page.
DisplayName string `json:"display_name"`
// Actual/effective tax rate percentage out of 100. For tax calculations with automatic_tax[enabled]=true, this percentage does not include the statutory tax rate of non-taxable jurisdictions.
// Actual/effective tax rate percentage out of 100. For tax calculations with automatic_tax[enabled]=true,
// this percentage reflects the rate actually used to calculate tax based on the product's taxability
// and whether the user is registered to collect taxes in the corresponding jurisdiction.
EffectivePercentage float64 `json:"effective_percentage"`
// Unique identifier for the object.
ID string `json:"id"`
Expand Down
Loading