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 68f66cf6b6..88c261aca9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,30 @@ # Changelog +## 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` + +* [#1482](https://github.com/stripe/stripe-go/pull/1482) Use the generated API version + ## 72.115.0 - 2022-06-17 * [#1477](https://github.com/stripe/stripe-go/pull/1477) API Updates * Add support for `FundCashBalance` test helper method on resource `Customer` diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index d13b3bd2b4..515f433c0c 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v158 \ No newline at end of file +v161 \ No newline at end of file diff --git a/README.md b/README.md index f89c3cf487..da7251a9e0 100644 --- a/README.md +++ b/README.md @@ -370,7 +370,47 @@ c, _ := charge.Retrieve("ch_123", p) c.Customer.ID // ID is still available c.Customer.Name // Name is now also available (if it had a value) ``` +### How to use undocumented parameters and properties +stripe-go is a typed library and it supports all public properties or parameters. + +Stripe sometimes launches private beta features which introduce new properties or parameters that are not immediately public. These will not have typed accessors in the stripe-go library but can still be used. + +#### Parameters + +To pass undocumented parameters to Stripe using stripe-go you need to use the `AddExtra()` method, as shown below: + +```go + + params := &stripe.CustomerParams{ + Email: stripe.String("jenny.rosen@example.com") + } + + params.AddExtra("secret_feature_enabled", "true") + params.AddExtra("secret_parameter[primary]","primary value") + params.AddExtra("secret_parameter[secondary]","secondary value") + + customer, err := customer.Create(params) +``` + +#### Properties + +You can access undocumented properties returned by Stripe by querying the raw response JSON object. An example of this is shown below: + +```go +customer, _ = customer.Get("cus_1234", nil); + +var rawData map[string]interface{} +_ = json.Unmarshal(customer.LastResponse.RawJSON, &rawData) + +secret_feature_enabled, _ := string(rawData["secret_feature_enabled"].(bool)) + +secret_parameter, ok := rawData["secret_parameter"].(map[string]interface{}) +if ok { + primary := secret_parameter["primary"].(string) + seconardy := secret_parameter["secondary"].(string) +} +``` ### Writing a Plugin If you're writing a plugin that uses the library, we'd appreciate it if you diff --git a/account.go b/account.go index dfb2a399f8..cfcff79e3b 100644 --- a/account.go +++ b/account.go @@ -111,13 +111,13 @@ const ( ) // The status of the promptpay payments capability of the account, or whether the account can directly process promptpay charges. -type AccountCapabilitiesPromptpayPayments string +type AccountCapabilitiesPromptPayPayments string -// List of values that AccountCapabilitiesPromptpayPayments can take +// List of values that AccountCapabilitiesPromptPayPayments can take const ( - AccountCapabilitiesPromptpayPaymentsActive AccountCapabilitiesPromptpayPayments = "active" - AccountCapabilitiesPromptpayPaymentsInactive AccountCapabilitiesPromptpayPayments = "inactive" - AccountCapabilitiesPromptpayPaymentsPending AccountCapabilitiesPromptpayPayments = "pending" + AccountCapabilitiesPromptPayPaymentsActive AccountCapabilitiesPromptPayPayments = "active" + AccountCapabilitiesPromptPayPaymentsInactive AccountCapabilitiesPromptPayPayments = "inactive" + AccountCapabilitiesPromptPayPaymentsPending AccountCapabilitiesPromptPayPayments = "pending" ) // The status of the banking capability, or whether the account can have bank accounts. @@ -458,7 +458,7 @@ type AccountCapabilitiesPayNowPaymentsParams struct { } // The promptpay_payments capability. -type AccountCapabilitiesPromptpayPaymentsParams struct { +type AccountCapabilitiesPromptPayPaymentsParams struct { // Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. Requested *bool `form:"requested"` } @@ -556,7 +556,7 @@ type AccountCapabilitiesParams struct { // The paynow_payments capability. PayNowPayments *AccountCapabilitiesPayNowPaymentsParams `form:"paynow_payments"` // The promptpay_payments capability. - PromptpayPayments *AccountCapabilitiesPromptpayPaymentsParams `form:"promptpay_payments"` + PromptPayPayments *AccountCapabilitiesPromptPayPaymentsParams `form:"promptpay_payments"` // The sepa_debit_payments capability. SEPADebitPayments *AccountCapabilitiesSEPADebitPaymentsParams `form:"sepa_debit_payments"` // The sofort_payments capability. @@ -964,7 +964,7 @@ type AccountCapabilities struct { // The status of the paynow payments capability of the account, or whether the account can directly process paynow charges. PayNowPayments AccountCapabilitiesPayNowPayments `json:"paynow_payments"` // The status of the promptpay payments capability of the account, or whether the account can directly process promptpay charges. - PromptpayPayments AccountCapabilitiesPromptpayPayments `json:"promptpay_payments"` + PromptPayPayments AccountCapabilitiesPromptPayPayments `json:"promptpay_payments"` // The status of the SEPA Direct Debits payments capability of the account, or whether the account can directly process SEPA Direct Debits charges. SEPADebitPayments AccountCapabilityStatus `json:"sepa_debit_payments"` // The status of the Sofort payments capability of the account, or whether the account can directly process Sofort charges. diff --git a/api_version.go b/api_version.go index 8ba0325624..63ecf7fccd 100644 --- a/api_version.go +++ b/api_version.go @@ -9,8 +9,3 @@ package stripe const ( apiVersion string = "2020-08-27" ) - -// -// Suppress the unused constant warning -// The constant is not used for GA releases but is used in betas -var _ = apiVersion diff --git a/charge.go b/charge.go index c4bd500cb6..6975b30b38 100644 --- a/charge.go +++ b/charge.go @@ -782,7 +782,7 @@ type ChargePaymentMethodDetailsPayNow struct { // Reference number associated with this PayNow payment Reference string `json:"reference"` } -type ChargePaymentMethodDetailsPromptpay struct { +type ChargePaymentMethodDetailsPromptPay struct { // Bill reference generated by PromptPay Reference string `json:"reference"` } @@ -881,7 +881,7 @@ type ChargePaymentMethodDetails struct { OXXO *ChargePaymentMethodDetailsOXXO `json:"oxxo"` P24 *ChargePaymentMethodDetailsP24 `json:"p24"` PayNow *ChargePaymentMethodDetailsPayNow `json:"paynow"` - Promptpay *ChargePaymentMethodDetailsPromptpay `json:"promptpay"` + PromptPay *ChargePaymentMethodDetailsPromptPay `json:"promptpay"` SepaCreditTransfer *ChargePaymentMethodDetailsSepaCreditTransfer `json:"sepa_credit_transfer"` SepaDebit *ChargePaymentMethodDetailsSepaDebit `json:"sepa_debit"` Sofort *ChargePaymentMethodDetailsSofort `json:"sofort"` diff --git a/checkout_session.go b/checkout_session.go index 36d54bddd6..99bebb4b42 100644 --- a/checkout_session.go +++ b/checkout_session.go @@ -1348,7 +1348,7 @@ 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. Address *Address `json:"address"` @@ -1711,7 +1711,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/example/generated_examples_test.go b/example/generated_examples_test.go index a938b63fed..ccf9e41671 100644 --- a/example/generated_examples_test.go +++ b/example/generated_examples_test.go @@ -1,3 +1,4 @@ +// File generated from our OpenAPI spec package example import ( @@ -8,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" @@ -60,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" @@ -84,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"), @@ -94,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) { @@ -132,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{ @@ -145,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"), @@ -154,16 +282,14 @@ func TestPaymentLinkListLineItems(t *testing.T) { assert.Nil(t, result.Err()) } -func TestPaymentLinkRetrieve(t *testing.T) { - params := &stripe.PaymentLinkParams{} - result, _ := paymentlink.Get("pl_xyz", 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) { @@ -172,52 +298,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) } @@ -228,15 +325,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) } @@ -252,73 +355,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) { @@ -346,18 +455,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, ) { @@ -395,1374 +504,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) - assert.NotNil(t, result) -} - -func TestChargeCapture(t *testing.T) { - params := &stripe.CaptureParams{} - result, _ := charge.Capture("ch_xxxxxxxxxxxxx", params) + result, _ := capability.Get("card_payments", params) assert.NotNil(t, result) } -func TestChargeList(t *testing.T) { - params := &stripe.ChargeListParams{} - params.Limit = stripe.Int64(3) - result := charge.List(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) - 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 TestPersonList(t *testing.T) { + params := &stripe.PersonListParams{ + Account: stripe.String("acct_xxxxxxxxxxxxx"), } - result := charge.Search(params) + params.Limit = stripe.Int64(3) + result := person.List(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)"), +func TestPersonCreate(t *testing.T) { + params := &stripe.PersonParams{ + FirstName: stripe.String("Jane"), + LastName: stripe.String("Diaz"), } - result, _ := customer.New(params) - assert.NotNil(t, result) -} - -func TestCustomerRetrieve(t *testing.T) { - params := &stripe.CustomerParams{} - result, _ := customer.Get("cus_xxxxxxxxxxxxx", params) + result, _ := person.New(params) assert.NotNil(t, result) } -func TestCustomerUpdate(t *testing.T) { - params := &stripe.CustomerParams{} +func TestPersonUpdate(t *testing.T) { + params := &stripe.PersonParams{Account: stripe.String("acct_xxxxxxxxxxxxx")} params.AddMetadata("order_id", "6735") - result, _ := customer.Update("cus_xxxxxxxxxxxxx", params) + result, _ := person.Update("person_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestCustomerDelete(t *testing.T) { - params := &stripe.CustomerParams{} - result, _ := customer.Del("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 TestCustomerList2(t *testing.T) { - params := &stripe.CustomerListParams{} +func TestBalanceTransactionList(t *testing.T) { + params := &stripe.BalanceTransactionListParams{} params.Limit = stripe.Int64(3) - result := customer.List(params) + result := balancetransaction.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) +func TestBalanceTransactionRetrieve(t *testing.T) { + params := &stripe.BalanceTransactionParams{} + result, _ := balancetransaction.Get("txn_xxxxxxxxxxxxx", params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } -func TestDisputeRetrieve(t *testing.T) { - params := &stripe.DisputeParams{} - result, _ := dispute.Get("dp_xxxxxxxxxxxxx", params) +func TestBillingPortalConfigurationList(t *testing.T) { + params := &stripe.BillingPortalConfigurationListParams{} + params.Limit = stripe.Int64(3) + result := billingportal_configuration.List(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } -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) +func TestCustomerBalanceTransactionRetrieve(t *testing.T) { + params := &stripe.CustomerBalanceTransactionParams{ + Customer: stripe.String("cus_xxxxxxxxxxxxx"), + } + result, _ := customerbalancetransaction.Get("cbtxn_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) - 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{} +func TestIdentityVerificationReportRetrieve(t *testing.T) { + params := &stripe.IdentityVerificationReportParams{} + result, _ := identity_verificationreport.Get("vr_xxxxxxxxxxxxx", params) + assert.NotNil(t, result) +} + +func TestIdentityVerificationSessionList(t *testing.T) { + params := &stripe.IdentityVerificationSessionListParams{} params.Limit = stripe.Int64(3) - result := price.List(params) + result := identity_verificationsession.List(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'", - }, +func TestIdentityVerificationSessionCreate(t *testing.T) { + params := &stripe.IdentityVerificationSessionParams{ + Type: stripe.String(string(stripe.IdentityVerificationSessionTypeDocument)), } - result := price.Search(params) + result, _ := identity_verificationsession.New(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), - } - result, _ := coupon.New(params) +func TestIdentityVerificationSessionRetrieve(t *testing.T) { + params := &stripe.IdentityVerificationSessionParams{} + result, _ := identity_verificationsession.Get("vs_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestCouponRetrieve(t *testing.T) { - params := &stripe.CouponParams{} - result, _ := coupon.Get("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 TestCouponUpdate(t *testing.T) { - params := &stripe.CouponParams{} - params.AddMetadata("order_id", "6735") - result, _ := coupon.Update("Z4OV52SU", params) +func TestIdentityVerificationSessionCancel(t *testing.T) { + params := &stripe.IdentityVerificationSessionCancelParams{} + result, _ := identity_verificationsession.Cancel("vs_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestCouponDelete(t *testing.T) { - params := &stripe.CouponParams{} - result, _ := coupon.Del("Z4OV52SU", params) +func TestIdentityVerificationSessionRedact(t *testing.T) { + params := &stripe.IdentityVerificationSessionRedactParams{} + result, _ := identity_verificationsession.Redact("vs_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestCouponList(t *testing.T) { - params := &stripe.CouponListParams{} +func TestInvoiceItemList(t *testing.T) { + params := &stripe.InvoiceItemListParams{} params.Limit = stripe.Int64(3) - result := coupon.List(params) + result := invoiceitem.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) +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 TestPromotionCodeUpdate(t *testing.T) { - params := &stripe.PromotionCodeParams{} - params.AddMetadata("order_id", "6735") - result, _ := promotioncode.Update("promo_xxxxxxxxxxxxx", params) +func TestInvoiceItemDelete(t *testing.T) { + params := &stripe.InvoiceItemParams{} + result, _ := invoiceitem.Del("ii_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestPromotionCodeRetrieve(t *testing.T) { - params := &stripe.PromotionCodeParams{} - result, _ := promotioncode.Get("promo_xxxxxxxxxxxxx", params) +func TestInvoiceItemRetrieve(t *testing.T) { + params := &stripe.InvoiceItemParams{} + result, _ := invoiceitem.Get("ii_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestPromotionCodeList(t *testing.T) { - params := &stripe.PromotionCodeListParams{} - params.Limit = stripe.Int64(3) - result := promotioncode.List(params) +func TestInvoiceItemUpdate(t *testing.T) { + params := &stripe.InvoiceItemParams{} + params.AddMetadata("order_id", "6735") + result, _ := invoiceitem.Update("ii_xxxxxxxxxxxxx", params) assert.NotNil(t, result) - assert.Nil(t, result.Err()) } -func TestTaxCodeList(t *testing.T) { - params := &stripe.TaxCodeListParams{} +func TestInvoiceList(t *testing.T) { + params := &stripe.InvoiceListParams{} params.Limit = stripe.Int64(3) - result := taxcode.List(params) + result := invoice.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 TestInvoiceCreate(t *testing.T) { + params := &stripe.InvoiceParams{Customer: stripe.String("cus_xxxxxxxxxxxxx")} + result, _ := invoice.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 TestInvoiceDelete(t *testing.T) { + params := &stripe.InvoiceParams{} + result, _ := invoice.Del("in_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTaxRateRetrieve(t *testing.T) { - params := &stripe.TaxRateParams{} - result, _ := taxrate.Get("txr_xxxxxxxxxxxxx", params) +func TestInvoiceRetrieve(t *testing.T) { + params := &stripe.InvoiceParams{} + result, _ := invoice.Get("in_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 TestInvoiceUpdate(t *testing.T) { + params := &stripe.InvoiceParams{} + params.AddMetadata("order_id", "6735") + result, _ := invoice.Update("in_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTaxRateList(t *testing.T) { - params := &stripe.TaxRateListParams{} - params.Limit = stripe.Int64(3) - result := taxrate.List(params) +func TestInvoiceFinalizeInvoice(t *testing.T) { + params := &stripe.InvoiceFinalizeParams{} + result, _ := invoice.FinalizeInvoice("in_xxxxxxxxxxxxx", 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 TestInvoiceMarkUncollectible(t *testing.T) { + params := &stripe.InvoiceMarkUncollectibleParams{} + result, _ := invoice.MarkUncollectible("in_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestShippingRateRetrieve(t *testing.T) { - params := &stripe.ShippingRateParams{} - result, _ := shippingrate.Get("shr_xxxxxxxxxxxxx", params) +func TestInvoicePay(t *testing.T) { + params := &stripe.InvoicePayParams{} + result, _ := invoice.Pay("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 TestInvoiceSendInvoice(t *testing.T) { + params := &stripe.InvoiceSendParams{} + result, _ := invoice.SendInvoice("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 TestInvoiceVoidInvoice(t *testing.T) { + params := &stripe.InvoiceVoidParams{} + result, _ := invoice.VoidInvoice("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 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 TestCheckoutSessionRetrieve(t *testing.T) { - params := &stripe.CheckoutSessionParams{} - result, _ := checkout_session.Get("cs_test_xxxxxxxxxxxxx", params) +func TestIssuingAuthorizationList(t *testing.T) { + params := &stripe.IssuingAuthorizationListParams{} + params.Limit = stripe.Int64(3) + result := issuing_authorization.List(params) assert.NotNil(t, result) + assert.Nil(t, result.Err()) } -func TestCheckoutSessionList(t *testing.T) { - params := &stripe.CheckoutSessionListParams{} - params.Limit = stripe.Int64(3) - result := checkout_session.List(params) +func TestIssuingAuthorizationRetrieve(t *testing.T) { + params := &stripe.IssuingAuthorizationParams{} + result, _ := issuing_authorization.Get("iauth_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 TestIssuingAuthorizationUpdate(t *testing.T) { + params := &stripe.IssuingAuthorizationParams{} + params.AddMetadata("order_id", "6735") + result, _ := issuing_authorization.Update("iauth_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestPaymentLinkRetrieve2(t *testing.T) { - params := &stripe.PaymentLinkParams{} - result, _ := paymentlink.Get("plink_xxxxxxxxxxxxx", params) +func TestIssuingAuthorizationApprove(t *testing.T) { + params := &stripe.IssuingAuthorizationApproveParams{} + result, _ := issuing_authorization.Approve("iauth_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 TestIssuingAuthorizationDecline(t *testing.T) { + params := &stripe.IssuingAuthorizationDeclineParams{} + result, _ := issuing_authorization.Decline("iauth_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestPaymentLinkList(t *testing.T) { - params := &stripe.PaymentLinkListParams{} +func TestIssuingCardholderList(t *testing.T) { + params := &stripe.IssuingCardholderListParams{} params.Limit = stripe.Int64(3) - result := paymentlink.List(params) + result := issuing_cardholder.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)), +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"), + }, + }, } - result, _ := customerbalancetransaction.New(params) + result, _ := issuing_cardholder.New(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 TestIssuingCardholderRetrieve(t *testing.T) { + params := &stripe.IssuingCardholderParams{} + result, _ := issuing_cardholder.Get("ich_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestCustomerBalanceTransactionUpdate(t *testing.T) { - params := &stripe.CustomerBalanceTransactionParams{ - Customer: stripe.String("cus_xxxxxxxxxxxxx"), - } +func TestIssuingCardholderUpdate(t *testing.T) { + params := &stripe.IssuingCardholderParams{} params.AddMetadata("order_id", "6735") - result, _ := customerbalancetransaction.Update("cbtxn_xxxxxxxxxxxxx", params) + result, _ := issuing_cardholder.Update("ich_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestCustomerBalanceTransactionList(t *testing.T) { - params := &stripe.CustomerBalanceTransactionListParams{ - Customer: stripe.String("cus_xxxxxxxxxxxxx"), - } +func TestIssuingCardList(t *testing.T) { + params := &stripe.IssuingCardListParams{} params.Limit = stripe.Int64(3) - result := customerbalancetransaction.List(params) + result := issuing_card.List(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) - assert.NotNil(t, result) -} - -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"), - }, +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, _ := billingportal_configuration.New(params) + result, _ := issuing_card.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 TestIssuingCardRetrieve(t *testing.T) { + params := &stripe.IssuingCardParams{} + result, _ := issuing_card.Get("ic_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestBillingPortalConfigurationRetrieve(t *testing.T) { - params := &stripe.BillingPortalConfigurationParams{} - result, _ := billingportal_configuration.Get("bpc_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 TestBillingPortalConfigurationList(t *testing.T) { - params := &stripe.BillingPortalConfigurationListParams{} +func TestIssuingDisputeList(t *testing.T) { + params := &stripe.IssuingDisputeListParams{} params.Limit = stripe.Int64(3) - result := billingportal_configuration.List(params) + result := issuing_dispute.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 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, _ := taxid.New(params) + result, _ := issuing_dispute.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 TestIssuingDisputeRetrieve(t *testing.T) { + params := &stripe.IssuingDisputeParams{} + result, _ := issuing_dispute.Get("idp_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 TestIssuingDisputeSubmit(t *testing.T) { + params := &stripe.IssuingDisputeSubmitParams{} + result, _ := issuing_dispute.Submit("idp_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestTaxIDList(t *testing.T) { - params := &stripe.TaxIDListParams{ - Customer: stripe.String("cus_xxxxxxxxxxxxx"), - } +func TestIssuingTransactionList(t *testing.T) { + params := &stripe.IssuingTransactionListParams{} params.Limit = stripe.Int64(3) - result := taxid.List(params) + result := issuing_transaction.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) - assert.NotNil(t, result) -} - -func TestInvoiceRetrieve(t *testing.T) { - params := &stripe.InvoiceParams{} - result, _ := invoice.Get("in_xxxxxxxxxxxxx", params) +func TestIssuingTransactionRetrieve(t *testing.T) { + params := &stripe.IssuingTransactionParams{} + result, _ := issuing_transaction.Get("ipi_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestInvoiceUpdate(t *testing.T) { - params := &stripe.InvoiceParams{} +func TestIssuingTransactionUpdate(t *testing.T) { + params := &stripe.IssuingTransactionParams{} params.AddMetadata("order_id", "6735") - result, _ := invoice.Update("in_xxxxxxxxxxxxx", params) + result, _ := issuing_transaction.Update("ipi_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestInvoiceDelete(t *testing.T) { - params := &stripe.InvoiceParams{} - result, _ := invoice.Del("in_xxxxxxxxxxxxx", params) +func TestMandateRetrieve(t *testing.T) { + params := &stripe.MandateParams{} + result, _ := mandate.Get("mandate_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestInvoiceFinalizeInvoice(t *testing.T) { - params := &stripe.InvoiceFinalizeParams{} - result, _ := invoice.FinalizeInvoice("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 TestInvoicePay(t *testing.T) { - params := &stripe.InvoicePayParams{} - result, _ := invoice.Pay("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 TestInvoiceSendInvoice(t *testing.T) { - params := &stripe.InvoiceSendParams{} - result, _ := invoice.SendInvoice("in_xxxxxxxxxxxxx", params) +func TestPaymentIntentRetrieve(t *testing.T) { + params := &stripe.PaymentIntentParams{} + result, _ := paymentintent.Get("pi_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestInvoiceVoidInvoice(t *testing.T) { - params := &stripe.InvoiceVoidParams{} - result, _ := invoice.VoidInvoice("in_xxxxxxxxxxxxx", params) +func TestPaymentIntentUpdate(t *testing.T) { + params := &stripe.PaymentIntentParams{} + params.AddMetadata("order_id", "6735") + result, _ := paymentintent.Update("pi_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestInvoiceMarkUncollectible(t *testing.T) { - params := &stripe.InvoiceMarkUncollectibleParams{} - result, _ := invoice.MarkUncollectible("in_xxxxxxxxxxxxx", params) +func TestPaymentIntentApplyCustomerBalance(t *testing.T) { + params := &stripe.PaymentIntentApplyCustomerBalanceParams{} + result, _ := paymentintent.ApplyCustomerBalance("pi_xxxxxxxxxxxxx", params) assert.NotNil(t, result) } -func TestInvoiceList(t *testing.T) { - params := &stripe.InvoiceListParams{} - params.Limit = stripe.Int64(3) - result := invoice.List(params) +func TestPaymentIntentCancel(t *testing.T) { + params := &stripe.PaymentIntentCancelParams{} + result, _ := paymentintent.Cancel("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 TestPaymentIntentCapture(t *testing.T) { + params := &stripe.PaymentIntentCaptureParams{} + result, _ := paymentintent.Capture("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"), +func TestPaymentIntentConfirm(t *testing.T) { + params := &stripe.PaymentIntentConfirmParams{ + PaymentMethod: stripe.String("pm_card_visa"), } - result, _ := invoiceitem.New(params) - assert.NotNil(t, result) -} - -func TestInvoiceItemRetrieve(t *testing.T) { - params := &stripe.InvoiceItemParams{} - result, _ := invoiceitem.Get("ii_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) - assert.NotNil(t, result) -} - -func TestInvoiceItemDelete(t *testing.T) { - params := &stripe.InvoiceItemParams{} - result, _ := invoiceitem.Del("ii_xxxxxxxxxxxxx", params) + 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 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)), + }, + 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()) } @@ -1773,312 +1800,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) { @@ -2091,6 +2088,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) @@ -2107,452 +2110,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()) } @@ -2569,6 +2621,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) @@ -2582,17 +2640,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 dc25f27e89..06e0699042 100644 --- a/invoice.go +++ b/invoice.go @@ -123,7 +123,7 @@ const ( InvoicePaymentSettingsPaymentMethodTypeKonbini InvoicePaymentSettingsPaymentMethodType = "konbini" InvoicePaymentSettingsPaymentMethodTypeLink InvoicePaymentSettingsPaymentMethodType = "link" InvoicePaymentSettingsPaymentMethodTypePayNow InvoicePaymentSettingsPaymentMethodType = "paynow" - InvoicePaymentSettingsPaymentMethodTypePromptpay InvoicePaymentSettingsPaymentMethodType = "promptpay" + InvoicePaymentSettingsPaymentMethodTypePromptPay InvoicePaymentSettingsPaymentMethodType = "promptpay" InvoicePaymentSettingsPaymentMethodTypeSepaCreditTransfer InvoicePaymentSettingsPaymentMethodType = "sepa_credit_transfer" InvoicePaymentSettingsPaymentMethodTypeSepaDebit InvoicePaymentSettingsPaymentMethodType = "sepa_debit" InvoicePaymentSettingsPaymentMethodTypeSofort InvoicePaymentSettingsPaymentMethodType = "sofort" @@ -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"` } @@ -528,7 +528,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/paymentintent.go b/paymentintent.go index b31aab5dc1..f962e6a61c 100644 --- a/paymentintent.go +++ b/paymentintent.go @@ -530,11 +530,11 @@ const ( // Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. // // When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). -type PaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage string +type PaymentIntentPaymentMethodOptionsPromptPaySetupFutureUsage string -// List of values that PaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage can take +// List of values that PaymentIntentPaymentMethodOptionsPromptPaySetupFutureUsage can take const ( - PaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsageNone PaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage = "none" + PaymentIntentPaymentMethodOptionsPromptPaySetupFutureUsageNone PaymentIntentPaymentMethodOptionsPromptPaySetupFutureUsage = "none" ) // Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -715,7 +715,7 @@ type PaymentIntentPaymentMethodDataLinkParams struct{} type PaymentIntentPaymentMethodDataPayNowParams struct{} // If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. -type PaymentIntentPaymentMethodDataPromptpayParams struct{} +type PaymentIntentPaymentMethodDataPromptPayParams struct{} // Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. type PaymentIntentPaymentMethodDataRadarOptionsParams struct { @@ -789,7 +789,7 @@ type PaymentIntentPaymentMethodDataParams struct { // If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. PayNow *PaymentIntentPaymentMethodDataPayNowParams `form:"paynow"` // If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. - Promptpay *PaymentIntentPaymentMethodDataPromptpayParams `form:"promptpay"` + PromptPay *PaymentIntentPaymentMethodDataPromptPayParams `form:"promptpay"` // Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. RadarOptions *PaymentIntentPaymentMethodDataRadarOptionsParams `form:"radar_options"` // If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. @@ -1225,7 +1225,7 @@ type PaymentIntentPaymentMethodOptionsPayNowParams struct { } // If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. -type PaymentIntentPaymentMethodOptionsPromptpayParams struct { +type PaymentIntentPaymentMethodOptionsPromptPayParams struct { // Indicates that you intend to make future payments with this PaymentIntent's payment method. // // Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. @@ -1364,7 +1364,7 @@ type PaymentIntentPaymentMethodOptionsParams struct { // If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. PayNow *PaymentIntentPaymentMethodOptionsPayNowParams `form:"paynow"` // If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. - Promptpay *PaymentIntentPaymentMethodOptionsPromptpayParams `form:"promptpay"` + PromptPay *PaymentIntentPaymentMethodOptionsPromptPayParams `form:"promptpay"` // If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. SepaDebit *PaymentIntentPaymentMethodOptionsSepaDebitParams `form:"sepa_debit"` // If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. @@ -1521,6 +1521,8 @@ type PaymentIntentConfirmRadarOptionsParams struct { // to learn more about manual confirmation. type PaymentIntentConfirmParams struct { Params `form:"*"` + // Controls when the funds will be captured from the customer's account. + CaptureMethod *string `form:"capture_method"` // Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. This parameter is intended for simpler integrations that do not handle customer actions, like [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). ErrorOnRequiresAction *bool `form:"error_on_requires_action"` // ID of the mandate to be used for this payment. @@ -1844,14 +1846,14 @@ type PaymentIntentNextActionPayNowDisplayQRCode struct { // The image_url_svg string used to render QR code ImageURLSVG string `json:"image_url_svg"` } -type PaymentIntentNextActionPromptpayDisplayQRCode struct { +type PaymentIntentNextActionPromptPayDisplayQRCode struct { // The raw data string used to generate QR code, it should be used together with QR code library. Data string `json:"data"` // The URL to the hosted PromptPay instructions page, which allows customers to view the PromptPay QR code. HostedInstructionsURL string `json:"hosted_instructions_url"` - // ​​The image_url_png string used to render QR code, can be used as + // The image_url_png string used to render QR code, can be used as ImageURLPNG string `json:"image_url_png"` - // ​​The image_url_svg string used to render QR code, can be used as + // The image_url_svg string used to render QR code, can be used as ImageURLSVG string `json:"image_url_svg"` } type PaymentIntentNextActionRedirectToURL struct { @@ -1911,7 +1913,7 @@ type PaymentIntentNextAction struct { KonbiniDisplayDetails *PaymentIntentNextActionKonbiniDisplayDetails `json:"konbini_display_details"` OXXODisplayDetails *PaymentIntentNextActionOXXODisplayDetails `json:"oxxo_display_details"` PayNowDisplayQRCode *PaymentIntentNextActionPayNowDisplayQRCode `json:"paynow_display_qr_code"` - PromptpayDisplayQRCode *PaymentIntentNextActionPromptpayDisplayQRCode `json:"promptpay_display_qr_code"` + PromptPayDisplayQRCode *PaymentIntentNextActionPromptPayDisplayQRCode `json:"promptpay_display_qr_code"` RedirectToURL *PaymentIntentNextActionRedirectToURL `json:"redirect_to_url"` // Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`. Type PaymentIntentNextActionType `json:"type"` @@ -2228,13 +2230,13 @@ type PaymentIntentPaymentMethodOptionsPayNow struct { // When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). SetupFutureUsage PaymentIntentPaymentMethodOptionsPayNowSetupFutureUsage `json:"setup_future_usage"` } -type PaymentIntentPaymentMethodOptionsPromptpay struct { +type PaymentIntentPaymentMethodOptionsPromptPay struct { // Indicates that you intend to make future payments with this PaymentIntent's payment method. // // Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. // // When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - SetupFutureUsage PaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage `json:"setup_future_usage"` + SetupFutureUsage PaymentIntentPaymentMethodOptionsPromptPaySetupFutureUsage `json:"setup_future_usage"` } type PaymentIntentPaymentMethodOptionsSepaDebitMandateOptions struct{} @@ -2314,7 +2316,7 @@ type PaymentIntentPaymentMethodOptions struct { OXXO *PaymentIntentPaymentMethodOptionsOXXO `json:"oxxo"` P24 *PaymentIntentPaymentMethodOptionsP24 `json:"p24"` PayNow *PaymentIntentPaymentMethodOptionsPayNow `json:"paynow"` - Promptpay *PaymentIntentPaymentMethodOptionsPromptpay `json:"promptpay"` + PromptPay *PaymentIntentPaymentMethodOptionsPromptPay `json:"promptpay"` SepaDebit *PaymentIntentPaymentMethodOptionsSepaDebit `json:"sepa_debit"` Sofort *PaymentIntentPaymentMethodOptionsSofort `json:"sofort"` USBankAccount *PaymentIntentPaymentMethodOptionsUSBankAccount `json:"us_bank_account"` diff --git a/paymentlink.go b/paymentlink.go index fb3f6dd155..64695bcdd3 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. @@ -234,7 +256,7 @@ type PaymentLinkParams struct { OnBehalfOf *string `form:"on_behalf_of"` // A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. PaymentIntentData *PaymentLinkPaymentIntentDataParams `form:"payment_intent_data"` - // The list of payment method types that customers can use. Only `card` is supported. Pass an empty string to enable automatic payment methods that use your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). + // The list of payment method types that customers can use. Pass an empty string to enable automatic payment methods that use your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). PaymentMethodTypes []*string `form:"payment_method_types"` // Controls phone number collection settings during checkout. // diff --git a/paymentmethod.go b/paymentmethod.go index 918e8a0042..c3e80a0417 100644 --- a/paymentmethod.go +++ b/paymentmethod.go @@ -89,7 +89,7 @@ const ( PaymentMethodTypeOXXO PaymentMethodType = "oxxo" PaymentMethodTypeP24 PaymentMethodType = "p24" PaymentMethodTypePayNow PaymentMethodType = "paynow" - PaymentMethodTypePromptpay PaymentMethodType = "promptpay" + PaymentMethodTypePromptPay PaymentMethodType = "promptpay" PaymentMethodTypeSepaDebit PaymentMethodType = "sepa_debit" PaymentMethodTypeSofort PaymentMethodType = "sofort" PaymentMethodTypeUSBankAccount PaymentMethodType = "us_bank_account" @@ -260,7 +260,7 @@ type PaymentMethodP24Params struct { type PaymentMethodPayNowParams struct{} // If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. -type PaymentMethodPromptpayParams struct{} +type PaymentMethodPromptPayParams struct{} // Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. type PaymentMethodRadarOptionsParams struct { @@ -349,7 +349,7 @@ type PaymentMethodParams struct { // If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. PayNow *PaymentMethodPayNowParams `form:"paynow"` // If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. - Promptpay *PaymentMethodPromptpayParams `form:"promptpay"` + PromptPay *PaymentMethodPromptPayParams `form:"promptpay"` // Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. RadarOptions *PaymentMethodRadarOptionsParams `form:"radar_options"` // This is a legacy parameter that will be removed in the future. It is a hash that does not accept any keys. @@ -590,7 +590,7 @@ type PaymentMethodP24 struct { Bank string `json:"bank"` } type PaymentMethodPayNow struct{} -type PaymentMethodPromptpay struct{} +type PaymentMethodPromptPay struct{} // Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. type PaymentMethodRadarOptions struct { @@ -694,7 +694,7 @@ type PaymentMethod struct { OXXO *PaymentMethodOXXO `json:"oxxo"` P24 *PaymentMethodP24 `json:"p24"` PayNow *PaymentMethodPayNow `json:"paynow"` - Promptpay *PaymentMethodPromptpay `json:"promptpay"` + PromptPay *PaymentMethodPromptPay `json:"promptpay"` // Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. RadarOptions *PaymentMethodRadarOptions `json:"radar_options"` SepaDebit *PaymentMethodSepaDebit `json:"sepa_debit"` diff --git a/setupintent.go b/setupintent.go index 489d9ed5a4..9c38fb00b0 100644 --- a/setupintent.go +++ b/setupintent.go @@ -348,7 +348,7 @@ type SetupIntentPaymentMethodDataP24Params struct { type SetupIntentPaymentMethodDataPayNowParams struct{} // If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. -type SetupIntentPaymentMethodDataPromptpayParams struct{} +type SetupIntentPaymentMethodDataPromptPayParams struct{} // Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. type SetupIntentPaymentMethodDataRadarOptionsParams struct { @@ -435,7 +435,7 @@ type SetupIntentPaymentMethodDataParams struct { // If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. PayNow *SetupIntentPaymentMethodDataPayNowParams `form:"paynow"` // If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. - Promptpay *SetupIntentPaymentMethodDataPromptpayParams `form:"promptpay"` + PromptPay *SetupIntentPaymentMethodDataPromptPayParams `form:"promptpay"` // Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. RadarOptions *SetupIntentPaymentMethodDataRadarOptionsParams `form:"radar_options"` // If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. @@ -758,7 +758,7 @@ type SetupIntentConfirmPaymentMethodDataP24Params struct { type SetupIntentConfirmPaymentMethodDataPayNowParams struct{} // If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. -type SetupIntentConfirmPaymentMethodDataPromptpayParams struct{} +type SetupIntentConfirmPaymentMethodDataPromptPayParams struct{} // Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. type SetupIntentConfirmPaymentMethodDataRadarOptionsParams struct { @@ -845,7 +845,7 @@ type SetupIntentConfirmPaymentMethodDataParams struct { // If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. PayNow *SetupIntentConfirmPaymentMethodDataPayNowParams `form:"paynow"` // If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. - Promptpay *SetupIntentConfirmPaymentMethodDataPromptpayParams `form:"promptpay"` + PromptPay *SetupIntentConfirmPaymentMethodDataPromptPayParams `form:"promptpay"` // Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. RadarOptions *SetupIntentConfirmPaymentMethodDataRadarOptionsParams `form:"radar_options"` // If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. diff --git a/sub.go b/sub.go index b28880f136..993f35081a 100644 --- a/sub.go +++ b/sub.go @@ -116,7 +116,7 @@ const ( SubscriptionPaymentSettingsPaymentMethodTypeKonbini SubscriptionPaymentSettingsPaymentMethodType = "konbini" SubscriptionPaymentSettingsPaymentMethodTypeLink SubscriptionPaymentSettingsPaymentMethodType = "link" SubscriptionPaymentSettingsPaymentMethodTypePayNow SubscriptionPaymentSettingsPaymentMethodType = "paynow" - SubscriptionPaymentSettingsPaymentMethodTypePromptpay SubscriptionPaymentSettingsPaymentMethodType = "promptpay" + SubscriptionPaymentSettingsPaymentMethodTypePromptPay SubscriptionPaymentSettingsPaymentMethodType = "promptpay" SubscriptionPaymentSettingsPaymentMethodTypeSepaCreditTransfer SubscriptionPaymentSettingsPaymentMethodType = "sepa_credit_transfer" SubscriptionPaymentSettingsPaymentMethodTypeSepaDebit SubscriptionPaymentSettingsPaymentMethodType = "sepa_debit" SubscriptionPaymentSettingsPaymentMethodTypeSofort SubscriptionPaymentSettingsPaymentMethodType = "sofort" 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/treasury_receivedcredit.go b/treasury_receivedcredit.go index 48414fc13f..a2b9b10f58 100644 --- a/treasury_receivedcredit.go +++ b/treasury_receivedcredit.go @@ -74,6 +74,18 @@ const ( TreasuryReceivedCreditNetworkDetailsTypeAch TreasuryReceivedCreditNetworkDetailsType = "ach" ) +// Set if a ReceivedCredit cannot be reversed. +type TreasuryReceivedCreditReversalDetailsRestrictedReason string + +// List of values that TreasuryReceivedCreditReversalDetailsRestrictedReason can take +const ( + TreasuryReceivedCreditReversalDetailsRestrictedReasonAlreadyReversed TreasuryReceivedCreditReversalDetailsRestrictedReason = "already_reversed" + TreasuryReceivedCreditReversalDetailsRestrictedReasonDeadlinePassed TreasuryReceivedCreditReversalDetailsRestrictedReason = "deadline_passed" + TreasuryReceivedCreditReversalDetailsRestrictedReasonNetworkRestricted TreasuryReceivedCreditReversalDetailsRestrictedReason = "network_restricted" + TreasuryReceivedCreditReversalDetailsRestrictedReasonOther TreasuryReceivedCreditReversalDetailsRestrictedReason = "other" + TreasuryReceivedCreditReversalDetailsRestrictedReasonSourceFlowRestricted TreasuryReceivedCreditReversalDetailsRestrictedReason = "source_flow_restricted" +) + // Status of the ReceivedCredit. ReceivedCredits are created either `succeeded` (approved) or `failed` (declined). If a ReceivedCredit is declined, the failure reason can be found in the `failure_code` field. type TreasuryReceivedCreditStatus string @@ -164,7 +176,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"` @@ -186,6 +198,14 @@ type TreasuryReceivedCreditNetworkDetails struct { Type TreasuryReceivedCreditNetworkDetailsType `json:"type"` } +// Details describing when a ReceivedCredit may be reversed. +type TreasuryReceivedCreditReversalDetails struct { + // Time before which a ReceivedCredit can be reversed. + Deadline int64 `json:"deadline"` + // Set if a ReceivedCredit cannot be reversed. + RestrictedReason TreasuryReceivedCreditReversalDetailsRestrictedReason `json:"restricted_reason"` +} + // ReceivedCredits represent funds sent to a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount. type TreasuryReceivedCredit struct { APIResource @@ -201,6 +221,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"` @@ -213,6 +235,8 @@ type TreasuryReceivedCredit struct { NetworkDetails *TreasuryReceivedCreditNetworkDetails `json:"network_details"` // String representing the object's type. Objects of the same type share the same value. Object string `json:"object"` + // Details describing when a ReceivedCredit may be reversed. + ReversalDetails *TreasuryReceivedCreditReversalDetails `json:"reversal_details"` // Status of the ReceivedCredit. ReceivedCredits are created either `succeeded` (approved) or `failed` (declined). If a ReceivedCredit is declined, the failure reason can be found in the `failure_code` field. Status TreasuryReceivedCreditStatus `json:"status"` // The Transaction associated with this object. diff --git a/treasury_receiveddebit.go b/treasury_receiveddebit.go index 47196c336c..5424098b45 100644 --- a/treasury_receiveddebit.go +++ b/treasury_receiveddebit.go @@ -63,6 +63,18 @@ const ( TreasuryReceivedDebitNetworkDetailsTypeAch TreasuryReceivedDebitNetworkDetailsType = "ach" ) +// Set if a ReceivedDebit can't be reversed. +type TreasuryReceivedDebitReversalDetailsRestrictedReason string + +// List of values that TreasuryReceivedDebitReversalDetailsRestrictedReason can take +const ( + TreasuryReceivedDebitReversalDetailsRestrictedReasonAlreadyReversed TreasuryReceivedDebitReversalDetailsRestrictedReason = "already_reversed" + TreasuryReceivedDebitReversalDetailsRestrictedReasonDeadlinePassed TreasuryReceivedDebitReversalDetailsRestrictedReason = "deadline_passed" + TreasuryReceivedDebitReversalDetailsRestrictedReasonNetworkRestricted TreasuryReceivedDebitReversalDetailsRestrictedReason = "network_restricted" + TreasuryReceivedDebitReversalDetailsRestrictedReasonOther TreasuryReceivedDebitReversalDetailsRestrictedReason = "other" + TreasuryReceivedDebitReversalDetailsRestrictedReasonSourceFlowRestricted TreasuryReceivedDebitReversalDetailsRestrictedReason = "source_flow_restricted" +) + // Status of the ReceivedDebit. ReceivedDebits are created with a status of either `succeeded` (approved) or `failed` (declined). The failure reason can be found under the `failure_code`. type TreasuryReceivedDebitStatus string @@ -118,6 +130,8 @@ type TreasuryReceivedDebitInitiatingPaymentMethodDetails struct { USBankAccount *TreasuryReceivedDebitInitiatingPaymentMethodDetailsUSBankAccount `json:"us_bank_account"` } type TreasuryReceivedDebitLinkedFlows struct { + // The DebitReversal created as a result of this ReceivedDebit being reversed. + DebitReversal string `json:"debit_reversal"` // Set if the ReceivedDebit is associated with an InboundTransfer's return of funds. InboundTransfer string `json:"inbound_transfer"` // Set if the ReceivedDebit was created due to an [Issuing Authorization](https://stripe.com/docs/api#issuing_authorizations) object. @@ -142,6 +156,14 @@ type TreasuryReceivedDebitNetworkDetails struct { Type TreasuryReceivedDebitNetworkDetailsType `json:"type"` } +// Details describing when a ReceivedDebit might be reversed. +type TreasuryReceivedDebitReversalDetails struct { + // Time before which a ReceivedDebit can be reversed. + Deadline int64 `json:"deadline"` + // Set if a ReceivedDebit can't be reversed. + RestrictedReason TreasuryReceivedDebitReversalDetailsRestrictedReason `json:"restricted_reason"` +} + // ReceivedDebits represent funds pulled from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts). These are not initiated from the FinancialAccount. type TreasuryReceivedDebit struct { APIResource @@ -157,6 +179,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"` @@ -169,6 +193,8 @@ type TreasuryReceivedDebit struct { NetworkDetails *TreasuryReceivedDebitNetworkDetails `json:"network_details"` // String representing the object's type. Objects of the same type share the same value. Object string `json:"object"` + // Details describing when a ReceivedDebit might be reversed. + ReversalDetails *TreasuryReceivedDebitReversalDetails `json:"reversal_details"` // Status of the ReceivedDebit. ReceivedDebits are created with a status of either `succeeded` (approved) or `failed` (declined). The failure reason can be found under the `failure_code`. Status TreasuryReceivedDebitStatus `json:"status"` // The Transaction associated with this object.