diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b82082a9b8..16df63fef6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,10 +5,14 @@ on: branches: - master - beta + - sdk-release/** + - feature/** pull_request: branches: - master - beta + - sdk-release/** + - feature/** jobs: lint: diff --git a/CHANGELOG.md b/CHANGELOG.md index 96b488e4cc..8f3323ce66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,20 +1,43 @@ # Changelog +## 72.119.0 - 2022-07-12 +* [#1494](https://github.com/stripe/stripe-go/pull/1494) API Updates + * Add support for `CustomerDetails` on `CheckoutSessionListParams` + +## 72.118.0 - 2022-07-07 +* [#1492](https://github.com/stripe/stripe-go/pull/1492) API Updates + * Add support for `Currency` on `CheckoutSessionParams`, `InvoiceUpcomingLinesParams`, `InvoiceUpcomingParams`, `PaymentLinkParams`, `SubscriptionParams`, `SubscriptionSchedulePhasesParams`, `SubscriptionSchedulePhases`, and `Subscription` + * Add support for `CurrencyOptions` on `CheckoutSessionShippingOptionsShippingRateDataFixedAmountParams`, `CouponParams`, `Coupon`, `OrderShippingCostShippingRateDataFixedAmountParams`, `PriceParams`, `Price`, `ProductDefaultPriceDataParams`, `PromotionCodeRestrictionsParams`, `PromotionCodeRestrictions`, `ShippingRateFixedAmountParams`, and `ShippingRateFixedAmount` + * Add support for `Restrictions` on `PromotionCodeParams` + * Add support for `FixedAmount` and `TaxBehavior` on `ShippingRateParams` +* [#1491](https://github.com/stripe/stripe-go/pull/1491) API Updates + * Add support for `Customer` on `CheckoutSessionListParams` and `RefundParams` + * Add support for `Currency` and `Origin` on `RefundParams` + + +## 72.117.0 - 2022-06-29 +* [#1487](https://github.com/stripe/stripe-go/pull/1487) API Updates + * Add support for `DeliverCard`, `FailCard`, `ReturnCard`, and `ShipCard` test helper methods on resource `Issuing.Card` + * Change type of `PaymentLinkPaymentMethodTypesParams` and `PaymentLinkPaymentMethodTypes` from `literal('card')` to `enum` + * Add support for `HostedRegulatoryReceiptURL` on `TreasuryReceivedCredit` and `TreasuryReceivedDebit` + +* [#1483](https://github.com/stripe/stripe-go/pull/1483) Document use of undocumented parameters/properties + ## 72.116.0 - 2022-06-23 * [#1484](https://github.com/stripe/stripe-go/pull/1484) API Updates * Add support for `CaptureMethod` on `PaymentIntentConfirmParams` and `PaymentIntentParams` * [#1481](https://github.com/stripe/stripe-go/pull/1481) API Updates - * Add support for `PromptPayPayments` on `AccountCapabilitiesParams` and `AccountCapabilities` - * Add support for `PromptPay` on `ChargePaymentMethodDetails`, `PaymentIntentConfirmPaymentMethodDataParams`, `PaymentIntentConfirmPaymentMethodOptionsParams`, `PaymentIntentPaymentMethodDataParams`, `PaymentIntentPaymentMethodOptionsParams`, `PaymentIntentPaymentMethodOptions`, `PaymentMethodParams`, `PaymentMethod`, `SetupIntentConfirmPaymentMethodDataParams`, and `SetupIntentPaymentMethodDataParams` - * Add support for `SubtotalExcludingTax` on `CreditNote` and `Invoice` - * Add support for `AmountExcludingTax` and `UnitAmountExcludingTax` on `CreditNoteLineItem` and `InvoiceLineItem` - * Add support for `RenderingOptions` on `InvoiceParams` - * Add support for `TotalExcludingTax` on `Invoice` - * Add support for new value `promptpay` on enums `InvoicePaymentSettingsPaymentMethodTypes` and `SubscriptionPaymentSettingsPaymentMethodTypes` - * Add support for `AutomaticPaymentMethods` on `OrderPaymentSettings` - * Add support for `PromptPayDisplayQRCode` on `PaymentIntentNextAction` - * Add support for new value `promptpay` on enum `PaymentMethodType` - + * Add support for `PromptPayPayments` on `AccountCapabilitiesParams` and `AccountCapabilities` + * Add support for `PromptPay` on `ChargePaymentMethodDetails`, `PaymentIntentConfirmPaymentMethodDataParams`, `PaymentIntentConfirmPaymentMethodOptionsParams`, `PaymentIntentPaymentMethodDataParams`, `PaymentIntentPaymentMethodOptionsParams`, `PaymentIntentPaymentMethodOptions`, `PaymentMethodParams`, `PaymentMethod`, `SetupIntentConfirmPaymentMethodDataParams`, and `SetupIntentPaymentMethodDataParams` + * Add support for `SubtotalExcludingTax` on `CreditNote` and `Invoice` + * Add support for `AmountExcludingTax` and `UnitAmountExcludingTax` on `CreditNoteLineItem` and `InvoiceLineItem` + * Add support for `RenderingOptions` on `InvoiceParams` + * Add support for `TotalExcludingTax` on `Invoice` + * Add support for new value `promptpay` on enums `InvoicePaymentSettingsPaymentMethodTypes` and `SubscriptionPaymentSettingsPaymentMethodTypes` + * Add support for `AutomaticPaymentMethods` on `OrderPaymentSettings` + * Add support for `PromptPayDisplayQRCode` on `PaymentIntentNextAction` + * Add support for new value `promptpay` on enum `PaymentMethodType` + * [#1482](https://github.com/stripe/stripe-go/pull/1482) Use the generated API version ## 72.115.0 - 2022-06-17 diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 08f46537f5..e02bb288e4 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v160 \ No newline at end of file +v164 \ No newline at end of file diff --git a/VERSION b/VERSION index 13bcfd1cb2..cb1daa8e15 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -72.116.0 +72.119.0 diff --git a/cashbalance.go b/cashbalance.go index f2cfab7dcc..5c13fccda9 100644 --- a/cashbalance.go +++ b/cashbalance.go @@ -17,19 +17,15 @@ const ( // Retrieves a customer's cash balance. type CashBalanceParams struct { - Params `form:"*"` + Params `form:"*"` + // A hash of settings for this cash balance. Settings *CashBalanceSettingsParams `form:"settings"` Customer *string `form:"-"` // Included in URL } + +// A hash of settings for this cash balance. type CashBalanceSettingsParams struct { - // Method for using the customer balance to pay outstanding - // `customer_balance` PaymentIntents. If set to `automatic`, all available - // funds will automatically be used to pay any outstanding PaymentIntent. - // If set to `manual`, only customer balance funds from bank transfers - // with a reference code matching - // `payment_intent.next_action.display_bank_transfer_intructions.reference_code` will - // automatically be used to pay the corresponding outstanding - // PaymentIntent. + // Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic` or `manual`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). ReconciliationMode *string `form:"reconciliation_mode"` } type CashBalanceSettings struct { @@ -40,7 +36,7 @@ type CashBalanceSettings struct { // A customer's `Cash balance` represents real funds. Customers can add funds to their cash balance by sending a bank transfer. These funds can be used for payment and can eventually be paid out to your bank account. type CashBalance struct { APIResource - // A hash of all cash balances available to this customer. You cannot delete a customer with any cash balances, even if the balance is 0. + // A hash of all cash balances available to this customer. You cannot delete a customer with any cash balances, even if the balance is 0. Amounts are represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). Available map[string]int64 `json:"available"` // The ID of the customer whose cash balance this object represents. Customer string `json:"customer"` diff --git a/checkout_session.go b/checkout_session.go index 36d54bddd6..9e534b47d2 100644 --- a/checkout_session.go +++ b/checkout_session.go @@ -56,7 +56,7 @@ const ( CheckoutSessionCustomerCreationIfRequired CheckoutSessionCustomerCreation = "if_required" ) -// The customer's tax exempt status at time of checkout. +// The customer's tax exempt status after a completed Checkout Session. type CheckoutSessionCustomerDetailsTaxExempt string // List of values that CheckoutSessionCustomerDetailsTaxExempt can take @@ -501,9 +501,19 @@ const ( CheckoutSessionSubmitTypePay CheckoutSessionSubmitType = "pay" ) +// Only return the Checkout Sessions for the Customer details specified. +type CheckoutSessionListCustomerDetailsParams struct { + // Customer's email address. + Email *string `form:"email"` +} + // Returns a list of Checkout Sessions. type CheckoutSessionListParams struct { ListParams `form:"*"` + // Only return the Checkout Sessions for the Customer specified. + Customer *string `form:"customer"` + // Only return the Checkout Sessions for the Customer details specified. + CustomerDetails *CheckoutSessionListCustomerDetailsParams `form:"customer_details"` // Only return the Checkout Session for the PaymentIntent specified. PaymentIntent *string `form:"payment_intent"` // Only return the Checkout Session for the subscription specified. @@ -1088,12 +1098,22 @@ type CheckoutSessionShippingOptionShippingRateDataDeliveryEstimateParams struct Minimum *CheckoutSessionShippingOptionShippingRateDataDeliveryEstimateMinimumParams `form:"minimum"` } +// Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +type CheckoutSessionShippingOptionShippingRateDataFixedAmountCurrencyOptionsParams struct { + // A non-negative integer in cents representing how much to charge. + Amount *int64 `form:"amount"` + // Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + TaxBehavior *string `form:"tax_behavior"` +} + // Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. type CheckoutSessionShippingOptionShippingRateDataFixedAmountParams struct { // A non-negative integer in cents representing how much to charge. Amount *int64 `form:"amount"` // 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"` + // Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + CurrencyOptions map[string]*CheckoutSessionShippingOptionShippingRateDataFixedAmountCurrencyOptionsParams `form:"currency_options"` } // Parameters to be passed to Shipping Rate creation for this shipping option @@ -1198,6 +1218,8 @@ type CheckoutSessionParams struct { ClientReferenceID *string `form:"client_reference_id"` // Configure fields for the Checkout Session to gather active consent from customers. ConsentCollection *CheckoutSessionConsentCollectionParams `form:"consent_collection"` + // 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 an existing Customer, if one exists. In `payment` mode, the customer's most recent card // payment method will be used to prefill the email, name, card details, and billing address // on the Checkout page. In `subscription` mode, the customer's [default payment method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method) @@ -1340,7 +1362,7 @@ type CheckoutSessionConsentCollection struct { Promotions CheckoutSessionConsentCollectionPromotions `json:"promotions"` } -// The customer's tax IDs at time of checkout. +// The customer's tax IDs after a completed Checkout Session. type CheckoutSessionCustomerDetailsTaxIDs struct { // The type of the tax ID, one of `eu_vat`, `br_cnpj`, `br_cpf`, `eu_oss_vat`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, or `unknown` Type CheckoutSessionCustomerDetailsTaxIDsType `json:"type"` @@ -1348,20 +1370,20 @@ type CheckoutSessionCustomerDetailsTaxIDs struct { Value string `json:"value"` } -// The customer details including the customer's tax exempt status and the customer's tax IDs. Only present on Sessions in `payment` or `subscription` mode. +// The customer details including the customer's tax exempt status and the customer's tax IDs. Only the customer's email is present on Sessions in `setup` mode. type CheckoutSessionCustomerDetails struct { - // The customer's address at the time of checkout. Note: This property is populated only for sessions on or after March 30, 2022. + // The customer's address after a completed Checkout Session. Note: This property is populated only for sessions on or after March 30, 2022. Address *Address `json:"address"` - // The email associated with the Customer, if one exists, on the Checkout Session at the time of checkout or at time of session expiry. + // The email associated with the Customer, if one exists, on the Checkout Session after a completed Checkout Session or at time of session expiry. // Otherwise, if the customer has consented to promotional content, this value is the most recent valid email provided by the customer on the Checkout form. Email string `json:"email"` - // The customer's name at the time of checkout. Note: This property is populated only for sessions on or after March 30, 2022. + // The customer's name after a completed Checkout Session. Note: This property is populated only for sessions on or after March 30, 2022. Name string `json:"name"` - // The customer's phone number at the time of checkout + // The customer's phone number after a completed Checkout Session. Phone string `json:"phone"` - // The customer's tax exempt status at time of checkout. + // The customer's tax exempt status after a completed Checkout Session. TaxExempt CheckoutSessionCustomerDetailsTaxExempt `json:"tax_exempt"` - // The customer's tax IDs at time of checkout. + // The customer's tax IDs after a completed Checkout Session. TaxIDs []*CheckoutSessionCustomerDetailsTaxIDs `json:"tax_ids"` } type CheckoutSessionPaymentMethodOptionsACSSDebitMandateOptions struct { @@ -1711,7 +1733,7 @@ type CheckoutSession struct { Customer *Customer `json:"customer"` // Configure whether a Checkout Session creates a Customer when the Checkout Session completes. CustomerCreation CheckoutSessionCustomerCreation `json:"customer_creation"` - // The customer details including the customer's tax exempt status and the customer's tax IDs. Only present on Sessions in `payment` or `subscription` mode. + // The customer details including the customer's tax exempt status and the customer's tax IDs. Only the customer's email is present on Sessions in `setup` mode. CustomerDetails *CheckoutSessionCustomerDetails `json:"customer_details"` // If provided, this value will be used when the Customer object is created. // If not provided, customers will be asked to enter their email address. diff --git a/client/api.go b/client/api.go index 30022197b0..7a4628708a 100644 --- a/client/api.go +++ b/client/api.go @@ -89,6 +89,7 @@ import ( terminallocation "github.com/stripe/stripe-go/v72/terminal/location" terminalreader "github.com/stripe/stripe-go/v72/terminal/reader" testhelperscustomer "github.com/stripe/stripe-go/v72/testhelpers/customer" + testhelpersissuingcard "github.com/stripe/stripe-go/v72/testhelpers/issuing/card" testhelpersrefund "github.com/stripe/stripe-go/v72/testhelpers/refund" testhelpersterminalreader "github.com/stripe/stripe-go/v72/testhelpers/terminal/reader" testhelperstestclock "github.com/stripe/stripe-go/v72/testhelpers/testclock" @@ -277,6 +278,8 @@ type API struct { TerminalReaders *terminalreader.Client // TestHelpersCustomers is the client used to invoke /customers APIs. TestHelpersCustomers *testhelperscustomer.Client + // TestHelpersIssuingCards is the client used to invoke /issuing/cards APIs. + TestHelpersIssuingCards *testhelpersissuingcard.Client // TestHelpersRefunds is the client used to invoke /refunds APIs. TestHelpersRefunds *testhelpersrefund.Client // TestHelpersTerminalReaders is the client used to invoke /terminal/readers APIs. @@ -417,6 +420,7 @@ 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.TestHelpersIssuingCards = &testhelpersissuingcard.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/coupon.go b/coupon.go index e03a7a8ced..247160247d 100644 --- a/coupon.go +++ b/coupon.go @@ -33,6 +33,12 @@ type CouponAppliesToParams struct { Products []*string `form:"products"` } +// Coupons defined in each available currency option (only supported if `amount_off` is passed). Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +type CouponCurrencyOptionsParams struct { + // A positive integer representing the amount to subtract from an invoice total. + AmountOff *int64 `form:"amount_off"` +} + // You can create coupons easily via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. Coupon creation is also accessible via the API if you need to create coupons on the fly. // // A coupon has either a percent_off or an amount_off and currency. If you set an amount_off, that amount will be subtracted from any invoice's subtotal. For example, an invoice with a subtotal of 100 will have a final total of 0 if a coupon with an amount_off of 200 is applied to it and an invoice with a subtotal of 300 will have a final total of 100 if a coupon with an amount_off of 200 is applied to it. @@ -44,6 +50,8 @@ type CouponParams struct { AppliesTo *CouponAppliesToParams `form:"applies_to"` // Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the `amount_off` parameter (required if `amount_off` is passed). Currency *string `form:"currency"` + // Coupons defined in each available currency option (only supported if the coupon is amount-based). Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + CurrencyOptions map[string]*CouponCurrencyOptionsParams `form:"currency_options"` // Specifies how long the discount will be in effect if used on a subscription. Can be `forever`, `once`, or `repeating`. Defaults to `once`. Duration *string `form:"duration"` // Required only if `duration` is `repeating`, in which case it must be a positive integer that specifies the number of months the discount will be in effect. @@ -64,6 +72,12 @@ type CouponAppliesTo struct { Products []string `json:"products"` } +// Coupons defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +type CouponCurrencyOptions struct { + // Amount (in the `currency` specified) that will be taken off the subtotal of any invoices for this customer. + AmountOff int64 `json:"amount_off"` +} + // A coupon contains information about a percent-off or amount-off discount you // might want to apply to a customer. Coupons may be applied to [subscriptions](https://stripe.com/docs/api#subscriptions), [invoices](https://stripe.com/docs/api#invoices), // [checkout sessions](https://stripe.com/docs/api/checkout/sessions), [quotes](https://stripe.com/docs/api#quotes), and more. Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge) or [payment intents](https://stripe.com/docs/api/payment_intents). @@ -76,7 +90,9 @@ type Coupon struct { Created int64 `json:"created"` // If `amount_off` has been set, the three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the amount to take off. Currency Currency `json:"currency"` - Deleted bool `json:"deleted"` + // Coupons defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + CurrencyOptions map[string]*CouponCurrencyOptions `json:"currency_options"` + Deleted bool `json:"deleted"` // One of `forever`, `once`, and `repeating`. Describes how long a customer who applies this coupon will get the discount. Duration CouponDuration `json:"duration"` // If `duration` is `repeating`, the number of months the coupon applies. Null if coupon `duration` is `forever` or `once`. diff --git a/customer.go b/customer.go index 9e79296119..f5ba546642 100644 --- a/customer.go +++ b/customer.go @@ -64,14 +64,7 @@ type CustomerListParams struct { // Settings controlling the behavior of the customer's cash balance, // such as reconciliation of funds received. type CustomerCashBalanceSettingsParams struct { - // Method for using the customer balance to pay outstanding - // `customer_balance` PaymentIntents. If set to `automatic`, all available - // funds will automatically be used to pay any outstanding PaymentIntent. - // If set to `manual`, only customer balance funds from bank transfers - // with a reference code matching - // `payment_intent.next_action.display_bank_transfer_intructions.reference_code` will - // automatically be used to pay the corresponding outstanding - // PaymentIntent. + // Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic` or `manual`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). ReconciliationMode *string `form:"reconciliation_mode"` } diff --git a/example/generated_examples_test.go b/example/generated_examples_test.go index a7e6aa15d1..7549a68663 100644 --- a/example/generated_examples_test.go +++ b/example/generated_examples_test.go @@ -9,6 +9,7 @@ import ( account "github.com/stripe/stripe-go/v72/account" accountlink "github.com/stripe/stripe-go/v72/accountlink" apps_secret "github.com/stripe/stripe-go/v72/apps/secret" + balancetransaction "github.com/stripe/stripe-go/v72/balancetransaction" billingportal_configuration "github.com/stripe/stripe-go/v72/billingportal/configuration" billingportal_session "github.com/stripe/stripe-go/v72/billingportal/session" capability "github.com/stripe/stripe-go/v72/capability" @@ -61,6 +62,7 @@ import ( terminal_location "github.com/stripe/stripe-go/v72/terminal/location" terminal_reader "github.com/stripe/stripe-go/v72/terminal/reader" testhelpers_customer "github.com/stripe/stripe-go/v72/testhelpers/customer" + testhelpers_issuing_card "github.com/stripe/stripe-go/v72/testhelpers/issuing/card" testhelpers_refund "github.com/stripe/stripe-go/v72/testhelpers/refund" testhelpers_testclock "github.com/stripe/stripe-go/v72/testhelpers/testclock" testhelpers_treasury_inboundtransfer "github.com/stripe/stripe-go/v72/testhelpers/treasury/inboundtransfer" @@ -85,6 +87,88 @@ import ( webhookendpoint "github.com/stripe/stripe-go/v72/webhookendpoint" ) +func TestAppsSecretList(t *testing.T) { + params := &stripe.AppsSecretListParams{ + Scope: &stripe.AppsSecretListScopeParams{ + Type: stripe.String(string(stripe.AppsSecretScopeTypeAccount)), + }, + } + params.Limit = stripe.Int64(2) + result := apps_secret.List(params) + assert.NotNil(t, result) + assert.Nil(t, result.Err()) +} + +func TestAppsSecretCreate(t *testing.T) { + params := &stripe.AppsSecretParams{ + Name: stripe.String("sec_123"), + Payload: stripe.String("very secret string"), + Scope: &stripe.AppsSecretScopeParams{ + Type: stripe.String(string(stripe.AppsSecretScopeTypeAccount)), + }, + } + result, _ := apps_secret.New(params) + assert.NotNil(t, result) +} + +func TestAppsSecretDeleteWhere(t *testing.T) { + params := &stripe.AppsSecretDeleteWhereParams{ + Name: stripe.String("my-api-key"), + Scope: &stripe.AppsSecretDeleteWhereScopeParams{ + Type: stripe.String(string(stripe.AppsSecretScopeTypeAccount)), + }, + } + result, _ := apps_secret.DeleteWhere(params) + assert.NotNil(t, result) +} + +func TestAppsSecretFind(t *testing.T) { + params := &stripe.AppsSecretFindParams{ + Name: stripe.String("sec_123"), + Scope: &stripe.AppsSecretFindScopeParams{ + Type: stripe.String(string(stripe.AppsSecretScopeTypeAccount)), + }, + } + result, _ := apps_secret.Find(params) + assert.NotNil(t, result) +} + +func TestCheckoutSessionExpire(t *testing.T) { + params := &stripe.CheckoutSessionExpireParams{} + result, _ := checkout_session.Expire("sess_xyz", params) + assert.NotNil(t, result) +} + +func TestCashBalanceRetrieve(t *testing.T) { + params := &stripe.CashBalanceParams{Customer: stripe.String("cus_123")} + result, _ := cashbalance.Get(params) + assert.NotNil(t, result) +} + +func TestCashBalanceUpdate(t *testing.T) { + params := &stripe.CashBalanceParams{ + Settings: &stripe.CashBalanceSettingsParams{ + ReconciliationMode: stripe.String(string(stripe.CashBalanceSettingsReconciliationModeManual)), + }, + Customer: stripe.String("cus_123"), + } + result, _ := cashbalance.Update(params) + assert.NotNil(t, result) +} + +func TestCustomerCreateFundingInstructions(t *testing.T) { + params := &stripe.CustomerCreateFundingInstructionsParams{ + BankTransfer: &stripe.CustomerCreateFundingInstructionsBankTransferParams{ + RequestedAddressTypes: []*string{stripe.String("zengin")}, + Type: stripe.String("jp_bank_transfer"), + }, + Currency: stripe.String(string(stripe.CurrencyUSD)), + FundingType: stripe.String("bank_transfer"), + } + result, _ := customer.CreateFundingInstructions("cus_123", params) + assert.NotNil(t, result) +} + func TestCustomerListPaymentMethods(t *testing.T) { params := &stripe.CustomerListPaymentMethodsParams{ Type: stripe.String("card"), @@ -95,30 +179,61 @@ func TestCustomerListPaymentMethods(t *testing.T) { assert.Nil(t, result.Err()) } -func TestCheckoutSessionExpire(t *testing.T) { - params := &stripe.CheckoutSessionExpireParams{} - result, _ := checkout_session.Expire("sess_xyz", params) +func TestFinancialConnectionsAccountList(t *testing.T) { + params := &stripe.FinancialConnectionsAccountListParams{} + result := financialconnections_account.List(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } -func TestShippingRateCreate(t *testing.T) { - params := &stripe.ShippingRateParams{ - DisplayName: stripe.String("Sample Shipper"), - FixedAmount: &stripe.ShippingRateFixedAmountParams{ - Currency: stripe.String(string(stripe.CurrencyUSD)), - Amount: stripe.Int64(400), +func TestFinancialConnectionsAccountRetrieve(t *testing.T) { + params := &stripe.FinancialConnectionsAccountParams{} + result, _ := financialconnections_account.GetByID("fca_xyz", params) + assert.NotNil(t, result) +} + +func TestFinancialConnectionsAccountDisconnect(t *testing.T) { + params := &stripe.FinancialConnectionsAccountDisconnectParams{} + result, _ := financialconnections_account.Disconnect("fca_xyz", params) + assert.NotNil(t, result) +} + +func TestFinancialConnectionsAccountListOwners(t *testing.T) { + params := &stripe.FinancialConnectionsAccountListOwnersParams{ + Ownership: stripe.String("fcaowns_xyz"), + Account: stripe.String("fca_xyz"), + } + result := financialconnections_account.ListOwners(params) + assert.NotNil(t, result) + assert.Nil(t, result.Err()) +} + +func TestFinancialConnectionsAccountRefresh(t *testing.T) { + params := &stripe.FinancialConnectionsAccountRefreshParams{ + Features: []*string{stripe.String("balance")}, + } + result, _ := financialconnections_account.Refresh("fca_xyz", params) + assert.NotNil(t, result) +} + +func TestFinancialConnectionsSessionCreate(t *testing.T) { + params := &stripe.FinancialConnectionsSessionParams{ + AccountHolder: &stripe.FinancialConnectionsSessionAccountHolderParams{ + Type: stripe.String(string(stripe.FinancialConnectionsSessionAccountHolderTypeCustomer)), + Customer: stripe.String("cus_123"), + }, + Permissions: []*string{ + stripe.String(string(stripe.FinancialConnectionsSessionPermissionBalances)), }, - Type: stripe.String("fixed_amount"), } - result, _ := shippingrate.New(params) + result, _ := financialconnections_session.New(params) assert.NotNil(t, result) } -func TestShippingRateList(t *testing.T) { - params := &stripe.ShippingRateListParams{} - result := shippingrate.List(params) +func TestFinancialConnectionsSessionRetrieve(t *testing.T) { + params := &stripe.FinancialConnectionsSessionParams{} + result, _ := financialconnections_session.Get("fcsess_xyz", params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } func TestPaymentIntentCreate(t *testing.T) { @@ -133,6 +248,12 @@ func TestPaymentIntentCreate(t *testing.T) { assert.NotNil(t, result) } +func TestPaymentIntentVerifyMicrodeposits(t *testing.T) { + params := &stripe.PaymentIntentVerifyMicrodepositsParams{} + result, _ := paymentintent.VerifyMicrodeposits("pi_xxxxxxxxxxxxx", params) + assert.NotNil(t, result) +} + func TestPaymentLinkCreate(t *testing.T) { params := &stripe.PaymentLinkParams{ LineItems: []*stripe.PaymentLinkLineItemParams{ @@ -146,6 +267,12 @@ func TestPaymentLinkCreate(t *testing.T) { assert.NotNil(t, result) } +func TestPaymentLinkRetrieve(t *testing.T) { + params := &stripe.PaymentLinkParams{} + result, _ := paymentlink.Get("pl_xyz", params) + assert.NotNil(t, result) +} + func TestPaymentLinkListLineItems(t *testing.T) { params := &stripe.PaymentLinkListLineItemsParams{ PaymentLink: stripe.String("pl_xyz"), @@ -155,16 +282,31 @@ func TestPaymentLinkListLineItems(t *testing.T) { assert.Nil(t, result.Err()) } -func TestPaymentLinkRetrieve(t *testing.T) { - params := &stripe.PaymentLinkParams{} - result, _ := paymentlink.Get("pl_xyz", params) +func TestPriceCreate(t *testing.T) { + params := &stripe.PriceParams{ + UnitAmount: stripe.Int64(2000), + Currency: stripe.String(string(stripe.CurrencyUSD)), + CurrencyOptions: map[string]*stripe.PriceCurrencyOptionsParams{ + "uah": &stripe.PriceCurrencyOptionsParams{UnitAmount: stripe.Int64(5000)}, + "eur": &stripe.PriceCurrencyOptionsParams{UnitAmount: stripe.Int64(1800)}, + }, + Recurring: &stripe.PriceRecurringParams{ + Interval: stripe.String(string(stripe.PriceRecurringIntervalMonth)), + }, + Product: stripe.String("prod_xxxxxxxxxxxxx"), + } + result, _ := price.New(params) assert.NotNil(t, result) } -func TestPaymentIntentVerifyMicrodeposits(t *testing.T) { - params := &stripe.PaymentIntentVerifyMicrodepositsParams{} - result, _ := paymentintent.VerifyMicrodeposits("pi_xxxxxxxxxxxxx", params) +func TestSetupAttemptList(t *testing.T) { + params := &stripe.SetupAttemptListParams{ + SetupIntent: stripe.String("si_xyz"), + } + params.Limit = stripe.Int64(3) + result := setupattempt.List(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } func TestSetupIntentVerifyMicrodeposits(t *testing.T) { @@ -173,52 +315,23 @@ func TestSetupIntentVerifyMicrodeposits(t *testing.T) { assert.NotNil(t, result) } -func TestTestHelpersTestClockCreate(t *testing.T) { - params := &stripe.TestHelpersTestClockParams{ - FrozenTime: stripe.Int64(123), - Name: stripe.String("cogsworth"), - } - result, _ := testhelpers_testclock.New(params) - assert.NotNil(t, result) -} - -func TestTestHelpersTestClockRetrieve(t *testing.T) { - params := &stripe.TestHelpersTestClockParams{} - result, _ := testhelpers_testclock.Get("clock_xyz", params) - assert.NotNil(t, result) -} - -func TestTestHelpersTestClockList(t *testing.T) { - params := &stripe.TestHelpersTestClockListParams{} - result := testhelpers_testclock.List(params) +func TestShippingRateList(t *testing.T) { + params := &stripe.ShippingRateListParams{} + result := shippingrate.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestTestHelpersTestClockDelete(t *testing.T) { - params := &stripe.TestHelpersTestClockParams{} - result, _ := testhelpers_testclock.Del("clock_xyz", params) - assert.NotNil(t, result) -} - -func TestTestHelpersTestClockAdvance(t *testing.T) { - params := &stripe.TestHelpersTestClockAdvanceParams{ - FrozenTime: stripe.Int64(142), - } - result, _ := testhelpers_testclock.Advance("clock_xyz", params) - assert.NotNil(t, result) -} - -func TestCustomerCreateFundingInstructions(t *testing.T) { - params := &stripe.CustomerCreateFundingInstructionsParams{ - BankTransfer: &stripe.CustomerCreateFundingInstructionsBankTransferParams{ - RequestedAddressTypes: []*string{stripe.String("zengin")}, - Type: stripe.String("jp_bank_transfer"), +func TestShippingRateCreate(t *testing.T) { + params := &stripe.ShippingRateParams{ + DisplayName: stripe.String("Sample Shipper"), + FixedAmount: &stripe.ShippingRateFixedAmountParams{ + Currency: stripe.String(string(stripe.CurrencyUSD)), + Amount: stripe.Int64(400), }, - Currency: stripe.String(string(stripe.CurrencyUSD)), - FundingType: stripe.String("bank_transfer"), + Type: stripe.String("fixed_amount"), } - result, _ := customer.CreateFundingInstructions("cus_123", params) + result, _ := shippingrate.New(params) assert.NotNil(t, result) } @@ -229,15 +342,21 @@ func TestTerminalConfigurationList(t *testing.T) { assert.Nil(t, result.Err()) } -func TestTerminalConfigurationRetrieve(t *testing.T) { +func TestTerminalConfigurationCreate(t *testing.T) { params := &stripe.TerminalConfigurationParams{} - result, _ := terminal_configuration.Get("uc_123", params) + result, _ := terminal_configuration.New(params) assert.NotNil(t, result) } -func TestTerminalConfigurationCreate(t *testing.T) { +func TestTerminalConfigurationDelete(t *testing.T) { params := &stripe.TerminalConfigurationParams{} - result, _ := terminal_configuration.New(params) + result, _ := terminal_configuration.Del("uc_123", params) + assert.NotNil(t, result) +} + +func TestTerminalConfigurationRetrieve(t *testing.T) { + params := &stripe.TerminalConfigurationParams{} + result, _ := terminal_configuration.Get("uc_123", params) assert.NotNil(t, result) } @@ -253,73 +372,79 @@ func TestTerminalConfigurationUpdate(t *testing.T) { assert.NotNil(t, result) } -func TestTerminalConfigurationDelete(t *testing.T) { - params := &stripe.TerminalConfigurationParams{} - result, _ := terminal_configuration.Del("uc_123", params) +func TestTestHelpersCustomerFundCashBalance(t *testing.T) { + params := &stripe.TestHelpersCustomerFundCashBalanceParams{ + Amount: stripe.Int64(30), + Currency: stripe.String(string(stripe.CurrencyEUR)), + } + result, _ := testhelpers_customer.FundCashBalance("cus_123", params) assert.NotNil(t, result) } -func TestTestHelpersRefundExpire(t *testing.T) { - params := &stripe.TestHelpersRefundExpireParams{} - result, _ := testhelpers_refund.Expire("re_123", params) +func TestTestHelpersIssuingCardDeliverCard(t *testing.T) { + params := &stripe.TestHelpersIssuingCardDeliverCardParams{} + result, _ := testhelpers_issuing_card.DeliverCard("card_123", params) assert.NotNil(t, result) } -func TestFinancialConnectionsAccountRetrieve(t *testing.T) { - params := &stripe.FinancialConnectionsAccountParams{} - result, _ := financialconnections_account.GetByID("fca_xyz", params) +func TestTestHelpersIssuingCardFailCard(t *testing.T) { + params := &stripe.TestHelpersIssuingCardFailCardParams{} + result, _ := testhelpers_issuing_card.FailCard("card_123", params) assert.NotNil(t, result) } -func TestFinancialConnectionsAccountRefresh(t *testing.T) { - params := &stripe.FinancialConnectionsAccountRefreshParams{ - Features: []*string{stripe.String("balance")}, - } - result, _ := financialconnections_account.Refresh("fca_xyz", params) +func TestTestHelpersIssuingCardReturnCard(t *testing.T) { + params := &stripe.TestHelpersIssuingCardReturnCardParams{} + result, _ := testhelpers_issuing_card.ReturnCard("card_123", params) assert.NotNil(t, result) } -func TestFinancialConnectionsAccountDisconnect(t *testing.T) { - params := &stripe.FinancialConnectionsAccountDisconnectParams{} - result, _ := financialconnections_account.Disconnect("fca_xyz", params) +func TestTestHelpersIssuingCardShipCard(t *testing.T) { + params := &stripe.TestHelpersIssuingCardShipCardParams{} + result, _ := testhelpers_issuing_card.ShipCard("card_123", params) assert.NotNil(t, result) } -func TestFinancialConnectionsSessionCreate(t *testing.T) { - params := &stripe.FinancialConnectionsSessionParams{ - AccountHolder: &stripe.FinancialConnectionsSessionAccountHolderParams{ - Type: stripe.String(string(stripe.FinancialConnectionsSessionAccountHolderTypeCustomer)), - Customer: stripe.String("cus_123"), - }, - Permissions: []*string{ - stripe.String(string(stripe.FinancialConnectionsSessionPermissionBalances)), - }, +func TestTestHelpersRefundExpire(t *testing.T) { + params := &stripe.TestHelpersRefundExpireParams{} + result, _ := testhelpers_refund.Expire("re_123", params) + assert.NotNil(t, result) +} + +func TestTestHelpersTestClockList(t *testing.T) { + params := &stripe.TestHelpersTestClockListParams{} + result := testhelpers_testclock.List(params) + assert.NotNil(t, result) + assert.Nil(t, result.Err()) +} + +func TestTestHelpersTestClockCreate(t *testing.T) { + params := &stripe.TestHelpersTestClockParams{ + FrozenTime: stripe.Int64(123), + Name: stripe.String("cogsworth"), } - result, _ := financialconnections_session.New(params) + result, _ := testhelpers_testclock.New(params) assert.NotNil(t, result) } -func TestFinancialConnectionsSessionRetrieve(t *testing.T) { - params := &stripe.FinancialConnectionsSessionParams{} - result, _ := financialconnections_session.Get("fcsess_xyz", params) +func TestTestHelpersTestClockDelete(t *testing.T) { + params := &stripe.TestHelpersTestClockParams{} + result, _ := testhelpers_testclock.Del("clock_xyz", params) assert.NotNil(t, result) } -func TestFinancialConnectionsAccountList(t *testing.T) { - params := &stripe.FinancialConnectionsAccountListParams{} - result := financialconnections_account.List(params) +func TestTestHelpersTestClockRetrieve(t *testing.T) { + params := &stripe.TestHelpersTestClockParams{} + result, _ := testhelpers_testclock.Get("clock_xyz", params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } -func TestFinancialConnectionsAccountListOwners(t *testing.T) { - params := &stripe.FinancialConnectionsAccountListOwnersParams{ - Ownership: stripe.String("fcaowns_xyz"), - Account: stripe.String("fca_xyz"), +func TestTestHelpersTestClockAdvance(t *testing.T) { + params := &stripe.TestHelpersTestClockAdvanceParams{ + FrozenTime: stripe.Int64(142), } - result := financialconnections_account.ListOwners(params) + result, _ := testhelpers_testclock.Advance("clock_xyz", params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } func TestTestHelpersTreasuryInboundTransferFail(t *testing.T) { @@ -347,18 +472,18 @@ func TestTestHelpersTreasuryInboundTransferSucceed(t *testing.T) { assert.NotNil(t, result) } -func TestTestHelpersTreasuryOutboundTransferPost(t *testing.T) { - params := &stripe.TestHelpersTreasuryOutboundTransferPostParams{} - result, _ := testhelpers_treasury_outboundtransfer.Post("obt_123", params) - assert.NotNil(t, result) -} - func TestTestHelpersTreasuryOutboundTransferFail(t *testing.T) { params := &stripe.TestHelpersTreasuryOutboundTransferFailParams{} result, _ := testhelpers_treasury_outboundtransfer.Fail("obt_123", params) assert.NotNil(t, result) } +func TestTestHelpersTreasuryOutboundTransferPost(t *testing.T) { + params := &stripe.TestHelpersTreasuryOutboundTransferPostParams{} + result, _ := testhelpers_treasury_outboundtransfer.Post("obt_123", params) + assert.NotNil(t, result) +} + func TestTestHelpersTreasuryOutboundTransferReturnOutboundTransfer( t *testing.T, ) { @@ -396,1374 +521,1292 @@ func TestTestHelpersTreasuryReceivedDebitCreate(t *testing.T) { assert.NotNil(t, result) } -func TestAppsSecretCreate(t *testing.T) { - params := &stripe.AppsSecretParams{ - Name: stripe.String("sec_123"), - Payload: stripe.String("very secret string"), - Scope: &stripe.AppsSecretScopeParams{ - Type: stripe.String(string(stripe.AppsSecretScopeTypeAccount)), - }, +func TestAccountLinkCreate(t *testing.T) { + params := &stripe.AccountLinkParams{ + Account: stripe.String("acct_xxxxxxxxxxxxx"), + RefreshURL: stripe.String("https://example.com/reauth"), + ReturnURL: stripe.String("https://example.com/return"), + Type: stripe.String("account_onboarding"), } - result, _ := apps_secret.New(params) + result, _ := accountlink.New(params) assert.NotNil(t, result) } -func TestAppsSecretFind(t *testing.T) { - params := &stripe.AppsSecretFindParams{ - Name: stripe.String("sec_123"), - Scope: &stripe.AppsSecretFindScopeParams{ - Type: stripe.String(string(stripe.AppsSecretScopeTypeAccount)), - }, - } - result, _ := apps_secret.Find(params) +func TestAccountList(t *testing.T) { + params := &stripe.AccountListParams{} + params.Limit = stripe.Int64(3) + result := account.List(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } -func TestAppsSecretDeleteWhere(t *testing.T) { - params := &stripe.AppsSecretDeleteWhereParams{ - Name: stripe.String("sec_123"), - Scope: &stripe.AppsSecretDeleteWhereScopeParams{ - Type: stripe.String(string(stripe.AppsSecretScopeTypeAccount)), +func TestAccountCreate(t *testing.T) { + params := &stripe.AccountParams{ + Type: stripe.String(string(stripe.AccountTypeCustom)), + Country: stripe.String("US"), + Email: stripe.String("jenny.rosen@example.com"), + Capabilities: &stripe.AccountCapabilitiesParams{ + CardPayments: &stripe.AccountCapabilitiesCardPaymentsParams{ + Requested: stripe.Bool(true), + }, + Transfers: &stripe.AccountCapabilitiesTransfersParams{ + Requested: stripe.Bool(true), + }, }, } - result, _ := apps_secret.DeleteWhere(params) + result, _ := account.New(params) assert.NotNil(t, result) } -func TestCashBalanceRetrieve(t *testing.T) { - params := &stripe.CashBalanceParams{Customer: stripe.String("cus_123")} - result, _ := cashbalance.Get(params) +func TestAccountDelete(t *testing.T) { + params := &stripe.AccountParams{} + result, _ := account.Del("acct_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestCashBalanceUpdate(t *testing.T) { - params := &stripe.CashBalanceParams{ - Settings: &stripe.CashBalanceSettingsParams{ - ReconciliationMode: stripe.String(string(stripe.CashBalanceSettingsReconciliationModeManual)), - }, - Customer: stripe.String("cus_123"), - } - result, _ := cashbalance.Update(params) +func TestAccountRetrieve(t *testing.T) { + params := &stripe.AccountParams{} + result, _ := account.GetByID("acct_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTestHelpersCustomerFundCashBalance(t *testing.T) { - params := &stripe.TestHelpersCustomerFundCashBalanceParams{ - Amount: stripe.Int64(30), - Currency: stripe.String(string(stripe.CurrencyEUR)), - } - result, _ := testhelpers_customer.FundCashBalance("cus_123", params) +func TestAccountUpdate(t *testing.T) { + params := &stripe.AccountParams{} + params.AddMetadata("order_id", "6735") + result, _ := account.Update("acct_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestCustomerList(t *testing.T) { - params := &stripe.CustomerListParams{} - params.Limit = stripe.Int64(3) - result := customer.List(params) +func TestAccountReject(t *testing.T) { + params := &stripe.AccountRejectParams{Reason: stripe.String("fraud")} + result, _ := account.Reject("acct_xxxxxxxxxxxxx", params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } -func TestCustomerSearch(t *testing.T) { - params := &stripe.CustomerSearchParams{ - SearchParams: stripe.SearchParams{ - Query: "name:'fakename' AND metadata['foo']:'bar'", - }, +func TestCapabilityList(t *testing.T) { + params := &stripe.CapabilityListParams{ + Account: stripe.String("acct_xxxxxxxxxxxxx"), } - result := customer.Search(params) + result := capability.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestChargeCreate(t *testing.T) { - params := &stripe.ChargeParams{ - Amount: stripe.Int64(2000), - Currency: stripe.String(string(stripe.CurrencyUSD)), - Source: &stripe.SourceParams{Token: stripe.String("tok_xxxx")}, - Description: stripe.String("My First Test Charge (created for API docs)"), +func TestCapabilityRetrieve(t *testing.T) { + params := &stripe.CapabilityParams{ + Account: stripe.String("acct_xxxxxxxxxxxxx"), } - result, _ := charge.New(params) - assert.NotNil(t, result) -} - -func TestChargeRetrieve(t *testing.T) { - params := &stripe.ChargeParams{} - result, _ := charge.Get("ch_xxxxxxxxxxxxx", params) - assert.NotNil(t, result) -} - -func TestChargeUpdate(t *testing.T) { - params := &stripe.ChargeParams{} - params.AddMetadata("order_id", "6735") - result, _ := charge.Update("ch_xxxxxxxxxxxxx", params) + result, _ := capability.Get("card_payments", params) assert.NotNil(t, result) } -func TestChargeCapture(t *testing.T) { - params := &stripe.CaptureParams{} - result, _ := charge.Capture("ch_xxxxxxxxxxxxx", params) +func TestCapabilityUpdate(t *testing.T) { + params := &stripe.CapabilityParams{ + Requested: stripe.Bool(true), + Account: stripe.String("acct_xxxxxxxxxxxxx"), + } + result, _ := capability.Update("card_payments", params) assert.NotNil(t, result) } -func TestChargeList(t *testing.T) { - params := &stripe.ChargeListParams{} +func TestPersonList(t *testing.T) { + params := &stripe.PersonListParams{ + Account: stripe.String("acct_xxxxxxxxxxxxx"), + } params.Limit = stripe.Int64(3) - result := charge.List(params) + result := person.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestChargeSearch(t *testing.T) { - params := &stripe.ChargeSearchParams{ - SearchParams: stripe.SearchParams{ - Query: "amount>999 AND metadata['order_id']:'6735'", - }, +func TestPersonCreate(t *testing.T) { + params := &stripe.PersonParams{ + FirstName: stripe.String("Jane"), + LastName: stripe.String("Diaz"), } - result := charge.Search(params) + result, _ := person.New(params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } -func TestCustomerCreate(t *testing.T) { - params := &stripe.CustomerParams{ - Description: stripe.String("My First Test Customer (created for API docs)"), - } - result, _ := customer.New(params) +func TestPersonUpdate(t *testing.T) { + params := &stripe.PersonParams{Account: stripe.String("acct_xxxxxxxxxxxxx")} + params.AddMetadata("order_id", "6735") + result, _ := person.Update("person_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestCustomerRetrieve(t *testing.T) { - params := &stripe.CustomerParams{} - result, _ := customer.Get("cus_xxxxxxxxxxxxx", params) +func TestAppsSecretCreate2(t *testing.T) { + params := &stripe.AppsSecretParams{ + Name: stripe.String("my-api-key"), + Payload: stripe.String("secret_key_xxxxxx"), + Scope: &stripe.AppsSecretScopeParams{ + Type: stripe.String(string(stripe.AppsSecretScopeTypeAccount)), + }, + } + result, _ := apps_secret.New(params) assert.NotNil(t, result) } -func TestCustomerUpdate(t *testing.T) { - params := &stripe.CustomerParams{} - params.AddMetadata("order_id", "6735") - result, _ := customer.Update("cus_xxxxxxxxxxxxx", params) +func TestBalanceTransactionList(t *testing.T) { + params := &stripe.BalanceTransactionListParams{} + params.Limit = stripe.Int64(3) + result := balancetransaction.List(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } -func TestCustomerDelete(t *testing.T) { - params := &stripe.CustomerParams{} - result, _ := customer.Del("cus_xxxxxxxxxxxxx", params) +func TestBalanceTransactionRetrieve(t *testing.T) { + params := &stripe.BalanceTransactionParams{} + result, _ := balancetransaction.Get("txn_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestCustomerList2(t *testing.T) { - params := &stripe.CustomerListParams{} +func TestBillingPortalConfigurationList(t *testing.T) { + params := &stripe.BillingPortalConfigurationListParams{} params.Limit = stripe.Int64(3) - result := customer.List(params) + result := billingportal_configuration.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestCustomerSearch2(t *testing.T) { - params := &stripe.CustomerSearchParams{ - SearchParams: stripe.SearchParams{ - Query: "name:'fakename' AND metadata['foo']:'bar'", - }, - } - result := customer.Search(params) - assert.NotNil(t, result) - assert.Nil(t, result.Err()) -} - -func TestDisputeRetrieve(t *testing.T) { - params := &stripe.DisputeParams{} - result, _ := dispute.Get("dp_xxxxxxxxxxxxx", params) - assert.NotNil(t, result) -} - -func TestDisputeUpdate(t *testing.T) { - params := &stripe.DisputeParams{} - params.AddMetadata("order_id", "6735") - result, _ := dispute.Update("dp_xxxxxxxxxxxxx", params) +func TestBillingPortalConfigurationCreate(t *testing.T) { + params := &stripe.BillingPortalConfigurationParams{ + Features: &stripe.BillingPortalConfigurationFeaturesParams{ + CustomerUpdate: &stripe.BillingPortalConfigurationFeaturesCustomerUpdateParams{ + AllowedUpdates: []*string{ + stripe.String(string(stripe.BillingPortalConfigurationFeaturesCustomerUpdateAllowedUpdateEmail)), + stripe.String(string(stripe.BillingPortalConfigurationFeaturesCustomerUpdateAllowedUpdateTaxID)), + }, + Enabled: stripe.Bool(true), + }, + InvoiceHistory: &stripe.BillingPortalConfigurationFeaturesInvoiceHistoryParams{ + Enabled: stripe.Bool(true), + }, + }, + BusinessProfile: &stripe.BillingPortalConfigurationBusinessProfileParams{ + PrivacyPolicyURL: stripe.String("https://example.com/privacy"), + TermsOfServiceURL: stripe.String("https://example.com/terms"), + }, + } + result, _ := billingportal_configuration.New(params) assert.NotNil(t, result) } -func TestDisputeClose(t *testing.T) { - params := &stripe.DisputeParams{} - result, _ := dispute.Close("dp_xxxxxxxxxxxxx", params) +func TestBillingPortalConfigurationRetrieve(t *testing.T) { + params := &stripe.BillingPortalConfigurationParams{} + result, _ := billingportal_configuration.Get("bpc_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestDisputeList(t *testing.T) { - params := &stripe.DisputeListParams{} - params.Limit = stripe.Int64(3) - result := dispute.List(params) +func TestBillingPortalConfigurationUpdate(t *testing.T) { + params := &stripe.BillingPortalConfigurationParams{ + BusinessProfile: &stripe.BillingPortalConfigurationBusinessProfileParams{ + PrivacyPolicyURL: stripe.String("https://example.com/privacy"), + TermsOfServiceURL: stripe.String("https://example.com/terms"), + }, + } + result, _ := billingportal_configuration.Update("bpc_xxxxxxxxxxxxx", params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } -func TestEventRetrieve(t *testing.T) { - params := &stripe.EventParams{} - result, _ := event.Get("evt_xxxxxxxxxxxxx", params) +func TestBillingPortalSessionCreate(t *testing.T) { + params := &stripe.BillingPortalSessionParams{ + Customer: stripe.String("cus_xxxxxxxxxxxxx"), + ReturnURL: stripe.String("https://example.com/account"), + } + result, _ := billingportal_session.New(params) assert.NotNil(t, result) } -func TestEventList(t *testing.T) { - params := &stripe.EventListParams{} +func TestChargeList(t *testing.T) { + params := &stripe.ChargeListParams{} params.Limit = stripe.Int64(3) - result := event.List(params) + result := charge.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestMandateRetrieve(t *testing.T) { - params := &stripe.MandateParams{} - result, _ := mandate.Get("mandate_xxxxxxxxxxxxx", params) - assert.NotNil(t, result) -} - -func TestPaymentIntentCreate2(t *testing.T) { - params := &stripe.PaymentIntentParams{ - Amount: stripe.Int64(2000), - Currency: stripe.String(string(stripe.CurrencyUSD)), - PaymentMethodTypes: []*string{stripe.String("card")}, +func TestChargeCreate(t *testing.T) { + params := &stripe.ChargeParams{ + Amount: stripe.Int64(2000), + Currency: stripe.String(string(stripe.CurrencyUSD)), + Source: &stripe.SourceParams{Token: stripe.String("tok_xxxx")}, + Description: stripe.String("My First Test Charge (created for API docs)"), } - result, _ := paymentintent.New(params) + result, _ := charge.New(params) assert.NotNil(t, result) } -func TestPaymentIntentRetrieve(t *testing.T) { - params := &stripe.PaymentIntentParams{} - result, _ := paymentintent.Get("pi_xxxxxxxxxxxxx", params) +func TestChargeRetrieve(t *testing.T) { + params := &stripe.ChargeParams{} + result, _ := charge.Get("ch_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestPaymentIntentUpdate(t *testing.T) { - params := &stripe.PaymentIntentParams{} +func TestChargeUpdate(t *testing.T) { + params := &stripe.ChargeParams{} params.AddMetadata("order_id", "6735") - result, _ := paymentintent.Update("pi_xxxxxxxxxxxxx", params) + result, _ := charge.Update("ch_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestPaymentIntentConfirm(t *testing.T) { - params := &stripe.PaymentIntentConfirmParams{ - PaymentMethod: stripe.String("pm_card_visa"), - } - result, _ := paymentintent.Confirm("pi_xxxxxxxxxxxxx", params) +func TestChargeCapture(t *testing.T) { + params := &stripe.CaptureParams{} + result, _ := charge.Capture("ch_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestPaymentIntentCapture(t *testing.T) { - params := &stripe.PaymentIntentCaptureParams{} - result, _ := paymentintent.Capture("pi_xxxxxxxxxxxxx", params) +func TestChargeSearch(t *testing.T) { + params := &stripe.ChargeSearchParams{ + SearchParams: stripe.SearchParams{ + Query: "amount>999 AND metadata['order_id']:'6735'", + }, + } + result := charge.Search(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } -func TestPaymentIntentCancel(t *testing.T) { - params := &stripe.PaymentIntentCancelParams{} - result, _ := paymentintent.Cancel("pi_xxxxxxxxxxxxx", params) +func TestCheckoutSessionList(t *testing.T) { + params := &stripe.CheckoutSessionListParams{} + params.Limit = stripe.Int64(3) + result := checkout_session.List(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } -func TestPaymentIntentList(t *testing.T) { - params := &stripe.PaymentIntentListParams{} - params.Limit = stripe.Int64(3) - result := paymentintent.List(params) +func TestCheckoutSessionRetrieve(t *testing.T) { + params := &stripe.CheckoutSessionParams{} + result, _ := checkout_session.Get("cs_test_xxxxxxxxxxxxx", params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } -func TestPaymentIntentIncrementAuthorization(t *testing.T) { - params := &stripe.PaymentIntentIncrementAuthorizationParams{ - Amount: stripe.Int64(2099), - } - result, _ := paymentintent.IncrementAuthorization("pi_xxxxxxxxxxxxx", params) +func TestCheckoutSessionExpire2(t *testing.T) { + params := &stripe.CheckoutSessionExpireParams{} + result, _ := checkout_session.Expire("cs_test_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestPaymentIntentSearch(t *testing.T) { - params := &stripe.PaymentIntentSearchParams{ - SearchParams: stripe.SearchParams{ - Query: "status:'succeeded' AND metadata['order_id']:'6735'", - }, - } - result := paymentintent.Search(params) +func TestCountrySpecList(t *testing.T) { + params := &stripe.CountrySpecListParams{} + params.Limit = stripe.Int64(3) + result := countryspec.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestPaymentIntentApplyCustomerBalance(t *testing.T) { - params := &stripe.PaymentIntentApplyCustomerBalanceParams{} - result, _ := paymentintent.ApplyCustomerBalance("pi_xxxxxxxxxxxxx", params) +func TestCountrySpecRetrieve(t *testing.T) { + params := &stripe.CountrySpecParams{} + result, _ := countryspec.Get("US", params) assert.NotNil(t, result) } -func TestSetupIntentCreate(t *testing.T) { - params := &stripe.SetupIntentParams{ - PaymentMethodTypes: []*string{stripe.String("card")}, - } - result, _ := setupintent.New(params) +func TestCouponList(t *testing.T) { + params := &stripe.CouponListParams{} + params.Limit = stripe.Int64(3) + result := coupon.List(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } -func TestSetupIntentRetrieve(t *testing.T) { - params := &stripe.SetupIntentParams{} - result, _ := setupintent.Get("seti_xxxxxxxxxxxxx", params) +func TestCouponCreate(t *testing.T) { + params := &stripe.CouponParams{ + PercentOff: stripe.Float64(25.5), + Duration: stripe.String(string(stripe.CouponDurationRepeating)), + DurationInMonths: stripe.Int64(3), + } + result, _ := coupon.New(params) assert.NotNil(t, result) } -func TestSetupIntentUpdate(t *testing.T) { - params := &stripe.SetupIntentParams{} - params.AddMetadata("user_id", "3435453") - result, _ := setupintent.Update("seti_xxxxxxxxxxxxx", params) +func TestCouponDelete(t *testing.T) { + params := &stripe.CouponParams{} + result, _ := coupon.Del("Z4OV52SU", params) assert.NotNil(t, result) } -func TestSetupIntentConfirm(t *testing.T) { - params := &stripe.SetupIntentConfirmParams{ - PaymentMethod: stripe.String("pm_card_visa"), - } - result, _ := setupintent.Confirm("seti_xxxxxxxxxxxxx", params) +func TestCouponRetrieve(t *testing.T) { + params := &stripe.CouponParams{} + result, _ := coupon.Get("Z4OV52SU", params) assert.NotNil(t, result) } -func TestSetupIntentCancel(t *testing.T) { - params := &stripe.SetupIntentCancelParams{} - result, _ := setupintent.Cancel("seti_xxxxxxxxxxxxx", params) +func TestCouponUpdate(t *testing.T) { + params := &stripe.CouponParams{} + params.AddMetadata("order_id", "6735") + result, _ := coupon.Update("Z4OV52SU", params) assert.NotNil(t, result) } -func TestSetupIntentList(t *testing.T) { - params := &stripe.SetupIntentListParams{} +func TestCustomerList(t *testing.T) { + params := &stripe.CustomerListParams{} params.Limit = stripe.Int64(3) - result := setupintent.List(params) + result := customer.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestSetupAttemptList(t *testing.T) { - params := &stripe.SetupAttemptListParams{ - SetupIntent: stripe.String("si_xyz"), - } +func TestCustomerList2(t *testing.T) { + params := &stripe.CustomerListParams{} params.Limit = stripe.Int64(3) - result := setupattempt.List(params) + result := customer.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestPayoutCreate(t *testing.T) { - params := &stripe.PayoutParams{ - Amount: stripe.Int64(1100), - Currency: stripe.String(string(stripe.CurrencyUSD)), +func TestCustomerCreate(t *testing.T) { + params := &stripe.CustomerParams{ + Description: stripe.String("My First Test Customer (created for API docs)"), } - result, _ := payout.New(params) + result, _ := customer.New(params) assert.NotNil(t, result) } -func TestPayoutRetrieve(t *testing.T) { - params := &stripe.PayoutParams{} - result, _ := payout.Get("po_xxxxxxxxxxxxx", params) +func TestCustomerDelete(t *testing.T) { + params := &stripe.CustomerParams{} + result, _ := customer.Del("cus_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestPayoutUpdate(t *testing.T) { - params := &stripe.PayoutParams{} +func TestCustomerRetrieve(t *testing.T) { + params := &stripe.CustomerParams{} + result, _ := customer.Get("cus_xxxxxxxxxxxxx", params) + assert.NotNil(t, result) +} + +func TestCustomerUpdate(t *testing.T) { + params := &stripe.CustomerParams{} params.AddMetadata("order_id", "6735") - result, _ := payout.Update("po_xxxxxxxxxxxxx", params) + result, _ := customer.Update("cus_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestPayoutList(t *testing.T) { - params := &stripe.PayoutListParams{} +func TestCustomerBalanceTransactionList(t *testing.T) { + params := &stripe.CustomerBalanceTransactionListParams{ + Customer: stripe.String("cus_xxxxxxxxxxxxx"), + } params.Limit = stripe.Int64(3) - result := payout.List(params) + result := customerbalancetransaction.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestPayoutCancel(t *testing.T) { - params := &stripe.PayoutParams{} - result, _ := payout.Cancel("po_xxxxxxxxxxxxx", params) +func TestCustomerBalanceTransactionCreate(t *testing.T) { + params := &stripe.CustomerBalanceTransactionParams{ + Amount: stripe.Int64(-500), + Currency: stripe.String(string(stripe.CurrencyUSD)), + } + result, _ := customerbalancetransaction.New(params) assert.NotNil(t, result) } -func TestPayoutReverse(t *testing.T) { - params := &stripe.PayoutReverseParams{} - result, _ := payout.Reverse("po_xxxxxxxxxxxxx", params) - assert.NotNil(t, result) -} - -func TestRefundCreate(t *testing.T) { - params := &stripe.RefundParams{Charge: stripe.String("ch_xxxxxxxxxxxxx")} - result, _ := refund.New(params) - assert.NotNil(t, result) -} - -func TestRefundRetrieve(t *testing.T) { - params := &stripe.RefundParams{} - result, _ := refund.Get("re_xxxxxxxxxxxxx", params) +func TestCustomerBalanceTransactionRetrieve(t *testing.T) { + params := &stripe.CustomerBalanceTransactionParams{ + Customer: stripe.String("cus_xxxxxxxxxxxxx"), + } + result, _ := customerbalancetransaction.Get("cbtxn_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestRefundUpdate(t *testing.T) { - params := &stripe.RefundParams{} +func TestCustomerBalanceTransactionUpdate(t *testing.T) { + params := &stripe.CustomerBalanceTransactionParams{ + Customer: stripe.String("cus_xxxxxxxxxxxxx"), + } params.AddMetadata("order_id", "6735") - result, _ := refund.Update("re_xxxxxxxxxxxxx", params) + result, _ := customerbalancetransaction.Update("cbtxn_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestRefundCancel(t *testing.T) { - params := &stripe.RefundCancelParams{} - result, _ := refund.Cancel("re_xxxxxxxxxxxxx", params) +func TestCustomerListPaymentMethods2(t *testing.T) { + params := &stripe.CustomerListPaymentMethodsParams{ + Type: stripe.String("card"), + Customer: stripe.String("cus_xxxxxxxxxxxxx"), + } + result := customer.ListPaymentMethods(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } -func TestRefundList(t *testing.T) { - params := &stripe.RefundListParams{} +func TestTaxIDList(t *testing.T) { + params := &stripe.TaxIDListParams{ + Customer: stripe.String("cus_xxxxxxxxxxxxx"), + } params.Limit = stripe.Int64(3) - result := refund.List(params) + result := taxid.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestPaymentMethodRetrieve(t *testing.T) { - params := &stripe.PaymentMethodParams{} - result, _ := paymentmethod.Get("pm_xxxxxxxxxxxxx", params) +func TestTaxIDCreate(t *testing.T) { + params := &stripe.TaxIDParams{ + Type: stripe.String(string(stripe.TaxIDTypeEUVAT)), + Value: stripe.String("DE123456789"), + } + result, _ := taxid.New(params) assert.NotNil(t, result) } -func TestPaymentMethodUpdate(t *testing.T) { - params := &stripe.PaymentMethodParams{} - params.AddMetadata("order_id", "6735") - result, _ := paymentmethod.Update("pm_xxxxxxxxxxxxx", params) +func TestTaxIDDelete(t *testing.T) { + params := &stripe.TaxIDParams{Customer: stripe.String("cus_xxxxxxxxxxxxx")} + result, _ := taxid.Del("txi_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestPaymentMethodList(t *testing.T) { - params := &stripe.PaymentMethodListParams{ - Customer: stripe.String("cus_xxxxxxxxxxxxx"), - Type: stripe.String(string(stripe.PaymentMethodTypeCard)), - } - result := paymentmethod.List(params) +func TestTaxIDRetrieve(t *testing.T) { + params := &stripe.TaxIDParams{Customer: stripe.String("cus_xxxxxxxxxxxxx")} + result, _ := taxid.Get("txi_xxxxxxxxxxxxx", params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } -func TestCustomerListPaymentMethods2(t *testing.T) { - params := &stripe.CustomerListPaymentMethodsParams{ - Type: stripe.String("card"), - Customer: stripe.String("cus_xxxxxxxxxxxxx"), +func TestCustomerSearch(t *testing.T) { + params := &stripe.CustomerSearchParams{ + SearchParams: stripe.SearchParams{ + Query: "name:'fakename' AND metadata['foo']:'bar'", + }, } - result := customer.ListPaymentMethods(params) + result := customer.Search(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestPaymentMethodAttach(t *testing.T) { - params := &stripe.PaymentMethodAttachParams{ - Customer: stripe.String("cus_xxxxxxxxxxxxx"), +func TestCustomerSearch2(t *testing.T) { + params := &stripe.CustomerSearchParams{ + SearchParams: stripe.SearchParams{ + Query: "name:'fakename' AND metadata['foo']:'bar'", + }, } - result, _ := paymentmethod.Attach("pm_xxxxxxxxxxxxx", params) + result := customer.Search(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } -func TestPaymentMethodDetach(t *testing.T) { - params := &stripe.PaymentMethodDetachParams{} - result, _ := paymentmethod.Detach("pm_xxxxxxxxxxxxx", params) +func TestDisputeList(t *testing.T) { + params := &stripe.DisputeListParams{} + params.Limit = stripe.Int64(3) + result := dispute.List(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } -func TestSourceRetrieve(t *testing.T) { - params := &stripe.SourceObjectParams{} - result, _ := source.Get("src_xxxxxxxxxxxxx", params) +func TestDisputeRetrieve(t *testing.T) { + params := &stripe.DisputeParams{} + result, _ := dispute.Get("dp_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestSourceUpdate(t *testing.T) { - params := &stripe.SourceObjectParams{} +func TestDisputeUpdate(t *testing.T) { + params := &stripe.DisputeParams{} params.AddMetadata("order_id", "6735") - result, _ := source.Update("src_xxxxxxxxxxxxx", params) + result, _ := dispute.Update("dp_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestProductCreate(t *testing.T) { - params := &stripe.ProductParams{Name: stripe.String("Gold Special")} - result, _ := product.New(params) +func TestDisputeClose(t *testing.T) { + params := &stripe.DisputeParams{} + result, _ := dispute.Close("dp_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestProductRetrieve(t *testing.T) { - params := &stripe.ProductParams{} - result, _ := product.Get("prod_xxxxxxxxxxxxx", params) +func TestEventList(t *testing.T) { + params := &stripe.EventListParams{} + params.Limit = stripe.Int64(3) + result := event.List(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } -func TestProductUpdate(t *testing.T) { - params := &stripe.ProductParams{} - params.AddMetadata("order_id", "6735") - result, _ := product.Update("prod_xxxxxxxxxxxxx", params) +func TestEventRetrieve(t *testing.T) { + params := &stripe.EventParams{} + result, _ := event.Get("evt_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestProductList(t *testing.T) { - params := &stripe.ProductListParams{} - params.Limit = stripe.Int64(3) - result := product.List(params) +func TestFinancialConnectionsAccountList2(t *testing.T) { + params := &stripe.FinancialConnectionsAccountListParams{ + AccountHolder: &stripe.FinancialConnectionsAccountListAccountHolderParams{ + Customer: stripe.String("cus_xxxxxxxxxxxxx"), + }, + } + result := financialconnections_account.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestProductDelete(t *testing.T) { - params := &stripe.ProductParams{} - result, _ := product.Del("prod_xxxxxxxxxxxxx", params) +func TestFinancialConnectionsAccountRetrieve2(t *testing.T) { + params := &stripe.FinancialConnectionsAccountParams{} + result, _ := financialconnections_account.GetByID( + "fca_xxxxxxxxxxxxx", + params, + ) assert.NotNil(t, result) } -func TestProductSearch(t *testing.T) { - params := &stripe.ProductSearchParams{ - SearchParams: stripe.SearchParams{ - Query: "active:'true' AND metadata['order_id']:'6735'", - }, +func TestFinancialConnectionsAccountListOwners2(t *testing.T) { + params := &stripe.FinancialConnectionsAccountListOwnersParams{ + Ownership: stripe.String("fcaowns_xxxxxxxxxxxxx"), + Account: stripe.String("fca_xxxxxxxxxxxxx"), } - result := product.Search(params) + params.Limit = stripe.Int64(3) + result := financialconnections_account.ListOwners(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestPriceCreate(t *testing.T) { - params := &stripe.PriceParams{ - UnitAmount: stripe.Int64(2000), - Currency: stripe.String(string(stripe.CurrencyUSD)), - Recurring: &stripe.PriceRecurringParams{ - Interval: stripe.String(string(stripe.PriceRecurringIntervalMonth)), +func TestFinancialConnectionsSessionCreate2(t *testing.T) { + params := &stripe.FinancialConnectionsSessionParams{ + AccountHolder: &stripe.FinancialConnectionsSessionAccountHolderParams{ + Type: stripe.String(string(stripe.FinancialConnectionsSessionAccountHolderTypeCustomer)), + Customer: stripe.String("cus_xxxxxxxxxxxxx"), + }, + Permissions: []*string{ + stripe.String(string(stripe.FinancialConnectionsSessionPermissionPaymentMethod)), + stripe.String(string(stripe.FinancialConnectionsSessionPermissionBalances)), + }, + Filters: &stripe.FinancialConnectionsSessionFiltersParams{ + Countries: []*string{stripe.String("US")}, }, - Product: stripe.String("prod_xxxxxxxxxxxxx"), } - result, _ := price.New(params) + result, _ := financialconnections_session.New(params) assert.NotNil(t, result) } -func TestPriceRetrieve(t *testing.T) { - params := &stripe.PriceParams{} - result, _ := price.Get("price_xxxxxxxxxxxxx", params) +func TestFinancialConnectionsSessionRetrieve2(t *testing.T) { + params := &stripe.FinancialConnectionsSessionParams{} + result, _ := financialconnections_session.Get("fcsess_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestPriceUpdate(t *testing.T) { - params := &stripe.PriceParams{} - params.AddMetadata("order_id", "6735") - result, _ := price.Update("price_xxxxxxxxxxxxx", params) +func TestIdentityVerificationReportList(t *testing.T) { + params := &stripe.IdentityVerificationReportListParams{} + params.Limit = stripe.Int64(3) + result := identity_verificationreport.List(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } -func TestPriceList(t *testing.T) { - params := &stripe.PriceListParams{} - params.Limit = stripe.Int64(3) - result := price.List(params) +func TestIdentityVerificationReportRetrieve(t *testing.T) { + params := &stripe.IdentityVerificationReportParams{} + result, _ := identity_verificationreport.Get("vr_xxxxxxxxxxxxx", params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } -func TestPriceSearch(t *testing.T) { - params := &stripe.PriceSearchParams{ - SearchParams: stripe.SearchParams{ - Query: "active:'true' AND metadata['order_id']:'6735'", - }, - } - result := price.Search(params) +func TestIdentityVerificationSessionList(t *testing.T) { + params := &stripe.IdentityVerificationSessionListParams{} + params.Limit = stripe.Int64(3) + result := identity_verificationsession.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestCouponCreate(t *testing.T) { - params := &stripe.CouponParams{ - PercentOff: stripe.Float64(25.5), - Duration: stripe.String(string(stripe.CouponDurationRepeating)), - DurationInMonths: stripe.Int64(3), +func TestIdentityVerificationSessionCreate(t *testing.T) { + params := &stripe.IdentityVerificationSessionParams{ + Type: stripe.String(string(stripe.IdentityVerificationSessionTypeDocument)), } - result, _ := coupon.New(params) + result, _ := identity_verificationsession.New(params) assert.NotNil(t, result) } -func TestCouponRetrieve(t *testing.T) { - params := &stripe.CouponParams{} - result, _ := coupon.Get("Z4OV52SU", params) +func TestIdentityVerificationSessionRetrieve(t *testing.T) { + params := &stripe.IdentityVerificationSessionParams{} + result, _ := identity_verificationsession.Get("vs_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestCouponUpdate(t *testing.T) { - params := &stripe.CouponParams{} - params.AddMetadata("order_id", "6735") - result, _ := coupon.Update("Z4OV52SU", params) +func TestIdentityVerificationSessionUpdate(t *testing.T) { + params := &stripe.IdentityVerificationSessionParams{ + Type: stripe.String(string(stripe.IdentityVerificationSessionTypeIDNumber)), + } + result, _ := identity_verificationsession.Update("vs_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestCouponDelete(t *testing.T) { - params := &stripe.CouponParams{} - result, _ := coupon.Del("Z4OV52SU", params) +func TestIdentityVerificationSessionCancel(t *testing.T) { + params := &stripe.IdentityVerificationSessionCancelParams{} + result, _ := identity_verificationsession.Cancel("vs_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestCouponList(t *testing.T) { - params := &stripe.CouponListParams{} - params.Limit = stripe.Int64(3) - result := coupon.List(params) - assert.NotNil(t, result) - assert.Nil(t, result.Err()) -} - -func TestPromotionCodeCreate(t *testing.T) { - params := &stripe.PromotionCodeParams{Coupon: stripe.String("Z4OV52SU")} - result, _ := promotioncode.New(params) - assert.NotNil(t, result) -} - -func TestPromotionCodeUpdate(t *testing.T) { - params := &stripe.PromotionCodeParams{} - params.AddMetadata("order_id", "6735") - result, _ := promotioncode.Update("promo_xxxxxxxxxxxxx", params) - assert.NotNil(t, result) -} - -func TestPromotionCodeRetrieve(t *testing.T) { - params := &stripe.PromotionCodeParams{} - result, _ := promotioncode.Get("promo_xxxxxxxxxxxxx", params) - assert.NotNil(t, result) -} - -func TestPromotionCodeList(t *testing.T) { - params := &stripe.PromotionCodeListParams{} - params.Limit = stripe.Int64(3) - result := promotioncode.List(params) +func TestIdentityVerificationSessionRedact(t *testing.T) { + params := &stripe.IdentityVerificationSessionRedactParams{} + result, _ := identity_verificationsession.Redact("vs_xxxxxxxxxxxxx", params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } -func TestTaxCodeList(t *testing.T) { - params := &stripe.TaxCodeListParams{} +func TestInvoiceItemList(t *testing.T) { + params := &stripe.InvoiceItemListParams{} params.Limit = stripe.Int64(3) - result := taxcode.List(params) + result := invoiceitem.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestTaxCodeRetrieve(t *testing.T) { - params := &stripe.TaxCodeParams{} - result, _ := taxcode.Get("txcd_xxxxxxxxxxxxx", params) +func TestInvoiceItemCreate(t *testing.T) { + params := &stripe.InvoiceItemParams{ + Customer: stripe.String("cus_xxxxxxxxxxxxx"), + Price: stripe.String("price_xxxxxxxxxxxxx"), + } + result, _ := invoiceitem.New(params) assert.NotNil(t, result) } -func TestTaxRateCreate(t *testing.T) { - params := &stripe.TaxRateParams{ - DisplayName: stripe.String("VAT"), - Description: stripe.String("VAT Germany"), - Jurisdiction: stripe.String("DE"), - Percentage: stripe.Float64(16), - Inclusive: stripe.Bool(false), - } - result, _ := taxrate.New(params) +func TestInvoiceItemDelete(t *testing.T) { + params := &stripe.InvoiceItemParams{} + result, _ := invoiceitem.Del("ii_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTaxRateRetrieve(t *testing.T) { - params := &stripe.TaxRateParams{} - result, _ := taxrate.Get("txr_xxxxxxxxxxxxx", params) +func TestInvoiceItemRetrieve(t *testing.T) { + params := &stripe.InvoiceItemParams{} + result, _ := invoiceitem.Get("ii_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTaxRateUpdate(t *testing.T) { - params := &stripe.TaxRateParams{Active: stripe.Bool(false)} - result, _ := taxrate.Update("txr_xxxxxxxxxxxxx", params) +func TestInvoiceItemUpdate(t *testing.T) { + params := &stripe.InvoiceItemParams{} + params.AddMetadata("order_id", "6735") + result, _ := invoiceitem.Update("ii_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTaxRateList(t *testing.T) { - params := &stripe.TaxRateListParams{} +func TestInvoiceList(t *testing.T) { + params := &stripe.InvoiceListParams{} params.Limit = stripe.Int64(3) - result := taxrate.List(params) + result := invoice.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestShippingRateCreate2(t *testing.T) { - params := &stripe.ShippingRateParams{ - DisplayName: stripe.String("Ground shipping"), - Type: stripe.String("fixed_amount"), - FixedAmount: &stripe.ShippingRateFixedAmountParams{ - Amount: stripe.Int64(500), - Currency: stripe.String(string(stripe.CurrencyUSD)), - }, - } - result, _ := shippingrate.New(params) +func TestInvoiceCreate(t *testing.T) { + params := &stripe.InvoiceParams{Customer: stripe.String("cus_xxxxxxxxxxxxx")} + result, _ := invoice.New(params) assert.NotNil(t, result) } -func TestShippingRateRetrieve(t *testing.T) { - params := &stripe.ShippingRateParams{} - result, _ := shippingrate.Get("shr_xxxxxxxxxxxxx", params) +func TestInvoiceDelete(t *testing.T) { + params := &stripe.InvoiceParams{} + result, _ := invoice.Del("in_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestShippingRateUpdate(t *testing.T) { - params := &stripe.ShippingRateParams{} - params.AddMetadata("order_id", "6735") - result, _ := shippingrate.Update("shr_xxxxxxxxxxxxx", params) +func TestInvoiceRetrieve(t *testing.T) { + params := &stripe.InvoiceParams{} + result, _ := invoice.Get("in_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestShippingRateList2(t *testing.T) { - params := &stripe.ShippingRateListParams{} - params.Limit = stripe.Int64(3) - result := shippingrate.List(params) +func TestInvoiceUpdate(t *testing.T) { + params := &stripe.InvoiceParams{} + params.AddMetadata("order_id", "6735") + result, _ := invoice.Update("in_xxxxxxxxxxxxx", params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } -func TestCheckoutSessionExpire2(t *testing.T) { - params := &stripe.CheckoutSessionExpireParams{} - result, _ := checkout_session.Expire("cs_test_xxxxxxxxxxxxx", params) +func TestInvoiceFinalizeInvoice(t *testing.T) { + params := &stripe.InvoiceFinalizeParams{} + result, _ := invoice.FinalizeInvoice("in_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestCheckoutSessionRetrieve(t *testing.T) { - params := &stripe.CheckoutSessionParams{} - result, _ := checkout_session.Get("cs_test_xxxxxxxxxxxxx", params) +func TestInvoiceMarkUncollectible(t *testing.T) { + params := &stripe.InvoiceMarkUncollectibleParams{} + result, _ := invoice.MarkUncollectible("in_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestCheckoutSessionList(t *testing.T) { - params := &stripe.CheckoutSessionListParams{} - params.Limit = stripe.Int64(3) - result := checkout_session.List(params) +func TestInvoicePay(t *testing.T) { + params := &stripe.InvoicePayParams{} + result, _ := invoice.Pay("in_xxxxxxxxxxxxx", params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } -func TestPaymentLinkCreate2(t *testing.T) { - params := &stripe.PaymentLinkParams{ - LineItems: []*stripe.PaymentLinkLineItemParams{ - &stripe.PaymentLinkLineItemParams{ - Price: stripe.String("price_xxxxxxxxxxxxx"), - Quantity: stripe.Int64(1), - }, - }, - } - result, _ := paymentlink.New(params) +func TestInvoiceSendInvoice(t *testing.T) { + params := &stripe.InvoiceSendParams{} + result, _ := invoice.SendInvoice("in_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestPaymentLinkRetrieve2(t *testing.T) { - params := &stripe.PaymentLinkParams{} - result, _ := paymentlink.Get("plink_xxxxxxxxxxxxx", params) +func TestInvoiceVoidInvoice(t *testing.T) { + params := &stripe.InvoiceVoidParams{} + result, _ := invoice.VoidInvoice("in_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestPaymentLinkUpdate(t *testing.T) { - params := &stripe.PaymentLinkParams{Active: stripe.Bool(false)} - result, _ := paymentlink.Update("plink_xxxxxxxxxxxxx", params) +func TestInvoiceSearch(t *testing.T) { + params := &stripe.InvoiceSearchParams{ + SearchParams: stripe.SearchParams{ + Query: "total>999 AND metadata['order_id']:'6735'", + }, + } + result := invoice.Search(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } -func TestPaymentLinkList(t *testing.T) { - params := &stripe.PaymentLinkListParams{} +func TestIssuingAuthorizationList(t *testing.T) { + params := &stripe.IssuingAuthorizationListParams{} params.Limit = stripe.Int64(3) - result := paymentlink.List(params) + result := issuing_authorization.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestCustomerBalanceTransactionCreate(t *testing.T) { - params := &stripe.CustomerBalanceTransactionParams{ - Amount: stripe.Int64(-500), - Currency: stripe.String(string(stripe.CurrencyUSD)), - } - result, _ := customerbalancetransaction.New(params) +func TestIssuingAuthorizationRetrieve(t *testing.T) { + params := &stripe.IssuingAuthorizationParams{} + result, _ := issuing_authorization.Get("iauth_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestCustomerBalanceTransactionRetrieve(t *testing.T) { - params := &stripe.CustomerBalanceTransactionParams{ - Customer: stripe.String("cus_xxxxxxxxxxxxx"), - } - result, _ := customerbalancetransaction.Get("cbtxn_xxxxxxxxxxxxx", params) +func TestIssuingAuthorizationUpdate(t *testing.T) { + params := &stripe.IssuingAuthorizationParams{} + params.AddMetadata("order_id", "6735") + result, _ := issuing_authorization.Update("iauth_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestCustomerBalanceTransactionUpdate(t *testing.T) { - params := &stripe.CustomerBalanceTransactionParams{ - Customer: stripe.String("cus_xxxxxxxxxxxxx"), - } - params.AddMetadata("order_id", "6735") - result, _ := customerbalancetransaction.Update("cbtxn_xxxxxxxxxxxxx", params) +func TestIssuingAuthorizationApprove(t *testing.T) { + params := &stripe.IssuingAuthorizationApproveParams{} + result, _ := issuing_authorization.Approve("iauth_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestCustomerBalanceTransactionList(t *testing.T) { - params := &stripe.CustomerBalanceTransactionListParams{ - Customer: stripe.String("cus_xxxxxxxxxxxxx"), - } - params.Limit = stripe.Int64(3) - result := customerbalancetransaction.List(params) +func TestIssuingAuthorizationDecline(t *testing.T) { + params := &stripe.IssuingAuthorizationDeclineParams{} + result, _ := issuing_authorization.Decline("iauth_xxxxxxxxxxxxx", params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } -func TestBillingPortalSessionCreate(t *testing.T) { - params := &stripe.BillingPortalSessionParams{ - Customer: stripe.String("cus_xxxxxxxxxxxxx"), - ReturnURL: stripe.String("https://example.com/account"), - } - result, _ := billingportal_session.New(params) +func TestIssuingCardholderList(t *testing.T) { + params := &stripe.IssuingCardholderListParams{} + params.Limit = stripe.Int64(3) + result := issuing_cardholder.List(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } -func TestBillingPortalConfigurationCreate(t *testing.T) { - params := &stripe.BillingPortalConfigurationParams{ - Features: &stripe.BillingPortalConfigurationFeaturesParams{ - CustomerUpdate: &stripe.BillingPortalConfigurationFeaturesCustomerUpdateParams{ - AllowedUpdates: []*string{ - stripe.String(string(stripe.BillingPortalConfigurationFeaturesCustomerUpdateAllowedUpdateEmail)), - stripe.String(string(stripe.BillingPortalConfigurationFeaturesCustomerUpdateAllowedUpdateTaxID)), - }, - Enabled: stripe.Bool(true), - }, - InvoiceHistory: &stripe.BillingPortalConfigurationFeaturesInvoiceHistoryParams{ - Enabled: stripe.Bool(true), +func TestIssuingCardholderCreate(t *testing.T) { + params := &stripe.IssuingCardholderParams{ + Type: stripe.String(string(stripe.IssuingCardholderTypeIndividual)), + Name: stripe.String("Jenny Rosen"), + Email: stripe.String("jenny.rosen@example.com"), + PhoneNumber: stripe.String("+18888675309"), + Billing: &stripe.IssuingCardholderBillingParams{ + Address: &stripe.AddressParams{ + Line1: stripe.String("1234 Main Street"), + City: stripe.String("San Francisco"), + State: stripe.String("CA"), + Country: stripe.String("US"), + PostalCode: stripe.String("94111"), }, }, - BusinessProfile: &stripe.BillingPortalConfigurationBusinessProfileParams{ - PrivacyPolicyURL: stripe.String("https://example.com/privacy"), - TermsOfServiceURL: stripe.String("https://example.com/terms"), - }, } - result, _ := billingportal_configuration.New(params) + result, _ := issuing_cardholder.New(params) assert.NotNil(t, result) } -func TestBillingPortalConfigurationUpdate(t *testing.T) { - params := &stripe.BillingPortalConfigurationParams{ - BusinessProfile: &stripe.BillingPortalConfigurationBusinessProfileParams{ - PrivacyPolicyURL: stripe.String("https://example.com/privacy"), - TermsOfServiceURL: stripe.String("https://example.com/terms"), - }, - } - result, _ := billingportal_configuration.Update("bpc_xxxxxxxxxxxxx", params) +func TestIssuingCardholderRetrieve(t *testing.T) { + params := &stripe.IssuingCardholderParams{} + result, _ := issuing_cardholder.Get("ich_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestBillingPortalConfigurationRetrieve(t *testing.T) { - params := &stripe.BillingPortalConfigurationParams{} - result, _ := billingportal_configuration.Get("bpc_xxxxxxxxxxxxx", params) +func TestIssuingCardholderUpdate(t *testing.T) { + params := &stripe.IssuingCardholderParams{} + params.AddMetadata("order_id", "6735") + result, _ := issuing_cardholder.Update("ich_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestBillingPortalConfigurationList(t *testing.T) { - params := &stripe.BillingPortalConfigurationListParams{} +func TestIssuingCardList(t *testing.T) { + params := &stripe.IssuingCardListParams{} params.Limit = stripe.Int64(3) - result := billingportal_configuration.List(params) + result := issuing_card.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestTaxIDCreate(t *testing.T) { - params := &stripe.TaxIDParams{ - Type: stripe.String(string(stripe.TaxIDTypeEUVAT)), - Value: stripe.String("DE123456789"), +func TestIssuingCardCreate(t *testing.T) { + params := &stripe.IssuingCardParams{ + Cardholder: stripe.String("ich_xxxxxxxxxxxxx"), + Currency: stripe.String(string(stripe.CurrencyUSD)), + Type: stripe.String(string(stripe.IssuingCardTypeVirtual)), } - result, _ := taxid.New(params) + result, _ := issuing_card.New(params) assert.NotNil(t, result) } -func TestTaxIDRetrieve(t *testing.T) { - params := &stripe.TaxIDParams{Customer: stripe.String("cus_xxxxxxxxxxxxx")} - result, _ := taxid.Get("txi_xxxxxxxxxxxxx", params) +func TestIssuingCardRetrieve(t *testing.T) { + params := &stripe.IssuingCardParams{} + result, _ := issuing_card.Get("ic_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTaxIDDelete(t *testing.T) { - params := &stripe.TaxIDParams{Customer: stripe.String("cus_xxxxxxxxxxxxx")} - result, _ := taxid.Del("txi_xxxxxxxxxxxxx", params) +func TestIssuingCardUpdate(t *testing.T) { + params := &stripe.IssuingCardParams{} + params.AddMetadata("order_id", "6735") + result, _ := issuing_card.Update("ic_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTaxIDList(t *testing.T) { - params := &stripe.TaxIDListParams{ - Customer: stripe.String("cus_xxxxxxxxxxxxx"), - } +func TestIssuingDisputeList(t *testing.T) { + params := &stripe.IssuingDisputeListParams{} params.Limit = stripe.Int64(3) - result := taxid.List(params) + result := issuing_dispute.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestInvoiceCreate(t *testing.T) { - params := &stripe.InvoiceParams{Customer: stripe.String("cus_xxxxxxxxxxxxx")} - result, _ := invoice.New(params) +func TestIssuingDisputeCreate(t *testing.T) { + params := &stripe.IssuingDisputeParams{ + Transaction: stripe.String("ipi_xxxxxxxxxxxxx"), + Evidence: &stripe.IssuingDisputeEvidenceParams{ + Reason: stripe.String(string(stripe.IssuingDisputeEvidenceReasonFraudulent)), + Fraudulent: &stripe.IssuingDisputeEvidenceFraudulentParams{ + Explanation: stripe.String("Purchase was unrecognized."), + }, + }, + } + result, _ := issuing_dispute.New(params) assert.NotNil(t, result) } -func TestInvoiceRetrieve(t *testing.T) { - params := &stripe.InvoiceParams{} - result, _ := invoice.Get("in_xxxxxxxxxxxxx", params) +func TestIssuingDisputeRetrieve(t *testing.T) { + params := &stripe.IssuingDisputeParams{} + result, _ := issuing_dispute.Get("idp_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestInvoiceUpdate(t *testing.T) { - params := &stripe.InvoiceParams{} - params.AddMetadata("order_id", "6735") - result, _ := invoice.Update("in_xxxxxxxxxxxxx", params) +func TestIssuingDisputeSubmit(t *testing.T) { + params := &stripe.IssuingDisputeSubmitParams{} + result, _ := issuing_dispute.Submit("idp_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestInvoiceDelete(t *testing.T) { - params := &stripe.InvoiceParams{} - result, _ := invoice.Del("in_xxxxxxxxxxxxx", params) +func TestIssuingTransactionList(t *testing.T) { + params := &stripe.IssuingTransactionListParams{} + params.Limit = stripe.Int64(3) + result := issuing_transaction.List(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } -func TestInvoiceFinalizeInvoice(t *testing.T) { - params := &stripe.InvoiceFinalizeParams{} - result, _ := invoice.FinalizeInvoice("in_xxxxxxxxxxxxx", params) +func TestIssuingTransactionRetrieve(t *testing.T) { + params := &stripe.IssuingTransactionParams{} + result, _ := issuing_transaction.Get("ipi_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestInvoicePay(t *testing.T) { - params := &stripe.InvoicePayParams{} - result, _ := invoice.Pay("in_xxxxxxxxxxxxx", params) +func TestIssuingTransactionUpdate(t *testing.T) { + params := &stripe.IssuingTransactionParams{} + params.AddMetadata("order_id", "6735") + result, _ := issuing_transaction.Update("ipi_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestInvoiceSendInvoice(t *testing.T) { - params := &stripe.InvoiceSendParams{} - result, _ := invoice.SendInvoice("in_xxxxxxxxxxxxx", params) +func TestMandateRetrieve(t *testing.T) { + params := &stripe.MandateParams{} + result, _ := mandate.Get("mandate_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestInvoiceVoidInvoice(t *testing.T) { - params := &stripe.InvoiceVoidParams{} - result, _ := invoice.VoidInvoice("in_xxxxxxxxxxxxx", params) +func TestPaymentIntentList(t *testing.T) { + params := &stripe.PaymentIntentListParams{} + params.Limit = stripe.Int64(3) + result := paymentintent.List(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } -func TestInvoiceMarkUncollectible(t *testing.T) { - params := &stripe.InvoiceMarkUncollectibleParams{} - result, _ := invoice.MarkUncollectible("in_xxxxxxxxxxxxx", params) +func TestPaymentIntentCreate2(t *testing.T) { + params := &stripe.PaymentIntentParams{ + Amount: stripe.Int64(2000), + Currency: stripe.String(string(stripe.CurrencyUSD)), + PaymentMethodTypes: []*string{stripe.String("card")}, + } + result, _ := paymentintent.New(params) assert.NotNil(t, result) } -func TestInvoiceList(t *testing.T) { - params := &stripe.InvoiceListParams{} - params.Limit = stripe.Int64(3) - result := invoice.List(params) +func TestPaymentIntentRetrieve(t *testing.T) { + params := &stripe.PaymentIntentParams{} + result, _ := paymentintent.Get("pi_xxxxxxxxxxxxx", params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } -func TestInvoiceSearch(t *testing.T) { - params := &stripe.InvoiceSearchParams{ - SearchParams: stripe.SearchParams{ - Query: "total>999 AND metadata['order_id']:'6735'", - }, - } - result := invoice.Search(params) +func TestPaymentIntentUpdate(t *testing.T) { + params := &stripe.PaymentIntentParams{} + params.AddMetadata("order_id", "6735") + result, _ := paymentintent.Update("pi_xxxxxxxxxxxxx", params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } -func TestInvoiceItemCreate(t *testing.T) { - params := &stripe.InvoiceItemParams{ - Customer: stripe.String("cus_xxxxxxxxxxxxx"), - Price: stripe.String("price_xxxxxxxxxxxxx"), - } - result, _ := invoiceitem.New(params) +func TestPaymentIntentApplyCustomerBalance(t *testing.T) { + params := &stripe.PaymentIntentApplyCustomerBalanceParams{} + result, _ := paymentintent.ApplyCustomerBalance("pi_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestInvoiceItemRetrieve(t *testing.T) { - params := &stripe.InvoiceItemParams{} - result, _ := invoiceitem.Get("ii_xxxxxxxxxxxxx", params) +func TestPaymentIntentCancel(t *testing.T) { + params := &stripe.PaymentIntentCancelParams{} + result, _ := paymentintent.Cancel("pi_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestInvoiceItemUpdate(t *testing.T) { - params := &stripe.InvoiceItemParams{} - params.AddMetadata("order_id", "6735") - result, _ := invoiceitem.Update("ii_xxxxxxxxxxxxx", params) +func TestPaymentIntentCapture(t *testing.T) { + params := &stripe.PaymentIntentCaptureParams{} + result, _ := paymentintent.Capture("pi_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestInvoiceItemDelete(t *testing.T) { - params := &stripe.InvoiceItemParams{} - result, _ := invoiceitem.Del("ii_xxxxxxxxxxxxx", params) +func TestPaymentIntentConfirm(t *testing.T) { + params := &stripe.PaymentIntentConfirmParams{ + PaymentMethod: stripe.String("pm_card_visa"), + } + result, _ := paymentintent.Confirm("pi_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestInvoiceItemList(t *testing.T) { - params := &stripe.InvoiceItemListParams{} - params.Limit = stripe.Int64(3) - result := invoiceitem.List(params) +func TestPaymentIntentIncrementAuthorization(t *testing.T) { + params := &stripe.PaymentIntentIncrementAuthorizationParams{ + Amount: stripe.Int64(2099), + } + result, _ := paymentintent.IncrementAuthorization("pi_xxxxxxxxxxxxx", params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } -func TestPlanCreate(t *testing.T) { - params := &stripe.PlanParams{ - Amount: stripe.Int64(2000), - Currency: stripe.String(string(stripe.CurrencyUSD)), - Interval: stripe.String(string(stripe.PlanIntervalMonth)), - Product: &stripe.PlanProductParams{ID: stripe.String("prod_xxxxxxxxxxxxx")}, +func TestPaymentIntentSearch(t *testing.T) { + params := &stripe.PaymentIntentSearchParams{ + SearchParams: stripe.SearchParams{ + Query: "status:'succeeded' AND metadata['order_id']:'6735'", + }, } - result, _ := plan.New(params) + result := paymentintent.Search(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } -func TestPlanRetrieve(t *testing.T) { - params := &stripe.PlanParams{} - result, _ := plan.Get("price_xxxxxxxxxxxxx", params) +func TestPaymentLinkList(t *testing.T) { + params := &stripe.PaymentLinkListParams{} + params.Limit = stripe.Int64(3) + result := paymentlink.List(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } -func TestPlanUpdate(t *testing.T) { - params := &stripe.PlanParams{} - params.AddMetadata("order_id", "6735") - result, _ := plan.Update("price_xxxxxxxxxxxxx", params) +func TestPaymentLinkCreate2(t *testing.T) { + params := &stripe.PaymentLinkParams{ + LineItems: []*stripe.PaymentLinkLineItemParams{ + &stripe.PaymentLinkLineItemParams{ + Price: stripe.String("price_xxxxxxxxxxxxx"), + Quantity: stripe.Int64(1), + }, + }, + } + result, _ := paymentlink.New(params) assert.NotNil(t, result) } -func TestPlanDelete(t *testing.T) { - params := &stripe.PlanParams{} - result, _ := plan.Del("price_xxxxxxxxxxxxx", params) +func TestPaymentLinkRetrieve2(t *testing.T) { + params := &stripe.PaymentLinkParams{} + result, _ := paymentlink.Get("plink_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestPlanList(t *testing.T) { - params := &stripe.PlanListParams{} - params.Limit = stripe.Int64(3) - result := plan.List(params) +func TestPaymentLinkUpdate(t *testing.T) { + params := &stripe.PaymentLinkParams{Active: stripe.Bool(false)} + result, _ := paymentlink.Update("plink_xxxxxxxxxxxxx", params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } -func TestQuoteCreate(t *testing.T) { - params := &stripe.QuoteParams{ +func TestPaymentMethodList(t *testing.T) { + params := &stripe.PaymentMethodListParams{ Customer: stripe.String("cus_xxxxxxxxxxxxx"), - LineItems: []*stripe.QuoteLineItemParams{ - &stripe.QuoteLineItemParams{ - Price: stripe.String("price_xxxxxxxxxxxxx"), - Quantity: stripe.Int64(2), - }, - }, + Type: stripe.String(string(stripe.PaymentMethodTypeCard)), } - result, _ := quote.New(params) + result := paymentmethod.List(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } -func TestQuoteRetrieve(t *testing.T) { - params := &stripe.QuoteParams{} - result, _ := quote.Get("qt_xxxxxxxxxxxxx", params) +func TestPaymentMethodRetrieve(t *testing.T) { + params := &stripe.PaymentMethodParams{} + result, _ := paymentmethod.Get("pm_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestQuoteUpdate(t *testing.T) { - params := &stripe.QuoteParams{} +func TestPaymentMethodUpdate(t *testing.T) { + params := &stripe.PaymentMethodParams{} params.AddMetadata("order_id", "6735") - result, _ := quote.Update("qt_xxxxxxxxxxxxx", params) - assert.NotNil(t, result) -} - -func TestQuoteFinalizeQuote(t *testing.T) { - params := &stripe.QuoteFinalizeQuoteParams{} - result, _ := quote.FinalizeQuote("qt_xxxxxxxxxxxxx", params) + result, _ := paymentmethod.Update("pm_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestQuoteAccept(t *testing.T) { - params := &stripe.QuoteAcceptParams{} - result, _ := quote.Accept("qt_xxxxxxxxxxxxx", params) +func TestPaymentMethodAttach(t *testing.T) { + params := &stripe.PaymentMethodAttachParams{ + Customer: stripe.String("cus_xxxxxxxxxxxxx"), + } + result, _ := paymentmethod.Attach("pm_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestQuoteCancel(t *testing.T) { - params := &stripe.QuoteCancelParams{} - result, _ := quote.Cancel("qt_xxxxxxxxxxxxx", params) +func TestPaymentMethodDetach(t *testing.T) { + params := &stripe.PaymentMethodDetachParams{} + result, _ := paymentmethod.Detach("pm_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestQuoteList(t *testing.T) { - params := &stripe.QuoteListParams{} +func TestPayoutList(t *testing.T) { + params := &stripe.PayoutListParams{} params.Limit = stripe.Int64(3) - result := quote.List(params) + result := payout.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestTestHelpersTestClockCreate2(t *testing.T) { - params := &stripe.TestHelpersTestClockParams{ - FrozenTime: stripe.Int64(1577836800), +func TestPayoutCreate(t *testing.T) { + params := &stripe.PayoutParams{ + Amount: stripe.Int64(1100), + Currency: stripe.String(string(stripe.CurrencyUSD)), } - result, _ := testhelpers_testclock.New(params) - assert.NotNil(t, result) -} - -func TestTestHelpersTestClockRetrieve2(t *testing.T) { - params := &stripe.TestHelpersTestClockParams{} - result, _ := testhelpers_testclock.Get("clock_xxxxxxxxxxxxx", params) + result, _ := payout.New(params) assert.NotNil(t, result) } -func TestTestHelpersTestClockDelete2(t *testing.T) { - params := &stripe.TestHelpersTestClockParams{} - result, _ := testhelpers_testclock.Del("clock_xxxxxxxxxxxxx", params) +func TestPayoutRetrieve(t *testing.T) { + params := &stripe.PayoutParams{} + result, _ := payout.Get("po_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTestHelpersTestClockAdvance2(t *testing.T) { - params := &stripe.TestHelpersTestClockAdvanceParams{ - FrozenTime: stripe.Int64(1652390605), - } - result, _ := testhelpers_testclock.Advance("clock_xxxxxxxxxxxxx", params) +func TestPayoutUpdate(t *testing.T) { + params := &stripe.PayoutParams{} + params.AddMetadata("order_id", "6735") + result, _ := payout.Update("po_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTestHelpersTestClockList2(t *testing.T) { - params := &stripe.TestHelpersTestClockListParams{} - params.Limit = stripe.Int64(3) - result := testhelpers_testclock.List(params) +func TestPayoutCancel(t *testing.T) { + params := &stripe.PayoutParams{} + result, _ := payout.Cancel("po_xxxxxxxxxxxxx", params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } -func TestUsageRecordCreate(t *testing.T) { - params := &stripe.UsageRecordParams{ - Quantity: stripe.Int64(100), - Timestamp: stripe.Int64(1571252444), - } - result, _ := usagerecord.New(params) +func TestPayoutReverse(t *testing.T) { + params := &stripe.PayoutReverseParams{} + result, _ := payout.Reverse("po_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestUsageRecordSummaryList(t *testing.T) { - params := &stripe.UsageRecordSummaryListParams{ - SubscriptionItem: stripe.String("si_xxxxxxxxxxxxx"), - } +func TestPlanList(t *testing.T) { + params := &stripe.PlanListParams{} params.Limit = stripe.Int64(3) - result := usagerecordsummary.List(params) + result := plan.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestAccountCreate(t *testing.T) { - params := &stripe.AccountParams{ - Type: stripe.String(string(stripe.AccountTypeCustom)), - Country: stripe.String("US"), - Email: stripe.String("jenny.rosen@example.com"), - Capabilities: &stripe.AccountCapabilitiesParams{ - CardPayments: &stripe.AccountCapabilitiesCardPaymentsParams{ - Requested: stripe.Bool(true), - }, - Transfers: &stripe.AccountCapabilitiesTransfersParams{ - Requested: stripe.Bool(true), - }, - }, +func TestPlanCreate(t *testing.T) { + params := &stripe.PlanParams{ + Amount: stripe.Int64(2000), + Currency: stripe.String(string(stripe.CurrencyUSD)), + Interval: stripe.String(string(stripe.PlanIntervalMonth)), + Product: &stripe.PlanProductParams{ID: stripe.String("prod_xxxxxxxxxxxxx")}, } - result, _ := account.New(params) - assert.NotNil(t, result) -} - -func TestAccountRetrieve(t *testing.T) { - params := &stripe.AccountParams{} - result, _ := account.GetByID("acct_xxxxxxxxxxxxx", params) + result, _ := plan.New(params) assert.NotNil(t, result) } -func TestAccountUpdate(t *testing.T) { - params := &stripe.AccountParams{} - params.AddMetadata("order_id", "6735") - result, _ := account.Update("acct_xxxxxxxxxxxxx", params) +func TestPlanDelete(t *testing.T) { + params := &stripe.PlanParams{} + result, _ := plan.Del("price_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestAccountDelete(t *testing.T) { - params := &stripe.AccountParams{} - result, _ := account.Del("acct_xxxxxxxxxxxxx", params) +func TestPlanRetrieve(t *testing.T) { + params := &stripe.PlanParams{} + result, _ := plan.Get("price_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestAccountReject(t *testing.T) { - params := &stripe.AccountRejectParams{Reason: stripe.String("fraud")} - result, _ := account.Reject("acct_xxxxxxxxxxxxx", params) +func TestPlanUpdate(t *testing.T) { + params := &stripe.PlanParams{} + params.AddMetadata("order_id", "6735") + result, _ := plan.Update("price_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestAccountList(t *testing.T) { - params := &stripe.AccountListParams{} +func TestPriceList(t *testing.T) { + params := &stripe.PriceListParams{} params.Limit = stripe.Int64(3) - result := account.List(params) + result := price.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestAccountLinkCreate(t *testing.T) { - params := &stripe.AccountLinkParams{ - Account: stripe.String("acct_xxxxxxxxxxxxx"), - RefreshURL: stripe.String("https://example.com/reauth"), - ReturnURL: stripe.String("https://example.com/return"), - Type: stripe.String("account_onboarding"), +func TestPriceCreate2(t *testing.T) { + params := &stripe.PriceParams{ + UnitAmount: stripe.Int64(2000), + Currency: stripe.String(string(stripe.CurrencyUSD)), + Recurring: &stripe.PriceRecurringParams{ + Interval: stripe.String(string(stripe.PriceRecurringIntervalMonth)), + }, + Product: stripe.String("prod_xxxxxxxxxxxxx"), } - result, _ := accountlink.New(params) + result, _ := price.New(params) assert.NotNil(t, result) } -func TestCapabilityRetrieve(t *testing.T) { - params := &stripe.CapabilityParams{ - Account: stripe.String("acct_xxxxxxxxxxxxx"), - } - result, _ := capability.Get("card_payments", params) +func TestPriceRetrieve(t *testing.T) { + params := &stripe.PriceParams{} + result, _ := price.Get("price_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestCapabilityUpdate(t *testing.T) { - params := &stripe.CapabilityParams{ - Requested: stripe.Bool(true), - Account: stripe.String("acct_xxxxxxxxxxxxx"), - } - result, _ := capability.Update("card_payments", params) +func TestPriceUpdate(t *testing.T) { + params := &stripe.PriceParams{} + params.AddMetadata("order_id", "6735") + result, _ := price.Update("price_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestCapabilityList(t *testing.T) { - params := &stripe.CapabilityListParams{ - Account: stripe.String("acct_xxxxxxxxxxxxx"), +func TestPriceSearch(t *testing.T) { + params := &stripe.PriceSearchParams{ + SearchParams: stripe.SearchParams{ + Query: "active:'true' AND metadata['order_id']:'6735'", + }, } - result := capability.List(params) + result := price.Search(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestCountrySpecList(t *testing.T) { - params := &stripe.CountrySpecListParams{} +func TestProductList(t *testing.T) { + params := &stripe.ProductListParams{} params.Limit = stripe.Int64(3) - result := countryspec.List(params) + result := product.List(params) + assert.NotNil(t, result) + assert.Nil(t, result.Err()) +} + +func TestProductCreate(t *testing.T) { + params := &stripe.ProductParams{Name: stripe.String("Gold Special")} + result, _ := product.New(params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } -func TestCountrySpecRetrieve(t *testing.T) { - params := &stripe.CountrySpecParams{} - result, _ := countryspec.Get("US", params) +func TestProductDelete(t *testing.T) { + params := &stripe.ProductParams{} + result, _ := product.Del("prod_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestPersonCreate(t *testing.T) { - params := &stripe.PersonParams{ - FirstName: stripe.String("Jane"), - LastName: stripe.String("Diaz"), - } - result, _ := person.New(params) +func TestProductRetrieve(t *testing.T) { + params := &stripe.ProductParams{} + result, _ := product.Get("prod_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestPersonUpdate(t *testing.T) { - params := &stripe.PersonParams{Account: stripe.String("acct_xxxxxxxxxxxxx")} +func TestProductUpdate(t *testing.T) { + params := &stripe.ProductParams{} params.AddMetadata("order_id", "6735") - result, _ := person.Update("person_xxxxxxxxxxxxx", params) + result, _ := product.Update("prod_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestPersonList(t *testing.T) { - params := &stripe.PersonListParams{ - Account: stripe.String("acct_xxxxxxxxxxxxx"), +func TestProductSearch(t *testing.T) { + params := &stripe.ProductSearchParams{ + SearchParams: stripe.SearchParams{ + Query: "active:'true' AND metadata['order_id']:'6735'", + }, } + result := product.Search(params) + assert.NotNil(t, result) + assert.Nil(t, result.Err()) +} + +func TestPromotionCodeList(t *testing.T) { + params := &stripe.PromotionCodeListParams{} params.Limit = stripe.Int64(3) - result := person.List(params) + result := promotioncode.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestTopupCreate(t *testing.T) { - params := &stripe.TopupParams{ - Amount: stripe.Int64(2000), - Currency: stripe.String(string(stripe.CurrencyUSD)), - Description: stripe.String("Top-up for Jenny Rosen"), - StatementDescriptor: stripe.String("Top-up"), - } - result, _ := topup.New(params) +func TestPromotionCodeCreate(t *testing.T) { + params := &stripe.PromotionCodeParams{Coupon: stripe.String("Z4OV52SU")} + result, _ := promotioncode.New(params) assert.NotNil(t, result) } -func TestTopupRetrieve(t *testing.T) { - params := &stripe.TopupParams{} - result, _ := topup.Get("tu_xxxxxxxxxxxxx", params) +func TestPromotionCodeRetrieve(t *testing.T) { + params := &stripe.PromotionCodeParams{} + result, _ := promotioncode.Get("promo_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTopupUpdate(t *testing.T) { - params := &stripe.TopupParams{} +func TestPromotionCodeUpdate(t *testing.T) { + params := &stripe.PromotionCodeParams{} params.AddMetadata("order_id", "6735") - result, _ := topup.Update("tu_xxxxxxxxxxxxx", params) + result, _ := promotioncode.Update("promo_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTopupList(t *testing.T) { - params := &stripe.TopupListParams{} +func TestQuoteList(t *testing.T) { + params := &stripe.QuoteListParams{} params.Limit = stripe.Int64(3) - result := topup.List(params) + result := quote.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestTransferCreate(t *testing.T) { - params := &stripe.TransferParams{ - Amount: stripe.Int64(400), - Currency: stripe.String(string(stripe.CurrencyUSD)), - Destination: stripe.String("acct_xxxxxxxxxxxxx"), - TransferGroup: stripe.String("ORDER_95"), +func TestQuoteCreate(t *testing.T) { + params := &stripe.QuoteParams{ + Customer: stripe.String("cus_xxxxxxxxxxxxx"), + LineItems: []*stripe.QuoteLineItemParams{ + &stripe.QuoteLineItemParams{ + Price: stripe.String("price_xxxxxxxxxxxxx"), + Quantity: stripe.Int64(2), + }, + }, } - result, _ := transfer.New(params) + result, _ := quote.New(params) assert.NotNil(t, result) } -func TestTransferRetrieve(t *testing.T) { - params := &stripe.TransferParams{} - result, _ := transfer.Get("tr_xxxxxxxxxxxxx", params) +func TestQuoteRetrieve(t *testing.T) { + params := &stripe.QuoteParams{} + result, _ := quote.Get("qt_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTransferUpdate(t *testing.T) { - params := &stripe.TransferParams{} +func TestQuoteUpdate(t *testing.T) { + params := &stripe.QuoteParams{} params.AddMetadata("order_id", "6735") - result, _ := transfer.Update("tr_xxxxxxxxxxxxx", params) - assert.NotNil(t, result) -} - -func TestTransferList(t *testing.T) { - params := &stripe.TransferListParams{} - params.Limit = stripe.Int64(3) - result := transfer.List(params) + result, _ := quote.Update("qt_xxxxxxxxxxxxx", params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } -func TestReversalCreate(t *testing.T) { - params := &stripe.ReversalParams{Amount: stripe.Int64(100)} - result, _ := reversal.New(params) +func TestQuoteAccept(t *testing.T) { + params := &stripe.QuoteAcceptParams{} + result, _ := quote.Accept("qt_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestReversalRetrieve(t *testing.T) { - params := &stripe.ReversalParams{Transfer: stripe.String("tr_xxxxxxxxxxxxx")} - result, _ := reversal.Get("trr_xxxxxxxxxxxxx", params) +func TestQuoteCancel(t *testing.T) { + params := &stripe.QuoteCancelParams{} + result, _ := quote.Cancel("qt_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestReversalUpdate(t *testing.T) { - params := &stripe.ReversalParams{Transfer: stripe.String("tr_xxxxxxxxxxxxx")} - params.AddMetadata("order_id", "6735") - result, _ := reversal.Update("trr_xxxxxxxxxxxxx", params) +func TestQuoteFinalizeQuote(t *testing.T) { + params := &stripe.QuoteFinalizeQuoteParams{} + result, _ := quote.FinalizeQuote("qt_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestReversalList(t *testing.T) { - params := &stripe.ReversalListParams{ - Transfer: stripe.String("tr_xxxxxxxxxxxxx"), - } +func TestRadarEarlyFraudWarningList(t *testing.T) { + params := &stripe.RadarEarlyFraudWarningListParams{} params.Limit = stripe.Int64(3) - result := reversal.List(params) + result := radar_earlyfraudwarning.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } @@ -1774,312 +1817,282 @@ func TestRadarEarlyFraudWarningRetrieve(t *testing.T) { assert.NotNil(t, result) } -func TestRadarEarlyFraudWarningList(t *testing.T) { - params := &stripe.RadarEarlyFraudWarningListParams{} +func TestRefundList(t *testing.T) { + params := &stripe.RefundListParams{} params.Limit = stripe.Int64(3) - result := radar_earlyfraudwarning.List(params) + result := refund.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestReviewApprove(t *testing.T) { - params := &stripe.ReviewApproveParams{} - result, _ := review.Approve("prv_xxxxxxxxxxxxx", params) +func TestRefundCreate(t *testing.T) { + params := &stripe.RefundParams{Charge: stripe.String("ch_xxxxxxxxxxxxx")} + result, _ := refund.New(params) assert.NotNil(t, result) } -func TestReviewRetrieve(t *testing.T) { - params := &stripe.ReviewParams{} - result, _ := review.Get("prv_xxxxxxxxxxxxx", params) +func TestRefundRetrieve(t *testing.T) { + params := &stripe.RefundParams{} + result, _ := refund.Get("re_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestReviewList(t *testing.T) { - params := &stripe.ReviewListParams{} - params.Limit = stripe.Int64(3) - result := review.List(params) +func TestRefundUpdate(t *testing.T) { + params := &stripe.RefundParams{} + params.AddMetadata("order_id", "6735") + result, _ := refund.Update("re_xxxxxxxxxxxxx", params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } -func TestIssuingAuthorizationRetrieve(t *testing.T) { - params := &stripe.IssuingAuthorizationParams{} - result, _ := issuing_authorization.Get("iauth_xxxxxxxxxxxxx", params) +func TestRefundCancel(t *testing.T) { + params := &stripe.RefundCancelParams{} + result, _ := refund.Cancel("re_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestIssuingAuthorizationUpdate(t *testing.T) { - params := &stripe.IssuingAuthorizationParams{} - params.AddMetadata("order_id", "6735") - result, _ := issuing_authorization.Update("iauth_xxxxxxxxxxxxx", params) +func TestReviewList(t *testing.T) { + params := &stripe.ReviewListParams{} + params.Limit = stripe.Int64(3) + result := review.List(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } -func TestIssuingAuthorizationApprove(t *testing.T) { - params := &stripe.IssuingAuthorizationApproveParams{} - result, _ := issuing_authorization.Approve("iauth_xxxxxxxxxxxxx", params) +func TestReviewRetrieve(t *testing.T) { + params := &stripe.ReviewParams{} + result, _ := review.Get("prv_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestIssuingAuthorizationDecline(t *testing.T) { - params := &stripe.IssuingAuthorizationDeclineParams{} - result, _ := issuing_authorization.Decline("iauth_xxxxxxxxxxxxx", params) +func TestReviewApprove(t *testing.T) { + params := &stripe.ReviewApproveParams{} + result, _ := review.Approve("prv_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestIssuingAuthorizationList(t *testing.T) { - params := &stripe.IssuingAuthorizationListParams{} +func TestSetupIntentList(t *testing.T) { + params := &stripe.SetupIntentListParams{} params.Limit = stripe.Int64(3) - result := issuing_authorization.List(params) + result := setupintent.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestIssuingCardholderCreate(t *testing.T) { - params := &stripe.IssuingCardholderParams{ - Type: stripe.String(string(stripe.IssuingCardholderTypeIndividual)), - Name: stripe.String("Jenny Rosen"), - Email: stripe.String("jenny.rosen@example.com"), - PhoneNumber: stripe.String("+18888675309"), - Billing: &stripe.IssuingCardholderBillingParams{ - Address: &stripe.AddressParams{ - Line1: stripe.String("1234 Main Street"), - City: stripe.String("San Francisco"), - State: stripe.String("CA"), - Country: stripe.String("US"), - PostalCode: stripe.String("94111"), - }, - }, +func TestSetupIntentCreate(t *testing.T) { + params := &stripe.SetupIntentParams{ + PaymentMethodTypes: []*string{stripe.String("card")}, } - result, _ := issuing_cardholder.New(params) - assert.NotNil(t, result) -} - -func TestIssuingCardholderRetrieve(t *testing.T) { - params := &stripe.IssuingCardholderParams{} - result, _ := issuing_cardholder.Get("ich_xxxxxxxxxxxxx", params) - assert.NotNil(t, result) -} - -func TestIssuingCardholderUpdate(t *testing.T) { - params := &stripe.IssuingCardholderParams{} - params.AddMetadata("order_id", "6735") - result, _ := issuing_cardholder.Update("ich_xxxxxxxxxxxxx", params) + result, _ := setupintent.New(params) assert.NotNil(t, result) } -func TestIssuingCardholderList(t *testing.T) { - params := &stripe.IssuingCardholderListParams{} - params.Limit = stripe.Int64(3) - result := issuing_cardholder.List(params) +func TestSetupIntentRetrieve(t *testing.T) { + params := &stripe.SetupIntentParams{} + result, _ := setupintent.Get("seti_xxxxxxxxxxxxx", params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } -func TestIssuingCardCreate(t *testing.T) { - params := &stripe.IssuingCardParams{ - Cardholder: stripe.String("ich_xxxxxxxxxxxxx"), - Currency: stripe.String(string(stripe.CurrencyUSD)), - Type: stripe.String(string(stripe.IssuingCardTypeVirtual)), - } - result, _ := issuing_card.New(params) +func TestSetupIntentUpdate(t *testing.T) { + params := &stripe.SetupIntentParams{} + params.AddMetadata("user_id", "3435453") + result, _ := setupintent.Update("seti_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestIssuingCardRetrieve(t *testing.T) { - params := &stripe.IssuingCardParams{} - result, _ := issuing_card.Get("ic_xxxxxxxxxxxxx", params) +func TestSetupIntentCancel(t *testing.T) { + params := &stripe.SetupIntentCancelParams{} + result, _ := setupintent.Cancel("seti_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestIssuingCardUpdate(t *testing.T) { - params := &stripe.IssuingCardParams{} - params.AddMetadata("order_id", "6735") - result, _ := issuing_card.Update("ic_xxxxxxxxxxxxx", params) +func TestSetupIntentConfirm(t *testing.T) { + params := &stripe.SetupIntentConfirmParams{ + PaymentMethod: stripe.String("pm_card_visa"), + } + result, _ := setupintent.Confirm("seti_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestIssuingCardList(t *testing.T) { - params := &stripe.IssuingCardListParams{} +func TestShippingRateList2(t *testing.T) { + params := &stripe.ShippingRateListParams{} params.Limit = stripe.Int64(3) - result := issuing_card.List(params) + result := shippingrate.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestIssuingDisputeCreate(t *testing.T) { - params := &stripe.IssuingDisputeParams{ - Transaction: stripe.String("ipi_xxxxxxxxxxxxx"), - Evidence: &stripe.IssuingDisputeEvidenceParams{ - Reason: stripe.String(string(stripe.IssuingDisputeEvidenceReasonFraudulent)), - Fraudulent: &stripe.IssuingDisputeEvidenceFraudulentParams{ - Explanation: stripe.String("Purchase was unrecognized."), - }, +func TestShippingRateCreate2(t *testing.T) { + params := &stripe.ShippingRateParams{ + DisplayName: stripe.String("Ground shipping"), + Type: stripe.String("fixed_amount"), + FixedAmount: &stripe.ShippingRateFixedAmountParams{ + Amount: stripe.Int64(500), + Currency: stripe.String(string(stripe.CurrencyUSD)), }, } - result, _ := issuing_dispute.New(params) + result, _ := shippingrate.New(params) assert.NotNil(t, result) } -func TestIssuingDisputeSubmit(t *testing.T) { - params := &stripe.IssuingDisputeSubmitParams{} - result, _ := issuing_dispute.Submit("idp_xxxxxxxxxxxxx", params) +func TestShippingRateRetrieve(t *testing.T) { + params := &stripe.ShippingRateParams{} + result, _ := shippingrate.Get("shr_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestIssuingDisputeRetrieve(t *testing.T) { - params := &stripe.IssuingDisputeParams{} - result, _ := issuing_dispute.Get("idp_xxxxxxxxxxxxx", params) +func TestShippingRateUpdate(t *testing.T) { + params := &stripe.ShippingRateParams{} + params.AddMetadata("order_id", "6735") + result, _ := shippingrate.Update("shr_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestIssuingDisputeUpdate(t *testing.T) { - params := &stripe.IssuingDisputeParams{ - Evidence: &stripe.IssuingDisputeEvidenceParams{ - Reason: stripe.String(string(stripe.IssuingDisputeEvidenceReasonNotReceived)), - NotReceived: &stripe.IssuingDisputeEvidenceNotReceivedParams{ - ExpectedAt: stripe.Int64(1590000000), - Explanation: stripe.String(""), - ProductDescription: stripe.String("Baseball cap"), - ProductType: stripe.String(string(stripe.IssuingDisputeEvidenceNotReceivedProductTypeMerchandise)), - }, - }, - } - result, _ := issuing_dispute.Update("idp_xxxxxxxxxxxxx", params) +func TestSigmaScheduledQueryRunList(t *testing.T) { + params := &stripe.SigmaScheduledQueryRunListParams{} + params.Limit = stripe.Int64(3) + result := sigma_scheduledqueryrun.List(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } -func TestIssuingDisputeList(t *testing.T) { - params := &stripe.IssuingDisputeListParams{} - params.Limit = stripe.Int64(3) - result := issuing_dispute.List(params) +func TestSigmaScheduledQueryRunRetrieve(t *testing.T) { + params := &stripe.SigmaScheduledQueryRunParams{} + result, _ := sigma_scheduledqueryrun.Get("sqr_xxxxxxxxxxxxx", params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } -func TestIssuingTransactionRetrieve(t *testing.T) { - params := &stripe.IssuingTransactionParams{} - result, _ := issuing_transaction.Get("ipi_xxxxxxxxxxxxx", params) +func TestSKUList(t *testing.T) { + params := &stripe.SKUListParams{} + params.Limit = stripe.Int64(3) + result := sku.List(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } -func TestIssuingTransactionUpdate(t *testing.T) { - params := &stripe.IssuingTransactionParams{} - params.AddMetadata("order_id", "6735") - result, _ := issuing_transaction.Update("ipi_xxxxxxxxxxxxx", params) +func TestSKUCreate(t *testing.T) { + params := &stripe.SKUParams{ + Attributes: map[string]string{"size": "Medium", "gender": "Unisex"}, + Price: stripe.Int64(1500), + Currency: stripe.String(string(stripe.CurrencyUSD)), + Inventory: &stripe.InventoryParams{ + Type: stripe.String(string(stripe.SKUInventoryTypeFinite)), + Quantity: stripe.Int64(500), + }, + Product: stripe.String("prod_xxxxxxxxxxxxx"), + } + result, _ := sku.New(params) assert.NotNil(t, result) } -func TestIssuingTransactionList(t *testing.T) { - params := &stripe.IssuingTransactionListParams{} - params.Limit = stripe.Int64(3) - result := issuing_transaction.List(params) +func TestSKUDelete(t *testing.T) { + params := &stripe.SKUParams{} + result, _ := sku.Del("sku_xxxxxxxxxxxxx", params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } -func TestTerminalConnectionTokenCreate(t *testing.T) { - params := &stripe.TerminalConnectionTokenParams{} - result, _ := terminal_connectiontoken.New(params) +func TestSKURetrieve(t *testing.T) { + params := &stripe.SKUParams{} + result, _ := sku.Get("sku_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTerminalLocationCreate(t *testing.T) { - params := &stripe.TerminalLocationParams{ - DisplayName: stripe.String("My First Store"), - Address: &stripe.AccountAddressParams{ - Line1: stripe.String("1234 Main Street"), - City: stripe.String("San Francisco"), - Country: stripe.String("US"), - PostalCode: stripe.String("94111"), - }, - } - result, _ := terminal_location.New(params) +func TestSKUUpdate(t *testing.T) { + params := &stripe.SKUParams{} + params.AddMetadata("order_id", "6735") + result, _ := sku.Update("sku_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTerminalLocationRetrieve(t *testing.T) { - params := &stripe.TerminalLocationParams{} - result, _ := terminal_location.Get("tml_xxxxxxxxxxxxx", params) +func TestSourceRetrieve(t *testing.T) { + params := &stripe.SourceObjectParams{} + result, _ := source.Get("src_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTerminalLocationUpdate(t *testing.T) { - params := &stripe.TerminalLocationParams{ - DisplayName: stripe.String("My First Store"), - } - result, _ := terminal_location.Update("tml_xxxxxxxxxxxxx", params) +func TestSourceRetrieve2(t *testing.T) { + params := &stripe.SourceObjectParams{} + result, _ := source.Get("src_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTerminalLocationDelete(t *testing.T) { - params := &stripe.TerminalLocationParams{} - result, _ := terminal_location.Del("tml_xxxxxxxxxxxxx", params) +func TestSourceUpdate(t *testing.T) { + params := &stripe.SourceObjectParams{} + params.AddMetadata("order_id", "6735") + result, _ := source.Update("src_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTerminalLocationList(t *testing.T) { - params := &stripe.TerminalLocationListParams{} +func TestUsageRecordSummaryList(t *testing.T) { + params := &stripe.UsageRecordSummaryListParams{ + SubscriptionItem: stripe.String("si_xxxxxxxxxxxxx"), + } params.Limit = stripe.Int64(3) - result := terminal_location.List(params) + result := usagerecordsummary.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestTerminalReaderCreate(t *testing.T) { - params := &stripe.TerminalReaderParams{ - RegistrationCode: stripe.String("puppies-plug-could"), - Label: stripe.String("Blue Rabbit"), - Location: stripe.String("tml_1234"), +func TestUsageRecordCreate(t *testing.T) { + params := &stripe.UsageRecordParams{ + Quantity: stripe.Int64(100), + Timestamp: stripe.Int64(1571252444), } - result, _ := terminal_reader.New(params) + result, _ := usagerecord.New(params) assert.NotNil(t, result) } -func TestTerminalReaderUpdate(t *testing.T) { - params := &stripe.TerminalReaderParams{Label: stripe.String("Blue Rabbit")} - result, _ := terminal_reader.Update("tmr_xxxxxxxxxxxxx", params) +func TestTaxCodeList(t *testing.T) { + params := &stripe.TaxCodeListParams{} + params.Limit = stripe.Int64(3) + result := taxcode.List(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } -func TestTerminalReaderDelete(t *testing.T) { - params := &stripe.TerminalReaderParams{} - result, _ := terminal_reader.Del("tmr_xxxxxxxxxxxxx", params) +func TestTaxCodeRetrieve(t *testing.T) { + params := &stripe.TaxCodeParams{} + result, _ := taxcode.Get("txcd_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTerminalReaderList(t *testing.T) { - params := &stripe.TerminalReaderListParams{} +func TestTaxRateList(t *testing.T) { + params := &stripe.TaxRateListParams{} params.Limit = stripe.Int64(3) - result := terminal_reader.List(params) + result := taxrate.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestTerminalReaderProcessPaymentIntent(t *testing.T) { - params := &stripe.TerminalReaderProcessPaymentIntentParams{ - PaymentIntent: stripe.String("pi_xxxxxxxxxxxxx"), +func TestTaxRateCreate(t *testing.T) { + params := &stripe.TaxRateParams{ + DisplayName: stripe.String("VAT"), + Description: stripe.String("VAT Germany"), + Jurisdiction: stripe.String("DE"), + Percentage: stripe.Float64(16), + Inclusive: stripe.Bool(false), } - result, _ := terminal_reader.ProcessPaymentIntent( - "tmr_xxxxxxxxxxxxx", - params, - ) + result, _ := taxrate.New(params) assert.NotNil(t, result) } -func TestTerminalReaderProcessSetupIntent(t *testing.T) { - params := &stripe.TerminalReaderProcessSetupIntentParams{ - SetupIntent: stripe.String("seti_xxxxxxxxxxxxx"), - CustomerConsentCollected: stripe.Bool(true), - } - result, _ := terminal_reader.ProcessSetupIntent("tmr_xxxxxxxxxxxxx", params) +func TestTaxRateRetrieve(t *testing.T) { + params := &stripe.TaxRateParams{} + result, _ := taxrate.Get("txr_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTerminalReaderCancelAction(t *testing.T) { - params := &stripe.TerminalReaderCancelActionParams{} - result, _ := terminal_reader.CancelAction("tmr_xxxxxxxxxxxxx", params) +func TestTaxRateUpdate(t *testing.T) { + params := &stripe.TaxRateParams{Active: stripe.Bool(false)} + result, _ := taxrate.Update("txr_xxxxxxxxxxxxx", params) + assert.NotNil(t, result) +} + +func TestTerminalConfigurationList2(t *testing.T) { + params := &stripe.TerminalConfigurationListParams{} + params.Limit = stripe.Int64(3) + result := terminal_configuration.List(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } func TestTerminalConfigurationCreate2(t *testing.T) { @@ -2092,6 +2105,12 @@ func TestTerminalConfigurationCreate2(t *testing.T) { assert.NotNil(t, result) } +func TestTerminalConfigurationDelete2(t *testing.T) { + params := &stripe.TerminalConfigurationParams{} + result, _ := terminal_configuration.Del("tmc_xxxxxxxxxxxxx", params) + assert.NotNil(t, result) +} + func TestTerminalConfigurationRetrieve2(t *testing.T) { params := &stripe.TerminalConfigurationParams{} result, _ := terminal_configuration.Get("tmc_xxxxxxxxxxxxx", params) @@ -2108,452 +2127,501 @@ func TestTerminalConfigurationUpdate2(t *testing.T) { assert.NotNil(t, result) } -func TestTerminalConfigurationDelete2(t *testing.T) { - params := &stripe.TerminalConfigurationParams{} - result, _ := terminal_configuration.Del("tmc_xxxxxxxxxxxxx", params) +func TestTerminalConnectionTokenCreate(t *testing.T) { + params := &stripe.TerminalConnectionTokenParams{} + result, _ := terminal_connectiontoken.New(params) + assert.NotNil(t, result) +} + +func TestTerminalLocationList(t *testing.T) { + params := &stripe.TerminalLocationListParams{} + params.Limit = stripe.Int64(3) + result := terminal_location.List(params) + assert.NotNil(t, result) + assert.Nil(t, result.Err()) +} + +func TestTerminalLocationCreate(t *testing.T) { + params := &stripe.TerminalLocationParams{ + DisplayName: stripe.String("My First Store"), + Address: &stripe.AccountAddressParams{ + Line1: stripe.String("1234 Main Street"), + City: stripe.String("San Francisco"), + Country: stripe.String("US"), + PostalCode: stripe.String("94111"), + }, + } + result, _ := terminal_location.New(params) + assert.NotNil(t, result) +} + +func TestTerminalLocationDelete(t *testing.T) { + params := &stripe.TerminalLocationParams{} + result, _ := terminal_location.Del("tml_xxxxxxxxxxxxx", params) + assert.NotNil(t, result) +} + +func TestTerminalLocationRetrieve(t *testing.T) { + params := &stripe.TerminalLocationParams{} + result, _ := terminal_location.Get("tml_xxxxxxxxxxxxx", params) + assert.NotNil(t, result) +} + +func TestTerminalLocationUpdate(t *testing.T) { + params := &stripe.TerminalLocationParams{ + DisplayName: stripe.String("My First Store"), + } + result, _ := terminal_location.Update("tml_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTerminalConfigurationList2(t *testing.T) { - params := &stripe.TerminalConfigurationListParams{} +func TestTerminalReaderList(t *testing.T) { + params := &stripe.TerminalReaderListParams{} params.Limit = stripe.Int64(3) - result := terminal_configuration.List(params) + result := terminal_reader.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestTreasuryFinancialAccountCreate(t *testing.T) { - params := &stripe.TreasuryFinancialAccountParams{ - SupportedCurrencies: []*string{stripe.String("usd")}, - Features: &stripe.TreasuryFinancialAccountFeaturesParams{}, +func TestTerminalReaderCreate(t *testing.T) { + params := &stripe.TerminalReaderParams{ + RegistrationCode: stripe.String("puppies-plug-could"), + Label: stripe.String("Blue Rabbit"), + Location: stripe.String("tml_1234"), } - result, _ := treasury_financialaccount.New(params) + result, _ := terminal_reader.New(params) assert.NotNil(t, result) } -func TestTreasuryFinancialAccountUpdate(t *testing.T) { - params := &stripe.TreasuryFinancialAccountParams{} - params.AddMetadata("order_id", "6735") - result, _ := treasury_financialaccount.Update("fa_xxxxxxxxxxxxx", params) +func TestTerminalReaderDelete(t *testing.T) { + params := &stripe.TerminalReaderParams{} + result, _ := terminal_reader.Del("tmr_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTreasuryFinancialAccountRetrieve(t *testing.T) { - params := &stripe.TreasuryFinancialAccountParams{} - result, _ := treasury_financialaccount.Get("fa_xxxxxxxxxxxxx", params) +func TestTerminalReaderUpdate(t *testing.T) { + params := &stripe.TerminalReaderParams{Label: stripe.String("Blue Rabbit")} + result, _ := terminal_reader.Update("tmr_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTreasuryFinancialAccountList(t *testing.T) { - params := &stripe.TreasuryFinancialAccountListParams{} - params.Limit = stripe.Int64(3) - result := treasury_financialaccount.List(params) +func TestTerminalReaderCancelAction(t *testing.T) { + params := &stripe.TerminalReaderCancelActionParams{} + result, _ := terminal_reader.CancelAction("tmr_xxxxxxxxxxxxx", params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } -func TestTreasuryFinancialAccountUpdateFeatures(t *testing.T) { - params := &stripe.TreasuryFinancialAccountUpdateFeaturesParams{} - result, _ := treasury_financialaccount.UpdateFeatures( - "fa_xxxxxxxxxxxxx", +func TestTerminalReaderProcessPaymentIntent(t *testing.T) { + params := &stripe.TerminalReaderProcessPaymentIntentParams{ + PaymentIntent: stripe.String("pi_xxxxxxxxxxxxx"), + } + result, _ := terminal_reader.ProcessPaymentIntent( + "tmr_xxxxxxxxxxxxx", params, ) assert.NotNil(t, result) } -func TestTreasuryFinancialAccountRetrieveFeatures(t *testing.T) { - params := &stripe.TreasuryFinancialAccountRetrieveFeaturesParams{} - result, _ := treasury_financialaccount.RetrieveFeatures( - "fa_xxxxxxxxxxxxx", - params, - ) +func TestTestHelpersTestClockList2(t *testing.T) { + params := &stripe.TestHelpersTestClockListParams{} + params.Limit = stripe.Int64(3) + result := testhelpers_testclock.List(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } -func TestTreasuryTransactionRetrieve(t *testing.T) { - params := &stripe.TreasuryTransactionParams{} - result, _ := treasury_transaction.Get("trxn_xxxxxxxxxxxxx", params) +func TestTestHelpersTestClockCreate2(t *testing.T) { + params := &stripe.TestHelpersTestClockParams{ + FrozenTime: stripe.Int64(1577836800), + } + result, _ := testhelpers_testclock.New(params) assert.NotNil(t, result) } -func TestTreasuryTransactionList(t *testing.T) { - params := &stripe.TreasuryTransactionListParams{ - FinancialAccount: stripe.String("fa_xxxxxxxxxxxxx"), - } - params.Limit = stripe.Int64(3) - result := treasury_transaction.List(params) +func TestTestHelpersTestClockDelete2(t *testing.T) { + params := &stripe.TestHelpersTestClockParams{} + result, _ := testhelpers_testclock.Del("clock_xxxxxxxxxxxxx", params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } -func TestTreasuryTransactionEntryRetrieve(t *testing.T) { - params := &stripe.TreasuryTransactionEntryParams{} - result, _ := treasury_transactionentry.Get("trxne_xxxxxxxxxxxxx", params) +func TestTestHelpersTestClockRetrieve2(t *testing.T) { + params := &stripe.TestHelpersTestClockParams{} + result, _ := testhelpers_testclock.Get("clock_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTreasuryTransactionEntryList(t *testing.T) { - params := &stripe.TreasuryTransactionEntryListParams{ - FinancialAccount: stripe.String("fa_xxxxxxxxxxxxx"), +func TestTestHelpersTestClockAdvance2(t *testing.T) { + params := &stripe.TestHelpersTestClockAdvanceParams{ + FrozenTime: stripe.Int64(1652390605), } + result, _ := testhelpers_testclock.Advance("clock_xxxxxxxxxxxxx", params) + assert.NotNil(t, result) +} + +func TestTopupList(t *testing.T) { + params := &stripe.TopupListParams{} params.Limit = stripe.Int64(3) - result := treasury_transactionentry.List(params) + result := topup.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestTreasuryOutboundTransferCreate(t *testing.T) { - params := &stripe.TreasuryOutboundTransferParams{ - FinancialAccount: stripe.String("fa_xxxxxxxxxxxxx"), - DestinationPaymentMethod: stripe.String("pm_xxxxxxxxxxxxx"), - Amount: stripe.Int64(500), - Currency: stripe.String(string(stripe.CurrencyUSD)), - Description: stripe.String("OutboundTransfer to my external bank account"), +func TestTopupCreate(t *testing.T) { + params := &stripe.TopupParams{ + Amount: stripe.Int64(2000), + Currency: stripe.String(string(stripe.CurrencyUSD)), + Description: stripe.String("Top-up for Jenny Rosen"), + StatementDescriptor: stripe.String("Top-up"), } - result, _ := treasury_outboundtransfer.New(params) + result, _ := topup.New(params) assert.NotNil(t, result) } -func TestTreasuryOutboundTransferCancel(t *testing.T) { - params := &stripe.TreasuryOutboundTransferCancelParams{} - result, _ := treasury_outboundtransfer.Cancel("obt_xxxxxxxxxxxxx", params) +func TestTopupRetrieve(t *testing.T) { + params := &stripe.TopupParams{} + result, _ := topup.Get("tu_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTreasuryOutboundTransferRetrieve(t *testing.T) { - params := &stripe.TreasuryOutboundTransferParams{} - result, _ := treasury_outboundtransfer.Get("obt_xxxxxxxxxxxxx", params) +func TestTopupUpdate(t *testing.T) { + params := &stripe.TopupParams{} + params.AddMetadata("order_id", "6735") + result, _ := topup.Update("tu_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTreasuryOutboundTransferList(t *testing.T) { - params := &stripe.TreasuryOutboundTransferListParams{ - FinancialAccount: stripe.String("fa_xxxxxxxxxxxxx"), - } +func TestTransferList(t *testing.T) { + params := &stripe.TransferListParams{} params.Limit = stripe.Int64(3) - result := treasury_outboundtransfer.List(params) + result := transfer.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestTreasuryOutboundPaymentCreate(t *testing.T) { - params := &stripe.TreasuryOutboundPaymentParams{ - FinancialAccount: stripe.String("fa_xxxxxxxxxxxxx"), - Amount: stripe.Int64(10000), - Currency: stripe.String(string(stripe.CurrencyUSD)), - Customer: stripe.String("cu_xxxxxxxxxxxxx"), - DestinationPaymentMethod: stripe.String("pm_xxxxxxxxxxxxx"), - Description: stripe.String("OutboundPayment to a 3rd party"), +func TestTransferCreate(t *testing.T) { + params := &stripe.TransferParams{ + Amount: stripe.Int64(400), + Currency: stripe.String(string(stripe.CurrencyUSD)), + Destination: stripe.String("acct_xxxxxxxxxxxxx"), + TransferGroup: stripe.String("ORDER_95"), } - result, _ := treasury_outboundpayment.New(params) + result, _ := transfer.New(params) assert.NotNil(t, result) } -func TestTreasuryOutboundPaymentCancel(t *testing.T) { - params := &stripe.TreasuryOutboundPaymentCancelParams{} - result, _ := treasury_outboundpayment.Cancel("obp_xxxxxxxxxxxxx", params) +func TestTransferRetrieve(t *testing.T) { + params := &stripe.TransferParams{} + result, _ := transfer.Get("tr_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTreasuryOutboundPaymentRetrieve(t *testing.T) { - params := &stripe.TreasuryOutboundPaymentParams{} - result, _ := treasury_outboundpayment.Get("obp_xxxxxxxxxxxxx", params) +func TestTransferUpdate(t *testing.T) { + params := &stripe.TransferParams{} + params.AddMetadata("order_id", "6735") + result, _ := transfer.Update("tr_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTreasuryOutboundPaymentList(t *testing.T) { - params := &stripe.TreasuryOutboundPaymentListParams{ - FinancialAccount: stripe.String("fa_xxxxxxxxxxxxx"), +func TestReversalList(t *testing.T) { + params := &stripe.ReversalListParams{ + Transfer: stripe.String("tr_xxxxxxxxxxxxx"), } params.Limit = stripe.Int64(3) - result := treasury_outboundpayment.List(params) + result := reversal.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestTreasuryInboundTransferCreate(t *testing.T) { - params := &stripe.TreasuryInboundTransferParams{ - FinancialAccount: stripe.String("fa_xxxxxxxxxxxxx"), - Amount: stripe.Int64(10000), - Currency: stripe.String(string(stripe.CurrencyUSD)), - OriginPaymentMethod: stripe.String("pm_xxxxxxxxxxxxx"), - Description: stripe.String("InboundTransfer from my bank account"), - } - result, _ := treasury_inboundtransfer.New(params) +func TestReversalCreate(t *testing.T) { + params := &stripe.ReversalParams{Amount: stripe.Int64(100)} + result, _ := reversal.New(params) assert.NotNil(t, result) } -func TestTreasuryInboundTransferRetrieve(t *testing.T) { - params := &stripe.TreasuryInboundTransferParams{} - result, _ := treasury_inboundtransfer.Get("ibt_xxxxxxxxxxxxx", params) +func TestReversalRetrieve(t *testing.T) { + params := &stripe.ReversalParams{Transfer: stripe.String("tr_xxxxxxxxxxxxx")} + result, _ := reversal.Get("trr_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTreasuryInboundTransferList(t *testing.T) { - params := &stripe.TreasuryInboundTransferListParams{ +func TestReversalUpdate(t *testing.T) { + params := &stripe.ReversalParams{Transfer: stripe.String("tr_xxxxxxxxxxxxx")} + params.AddMetadata("order_id", "6735") + result, _ := reversal.Update("trr_xxxxxxxxxxxxx", params) + assert.NotNil(t, result) +} + +func TestTreasuryCreditReversalList(t *testing.T) { + params := &stripe.TreasuryCreditReversalListParams{ FinancialAccount: stripe.String("fa_xxxxxxxxxxxxx"), } params.Limit = stripe.Int64(3) - result := treasury_inboundtransfer.List(params) + result := treasury_creditreversal.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestTreasuryInboundTransferCancel(t *testing.T) { - params := &stripe.TreasuryInboundTransferCancelParams{} - result, _ := treasury_inboundtransfer.Cancel("ibt_xxxxxxxxxxxxx", params) +func TestTreasuryCreditReversalCreate(t *testing.T) { + params := &stripe.TreasuryCreditReversalParams{ + ReceivedCredit: stripe.String("rc_xxxxxxxxxxxxx"), + } + result, _ := treasury_creditreversal.New(params) assert.NotNil(t, result) } -func TestTreasuryReceivedCreditRetrieve(t *testing.T) { - params := &stripe.TreasuryReceivedCreditParams{} - result, _ := treasury_receivedcredit.Get("rc_xxxxxxxxxxxxx", params) +func TestTreasuryCreditReversalRetrieve(t *testing.T) { + params := &stripe.TreasuryCreditReversalParams{} + result, _ := treasury_creditreversal.Get("credrev_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTreasuryReceivedCreditList(t *testing.T) { - params := &stripe.TreasuryReceivedCreditListParams{ +func TestTreasuryDebitReversalList(t *testing.T) { + params := &stripe.TreasuryDebitReversalListParams{ FinancialAccount: stripe.String("fa_xxxxxxxxxxxxx"), } params.Limit = stripe.Int64(3) - result := treasury_receivedcredit.List(params) + result := treasury_debitreversal.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestTreasuryReceivedDebitRetrieve(t *testing.T) { - params := &stripe.TreasuryReceivedDebitParams{} - result, _ := treasury_receiveddebit.Get("rd_xxxxxxxxxxxxx", params) +func TestTreasuryDebitReversalCreate(t *testing.T) { + params := &stripe.TreasuryDebitReversalParams{ + ReceivedDebit: stripe.String("rd_xxxxxxxxxxxxx"), + } + result, _ := treasury_debitreversal.New(params) assert.NotNil(t, result) } -func TestTreasuryReceivedDebitList(t *testing.T) { - params := &stripe.TreasuryReceivedDebitListParams{ - FinancialAccount: stripe.String("fa_xxxxxxxxxxxxx"), - } +func TestTreasuryDebitReversalRetrieve(t *testing.T) { + params := &stripe.TreasuryDebitReversalParams{} + result, _ := treasury_debitreversal.Get("debrev_xxxxxxxxxxxxx", params) + assert.NotNil(t, result) +} + +func TestTreasuryFinancialAccountList(t *testing.T) { + params := &stripe.TreasuryFinancialAccountListParams{} params.Limit = stripe.Int64(3) - result := treasury_receiveddebit.List(params) + result := treasury_financialaccount.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestTreasuryCreditReversalCreate(t *testing.T) { - params := &stripe.TreasuryCreditReversalParams{ - ReceivedCredit: stripe.String("rc_xxxxxxxxxxxxx"), +func TestTreasuryFinancialAccountCreate(t *testing.T) { + params := &stripe.TreasuryFinancialAccountParams{ + SupportedCurrencies: []*string{stripe.String("usd")}, + Features: &stripe.TreasuryFinancialAccountFeaturesParams{}, } - result, _ := treasury_creditreversal.New(params) + result, _ := treasury_financialaccount.New(params) assert.NotNil(t, result) } -func TestTreasuryCreditReversalRetrieve(t *testing.T) { - params := &stripe.TreasuryCreditReversalParams{} - result, _ := treasury_creditreversal.Get("credrev_xxxxxxxxxxxxx", params) +func TestTreasuryFinancialAccountRetrieve(t *testing.T) { + params := &stripe.TreasuryFinancialAccountParams{} + result, _ := treasury_financialaccount.Get("fa_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTreasuryCreditReversalList(t *testing.T) { - params := &stripe.TreasuryCreditReversalListParams{ - FinancialAccount: stripe.String("fa_xxxxxxxxxxxxx"), - } - params.Limit = stripe.Int64(3) - result := treasury_creditreversal.List(params) +func TestTreasuryFinancialAccountUpdate(t *testing.T) { + params := &stripe.TreasuryFinancialAccountParams{} + params.AddMetadata("order_id", "6735") + result, _ := treasury_financialaccount.Update("fa_xxxxxxxxxxxxx", params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } -func TestTreasuryDebitReversalCreate(t *testing.T) { - params := &stripe.TreasuryDebitReversalParams{ - ReceivedDebit: stripe.String("rd_xxxxxxxxxxxxx"), - } - result, _ := treasury_debitreversal.New(params) +func TestTreasuryFinancialAccountRetrieveFeatures(t *testing.T) { + params := &stripe.TreasuryFinancialAccountRetrieveFeaturesParams{} + result, _ := treasury_financialaccount.RetrieveFeatures( + "fa_xxxxxxxxxxxxx", + params, + ) assert.NotNil(t, result) } -func TestTreasuryDebitReversalRetrieve(t *testing.T) { - params := &stripe.TreasuryDebitReversalParams{} - result, _ := treasury_debitreversal.Get("debrev_xxxxxxxxxxxxx", params) +func TestTreasuryFinancialAccountUpdateFeatures(t *testing.T) { + params := &stripe.TreasuryFinancialAccountUpdateFeaturesParams{ + CardIssuing: &stripe.TreasuryFinancialAccountUpdateFeaturesCardIssuingParams{ + Requested: stripe.Bool(false), + }, + } + result, _ := treasury_financialaccount.UpdateFeatures( + "fa_xxxxxxxxxxxxx", + params, + ) assert.NotNil(t, result) } -func TestTreasuryDebitReversalList(t *testing.T) { - params := &stripe.TreasuryDebitReversalListParams{ +func TestTreasuryInboundTransferList(t *testing.T) { + params := &stripe.TreasuryInboundTransferListParams{ FinancialAccount: stripe.String("fa_xxxxxxxxxxxxx"), } params.Limit = stripe.Int64(3) - result := treasury_debitreversal.List(params) + result := treasury_inboundtransfer.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestSKUCreate(t *testing.T) { - params := &stripe.SKUParams{ - Attributes: map[string]string{"size": "Medium", "gender": "Unisex"}, - Price: stripe.Int64(1500), - Currency: stripe.String(string(stripe.CurrencyUSD)), - Inventory: &stripe.InventoryParams{ - Type: stripe.String(string(stripe.SKUInventoryTypeFinite)), - Quantity: stripe.Int64(500), - }, - Product: stripe.String("prod_xxxxxxxxxxxxx"), +func TestTreasuryInboundTransferCreate(t *testing.T) { + params := &stripe.TreasuryInboundTransferParams{ + FinancialAccount: stripe.String("fa_xxxxxxxxxxxxx"), + Amount: stripe.Int64(10000), + Currency: stripe.String(string(stripe.CurrencyUSD)), + OriginPaymentMethod: stripe.String("pm_xxxxxxxxxxxxx"), + Description: stripe.String("InboundTransfer from my bank account"), } - result, _ := sku.New(params) + result, _ := treasury_inboundtransfer.New(params) assert.NotNil(t, result) } -func TestSKURetrieve(t *testing.T) { - params := &stripe.SKUParams{} - result, _ := sku.Get("sku_xxxxxxxxxxxxx", params) +func TestTreasuryInboundTransferRetrieve(t *testing.T) { + params := &stripe.TreasuryInboundTransferParams{} + result, _ := treasury_inboundtransfer.Get("ibt_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestSKUUpdate(t *testing.T) { - params := &stripe.SKUParams{} - params.AddMetadata("order_id", "6735") - result, _ := sku.Update("sku_xxxxxxxxxxxxx", params) +func TestTreasuryInboundTransferCancel(t *testing.T) { + params := &stripe.TreasuryInboundTransferCancelParams{} + result, _ := treasury_inboundtransfer.Cancel("ibt_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestSKUList(t *testing.T) { - params := &stripe.SKUListParams{} +func TestTreasuryOutboundPaymentList(t *testing.T) { + params := &stripe.TreasuryOutboundPaymentListParams{ + FinancialAccount: stripe.String("fa_xxxxxxxxxxxxx"), + } params.Limit = stripe.Int64(3) - result := sku.List(params) + result := treasury_outboundpayment.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestSKUDelete(t *testing.T) { - params := &stripe.SKUParams{} - result, _ := sku.Del("sku_xxxxxxxxxxxxx", params) - assert.NotNil(t, result) -} - -func TestSigmaScheduledQueryRunRetrieve(t *testing.T) { - params := &stripe.SigmaScheduledQueryRunParams{} - result, _ := sigma_scheduledqueryrun.Get("sqr_xxxxxxxxxxxxx", params) +func TestTreasuryOutboundPaymentCreate(t *testing.T) { + params := &stripe.TreasuryOutboundPaymentParams{ + FinancialAccount: stripe.String("fa_xxxxxxxxxxxxx"), + Amount: stripe.Int64(10000), + Currency: stripe.String(string(stripe.CurrencyUSD)), + Customer: stripe.String("cu_xxxxxxxxxxxxx"), + DestinationPaymentMethod: stripe.String("pm_xxxxxxxxxxxxx"), + Description: stripe.String("OutboundPayment to a 3rd party"), + } + result, _ := treasury_outboundpayment.New(params) assert.NotNil(t, result) } -func TestSigmaScheduledQueryRunList(t *testing.T) { - params := &stripe.SigmaScheduledQueryRunListParams{} - params.Limit = stripe.Int64(3) - result := sigma_scheduledqueryrun.List(params) +func TestTreasuryOutboundPaymentRetrieve(t *testing.T) { + params := &stripe.TreasuryOutboundPaymentParams{} + result, _ := treasury_outboundpayment.Get("obp_xxxxxxxxxxxxx", params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } -func TestFinancialConnectionsAccountRetrieve2(t *testing.T) { - params := &stripe.FinancialConnectionsAccountParams{} - result, _ := financialconnections_account.GetByID( - "fca_xxxxxxxxxxxxx", - params, - ) +func TestTreasuryOutboundPaymentCancel(t *testing.T) { + params := &stripe.TreasuryOutboundPaymentCancelParams{} + result, _ := treasury_outboundpayment.Cancel("obp_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestFinancialConnectionsAccountList2(t *testing.T) { - params := &stripe.FinancialConnectionsAccountListParams{ - AccountHolder: &stripe.FinancialConnectionsAccountListAccountHolderParams{ - Customer: stripe.String("cus_xxxxxxxxxxxxx"), - }, +func TestTreasuryOutboundTransferList(t *testing.T) { + params := &stripe.TreasuryOutboundTransferListParams{ + FinancialAccount: stripe.String("fa_xxxxxxxxxxxxx"), } - result := financialconnections_account.List(params) + params.Limit = stripe.Int64(3) + result := treasury_outboundtransfer.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestFinancialConnectionsAccountListOwners2(t *testing.T) { - params := &stripe.FinancialConnectionsAccountListOwnersParams{ - Ownership: stripe.String("fcaowns_xxxxxxxxxxxxx"), - Account: stripe.String("fca_xxxxxxxxxxxxx"), +func TestTreasuryOutboundTransferCreate(t *testing.T) { + params := &stripe.TreasuryOutboundTransferParams{ + FinancialAccount: stripe.String("fa_xxxxxxxxxxxxx"), + DestinationPaymentMethod: stripe.String("pm_xxxxxxxxxxxxx"), + Amount: stripe.Int64(500), + Currency: stripe.String(string(stripe.CurrencyUSD)), + Description: stripe.String("OutboundTransfer to my external bank account"), } - params.Limit = stripe.Int64(3) - result := financialconnections_account.ListOwners(params) + result, _ := treasury_outboundtransfer.New(params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } -func TestFinancialConnectionsSessionCreate2(t *testing.T) { - params := &stripe.FinancialConnectionsSessionParams{ - AccountHolder: &stripe.FinancialConnectionsSessionAccountHolderParams{ - Type: stripe.String(string(stripe.FinancialConnectionsSessionAccountHolderTypeCustomer)), - Customer: stripe.String("cus_xxxxxxxxxxxxx"), - }, - Permissions: []*string{ - stripe.String(string(stripe.FinancialConnectionsSessionPermissionPaymentMethod)), - stripe.String(string(stripe.FinancialConnectionsSessionPermissionBalances)), - }, - Filters: &stripe.FinancialConnectionsSessionFiltersParams{ - Countries: []*string{stripe.String("US")}, - }, - } - result, _ := financialconnections_session.New(params) +func TestTreasuryOutboundTransferRetrieve(t *testing.T) { + params := &stripe.TreasuryOutboundTransferParams{} + result, _ := treasury_outboundtransfer.Get("obt_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestFinancialConnectionsSessionRetrieve2(t *testing.T) { - params := &stripe.FinancialConnectionsSessionParams{} - result, _ := financialconnections_session.Get("fcsess_xxxxxxxxxxxxx", params) +func TestTreasuryOutboundTransferCancel(t *testing.T) { + params := &stripe.TreasuryOutboundTransferCancelParams{} + result, _ := treasury_outboundtransfer.Cancel("obt_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestSourceRetrieve2(t *testing.T) { - params := &stripe.SourceObjectParams{} - result, _ := source.Get("src_xxxxxxxxxxxxx", params) +func TestTreasuryReceivedCreditList(t *testing.T) { + params := &stripe.TreasuryReceivedCreditListParams{ + FinancialAccount: stripe.String("fa_xxxxxxxxxxxxx"), + } + params.Limit = stripe.Int64(3) + result := treasury_receivedcredit.List(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } -func TestIdentityVerificationSessionCreate(t *testing.T) { - params := &stripe.IdentityVerificationSessionParams{ - Type: stripe.String(string(stripe.IdentityVerificationSessionTypeDocument)), - } - result, _ := identity_verificationsession.New(params) +func TestTreasuryReceivedCreditRetrieve(t *testing.T) { + params := &stripe.TreasuryReceivedCreditParams{} + result, _ := treasury_receivedcredit.Get("rc_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestIdentityVerificationSessionList(t *testing.T) { - params := &stripe.IdentityVerificationSessionListParams{} +func TestTreasuryReceivedDebitList(t *testing.T) { + params := &stripe.TreasuryReceivedDebitListParams{ + FinancialAccount: stripe.String("fa_xxxxxxxxxxxxx"), + } params.Limit = stripe.Int64(3) - result := identity_verificationsession.List(params) + result := treasury_receiveddebit.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } -func TestIdentityVerificationSessionRetrieve(t *testing.T) { - params := &stripe.IdentityVerificationSessionParams{} - result, _ := identity_verificationsession.Get("vs_xxxxxxxxxxxxx", params) +func TestTreasuryReceivedDebitRetrieve(t *testing.T) { + params := &stripe.TreasuryReceivedDebitParams{} + result, _ := treasury_receiveddebit.Get("rd_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestIdentityVerificationSessionUpdate(t *testing.T) { - params := &stripe.IdentityVerificationSessionParams{ - Type: stripe.String(string(stripe.IdentityVerificationSessionTypeIDNumber)), +func TestTreasuryTransactionEntryList(t *testing.T) { + params := &stripe.TreasuryTransactionEntryListParams{ + FinancialAccount: stripe.String("fa_xxxxxxxxxxxxx"), } - result, _ := identity_verificationsession.Update("vs_xxxxxxxxxxxxx", params) + params.Limit = stripe.Int64(3) + result := treasury_transactionentry.List(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } -func TestIdentityVerificationSessionCancel(t *testing.T) { - params := &stripe.IdentityVerificationSessionCancelParams{} - result, _ := identity_verificationsession.Cancel("vs_xxxxxxxxxxxxx", params) +func TestTreasuryTransactionEntryRetrieve(t *testing.T) { + params := &stripe.TreasuryTransactionEntryParams{} + result, _ := treasury_transactionentry.Get("trxne_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestIdentityVerificationSessionRedact(t *testing.T) { - params := &stripe.IdentityVerificationSessionRedactParams{} - result, _ := identity_verificationsession.Redact("vs_xxxxxxxxxxxxx", params) +func TestTreasuryTransactionList(t *testing.T) { + params := &stripe.TreasuryTransactionListParams{ + FinancialAccount: stripe.String("fa_xxxxxxxxxxxxx"), + } + params.Limit = stripe.Int64(3) + result := treasury_transaction.List(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } -func TestIdentityVerificationReportRetrieve(t *testing.T) { - params := &stripe.IdentityVerificationReportParams{} - result, _ := identity_verificationreport.Get("vr_xxxxxxxxxxxxx", params) +func TestTreasuryTransactionRetrieve(t *testing.T) { + params := &stripe.TreasuryTransactionParams{} + result, _ := treasury_transaction.Get("trxn_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestIdentityVerificationReportList(t *testing.T) { - params := &stripe.IdentityVerificationReportListParams{} +func TestWebhookEndpointList(t *testing.T) { + params := &stripe.WebhookEndpointListParams{} params.Limit = stripe.Int64(3) - result := identity_verificationreport.List(params) + result := webhookendpoint.List(params) assert.NotNil(t, result) assert.Nil(t, result.Err()) } @@ -2570,6 +2638,12 @@ func TestWebhookEndpointCreate(t *testing.T) { assert.NotNil(t, result) } +func TestWebhookEndpointDelete(t *testing.T) { + params := &stripe.WebhookEndpointParams{} + result, _ := webhookendpoint.Del("we_xxxxxxxxxxxxx", params) + assert.NotNil(t, result) +} + func TestWebhookEndpointRetrieve(t *testing.T) { params := &stripe.WebhookEndpointParams{} result, _ := webhookendpoint.Get("we_xxxxxxxxxxxxx", params) @@ -2583,17 +2657,3 @@ func TestWebhookEndpointUpdate(t *testing.T) { result, _ := webhookendpoint.Update("we_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } - -func TestWebhookEndpointList(t *testing.T) { - params := &stripe.WebhookEndpointListParams{} - params.Limit = stripe.Int64(3) - result := webhookendpoint.List(params) - assert.NotNil(t, result) - assert.Nil(t, result.Err()) -} - -func TestWebhookEndpointDelete(t *testing.T) { - params := &stripe.WebhookEndpointParams{} - result, _ := webhookendpoint.Del("we_xxxxxxxxxxxxx", params) - assert.NotNil(t, result) -} diff --git a/invoice.go b/invoice.go index 99e12e0e87..dad1c8d623 100644 --- a/invoice.go +++ b/invoice.go @@ -173,7 +173,7 @@ type InvoiceListParams struct { // Settings for automatic tax lookup for this invoice. type InvoiceAutomaticTaxParams struct { - // Controls whether Stripe will automatically compute tax on this invoice. + // Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. Enabled *bool `form:"enabled"` } @@ -309,6 +309,8 @@ type InvoiceParams struct { AutomaticTax *InvoiceAutomaticTaxParams `form:"automatic_tax"` // Either `charge_automatically` or `send_invoice`. This field can be updated only on `draft` invoices. CollectionMethod *string `form:"collection_method"` + // The currency to preview this invoice in. Defaults to that of `customer` if not specified. + Currency *string `form:"currency"` // The identifier of the customer whose upcoming invoice you'd like to retrieve. Customer *string `form:"customer"` // A list of up to 4 custom fields to be displayed on the invoice. If a value for `custom_fields` is specified, the list specified will replace the existing custom field list on this invoice. Pass an empty string to remove previously-defined fields. @@ -528,7 +530,7 @@ type InvoiceLineListParams struct { Subscription *string `form:"subscription"` } type InvoiceAutomaticTax struct { - // Whether Stripe automatically computes tax on this invoice. + // Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. Enabled bool `json:"enabled"` // The status of the most recent automated tax calculation for this invoice. Status InvoiceAutomaticTaxStatus `json:"status"` diff --git a/paymentlink.go b/paymentlink.go index 40eabe2b74..ac2fa38b4b 100644 --- a/paymentlink.go +++ b/paymentlink.go @@ -66,7 +66,29 @@ type PaymentLinkPaymentMethodType string // List of values that PaymentLinkPaymentMethodType can take const ( - PaymentLinkPaymentMethodTypeCard PaymentLinkPaymentMethodType = "card" + PaymentLinkPaymentMethodTypeAffirm PaymentLinkPaymentMethodType = "affirm" + PaymentLinkPaymentMethodTypeAfterpayClearpay PaymentLinkPaymentMethodType = "afterpay_clearpay" + PaymentLinkPaymentMethodTypeAlipay PaymentLinkPaymentMethodType = "alipay" + PaymentLinkPaymentMethodTypeAUBECSDebit PaymentLinkPaymentMethodType = "au_becs_debit" + PaymentLinkPaymentMethodTypeBACSDebit PaymentLinkPaymentMethodType = "bacs_debit" + PaymentLinkPaymentMethodTypeBancontact PaymentLinkPaymentMethodType = "bancontact" + PaymentLinkPaymentMethodTypeBoleto PaymentLinkPaymentMethodType = "boleto" + PaymentLinkPaymentMethodTypeCard PaymentLinkPaymentMethodType = "card" + PaymentLinkPaymentMethodTypeEPS PaymentLinkPaymentMethodType = "eps" + PaymentLinkPaymentMethodTypeFPX PaymentLinkPaymentMethodType = "fpx" + PaymentLinkPaymentMethodTypeGiropay PaymentLinkPaymentMethodType = "giropay" + PaymentLinkPaymentMethodTypeGrabpay PaymentLinkPaymentMethodType = "grabpay" + PaymentLinkPaymentMethodTypeIdeal PaymentLinkPaymentMethodType = "ideal" + PaymentLinkPaymentMethodTypeKlarna PaymentLinkPaymentMethodType = "klarna" + PaymentLinkPaymentMethodTypeKonbini PaymentLinkPaymentMethodType = "konbini" + PaymentLinkPaymentMethodTypeOXXO PaymentLinkPaymentMethodType = "oxxo" + PaymentLinkPaymentMethodTypeP24 PaymentLinkPaymentMethodType = "p24" + PaymentLinkPaymentMethodTypePayNow PaymentLinkPaymentMethodType = "paynow" + PaymentLinkPaymentMethodTypePromptPay PaymentLinkPaymentMethodType = "promptpay" + PaymentLinkPaymentMethodTypeSepaDebit PaymentLinkPaymentMethodType = "sepa_debit" + PaymentLinkPaymentMethodTypeSofort PaymentLinkPaymentMethodType = "sofort" + PaymentLinkPaymentMethodTypeUSBankAccount PaymentLinkPaymentMethodType = "us_bank_account" + PaymentLinkPaymentMethodTypeWechatPay PaymentLinkPaymentMethodType = "wechat_pay" ) // Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button. @@ -226,6 +248,8 @@ type PaymentLinkParams struct { BillingAddressCollection *string `form:"billing_address_collection"` // Configure fields to gather active consent from customers. ConsentCollection *PaymentLinkConsentCollectionParams `form:"consent_collection"` + // 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) and supported by each line item's price. + Currency *string `form:"currency"` // Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers). CustomerCreation *string `form:"customer_creation"` // The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported. @@ -244,7 +268,7 @@ type PaymentLinkParams struct { ShippingAddressCollection *PaymentLinkShippingAddressCollectionParams `form:"shipping_address_collection"` // The shipping rate options to apply to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. ShippingOptions []*PaymentLinkShippingOptionParams `form:"shipping_options"` - // Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. + // Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. Changing this value will also affect the hostname in the [url](https://stripe.com/docs/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`). SubmitType *string `form:"submit_type"` // When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`. SubscriptionData *PaymentLinkSubscriptionDataParams `form:"subscription_data"` diff --git a/price.go b/price.go index a6c7dddd14..f9cc46e3b0 100644 --- a/price.go +++ b/price.go @@ -20,6 +20,16 @@ const ( PriceBillingSchemeTiered PriceBillingScheme = "tiered" ) +// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. +type PriceCurrencyOptionsTaxBehavior string + +// List of values that PriceCurrencyOptionsTaxBehavior can take +const ( + PriceCurrencyOptionsTaxBehaviorExclusive PriceCurrencyOptionsTaxBehavior = "exclusive" + PriceCurrencyOptionsTaxBehaviorInclusive PriceCurrencyOptionsTaxBehavior = "inclusive" + PriceCurrencyOptionsTaxBehaviorUnspecified PriceCurrencyOptionsTaxBehavior = "unspecified" +) + // Specifies a usage aggregation strategy for prices of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`. type PriceRecurringAggregateUsage string @@ -127,6 +137,54 @@ type PriceListParams struct { Type *string `form:"type"` } +// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. +type PriceCurrencyOptionsCustomUnitAmountParams struct { + // Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. + Enabled *bool `form:"enabled"` + // The maximum unit amount the customer can specify for this item. + Maximum *int64 `form:"maximum"` + // The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. + Minimum *int64 `form:"minimum"` + // The starting unit amount which can be updated by the customer. + Preset *int64 `form:"preset"` +} + +// Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. +type PriceCurrencyOptionsTierParams struct { + // The flat billing amount for an entire tier, regardless of the number of units in the tier. + FlatAmount *int64 `form:"flat_amount"` + // Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. + FlatAmountDecimal *float64 `form:"flat_amount_decimal,high_precision"` + // The per unit billing amount for each individual unit for which this tier applies. + UnitAmount *int64 `form:"unit_amount"` + // Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` + // Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier. + UpTo *int64 `form:"up_to"` + UpToInf *bool `form:"-"` // See custom AppendTo +} + +// AppendTo implements custom encoding logic for PriceCurrencyOptionsTierParams. +func (p *PriceCurrencyOptionsTierParams) AppendTo(body *form.Values, keyParts []string) { + if BoolValue(p.UpToInf) { + body.Add(form.FormatKey(append(keyParts, "up_to")), "inf") + } +} + +// Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +type PriceCurrencyOptionsParams struct { + // When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + CustomUnitAmount *PriceCurrencyOptionsCustomUnitAmountParams `form:"custom_unit_amount"` + // Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + TaxBehavior *string `form:"tax_behavior"` + // Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. + Tiers []*PriceCurrencyOptionsTierParams `form:"tiers"` + // A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + UnitAmount *int64 `form:"unit_amount"` + // Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` +} + // When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. type PriceCustomUnitAmountParams struct { // Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. @@ -212,6 +270,8 @@ type PriceParams struct { BillingScheme *string `form:"billing_scheme"` // 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"` + // Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + CurrencyOptions map[string]*PriceCurrencyOptionsParams `form:"currency_options"` // When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. CustomUnitAmount *PriceCustomUnitAmountParams `form:"custom_unit_amount"` // A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters. @@ -240,6 +300,44 @@ type PriceParams struct { UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` } +// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. +type PriceCurrencyOptionsCustomUnitAmount struct { + // The maximum unit amount the customer can specify for this item. + Maximum int64 `json:"maximum"` + // The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. + Minimum int64 `json:"minimum"` + // The starting unit amount which can be updated by the customer. + Preset int64 `json:"preset"` +} + +// Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. +type PriceCurrencyOptionsTier struct { + // Price for the entire tier. + FlatAmount int64 `json:"flat_amount"` + // Same as `flat_amount`, but contains a decimal value with at most 12 decimal places. + FlatAmountDecimal float64 `json:"flat_amount_decimal,string"` + // Per unit price for units relevant to the tier. + UnitAmount int64 `json:"unit_amount"` + // Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. + UnitAmountDecimal float64 `json:"unit_amount_decimal,string"` + // Up to and including to this quantity will be contained in the tier. + UpTo int64 `json:"up_to"` +} + +// Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +type PriceCurrencyOptions struct { + // When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + CustomUnitAmount *PriceCurrencyOptionsCustomUnitAmount `json:"custom_unit_amount"` + // Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + TaxBehavior PriceCurrencyOptionsTaxBehavior `json:"tax_behavior"` + // Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. + Tiers []*PriceCurrencyOptionsTier `json:"tiers"` + // The unit amount in %s to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`. + UnitAmount int64 `json:"unit_amount"` + // The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`. + UnitAmountDecimal float64 `json:"unit_amount_decimal,string"` +} + // When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. type PriceCustomUnitAmount struct { // The maximum unit amount the customer can specify for this item. @@ -302,6 +400,8 @@ type Price struct { Created int64 `json:"created"` // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Currency Currency `json:"currency"` + // Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + CurrencyOptions map[string]*PriceCurrencyOptions `json:"currency_options"` // When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. CustomUnitAmount *PriceCustomUnitAmount `json:"custom_unit_amount"` Deleted bool `json:"deleted"` diff --git a/product.go b/product.go index 3be57e6ad3..3904247056 100644 --- a/product.go +++ b/product.go @@ -6,7 +6,10 @@ package stripe -import "encoding/json" +import ( + "encoding/json" + "github.com/stripe/stripe-go/v72/form" +) // The type of the product. The product is either of type `good`, which is eligible for use with Orders and SKUs, or `service`, which is eligible for use with Subscriptions and Plans. type ProductType string @@ -27,6 +30,54 @@ type ProductSearchParams struct { Page *string `form:"page"` } +// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. +type ProductDefaultPriceDataCurrencyOptionsCustomUnitAmountParams struct { + // Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. + Enabled *bool `form:"enabled"` + // The maximum unit amount the customer can specify for this item. + Maximum *int64 `form:"maximum"` + // The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. + Minimum *int64 `form:"minimum"` + // The starting unit amount which can be updated by the customer. + Preset *int64 `form:"preset"` +} + +// Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. +type ProductDefaultPriceDataCurrencyOptionsTierParams struct { + // The flat billing amount for an entire tier, regardless of the number of units in the tier. + FlatAmount *int64 `form:"flat_amount"` + // Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. + FlatAmountDecimal *float64 `form:"flat_amount_decimal,high_precision"` + // The per unit billing amount for each individual unit for which this tier applies. + UnitAmount *int64 `form:"unit_amount"` + // Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` + // Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier. + UpTo *int64 `form:"up_to"` + UpToInf *bool `form:"-"` // See custom AppendTo +} + +// AppendTo implements custom encoding logic for ProductDefaultPriceDataCurrencyOptionsTierParams. +func (p *ProductDefaultPriceDataCurrencyOptionsTierParams) AppendTo(body *form.Values, keyParts []string) { + if BoolValue(p.UpToInf) { + body.Add(form.FormatKey(append(keyParts, "up_to")), "inf") + } +} + +// Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +type ProductDefaultPriceDataCurrencyOptionsParams struct { + // When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + CustomUnitAmount *ProductDefaultPriceDataCurrencyOptionsCustomUnitAmountParams `form:"custom_unit_amount"` + // Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + TaxBehavior *string `form:"tax_behavior"` + // Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. + Tiers []*ProductDefaultPriceDataCurrencyOptionsTierParams `form:"tiers"` + // A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + UnitAmount *int64 `form:"unit_amount"` + // Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` +} + // The recurring components of a price such as `interval` and `interval_count`. type ProductDefaultPriceDataRecurringParams struct { // Specifies billing frequency. Either `day`, `week`, `month` or `year`. @@ -39,6 +90,8 @@ type ProductDefaultPriceDataRecurringParams struct { type ProductDefaultPriceDataParams struct { // 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"` + // Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + CurrencyOptions map[string]*ProductDefaultPriceDataCurrencyOptionsParams `form:"currency_options"` // The recurring components of a price such as `interval` and `interval_count`. Recurring *ProductDefaultPriceDataRecurringParams `form:"recurring"` // Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. diff --git a/promotioncode.go b/promotioncode.go index 37aa87eb8d..2e26cde6f6 100644 --- a/promotioncode.go +++ b/promotioncode.go @@ -27,8 +27,16 @@ type PromotionCodeParams struct { Restrictions *PromotionCodeRestrictionsParams `form:"restrictions"` } +// Promotion codes defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +type PromotionCodeRestrictionsCurrencyOptionsParams struct { + // Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). + MinimumAmount *int64 `form:"minimum_amount"` +} + // Settings that restrict the redemption of the promotion code. type PromotionCodeRestrictionsParams struct { + // Promotion codes defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + CurrencyOptions map[string]*PromotionCodeRestrictionsCurrencyOptionsParams `form:"currency_options"` // A Boolean indicating if the Promotion Code should only be redeemed for Customers without any successful payments or invoices FirstTimeTransaction *bool `form:"first_time_transaction"` // Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). @@ -53,7 +61,15 @@ type PromotionCodeListParams struct { // Only return promotion codes that are restricted to this customer. Customer *string `form:"customer"` } + +// Promotion code restrictions defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +type PromotionCodeRestrictionsCurrencyOptions struct { + // Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). + MinimumAmount int64 `json:"minimum_amount"` +} type PromotionCodeRestrictions struct { + // Promotion code restrictions defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + CurrencyOptions map[string]*PromotionCodeRestrictionsCurrencyOptions `json:"currency_options"` // A Boolean indicating if the Promotion Code should only be redeemed for Customers without any successful payments or invoices FirstTimeTransaction bool `json:"first_time_transaction"` // Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). diff --git a/refund.go b/refund.go index 5b655acdb7..0c1521f31c 100644 --- a/refund.go +++ b/refund.go @@ -53,10 +53,18 @@ type RefundListParams struct { // Create a refund. type RefundParams struct { - Params `form:"*"` - Amount *int64 `form:"amount"` - Charge *string `form:"charge"` - InstructionsEmail *string `form:"instructions_email"` + Params `form:"*"` + // A positive integer representing how much to refund. + Amount *int64 `form:"amount"` + Charge *string `form:"charge"` + // 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"` + // Customer whose customer balance to refund from. + Customer *string `form:"customer"` + // Address to send refund email, use customer email if not specified + InstructionsEmail *string `form:"instructions_email"` + // Origin of the refund + Origin *string `form:"origin"` PaymentIntent *string `form:"payment_intent"` Reason *string `form:"reason"` RefundApplicationFee *bool `form:"refund_application_fee"` diff --git a/shippingrate.go b/shippingrate.go index 68cd471075..e4d3ed976d 100644 --- a/shippingrate.go +++ b/shippingrate.go @@ -32,6 +32,16 @@ const ( ShippingRateDeliveryEstimateMinimumUnitWeek ShippingRateDeliveryEstimateMinimumUnit = "week" ) +// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. +type ShippingRateFixedAmountCurrencyOptionsTaxBehavior string + +// List of values that ShippingRateFixedAmountCurrencyOptionsTaxBehavior can take +const ( + ShippingRateFixedAmountCurrencyOptionsTaxBehaviorExclusive ShippingRateFixedAmountCurrencyOptionsTaxBehavior = "exclusive" + ShippingRateFixedAmountCurrencyOptionsTaxBehaviorInclusive ShippingRateFixedAmountCurrencyOptionsTaxBehavior = "inclusive" + ShippingRateFixedAmountCurrencyOptionsTaxBehaviorUnspecified ShippingRateFixedAmountCurrencyOptionsTaxBehavior = "unspecified" +) + // Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. type ShippingRateTaxBehavior string @@ -87,12 +97,22 @@ type ShippingRateDeliveryEstimateParams struct { Minimum *ShippingRateDeliveryEstimateMinimumParams `form:"minimum"` } +// Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +type ShippingRateFixedAmountCurrencyOptionsParams struct { + // A non-negative integer in cents representing how much to charge. + Amount *int64 `form:"amount"` + // Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + TaxBehavior *string `form:"tax_behavior"` +} + // Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. type ShippingRateFixedAmountParams struct { // A non-negative integer in cents representing how much to charge. Amount *int64 `form:"amount"` // 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"` + // Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + CurrencyOptions map[string]*ShippingRateFixedAmountCurrencyOptionsParams `form:"currency_options"` } // Creates a new shipping rate object. @@ -137,11 +157,21 @@ type ShippingRateDeliveryEstimate struct { // The lower bound of the estimated range. If empty, represents no lower bound. Minimum *ShippingRateDeliveryEstimateMinimum `json:"minimum"` } + +// Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +type ShippingRateFixedAmountCurrencyOptions struct { + // A non-negative integer in cents representing how much to charge. + Amount int64 `json:"amount"` + // Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + TaxBehavior ShippingRateFixedAmountCurrencyOptionsTaxBehavior `json:"tax_behavior"` +} type ShippingRateFixedAmount struct { // A non-negative integer in cents representing how much to charge. Amount int64 `json:"amount"` // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Currency Currency `json:"currency"` + // Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + CurrencyOptions map[string]*ShippingRateFixedAmountCurrencyOptions `json:"currency_options"` } // Shipping rates describe the price of shipping presented to your customers and can be diff --git a/stripe.go b/stripe.go index c3e0f4c07d..d77935e56b 100644 --- a/stripe.go +++ b/stripe.go @@ -1206,7 +1206,7 @@ func StringSlice(v []string) []*string { // // clientversion is the binding version -const clientversion = "72.116.0" +const clientversion = "72.119.0" // defaultHTTPTimeout is the default timeout on the http.Client used by the library. // This is chosen to be consistent with the other Stripe language libraries and diff --git a/sub.go b/sub.go index 993f35081a..52c568b5cd 100644 --- a/sub.go +++ b/sub.go @@ -423,6 +423,8 @@ type SubscriptionParams struct { CollectionMethod *string `form:"collection_method"` // The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. Coupon *string `form:"coupon"` + // 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"` // The identifier of the customer to subscribe. Customer *string `form:"customer"` // Number of days a customer has to pay invoices generated by this subscription. Valid only for subscriptions where `collection_method` is set to `send_invoice`. @@ -669,6 +671,8 @@ type Subscription struct { CollectionMethod SubscriptionCollectionMethod `json:"collection_method"` // Time at which the object was created. Measured in seconds since the Unix epoch. Created int64 `json:"created"` + // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + Currency Currency `json:"currency"` // End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created. CurrentPeriodEnd int64 `json:"current_period_end"` // Start of the current period that the subscription has been invoiced for. diff --git a/subschedule.go b/subschedule.go index 876e6868f2..11b89d75f6 100644 --- a/subschedule.go +++ b/subschedule.go @@ -176,6 +176,8 @@ type SubscriptionSchedulePhaseParams struct { CollectionMethod *string `form:"collection_method"` // The identifier of the coupon to apply to this phase of the subscription schedule. Coupon *string `form:"coupon"` + // 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 default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. DefaultPaymentMethod *string `form:"default_payment_method"` // A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. @@ -331,6 +333,8 @@ type SubscriptionSchedulePhase struct { CollectionMethod SubscriptionCollectionMethod `json:"collection_method"` // ID of the coupon to use during this phase of the subscription schedule. Coupon *Coupon `json:"coupon"` + // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + Currency Currency `json:"currency"` // ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. DefaultPaymentMethod *PaymentMethod `json:"default_payment_method"` // The default tax rates to apply to the subscription during this phase of the subscription schedule. diff --git a/testhelpers/issuing/card/client.go b/testhelpers/issuing/card/client.go new file mode 100644 index 0000000000..9234d3fc9f --- /dev/null +++ b/testhelpers/issuing/card/client.go @@ -0,0 +1,88 @@ +// +// +// File generated from our OpenAPI spec +// +// + +// Package card provides the /issuing/cards APIs +package card + +import ( + "net/http" + + stripe "github.com/stripe/stripe-go/v72" +) + +// Client is used to invoke /issuing/cards APIs. +type Client struct { + B stripe.Backend + Key string +} + +// DeliverCard is the method for the `POST /v1/test_helpers/issuing/cards/{card}/shipping/deliver` API. +func DeliverCard(id string, params *stripe.TestHelpersIssuingCardDeliverCardParams) (*stripe.IssuingCard, error) { + return getC().DeliverCard(id, params) +} + +// DeliverCard is the method for the `POST /v1/test_helpers/issuing/cards/{card}/shipping/deliver` API. +func (c Client) DeliverCard(id string, params *stripe.TestHelpersIssuingCardDeliverCardParams) (*stripe.IssuingCard, error) { + path := stripe.FormatURLPath( + "/v1/test_helpers/issuing/cards/%s/shipping/deliver", + id, + ) + card := &stripe.IssuingCard{} + err := c.B.Call(http.MethodPost, path, c.Key, params, card) + return card, err +} + +// FailCard is the method for the `POST /v1/test_helpers/issuing/cards/{card}/shipping/fail` API. +func FailCard(id string, params *stripe.TestHelpersIssuingCardFailCardParams) (*stripe.IssuingCard, error) { + return getC().FailCard(id, params) +} + +// FailCard is the method for the `POST /v1/test_helpers/issuing/cards/{card}/shipping/fail` API. +func (c Client) FailCard(id string, params *stripe.TestHelpersIssuingCardFailCardParams) (*stripe.IssuingCard, error) { + path := stripe.FormatURLPath( + "/v1/test_helpers/issuing/cards/%s/shipping/fail", + id, + ) + card := &stripe.IssuingCard{} + err := c.B.Call(http.MethodPost, path, c.Key, params, card) + return card, err +} + +// ReturnCard is the method for the `POST /v1/test_helpers/issuing/cards/{card}/shipping/return` API. +func ReturnCard(id string, params *stripe.TestHelpersIssuingCardReturnCardParams) (*stripe.IssuingCard, error) { + return getC().ReturnCard(id, params) +} + +// ReturnCard is the method for the `POST /v1/test_helpers/issuing/cards/{card}/shipping/return` API. +func (c Client) ReturnCard(id string, params *stripe.TestHelpersIssuingCardReturnCardParams) (*stripe.IssuingCard, error) { + path := stripe.FormatURLPath( + "/v1/test_helpers/issuing/cards/%s/shipping/return", + id, + ) + card := &stripe.IssuingCard{} + err := c.B.Call(http.MethodPost, path, c.Key, params, card) + return card, err +} + +// ShipCard is the method for the `POST /v1/test_helpers/issuing/cards/{card}/shipping/ship` API. +func ShipCard(id string, params *stripe.TestHelpersIssuingCardShipCardParams) (*stripe.IssuingCard, error) { + return getC().ShipCard(id, params) +} + +// ShipCard is the method for the `POST /v1/test_helpers/issuing/cards/{card}/shipping/ship` API. +func (c Client) ShipCard(id string, params *stripe.TestHelpersIssuingCardShipCardParams) (*stripe.IssuingCard, error) { + path := stripe.FormatURLPath( + "/v1/test_helpers/issuing/cards/%s/shipping/ship", + id, + ) + card := &stripe.IssuingCard{} + err := c.B.Call(http.MethodPost, path, c.Key, params, card) + return card, err +} + +func getC() Client { + return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key} +} diff --git a/testhelpersissuing_card.go b/testhelpersissuing_card.go new file mode 100644 index 0000000000..783cfbb98c --- /dev/null +++ b/testhelpersissuing_card.go @@ -0,0 +1,27 @@ +// +// +// File generated from our OpenAPI spec +// +// + +package stripe + +// Updates the shipping status of the specified Issuing Card object to delivered. +type TestHelpersIssuingCardDeliverCardParams struct { + Params `form:"*"` +} + +// Updates the shipping status of the specified Issuing Card object to shipped. +type TestHelpersIssuingCardShipCardParams struct { + Params `form:"*"` +} + +// Updates the shipping status of the specified Issuing Card object to returned. +type TestHelpersIssuingCardReturnCardParams struct { + Params `form:"*"` +} + +// Updates the shipping status of the specified Issuing Card object to failure. +type TestHelpersIssuingCardFailCardParams struct { + Params `form:"*"` +} diff --git a/testhelpersterminal_reader.go b/testhelpersterminal_reader.go index f7a8c6507a..841115bf2c 100644 --- a/testhelpersterminal_reader.go +++ b/testhelpersterminal_reader.go @@ -6,7 +6,7 @@ package stripe -// Simulated card present data +// Simulated data for the card_present payment method type TestHelpersTerminalReaderPresentPaymentMethodCardPresentParams struct { // Card Number Number *string `form:"number"` @@ -15,7 +15,7 @@ type TestHelpersTerminalReaderPresentPaymentMethodCardPresentParams struct { // Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction. type TestHelpersTerminalReaderPresentPaymentMethodParams struct { Params `form:"*"` - // Simulated card present data + // Simulated data for the card_present payment method CardPresent *TestHelpersTerminalReaderPresentPaymentMethodCardPresentParams `form:"card_present"` // Simulated payment type Type *string `form:"type"` diff --git a/treasury_receivedcredit.go b/treasury_receivedcredit.go index e39702bed0..b62b561667 100644 --- a/treasury_receivedcredit.go +++ b/treasury_receivedcredit.go @@ -168,7 +168,7 @@ type TreasuryReceivedCreditLinkedFlows struct { IssuingAuthorization string `json:"issuing_authorization"` // Set if the ReceivedCredit is also viewable as an [Issuing transaction](https://stripe.com/docs/api#issuing_transactions) object. IssuingTransaction string `json:"issuing_transaction"` - // ID of the source flow. Set if `network` is `stripe` and the source flow is visible to the merchant. Examples of source flows include OutboundPayments, payouts, or CreditReversals. + // ID of the source flow. Set if `network` is `stripe` and the source flow is visible to the user. Examples of source flows include OutboundPayments, payouts, or CreditReversals. SourceFlow string `json:"source_flow"` // The expandable object of the source flow. SourceFlowDetails *TreasuryReceivedCreditLinkedFlowsSourceFlowDetails `json:"source_flow_details"` @@ -199,6 +199,8 @@ type TreasuryReceivedCredit struct { FailureCode TreasuryReceivedCreditFailureCode `json:"failure_code"` // The FinancialAccount that received the funds. FinancialAccount string `json:"financial_account"` + // A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + HostedRegulatoryReceiptURL string `json:"hosted_regulatory_receipt_url"` // Unique identifier for the object. ID string `json:"id"` InitiatingPaymentMethodDetails *TreasuryReceivedCreditInitiatingPaymentMethodDetails `json:"initiating_payment_method_details"` diff --git a/treasury_receiveddebit.go b/treasury_receiveddebit.go index 23632dd3e0..4d6e09ca2a 100644 --- a/treasury_receiveddebit.go +++ b/treasury_receiveddebit.go @@ -155,6 +155,8 @@ type TreasuryReceivedDebit struct { FailureCode TreasuryReceivedDebitFailureCode `json:"failure_code"` // The FinancialAccount that funds were pulled from. FinancialAccount string `json:"financial_account"` + // A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + HostedRegulatoryReceiptURL string `json:"hosted_regulatory_receipt_url"` // Unique identifier for the object. ID string `json:"id"` InitiatingPaymentMethodDetails *TreasuryReceivedDebitInitiatingPaymentMethodDetails `json:"initiating_payment_method_details"`