diff --git a/CHANGELOG.md b/CHANGELOG.md index 814813fa8b..d22819de21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 75.5.0 - 2023-09-13 +* [#1735](https://github.com/stripe/stripe-go/pull/1735) Bugfix: point files.New back to files.stripe.com +* [#1731](https://github.com/stripe/stripe-go/pull/1731) Delay calculation of Stripe-User-Agent + ## 75.5.0-beta.1 - 2023-09-07 * [#1730](https://github.com/stripe/stripe-go/pull/1730) Update generated code for beta Release specs are identical. diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 2597d2c772..e9281bf5d6 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v515 \ No newline at end of file +v532 \ No newline at end of file diff --git a/balance.go b/balance.go index 0e75d16458..ce1bb18224 100644 --- a/balance.go +++ b/balance.go @@ -30,7 +30,7 @@ func (p *BalanceParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } -// Funds that are available to be transferred or paid out, whether automatically by Stripe or explicitly via the [Transfers API](https://stripe.com/docs/api#transfers) or [Payouts API](https://stripe.com/docs/api#payouts). The available balance for each currency and payment type can be found in the `source_types` property. +// Available funds that you can transfer or pay out automatically by Stripe or explicitly through the [Transfers API](https://stripe.com/docs/api#transfers) or [Payouts API](https://stripe.com/docs/api#payouts). You can find the available balance for each currency and payment type in the `source_types` property. type Amount struct { // Balance amount. Amount int64 `json:"amount"` @@ -56,17 +56,17 @@ type BalanceIssuing struct { // Related guide: [Understanding Connect account balances](https://stripe.com/docs/connect/account-balances) type Balance struct { APIResource - // Funds that are available to be transferred or paid out, whether automatically by Stripe or explicitly via the [Transfers API](https://stripe.com/docs/api#transfers) or [Payouts API](https://stripe.com/docs/api#payouts). The available balance for each currency and payment type can be found in the `source_types` property. + // Available funds that you can transfer or pay out automatically by Stripe or explicitly through the [Transfers API](https://stripe.com/docs/api#transfers) or [Payouts API](https://stripe.com/docs/api#payouts). You can find the available balance for each currency and payment type in the `source_types` property. Available []*Amount `json:"available"` - // Funds held due to negative balances on connected Custom accounts. The connect reserve balance for each currency and payment type can be found in the `source_types` property. + // Funds held due to negative balances on connected Custom accounts. You can find the connect reserve balance for each currency and payment type in the `source_types` property. ConnectReserved []*Amount `json:"connect_reserved"` - // Funds that can be paid out using Instant Payouts. + // Funds that you can pay out using Instant Payouts. InstantAvailable []*Amount `json:"instant_available"` Issuing *BalanceIssuing `json:"issuing"` // 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"` // String representing the object's type. Objects of the same type share the same value. Object string `json:"object"` - // Funds that are not yet available in the balance. The pending balance for each currency, and for each payment type, can be found in the `source_types` property. + // Funds that aren't available in the balance yet. You can find the pending balance for each currency and each payment type in the `source_types` property. Pending []*Amount `json:"pending"` } diff --git a/balancetransaction.go b/balancetransaction.go index 559868d172..9de32426ee 100644 --- a/balancetransaction.go +++ b/balancetransaction.go @@ -8,7 +8,7 @@ package stripe import "encoding/json" -// [Learn more](https://stripe.com/docs/reports/reporting-categories) about how reporting categories can help you understand balance transactions from an accounting perspective. +// Learn more about how [reporting categories] (https://stripe.com/docs/reports/reporting-categories) can help you understand balance transactions from an accounting perspective. type BalanceTransactionReportingCategory string // List of values that BalanceTransactionReportingCategory can take @@ -64,7 +64,7 @@ const ( BalanceTransactionSourceTypeTransferReversal BalanceTransactionSourceType = "transfer_reversal" ) -// If the transaction's net funds are available in the Stripe balance yet. Either `available` or `pending`. +// The transaction's net funds status in the Stripe balance, which are either `available` or `pending`. type BalanceTransactionStatus string // List of values that BalanceTransactionStatus can take @@ -73,7 +73,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`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `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. +// 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`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `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 about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead. type BalanceTransactionType string // List of values that BalanceTransactionType can take @@ -172,14 +172,14 @@ type BalanceTransactionFeeDetail struct { } // Balance transactions represent funds moving through your Stripe account. -// They're created for every type of transaction that comes into or flows out of your Stripe account balance. +// Stripe creates them for every type of transaction that enters or leaves your Stripe account balance. // // Related guide: [Balance transaction types](https://stripe.com/docs/reports/balance-transaction-types) type BalanceTransaction struct { APIResource - // Gross amount of the transaction, in cents (or local equivalent). + // Gross amount of the transaction (in cents (or local equivalent)). Amount int64 `json:"amount"` - // The date the transaction's net funds will become available in the Stripe balance. + // The date that the transaction's net funds become available in the Stripe balance. AvailableOn int64 `json:"available_on"` // Time at which the object was created. Measured in seconds since the Unix epoch. Created int64 `json:"created"` @@ -187,7 +187,7 @@ type BalanceTransaction struct { Currency Currency `json:"currency"` // An arbitrary string attached to the object. Often useful for displaying to users. Description string `json:"description"` - // The exchange rate used, if applicable, for this transaction. Specifically, if money was converted from currency A to currency B, then the `amount` in currency A, times `exchange_rate`, would be the `amount` in currency B. For example, suppose you charged a customer 10.00 EUR. Then the PaymentIntent's `amount` would be `1000` and `currency` would be `eur`. Suppose this was converted into 12.34 USD in your Stripe account. Then the BalanceTransaction's `amount` would be `1234`, `currency` would be `usd`, and `exchange_rate` would be `1.234`. + // If applicable, this transaction uses an exchange rate. If money converts from currency A to currency B, then the `amount` in currency A, multipled by the `exchange_rate`, equals the `amount` in currency B. For example, if you charge a customer 10.00 EUR, the PaymentIntent's `amount` is `1000` and `currency` is `eur`. If this converts to 12.34 USD in your Stripe account, the BalanceTransaction's `amount` is `1234`, its `currency` is `usd`, and the `exchange_rate` is `1.234`. ExchangeRate float64 `json:"exchange_rate"` // Fees (in cents (or local equivalent)) paid for this transaction. Fee int64 `json:"fee"` @@ -195,17 +195,17 @@ type BalanceTransaction struct { FeeDetails []*BalanceTransactionFeeDetail `json:"fee_details"` // Unique identifier for the object. ID string `json:"id"` - // Net amount of the transaction, in cents (or local equivalent). + // Net amount of the transaction (in cents (or local equivalent)). Net int64 `json:"net"` // String representing the object's type. Objects of the same type share the same value. Object string `json:"object"` - // [Learn more](https://stripe.com/docs/reports/reporting-categories) about how reporting categories can help you understand balance transactions from an accounting perspective. + // Learn more about how [reporting categories] (https://stripe.com/docs/reports/reporting-categories) can help you understand balance transactions from an accounting perspective. ReportingCategory BalanceTransactionReportingCategory `json:"reporting_category"` - // The Stripe object to which this transaction is related. + // This transaction relates to the Stripe object. Source *BalanceTransactionSource `json:"source"` - // If the transaction's net funds are available in the Stripe balance yet. Either `available` or `pending`. + // The transaction's net funds status in the Stripe balance, which are 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`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `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. + // 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`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `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 about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead. Type BalanceTransactionType `json:"type"` } type BalanceTransactionSource struct { diff --git a/client/api.go b/client/api.go index f767b2e0fb..f9b561a783 100644 --- a/client/api.go +++ b/client/api.go @@ -28,6 +28,7 @@ import ( "github.com/stripe/stripe-go/v75/cashbalance" "github.com/stripe/stripe-go/v75/charge" checkoutsession "github.com/stripe/stripe-go/v75/checkout/session" + "github.com/stripe/stripe-go/v75/confirmationtoken" "github.com/stripe/stripe-go/v75/countryspec" "github.com/stripe/stripe-go/v75/coupon" "github.com/stripe/stripe-go/v75/creditnote" @@ -107,8 +108,10 @@ import ( terminallocation "github.com/stripe/stripe-go/v75/terminal/location" terminalreader "github.com/stripe/stripe-go/v75/terminal/reader" testhelperscustomer "github.com/stripe/stripe-go/v75/testhelpers/customer" + testhelpersissuingauthorization "github.com/stripe/stripe-go/v75/testhelpers/issuing/authorization" testhelpersissuingcard "github.com/stripe/stripe-go/v75/testhelpers/issuing/card" testhelpersissuingcarddesign "github.com/stripe/stripe-go/v75/testhelpers/issuing/carddesign" + testhelpersissuingtransaction "github.com/stripe/stripe-go/v75/testhelpers/issuing/transaction" testhelpersrefund "github.com/stripe/stripe-go/v75/testhelpers/refund" testhelpersterminalreader "github.com/stripe/stripe-go/v75/testhelpers/terminal/reader" testhelperstestclock "github.com/stripe/stripe-go/v75/testhelpers/testclock" @@ -176,6 +179,8 @@ type API struct { Charges *charge.Client // CheckoutSessions is the client used to invoke /checkout/sessions APIs. CheckoutSessions *checkoutsession.Client + // ConfirmationTokens is the client used to invoke /confirmation_tokens APIs. + ConfirmationTokens *confirmationtoken.Client // CountrySpecs is the client used to invoke /country_specs APIs. CountrySpecs *countryspec.Client // Coupons is the client used to invoke /coupons APIs. @@ -334,10 +339,14 @@ type API struct { TerminalReaders *terminalreader.Client // TestHelpersCustomers is the client used to invoke /customers APIs. TestHelpersCustomers *testhelperscustomer.Client + // TestHelpersIssuingAuthorizations is the client used to invoke /issuing/authorizations APIs. + TestHelpersIssuingAuthorizations *testhelpersissuingauthorization.Client // TestHelpersIssuingCardDesigns is the client used to invoke /issuing/card_designs APIs. TestHelpersIssuingCardDesigns *testhelpersissuingcarddesign.Client // TestHelpersIssuingCards is the client used to invoke /issuing/cards APIs. TestHelpersIssuingCards *testhelpersissuingcard.Client + // TestHelpersIssuingTransactions is the client used to invoke /issuing/transactions APIs. + TestHelpersIssuingTransactions *testhelpersissuingtransaction.Client // TestHelpersRefunds is the client used to invoke /refunds APIs. TestHelpersRefunds *testhelpersrefund.Client // TestHelpersTerminalReaders is the client used to invoke /terminal/readers APIs. @@ -419,6 +428,7 @@ func (a *API) Init(key string, backends *stripe.Backends) { a.CashBalances = &cashbalance.Client{B: backends.API, Key: key} a.Charges = &charge.Client{B: backends.API, Key: key} a.CheckoutSessions = &checkoutsession.Client{B: backends.API, Key: key} + a.ConfirmationTokens = &confirmationtoken.Client{B: backends.API, Key: key} a.CountrySpecs = &countryspec.Client{B: backends.API, Key: key} a.Coupons = &coupon.Client{B: backends.API, Key: key} a.CreditNotes = &creditnote.Client{B: backends.API, Key: key} @@ -498,8 +508,10 @@ func (a *API) Init(key string, backends *stripe.Backends) { a.TerminalLocations = &terminallocation.Client{B: backends.API, Key: key} a.TerminalReaders = &terminalreader.Client{B: backends.API, Key: key} a.TestHelpersCustomers = &testhelperscustomer.Client{B: backends.API, Key: key} + a.TestHelpersIssuingAuthorizations = &testhelpersissuingauthorization.Client{B: backends.API, Key: key} a.TestHelpersIssuingCardDesigns = &testhelpersissuingcarddesign.Client{B: backends.API, Key: key} a.TestHelpersIssuingCards = &testhelpersissuingcard.Client{B: backends.API, Key: key} + a.TestHelpersIssuingTransactions = &testhelpersissuingtransaction.Client{B: backends.API, Key: key} a.TestHelpersRefunds = &testhelpersrefund.Client{B: backends.API, Key: key} a.TestHelpersTerminalReaders = &testhelpersterminalreader.Client{B: backends.API, Key: key} a.TestHelpersTestClocks = &testhelperstestclock.Client{B: backends.API, Key: key} diff --git a/confirmationtoken.go b/confirmationtoken.go new file mode 100644 index 0000000000..540d69260a --- /dev/null +++ b/confirmationtoken.go @@ -0,0 +1,781 @@ +// +// +// File generated from our OpenAPI spec +// +// + +package stripe + +// The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type. +type ConfirmationTokenPaymentMethodPreviewCardWalletType string + +// List of values that ConfirmationTokenPaymentMethodPreviewCardWalletType can take +const ( + ConfirmationTokenPaymentMethodPreviewCardWalletTypeAmexExpressCheckout ConfirmationTokenPaymentMethodPreviewCardWalletType = "amex_express_checkout" + ConfirmationTokenPaymentMethodPreviewCardWalletTypeApplePay ConfirmationTokenPaymentMethodPreviewCardWalletType = "apple_pay" + ConfirmationTokenPaymentMethodPreviewCardWalletTypeGooglePay ConfirmationTokenPaymentMethodPreviewCardWalletType = "google_pay" + ConfirmationTokenPaymentMethodPreviewCardWalletTypeLink ConfirmationTokenPaymentMethodPreviewCardWalletType = "link" + ConfirmationTokenPaymentMethodPreviewCardWalletTypeMasterpass ConfirmationTokenPaymentMethodPreviewCardWalletType = "masterpass" + ConfirmationTokenPaymentMethodPreviewCardWalletTypeSamsungPay ConfirmationTokenPaymentMethodPreviewCardWalletType = "samsung_pay" + ConfirmationTokenPaymentMethodPreviewCardWalletTypeVisaCheckout ConfirmationTokenPaymentMethodPreviewCardWalletType = "visa_checkout" +) + +// How card details were read in this transaction. +type ConfirmationTokenPaymentMethodPreviewCardPresentReadMethod string + +// List of values that ConfirmationTokenPaymentMethodPreviewCardPresentReadMethod can take +const ( + ConfirmationTokenPaymentMethodPreviewCardPresentReadMethodContactEmv ConfirmationTokenPaymentMethodPreviewCardPresentReadMethod = "contact_emv" + ConfirmationTokenPaymentMethodPreviewCardPresentReadMethodContactlessEmv ConfirmationTokenPaymentMethodPreviewCardPresentReadMethod = "contactless_emv" + ConfirmationTokenPaymentMethodPreviewCardPresentReadMethodContactlessMagstripeMode ConfirmationTokenPaymentMethodPreviewCardPresentReadMethod = "contactless_magstripe_mode" + ConfirmationTokenPaymentMethodPreviewCardPresentReadMethodMagneticStripeFallback ConfirmationTokenPaymentMethodPreviewCardPresentReadMethod = "magnetic_stripe_fallback" + ConfirmationTokenPaymentMethodPreviewCardPresentReadMethodMagneticStripeTrack2 ConfirmationTokenPaymentMethodPreviewCardPresentReadMethod = "magnetic_stripe_track2" +) + +// The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`. +type ConfirmationTokenPaymentMethodPreviewEPSBank string + +// List of values that ConfirmationTokenPaymentMethodPreviewEPSBank can take +const ( + ConfirmationTokenPaymentMethodPreviewEPSBankArzteUndApothekerBank ConfirmationTokenPaymentMethodPreviewEPSBank = "arzte_und_apotheker_bank" + ConfirmationTokenPaymentMethodPreviewEPSBankAustrianAnadiBankAg ConfirmationTokenPaymentMethodPreviewEPSBank = "austrian_anadi_bank_ag" + ConfirmationTokenPaymentMethodPreviewEPSBankBankAustria ConfirmationTokenPaymentMethodPreviewEPSBank = "bank_austria" + ConfirmationTokenPaymentMethodPreviewEPSBankBankhausCarlSpangler ConfirmationTokenPaymentMethodPreviewEPSBank = "bankhaus_carl_spangler" + ConfirmationTokenPaymentMethodPreviewEPSBankBankhausSchelhammerUndSchatteraAg ConfirmationTokenPaymentMethodPreviewEPSBank = "bankhaus_schelhammer_und_schattera_ag" + ConfirmationTokenPaymentMethodPreviewEPSBankBawagPskAg ConfirmationTokenPaymentMethodPreviewEPSBank = "bawag_psk_ag" + ConfirmationTokenPaymentMethodPreviewEPSBankBksBankAg ConfirmationTokenPaymentMethodPreviewEPSBank = "bks_bank_ag" + ConfirmationTokenPaymentMethodPreviewEPSBankBrullKallmusBankAg ConfirmationTokenPaymentMethodPreviewEPSBank = "brull_kallmus_bank_ag" + ConfirmationTokenPaymentMethodPreviewEPSBankBtvVierLanderBank ConfirmationTokenPaymentMethodPreviewEPSBank = "btv_vier_lander_bank" + ConfirmationTokenPaymentMethodPreviewEPSBankCapitalBankGraweGruppeAg ConfirmationTokenPaymentMethodPreviewEPSBank = "capital_bank_grawe_gruppe_ag" + ConfirmationTokenPaymentMethodPreviewEPSBankDeutscheBankAg ConfirmationTokenPaymentMethodPreviewEPSBank = "deutsche_bank_ag" + ConfirmationTokenPaymentMethodPreviewEPSBankDolomitenbank ConfirmationTokenPaymentMethodPreviewEPSBank = "dolomitenbank" + ConfirmationTokenPaymentMethodPreviewEPSBankEasybankAg ConfirmationTokenPaymentMethodPreviewEPSBank = "easybank_ag" + ConfirmationTokenPaymentMethodPreviewEPSBankErsteBankUndSparkassen ConfirmationTokenPaymentMethodPreviewEPSBank = "erste_bank_und_sparkassen" + ConfirmationTokenPaymentMethodPreviewEPSBankHypoAlpeadriabankInternationalAg ConfirmationTokenPaymentMethodPreviewEPSBank = "hypo_alpeadriabank_international_ag" + ConfirmationTokenPaymentMethodPreviewEPSBankHypoBankBurgenlandAktiengesellschaft ConfirmationTokenPaymentMethodPreviewEPSBank = "hypo_bank_burgenland_aktiengesellschaft" + ConfirmationTokenPaymentMethodPreviewEPSBankHypoNoeLbFurNiederosterreichUWien ConfirmationTokenPaymentMethodPreviewEPSBank = "hypo_noe_lb_fur_niederosterreich_u_wien" + ConfirmationTokenPaymentMethodPreviewEPSBankHypoOberosterreichSalzburgSteiermark ConfirmationTokenPaymentMethodPreviewEPSBank = "hypo_oberosterreich_salzburg_steiermark" + ConfirmationTokenPaymentMethodPreviewEPSBankHypoTirolBankAg ConfirmationTokenPaymentMethodPreviewEPSBank = "hypo_tirol_bank_ag" + ConfirmationTokenPaymentMethodPreviewEPSBankHypoVorarlbergBankAg ConfirmationTokenPaymentMethodPreviewEPSBank = "hypo_vorarlberg_bank_ag" + ConfirmationTokenPaymentMethodPreviewEPSBankMarchfelderBank ConfirmationTokenPaymentMethodPreviewEPSBank = "marchfelder_bank" + ConfirmationTokenPaymentMethodPreviewEPSBankOberbankAg ConfirmationTokenPaymentMethodPreviewEPSBank = "oberbank_ag" + ConfirmationTokenPaymentMethodPreviewEPSBankRaiffeisenBankengruppeOsterreich ConfirmationTokenPaymentMethodPreviewEPSBank = "raiffeisen_bankengruppe_osterreich" + ConfirmationTokenPaymentMethodPreviewEPSBankSchoellerbankAg ConfirmationTokenPaymentMethodPreviewEPSBank = "schoellerbank_ag" + ConfirmationTokenPaymentMethodPreviewEPSBankSpardaBankWien ConfirmationTokenPaymentMethodPreviewEPSBank = "sparda_bank_wien" + ConfirmationTokenPaymentMethodPreviewEPSBankVolksbankGruppe ConfirmationTokenPaymentMethodPreviewEPSBank = "volksbank_gruppe" + ConfirmationTokenPaymentMethodPreviewEPSBankVolkskreditbankAg ConfirmationTokenPaymentMethodPreviewEPSBank = "volkskreditbank_ag" + ConfirmationTokenPaymentMethodPreviewEPSBankVrBankBraunau ConfirmationTokenPaymentMethodPreviewEPSBank = "vr_bank_braunau" +) + +// Account holder type, if provided. Can be one of `individual` or `company`. +type ConfirmationTokenPaymentMethodPreviewFPXAccountHolderType string + +// List of values that ConfirmationTokenPaymentMethodPreviewFPXAccountHolderType can take +const ( + ConfirmationTokenPaymentMethodPreviewFPXAccountHolderTypeCompany ConfirmationTokenPaymentMethodPreviewFPXAccountHolderType = "company" + ConfirmationTokenPaymentMethodPreviewFPXAccountHolderTypeIndividual ConfirmationTokenPaymentMethodPreviewFPXAccountHolderType = "individual" +) + +// The customer's bank, if provided. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. +type ConfirmationTokenPaymentMethodPreviewFPXBank string + +// List of values that ConfirmationTokenPaymentMethodPreviewFPXBank can take +const ( + ConfirmationTokenPaymentMethodPreviewFPXBankAffinBank ConfirmationTokenPaymentMethodPreviewFPXBank = "affin_bank" + ConfirmationTokenPaymentMethodPreviewFPXBankAgrobank ConfirmationTokenPaymentMethodPreviewFPXBank = "agrobank" + ConfirmationTokenPaymentMethodPreviewFPXBankAllianceBank ConfirmationTokenPaymentMethodPreviewFPXBank = "alliance_bank" + ConfirmationTokenPaymentMethodPreviewFPXBankAmbank ConfirmationTokenPaymentMethodPreviewFPXBank = "ambank" + ConfirmationTokenPaymentMethodPreviewFPXBankBankIslam ConfirmationTokenPaymentMethodPreviewFPXBank = "bank_islam" + ConfirmationTokenPaymentMethodPreviewFPXBankBankMuamalat ConfirmationTokenPaymentMethodPreviewFPXBank = "bank_muamalat" + ConfirmationTokenPaymentMethodPreviewFPXBankBankOfChina ConfirmationTokenPaymentMethodPreviewFPXBank = "bank_of_china" + ConfirmationTokenPaymentMethodPreviewFPXBankBankRakyat ConfirmationTokenPaymentMethodPreviewFPXBank = "bank_rakyat" + ConfirmationTokenPaymentMethodPreviewFPXBankBsn ConfirmationTokenPaymentMethodPreviewFPXBank = "bsn" + ConfirmationTokenPaymentMethodPreviewFPXBankCimb ConfirmationTokenPaymentMethodPreviewFPXBank = "cimb" + ConfirmationTokenPaymentMethodPreviewFPXBankDeutscheBank ConfirmationTokenPaymentMethodPreviewFPXBank = "deutsche_bank" + ConfirmationTokenPaymentMethodPreviewFPXBankHongLeongBank ConfirmationTokenPaymentMethodPreviewFPXBank = "hong_leong_bank" + ConfirmationTokenPaymentMethodPreviewFPXBankHsbc ConfirmationTokenPaymentMethodPreviewFPXBank = "hsbc" + ConfirmationTokenPaymentMethodPreviewFPXBankKfh ConfirmationTokenPaymentMethodPreviewFPXBank = "kfh" + ConfirmationTokenPaymentMethodPreviewFPXBankMaybank2e ConfirmationTokenPaymentMethodPreviewFPXBank = "maybank2e" + ConfirmationTokenPaymentMethodPreviewFPXBankMaybank2u ConfirmationTokenPaymentMethodPreviewFPXBank = "maybank2u" + ConfirmationTokenPaymentMethodPreviewFPXBankOcbc ConfirmationTokenPaymentMethodPreviewFPXBank = "ocbc" + ConfirmationTokenPaymentMethodPreviewFPXBankPbEnterprise ConfirmationTokenPaymentMethodPreviewFPXBank = "pb_enterprise" + ConfirmationTokenPaymentMethodPreviewFPXBankPublicBank ConfirmationTokenPaymentMethodPreviewFPXBank = "public_bank" + ConfirmationTokenPaymentMethodPreviewFPXBankRhb ConfirmationTokenPaymentMethodPreviewFPXBank = "rhb" + ConfirmationTokenPaymentMethodPreviewFPXBankStandardChartered ConfirmationTokenPaymentMethodPreviewFPXBank = "standard_chartered" + ConfirmationTokenPaymentMethodPreviewFPXBankUob ConfirmationTokenPaymentMethodPreviewFPXBank = "uob" +) + +// The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. +type ConfirmationTokenPaymentMethodPreviewIDEALBank string + +// List of values that ConfirmationTokenPaymentMethodPreviewIDEALBank can take +const ( + ConfirmationTokenPaymentMethodPreviewIDEALBankAbnAmro ConfirmationTokenPaymentMethodPreviewIDEALBank = "abn_amro" + ConfirmationTokenPaymentMethodPreviewIDEALBankAsnBank ConfirmationTokenPaymentMethodPreviewIDEALBank = "asn_bank" + ConfirmationTokenPaymentMethodPreviewIDEALBankBunq ConfirmationTokenPaymentMethodPreviewIDEALBank = "bunq" + ConfirmationTokenPaymentMethodPreviewIDEALBankHandelsbanken ConfirmationTokenPaymentMethodPreviewIDEALBank = "handelsbanken" + ConfirmationTokenPaymentMethodPreviewIDEALBankIng ConfirmationTokenPaymentMethodPreviewIDEALBank = "ing" + ConfirmationTokenPaymentMethodPreviewIDEALBankKnab ConfirmationTokenPaymentMethodPreviewIDEALBank = "knab" + ConfirmationTokenPaymentMethodPreviewIDEALBankMoneyou ConfirmationTokenPaymentMethodPreviewIDEALBank = "moneyou" + ConfirmationTokenPaymentMethodPreviewIDEALBankN26 ConfirmationTokenPaymentMethodPreviewIDEALBank = "n26" + ConfirmationTokenPaymentMethodPreviewIDEALBankRabobank ConfirmationTokenPaymentMethodPreviewIDEALBank = "rabobank" + ConfirmationTokenPaymentMethodPreviewIDEALBankRegiobank ConfirmationTokenPaymentMethodPreviewIDEALBank = "regiobank" + ConfirmationTokenPaymentMethodPreviewIDEALBankRevolut ConfirmationTokenPaymentMethodPreviewIDEALBank = "revolut" + ConfirmationTokenPaymentMethodPreviewIDEALBankSnsBank ConfirmationTokenPaymentMethodPreviewIDEALBank = "sns_bank" + ConfirmationTokenPaymentMethodPreviewIDEALBankTriodosBank ConfirmationTokenPaymentMethodPreviewIDEALBank = "triodos_bank" + ConfirmationTokenPaymentMethodPreviewIDEALBankVanLanschot ConfirmationTokenPaymentMethodPreviewIDEALBank = "van_lanschot" + ConfirmationTokenPaymentMethodPreviewIDEALBankYoursafe ConfirmationTokenPaymentMethodPreviewIDEALBank = "yoursafe" +) + +// The Bank Identifier Code of the customer's bank, if the bank was provided. +type ConfirmationTokenPaymentMethodPreviewIDEALBIC string + +// List of values that ConfirmationTokenPaymentMethodPreviewIDEALBIC can take +const ( + ConfirmationTokenPaymentMethodPreviewIDEALBICABNANL2A ConfirmationTokenPaymentMethodPreviewIDEALBIC = "ABNANL2A" + ConfirmationTokenPaymentMethodPreviewIDEALBICASNBNL21 ConfirmationTokenPaymentMethodPreviewIDEALBIC = "ASNBNL21" + ConfirmationTokenPaymentMethodPreviewIDEALBICBITSNL2A ConfirmationTokenPaymentMethodPreviewIDEALBIC = "BITSNL2A" + ConfirmationTokenPaymentMethodPreviewIDEALBICBUNQNL2A ConfirmationTokenPaymentMethodPreviewIDEALBIC = "BUNQNL2A" + ConfirmationTokenPaymentMethodPreviewIDEALBICFVLBNL22 ConfirmationTokenPaymentMethodPreviewIDEALBIC = "FVLBNL22" + ConfirmationTokenPaymentMethodPreviewIDEALBICHANDNL2A ConfirmationTokenPaymentMethodPreviewIDEALBIC = "HANDNL2A" + ConfirmationTokenPaymentMethodPreviewIDEALBICINGBNL2A ConfirmationTokenPaymentMethodPreviewIDEALBIC = "INGBNL2A" + ConfirmationTokenPaymentMethodPreviewIDEALBICKNABNL2H ConfirmationTokenPaymentMethodPreviewIDEALBIC = "KNABNL2H" + ConfirmationTokenPaymentMethodPreviewIDEALBICMOYONL21 ConfirmationTokenPaymentMethodPreviewIDEALBIC = "MOYONL21" + ConfirmationTokenPaymentMethodPreviewIDEALBICNTSBDEB1 ConfirmationTokenPaymentMethodPreviewIDEALBIC = "NTSBDEB1" + ConfirmationTokenPaymentMethodPreviewIDEALBICRABONL2U ConfirmationTokenPaymentMethodPreviewIDEALBIC = "RABONL2U" + ConfirmationTokenPaymentMethodPreviewIDEALBICRBRBNL21 ConfirmationTokenPaymentMethodPreviewIDEALBIC = "RBRBNL21" + ConfirmationTokenPaymentMethodPreviewIDEALBICREVOIE23 ConfirmationTokenPaymentMethodPreviewIDEALBIC = "REVOIE23" + ConfirmationTokenPaymentMethodPreviewIDEALBICREVOLT21 ConfirmationTokenPaymentMethodPreviewIDEALBIC = "REVOLT21" + ConfirmationTokenPaymentMethodPreviewIDEALBICSNSBNL2A ConfirmationTokenPaymentMethodPreviewIDEALBIC = "SNSBNL2A" + ConfirmationTokenPaymentMethodPreviewIDEALBICTRIONL2U ConfirmationTokenPaymentMethodPreviewIDEALBIC = "TRIONL2U" +) + +// How card details were read in this transaction. +type ConfirmationTokenPaymentMethodPreviewInteracPresentReadMethod string + +// List of values that ConfirmationTokenPaymentMethodPreviewInteracPresentReadMethod can take +const ( + ConfirmationTokenPaymentMethodPreviewInteracPresentReadMethodContactEmv ConfirmationTokenPaymentMethodPreviewInteracPresentReadMethod = "contact_emv" + ConfirmationTokenPaymentMethodPreviewInteracPresentReadMethodContactlessEmv ConfirmationTokenPaymentMethodPreviewInteracPresentReadMethod = "contactless_emv" + ConfirmationTokenPaymentMethodPreviewInteracPresentReadMethodContactlessMagstripeMode ConfirmationTokenPaymentMethodPreviewInteracPresentReadMethod = "contactless_magstripe_mode" + ConfirmationTokenPaymentMethodPreviewInteracPresentReadMethodMagneticStripeFallback ConfirmationTokenPaymentMethodPreviewInteracPresentReadMethod = "magnetic_stripe_fallback" + ConfirmationTokenPaymentMethodPreviewInteracPresentReadMethodMagneticStripeTrack2 ConfirmationTokenPaymentMethodPreviewInteracPresentReadMethod = "magnetic_stripe_track2" +) + +// The customer's bank, if provided. +type ConfirmationTokenPaymentMethodPreviewP24Bank string + +// List of values that ConfirmationTokenPaymentMethodPreviewP24Bank can take +const ( + ConfirmationTokenPaymentMethodPreviewP24BankAliorBank ConfirmationTokenPaymentMethodPreviewP24Bank = "alior_bank" + ConfirmationTokenPaymentMethodPreviewP24BankBankMillennium ConfirmationTokenPaymentMethodPreviewP24Bank = "bank_millennium" + ConfirmationTokenPaymentMethodPreviewP24BankBankNowyBfgSa ConfirmationTokenPaymentMethodPreviewP24Bank = "bank_nowy_bfg_sa" + ConfirmationTokenPaymentMethodPreviewP24BankBankPekaoSa ConfirmationTokenPaymentMethodPreviewP24Bank = "bank_pekao_sa" + ConfirmationTokenPaymentMethodPreviewP24BankBankiSpbdzielcze ConfirmationTokenPaymentMethodPreviewP24Bank = "banki_spbdzielcze" + ConfirmationTokenPaymentMethodPreviewP24BankBLIK ConfirmationTokenPaymentMethodPreviewP24Bank = "blik" + ConfirmationTokenPaymentMethodPreviewP24BankBnpParibas ConfirmationTokenPaymentMethodPreviewP24Bank = "bnp_paribas" + ConfirmationTokenPaymentMethodPreviewP24BankBoz ConfirmationTokenPaymentMethodPreviewP24Bank = "boz" + ConfirmationTokenPaymentMethodPreviewP24BankCitiHandlowy ConfirmationTokenPaymentMethodPreviewP24Bank = "citi_handlowy" + ConfirmationTokenPaymentMethodPreviewP24BankCreditAgricole ConfirmationTokenPaymentMethodPreviewP24Bank = "credit_agricole" + ConfirmationTokenPaymentMethodPreviewP24BankEnvelobank ConfirmationTokenPaymentMethodPreviewP24Bank = "envelobank" + ConfirmationTokenPaymentMethodPreviewP24BankEtransferPocztowy24 ConfirmationTokenPaymentMethodPreviewP24Bank = "etransfer_pocztowy24" + ConfirmationTokenPaymentMethodPreviewP24BankGetinBank ConfirmationTokenPaymentMethodPreviewP24Bank = "getin_bank" + ConfirmationTokenPaymentMethodPreviewP24BankIdeabank ConfirmationTokenPaymentMethodPreviewP24Bank = "ideabank" + ConfirmationTokenPaymentMethodPreviewP24BankIng ConfirmationTokenPaymentMethodPreviewP24Bank = "ing" + ConfirmationTokenPaymentMethodPreviewP24BankInteligo ConfirmationTokenPaymentMethodPreviewP24Bank = "inteligo" + ConfirmationTokenPaymentMethodPreviewP24BankMbankMtransfer ConfirmationTokenPaymentMethodPreviewP24Bank = "mbank_mtransfer" + ConfirmationTokenPaymentMethodPreviewP24BankNestPrzelew ConfirmationTokenPaymentMethodPreviewP24Bank = "nest_przelew" + ConfirmationTokenPaymentMethodPreviewP24BankNoblePay ConfirmationTokenPaymentMethodPreviewP24Bank = "noble_pay" + ConfirmationTokenPaymentMethodPreviewP24BankPbacZIpko ConfirmationTokenPaymentMethodPreviewP24Bank = "pbac_z_ipko" + ConfirmationTokenPaymentMethodPreviewP24BankPlusBank ConfirmationTokenPaymentMethodPreviewP24Bank = "plus_bank" + ConfirmationTokenPaymentMethodPreviewP24BankSantanderPrzelew24 ConfirmationTokenPaymentMethodPreviewP24Bank = "santander_przelew24" + ConfirmationTokenPaymentMethodPreviewP24BankTmobileUsbugiBankowe ConfirmationTokenPaymentMethodPreviewP24Bank = "tmobile_usbugi_bankowe" + ConfirmationTokenPaymentMethodPreviewP24BankToyotaBank ConfirmationTokenPaymentMethodPreviewP24Bank = "toyota_bank" + ConfirmationTokenPaymentMethodPreviewP24BankVolkswagenBank ConfirmationTokenPaymentMethodPreviewP24Bank = "volkswagen_bank" +) + +// The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. +type ConfirmationTokenPaymentMethodPreviewType string + +// List of values that ConfirmationTokenPaymentMethodPreviewType can take +const ( + ConfirmationTokenPaymentMethodPreviewTypeACSSDebit ConfirmationTokenPaymentMethodPreviewType = "acss_debit" + ConfirmationTokenPaymentMethodPreviewTypeAffirm ConfirmationTokenPaymentMethodPreviewType = "affirm" + ConfirmationTokenPaymentMethodPreviewTypeAfterpayClearpay ConfirmationTokenPaymentMethodPreviewType = "afterpay_clearpay" + ConfirmationTokenPaymentMethodPreviewTypeAlipay ConfirmationTokenPaymentMethodPreviewType = "alipay" + ConfirmationTokenPaymentMethodPreviewTypeAUBECSDebit ConfirmationTokenPaymentMethodPreviewType = "au_becs_debit" + ConfirmationTokenPaymentMethodPreviewTypeBACSDebit ConfirmationTokenPaymentMethodPreviewType = "bacs_debit" + ConfirmationTokenPaymentMethodPreviewTypeBancontact ConfirmationTokenPaymentMethodPreviewType = "bancontact" + ConfirmationTokenPaymentMethodPreviewTypeBLIK ConfirmationTokenPaymentMethodPreviewType = "blik" + ConfirmationTokenPaymentMethodPreviewTypeBoleto ConfirmationTokenPaymentMethodPreviewType = "boleto" + ConfirmationTokenPaymentMethodPreviewTypeCard ConfirmationTokenPaymentMethodPreviewType = "card" + ConfirmationTokenPaymentMethodPreviewTypeCardPresent ConfirmationTokenPaymentMethodPreviewType = "card_present" + ConfirmationTokenPaymentMethodPreviewTypeCashApp ConfirmationTokenPaymentMethodPreviewType = "cashapp" + ConfirmationTokenPaymentMethodPreviewTypeCustomerBalance ConfirmationTokenPaymentMethodPreviewType = "customer_balance" + ConfirmationTokenPaymentMethodPreviewTypeEPS ConfirmationTokenPaymentMethodPreviewType = "eps" + ConfirmationTokenPaymentMethodPreviewTypeFPX ConfirmationTokenPaymentMethodPreviewType = "fpx" + ConfirmationTokenPaymentMethodPreviewTypeGiropay ConfirmationTokenPaymentMethodPreviewType = "giropay" + ConfirmationTokenPaymentMethodPreviewTypeGrabpay ConfirmationTokenPaymentMethodPreviewType = "grabpay" + ConfirmationTokenPaymentMethodPreviewTypeIDEAL ConfirmationTokenPaymentMethodPreviewType = "ideal" + ConfirmationTokenPaymentMethodPreviewTypeInteracPresent ConfirmationTokenPaymentMethodPreviewType = "interac_present" + ConfirmationTokenPaymentMethodPreviewTypeKlarna ConfirmationTokenPaymentMethodPreviewType = "klarna" + ConfirmationTokenPaymentMethodPreviewTypeKonbini ConfirmationTokenPaymentMethodPreviewType = "konbini" + ConfirmationTokenPaymentMethodPreviewTypeLink ConfirmationTokenPaymentMethodPreviewType = "link" + ConfirmationTokenPaymentMethodPreviewTypeOXXO ConfirmationTokenPaymentMethodPreviewType = "oxxo" + ConfirmationTokenPaymentMethodPreviewTypeP24 ConfirmationTokenPaymentMethodPreviewType = "p24" + ConfirmationTokenPaymentMethodPreviewTypePayNow ConfirmationTokenPaymentMethodPreviewType = "paynow" + ConfirmationTokenPaymentMethodPreviewTypePaypal ConfirmationTokenPaymentMethodPreviewType = "paypal" + ConfirmationTokenPaymentMethodPreviewTypePix ConfirmationTokenPaymentMethodPreviewType = "pix" + ConfirmationTokenPaymentMethodPreviewTypePromptPay ConfirmationTokenPaymentMethodPreviewType = "promptpay" + ConfirmationTokenPaymentMethodPreviewTypeSEPADebit ConfirmationTokenPaymentMethodPreviewType = "sepa_debit" + ConfirmationTokenPaymentMethodPreviewTypeSofort ConfirmationTokenPaymentMethodPreviewType = "sofort" + ConfirmationTokenPaymentMethodPreviewTypeUSBankAccount ConfirmationTokenPaymentMethodPreviewType = "us_bank_account" + ConfirmationTokenPaymentMethodPreviewTypeWeChatPay ConfirmationTokenPaymentMethodPreviewType = "wechat_pay" + ConfirmationTokenPaymentMethodPreviewTypeZip ConfirmationTokenPaymentMethodPreviewType = "zip" +) + +// Account holder type: individual or company. +type ConfirmationTokenPaymentMethodPreviewUSBankAccountAccountHolderType string + +// List of values that ConfirmationTokenPaymentMethodPreviewUSBankAccountAccountHolderType can take +const ( + ConfirmationTokenPaymentMethodPreviewUSBankAccountAccountHolderTypeCompany ConfirmationTokenPaymentMethodPreviewUSBankAccountAccountHolderType = "company" + ConfirmationTokenPaymentMethodPreviewUSBankAccountAccountHolderTypeIndividual ConfirmationTokenPaymentMethodPreviewUSBankAccountAccountHolderType = "individual" +) + +// Account type: checkings or savings. Defaults to checking if omitted. +type ConfirmationTokenPaymentMethodPreviewUSBankAccountAccountType string + +// List of values that ConfirmationTokenPaymentMethodPreviewUSBankAccountAccountType can take +const ( + ConfirmationTokenPaymentMethodPreviewUSBankAccountAccountTypeChecking ConfirmationTokenPaymentMethodPreviewUSBankAccountAccountType = "checking" + ConfirmationTokenPaymentMethodPreviewUSBankAccountAccountTypeSavings ConfirmationTokenPaymentMethodPreviewUSBankAccountAccountType = "savings" +) + +// All supported networks. +type ConfirmationTokenPaymentMethodPreviewUSBankAccountNetworksSupported string + +// List of values that ConfirmationTokenPaymentMethodPreviewUSBankAccountNetworksSupported can take +const ( + ConfirmationTokenPaymentMethodPreviewUSBankAccountNetworksSupportedACH ConfirmationTokenPaymentMethodPreviewUSBankAccountNetworksSupported = "ach" + ConfirmationTokenPaymentMethodPreviewUSBankAccountNetworksSupportedUSDomesticWire ConfirmationTokenPaymentMethodPreviewUSBankAccountNetworksSupported = "us_domestic_wire" +) + +// The ACH network code that resulted in this block. +type ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedNetworkCode string + +// List of values that ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedNetworkCode can take +const ( + ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedNetworkCodeR02 ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedNetworkCode = "R02" + ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedNetworkCodeR03 ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedNetworkCode = "R03" + ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedNetworkCodeR04 ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedNetworkCode = "R04" + ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedNetworkCodeR05 ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedNetworkCode = "R05" + ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedNetworkCodeR07 ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedNetworkCode = "R07" + ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedNetworkCodeR08 ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedNetworkCode = "R08" + ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedNetworkCodeR10 ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedNetworkCode = "R10" + ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedNetworkCodeR11 ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedNetworkCode = "R11" + ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedNetworkCodeR16 ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedNetworkCode = "R16" + ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedNetworkCodeR20 ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedNetworkCode = "R20" + ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedNetworkCodeR29 ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedNetworkCode = "R29" + ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedNetworkCodeR31 ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedNetworkCode = "R31" +) + +// The reason why this PaymentMethod's fingerprint has been blocked +type ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedReason string + +// List of values that ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedReason can take +const ( + ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedReasonBankAccountClosed ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedReason = "bank_account_closed" + ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedReasonBankAccountFrozen ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedReason = "bank_account_frozen" + ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedReasonBankAccountInvalidDetails ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedReason = "bank_account_invalid_details" + ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedReasonBankAccountRestricted ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedReason = "bank_account_restricted" + ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedReasonBankAccountUnusable ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedReason = "bank_account_unusable" + ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedReasonDebitNotAuthorized ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedReason = "debit_not_authorized" +) + +// Indicates that you intend to make future payments with this ConfirmationToken's payment method. +// +// The presence of this property will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +type ConfirmationTokenSetupFutureUsage string + +// List of values that ConfirmationTokenSetupFutureUsage can take +const ( + ConfirmationTokenSetupFutureUsageOffSession ConfirmationTokenSetupFutureUsage = "off_session" + ConfirmationTokenSetupFutureUsageOnSession ConfirmationTokenSetupFutureUsage = "on_session" +) + +// Retrieves an existing ConfirmationToken object +type ConfirmationTokenParams 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 *ConfirmationTokenParams) AddExpand(f string) { + p.Expand = append(p.Expand, &f) +} + +// If this is a Mandate accepted online, this hash contains details about the online acceptance. +type ConfirmationTokenMandateDataCustomerAcceptanceOnline struct { + // The IP address from which the Mandate was accepted by the customer. + IPAddress string `json:"ip_address"` + // The user agent of the browser from which the Mandate was accepted by the customer. + UserAgent string `json:"user_agent"` +} + +// This hash contains details about the customer acceptance of the Mandate. +type ConfirmationTokenMandateDataCustomerAcceptance struct { + // If this is a Mandate accepted online, this hash contains details about the online acceptance. + Online *ConfirmationTokenMandateDataCustomerAcceptanceOnline `json:"online"` + // The type of customer acceptance information included with the Mandate. + Type string `json:"type"` +} + +// Data used for generating a Mandate. +type ConfirmationTokenMandateData struct { + // This hash contains details about the customer acceptance of the Mandate. + CustomerAcceptance *ConfirmationTokenMandateDataCustomerAcceptance `json:"customer_acceptance"` +} +type ConfirmationTokenPaymentMethodPreviewACSSDebit struct { + // Name of the bank associated with the bank account. + BankName string `json:"bank_name"` + // Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + Fingerprint string `json:"fingerprint"` + // Institution number of the bank account. + InstitutionNumber string `json:"institution_number"` + // Last four digits of the bank account number. + Last4 string `json:"last4"` + // Transit number of the bank account. + TransitNumber string `json:"transit_number"` +} +type ConfirmationTokenPaymentMethodPreviewAffirm struct{} +type ConfirmationTokenPaymentMethodPreviewAfterpayClearpay struct{} +type ConfirmationTokenPaymentMethodPreviewAlipay struct{} +type ConfirmationTokenPaymentMethodPreviewAUBECSDebit struct { + // Six-digit number identifying bank and branch associated with this bank account. + BSBNumber string `json:"bsb_number"` + // Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + Fingerprint string `json:"fingerprint"` + // Last four digits of the bank account number. + Last4 string `json:"last4"` +} +type ConfirmationTokenPaymentMethodPreviewBACSDebit struct { + // Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + Fingerprint string `json:"fingerprint"` + // Last four digits of the bank account number. + Last4 string `json:"last4"` + // Sort code of the bank account. (e.g., `10-20-30`) + SortCode string `json:"sort_code"` +} +type ConfirmationTokenPaymentMethodPreviewBancontact struct{} +type ConfirmationTokenPaymentMethodPreviewBillingDetails struct { + // Billing address. + Address *Address `json:"address"` + // Email address. + Email string `json:"email"` + // Full name. + Name string `json:"name"` + // Billing phone number (including extension). + Phone string `json:"phone"` +} +type ConfirmationTokenPaymentMethodPreviewBLIK struct{} +type ConfirmationTokenPaymentMethodPreviewBoleto struct { + // Uniquely identifies the customer tax id (CNPJ or CPF) + TaxID string `json:"tax_id"` +} + +// Checks on Card address and CVC if provided. +type ConfirmationTokenPaymentMethodPreviewCardChecks struct { + // If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + AddressLine1Check string `json:"address_line1_check"` + // If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + AddressPostalCodeCheck string `json:"address_postal_code_check"` + // If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + CVCCheck string `json:"cvc_check"` +} + +// Contains information about card networks that can be used to process the payment. +type ConfirmationTokenPaymentMethodPreviewCardNetworks struct { + // All available networks for the card. + Available []string `json:"available"` + // The preferred network for the card. + Preferred string `json:"preferred"` +} + +// Contains details on how this Card may be used for 3D Secure authentication. +type ConfirmationTokenPaymentMethodPreviewCardThreeDSecureUsage struct { + // Whether 3D Secure is supported on this card. + Supported bool `json:"supported"` +} +type ConfirmationTokenPaymentMethodPreviewCardWalletAmexExpressCheckout struct{} +type ConfirmationTokenPaymentMethodPreviewCardWalletApplePay struct{} +type ConfirmationTokenPaymentMethodPreviewCardWalletGooglePay struct{} +type ConfirmationTokenPaymentMethodPreviewCardWalletLink struct{} +type ConfirmationTokenPaymentMethodPreviewCardWalletMasterpass struct { + // Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + BillingAddress *Address `json:"billing_address"` + // Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + Email string `json:"email"` + // Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + Name string `json:"name"` + // Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + ShippingAddress *Address `json:"shipping_address"` +} +type ConfirmationTokenPaymentMethodPreviewCardWalletSamsungPay struct{} +type ConfirmationTokenPaymentMethodPreviewCardWalletVisaCheckout struct { + // Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + BillingAddress *Address `json:"billing_address"` + // Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + Email string `json:"email"` + // Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + Name string `json:"name"` + // Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + ShippingAddress *Address `json:"shipping_address"` +} + +// If this Card is part of a card wallet, this contains the details of the card wallet. +type ConfirmationTokenPaymentMethodPreviewCardWallet struct { + AmexExpressCheckout *ConfirmationTokenPaymentMethodPreviewCardWalletAmexExpressCheckout `json:"amex_express_checkout"` + ApplePay *ConfirmationTokenPaymentMethodPreviewCardWalletApplePay `json:"apple_pay"` + // (For tokenized numbers only.) The last four digits of the device account number. + DynamicLast4 string `json:"dynamic_last4"` + GooglePay *ConfirmationTokenPaymentMethodPreviewCardWalletGooglePay `json:"google_pay"` + Link *ConfirmationTokenPaymentMethodPreviewCardWalletLink `json:"link"` + Masterpass *ConfirmationTokenPaymentMethodPreviewCardWalletMasterpass `json:"masterpass"` + SamsungPay *ConfirmationTokenPaymentMethodPreviewCardWalletSamsungPay `json:"samsung_pay"` + // The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type. + Type ConfirmationTokenPaymentMethodPreviewCardWalletType `json:"type"` + VisaCheckout *ConfirmationTokenPaymentMethodPreviewCardWalletVisaCheckout `json:"visa_checkout"` +} +type ConfirmationTokenPaymentMethodPreviewCard struct { + // Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + Brand string `json:"brand"` + // Checks on Card address and CVC if provided. + Checks *ConfirmationTokenPaymentMethodPreviewCardChecks `json:"checks"` + // Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + Country string `json:"country"` + // A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + Description string `json:"description"` + // Two-digit number representing the card's expiration month. + ExpMonth int64 `json:"exp_month"` + // Four-digit number representing the card's expiration year. + ExpYear int64 `json:"exp_year"` + // Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + // + // *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + Fingerprint string `json:"fingerprint"` + // Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + Funding string `json:"funding"` + // Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + IIN string `json:"iin"` + // 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 last four digits of the card. + Last4 string `json:"last4"` + // Contains information about card networks that can be used to process the payment. + Networks *ConfirmationTokenPaymentMethodPreviewCardNetworks `json:"networks"` + // Contains details on how this Card may be used for 3D Secure authentication. + ThreeDSecureUsage *ConfirmationTokenPaymentMethodPreviewCardThreeDSecureUsage `json:"three_d_secure_usage"` + // If this Card is part of a card wallet, this contains the details of the card wallet. + Wallet *ConfirmationTokenPaymentMethodPreviewCardWallet `json:"wallet"` +} + +// Contains information about card networks that can be used to process the payment. +type ConfirmationTokenPaymentMethodPreviewCardPresentNetworks struct { + // All available networks for the card. + Available []string `json:"available"` + // The preferred network for the card. + Preferred string `json:"preferred"` +} +type ConfirmationTokenPaymentMethodPreviewCardPresent struct { + // Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + Brand string `json:"brand"` + // The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + CardholderName string `json:"cardholder_name"` + // Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + Country string `json:"country"` + // A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + Description string `json:"description"` + // Two-digit number representing the card's expiration month. + ExpMonth int64 `json:"exp_month"` + // Four-digit number representing the card's expiration year. + ExpYear int64 `json:"exp_year"` + // Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + // + // *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + Fingerprint string `json:"fingerprint"` + // Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + Funding string `json:"funding"` + // Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + IIN string `json:"iin"` + // 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 last four digits of the card. + Last4 string `json:"last4"` + // Contains information about card networks that can be used to process the payment. + Networks *ConfirmationTokenPaymentMethodPreviewCardPresentNetworks `json:"networks"` + // How card details were read in this transaction. + ReadMethod ConfirmationTokenPaymentMethodPreviewCardPresentReadMethod `json:"read_method"` +} +type ConfirmationTokenPaymentMethodPreviewCashApp struct { + // A unique and immutable identifier assigned by Cash App to every buyer. + BuyerID string `json:"buyer_id"` + // A public identifier for buyers using Cash App. + Cashtag string `json:"cashtag"` +} +type ConfirmationTokenPaymentMethodPreviewCustomerBalance struct{} +type ConfirmationTokenPaymentMethodPreviewEPS struct { + // The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`. + Bank ConfirmationTokenPaymentMethodPreviewEPSBank `json:"bank"` +} +type ConfirmationTokenPaymentMethodPreviewFPX struct { + // Account holder type, if provided. Can be one of `individual` or `company`. + AccountHolderType ConfirmationTokenPaymentMethodPreviewFPXAccountHolderType `json:"account_holder_type"` + // The customer's bank, if provided. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. + Bank ConfirmationTokenPaymentMethodPreviewFPXBank `json:"bank"` +} +type ConfirmationTokenPaymentMethodPreviewGiropay struct{} +type ConfirmationTokenPaymentMethodPreviewGrabpay struct{} +type ConfirmationTokenPaymentMethodPreviewIDEAL struct { + // The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + Bank ConfirmationTokenPaymentMethodPreviewIDEALBank `json:"bank"` + // The Bank Identifier Code of the customer's bank, if the bank was provided. + BIC ConfirmationTokenPaymentMethodPreviewIDEALBIC `json:"bic"` +} + +// Contains information about card networks that can be used to process the payment. +type ConfirmationTokenPaymentMethodPreviewInteracPresentNetworks struct { + // All available networks for the card. + Available []string `json:"available"` + // The preferred network for the card. + Preferred string `json:"preferred"` +} +type ConfirmationTokenPaymentMethodPreviewInteracPresent struct { + // Card brand. Can be `interac`, `mastercard` or `visa`. + Brand string `json:"brand"` + // The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + CardholderName string `json:"cardholder_name"` + // Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + Country string `json:"country"` + // A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + Description string `json:"description"` + // Two-digit number representing the card's expiration month. + ExpMonth int64 `json:"exp_month"` + // Four-digit number representing the card's expiration year. + ExpYear int64 `json:"exp_year"` + // Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + // + // *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + Fingerprint string `json:"fingerprint"` + // Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + Funding string `json:"funding"` + // Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + IIN string `json:"iin"` + // 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 last four digits of the card. + Last4 string `json:"last4"` + // Contains information about card networks that can be used to process the payment. + Networks *ConfirmationTokenPaymentMethodPreviewInteracPresentNetworks `json:"networks"` + // EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + PreferredLocales []string `json:"preferred_locales"` + // How card details were read in this transaction. + ReadMethod ConfirmationTokenPaymentMethodPreviewInteracPresentReadMethod `json:"read_method"` +} + +// The customer's date of birth, if provided. +type ConfirmationTokenPaymentMethodPreviewKlarnaDOB struct { + // The day of birth, between 1 and 31. + Day int64 `json:"day"` + // The month of birth, between 1 and 12. + Month int64 `json:"month"` + // The four-digit year of birth. + Year int64 `json:"year"` +} +type ConfirmationTokenPaymentMethodPreviewKlarna struct { + // The customer's date of birth, if provided. + DOB *ConfirmationTokenPaymentMethodPreviewKlarnaDOB `json:"dob"` +} +type ConfirmationTokenPaymentMethodPreviewKonbini struct{} +type ConfirmationTokenPaymentMethodPreviewLink struct { + // Account owner's email address. + Email string `json:"email"` + // [Deprecated] This is a legacy parameter that no longer has any function. + PersistentToken string `json:"persistent_token"` +} +type ConfirmationTokenPaymentMethodPreviewOXXO struct{} +type ConfirmationTokenPaymentMethodPreviewP24 struct { + // The customer's bank, if provided. + Bank ConfirmationTokenPaymentMethodPreviewP24Bank `json:"bank"` +} +type ConfirmationTokenPaymentMethodPreviewPayNow struct{} +type ConfirmationTokenPaymentMethodPreviewPaypal struct { + // Uniquely identifies this particular PayPal account. You can use this attribute to check whether two PayPal accounts are the same. + Fingerprint string `json:"fingerprint"` + // Owner's email. Values are provided by PayPal directly + // (if supported) at the time of authorization or settlement. They cannot be set or mutated. + PayerEmail string `json:"payer_email"` + // PayPal account PayerID. This identifier uniquely identifies the PayPal customer. + PayerID string `json:"payer_id"` + // Owner's verified email. Values are verified or provided by PayPal directly + // (if supported) at the time of authorization or settlement. They cannot be set or mutated. + VerifiedEmail string `json:"verified_email"` +} +type ConfirmationTokenPaymentMethodPreviewPix struct{} +type ConfirmationTokenPaymentMethodPreviewPromptPay struct{} + +// Information about the object that generated this PaymentMethod. +type ConfirmationTokenPaymentMethodPreviewSEPADebitGeneratedFrom struct { + // The ID of the Charge that generated this PaymentMethod, if any. + Charge *Charge `json:"charge"` + // The ID of the SetupAttempt that generated this PaymentMethod, if any. + SetupAttempt *SetupAttempt `json:"setup_attempt"` +} +type ConfirmationTokenPaymentMethodPreviewSEPADebit struct { + // Bank code of bank associated with the bank account. + BankCode string `json:"bank_code"` + // Branch code of bank associated with the bank account. + BranchCode string `json:"branch_code"` + // Two-letter ISO code representing the country the bank account is located in. + Country string `json:"country"` + // Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + Fingerprint string `json:"fingerprint"` + // Information about the object that generated this PaymentMethod. + GeneratedFrom *ConfirmationTokenPaymentMethodPreviewSEPADebitGeneratedFrom `json:"generated_from"` + // Last four characters of the IBAN. + Last4 string `json:"last4"` +} +type ConfirmationTokenPaymentMethodPreviewSofort struct { + // Two-letter ISO code representing the country the bank account is located in. + Country string `json:"country"` +} + +// Contains information about US bank account networks that can be used. +type ConfirmationTokenPaymentMethodPreviewUSBankAccountNetworks struct { + // The preferred network. + Preferred string `json:"preferred"` + // All supported networks. + Supported []ConfirmationTokenPaymentMethodPreviewUSBankAccountNetworksSupported `json:"supported"` +} +type ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlocked struct { + // The ACH network code that resulted in this block. + NetworkCode ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedNetworkCode `json:"network_code"` + // The reason why this PaymentMethod's fingerprint has been blocked + Reason ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlockedReason `json:"reason"` +} + +// Contains information about the future reusability of this PaymentMethod. +type ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetails struct { + Blocked *ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetailsBlocked `json:"blocked"` +} +type ConfirmationTokenPaymentMethodPreviewUSBankAccount struct { + // Account holder type: individual or company. + AccountHolderType ConfirmationTokenPaymentMethodPreviewUSBankAccountAccountHolderType `json:"account_holder_type"` + // Account number of the bank account. + AccountNumber string `json:"account_number"` + // Account type: checkings or savings. Defaults to checking if omitted. + AccountType ConfirmationTokenPaymentMethodPreviewUSBankAccountAccountType `json:"account_type"` + // The name of the bank. + BankName string `json:"bank_name"` + // The ID of the Financial Connections Account used to create the payment method. + FinancialConnectionsAccount string `json:"financial_connections_account"` + // Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + Fingerprint string `json:"fingerprint"` + // Last four digits of the bank account number. + Last4 string `json:"last4"` + // Contains information about US bank account networks that can be used. + Networks *ConfirmationTokenPaymentMethodPreviewUSBankAccountNetworks `json:"networks"` + // Routing number of the bank account. + RoutingNumber string `json:"routing_number"` + // Contains information about the future reusability of this PaymentMethod. + StatusDetails *ConfirmationTokenPaymentMethodPreviewUSBankAccountStatusDetails `json:"status_details"` +} +type ConfirmationTokenPaymentMethodPreviewWeChatPay struct{} +type ConfirmationTokenPaymentMethodPreviewZip struct{} + +// Payment details collected by the Payment Element, used to create a PaymentMethod when a PaymentIntent or SetupIntent is confirmed with this ConfirmationToken. +type ConfirmationTokenPaymentMethodPreview struct { + ACSSDebit *ConfirmationTokenPaymentMethodPreviewACSSDebit `json:"acss_debit"` + Affirm *ConfirmationTokenPaymentMethodPreviewAffirm `json:"affirm"` + AfterpayClearpay *ConfirmationTokenPaymentMethodPreviewAfterpayClearpay `json:"afterpay_clearpay"` + Alipay *ConfirmationTokenPaymentMethodPreviewAlipay `json:"alipay"` + AUBECSDebit *ConfirmationTokenPaymentMethodPreviewAUBECSDebit `json:"au_becs_debit"` + BACSDebit *ConfirmationTokenPaymentMethodPreviewBACSDebit `json:"bacs_debit"` + Bancontact *ConfirmationTokenPaymentMethodPreviewBancontact `json:"bancontact"` + BillingDetails *ConfirmationTokenPaymentMethodPreviewBillingDetails `json:"billing_details"` + BLIK *ConfirmationTokenPaymentMethodPreviewBLIK `json:"blik"` + Boleto *ConfirmationTokenPaymentMethodPreviewBoleto `json:"boleto"` + Card *ConfirmationTokenPaymentMethodPreviewCard `json:"card"` + CardPresent *ConfirmationTokenPaymentMethodPreviewCardPresent `json:"card_present"` + CashApp *ConfirmationTokenPaymentMethodPreviewCashApp `json:"cashapp"` + CustomerBalance *ConfirmationTokenPaymentMethodPreviewCustomerBalance `json:"customer_balance"` + EPS *ConfirmationTokenPaymentMethodPreviewEPS `json:"eps"` + FPX *ConfirmationTokenPaymentMethodPreviewFPX `json:"fpx"` + Giropay *ConfirmationTokenPaymentMethodPreviewGiropay `json:"giropay"` + Grabpay *ConfirmationTokenPaymentMethodPreviewGrabpay `json:"grabpay"` + IDEAL *ConfirmationTokenPaymentMethodPreviewIDEAL `json:"ideal"` + InteracPresent *ConfirmationTokenPaymentMethodPreviewInteracPresent `json:"interac_present"` + Klarna *ConfirmationTokenPaymentMethodPreviewKlarna `json:"klarna"` + Konbini *ConfirmationTokenPaymentMethodPreviewKonbini `json:"konbini"` + Link *ConfirmationTokenPaymentMethodPreviewLink `json:"link"` + OXXO *ConfirmationTokenPaymentMethodPreviewOXXO `json:"oxxo"` + P24 *ConfirmationTokenPaymentMethodPreviewP24 `json:"p24"` + PayNow *ConfirmationTokenPaymentMethodPreviewPayNow `json:"paynow"` + Paypal *ConfirmationTokenPaymentMethodPreviewPaypal `json:"paypal"` + Pix *ConfirmationTokenPaymentMethodPreviewPix `json:"pix"` + PromptPay *ConfirmationTokenPaymentMethodPreviewPromptPay `json:"promptpay"` + SEPADebit *ConfirmationTokenPaymentMethodPreviewSEPADebit `json:"sepa_debit"` + Sofort *ConfirmationTokenPaymentMethodPreviewSofort `json:"sofort"` + // The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. + Type ConfirmationTokenPaymentMethodPreviewType `json:"type"` + USBankAccount *ConfirmationTokenPaymentMethodPreviewUSBankAccount `json:"us_bank_account"` + WeChatPay *ConfirmationTokenPaymentMethodPreviewWeChatPay `json:"wechat_pay"` + Zip *ConfirmationTokenPaymentMethodPreviewZip `json:"zip"` +} + +// Shipping information collected on this ConfirmationToken. +type ConfirmationTokenShipping struct { + Address *Address `json:"address"` + // Recipient name. + Name string `json:"name"` + // Recipient phone (including extension). + Phone string `json:"phone"` +} + +// ConfirmationTokens help transport client side data collected by Stripe JS over +// to your server for confirming a PaymentIntent or SetupIntent. If the confirmation +// is successful, values present on the ConfirmationToken are written onto the Intent. +type ConfirmationToken struct { + APIResource + // Time at which the object was created. Measured in seconds since the Unix epoch. + Created int64 `json:"created"` + // ID of the Customer this ConfirmationToken belongs to. + Customer string `json:"customer"` + // Time at which this ConfirmationToken expires and can no longer be used to confirm a PaymentIntent or SetupIntent. This is set to null once this ConfirmationToken has been used. + ExpiresAt int64 `json:"expires_at"` + // 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"` + // Data used for generating a Mandate. + MandateData *ConfirmationTokenMandateData `json:"mandate_data"` + // String representing the object's type. Objects of the same type share the same value. + Object string `json:"object"` + // ID of the PaymentIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used. + PaymentIntent string `json:"payment_intent"` + // ID of an existing PaymentMethod. + PaymentMethod *PaymentMethod `json:"payment_method"` + // Payment details collected by the Payment Element, used to create a PaymentMethod when a PaymentIntent or SetupIntent is confirmed with this ConfirmationToken. + PaymentMethodPreview *ConfirmationTokenPaymentMethodPreview `json:"payment_method_preview"` + // Return URL used to confirm the Intent. + ReturnURL string `json:"return_url"` + // Indicates that you intend to make future payments with this ConfirmationToken's payment method. + // + // The presence of this property will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + SetupFutureUsage ConfirmationTokenSetupFutureUsage `json:"setup_future_usage"` + // ID of the SetupIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used. + SetupIntent string `json:"setup_intent"` + // Shipping information collected on this ConfirmationToken. + Shipping *ConfirmationTokenShipping `json:"shipping"` +} diff --git a/confirmationtoken/client.go b/confirmationtoken/client.go new file mode 100644 index 0000000000..55b32e9839 --- /dev/null +++ b/confirmationtoken/client.go @@ -0,0 +1,37 @@ +// +// +// File generated from our OpenAPI spec +// +// + +// Package confirmationtoken provides the /confirmation_tokens APIs +package confirmationtoken + +import ( + "net/http" + + stripe "github.com/stripe/stripe-go/v75" +) + +// Client is used to invoke /confirmation_tokens APIs. +type Client struct { + B stripe.Backend + Key string +} + +// Get returns the details of a confirmation token. +func Get(id string, params *stripe.ConfirmationTokenParams) (*stripe.ConfirmationToken, error) { + return getC().Get(id, params) +} + +// Get returns the details of a confirmation token. +func (c Client) Get(id string, params *stripe.ConfirmationTokenParams) (*stripe.ConfirmationToken, error) { + path := stripe.FormatURLPath("/v1/confirmation_tokens/%s", id) + confirmationtoken := &stripe.ConfirmationToken{} + err := c.B.Call(http.MethodGet, path, c.Key, params, confirmationtoken) + return confirmationtoken, err +} + +func getC() Client { + return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key} +} diff --git a/customer.go b/customer.go index 3c5f7e3b8e..a10f295512 100644 --- a/customer.go +++ b/customer.go @@ -30,7 +30,7 @@ const ( CustomerTaxLocationSourceShippingDestination CustomerTaxLocationSource = "shipping_destination" ) -// Describes the customer's tax exemption status. One of `none`, `exempt`, or `reverse`. When set to `reverse`, invoice and receipt PDFs include the text **"Reverse charge"**. +// Describes the customer's tax exemption status, which is `none`, `exempt`, or `reverse`. When set to `reverse`, invoice and receipt PDFs include the following text: **"Reverse charge"**. type CustomerTaxExempt string // List of values that CustomerTaxExempt can take @@ -319,16 +319,16 @@ type CustomerTax struct { Location *CustomerTaxLocation `json:"location"` } -// This object represents a customer of your business. It lets you create recurring charges and track payments that belong to the same customer. +// This object represents a customer of your business. Use it to create recurring charges and track payments that belong to the same customer. // // Related guide: [Save a card during payment](https://stripe.com/docs/payments/save-during-payment) type Customer struct { APIResource // The customer's address. Address *Address `json:"address"` - // Current balance, if any, being stored on the customer. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that will be added to their next invoice. The balance does not refer to any unpaid invoices; it solely takes into account amounts that have yet to be successfully applied to any invoice. This balance is only taken into account as invoices are finalized. + // The current balance, if any, that's stored on the customer. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that's added to their next invoice. The balance only considers amounts that Stripe hasn't successfully applied to any invoice. It doesn't reflect unpaid invoices. This balance is only taken into account after invoices finalize. Balance int64 `json:"balance"` - // The current funds being held by Stripe on behalf of the customer. These funds can be applied towards payment intents with source "cash_balance". The settings[reconciliation_mode] field describes whether these funds are applied to such payment intents manually or automatically. + // The current funds being held by Stripe on behalf of the customer. You can apply these funds towards payment intents when the source is "cash_balance". The `settings[reconciliation_mode]` field describes if these funds apply to these payment intents manually or automatically. CashBalance *CashBalance `json:"cash_balance"` // Time at which the object was created. Measured in seconds since the Unix epoch. Created int64 `json:"created"` @@ -336,12 +336,12 @@ type Customer struct { Currency Currency `json:"currency"` // ID of the default payment source for the customer. // - // If you are using payment methods created via the PaymentMethods API, see the [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) field instead. + // If you use payment methods created through the PaymentMethods API, see the [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) field instead. DefaultSource *PaymentSource `json:"default_source"` Deleted bool `json:"deleted"` - // When the customer's latest invoice is billed by charging automatically, `delinquent` is `true` if the invoice's latest charge failed. When the customer's latest invoice is billed by sending an invoice, `delinquent` is `true` if the invoice isn't paid by its due date. + // If Stripe bills the customer's latest invoice by automatically charging and the latest charge fails, it sets `delinquent`` to `true``. If Stripe bills the invoice by sending it, and the invoice isn't paid by the due date, it also sets `delinquent`` to `true`. // - // If an invoice is marked uncollectible by [dunning](https://stripe.com/docs/billing/automatic-collection), `delinquent` doesn't get reset to `false`. + // If an invoice becomes uncollectible by [dunning](https://stripe.com/docs/billing/automatic-collection), `delinquent` doesn't reset to `false`. Delinquent bool `json:"delinquent"` // An arbitrary string attached to the object. Often useful for displaying to users. Description string `json:"description"` @@ -351,7 +351,7 @@ type Customer struct { Email string `json:"email"` // Unique identifier for the object. ID string `json:"id"` - // The current multi-currency balances, if any, being stored on the customer. If positive in a currency, the customer has a credit to apply to their next invoice denominated in that currency. If negative, the customer has an amount owed that will be added to their next invoice denominated in that currency. These balances do not refer to any unpaid invoices. They solely track amounts that have yet to be successfully applied to any invoice. A balance in a particular currency is only applied to any invoice as an invoice in that currency is finalized. + // The current multi-currency balances, if any, that's stored on the customer. If positive in a currency, the customer has a credit to apply to their next invoice denominated in that currency. If negative, the customer has an amount owed that's added to their next invoice denominated in that currency. These balances don't apply to unpaid invoices. They solely track amounts that Stripe hasn't successfully applied to any invoice. Stripe only applies a balance in a specific currency to an invoice after that invoice (which is in the same currency) finalizes. InvoiceCreditBalance map[string]int64 `json:"invoice_credit_balance"` // The prefix for the customer used to generate unique invoice numbers. InvoicePrefix string `json:"invoice_prefix"` @@ -362,7 +362,7 @@ type Customer struct { Metadata map[string]string `json:"metadata"` // The customer's full name or business name. Name string `json:"name"` - // The suffix of the customer's next invoice number, e.g., 0001. + // The suffix of the customer's next invoice number (for example, 0001). NextInvoiceSequence int64 `json:"next_invoice_sequence"` // String representing the object's type. Objects of the same type share the same value. Object string `json:"object"` @@ -376,11 +376,11 @@ type Customer struct { // The customer's current subscriptions, if any. Subscriptions *SubscriptionList `json:"subscriptions"` Tax *CustomerTax `json:"tax"` - // Describes the customer's tax exemption status. One of `none`, `exempt`, or `reverse`. When set to `reverse`, invoice and receipt PDFs include the text **"Reverse charge"**. + // Describes the customer's tax exemption status, which is `none`, `exempt`, or `reverse`. When set to `reverse`, invoice and receipt PDFs include the following text: **"Reverse charge"**. TaxExempt CustomerTaxExempt `json:"tax_exempt"` // The customer's tax IDs. TaxIDs *TaxIDList `json:"tax_ids"` - // ID of the test clock this customer belongs to. + // ID of the test clock that this customer belongs to. TestClock *TestHelpersTestClock `json:"test_clock"` } diff --git a/dispute.go b/dispute.go index 2ca5b92a48..eae22de7de 100644 --- a/dispute.go +++ b/dispute.go @@ -16,7 +16,7 @@ const ( DisputePaymentMethodDetailsTypeCard DisputePaymentMethodDetailsType = "card" ) -// 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`. Read more about [dispute reasons](https://stripe.com/docs/disputes/categories). +// 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). type DisputeReason string // List of values that DisputeReason can take @@ -235,19 +235,17 @@ type DisputePaymentMethodDetails struct { } // A dispute occurs when a customer questions your charge with their card issuer. -// When this happens, you're given the opportunity to respond to the dispute with -// evidence that shows that the charge is legitimate. You can find more -// information about the dispute process in our [Disputes and -// Fraud](https://stripe.com/docs/disputes) documentation. +// When this happens, you have the opportunity to respond to the dispute with +// evidence that shows that the charge is legitimate. // // Related guide: [Disputes and fraud](https://stripe.com/docs/disputes) type Dispute struct { APIResource - // Disputed amount. Usually the amount of the charge, but can differ (usually because of currency fluctuation or because only part of the order is disputed). + // Disputed amount. Usually the amount of the charge, but it can differ (usually because of currency fluctuation or because only part of the order is disputed). Amount int64 `json:"amount"` // List of zero, one, or two balance transactions that show funds withdrawn and reinstated to your Stripe account as a result of this dispute. BalanceTransactions []*BalanceTransaction `json:"balance_transactions"` - // ID of the charge that was disputed. + // ID of the charge that's disputed. Charge *Charge `json:"charge"` // Time at which the object was created. Measured in seconds since the Unix epoch. Created int64 `json:"created"` @@ -257,7 +255,7 @@ type Dispute struct { EvidenceDetails *DisputeEvidenceDetails `json:"evidence_details"` // Unique identifier for the object. ID string `json:"id"` - // If true, it is still possible to refund the disputed payment. Once the payment has been fully refunded, no further funds will be withdrawn from your Stripe account as a result of this dispute. + // If true, it's still possible to refund the disputed payment. After the payment has been fully refunded, no further funds are withdrawn from your Stripe account as a result of this dispute. IsChargeRefundable bool `json:"is_charge_refundable"` // 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"` @@ -267,10 +265,10 @@ type Dispute struct { NetworkReasonCode string `json:"network_reason_code"` // String representing the object's type. Objects of the same type share the same value. Object string `json:"object"` - // ID of the PaymentIntent that was disputed. + // ID of the PaymentIntent that's disputed. PaymentIntent *PaymentIntent `json:"payment_intent"` PaymentMethodDetails *DisputePaymentMethodDetails `json:"payment_method_details"` - // 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`. Read more about [dispute reasons](https://stripe.com/docs/disputes/categories). + // 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). Reason DisputeReason `json:"reason"` // Current status of dispute. Possible values are `warning_needs_response`, `warning_under_review`, `warning_closed`, `needs_response`, `under_review`, `won`, or `lost`. Status DisputeStatus `json:"status"` diff --git a/ephemeralkey.go b/ephemeralkey.go index 3b081abf98..0c8e00145b 100644 --- a/ephemeralkey.go +++ b/ephemeralkey.go @@ -17,6 +17,8 @@ type EphemeralKeyParams struct { Expand []*string `form:"expand"` // The ID of the Issuing Card you'd like to access using the resulting ephemeral key. IssuingCard *string `form:"issuing_card"` + // A single-use token, created by Stripe.js, used for creating ephemeral keys for Issuing Cards without exchanging sensitive information. + Nonce *string `form:"nonce"` // The ID of the Identity VerificationSession you'd like to access using the resulting ephemeral key VerificationSession *string `form:"verification_session"` StripeVersion *string `form:"-"` // This goes in the `Stripe-Version` header diff --git a/error.go b/error.go index 57d2663013..bce1bc13e7 100644 --- a/error.go +++ b/error.go @@ -170,6 +170,7 @@ const ( ErrorCodeShippingCalculationFailed ErrorCode = "shipping_calculation_failed" ErrorCodeStateUnsupported ErrorCode = "state_unsupported" ErrorCodeStatusTransitionInvalid ErrorCode = "status_transition_invalid" + ErrorCodeStripeTaxInactive ErrorCode = "stripe_tax_inactive" ErrorCodeTLSVersionUnsupported ErrorCode = "tls_version_unsupported" ErrorCodeTaxIDInvalid ErrorCode = "tax_id_invalid" ErrorCodeTaxesCalculationFailed ErrorCode = "taxes_calculation_failed" diff --git a/event.go b/event.go index 2358b01498..decc4c74dd 100644 --- a/event.go +++ b/event.go @@ -12,7 +12,7 @@ import ( "strconv" ) -// Description of the event (e.g., `invoice.created` or `charge.refunded`). +// Description of the event (for example, `invoice.created` or `charge.refunded`). type EventType string // List of values that EventType can take @@ -126,6 +126,7 @@ const ( EventTypeIssuingCardUpdated EventType = "issuing_card.updated" EventTypeIssuingCardDesignActivated EventType = "issuing_card_design.activated" EventTypeIssuingCardDesignDeactivated EventType = "issuing_card_design.deactivated" + EventTypeIssuingCardDesignRejected EventType = "issuing_card_design.rejected" EventTypeIssuingCardDesignUpdated EventType = "issuing_card_design.updated" EventTypeIssuingCardholderCreated EventType = "issuing_cardholder.created" EventTypeIssuingCardholderUpdated EventType = "issuing_cardholder.updated" @@ -310,7 +311,7 @@ type EventData struct { Raw json.RawMessage `json:"object"` } -// Information on the API request that instigated the event. +// Information on the API request that triggers the event. type EventRequest struct { // ID is the request ID of the request that created an event, if the event // was created by a request. @@ -327,37 +328,38 @@ type EventRequest struct { // Events are our way of letting you know when something interesting happens in // your account. When an interesting event occurs, we create a new `Event` // object. For example, when a charge succeeds, we create a `charge.succeeded` -// event; and when an invoice payment attempt fails, we create an -// `invoice.payment_failed` event. Note that many API requests may cause multiple -// events to be created. For example, if you create a new subscription for a -// customer, you will receive both a `customer.subscription.created` event and a +// event, and when an invoice payment attempt fails, we create an +// `invoice.payment_failed` event. Certain API requests might create multiple +// events. For example, if you create a new subscription for a +// customer, you receive both a `customer.subscription.created` event and a // `charge.succeeded` event. // -// Events occur when the state of another API resource changes. The state of that -// resource at the time of the change is embedded in the event's data field. For -// example, a `charge.succeeded` event will contain a charge, and an -// `invoice.payment_failed` event will contain an invoice. +// Events occur when the state of another API resource changes. The event's data +// field embeds the resource's state at the time of the change. For +// example, a `charge.succeeded` event contains a charge, and an +// `invoice.payment_failed` event contains an invoice. // // As with other API resources, you can use endpoints to retrieve an // [individual event](https://stripe.com/docs/api#retrieve_event) or a [list of events](https://stripe.com/docs/api#list_events) // from the API. We also have a separate // [webhooks](http://en.wikipedia.org/wiki/Webhook) system for sending the -// `Event` objects directly to an endpoint on your server. Webhooks are managed -// in your -// [account settings](https://dashboard.stripe.com/account/webhooks), -// and our [Using Webhooks](https://stripe.com/docs/webhooks) guide will help you get set up. +// `Event` objects directly to an endpoint on your server. You can manage +// webhooks in your +// [account settings](https://dashboard.stripe.com/account/webhooks). Learn how +// to [listen for events] +// (/docs/webhooks) so that your integration can automatically trigger reactions. // -// When using [Connect](https://stripe.com/docs/connect), you can also receive notifications of -// events that occur in connected accounts. For these events, there will be an +// When using [Connect](https://stripe.com/docs/connect), you can also receive event notifications +// that occur in connected accounts. For these events, there's an // additional `account` attribute in the received `Event` object. // -// **NOTE:** Right now, access to events through the [Retrieve Event API](https://stripe.com/docs/api#retrieve_event) is -// guaranteed only for 30 days. +// We only guarantee access to events through the [Retrieve Event API](https://stripe.com/docs/api#retrieve_event) +// for 30 days. type Event struct { APIResource - // The connected account that originated the event. + // The connected account that originates the event. Account string `json:"account"` - // The Stripe API version used to render `data`. *Note: This property is populated only for events on or after October 31, 2014*. + // The Stripe API version used to render `data`. This property is populated only for events on or after October 31, 2014. APIVersion string `json:"api_version"` // Time at which the object was created. Measured in seconds since the Unix epoch. Created int64 `json:"created"` @@ -368,11 +370,11 @@ type Event struct { Livemode bool `json:"livemode"` // String representing the object's type. Objects of the same type share the same value. Object string `json:"object"` - // Number of webhooks that have yet to be successfully delivered (i.e., to return a 20x response) to the URLs you've specified. + // Number of webhooks that haven't been successfully delivered (for example, to return a 20x response) to the URLs you specify. PendingWebhooks int64 `json:"pending_webhooks"` - // Information on the API request that instigated the event. + // Information on the API request that triggers the event. Request *EventRequest `json:"request"` - // Description of the event (e.g., `invoice.created` or `charge.refunded`). + // Description of the event (for example, `invoice.created` or `charge.refunded`). Type EventType `json:"type"` } diff --git a/example/generated_examples_test.go b/example/generated_examples_test.go index a297702531..2066bd103b 100644 --- a/example/generated_examples_test.go +++ b/example/generated_examples_test.go @@ -1,4 +1,9 @@ +// +// // File generated from our OpenAPI spec +// +// + package example import ( @@ -37,6 +42,7 @@ import ( paymentintent "github.com/stripe/stripe-go/v75/paymentintent" paymentlink "github.com/stripe/stripe-go/v75/paymentlink" paymentmethod "github.com/stripe/stripe-go/v75/paymentmethod" + paymentmethodconfiguration "github.com/stripe/stripe-go/v75/paymentmethodconfiguration" payout "github.com/stripe/stripe-go/v75/payout" person "github.com/stripe/stripe-go/v75/person" plan "github.com/stripe/stripe-go/v75/plan" @@ -66,7 +72,9 @@ import ( terminal_location "github.com/stripe/stripe-go/v75/terminal/location" terminal_reader "github.com/stripe/stripe-go/v75/terminal/reader" testhelpers_customer "github.com/stripe/stripe-go/v75/testhelpers/customer" + testhelpers_issuing_authorization "github.com/stripe/stripe-go/v75/testhelpers/issuing/authorization" testhelpers_issuing_card "github.com/stripe/stripe-go/v75/testhelpers/issuing/card" + testhelpers_issuing_transaction "github.com/stripe/stripe-go/v75/testhelpers/issuing/transaction" testhelpers_refund "github.com/stripe/stripe-go/v75/testhelpers/refund" testhelpers_testclock "github.com/stripe/stripe-go/v75/testhelpers/testclock" testhelpers_treasury_inboundtransfer "github.com/stripe/stripe-go/v75/testhelpers/treasury/inboundtransfer" @@ -3276,3 +3284,300 @@ func TestTaxFormPDF(t *testing.T) { assert.NotNil(t, result) assert.Nil(t, err) } + +func TestPaymentMethodConfigurationList(t *testing.T) { + params := &stripe.PaymentMethodConfigurationListParams{ + Application: stripe.String("foo"), + } + result := paymentmethodconfiguration.List(params) + assert.NotNil(t, result) + assert.Nil(t, result.Err()) +} + +func TestPaymentMethodConfigurationCreate(t *testing.T) { + params := &stripe.PaymentMethodConfigurationParams{ + ACSSDebit: &stripe.PaymentMethodConfigurationACSSDebitParams{ + DisplayPreference: &stripe.PaymentMethodConfigurationACSSDebitDisplayPreferenceParams{ + Preference: stripe.String(string(stripe.PaymentMethodConfigurationACSSDebitDisplayPreferencePreferenceNone)), + }, + }, + Affirm: &stripe.PaymentMethodConfigurationAffirmParams{ + DisplayPreference: &stripe.PaymentMethodConfigurationAffirmDisplayPreferenceParams{ + Preference: stripe.String(string(stripe.PaymentMethodConfigurationAffirmDisplayPreferencePreferenceNone)), + }, + }, + } + result, err := paymentmethodconfiguration.New(params) + assert.NotNil(t, result) + assert.Nil(t, err) +} + +func TestPaymentMethodConfigurationRetrieve(t *testing.T) { + params := &stripe.PaymentMethodConfigurationParams{} + result, err := paymentmethodconfiguration.Get("foo", params) + assert.NotNil(t, result) + assert.Nil(t, err) +} + +func TestPaymentMethodConfigurationUpdate(t *testing.T) { + params := &stripe.PaymentMethodConfigurationParams{ + ACSSDebit: &stripe.PaymentMethodConfigurationACSSDebitParams{ + DisplayPreference: &stripe.PaymentMethodConfigurationACSSDebitDisplayPreferenceParams{ + Preference: stripe.String(string(stripe.PaymentMethodConfigurationACSSDebitDisplayPreferencePreferenceOn)), + }, + }, + } + result, err := paymentmethodconfiguration.Update("foo", params) + assert.NotNil(t, result) + assert.Nil(t, err) +} + +func TestTestHelpersIssuingAuthorizationCreate(t *testing.T) { + params := &stripe.TestHelpersIssuingAuthorizationParams{ + Amount: stripe.Int64(100), + AmountDetails: &stripe.TestHelpersIssuingAuthorizationAmountDetailsParams{ + ATMFee: stripe.Int64(10), + CashbackAmount: stripe.Int64(5), + }, + AuthorizationMethod: stripe.String(string(stripe.IssuingAuthorizationAuthorizationMethodChip)), + Card: stripe.String("foo"), + Currency: stripe.String(string(stripe.CurrencyUSD)), + IsAmountControllable: stripe.Bool(true), + MerchantData: &stripe.TestHelpersIssuingAuthorizationMerchantDataParams{ + Category: stripe.String("ac_refrigeration_repair"), + City: stripe.String("foo"), + Country: stripe.String("bar"), + Name: stripe.String("foo"), + NetworkID: stripe.String("bar"), + PostalCode: stripe.String("foo"), + State: stripe.String("bar"), + TerminalID: stripe.String("foo"), + }, + NetworkData: &stripe.TestHelpersIssuingAuthorizationNetworkDataParams{ + AcquiringInstitutionID: stripe.String("foo"), + }, + VerificationData: &stripe.TestHelpersIssuingAuthorizationVerificationDataParams{ + AddressLine1Check: stripe.String("mismatch"), + AddressPostalCodeCheck: stripe.String("match"), + CVCCheck: stripe.String("match"), + ExpiryCheck: stripe.String("mismatch"), + }, + Wallet: stripe.String("apple_pay"), + } + result, err := testhelpers_issuing_authorization.New(params) + assert.NotNil(t, result) + assert.Nil(t, err) +} + +func TestTestHelpersIssuingAuthorizationCapture(t *testing.T) { + params := &stripe.TestHelpersIssuingAuthorizationCaptureParams{ + CaptureAmount: stripe.Int64(100), + CloseAuthorization: stripe.Bool(true), + PurchaseDetails: &stripe.TestHelpersIssuingAuthorizationCapturePurchaseDetailsParams{ + Flight: &stripe.TestHelpersIssuingAuthorizationCapturePurchaseDetailsFlightParams{ + DepartureAt: stripe.Int64(1633651200), + PassengerName: stripe.String("John Doe"), + Refundable: stripe.Bool(true), + Segments: []*stripe.TestHelpersIssuingAuthorizationCapturePurchaseDetailsFlightSegmentParams{ + &stripe.TestHelpersIssuingAuthorizationCapturePurchaseDetailsFlightSegmentParams{ + ArrivalAirportCode: stripe.String("SFO"), + Carrier: stripe.String("Delta"), + DepartureAirportCode: stripe.String("LAX"), + FlightNumber: stripe.String("DL100"), + ServiceClass: stripe.String("Economy"), + StopoverAllowed: stripe.Bool(true), + }, + }, + TravelAgency: stripe.String("Orbitz"), + }, + Fuel: &stripe.TestHelpersIssuingAuthorizationCapturePurchaseDetailsFuelParams{ + Type: stripe.String("diesel"), + Unit: stripe.String("liter"), + UnitCostDecimal: stripe.Float64(3.5), + VolumeDecimal: stripe.Float64(10), + }, + Lodging: &stripe.TestHelpersIssuingAuthorizationCapturePurchaseDetailsLodgingParams{ + CheckInAt: stripe.Int64(1633651200), + Nights: stripe.Int64(2), + }, + Receipt: []*stripe.TestHelpersIssuingAuthorizationCapturePurchaseDetailsReceiptParams{ + &stripe.TestHelpersIssuingAuthorizationCapturePurchaseDetailsReceiptParams{ + Description: stripe.String("Room charge"), + Quantity: stripe.Float64(1), + Total: stripe.Int64(200), + UnitCost: stripe.Int64(200), + }, + }, + Reference: stripe.String("foo"), + }, + } + result, err := testhelpers_issuing_authorization.Capture( + "example_authorization", + params, + ) + assert.NotNil(t, result) + assert.Nil(t, err) +} + +func TestTestHelpersIssuingAuthorizationExpire(t *testing.T) { + params := &stripe.TestHelpersIssuingAuthorizationExpireParams{} + result, err := testhelpers_issuing_authorization.Expire( + "example_authorization", + params, + ) + assert.NotNil(t, result) + assert.Nil(t, err) +} + +func TestTestHelpersIssuingAuthorizationIncrement(t *testing.T) { + params := &stripe.TestHelpersIssuingAuthorizationIncrementParams{ + IncrementAmount: stripe.Int64(50), + IsAmountControllable: stripe.Bool(true), + } + result, err := testhelpers_issuing_authorization.Increment( + "example_authorization", + params, + ) + assert.NotNil(t, result) + assert.Nil(t, err) +} + +func TestTestHelpersIssuingAuthorizationReverse(t *testing.T) { + params := &stripe.TestHelpersIssuingAuthorizationReverseParams{ + ReverseAmount: stripe.Int64(20), + } + result, err := testhelpers_issuing_authorization.Reverse( + "example_authorization", + params, + ) + assert.NotNil(t, result) + assert.Nil(t, err) +} + +func TestTestHelpersIssuingTransactionCreateForceCapture(t *testing.T) { + params := &stripe.TestHelpersIssuingTransactionCreateForceCaptureParams{ + Amount: stripe.Int64(100), + Card: stripe.String("foo"), + Currency: stripe.String(string(stripe.CurrencyUSD)), + MerchantData: &stripe.TestHelpersIssuingTransactionCreateForceCaptureMerchantDataParams{ + Category: stripe.String("ac_refrigeration_repair"), + City: stripe.String("foo"), + Country: stripe.String("US"), + Name: stripe.String("foo"), + NetworkID: stripe.String("bar"), + PostalCode: stripe.String("10001"), + State: stripe.String("NY"), + TerminalID: stripe.String("foo"), + }, + PurchaseDetails: &stripe.TestHelpersIssuingTransactionCreateForceCapturePurchaseDetailsParams{ + Flight: &stripe.TestHelpersIssuingTransactionCreateForceCapturePurchaseDetailsFlightParams{ + DepartureAt: stripe.Int64(1633651200), + PassengerName: stripe.String("John Doe"), + Refundable: stripe.Bool(true), + Segments: []*stripe.TestHelpersIssuingTransactionCreateForceCapturePurchaseDetailsFlightSegmentParams{ + &stripe.TestHelpersIssuingTransactionCreateForceCapturePurchaseDetailsFlightSegmentParams{ + ArrivalAirportCode: stripe.String("SFO"), + Carrier: stripe.String("Delta"), + DepartureAirportCode: stripe.String("LAX"), + FlightNumber: stripe.String("DL100"), + ServiceClass: stripe.String("Economy"), + StopoverAllowed: stripe.Bool(true), + }, + }, + TravelAgency: stripe.String("Orbitz"), + }, + Fuel: &stripe.TestHelpersIssuingTransactionCreateForceCapturePurchaseDetailsFuelParams{ + Type: stripe.String("diesel"), + Unit: stripe.String("liter"), + UnitCostDecimal: stripe.Float64(3.5), + VolumeDecimal: stripe.Float64(10), + }, + Lodging: &stripe.TestHelpersIssuingTransactionCreateForceCapturePurchaseDetailsLodgingParams{ + CheckInAt: stripe.Int64(1533651200), + Nights: stripe.Int64(2), + }, + Receipt: []*stripe.TestHelpersIssuingTransactionCreateForceCapturePurchaseDetailsReceiptParams{ + &stripe.TestHelpersIssuingTransactionCreateForceCapturePurchaseDetailsReceiptParams{ + Description: stripe.String("Room charge"), + Quantity: stripe.Float64(1), + Total: stripe.Int64(200), + UnitCost: stripe.Int64(200), + }, + }, + Reference: stripe.String("foo"), + }, + } + result, err := testhelpers_issuing_transaction.CreateForceCapture(params) + assert.NotNil(t, result) + assert.Nil(t, err) +} + +func TestTestHelpersIssuingTransactionCreateUnlinkedRefund(t *testing.T) { + params := &stripe.TestHelpersIssuingTransactionCreateUnlinkedRefundParams{ + Amount: stripe.Int64(100), + Card: stripe.String("foo"), + Currency: stripe.String(string(stripe.CurrencyUSD)), + MerchantData: &stripe.TestHelpersIssuingTransactionCreateUnlinkedRefundMerchantDataParams{ + Category: stripe.String("ac_refrigeration_repair"), + City: stripe.String("foo"), + Country: stripe.String("bar"), + Name: stripe.String("foo"), + NetworkID: stripe.String("bar"), + PostalCode: stripe.String("foo"), + State: stripe.String("bar"), + TerminalID: stripe.String("foo"), + }, + PurchaseDetails: &stripe.TestHelpersIssuingTransactionCreateUnlinkedRefundPurchaseDetailsParams{ + Flight: &stripe.TestHelpersIssuingTransactionCreateUnlinkedRefundPurchaseDetailsFlightParams{ + DepartureAt: stripe.Int64(1533651200), + PassengerName: stripe.String("John Doe"), + Refundable: stripe.Bool(true), + Segments: []*stripe.TestHelpersIssuingTransactionCreateUnlinkedRefundPurchaseDetailsFlightSegmentParams{ + &stripe.TestHelpersIssuingTransactionCreateUnlinkedRefundPurchaseDetailsFlightSegmentParams{ + ArrivalAirportCode: stripe.String("SFO"), + Carrier: stripe.String("Delta"), + DepartureAirportCode: stripe.String("LAX"), + FlightNumber: stripe.String("DL100"), + ServiceClass: stripe.String("Economy"), + StopoverAllowed: stripe.Bool(true), + }, + }, + TravelAgency: stripe.String("Orbitz"), + }, + Fuel: &stripe.TestHelpersIssuingTransactionCreateUnlinkedRefundPurchaseDetailsFuelParams{ + Type: stripe.String("diesel"), + Unit: stripe.String("liter"), + UnitCostDecimal: stripe.Float64(3.5), + VolumeDecimal: stripe.Float64(10), + }, + Lodging: &stripe.TestHelpersIssuingTransactionCreateUnlinkedRefundPurchaseDetailsLodgingParams{ + CheckInAt: stripe.Int64(1533651200), + Nights: stripe.Int64(2), + }, + Receipt: []*stripe.TestHelpersIssuingTransactionCreateUnlinkedRefundPurchaseDetailsReceiptParams{ + &stripe.TestHelpersIssuingTransactionCreateUnlinkedRefundPurchaseDetailsReceiptParams{ + Description: stripe.String("Room charge"), + Quantity: stripe.Float64(1), + Total: stripe.Int64(200), + UnitCost: stripe.Int64(200), + }, + }, + Reference: stripe.String("foo"), + }, + } + result, err := testhelpers_issuing_transaction.CreateUnlinkedRefund(params) + assert.NotNil(t, result) + assert.Nil(t, err) +} + +func TestTestHelpersIssuingTransactionRefund(t *testing.T) { + params := &stripe.TestHelpersIssuingTransactionRefundParams{ + RefundAmount: stripe.Int64(50), + } + result, err := testhelpers_issuing_transaction.Refund( + "example_transaction", + params, + ) + assert.NotNil(t, result) + assert.Nil(t, err) +} diff --git a/file/client.go b/file/client.go index 6e950b7893..8898708980 100644 --- a/file/client.go +++ b/file/client.go @@ -41,7 +41,7 @@ func (c Client) New(params *stripe.FileParams) (*stripe.File, error) { } file := &stripe.File{} - err = c.B.CallMultipart(http.MethodPost, "/v1/files", c.Key, boundary, bodyBuffer, ¶ms.Params, file) + err = c.BUploads.CallMultipart(http.MethodPost, "/v1/files", c.Key, boundary, bodyBuffer, ¶ms.Params, file) return file, err } diff --git a/file/client_test.go b/file/client_test.go index 3c1fce7576..8d44ddd73b 100644 --- a/file/client_test.go +++ b/file/client_test.go @@ -12,11 +12,13 @@ package file // import ( + "bytes" "os" "testing" assert "github.com/stretchr/testify/require" stripe "github.com/stripe/stripe-go/v75" + "github.com/stripe/stripe-go/v75/form" _ "github.com/stripe/stripe-go/v75/testing" ) @@ -41,6 +43,33 @@ func TestFileList(t *testing.T) { assert.NotNil(t, i.FileList()) } +type testBackend struct { + calledMultipart bool +} + +func (b *testBackend) Call(method, path, key string, params stripe.ParamsContainer, v stripe.LastResponseSetter) error { + return nil +} +func (b *testBackend) CallStreaming(method, path, key string, params stripe.ParamsContainer, v stripe.StreamingLastResponseSetter) error { + return nil +} +func (b *testBackend) CallRaw(method, path, key string, body *form.Values, params *stripe.Params, v stripe.LastResponseSetter) error { + return nil +} +func (b *testBackend) CallMultipart(method, path, key, boundary string, body *bytes.Buffer, params *stripe.Params, v stripe.LastResponseSetter) error { + b.calledMultipart = true + return nil +} +func (b *testBackend) SetMaxNetworkRetries(maxNetworkRetries int64) {} +func TestFileBackend(t *testing.T) { + orig := stripe.GetBackend(stripe.UploadsBackend) + b := &testBackend{calledMultipart: false} + stripe.SetBackend(stripe.UploadsBackend, b) + fileParams := &stripe.FileParams{} + New(fileParams) + assert.Equal(t, b.calledMultipart, true) + stripe.SetBackend(stripe.UploadsBackend, orig) +} func TestFileNew(t *testing.T) { f, err := os.Open("test_data.pdf") if err != nil { diff --git a/financialconnections_account.go b/financialconnections_account.go index 34ab340f5b..37f121549a 100644 --- a/financialconnections_account.go +++ b/financialconnections_account.go @@ -291,7 +291,7 @@ type FinancialConnectionsAccountBalance struct { type FinancialConnectionsAccountBalanceRefresh struct { // The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch. LastAttemptedAt int64 `json:"last_attempted_at"` - // Time at which the next balance refresh can be initiated. This value will be `null` when when `status` is `pending`. Measured in seconds since the Unix epoch. + // Time at which the next balance refresh can be initiated. This value will be `null` when `status` is `pending`. Measured in seconds since the Unix epoch. NextRefreshAvailableAt int64 `json:"next_refresh_available_at"` // The status of the last refresh attempt. Status FinancialConnectionsAccountBalanceRefreshStatus `json:"status"` @@ -301,7 +301,7 @@ type FinancialConnectionsAccountBalanceRefresh struct { type FinancialConnectionsAccountInferredBalancesRefresh struct { // The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch. LastAttemptedAt int64 `json:"last_attempted_at"` - // Time at which the next inferred balance refresh can be initiated. This value will be `null` when when `status` is `pending`. Measured in seconds since the Unix epoch. + // Time at which the next inferred balance refresh can be initiated. This value will be `null` when `status` is `pending`. Measured in seconds since the Unix epoch. NextRefreshAvailableAt int64 `json:"next_refresh_available_at"` // The status of the last refresh attempt. Status FinancialConnectionsAccountInferredBalancesRefreshStatus `json:"status"` @@ -311,7 +311,7 @@ type FinancialConnectionsAccountInferredBalancesRefresh struct { type FinancialConnectionsAccountOwnershipRefresh struct { // The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch. LastAttemptedAt int64 `json:"last_attempted_at"` - // Time at which the next ownership refresh can be initiated. This value will be `null` when when `status` is `pending`. Measured in seconds since the Unix epoch. + // Time at which the next ownership refresh can be initiated. This value will be `null` when `status` is `pending`. Measured in seconds since the Unix epoch. NextRefreshAvailableAt int64 `json:"next_refresh_available_at"` // The status of the last refresh attempt. Status FinancialConnectionsAccountOwnershipRefreshStatus `json:"status"` @@ -323,7 +323,7 @@ type FinancialConnectionsAccountTransactionRefresh struct { ID string `json:"id"` // The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch. LastAttemptedAt int64 `json:"last_attempted_at"` - // Time at which the next transaction refresh can be initiated. This value will be `null` when when `status` is `pending`. Measured in seconds since the Unix epoch. + // Time at which the next transaction refresh can be initiated. This value will be `null` when `status` is `pending`. Measured in seconds since the Unix epoch. NextRefreshAvailableAt int64 `json:"next_refresh_available_at"` // The status of the last refresh attempt. Status FinancialConnectionsAccountTransactionRefreshStatus `json:"status"` diff --git a/issuing/carddesign/client.go b/issuing/carddesign/client.go index c786a0fd16..aee6c65d66 100644 --- a/issuing/carddesign/client.go +++ b/issuing/carddesign/client.go @@ -20,6 +20,24 @@ type Client struct { Key string } +// New creates a new issuing card design. +func New(params *stripe.IssuingCardDesignParams) (*stripe.IssuingCardDesign, error) { + return getC().New(params) +} + +// New creates a new issuing card design. +func (c Client) New(params *stripe.IssuingCardDesignParams) (*stripe.IssuingCardDesign, error) { + carddesign := &stripe.IssuingCardDesign{} + err := c.B.Call( + http.MethodPost, + "/v1/issuing/card_designs", + c.Key, + params, + carddesign, + ) + return carddesign, err +} + // Get returns the details of an issuing card design. func Get(id string, params *stripe.IssuingCardDesignParams) (*stripe.IssuingCardDesign, error) { return getC().Get(id, params) diff --git a/issuing_authorization.go b/issuing_authorization.go index 6f170ceb08..14bf74de70 100644 --- a/issuing_authorization.go +++ b/issuing_authorization.go @@ -181,6 +181,8 @@ func (p *IssuingAuthorizationDeclineParams) AddMetadata(key string, value string type IssuingAuthorizationAmountDetails struct { // The fee charged by the ATM for the cash withdrawal. ATMFee int64 `json:"atm_fee"` + // The amount of cash requested by the cardholder. + CashbackAmount int64 `json:"cashback_amount"` } type IssuingAuthorizationMerchantData struct { // A categorization of the seller's type of business. See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. diff --git a/issuing_card.go b/issuing_card.go index 9d34d67734..4f7183a602 100644 --- a/issuing_card.go +++ b/issuing_card.go @@ -306,7 +306,7 @@ type IssuingCardShipping struct { ETA int64 `json:"eta"` // Recipient name. Name string `json:"name"` - // The phone number of the receiver of the bulk shipment. This phone number will be provided to the shipping company, who might use it to contact the receiver in case of delivery issues. + // The phone number of the receiver of the shipment. Our courier partners will use this number to contact you in the event of card delivery issues. For individual shipments to the EU/UK, if this field is empty, we will provide them with the phone number provided when the cardholder was initially created. PhoneNumber string `json:"phone_number"` // Whether a signature is required for card delivery. This feature is only supported for US users. Standard shipping service does not support signature on delivery. The default value for standard shipping service is false and for express and priority services is true. RequireSignature bool `json:"require_signature"` diff --git a/issuing_cardbundle.go b/issuing_cardbundle.go index 2f6d2a6c49..b1106f9d36 100644 --- a/issuing_cardbundle.go +++ b/issuing_cardbundle.go @@ -8,6 +8,26 @@ package stripe import "encoding/json" +// The policy for how to use card logo images in a card design with this card bundle. +type IssuingCardBundleFeaturesCardLogo string + +// List of values that IssuingCardBundleFeaturesCardLogo can take +const ( + IssuingCardBundleFeaturesCardLogoOptional IssuingCardBundleFeaturesCardLogo = "optional" + IssuingCardBundleFeaturesCardLogoRequired IssuingCardBundleFeaturesCardLogo = "required" + IssuingCardBundleFeaturesCardLogoUnsupported IssuingCardBundleFeaturesCardLogo = "unsupported" +) + +// The policy for how to use carrier letter text in a card design with this card bundle. +type IssuingCardBundleFeaturesCarrierText string + +// List of values that IssuingCardBundleFeaturesCarrierText can take +const ( + IssuingCardBundleFeaturesCarrierTextOptional IssuingCardBundleFeaturesCarrierText = "optional" + IssuingCardBundleFeaturesCarrierTextRequired IssuingCardBundleFeaturesCarrierText = "required" + IssuingCardBundleFeaturesCarrierTextUnsupported IssuingCardBundleFeaturesCarrierText = "unsupported" +) + // Whether this card bundle can be used to create cards. type IssuingCardBundleStatus string @@ -55,9 +75,17 @@ func (p *IssuingCardBundleParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } +type IssuingCardBundleFeatures struct { + // The policy for how to use card logo images in a card design with this card bundle. + CardLogo IssuingCardBundleFeaturesCardLogo `json:"card_logo"` + // The policy for how to use carrier letter text in a card design with this card bundle. + CarrierText IssuingCardBundleFeaturesCarrierText `json:"carrier_text"` +} + // A Card Bundle represents the bundle of physical items - card stock, carrier letter, and envelope - that is shipped to a cardholder when you create a physical card. type IssuingCardBundle struct { APIResource + Features *IssuingCardBundleFeatures `json:"features"` // 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. diff --git a/issuing_carddesign.go b/issuing_carddesign.go index ec62bb42d2..a2827c2656 100644 --- a/issuing_carddesign.go +++ b/issuing_carddesign.go @@ -8,14 +8,33 @@ package stripe import "encoding/json" -// Whether this card design is used to create cards when one is not specified. -type IssuingCardDesignPreference string +// The reason(s) the card logo was rejected. +type IssuingCardDesignRejectionReasonsCardLogo string -// List of values that IssuingCardDesignPreference can take +// List of values that IssuingCardDesignRejectionReasonsCardLogo can take const ( - IssuingCardDesignPreferenceDefault IssuingCardDesignPreference = "default" - IssuingCardDesignPreferenceNone IssuingCardDesignPreference = "none" - IssuingCardDesignPreferencePlatformDefault IssuingCardDesignPreference = "platform_default" + IssuingCardDesignRejectionReasonsCardLogoGeographicLocation IssuingCardDesignRejectionReasonsCardLogo = "geographic_location" + IssuingCardDesignRejectionReasonsCardLogoInappropriate IssuingCardDesignRejectionReasonsCardLogo = "inappropriate" + IssuingCardDesignRejectionReasonsCardLogoNetworkName IssuingCardDesignRejectionReasonsCardLogo = "network_name" + IssuingCardDesignRejectionReasonsCardLogoNonBinaryImage IssuingCardDesignRejectionReasonsCardLogo = "non_binary_image" + IssuingCardDesignRejectionReasonsCardLogoNonFiatCurrency IssuingCardDesignRejectionReasonsCardLogo = "non_fiat_currency" + IssuingCardDesignRejectionReasonsCardLogoOther IssuingCardDesignRejectionReasonsCardLogo = "other" + IssuingCardDesignRejectionReasonsCardLogoOtherEntity IssuingCardDesignRejectionReasonsCardLogo = "other_entity" + IssuingCardDesignRejectionReasonsCardLogoPromotionalMaterial IssuingCardDesignRejectionReasonsCardLogo = "promotional_material" +) + +// The reason(s) the carrier text was rejected. +type IssuingCardDesignRejectionReasonsCarrierText string + +// List of values that IssuingCardDesignRejectionReasonsCarrierText can take +const ( + IssuingCardDesignRejectionReasonsCarrierTextGeographicLocation IssuingCardDesignRejectionReasonsCarrierText = "geographic_location" + IssuingCardDesignRejectionReasonsCarrierTextInappropriate IssuingCardDesignRejectionReasonsCarrierText = "inappropriate" + IssuingCardDesignRejectionReasonsCarrierTextNetworkName IssuingCardDesignRejectionReasonsCarrierText = "network_name" + IssuingCardDesignRejectionReasonsCarrierTextNonFiatCurrency IssuingCardDesignRejectionReasonsCarrierText = "non_fiat_currency" + IssuingCardDesignRejectionReasonsCarrierTextOther IssuingCardDesignRejectionReasonsCarrierText = "other" + IssuingCardDesignRejectionReasonsCarrierTextOtherEntity IssuingCardDesignRejectionReasonsCarrierText = "other_entity" + IssuingCardDesignRejectionReasonsCarrierTextPromotionalMaterial IssuingCardDesignRejectionReasonsCarrierText = "promotional_material" ) // Whether this card design can be used to create cards. @@ -29,6 +48,14 @@ const ( IssuingCardDesignStatusReview IssuingCardDesignStatus = "review" ) +// Only return card designs with the given preferences. +type IssuingCardDesignListPreferencesParams struct { + // Only return the card design that is set as the account default. A connected account will use the Connect platform's default if no card design is set as the account default. + AccountDefault *bool `form:"account_default"` + // Only return the card design that is set as the Connect platform's default. This parameter is only applicable to connected accounts. + PlatformDefault *bool `form:"platform_default"` +} + // Returns a list of card design objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. type IssuingCardDesignListParams struct { ListParams `form:"*"` @@ -36,8 +63,8 @@ type IssuingCardDesignListParams struct { Expand []*string `form:"expand"` // Only return card designs with the given lookup keys. LookupKeys []*string `form:"lookup_keys"` - // Only return card designs with the given preference. - Preference *string `form:"preference"` + // Only return card designs with the given preferences. + Preferences *IssuingCardDesignListPreferencesParams `form:"preferences"` // Only return card designs with the given status. Status *string `form:"status"` } @@ -47,9 +74,33 @@ func (p *IssuingCardDesignListParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } -// Retrieves a card design object. +// Hash containing carrier text, for use with card bundles that support carrier text. +type IssuingCardDesignCarrierTextParams struct { + // The footer body text of the carrier letter. + FooterBody *string `form:"footer_body"` + // The footer title text of the carrier letter. + FooterTitle *string `form:"footer_title"` + // The header body text of the carrier letter. + HeaderBody *string `form:"header_body"` + // The header title text of the carrier letter. + HeaderTitle *string `form:"header_title"` +} + +// Information on whether this card design is used to create cards when one is not specified. +type IssuingCardDesignPreferencesParams struct { + // Whether this card design is used to create cards when one is not specified. A connected account will use the Connect platform's default if no card design is set as the account default. + AccountDefault *bool `form:"account_default"` +} + +// Creates a card design object. type IssuingCardDesignParams struct { Params `form:"*"` + // The card bundle object belonging to this card design. + CardBundle *string `form:"card_bundle"` + // The file for the card logo, for use with card bundles that support card logos. + CardLogo *string `form:"card_logo"` + // Hash containing carrier text, for use with card bundles that support carrier text. + CarrierText *IssuingCardDesignCarrierTextParams `form:"carrier_text"` // Specifies which fields in the response should be expanded. Expand []*string `form:"expand"` // A lookup key used to retrieve card designs dynamically from a static string. This may be up to 200 characters. @@ -58,8 +109,8 @@ type IssuingCardDesignParams struct { Metadata map[string]string `form:"metadata"` // Friendly display name. Providing an empty string will set the field to null. Name *string `form:"name"` - // Whether this card design is used to create cards when one is not specified. - Preference *string `form:"preference"` + // Information on whether this card design is used to create cards when one is not specified. + Preferences *IssuingCardDesignPreferencesParams `form:"preferences"` // If set to true, will atomically remove the lookup key from the existing card design, and assign it to this card design. TransferLookupKey *bool `form:"transfer_lookup_key"` } @@ -78,11 +129,39 @@ func (p *IssuingCardDesignParams) AddMetadata(key string, value string) { p.Metadata[key] = value } +// Hash containing carrier text, for use with card bundles that support carrier text. +type IssuingCardDesignCarrierText struct { + // The footer body text of the carrier letter. + FooterBody string `json:"footer_body"` + // The footer title text of the carrier letter. + FooterTitle string `json:"footer_title"` + // The header body text of the carrier letter. + HeaderBody string `json:"header_body"` + // The header title text of the carrier letter. + HeaderTitle string `json:"header_title"` +} +type IssuingCardDesignPreferences struct { + // Whether this card design is used to create cards when one is not specified. A connected account will use the Connect platform's default if no card design is set as the account default. + AccountDefault bool `json:"account_default"` + // Whether this card design is used to create cards when one is not specified and an account default for this connected account does not exist. + PlatformDefault bool `json:"platform_default"` +} +type IssuingCardDesignRejectionReasons struct { + // The reason(s) the card logo was rejected. + CardLogo []IssuingCardDesignRejectionReasonsCardLogo `json:"card_logo"` + // The reason(s) the carrier text was rejected. + CarrierText []IssuingCardDesignRejectionReasonsCarrierText `json:"carrier_text"` +} + // A Card Design is a logical grouping of a Card Bundle, card logo, and carrier text that represents a product line. type IssuingCardDesign struct { APIResource // The card bundle object belonging to this card design. CardBundle *IssuingCardBundle `json:"card_bundle"` + // The file for the card logo, for use with card bundles that support card logos. + CardLogo *File `json:"card_logo"` + // Hash containing carrier text, for use with card bundles that support carrier text. + CarrierText *IssuingCardDesignCarrierText `json:"carrier_text"` // Unique identifier for the object. ID string `json:"id"` // A lookup key used to retrieve card designs dynamically from a static string. This may be up to 200 characters. @@ -92,9 +171,9 @@ type IssuingCardDesign struct { // Friendly display name. Name string `json:"name"` // String representing the object's type. Objects of the same type share the same value. - Object string `json:"object"` - // Whether this card design is used to create cards when one is not specified. - Preference IssuingCardDesignPreference `json:"preference"` + Object string `json:"object"` + Preferences *IssuingCardDesignPreferences `json:"preferences"` + RejectionReasons *IssuingCardDesignRejectionReasons `json:"rejection_reasons"` // Whether this card design can be used to create cards. Status IssuingCardDesignStatus `json:"status"` } diff --git a/issuing_transaction.go b/issuing_transaction.go index 3d7e8d4423..ee01e12c61 100644 --- a/issuing_transaction.go +++ b/issuing_transaction.go @@ -97,6 +97,8 @@ func (p *IssuingTransactionParams) AddMetadata(key string, value string) { type IssuingTransactionAmountDetails struct { // The fee charged by the ATM for the cash withdrawal. ATMFee int64 `json:"atm_fee"` + // The amount of cash requested by the cardholder. + CashbackAmount int64 `json:"cashback_amount"` } // Details about the transaction, such as processing dates, set by the card network. diff --git a/order.go b/order.go index cae2b32b51..cfe0066eac 100644 --- a/order.go +++ b/order.go @@ -745,8 +745,7 @@ type OrderPaymentSettingsPaymentMethodOptionsAfterpayClearpayParams struct { // // If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. CaptureMethod *string `form:"capture_method"` - // Order identifier shown to the customer in Afterpay's online portal. We recommend using a value that helps you answer any questions a customer might have about - // the payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. + // An internal identifier or reference this payment corresponds to. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. Reference *string `form:"reference"` // Indicates that you intend to make future payments with the payment method. // diff --git a/paymentintent.go b/paymentintent.go index 785f36bcc3..7e5be348b7 100644 --- a/paymentintent.go +++ b/paymentintent.go @@ -1863,6 +1863,10 @@ type PaymentIntentParams struct { // Set to `true` to attempt to [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent immediately. This parameter defaults to `false`. When creating and confirming a PaymentIntent at the same time, parameters available in the [confirm](https://stripe.com/docs/api/payment_intents/confirm) API may also be provided. Confirm *bool `form:"confirm"` ConfirmationMethod *string `form:"confirmation_method"` + // ID of the ConfirmationToken used to confirm this PaymentIntent. + // + // If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. + ConfirmationToken *string `form:"confirmation_token"` // 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 *string `form:"currency"` // ID of the Customer this PaymentIntent belongs to, if one exists. @@ -2117,6 +2121,10 @@ type PaymentIntentConfirmParams struct { ApplicationFeeAmount *int64 `form:"application_fee_amount"` // Controls when the funds will be captured from the customer's account. CaptureMethod *string `form:"capture_method"` + // ID of the ConfirmationToken used to confirm this PaymentIntent. + // + // If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. + ConfirmationToken *string `form:"confirmation_token"` // Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. This parameter is intended for simpler integrations that do not handle customer actions, like [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). ErrorOnRequiresAction *bool `form:"error_on_requires_action"` // Specifies which fields in the response should be expanded. diff --git a/setupintent.go b/setupintent.go index 3551b45805..00324678e8 100644 --- a/setupintent.go +++ b/setupintent.go @@ -688,6 +688,10 @@ type SetupIntentParams struct { 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. Confirm *bool `form:"confirm"` + // ID of the ConfirmationToken used to confirm this SetupIntent. + // + // If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. + ConfirmationToken *string `form:"confirmation_token"` // ID of the Customer this SetupIntent belongs to, if one exists. // // If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent. @@ -1040,6 +1044,10 @@ func (p *SetupIntentConfirmPaymentMethodDataParams) AddMetadata(key string, valu // confirmation limit is reached. type SetupIntentConfirmParams struct { Params `form:"*"` + // ID of the ConfirmationToken used to confirm this SetupIntent. + // + // If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. + ConfirmationToken *string `form:"confirmation_token"` // Specifies which fields in the response should be expanded. Expand []*string `form:"expand"` // This hash contains details about the Mandate to create diff --git a/stripe.go b/stripe.go index b9ad408158..bb74b06658 100644 --- a/stripe.go +++ b/stripe.go @@ -489,7 +489,7 @@ func (s *BackendImplementation) NewRequest(method, path, key, contentType string req.Header.Add("Content-Type", contentType) req.Header.Add("Stripe-Version", APIVersion) req.Header.Add("User-Agent", encodedUserAgent) - req.Header.Add("X-Stripe-Client-User-Agent", encodedStripeUserAgent) + req.Header.Add("X-Stripe-Client-User-Agent", getEncodedStripeUserAgent()) if params != nil { if params.Context != nil { @@ -1352,6 +1352,7 @@ type requestTelemetry struct { var appInfo *AppInfo var backends Backends var encodedStripeUserAgent string +var encodedStripeUserAgentReady *sync.Once var encodedUserAgent string // The default HTTP client used for communication with any of Stripe's @@ -1433,22 +1434,28 @@ func initUserAgent() { if appInfo != nil { encodedUserAgent += " " + appInfo.formatUserAgent() } + encodedStripeUserAgentReady = &sync.Once{} +} - stripeUserAgent := &stripeClientUserAgent{ - Application: appInfo, - BindingsVersion: clientversion, - Language: "go", - LanguageVersion: runtime.Version(), - Publisher: "stripe", - Uname: getUname(), - } - marshaled, err := json.Marshal(stripeUserAgent) - // Encoding this struct should never be a problem, so we're okay to panic - // in case it is for some reason. - if err != nil { - panic(err) - } - encodedStripeUserAgent = string(marshaled) +func getEncodedStripeUserAgent() string { + encodedStripeUserAgentReady.Do(func() { + stripeUserAgent := &stripeClientUserAgent{ + Application: appInfo, + BindingsVersion: clientversion, + Language: "go", + LanguageVersion: runtime.Version(), + Publisher: "stripe", + Uname: getUname(), + } + marshaled, err := json.Marshal(stripeUserAgent) + // Encoding this struct should never be a problem, so we're okay to panic + // in case it is for some reason. + if err != nil { + panic(err) + } + encodedStripeUserAgent = string(marshaled) + }) + return encodedStripeUserAgent } func isHTTPWriteMethod(method string) bool { diff --git a/taxid.go b/taxid.go index 04df07e045..167d64df50 100644 --- a/taxid.go +++ b/taxid.go @@ -93,7 +93,7 @@ const ( TaxIDVerificationStatusVerified TaxIDVerificationStatus = "verified" ) -// Creates a new TaxID object for a customer. +// Creates a new tax_id object for a customer. type TaxIDParams struct { Params `form:"*"` Customer *string `form:"-"` // Included in URL diff --git a/terminal_reader.go b/terminal_reader.go index 7e12d2ac14..56192e575c 100644 --- a/terminal_reader.go +++ b/terminal_reader.go @@ -121,6 +121,8 @@ type TerminalReaderListParams struct { Expand []*string `form:"expand"` // A location ID to filter the response list to only readers at the specific location Location *string `form:"location"` + // Filters readers by serial number + SerialNumber *string `form:"serial_number"` // A status filter to filter readers to only offline or online readers Status *string `form:"status"` } diff --git a/testhelpers/issuing/authorization/client.go b/testhelpers/issuing/authorization/client.go new file mode 100644 index 0000000000..eb10b9c611 --- /dev/null +++ b/testhelpers/issuing/authorization/client.go @@ -0,0 +1,106 @@ +// +// +// File generated from our OpenAPI spec +// +// + +// Package authorization provides the /issuing/authorizations APIs +package authorization + +import ( + "net/http" + + stripe "github.com/stripe/stripe-go/v75" +) + +// Client is used to invoke /issuing/authorizations APIs. +type Client struct { + B stripe.Backend + Key string +} + +// New creates a new issuing authorization. +func New(params *stripe.TestHelpersIssuingAuthorizationParams) (*stripe.IssuingAuthorization, error) { + return getC().New(params) +} + +// New creates a new issuing authorization. +func (c Client) New(params *stripe.TestHelpersIssuingAuthorizationParams) (*stripe.IssuingAuthorization, error) { + authorization := &stripe.IssuingAuthorization{} + err := c.B.Call( + http.MethodPost, + "/v1/test_helpers/issuing/authorizations", + c.Key, + params, + authorization, + ) + return authorization, err +} + +// Capture is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/capture` API. +func Capture(id string, params *stripe.TestHelpersIssuingAuthorizationCaptureParams) (*stripe.IssuingAuthorization, error) { + return getC().Capture(id, params) +} + +// Capture is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/capture` API. +func (c Client) Capture(id string, params *stripe.TestHelpersIssuingAuthorizationCaptureParams) (*stripe.IssuingAuthorization, error) { + path := stripe.FormatURLPath( + "/v1/test_helpers/issuing/authorizations/%s/capture", + id, + ) + authorization := &stripe.IssuingAuthorization{} + err := c.B.Call(http.MethodPost, path, c.Key, params, authorization) + return authorization, err +} + +// Expire is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/expire` API. +func Expire(id string, params *stripe.TestHelpersIssuingAuthorizationExpireParams) (*stripe.IssuingAuthorization, error) { + return getC().Expire(id, params) +} + +// Expire is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/expire` API. +func (c Client) Expire(id string, params *stripe.TestHelpersIssuingAuthorizationExpireParams) (*stripe.IssuingAuthorization, error) { + path := stripe.FormatURLPath( + "/v1/test_helpers/issuing/authorizations/%s/expire", + id, + ) + authorization := &stripe.IssuingAuthorization{} + err := c.B.Call(http.MethodPost, path, c.Key, params, authorization) + return authorization, err +} + +// Increment is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/increment` API. +func Increment(id string, params *stripe.TestHelpersIssuingAuthorizationIncrementParams) (*stripe.IssuingAuthorization, error) { + return getC().Increment(id, params) +} + +// Increment is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/increment` API. +func (c Client) Increment(id string, params *stripe.TestHelpersIssuingAuthorizationIncrementParams) (*stripe.IssuingAuthorization, error) { + path := stripe.FormatURLPath( + "/v1/test_helpers/issuing/authorizations/%s/increment", + id, + ) + authorization := &stripe.IssuingAuthorization{} + err := c.B.Call(http.MethodPost, path, c.Key, params, authorization) + return authorization, err +} + +// Reverse is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/reverse` API. +func Reverse(id string, params *stripe.TestHelpersIssuingAuthorizationReverseParams) (*stripe.IssuingAuthorization, error) { + return getC().Reverse(id, params) +} + +// Reverse is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/reverse` API. +func (c Client) Reverse(id string, params *stripe.TestHelpersIssuingAuthorizationReverseParams) (*stripe.IssuingAuthorization, error) { + path := stripe.FormatURLPath( + "/v1/test_helpers/issuing/authorizations/%s/reverse", + id, + ) + authorization := &stripe.IssuingAuthorization{} + err := c.B.Call(http.MethodPost, path, c.Key, params, authorization) + return authorization, err +} + +func getC() Client { + return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key} +} diff --git a/testhelpers/issuing/carddesign/client.go b/testhelpers/issuing/carddesign/client.go index 2b5b0077d3..e422ed587a 100644 --- a/testhelpers/issuing/carddesign/client.go +++ b/testhelpers/issuing/carddesign/client.go @@ -51,6 +51,22 @@ func (c Client) DeactivateTestmode(id string, params *stripe.TestHelpersIssuingC return carddesign, err } +// RejectTestmode is the method for the `POST /v1/test_helpers/issuing/card_designs/{card_design}/status/reject` API. +func RejectTestmode(id string, params *stripe.TestHelpersIssuingCardDesignRejectTestmodeParams) (*stripe.IssuingCardDesign, error) { + return getC().RejectTestmode(id, params) +} + +// RejectTestmode is the method for the `POST /v1/test_helpers/issuing/card_designs/{card_design}/status/reject` API. +func (c Client) RejectTestmode(id string, params *stripe.TestHelpersIssuingCardDesignRejectTestmodeParams) (*stripe.IssuingCardDesign, error) { + path := stripe.FormatURLPath( + "/v1/test_helpers/issuing/card_designs/%s/status/reject", + id, + ) + carddesign := &stripe.IssuingCardDesign{} + err := c.B.Call(http.MethodPost, path, c.Key, params, carddesign) + return carddesign, err +} + func getC() Client { return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key} } diff --git a/testhelpers/issuing/transaction/client.go b/testhelpers/issuing/transaction/client.go new file mode 100644 index 0000000000..df947fc4e9 --- /dev/null +++ b/testhelpers/issuing/transaction/client.go @@ -0,0 +1,76 @@ +// +// +// File generated from our OpenAPI spec +// +// + +// Package transaction provides the /issuing/transactions APIs +package transaction + +import ( + "net/http" + + stripe "github.com/stripe/stripe-go/v75" +) + +// Client is used to invoke /issuing/transactions APIs. +type Client struct { + B stripe.Backend + Key string +} + +// CreateForceCapture is the method for the `POST /v1/test_helpers/issuing/transactions/create_force_capture` API. +func CreateForceCapture(params *stripe.TestHelpersIssuingTransactionCreateForceCaptureParams) (*stripe.IssuingTransaction, error) { + return getC().CreateForceCapture(params) +} + +// CreateForceCapture is the method for the `POST /v1/test_helpers/issuing/transactions/create_force_capture` API. +func (c Client) CreateForceCapture(params *stripe.TestHelpersIssuingTransactionCreateForceCaptureParams) (*stripe.IssuingTransaction, error) { + transaction := &stripe.IssuingTransaction{} + err := c.B.Call( + http.MethodPost, + "/v1/test_helpers/issuing/transactions/create_force_capture", + c.Key, + params, + transaction, + ) + return transaction, err +} + +// CreateUnlinkedRefund is the method for the `POST /v1/test_helpers/issuing/transactions/create_unlinked_refund` API. +func CreateUnlinkedRefund(params *stripe.TestHelpersIssuingTransactionCreateUnlinkedRefundParams) (*stripe.IssuingTransaction, error) { + return getC().CreateUnlinkedRefund(params) +} + +// CreateUnlinkedRefund is the method for the `POST /v1/test_helpers/issuing/transactions/create_unlinked_refund` API. +func (c Client) CreateUnlinkedRefund(params *stripe.TestHelpersIssuingTransactionCreateUnlinkedRefundParams) (*stripe.IssuingTransaction, error) { + transaction := &stripe.IssuingTransaction{} + err := c.B.Call( + http.MethodPost, + "/v1/test_helpers/issuing/transactions/create_unlinked_refund", + c.Key, + params, + transaction, + ) + return transaction, err +} + +// Refund is the method for the `POST /v1/test_helpers/issuing/transactions/{transaction}/refund` API. +func Refund(id string, params *stripe.TestHelpersIssuingTransactionRefundParams) (*stripe.IssuingTransaction, error) { + return getC().Refund(id, params) +} + +// Refund is the method for the `POST /v1/test_helpers/issuing/transactions/{transaction}/refund` API. +func (c Client) Refund(id string, params *stripe.TestHelpersIssuingTransactionRefundParams) (*stripe.IssuingTransaction, error) { + path := stripe.FormatURLPath( + "/v1/test_helpers/issuing/transactions/%s/refund", + id, + ) + transaction := &stripe.IssuingTransaction{} + err := c.B.Call(http.MethodPost, path, c.Key, params, transaction) + return transaction, err +} + +func getC() Client { + return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key} +} diff --git a/testhelpersissuing_authorization.go b/testhelpersissuing_authorization.go new file mode 100644 index 0000000000..e146e4170b --- /dev/null +++ b/testhelpersissuing_authorization.go @@ -0,0 +1,226 @@ +// +// +// File generated from our OpenAPI spec +// +// + +package stripe + +// Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). +type TestHelpersIssuingAuthorizationAmountDetailsParams struct { + // The ATM withdrawal fee. + ATMFee *int64 `form:"atm_fee"` + // The amount of cash requested by the cardholder. + CashbackAmount *int64 `form:"cashback_amount"` +} + +// Details about the seller (grocery store, e-commerce website, etc.) where the card authorization happened. +type TestHelpersIssuingAuthorizationMerchantDataParams struct { + // A categorization of the seller's type of business. See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. + Category *string `form:"category"` + // City where the seller is located + City *string `form:"city"` + // Country where the seller is located + Country *string `form:"country"` + // Name of the seller + Name *string `form:"name"` + // Identifier assigned to the seller by the card network. Different card networks may assign different network_id fields to the same merchant. + NetworkID *string `form:"network_id"` + // Postal code where the seller is located + PostalCode *string `form:"postal_code"` + // State where the seller is located + State *string `form:"state"` + // An ID assigned by the seller to the location of the sale. + TerminalID *string `form:"terminal_id"` + URL *string `form:"url"` +} + +// Details about the authorization, such as identifiers, set by the card network. +type TestHelpersIssuingAuthorizationNetworkDataParams struct { + // Identifier assigned to the acquirer by the card network. + AcquiringInstitutionID *string `form:"acquiring_institution_id"` +} + +// 3D Secure details. +type TestHelpersIssuingAuthorizationVerificationDataThreeDSecureParams struct { + // The outcome of the 3D Secure authentication request. + Result *string `form:"result"` +} + +// Verifications that Stripe performed on information that the cardholder provided to the merchant. +type TestHelpersIssuingAuthorizationVerificationDataParams struct { + // Whether the cardholder provided an address first line and if it matched the cardholder's `billing.address.line1`. + AddressLine1Check *string `form:"address_line1_check"` + // Whether the cardholder provided a postal code and if it matched the cardholder's `billing.address.postal_code`. + AddressPostalCodeCheck *string `form:"address_postal_code_check"` + // Whether the cardholder provided a CVC and if it matched Stripe's record. + CVCCheck *string `form:"cvc_check"` + // Whether the cardholder provided an expiry date and if it matched Stripe's record. + ExpiryCheck *string `form:"expiry_check"` + // 3D Secure details. + ThreeDSecure *TestHelpersIssuingAuthorizationVerificationDataThreeDSecureParams `form:"three_d_secure"` +} + +// Create a test-mode authorization. +type TestHelpersIssuingAuthorizationParams struct { + Params `form:"*"` + // The total amount to attempt to authorize. This amount is in the provided currency, or defaults to the cards currency, and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + Amount *int64 `form:"amount"` + // Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + AmountDetails *TestHelpersIssuingAuthorizationAmountDetailsParams `form:"amount_details"` + // How the card details were provided. Defaults to online. + AuthorizationMethod *string `form:"authorization_method"` + // Card associated with this authorization. + Card *string `form:"card"` + // The currency of the authorization. If not provided, defaults to the currency of the card. 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 *string `form:"currency"` + // Specifies which fields in the response should be expanded. + Expand []*string `form:"expand"` + // If set `true`, you may provide [amount](https://stripe.com/docs/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization. + IsAmountControllable *bool `form:"is_amount_controllable"` + // Details about the seller (grocery store, e-commerce website, etc.) where the card authorization happened. + MerchantData *TestHelpersIssuingAuthorizationMerchantDataParams `form:"merchant_data"` + // Details about the authorization, such as identifiers, set by the card network. + NetworkData *TestHelpersIssuingAuthorizationNetworkDataParams `form:"network_data"` + // Verifications that Stripe performed on information that the cardholder provided to the merchant. + VerificationData *TestHelpersIssuingAuthorizationVerificationDataParams `form:"verification_data"` + // The digital wallet used for this transaction. One of `apple_pay`, `google_pay`, or `samsung_pay`. Will populate as `null` when no digital wallet was utilized. + Wallet *string `form:"wallet"` +} + +// AddExpand appends a new field to expand. +func (p *TestHelpersIssuingAuthorizationParams) AddExpand(f string) { + p.Expand = append(p.Expand, &f) +} + +// Increment a test-mode Authorization. +type TestHelpersIssuingAuthorizationIncrementParams struct { + Params `form:"*"` + // Specifies which fields in the response should be expanded. + Expand []*string `form:"expand"` + // The amount to increment the authorization by. This amount is in the authorization currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + IncrementAmount *int64 `form:"increment_amount"` + // If set `true`, you may provide [amount](https://stripe.com/docs/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization. + IsAmountControllable *bool `form:"is_amount_controllable"` +} + +// AddExpand appends a new field to expand. +func (p *TestHelpersIssuingAuthorizationIncrementParams) AddExpand(f string) { + p.Expand = append(p.Expand, &f) +} + +// Reverse a test-mode Authorization. +type TestHelpersIssuingAuthorizationReverseParams struct { + Params `form:"*"` + // Specifies which fields in the response should be expanded. + Expand []*string `form:"expand"` + // The amount to reverse from the authorization. If not provided, the full amount of the authorization will be reversed. This amount is in the authorization currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + ReverseAmount *int64 `form:"reverse_amount"` +} + +// AddExpand appends a new field to expand. +func (p *TestHelpersIssuingAuthorizationReverseParams) AddExpand(f string) { + p.Expand = append(p.Expand, &f) +} + +// Expire a test-mode Authorization. +type TestHelpersIssuingAuthorizationExpireParams 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 *TestHelpersIssuingAuthorizationExpireParams) AddExpand(f string) { + p.Expand = append(p.Expand, &f) +} + +// The legs of the trip. +type TestHelpersIssuingAuthorizationCapturePurchaseDetailsFlightSegmentParams struct { + // The three-letter IATA airport code of the flight's destination. + ArrivalAirportCode *string `form:"arrival_airport_code"` + // The airline carrier code. + Carrier *string `form:"carrier"` + // The three-letter IATA airport code that the flight departed from. + DepartureAirportCode *string `form:"departure_airport_code"` + // The flight number. + FlightNumber *string `form:"flight_number"` + // The flight's service class. + ServiceClass *string `form:"service_class"` + // Whether a stopover is allowed on this flight. + StopoverAllowed *bool `form:"stopover_allowed"` +} + +// Information about the flight that was purchased with this transaction. +type TestHelpersIssuingAuthorizationCapturePurchaseDetailsFlightParams struct { + // The time that the flight departed. + DepartureAt *int64 `form:"departure_at"` + // The name of the passenger. + PassengerName *string `form:"passenger_name"` + // Whether the ticket is refundable. + Refundable *bool `form:"refundable"` + // The legs of the trip. + Segments []*TestHelpersIssuingAuthorizationCapturePurchaseDetailsFlightSegmentParams `form:"segments"` + // The travel agency that issued the ticket. + TravelAgency *string `form:"travel_agency"` +} + +// Information about fuel that was purchased with this transaction. +type TestHelpersIssuingAuthorizationCapturePurchaseDetailsFuelParams struct { + // The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. + Type *string `form:"type"` + // The units for `volume_decimal`. One of `us_gallon` or `liter`. + Unit *string `form:"unit"` + // The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. + UnitCostDecimal *float64 `form:"unit_cost_decimal,high_precision"` + // The volume of the fuel that was pumped, represented as a decimal string with at most 12 decimal places. + VolumeDecimal *float64 `form:"volume_decimal,high_precision"` +} + +// Information about lodging that was purchased with this transaction. +type TestHelpersIssuingAuthorizationCapturePurchaseDetailsLodgingParams struct { + // The time of checking into the lodging. + CheckInAt *int64 `form:"check_in_at"` + // The number of nights stayed at the lodging. + Nights *int64 `form:"nights"` +} + +// The line items in the purchase. +type TestHelpersIssuingAuthorizationCapturePurchaseDetailsReceiptParams struct { + Description *string `form:"description"` + Quantity *float64 `form:"quantity,high_precision"` + Total *int64 `form:"total"` + UnitCost *int64 `form:"unit_cost"` +} + +// Additional purchase information that is optionally provided by the merchant. +type TestHelpersIssuingAuthorizationCapturePurchaseDetailsParams struct { + // Information about the flight that was purchased with this transaction. + Flight *TestHelpersIssuingAuthorizationCapturePurchaseDetailsFlightParams `form:"flight"` + // Information about fuel that was purchased with this transaction. + Fuel *TestHelpersIssuingAuthorizationCapturePurchaseDetailsFuelParams `form:"fuel"` + // Information about lodging that was purchased with this transaction. + Lodging *TestHelpersIssuingAuthorizationCapturePurchaseDetailsLodgingParams `form:"lodging"` + // The line items in the purchase. + Receipt []*TestHelpersIssuingAuthorizationCapturePurchaseDetailsReceiptParams `form:"receipt"` + // A merchant-specific order number. + Reference *string `form:"reference"` +} + +// Capture a test-mode authorization. +type TestHelpersIssuingAuthorizationCaptureParams struct { + Params `form:"*"` + // The amount to capture from the authorization. If not provided, the full amount of the authorization will be captured. This amount is in the authorization currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + CaptureAmount *int64 `form:"capture_amount"` + // Whether to close the authorization after capture. Defaults to true. Set to false to enable multi-capture flows. + CloseAuthorization *bool `form:"close_authorization"` + // Specifies which fields in the response should be expanded. + Expand []*string `form:"expand"` + // Additional purchase information that is optionally provided by the merchant. + PurchaseDetails *TestHelpersIssuingAuthorizationCapturePurchaseDetailsParams `form:"purchase_details"` +} + +// AddExpand appends a new field to expand. +func (p *TestHelpersIssuingAuthorizationCaptureParams) AddExpand(f string) { + p.Expand = append(p.Expand, &f) +} diff --git a/testhelpersissuing_carddesign.go b/testhelpersissuing_carddesign.go index e4bc3e6f4c..06a141072b 100644 --- a/testhelpersissuing_carddesign.go +++ b/testhelpersissuing_carddesign.go @@ -29,3 +29,25 @@ type TestHelpersIssuingCardDesignDeactivateTestmodeParams struct { func (p *TestHelpersIssuingCardDesignDeactivateTestmodeParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } + +// The reason(s) the card design was rejected. +type TestHelpersIssuingCardDesignRejectTestmodeRejectionReasonsParams struct { + // The reason(s) the card logo was rejected. + CardLogo []*string `form:"card_logo"` + // The reason(s) the carrier text was rejected. + CarrierText []*string `form:"carrier_text"` +} + +// Updates the status of the specified testmode card design object to rejected. +type TestHelpersIssuingCardDesignRejectTestmodeParams struct { + Params `form:"*"` + // Specifies which fields in the response should be expanded. + Expand []*string `form:"expand"` + // The reason(s) the card design was rejected. + RejectionReasons *TestHelpersIssuingCardDesignRejectTestmodeRejectionReasonsParams `form:"rejection_reasons"` +} + +// AddExpand appends a new field to expand. +func (p *TestHelpersIssuingCardDesignRejectTestmodeParams) AddExpand(f string) { + p.Expand = append(p.Expand, &f) +} diff --git a/testhelpersissuing_transaction.go b/testhelpersissuing_transaction.go new file mode 100644 index 0000000000..f45824c6a5 --- /dev/null +++ b/testhelpersissuing_transaction.go @@ -0,0 +1,251 @@ +// +// +// File generated from our OpenAPI spec +// +// + +package stripe + +// Details about the seller (grocery store, e-commerce website, etc.) where the card authorization happened. +type TestHelpersIssuingTransactionCreateForceCaptureMerchantDataParams struct { + // A categorization of the seller's type of business. See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. + Category *string `form:"category"` + // City where the seller is located + City *string `form:"city"` + // Country where the seller is located + Country *string `form:"country"` + // Name of the seller + Name *string `form:"name"` + // Identifier assigned to the seller by the card network. Different card networks may assign different network_id fields to the same merchant. + NetworkID *string `form:"network_id"` + // Postal code where the seller is located + PostalCode *string `form:"postal_code"` + // State where the seller is located + State *string `form:"state"` + // An ID assigned by the seller to the location of the sale. + TerminalID *string `form:"terminal_id"` + URL *string `form:"url"` +} + +// The legs of the trip. +type TestHelpersIssuingTransactionCreateForceCapturePurchaseDetailsFlightSegmentParams struct { + // The three-letter IATA airport code of the flight's destination. + ArrivalAirportCode *string `form:"arrival_airport_code"` + // The airline carrier code. + Carrier *string `form:"carrier"` + // The three-letter IATA airport code that the flight departed from. + DepartureAirportCode *string `form:"departure_airport_code"` + // The flight number. + FlightNumber *string `form:"flight_number"` + // The flight's service class. + ServiceClass *string `form:"service_class"` + // Whether a stopover is allowed on this flight. + StopoverAllowed *bool `form:"stopover_allowed"` +} + +// Information about the flight that was purchased with this transaction. +type TestHelpersIssuingTransactionCreateForceCapturePurchaseDetailsFlightParams struct { + // The time that the flight departed. + DepartureAt *int64 `form:"departure_at"` + // The name of the passenger. + PassengerName *string `form:"passenger_name"` + // Whether the ticket is refundable. + Refundable *bool `form:"refundable"` + // The legs of the trip. + Segments []*TestHelpersIssuingTransactionCreateForceCapturePurchaseDetailsFlightSegmentParams `form:"segments"` + // The travel agency that issued the ticket. + TravelAgency *string `form:"travel_agency"` +} + +// Information about fuel that was purchased with this transaction. +type TestHelpersIssuingTransactionCreateForceCapturePurchaseDetailsFuelParams struct { + // The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. + Type *string `form:"type"` + // The units for `volume_decimal`. One of `us_gallon` or `liter`. + Unit *string `form:"unit"` + // The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. + UnitCostDecimal *float64 `form:"unit_cost_decimal,high_precision"` + // The volume of the fuel that was pumped, represented as a decimal string with at most 12 decimal places. + VolumeDecimal *float64 `form:"volume_decimal,high_precision"` +} + +// Information about lodging that was purchased with this transaction. +type TestHelpersIssuingTransactionCreateForceCapturePurchaseDetailsLodgingParams struct { + // The time of checking into the lodging. + CheckInAt *int64 `form:"check_in_at"` + // The number of nights stayed at the lodging. + Nights *int64 `form:"nights"` +} + +// The line items in the purchase. +type TestHelpersIssuingTransactionCreateForceCapturePurchaseDetailsReceiptParams struct { + Description *string `form:"description"` + Quantity *float64 `form:"quantity,high_precision"` + Total *int64 `form:"total"` + UnitCost *int64 `form:"unit_cost"` +} + +// Additional purchase information that is optionally provided by the merchant. +type TestHelpersIssuingTransactionCreateForceCapturePurchaseDetailsParams struct { + // Information about the flight that was purchased with this transaction. + Flight *TestHelpersIssuingTransactionCreateForceCapturePurchaseDetailsFlightParams `form:"flight"` + // Information about fuel that was purchased with this transaction. + Fuel *TestHelpersIssuingTransactionCreateForceCapturePurchaseDetailsFuelParams `form:"fuel"` + // Information about lodging that was purchased with this transaction. + Lodging *TestHelpersIssuingTransactionCreateForceCapturePurchaseDetailsLodgingParams `form:"lodging"` + // The line items in the purchase. + Receipt []*TestHelpersIssuingTransactionCreateForceCapturePurchaseDetailsReceiptParams `form:"receipt"` + // A merchant-specific order number. + Reference *string `form:"reference"` +} + +// Allows the user to capture an arbitrary amount, also known as a forced capture. +type TestHelpersIssuingTransactionCreateForceCaptureParams struct { + Params `form:"*"` + // The total amount to attempt to capture. This amount is in the provided currency, or defaults to the cards currency, and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + Amount *int64 `form:"amount"` + // Card associated with this transaction. + Card *string `form:"card"` + // The currency of the capture. If not provided, defaults to the currency of the card. 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 *string `form:"currency"` + // Specifies which fields in the response should be expanded. + Expand []*string `form:"expand"` + // Details about the seller (grocery store, e-commerce website, etc.) where the card authorization happened. + MerchantData *TestHelpersIssuingTransactionCreateForceCaptureMerchantDataParams `form:"merchant_data"` + // Additional purchase information that is optionally provided by the merchant. + PurchaseDetails *TestHelpersIssuingTransactionCreateForceCapturePurchaseDetailsParams `form:"purchase_details"` +} + +// AddExpand appends a new field to expand. +func (p *TestHelpersIssuingTransactionCreateForceCaptureParams) AddExpand(f string) { + p.Expand = append(p.Expand, &f) +} + +// Details about the seller (grocery store, e-commerce website, etc.) where the card authorization happened. +type TestHelpersIssuingTransactionCreateUnlinkedRefundMerchantDataParams struct { + // A categorization of the seller's type of business. See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. + Category *string `form:"category"` + // City where the seller is located + City *string `form:"city"` + // Country where the seller is located + Country *string `form:"country"` + // Name of the seller + Name *string `form:"name"` + // Identifier assigned to the seller by the card network. Different card networks may assign different network_id fields to the same merchant. + NetworkID *string `form:"network_id"` + // Postal code where the seller is located + PostalCode *string `form:"postal_code"` + // State where the seller is located + State *string `form:"state"` + // An ID assigned by the seller to the location of the sale. + TerminalID *string `form:"terminal_id"` + URL *string `form:"url"` +} + +// The legs of the trip. +type TestHelpersIssuingTransactionCreateUnlinkedRefundPurchaseDetailsFlightSegmentParams struct { + // The three-letter IATA airport code of the flight's destination. + ArrivalAirportCode *string `form:"arrival_airport_code"` + // The airline carrier code. + Carrier *string `form:"carrier"` + // The three-letter IATA airport code that the flight departed from. + DepartureAirportCode *string `form:"departure_airport_code"` + // The flight number. + FlightNumber *string `form:"flight_number"` + // The flight's service class. + ServiceClass *string `form:"service_class"` + // Whether a stopover is allowed on this flight. + StopoverAllowed *bool `form:"stopover_allowed"` +} + +// Information about the flight that was purchased with this transaction. +type TestHelpersIssuingTransactionCreateUnlinkedRefundPurchaseDetailsFlightParams struct { + // The time that the flight departed. + DepartureAt *int64 `form:"departure_at"` + // The name of the passenger. + PassengerName *string `form:"passenger_name"` + // Whether the ticket is refundable. + Refundable *bool `form:"refundable"` + // The legs of the trip. + Segments []*TestHelpersIssuingTransactionCreateUnlinkedRefundPurchaseDetailsFlightSegmentParams `form:"segments"` + // The travel agency that issued the ticket. + TravelAgency *string `form:"travel_agency"` +} + +// Information about fuel that was purchased with this transaction. +type TestHelpersIssuingTransactionCreateUnlinkedRefundPurchaseDetailsFuelParams struct { + // The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. + Type *string `form:"type"` + // The units for `volume_decimal`. One of `us_gallon` or `liter`. + Unit *string `form:"unit"` + // The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. + UnitCostDecimal *float64 `form:"unit_cost_decimal,high_precision"` + // The volume of the fuel that was pumped, represented as a decimal string with at most 12 decimal places. + VolumeDecimal *float64 `form:"volume_decimal,high_precision"` +} + +// Information about lodging that was purchased with this transaction. +type TestHelpersIssuingTransactionCreateUnlinkedRefundPurchaseDetailsLodgingParams struct { + // The time of checking into the lodging. + CheckInAt *int64 `form:"check_in_at"` + // The number of nights stayed at the lodging. + Nights *int64 `form:"nights"` +} + +// The line items in the purchase. +type TestHelpersIssuingTransactionCreateUnlinkedRefundPurchaseDetailsReceiptParams struct { + Description *string `form:"description"` + Quantity *float64 `form:"quantity,high_precision"` + Total *int64 `form:"total"` + UnitCost *int64 `form:"unit_cost"` +} + +// Additional purchase information that is optionally provided by the merchant. +type TestHelpersIssuingTransactionCreateUnlinkedRefundPurchaseDetailsParams struct { + // Information about the flight that was purchased with this transaction. + Flight *TestHelpersIssuingTransactionCreateUnlinkedRefundPurchaseDetailsFlightParams `form:"flight"` + // Information about fuel that was purchased with this transaction. + Fuel *TestHelpersIssuingTransactionCreateUnlinkedRefundPurchaseDetailsFuelParams `form:"fuel"` + // Information about lodging that was purchased with this transaction. + Lodging *TestHelpersIssuingTransactionCreateUnlinkedRefundPurchaseDetailsLodgingParams `form:"lodging"` + // The line items in the purchase. + Receipt []*TestHelpersIssuingTransactionCreateUnlinkedRefundPurchaseDetailsReceiptParams `form:"receipt"` + // A merchant-specific order number. + Reference *string `form:"reference"` +} + +// Allows the user to refund an arbitrary amount, also known as a unlinked refund. +type TestHelpersIssuingTransactionCreateUnlinkedRefundParams struct { + Params `form:"*"` + // The total amount to attempt to refund. This amount is in the provided currency, or defaults to the cards currency, and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + Amount *int64 `form:"amount"` + // Card associated with this unlinked refund transaction. + Card *string `form:"card"` + // The currency of the unlinked refund. If not provided, defaults to the currency of the card. 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 *string `form:"currency"` + // Specifies which fields in the response should be expanded. + Expand []*string `form:"expand"` + // Details about the seller (grocery store, e-commerce website, etc.) where the card authorization happened. + MerchantData *TestHelpersIssuingTransactionCreateUnlinkedRefundMerchantDataParams `form:"merchant_data"` + // Additional purchase information that is optionally provided by the merchant. + PurchaseDetails *TestHelpersIssuingTransactionCreateUnlinkedRefundPurchaseDetailsParams `form:"purchase_details"` +} + +// AddExpand appends a new field to expand. +func (p *TestHelpersIssuingTransactionCreateUnlinkedRefundParams) AddExpand(f string) { + p.Expand = append(p.Expand, &f) +} + +// Refund a test-mode Transaction. +type TestHelpersIssuingTransactionRefundParams struct { + Params `form:"*"` + // Specifies which fields in the response should be expanded. + Expand []*string `form:"expand"` + // The total amount to attempt to refund. This amount is in the provided currency, or defaults to the cards currency, and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + RefundAmount *int64 `form:"refund_amount"` +} + +// AddExpand appends a new field to expand. +func (p *TestHelpersIssuingTransactionRefundParams) AddExpand(f string) { + p.Expand = append(p.Expand, &f) +} diff --git a/treasury_financialaccount.go b/treasury_financialaccount.go index 59aaf44356..cc64b8369f 100644 --- a/treasury_financialaccount.go +++ b/treasury_financialaccount.go @@ -159,7 +159,7 @@ type TreasuryFinancialAccountFeaturesOutboundPaymentsACHParams struct { Requested *bool `form:"requested"` } -// Enables US domestic wire tranfers via the OutboundPayments API. +// Enables US domestic wire transfers via the OutboundPayments API. type TreasuryFinancialAccountFeaturesOutboundPaymentsUSDomesticWireParams struct { // Whether the FinancialAccount should have the Feature. Requested *bool `form:"requested"` @@ -169,7 +169,7 @@ type TreasuryFinancialAccountFeaturesOutboundPaymentsUSDomesticWireParams struct type TreasuryFinancialAccountFeaturesOutboundPaymentsParams struct { // Enables ACH transfers via the OutboundPayments API. ACH *TreasuryFinancialAccountFeaturesOutboundPaymentsACHParams `form:"ach"` - // Enables US domestic wire tranfers via the OutboundPayments API. + // Enables US domestic wire transfers via the OutboundPayments API. USDomesticWire *TreasuryFinancialAccountFeaturesOutboundPaymentsUSDomesticWireParams `form:"us_domestic_wire"` } @@ -179,7 +179,7 @@ type TreasuryFinancialAccountFeaturesOutboundTransfersACHParams struct { Requested *bool `form:"requested"` } -// Enables US domestic wire tranfers via the OutboundTransfers API. +// Enables US domestic wire transfers via the OutboundTransfers API. type TreasuryFinancialAccountFeaturesOutboundTransfersUSDomesticWireParams struct { // Whether the FinancialAccount should have the Feature. Requested *bool `form:"requested"` @@ -189,7 +189,7 @@ type TreasuryFinancialAccountFeaturesOutboundTransfersUSDomesticWireParams struc type TreasuryFinancialAccountFeaturesOutboundTransfersParams struct { // Enables ACH transfers via the OutboundTransfers API. ACH *TreasuryFinancialAccountFeaturesOutboundTransfersACHParams `form:"ach"` - // Enables US domestic wire tranfers via the OutboundTransfers API. + // Enables US domestic wire transfers via the OutboundTransfers API. USDomesticWire *TreasuryFinancialAccountFeaturesOutboundTransfersUSDomesticWireParams `form:"us_domestic_wire"` } @@ -310,7 +310,7 @@ type TreasuryFinancialAccountUpdateFeaturesOutboundPaymentsACHParams struct { Requested *bool `form:"requested"` } -// Enables US domestic wire tranfers via the OutboundPayments API. +// Enables US domestic wire transfers via the OutboundPayments API. type TreasuryFinancialAccountUpdateFeaturesOutboundPaymentsUSDomesticWireParams struct { // Whether the FinancialAccount should have the Feature. Requested *bool `form:"requested"` @@ -320,7 +320,7 @@ type TreasuryFinancialAccountUpdateFeaturesOutboundPaymentsUSDomesticWireParams type TreasuryFinancialAccountUpdateFeaturesOutboundPaymentsParams struct { // Enables ACH transfers via the OutboundPayments API. ACH *TreasuryFinancialAccountUpdateFeaturesOutboundPaymentsACHParams `form:"ach"` - // Enables US domestic wire tranfers via the OutboundPayments API. + // Enables US domestic wire transfers via the OutboundPayments API. USDomesticWire *TreasuryFinancialAccountUpdateFeaturesOutboundPaymentsUSDomesticWireParams `form:"us_domestic_wire"` } @@ -330,7 +330,7 @@ type TreasuryFinancialAccountUpdateFeaturesOutboundTransfersACHParams struct { Requested *bool `form:"requested"` } -// Enables US domestic wire tranfers via the OutboundTransfers API. +// Enables US domestic wire transfers via the OutboundTransfers API. type TreasuryFinancialAccountUpdateFeaturesOutboundTransfersUSDomesticWireParams struct { // Whether the FinancialAccount should have the Feature. Requested *bool `form:"requested"` @@ -340,7 +340,7 @@ type TreasuryFinancialAccountUpdateFeaturesOutboundTransfersUSDomesticWireParams type TreasuryFinancialAccountUpdateFeaturesOutboundTransfersParams struct { // Enables ACH transfers via the OutboundTransfers API. ACH *TreasuryFinancialAccountUpdateFeaturesOutboundTransfersACHParams `form:"ach"` - // Enables US domestic wire tranfers via the OutboundTransfers API. + // Enables US domestic wire transfers via the OutboundTransfers API. USDomesticWire *TreasuryFinancialAccountUpdateFeaturesOutboundTransfersUSDomesticWireParams `form:"us_domestic_wire"` }