From 17c13c65d81e37c340253fa2a7c9861a3da2c18a Mon Sep 17 00:00:00 2001 From: David Brownman Date: Fri, 12 Jun 2026 09:23:18 -0700 Subject: [PATCH 1/5] URI Encode path params (#2750) --- src/resources/Accounts.ts | 50 ++- src/resources/ApplePayDomains.ts | 4 +- src/resources/ApplicationFees.ts | 14 +- src/resources/BalanceTransactions.ts | 2 +- src/resources/Billing/Alerts.ts | 8 +- .../Billing/CreditBalanceTransactions.ts | 2 +- src/resources/Billing/CreditGrants.ts | 8 +- src/resources/Billing/Meters.ts | 10 +- src/resources/BillingPortal/Configurations.ts | 4 +- src/resources/Charges.ts | 6 +- src/resources/Checkout/Sessions.ts | 8 +- src/resources/Climate/Orders.ts | 6 +- src/resources/Climate/Products.ts | 2 +- src/resources/Climate/Suppliers.ts | 2 +- src/resources/ConfirmationTokens.ts | 2 +- src/resources/CountrySpecs.ts | 2 +- src/resources/Coupons.ts | 6 +- src/resources/CreditNotes.ts | 46 +-- src/resources/Customers.ts | 244 +++++++------ src/resources/Disputes.ts | 6 +- .../Entitlements/ActiveEntitlements.ts | 2 +- src/resources/Entitlements/Features.ts | 4 +- src/resources/EphemeralKeys.ts | 2 +- src/resources/Events.ts | 7 +- src/resources/ExchangeRates.ts | 2 +- src/resources/FileLinks.ts | 4 +- src/resources/Files.ts | 7 +- .../FinancialConnections/Accounts.ts | 14 +- .../FinancialConnections/Sessions.ts | 2 +- .../FinancialConnections/Transactions.ts | 2 +- src/resources/Forwarding/Requests.ts | 2 +- src/resources/Identity/VerificationReports.ts | 2 +- .../Identity/VerificationSessions.ts | 8 +- src/resources/InvoiceItems.ts | 40 ++- src/resources/InvoicePayments.ts | 2 +- src/resources/InvoiceRenderingTemplates.ts | 6 +- src/resources/Invoices.ts | 142 ++++---- src/resources/Issuing/Authorizations.ts | 8 +- src/resources/Issuing/Cardholders.ts | 4 +- src/resources/Issuing/Cards.ts | 4 +- src/resources/Issuing/Disputes.ts | 6 +- .../Issuing/PersonalizationDesigns.ts | 4 +- src/resources/Issuing/PhysicalBundles.ts | 2 +- src/resources/Issuing/Tokens.ts | 4 +- src/resources/Issuing/Transactions.ts | 4 +- src/resources/Mandates.ts | 2 +- src/resources/PaymentAttemptRecords.ts | 2 +- src/resources/PaymentIntents.ts | 18 +- src/resources/PaymentLinks.ts | 6 +- src/resources/PaymentMethodConfigurations.ts | 4 +- src/resources/PaymentMethodDomains.ts | 6 +- src/resources/PaymentMethods.ts | 8 +- src/resources/PaymentRecords.ts | 22 +- src/resources/Payouts.ts | 8 +- src/resources/Plans.ts | 90 ++--- src/resources/Prices.ts | 188 +++++----- src/resources/Products.ts | 18 +- src/resources/PromotionCodes.ts | 4 +- src/resources/Quotes.ts | 320 ++++++++++-------- src/resources/Radar/EarlyFraudWarnings.ts | 2 +- src/resources/Radar/ValueListItems.ts | 4 +- src/resources/Radar/ValueLists.ts | 6 +- src/resources/Refunds.ts | 6 +- src/resources/Reporting/ReportRuns.ts | 2 +- src/resources/Reporting/ReportTypes.ts | 2 +- src/resources/Reviews.ts | 4 +- src/resources/SetupIntents.ts | 10 +- src/resources/ShippingRates.ts | 4 +- src/resources/Sigma/ScheduledQueryRuns.ts | 2 +- src/resources/Sources.ts | 8 +- src/resources/SubscriptionItems.ts | 6 +- src/resources/SubscriptionSchedules.ts | 8 +- src/resources/Subscriptions.ts | 12 +- src/resources/Tax/Calculations.ts | 4 +- src/resources/Tax/Registrations.ts | 4 +- src/resources/Tax/Transactions.ts | 4 +- src/resources/TaxCodes.ts | 2 +- src/resources/TaxIds.ts | 4 +- src/resources/TaxRates.ts | 4 +- src/resources/Terminal/Configurations.ts | 6 +- src/resources/Terminal/Locations.ts | 6 +- src/resources/Terminal/Readers.ts | 22 +- src/resources/TestHelpers/Customers.ts | 2 +- .../TestHelpers/Issuing/Authorizations.ts | 24 +- src/resources/TestHelpers/Issuing/Cards.ts | 16 +- .../Issuing/PersonalizationDesigns.ts | 12 +- .../TestHelpers/Issuing/Transactions.ts | 2 +- src/resources/TestHelpers/Refunds.ts | 2 +- src/resources/TestHelpers/Terminal/Readers.ts | 12 +- src/resources/TestHelpers/TestClocks.ts | 6 +- .../TestHelpers/Treasury/InboundTransfers.ts | 12 +- .../TestHelpers/Treasury/OutboundPayments.ts | 14 +- .../TestHelpers/Treasury/OutboundTransfers.ts | 14 +- src/resources/Tokens.ts | 7 +- src/resources/Topups.ts | 11 +- src/resources/Transfers.ts | 16 +- src/resources/Treasury/CreditReversals.ts | 2 +- src/resources/Treasury/DebitReversals.ts | 2 +- src/resources/Treasury/FinancialAccounts.ts | 10 +- src/resources/Treasury/InboundTransfers.ts | 4 +- src/resources/Treasury/OutboundPayments.ts | 4 +- src/resources/Treasury/OutboundTransfers.ts | 4 +- src/resources/Treasury/ReceivedCredits.ts | 2 +- src/resources/Treasury/ReceivedDebits.ts | 2 +- src/resources/Treasury/TransactionEntries.ts | 2 +- src/resources/Treasury/Transactions.ts | 2 +- .../V2/Commerce/ProductCatalog/Imports.ts | 2 +- src/resources/V2/Core/AccountTokens.ts | 2 +- src/resources/V2/Core/Accounts.ts | 6 +- .../V2/Core/Accounts/PersonTokens.ts | 8 +- src/resources/V2/Core/Accounts/Persons.ts | 20 +- src/resources/V2/Core/EventDestinations.ts | 12 +- src/resources/V2/Core/Events.ts | 12 +- src/resources/WebhookEndpoints.ts | 6 +- test/resources/Customers.spec.js | 36 ++ 115 files changed, 1047 insertions(+), 785 deletions(-) diff --git a/src/resources/Accounts.ts b/src/resources/Accounts.ts index 1834e9a329..cb6dcb295e 100644 --- a/src/resources/Accounts.ts +++ b/src/resources/Accounts.ts @@ -36,7 +36,7 @@ export class AccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v1/accounts/${id}`, + `/v1/accounts/${encodeURIComponent(id)}`, params, options ) as any; @@ -82,7 +82,7 @@ export class AccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/accounts/${id}`, + `/v1/accounts/${encodeURIComponent(id)}`, params, options ) as any; @@ -133,7 +133,7 @@ export class AccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/accounts/${id}/reject`, + `/v1/accounts/${encodeURIComponent(id)}/reject`, params, options ) as any; @@ -148,7 +148,7 @@ export class AccountResource extends StripeResource { ): ApiListPromise { return this._makeRequest( 'GET', - `/v1/accounts/${id}/capabilities`, + `/v1/accounts/${encodeURIComponent(id)}/capabilities`, params, options, { @@ -167,7 +167,9 @@ export class AccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/accounts/${accountId}/capabilities/${id}`, + `/v1/accounts/${encodeURIComponent( + accountId + )}/capabilities/${encodeURIComponent(id)}`, params, options ) as any; @@ -183,7 +185,9 @@ export class AccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/accounts/${accountId}/capabilities/${id}`, + `/v1/accounts/${encodeURIComponent( + accountId + )}/capabilities/${encodeURIComponent(id)}`, params, options ) as any; @@ -199,7 +203,9 @@ export class AccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v1/accounts/${accountId}/external_accounts/${id}`, + `/v1/accounts/${encodeURIComponent( + accountId + )}/external_accounts/${encodeURIComponent(id)}`, params, options ) as any; @@ -215,7 +221,9 @@ export class AccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/accounts/${accountId}/external_accounts/${id}`, + `/v1/accounts/${encodeURIComponent( + accountId + )}/external_accounts/${encodeURIComponent(id)}`, params, options ) as any; @@ -238,7 +246,9 @@ export class AccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/accounts/${accountId}/external_accounts/${id}`, + `/v1/accounts/${encodeURIComponent( + accountId + )}/external_accounts/${encodeURIComponent(id)}`, params, options ) as any; @@ -253,7 +263,7 @@ export class AccountResource extends StripeResource { ): ApiListPromise { return this._makeRequest( 'GET', - `/v1/accounts/${id}/external_accounts`, + `/v1/accounts/${encodeURIComponent(id)}/external_accounts`, params, options, { @@ -271,7 +281,7 @@ export class AccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/accounts/${id}/external_accounts`, + `/v1/accounts/${encodeURIComponent(id)}/external_accounts`, params, options ) as any; @@ -288,7 +298,7 @@ export class AccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/accounts/${id}/login_links`, + `/v1/accounts/${encodeURIComponent(id)}/login_links`, params, options ) as any; @@ -304,7 +314,9 @@ export class AccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v1/accounts/${accountId}/persons/${id}`, + `/v1/accounts/${encodeURIComponent( + accountId + )}/persons/${encodeURIComponent(id)}`, params, options ) as any; @@ -320,7 +332,9 @@ export class AccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/accounts/${accountId}/persons/${id}`, + `/v1/accounts/${encodeURIComponent( + accountId + )}/persons/${encodeURIComponent(id)}`, params, options ) as any; @@ -336,7 +350,9 @@ export class AccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/accounts/${accountId}/persons/${id}`, + `/v1/accounts/${encodeURIComponent( + accountId + )}/persons/${encodeURIComponent(id)}`, params, options ) as any; @@ -351,7 +367,7 @@ export class AccountResource extends StripeResource { ): ApiListPromise { return this._makeRequest( 'GET', - `/v1/accounts/${id}/persons`, + `/v1/accounts/${encodeURIComponent(id)}/persons`, params, options, { @@ -369,7 +385,7 @@ export class AccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/accounts/${id}/persons`, + `/v1/accounts/${encodeURIComponent(id)}/persons`, params, options ) as any; diff --git a/src/resources/ApplePayDomains.ts b/src/resources/ApplePayDomains.ts index 48d5525068..3a215acecd 100644 --- a/src/resources/ApplePayDomains.ts +++ b/src/resources/ApplePayDomains.ts @@ -15,7 +15,7 @@ export class ApplePayDomainResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v1/apple_pay/domains/${id}`, + `/v1/apple_pay/domains/${encodeURIComponent(id)}`, params, options ) as any; @@ -30,7 +30,7 @@ export class ApplePayDomainResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/apple_pay/domains/${id}`, + `/v1/apple_pay/domains/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/ApplicationFees.ts b/src/resources/ApplicationFees.ts index f31f6788cd..84b0bdeed9 100644 --- a/src/resources/ApplicationFees.ts +++ b/src/resources/ApplicationFees.ts @@ -36,7 +36,7 @@ export class ApplicationFeeResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/application_fees/${id}`, + `/v1/application_fees/${encodeURIComponent(id)}`, params, options ) as any; @@ -52,7 +52,9 @@ export class ApplicationFeeResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/application_fees/${feeId}/refunds/${id}`, + `/v1/application_fees/${encodeURIComponent( + feeId + )}/refunds/${encodeURIComponent(id)}`, params, options ) as any; @@ -70,7 +72,9 @@ export class ApplicationFeeResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/application_fees/${feeId}/refunds/${id}`, + `/v1/application_fees/${encodeURIComponent( + feeId + )}/refunds/${encodeURIComponent(id)}`, params, options ) as any; @@ -85,7 +89,7 @@ export class ApplicationFeeResource extends StripeResource { ): ApiListPromise { return this._makeRequest( 'GET', - `/v1/application_fees/${id}/refunds`, + `/v1/application_fees/${encodeURIComponent(id)}/refunds`, params, options, { @@ -111,7 +115,7 @@ export class ApplicationFeeResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/application_fees/${id}/refunds`, + `/v1/application_fees/${encodeURIComponent(id)}/refunds`, params, options ) as any; diff --git a/src/resources/BalanceTransactions.ts b/src/resources/BalanceTransactions.ts index a759792cde..406b540eec 100644 --- a/src/resources/BalanceTransactions.ts +++ b/src/resources/BalanceTransactions.ts @@ -37,7 +37,7 @@ export class BalanceTransactionResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/balance_transactions/${id}`, + `/v1/balance_transactions/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Billing/Alerts.ts b/src/resources/Billing/Alerts.ts index 1c8bd81d66..1db6ae4532 100644 --- a/src/resources/Billing/Alerts.ts +++ b/src/resources/Billing/Alerts.ts @@ -42,7 +42,7 @@ export class AlertResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/billing/alerts/${id}`, + `/v1/billing/alerts/${encodeURIComponent(id)}`, params, options ) as any; @@ -57,7 +57,7 @@ export class AlertResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/billing/alerts/${id}/activate`, + `/v1/billing/alerts/${encodeURIComponent(id)}/activate`, params, options ) as any; @@ -72,7 +72,7 @@ export class AlertResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/billing/alerts/${id}/archive`, + `/v1/billing/alerts/${encodeURIComponent(id)}/archive`, params, options ) as any; @@ -87,7 +87,7 @@ export class AlertResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/billing/alerts/${id}/deactivate`, + `/v1/billing/alerts/${encodeURIComponent(id)}/deactivate`, params, options ) as any; diff --git a/src/resources/Billing/CreditBalanceTransactions.ts b/src/resources/Billing/CreditBalanceTransactions.ts index 9b236e3a2e..9204cfb3e6 100644 --- a/src/resources/Billing/CreditBalanceTransactions.ts +++ b/src/resources/Billing/CreditBalanceTransactions.ts @@ -35,7 +35,7 @@ export class CreditBalanceTransactionResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/billing/credit_balance_transactions/${id}`, + `/v1/billing/credit_balance_transactions/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Billing/CreditGrants.ts b/src/resources/Billing/CreditGrants.ts index 42a2c3c6ee..effcc673fa 100644 --- a/src/resources/Billing/CreditGrants.ts +++ b/src/resources/Billing/CreditGrants.ts @@ -53,7 +53,7 @@ export class CreditGrantResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/billing/credit_grants/${id}`, + `/v1/billing/credit_grants/${encodeURIComponent(id)}`, params, options ) as any; @@ -68,7 +68,7 @@ export class CreditGrantResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/billing/credit_grants/${id}`, + `/v1/billing/credit_grants/${encodeURIComponent(id)}`, params, options ) as any; @@ -83,7 +83,7 @@ export class CreditGrantResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/billing/credit_grants/${id}/expire`, + `/v1/billing/credit_grants/${encodeURIComponent(id)}/expire`, params, options ) as any; @@ -98,7 +98,7 @@ export class CreditGrantResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/billing/credit_grants/${id}/void`, + `/v1/billing/credit_grants/${encodeURIComponent(id)}/void`, params, options ) as any; diff --git a/src/resources/Billing/Meters.ts b/src/resources/Billing/Meters.ts index a8d7e378eb..8a9b79c1a1 100644 --- a/src/resources/Billing/Meters.ts +++ b/src/resources/Billing/Meters.ts @@ -41,7 +41,7 @@ export class MeterResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/billing/meters/${id}`, + `/v1/billing/meters/${encodeURIComponent(id)}`, params, options ) as any; @@ -56,7 +56,7 @@ export class MeterResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/billing/meters/${id}`, + `/v1/billing/meters/${encodeURIComponent(id)}`, params, options ) as any; @@ -71,7 +71,7 @@ export class MeterResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/billing/meters/${id}/deactivate`, + `/v1/billing/meters/${encodeURIComponent(id)}/deactivate`, params, options ) as any; @@ -86,7 +86,7 @@ export class MeterResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/billing/meters/${id}/reactivate`, + `/v1/billing/meters/${encodeURIComponent(id)}/reactivate`, params, options ) as any; @@ -101,7 +101,7 @@ export class MeterResource extends StripeResource { ): ApiListPromise { return this._makeRequest( 'GET', - `/v1/billing/meters/${id}/event_summaries`, + `/v1/billing/meters/${encodeURIComponent(id)}/event_summaries`, params, options, { diff --git a/src/resources/BillingPortal/Configurations.ts b/src/resources/BillingPortal/Configurations.ts index 7eea0834f4..14efafff61 100644 --- a/src/resources/BillingPortal/Configurations.ts +++ b/src/resources/BillingPortal/Configurations.ts @@ -52,7 +52,7 @@ export class ConfigurationResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/billing_portal/configurations/${id}`, + `/v1/billing_portal/configurations/${encodeURIComponent(id)}`, params, options ) as any; @@ -67,7 +67,7 @@ export class ConfigurationResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/billing_portal/configurations/${id}`, + `/v1/billing_portal/configurations/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Charges.ts b/src/resources/Charges.ts index 1b1e8ff8f5..f3761ceb8b 100644 --- a/src/resources/Charges.ts +++ b/src/resources/Charges.ts @@ -63,7 +63,7 @@ export class ChargeResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/charges/${id}`, + `/v1/charges/${encodeURIComponent(id)}`, params, options ) as any; @@ -78,7 +78,7 @@ export class ChargeResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/charges/${id}`, + `/v1/charges/${encodeURIComponent(id)}`, params, options ) as any; @@ -111,7 +111,7 @@ export class ChargeResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/charges/${id}/capture`, + `/v1/charges/${encodeURIComponent(id)}/capture`, params, options ) as any; diff --git a/src/resources/Checkout/Sessions.ts b/src/resources/Checkout/Sessions.ts index 9a7d75e18a..a3bf294a51 100644 --- a/src/resources/Checkout/Sessions.ts +++ b/src/resources/Checkout/Sessions.ts @@ -246,7 +246,7 @@ export class SessionResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/checkout/sessions/${id}`, + `/v1/checkout/sessions/${encodeURIComponent(id)}`, params, options, { @@ -346,7 +346,7 @@ export class SessionResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/checkout/sessions/${id}`, + `/v1/checkout/sessions/${encodeURIComponent(id)}`, params, options, { @@ -463,7 +463,7 @@ export class SessionResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/checkout/sessions/${id}/expire`, + `/v1/checkout/sessions/${encodeURIComponent(id)}/expire`, params, options, { @@ -561,7 +561,7 @@ export class SessionResource extends StripeResource { ): ApiListPromise { return this._makeRequest( 'GET', - `/v1/checkout/sessions/${id}/line_items`, + `/v1/checkout/sessions/${encodeURIComponent(id)}/line_items`, params, options, { diff --git a/src/resources/Climate/Orders.ts b/src/resources/Climate/Orders.ts index aa5e4d318d..8b1dddb9fa 100644 --- a/src/resources/Climate/Orders.ts +++ b/src/resources/Climate/Orders.ts @@ -66,7 +66,7 @@ export class OrderResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/climate/orders/${id}`, + `/v1/climate/orders/${encodeURIComponent(id)}`, params, options, { @@ -87,7 +87,7 @@ export class OrderResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/climate/orders/${id}`, + `/v1/climate/orders/${encodeURIComponent(id)}`, params, options, { @@ -111,7 +111,7 @@ export class OrderResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/climate/orders/${id}/cancel`, + `/v1/climate/orders/${encodeURIComponent(id)}/cancel`, params, options, { diff --git a/src/resources/Climate/Products.ts b/src/resources/Climate/Products.ts index 897a0c9f48..64bd8c1db2 100644 --- a/src/resources/Climate/Products.ts +++ b/src/resources/Climate/Products.ts @@ -39,7 +39,7 @@ export class ProductResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/climate/products/${id}`, + `/v1/climate/products/${encodeURIComponent(id)}`, params, options, { diff --git a/src/resources/Climate/Suppliers.ts b/src/resources/Climate/Suppliers.ts index 1fb75ac868..669fb92f3c 100644 --- a/src/resources/Climate/Suppliers.ts +++ b/src/resources/Climate/Suppliers.ts @@ -26,7 +26,7 @@ export class SupplierResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/climate/suppliers/${id}`, + `/v1/climate/suppliers/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/ConfirmationTokens.ts b/src/resources/ConfirmationTokens.ts index 30e4e0878b..65d925b175 100644 --- a/src/resources/ConfirmationTokens.ts +++ b/src/resources/ConfirmationTokens.ts @@ -18,7 +18,7 @@ export class ConfirmationTokenResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/confirmation_tokens/${id}`, + `/v1/confirmation_tokens/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/CountrySpecs.ts b/src/resources/CountrySpecs.ts index 9f44513125..207fdb2bfc 100644 --- a/src/resources/CountrySpecs.ts +++ b/src/resources/CountrySpecs.ts @@ -26,7 +26,7 @@ export class CountrySpecResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/country_specs/${id}`, + `/v1/country_specs/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Coupons.ts b/src/resources/Coupons.ts index 60bb6a68da..78a581fdda 100644 --- a/src/resources/Coupons.ts +++ b/src/resources/Coupons.ts @@ -21,7 +21,7 @@ export class CouponResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v1/coupons/${id}`, + `/v1/coupons/${encodeURIComponent(id)}`, params, options ) as any; @@ -36,7 +36,7 @@ export class CouponResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/coupons/${id}`, + `/v1/coupons/${encodeURIComponent(id)}`, params, options ) as any; @@ -51,7 +51,7 @@ export class CouponResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/coupons/${id}`, + `/v1/coupons/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/CreditNotes.ts b/src/resources/CreditNotes.ts index 3770a8de45..855dde41d3 100644 --- a/src/resources/CreditNotes.ts +++ b/src/resources/CreditNotes.ts @@ -126,21 +126,27 @@ export class CreditNoteResource extends StripeResource { params?: CreditNoteRetrieveParams, options?: RequestOptions ): Promise> { - return this._makeRequest('GET', `/v1/credit_notes/${id}`, params, options, { - responseSchema: { - kind: 'object', - fields: { - lines: { - kind: 'object', - fields: { - data: { - kind: 'array', - element: { - kind: 'object', - fields: { - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + return this._makeRequest( + 'GET', + `/v1/credit_notes/${encodeURIComponent(id)}`, + params, + options, + { + responseSchema: { + kind: 'object', + fields: { + lines: { + kind: 'object', + fields: { + data: { + kind: 'array', + element: { + kind: 'object', + fields: { + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, @@ -148,8 +154,8 @@ export class CreditNoteResource extends StripeResource { }, }, }, - }, - }) as any; + } + ) as any; } /** * Updates an existing credit note. @@ -161,7 +167,7 @@ export class CreditNoteResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/credit_notes/${id}`, + `/v1/credit_notes/${encodeURIComponent(id)}`, params, options, { @@ -250,7 +256,7 @@ export class CreditNoteResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/credit_notes/${id}/void`, + `/v1/credit_notes/${encodeURIComponent(id)}/void`, params, options, { @@ -335,7 +341,7 @@ export class CreditNoteResource extends StripeResource { ): ApiListPromise { return this._makeRequest( 'GET', - `/v1/credit_notes/${id}/lines`, + `/v1/credit_notes/${encodeURIComponent(id)}/lines`, params, options, { diff --git a/src/resources/Customers.ts b/src/resources/Customers.ts index 3a1cdc679c..b0c7e522b5 100644 --- a/src/resources/Customers.ts +++ b/src/resources/Customers.ts @@ -40,7 +40,7 @@ export class CustomerResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v1/customers/${id}`, + `/v1/customers/${encodeURIComponent(id)}`, params, options ) as any; @@ -55,7 +55,7 @@ export class CustomerResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/customers/${id}`, + `/v1/customers/${encodeURIComponent(id)}`, params, options ) as any; @@ -70,101 +70,111 @@ export class CustomerResource extends StripeResource { params?: CustomerUpdateParams, options?: RequestOptions ): Promise> { - return this._makeRequest('POST', `/v1/customers/${id}`, params, options, { - responseSchema: { - kind: 'object', - fields: { - subscriptions: { - kind: 'object', - fields: { - data: { - kind: 'array', - element: { - kind: 'object', - fields: { - items: { - kind: 'object', - fields: { - data: { - kind: 'array', - element: { - kind: 'object', - fields: { - plan: { - kind: 'object', - fields: { - amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, - }, - tiers: { - kind: 'array', - element: { - kind: 'object', - fields: { - flat_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + return this._makeRequest( + 'POST', + `/v1/customers/${encodeURIComponent(id)}`, + params, + options, + { + responseSchema: { + kind: 'object', + fields: { + subscriptions: { + kind: 'object', + fields: { + data: { + kind: 'array', + element: { + kind: 'object', + fields: { + items: { + kind: 'object', + fields: { + data: { + kind: 'array', + element: { + kind: 'object', + fields: { + plan: { + kind: 'object', + fields: { + amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, + tiers: { + kind: 'array', + element: { + kind: 'object', + fields: { + flat_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, }, }, - }, - price: { - kind: 'object', - fields: { - currency_options: { - kind: 'array', - element: { - kind: 'object', - fields: { - tiers: { - kind: 'array', - element: { - kind: 'object', - fields: { - flat_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + price: { + kind: 'object', + fields: { + currency_options: { + kind: 'array', + element: { + kind: 'object', + fields: { + tiers: { + kind: 'array', + element: { + kind: 'object', + fields: { + flat_amount_decimal: { + kind: 'nullable', + inner: { + kind: 'decimal_string', + }, + }, + unit_amount_decimal: { + kind: 'nullable', + inner: { + kind: 'decimal_string', + }, + }, }, }, }, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, - }, - tiers: { - kind: 'array', - element: { - kind: 'object', - fields: { - flat_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + tiers: { + kind: 'array', + element: { + kind: 'object', + fields: { + flat_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, @@ -179,8 +189,8 @@ export class CustomerResource extends StripeResource { }, }, }, - }, - }) as any; + } + ) as any; } /** * Removes the currently applied discount on a customer. @@ -192,7 +202,7 @@ export class CustomerResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v1/customers/${id}/discount`, + `/v1/customers/${encodeURIComponent(id)}/discount`, params, options ) as any; @@ -593,7 +603,7 @@ export class CustomerResource extends StripeResource { ): ApiListPromise { return this._makeRequest( 'GET', - `/v1/customers/${id}/balance_transactions`, + `/v1/customers/${encodeURIComponent(id)}/balance_transactions`, params, options, { @@ -611,7 +621,7 @@ export class CustomerResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/customers/${id}/balance_transactions`, + `/v1/customers/${encodeURIComponent(id)}/balance_transactions`, params, options ) as any; @@ -627,7 +637,9 @@ export class CustomerResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/customers/${customerId}/balance_transactions/${id}`, + `/v1/customers/${encodeURIComponent( + customerId + )}/balance_transactions/${encodeURIComponent(id)}`, params, options ) as any; @@ -643,7 +655,9 @@ export class CustomerResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/customers/${customerId}/balance_transactions/${id}`, + `/v1/customers/${encodeURIComponent( + customerId + )}/balance_transactions/${encodeURIComponent(id)}`, params, options ) as any; @@ -658,7 +672,7 @@ export class CustomerResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/customers/${id}/cash_balance`, + `/v1/customers/${encodeURIComponent(id)}/cash_balance`, params, options ) as any; @@ -673,7 +687,7 @@ export class CustomerResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/customers/${id}/cash_balance`, + `/v1/customers/${encodeURIComponent(id)}/cash_balance`, params, options ) as any; @@ -688,7 +702,7 @@ export class CustomerResource extends StripeResource { ): ApiListPromise { return this._makeRequest( 'GET', - `/v1/customers/${id}/cash_balance_transactions`, + `/v1/customers/${encodeURIComponent(id)}/cash_balance_transactions`, params, options, { @@ -707,7 +721,9 @@ export class CustomerResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/customers/${customerId}/cash_balance_transactions/${id}`, + `/v1/customers/${encodeURIComponent( + customerId + )}/cash_balance_transactions/${encodeURIComponent(id)}`, params, options ) as any; @@ -724,7 +740,7 @@ export class CustomerResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/customers/${id}/funding_instructions`, + `/v1/customers/${encodeURIComponent(id)}/funding_instructions`, params, options ) as any; @@ -739,7 +755,7 @@ export class CustomerResource extends StripeResource { ): ApiListPromise { return this._makeRequest( 'GET', - `/v1/customers/${id}/payment_methods`, + `/v1/customers/${encodeURIComponent(id)}/payment_methods`, params, options, { @@ -758,7 +774,9 @@ export class CustomerResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/customers/${customerId}/payment_methods/${id}`, + `/v1/customers/${encodeURIComponent( + customerId + )}/payment_methods/${encodeURIComponent(id)}`, params, options ) as any; @@ -773,7 +791,7 @@ export class CustomerResource extends StripeResource { ): ApiListPromise { return this._makeRequest( 'GET', - `/v1/customers/${id}/sources`, + `/v1/customers/${encodeURIComponent(id)}/sources`, params, options, { @@ -795,7 +813,7 @@ export class CustomerResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/customers/${id}/sources`, + `/v1/customers/${encodeURIComponent(id)}/sources`, params, options ) as any; @@ -811,7 +829,9 @@ export class CustomerResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/customers/${customerId}/sources/${id}`, + `/v1/customers/${encodeURIComponent( + customerId + )}/sources/${encodeURIComponent(id)}`, params, options ) as any; @@ -827,7 +847,9 @@ export class CustomerResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/customers/${customerId}/sources/${id}`, + `/v1/customers/${encodeURIComponent( + customerId + )}/sources/${encodeURIComponent(id)}`, params, options ) as any; @@ -843,7 +865,9 @@ export class CustomerResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v1/customers/${customerId}/sources/${id}`, + `/v1/customers/${encodeURIComponent( + customerId + )}/sources/${encodeURIComponent(id)}`, params, options ) as any; @@ -859,7 +883,9 @@ export class CustomerResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/customers/${customerId}/sources/${id}/verify`, + `/v1/customers/${encodeURIComponent( + customerId + )}/sources/${encodeURIComponent(id)}/verify`, params, options ) as any; @@ -875,7 +901,9 @@ export class CustomerResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v1/customers/${customerId}/tax_ids/${id}`, + `/v1/customers/${encodeURIComponent( + customerId + )}/tax_ids/${encodeURIComponent(id)}`, params, options ) as any; @@ -891,7 +919,9 @@ export class CustomerResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/customers/${customerId}/tax_ids/${id}`, + `/v1/customers/${encodeURIComponent( + customerId + )}/tax_ids/${encodeURIComponent(id)}`, params, options ) as any; @@ -906,7 +936,7 @@ export class CustomerResource extends StripeResource { ): ApiListPromise { return this._makeRequest( 'GET', - `/v1/customers/${id}/tax_ids`, + `/v1/customers/${encodeURIComponent(id)}/tax_ids`, params, options, { @@ -924,7 +954,7 @@ export class CustomerResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/customers/${id}/tax_ids`, + `/v1/customers/${encodeURIComponent(id)}/tax_ids`, params, options ) as any; diff --git a/src/resources/Disputes.ts b/src/resources/Disputes.ts index bcec3605a1..a5f5a0b72a 100644 --- a/src/resources/Disputes.ts +++ b/src/resources/Disputes.ts @@ -38,7 +38,7 @@ export class DisputeResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/disputes/${id}`, + `/v1/disputes/${encodeURIComponent(id)}`, params, options ) as any; @@ -55,7 +55,7 @@ export class DisputeResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/disputes/${id}`, + `/v1/disputes/${encodeURIComponent(id)}`, params, options ) as any; @@ -72,7 +72,7 @@ export class DisputeResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/disputes/${id}/close`, + `/v1/disputes/${encodeURIComponent(id)}/close`, params, options ) as any; diff --git a/src/resources/Entitlements/ActiveEntitlements.ts b/src/resources/Entitlements/ActiveEntitlements.ts index 86389840fb..76a9895690 100644 --- a/src/resources/Entitlements/ActiveEntitlements.ts +++ b/src/resources/Entitlements/ActiveEntitlements.ts @@ -33,7 +33,7 @@ export class ActiveEntitlementResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/entitlements/active_entitlements/${id}`, + `/v1/entitlements/active_entitlements/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Entitlements/Features.ts b/src/resources/Entitlements/Features.ts index 5b59c6171e..29f5f04e67 100644 --- a/src/resources/Entitlements/Features.ts +++ b/src/resources/Entitlements/Features.ts @@ -51,7 +51,7 @@ export class FeatureResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/entitlements/features/${id}`, + `/v1/entitlements/features/${encodeURIComponent(id)}`, params, options ) as any; @@ -66,7 +66,7 @@ export class FeatureResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/entitlements/features/${id}`, + `/v1/entitlements/features/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/EphemeralKeys.ts b/src/resources/EphemeralKeys.ts index 2109ef59ca..fad18ebb2a 100644 --- a/src/resources/EphemeralKeys.ts +++ b/src/resources/EphemeralKeys.ts @@ -14,7 +14,7 @@ export class EphemeralKeyResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v1/ephemeral_keys/${id}`, + `/v1/ephemeral_keys/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Events.ts b/src/resources/Events.ts index 362f80b334..47e31cf1cd 100644 --- a/src/resources/Events.ts +++ b/src/resources/Events.ts @@ -24,7 +24,12 @@ export class EventResource extends StripeResource { params?: EventRetrieveParams, options?: RequestOptions ): Promise> { - return this._makeRequest('GET', `/v1/events/${id}`, params, options) as any; + return this._makeRequest( + 'GET', + `/v1/events/${encodeURIComponent(id)}`, + params, + options + ) as any; } } export interface EventBase { diff --git a/src/resources/ExchangeRates.ts b/src/resources/ExchangeRates.ts index f25edc909e..da22fa870b 100644 --- a/src/resources/ExchangeRates.ts +++ b/src/resources/ExchangeRates.ts @@ -32,7 +32,7 @@ export class ExchangeRateResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/exchange_rates/${id}`, + `/v1/exchange_rates/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/FileLinks.ts b/src/resources/FileLinks.ts index cab2dd408f..7416445179 100644 --- a/src/resources/FileLinks.ts +++ b/src/resources/FileLinks.ts @@ -42,7 +42,7 @@ export class FileLinkResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/file_links/${id}`, + `/v1/file_links/${encodeURIComponent(id)}`, params, options ) as any; @@ -57,7 +57,7 @@ export class FileLinkResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/file_links/${id}`, + `/v1/file_links/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Files.ts b/src/resources/Files.ts index 3f38810534..4c47c03770 100644 --- a/src/resources/Files.ts +++ b/src/resources/Files.ts @@ -54,7 +54,12 @@ export class FileResource extends StripeResource { params?: FileRetrieveParams, options?: RequestOptions ): Promise> { - return this._makeRequest('GET', `/v1/files/${id}`, params, options) as any; + return this._makeRequest( + 'GET', + `/v1/files/${encodeURIComponent(id)}`, + params, + options + ) as any; } } export interface File { diff --git a/src/resources/FinancialConnections/Accounts.ts b/src/resources/FinancialConnections/Accounts.ts index fdad781524..13256f6d9d 100644 --- a/src/resources/FinancialConnections/Accounts.ts +++ b/src/resources/FinancialConnections/Accounts.ts @@ -35,7 +35,7 @@ export class AccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/financial_connections/accounts/${id}`, + `/v1/financial_connections/accounts/${encodeURIComponent(id)}`, params, options ) as any; @@ -50,7 +50,7 @@ export class AccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/financial_connections/accounts/${id}/disconnect`, + `/v1/financial_connections/accounts/${encodeURIComponent(id)}/disconnect`, params, options ) as any; @@ -65,7 +65,7 @@ export class AccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/financial_connections/accounts/${id}/refresh`, + `/v1/financial_connections/accounts/${encodeURIComponent(id)}/refresh`, params, options ) as any; @@ -80,7 +80,7 @@ export class AccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/financial_connections/accounts/${id}/subscribe`, + `/v1/financial_connections/accounts/${encodeURIComponent(id)}/subscribe`, params, options ) as any; @@ -95,7 +95,9 @@ export class AccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/financial_connections/accounts/${id}/unsubscribe`, + `/v1/financial_connections/accounts/${encodeURIComponent( + id + )}/unsubscribe`, params, options ) as any; @@ -110,7 +112,7 @@ export class AccountResource extends StripeResource { ): ApiListPromise { return this._makeRequest( 'GET', - `/v1/financial_connections/accounts/${id}/owners`, + `/v1/financial_connections/accounts/${encodeURIComponent(id)}/owners`, params, options, { diff --git a/src/resources/FinancialConnections/Sessions.ts b/src/resources/FinancialConnections/Sessions.ts index ee8b3a0f73..67e09a791f 100644 --- a/src/resources/FinancialConnections/Sessions.ts +++ b/src/resources/FinancialConnections/Sessions.ts @@ -16,7 +16,7 @@ export class SessionResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/financial_connections/sessions/${id}`, + `/v1/financial_connections/sessions/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/FinancialConnections/Transactions.ts b/src/resources/FinancialConnections/Transactions.ts index 960f665c98..d5df0a6f57 100644 --- a/src/resources/FinancialConnections/Transactions.ts +++ b/src/resources/FinancialConnections/Transactions.ts @@ -32,7 +32,7 @@ export class TransactionResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/financial_connections/transactions/${id}`, + `/v1/financial_connections/transactions/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Forwarding/Requests.ts b/src/resources/Forwarding/Requests.ts index 45b44d0513..d4c3852b5e 100644 --- a/src/resources/Forwarding/Requests.ts +++ b/src/resources/Forwarding/Requests.ts @@ -51,7 +51,7 @@ export class RequestResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/forwarding/requests/${id}`, + `/v1/forwarding/requests/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Identity/VerificationReports.ts b/src/resources/Identity/VerificationReports.ts index 914fdf1177..6a82330442 100644 --- a/src/resources/Identity/VerificationReports.ts +++ b/src/resources/Identity/VerificationReports.ts @@ -32,7 +32,7 @@ export class VerificationReportResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/identity/verification_reports/${id}`, + `/v1/identity/verification_reports/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Identity/VerificationSessions.ts b/src/resources/Identity/VerificationSessions.ts index e8155c67e0..cafbb83e9d 100644 --- a/src/resources/Identity/VerificationSessions.ts +++ b/src/resources/Identity/VerificationSessions.ts @@ -63,7 +63,7 @@ export class VerificationSessionResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/identity/verification_sessions/${id}`, + `/v1/identity/verification_sessions/${encodeURIComponent(id)}`, params, options ) as any; @@ -81,7 +81,7 @@ export class VerificationSessionResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/identity/verification_sessions/${id}`, + `/v1/identity/verification_sessions/${encodeURIComponent(id)}`, params, options ) as any; @@ -98,7 +98,7 @@ export class VerificationSessionResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/identity/verification_sessions/${id}/cancel`, + `/v1/identity/verification_sessions/${encodeURIComponent(id)}/cancel`, params, options ) as any; @@ -131,7 +131,7 @@ export class VerificationSessionResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/identity/verification_sessions/${id}/redact`, + `/v1/identity/verification_sessions/${encodeURIComponent(id)}/redact`, params, options ) as any; diff --git a/src/resources/InvoiceItems.ts b/src/resources/InvoiceItems.ts index 004c8c0d1f..b7190941f4 100644 --- a/src/resources/InvoiceItems.ts +++ b/src/resources/InvoiceItems.ts @@ -28,7 +28,7 @@ export class InvoiceItemResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v1/invoiceitems/${id}`, + `/v1/invoiceitems/${encodeURIComponent(id)}`, params, options ) as any; @@ -41,26 +41,32 @@ export class InvoiceItemResource extends StripeResource { params?: InvoiceItemRetrieveParams, options?: RequestOptions ): Promise> { - return this._makeRequest('GET', `/v1/invoiceitems/${id}`, params, options, { - responseSchema: { - kind: 'object', - fields: { - pricing: { - kind: 'nullable', - inner: { - kind: 'object', - fields: { - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + return this._makeRequest( + 'GET', + `/v1/invoiceitems/${encodeURIComponent(id)}`, + params, + options, + { + responseSchema: { + kind: 'object', + fields: { + pricing: { + kind: 'nullable', + inner: { + kind: 'object', + fields: { + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, + quantity_decimal: {kind: 'decimal_string'}, }, - quantity_decimal: {kind: 'decimal_string'}, }, - }, - }) as any; + } + ) as any; } /** * Updates the amount or description of an invoice item on an upcoming invoice. Updating an invoice item is only possible before the invoice it's attached to is closed. @@ -72,7 +78,7 @@ export class InvoiceItemResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/invoiceitems/${id}`, + `/v1/invoiceitems/${encodeURIComponent(id)}`, params, options, { diff --git a/src/resources/InvoicePayments.ts b/src/resources/InvoicePayments.ts index 1476445906..e7993df180 100644 --- a/src/resources/InvoicePayments.ts +++ b/src/resources/InvoicePayments.ts @@ -30,7 +30,7 @@ export class InvoicePaymentResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/invoice_payments/${id}`, + `/v1/invoice_payments/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/InvoiceRenderingTemplates.ts b/src/resources/InvoiceRenderingTemplates.ts index 2e690d2391..e0d40fe2e7 100644 --- a/src/resources/InvoiceRenderingTemplates.ts +++ b/src/resources/InvoiceRenderingTemplates.ts @@ -32,7 +32,7 @@ export class InvoiceRenderingTemplateResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/invoice_rendering_templates/${id}`, + `/v1/invoice_rendering_templates/${encodeURIComponent(id)}`, params, options ) as any; @@ -47,7 +47,7 @@ export class InvoiceRenderingTemplateResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/invoice_rendering_templates/${id}/archive`, + `/v1/invoice_rendering_templates/${encodeURIComponent(id)}/archive`, params, options ) as any; @@ -62,7 +62,7 @@ export class InvoiceRenderingTemplateResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/invoice_rendering_templates/${id}/unarchive`, + `/v1/invoice_rendering_templates/${encodeURIComponent(id)}/unarchive`, params, options ) as any; diff --git a/src/resources/Invoices.ts b/src/resources/Invoices.ts index 372694349b..095c2b79a0 100644 --- a/src/resources/Invoices.ts +++ b/src/resources/Invoices.ts @@ -46,7 +46,7 @@ export class InvoiceResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v1/invoices/${id}`, + `/v1/invoices/${encodeURIComponent(id)}`, params, options ) as any; @@ -59,33 +59,39 @@ export class InvoiceResource extends StripeResource { params?: InvoiceRetrieveParams, options?: RequestOptions ): Promise> { - return this._makeRequest('GET', `/v1/invoices/${id}`, params, options, { - responseSchema: { - kind: 'object', - fields: { - lines: { - kind: 'object', - fields: { - data: { - kind: 'array', - element: { - kind: 'object', - fields: { - pricing: { - kind: 'nullable', - inner: { - kind: 'object', - fields: { - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + return this._makeRequest( + 'GET', + `/v1/invoices/${encodeURIComponent(id)}`, + params, + options, + { + responseSchema: { + kind: 'object', + fields: { + lines: { + kind: 'object', + fields: { + data: { + kind: 'array', + element: { + kind: 'object', + fields: { + pricing: { + kind: 'nullable', + inner: { + kind: 'object', + fields: { + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, - }, - quantity_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + quantity_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, @@ -93,8 +99,8 @@ export class InvoiceResource extends StripeResource { }, }, }, - }, - }) as any; + } + ) as any; } /** * Draft invoices are fully editable. Once an invoice is [finalized](https://docs.stripe.com/docs/billing/invoices/workflow#finalized), @@ -109,33 +115,39 @@ export class InvoiceResource extends StripeResource { params?: InvoiceUpdateParams, options?: RequestOptions ): Promise> { - return this._makeRequest('POST', `/v1/invoices/${id}`, params, options, { - responseSchema: { - kind: 'object', - fields: { - lines: { - kind: 'object', - fields: { - data: { - kind: 'array', - element: { - kind: 'object', - fields: { - pricing: { - kind: 'nullable', - inner: { - kind: 'object', - fields: { - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + return this._makeRequest( + 'POST', + `/v1/invoices/${encodeURIComponent(id)}`, + params, + options, + { + responseSchema: { + kind: 'object', + fields: { + lines: { + kind: 'object', + fields: { + data: { + kind: 'array', + element: { + kind: 'object', + fields: { + pricing: { + kind: 'nullable', + inner: { + kind: 'object', + fields: { + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, - }, - quantity_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + quantity_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, @@ -143,8 +155,8 @@ export class InvoiceResource extends StripeResource { }, }, }, - }, - }) as any; + } + ) as any; } /** * You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first. @@ -309,7 +321,7 @@ export class InvoiceResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/invoices/${id}/add_lines`, + `/v1/invoices/${encodeURIComponent(id)}/add_lines`, params, options, { @@ -387,7 +399,7 @@ export class InvoiceResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/invoices/${id}/attach_payment`, + `/v1/invoices/${encodeURIComponent(id)}/attach_payment`, params, options, { @@ -438,7 +450,7 @@ export class InvoiceResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/invoices/${id}/finalize`, + `/v1/invoices/${encodeURIComponent(id)}/finalize`, params, options, { @@ -489,7 +501,7 @@ export class InvoiceResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/invoices/${id}/mark_uncollectible`, + `/v1/invoices/${encodeURIComponent(id)}/mark_uncollectible`, params, options, { @@ -540,7 +552,7 @@ export class InvoiceResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/invoices/${id}/pay`, + `/v1/invoices/${encodeURIComponent(id)}/pay`, params, options, { @@ -591,7 +603,7 @@ export class InvoiceResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/invoices/${id}/remove_lines`, + `/v1/invoices/${encodeURIComponent(id)}/remove_lines`, params, options, { @@ -644,7 +656,7 @@ export class InvoiceResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/invoices/${id}/send`, + `/v1/invoices/${encodeURIComponent(id)}/send`, params, options, { @@ -695,7 +707,7 @@ export class InvoiceResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/invoices/${id}/update_lines`, + `/v1/invoices/${encodeURIComponent(id)}/update_lines`, params, options, { @@ -766,7 +778,7 @@ export class InvoiceResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/invoices/${id}/void`, + `/v1/invoices/${encodeURIComponent(id)}/void`, params, options, { @@ -952,7 +964,7 @@ export class InvoiceResource extends StripeResource { ): ApiListPromise { return this._makeRequest( 'GET', - `/v1/invoices/${id}/lines`, + `/v1/invoices/${encodeURIComponent(id)}/lines`, params, options, { @@ -1003,7 +1015,9 @@ export class InvoiceResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/invoices/${invoiceId}/lines/${id}`, + `/v1/invoices/${encodeURIComponent(invoiceId)}/lines/${encodeURIComponent( + id + )}`, params, options, { diff --git a/src/resources/Issuing/Authorizations.ts b/src/resources/Issuing/Authorizations.ts index e987214f26..d5a39060f1 100644 --- a/src/resources/Issuing/Authorizations.ts +++ b/src/resources/Issuing/Authorizations.ts @@ -222,7 +222,7 @@ export class AuthorizationResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/issuing/authorizations/${id}`, + `/v1/issuing/authorizations/${encodeURIComponent(id)}`, params, options, { @@ -401,7 +401,7 @@ export class AuthorizationResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/issuing/authorizations/${id}`, + `/v1/issuing/authorizations/${encodeURIComponent(id)}`, params, options, { @@ -582,7 +582,7 @@ export class AuthorizationResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/issuing/authorizations/${id}/approve`, + `/v1/issuing/authorizations/${encodeURIComponent(id)}/approve`, params, options, { @@ -763,7 +763,7 @@ export class AuthorizationResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/issuing/authorizations/${id}/decline`, + `/v1/issuing/authorizations/${encodeURIComponent(id)}/decline`, params, options, { diff --git a/src/resources/Issuing/Cardholders.ts b/src/resources/Issuing/Cardholders.ts index 000b4c5f6f..85c9b998c1 100644 --- a/src/resources/Issuing/Cardholders.ts +++ b/src/resources/Issuing/Cardholders.ts @@ -54,7 +54,7 @@ export class CardholderResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/issuing/cardholders/${id}`, + `/v1/issuing/cardholders/${encodeURIComponent(id)}`, params, options ) as any; @@ -69,7 +69,7 @@ export class CardholderResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/issuing/cardholders/${id}`, + `/v1/issuing/cardholders/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Issuing/Cards.ts b/src/resources/Issuing/Cards.ts index b6ec92988a..2032e0b3c4 100644 --- a/src/resources/Issuing/Cards.ts +++ b/src/resources/Issuing/Cards.ts @@ -49,7 +49,7 @@ export class CardResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/issuing/cards/${id}`, + `/v1/issuing/cards/${encodeURIComponent(id)}`, params, options ) as any; @@ -64,7 +64,7 @@ export class CardResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/issuing/cards/${id}`, + `/v1/issuing/cards/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Issuing/Disputes.ts b/src/resources/Issuing/Disputes.ts index 5cc80bcee9..65bd2db360 100644 --- a/src/resources/Issuing/Disputes.ts +++ b/src/resources/Issuing/Disputes.ts @@ -49,7 +49,7 @@ export class DisputeResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/issuing/disputes/${id}`, + `/v1/issuing/disputes/${encodeURIComponent(id)}`, params, options ) as any; @@ -64,7 +64,7 @@ export class DisputeResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/issuing/disputes/${id}`, + `/v1/issuing/disputes/${encodeURIComponent(id)}`, params, options ) as any; @@ -79,7 +79,7 @@ export class DisputeResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/issuing/disputes/${id}/submit`, + `/v1/issuing/disputes/${encodeURIComponent(id)}/submit`, params, options ) as any; diff --git a/src/resources/Issuing/PersonalizationDesigns.ts b/src/resources/Issuing/PersonalizationDesigns.ts index b30dc7aa16..d0dc4d4769 100644 --- a/src/resources/Issuing/PersonalizationDesigns.ts +++ b/src/resources/Issuing/PersonalizationDesigns.ts @@ -53,7 +53,7 @@ export class PersonalizationDesignResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/issuing/personalization_designs/${id}`, + `/v1/issuing/personalization_designs/${encodeURIComponent(id)}`, params, options ) as any; @@ -68,7 +68,7 @@ export class PersonalizationDesignResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/issuing/personalization_designs/${id}`, + `/v1/issuing/personalization_designs/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Issuing/PhysicalBundles.ts b/src/resources/Issuing/PhysicalBundles.ts index 38345dec6b..13f84b4987 100644 --- a/src/resources/Issuing/PhysicalBundles.ts +++ b/src/resources/Issuing/PhysicalBundles.ts @@ -32,7 +32,7 @@ export class PhysicalBundleResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/issuing/physical_bundles/${id}`, + `/v1/issuing/physical_bundles/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Issuing/Tokens.ts b/src/resources/Issuing/Tokens.ts index 7a2a5d0002..601fcaa6ed 100644 --- a/src/resources/Issuing/Tokens.ts +++ b/src/resources/Issuing/Tokens.ts @@ -27,7 +27,7 @@ export class TokenResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/issuing/tokens/${id}`, + `/v1/issuing/tokens/${encodeURIComponent(id)}`, params, options ) as any; @@ -42,7 +42,7 @@ export class TokenResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/issuing/tokens/${id}`, + `/v1/issuing/tokens/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Issuing/Transactions.ts b/src/resources/Issuing/Transactions.ts index ed8077af5d..c7a98cab5c 100644 --- a/src/resources/Issuing/Transactions.ts +++ b/src/resources/Issuing/Transactions.ts @@ -135,7 +135,7 @@ export class TransactionResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/issuing/transactions/${id}`, + `/v1/issuing/transactions/${encodeURIComponent(id)}`, params, options, { @@ -234,7 +234,7 @@ export class TransactionResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/issuing/transactions/${id}`, + `/v1/issuing/transactions/${encodeURIComponent(id)}`, params, options, { diff --git a/src/resources/Mandates.ts b/src/resources/Mandates.ts index 2e46e5326b..ab2236b240 100644 --- a/src/resources/Mandates.ts +++ b/src/resources/Mandates.ts @@ -15,7 +15,7 @@ export class MandateResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/mandates/${id}`, + `/v1/mandates/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/PaymentAttemptRecords.ts b/src/resources/PaymentAttemptRecords.ts index 921371e474..d4b83b42d5 100644 --- a/src/resources/PaymentAttemptRecords.ts +++ b/src/resources/PaymentAttemptRecords.ts @@ -34,7 +34,7 @@ export class PaymentAttemptRecordResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/payment_attempt_records/${id}`, + `/v1/payment_attempt_records/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/PaymentIntents.ts b/src/resources/PaymentIntents.ts index d97ad96ce5..84a211d823 100644 --- a/src/resources/PaymentIntents.ts +++ b/src/resources/PaymentIntents.ts @@ -76,7 +76,7 @@ export class PaymentIntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/payment_intents/${id}`, + `/v1/payment_intents/${encodeURIComponent(id)}`, params, options ) as any; @@ -97,7 +97,7 @@ export class PaymentIntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_intents/${id}`, + `/v1/payment_intents/${encodeURIComponent(id)}`, params, options ) as any; @@ -132,7 +132,7 @@ export class PaymentIntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_intents/${id}/apply_customer_balance`, + `/v1/payment_intents/${encodeURIComponent(id)}/apply_customer_balance`, params, options ) as any; @@ -151,7 +151,7 @@ export class PaymentIntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_intents/${id}/cancel`, + `/v1/payment_intents/${encodeURIComponent(id)}/cancel`, params, options ) as any; @@ -170,7 +170,7 @@ export class PaymentIntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_intents/${id}/capture`, + `/v1/payment_intents/${encodeURIComponent(id)}/capture`, params, options ) as any; @@ -214,7 +214,7 @@ export class PaymentIntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_intents/${id}/confirm`, + `/v1/payment_intents/${encodeURIComponent(id)}/confirm`, params, options ) as any; @@ -254,7 +254,7 @@ export class PaymentIntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_intents/${id}/increment_authorization`, + `/v1/payment_intents/${encodeURIComponent(id)}/increment_authorization`, params, options ) as any; @@ -269,7 +269,7 @@ export class PaymentIntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_intents/${id}/verify_microdeposits`, + `/v1/payment_intents/${encodeURIComponent(id)}/verify_microdeposits`, params, options ) as any; @@ -284,7 +284,7 @@ export class PaymentIntentResource extends StripeResource { ): ApiListPromise { return this._makeRequest( 'GET', - `/v1/payment_intents/${id}/amount_details_line_items`, + `/v1/payment_intents/${encodeURIComponent(id)}/amount_details_line_items`, params, options, { diff --git a/src/resources/PaymentLinks.ts b/src/resources/PaymentLinks.ts index a417d7328c..f536537f9a 100644 --- a/src/resources/PaymentLinks.ts +++ b/src/resources/PaymentLinks.ts @@ -220,7 +220,7 @@ export class PaymentLinkResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/payment_links/${id}`, + `/v1/payment_links/${encodeURIComponent(id)}`, params, options, { @@ -311,7 +311,7 @@ export class PaymentLinkResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_links/${id}`, + `/v1/payment_links/${encodeURIComponent(id)}`, params, options, { @@ -402,7 +402,7 @@ export class PaymentLinkResource extends StripeResource { ): ApiListPromise { return this._makeRequest( 'GET', - `/v1/payment_links/${id}/line_items`, + `/v1/payment_links/${encodeURIComponent(id)}/line_items`, params, options, { diff --git a/src/resources/PaymentMethodConfigurations.ts b/src/resources/PaymentMethodConfigurations.ts index 7ca98175c9..ca7551cb69 100644 --- a/src/resources/PaymentMethodConfigurations.ts +++ b/src/resources/PaymentMethodConfigurations.ts @@ -46,7 +46,7 @@ export class PaymentMethodConfigurationResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/payment_method_configurations/${id}`, + `/v1/payment_method_configurations/${encodeURIComponent(id)}`, params, options ) as any; @@ -61,7 +61,7 @@ export class PaymentMethodConfigurationResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_method_configurations/${id}`, + `/v1/payment_method_configurations/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/PaymentMethodDomains.ts b/src/resources/PaymentMethodDomains.ts index e2dca15fdb..a45d2ae463 100644 --- a/src/resources/PaymentMethodDomains.ts +++ b/src/resources/PaymentMethodDomains.ts @@ -46,7 +46,7 @@ export class PaymentMethodDomainResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/payment_method_domains/${id}`, + `/v1/payment_method_domains/${encodeURIComponent(id)}`, params, options ) as any; @@ -61,7 +61,7 @@ export class PaymentMethodDomainResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_method_domains/${id}`, + `/v1/payment_method_domains/${encodeURIComponent(id)}`, params, options ) as any; @@ -81,7 +81,7 @@ export class PaymentMethodDomainResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_method_domains/${id}/validate`, + `/v1/payment_method_domains/${encodeURIComponent(id)}/validate`, params, options ) as any; diff --git a/src/resources/PaymentMethods.ts b/src/resources/PaymentMethods.ts index 22b0bc9f04..1f5971ee8f 100644 --- a/src/resources/PaymentMethods.ts +++ b/src/resources/PaymentMethods.ts @@ -52,7 +52,7 @@ export class PaymentMethodResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/payment_methods/${id}`, + `/v1/payment_methods/${encodeURIComponent(id)}`, params, options ) as any; @@ -67,7 +67,7 @@ export class PaymentMethodResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_methods/${id}`, + `/v1/payment_methods/${encodeURIComponent(id)}`, params, options ) as any; @@ -94,7 +94,7 @@ export class PaymentMethodResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_methods/${id}/attach`, + `/v1/payment_methods/${encodeURIComponent(id)}/attach`, params, options ) as any; @@ -109,7 +109,7 @@ export class PaymentMethodResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_methods/${id}/detach`, + `/v1/payment_methods/${encodeURIComponent(id)}/detach`, params, options ) as any; diff --git a/src/resources/PaymentRecords.ts b/src/resources/PaymentRecords.ts index cc8c336380..88c81b1bef 100644 --- a/src/resources/PaymentRecords.ts +++ b/src/resources/PaymentRecords.ts @@ -23,7 +23,7 @@ export class PaymentRecordResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/payment_records/${id}`, + `/v1/payment_records/${encodeURIComponent(id)}`, params, options ) as any; @@ -39,7 +39,7 @@ export class PaymentRecordResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_records/${id}/report_payment_attempt`, + `/v1/payment_records/${encodeURIComponent(id)}/report_payment_attempt`, params, options ) as any; @@ -55,7 +55,9 @@ export class PaymentRecordResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_records/${id}/report_payment_attempt_canceled`, + `/v1/payment_records/${encodeURIComponent( + id + )}/report_payment_attempt_canceled`, params, options ) as any; @@ -71,7 +73,9 @@ export class PaymentRecordResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_records/${id}/report_payment_attempt_failed`, + `/v1/payment_records/${encodeURIComponent( + id + )}/report_payment_attempt_failed`, params, options ) as any; @@ -87,7 +91,9 @@ export class PaymentRecordResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_records/${id}/report_payment_attempt_guaranteed`, + `/v1/payment_records/${encodeURIComponent( + id + )}/report_payment_attempt_guaranteed`, params, options ) as any; @@ -102,7 +108,9 @@ export class PaymentRecordResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_records/${id}/report_payment_attempt_informational`, + `/v1/payment_records/${encodeURIComponent( + id + )}/report_payment_attempt_informational`, params, options ) as any; @@ -118,7 +126,7 @@ export class PaymentRecordResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_records/${id}/report_refund`, + `/v1/payment_records/${encodeURIComponent(id)}/report_refund`, params, options ) as any; diff --git a/src/resources/Payouts.ts b/src/resources/Payouts.ts index 7dd8d31dde..80a8973305 100644 --- a/src/resources/Payouts.ts +++ b/src/resources/Payouts.ts @@ -48,7 +48,7 @@ export class PayoutResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/payouts/${id}`, + `/v1/payouts/${encodeURIComponent(id)}`, params, options ) as any; @@ -63,7 +63,7 @@ export class PayoutResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payouts/${id}`, + `/v1/payouts/${encodeURIComponent(id)}`, params, options ) as any; @@ -78,7 +78,7 @@ export class PayoutResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payouts/${id}/cancel`, + `/v1/payouts/${encodeURIComponent(id)}/cancel`, params, options ) as any; @@ -95,7 +95,7 @@ export class PayoutResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payouts/${id}/reverse`, + `/v1/payouts/${encodeURIComponent(id)}/reverse`, params, options ) as any; diff --git a/src/resources/Plans.ts b/src/resources/Plans.ts index 3b6e04bada..e5c78ea645 100644 --- a/src/resources/Plans.ts +++ b/src/resources/Plans.ts @@ -23,7 +23,7 @@ export class PlanResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v1/plans/${id}`, + `/v1/plans/${encodeURIComponent(id)}`, params, options ) as any; @@ -36,30 +36,36 @@ export class PlanResource extends StripeResource { params?: PlanRetrieveParams, options?: RequestOptions ): Promise> { - return this._makeRequest('GET', `/v1/plans/${id}`, params, options, { - responseSchema: { - kind: 'object', - fields: { - amount_decimal: {kind: 'nullable', inner: {kind: 'decimal_string'}}, - tiers: { - kind: 'array', - element: { - kind: 'object', - fields: { - flat_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + return this._makeRequest( + 'GET', + `/v1/plans/${encodeURIComponent(id)}`, + params, + options, + { + responseSchema: { + kind: 'object', + fields: { + amount_decimal: {kind: 'nullable', inner: {kind: 'decimal_string'}}, + tiers: { + kind: 'array', + element: { + kind: 'object', + fields: { + flat_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, }, }, - }, - }) as any; + } + ) as any; } /** * Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan's ID, amount, currency, or billing cycle. @@ -69,30 +75,36 @@ export class PlanResource extends StripeResource { params?: PlanUpdateParams, options?: RequestOptions ): Promise> { - return this._makeRequest('POST', `/v1/plans/${id}`, params, options, { - responseSchema: { - kind: 'object', - fields: { - amount_decimal: {kind: 'nullable', inner: {kind: 'decimal_string'}}, - tiers: { - kind: 'array', - element: { - kind: 'object', - fields: { - flat_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + return this._makeRequest( + 'POST', + `/v1/plans/${encodeURIComponent(id)}`, + params, + options, + { + responseSchema: { + kind: 'object', + fields: { + amount_decimal: {kind: 'nullable', inner: {kind: 'decimal_string'}}, + tiers: { + kind: 'array', + element: { + kind: 'object', + fields: { + flat_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, }, }, - }, - }) as any; + } + ) as any; } /** * Returns a list of your plans. diff --git a/src/resources/Prices.ts b/src/resources/Prices.ts index dd8847d9e6..7edf6330c6 100644 --- a/src/resources/Prices.ts +++ b/src/resources/Prices.ts @@ -196,61 +196,67 @@ export class PriceResource extends StripeResource { params?: PriceRetrieveParams, options?: RequestOptions ): Promise> { - return this._makeRequest('GET', `/v1/prices/${id}`, params, options, { - responseSchema: { - kind: 'object', - fields: { - currency_options: { - kind: 'array', - element: { - kind: 'object', - fields: { - tiers: { - kind: 'array', - element: { - kind: 'object', - fields: { - flat_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + return this._makeRequest( + 'GET', + `/v1/prices/${encodeURIComponent(id)}`, + params, + options, + { + responseSchema: { + kind: 'object', + fields: { + currency_options: { + kind: 'array', + element: { + kind: 'object', + fields: { + tiers: { + kind: 'array', + element: { + kind: 'object', + fields: { + flat_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, - }, - tiers: { - kind: 'array', - element: { - kind: 'object', - fields: { - flat_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + tiers: { + kind: 'array', + element: { + kind: 'object', + fields: { + flat_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, - }, - }) as any; + } + ) as any; } /** * Updates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged. @@ -260,61 +266,67 @@ export class PriceResource extends StripeResource { params?: PriceUpdateParams, options?: RequestOptions ): Promise> { - return this._makeRequest('POST', `/v1/prices/${id}`, params, options, { - responseSchema: { - kind: 'object', - fields: { - currency_options: { - kind: 'array', - element: { - kind: 'object', - fields: { - tiers: { - kind: 'array', - element: { - kind: 'object', - fields: { - flat_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + return this._makeRequest( + 'POST', + `/v1/prices/${encodeURIComponent(id)}`, + params, + options, + { + responseSchema: { + kind: 'object', + fields: { + currency_options: { + kind: 'array', + element: { + kind: 'object', + fields: { + tiers: { + kind: 'array', + element: { + kind: 'object', + fields: { + flat_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, - }, - tiers: { - kind: 'array', - element: { - kind: 'object', - fields: { - flat_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + tiers: { + kind: 'array', + element: { + kind: 'object', + fields: { + flat_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, - }, - }) as any; + } + ) as any; } /** * Search for prices you've previously created using Stripe's [Search Query Language](https://docs.stripe.com/docs/search#search-query-language). diff --git a/src/resources/Products.ts b/src/resources/Products.ts index 9bde2eb140..2f1c7c8436 100644 --- a/src/resources/Products.ts +++ b/src/resources/Products.ts @@ -30,7 +30,7 @@ export class ProductResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v1/products/${id}`, + `/v1/products/${encodeURIComponent(id)}`, params, options ) as any; @@ -45,7 +45,7 @@ export class ProductResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/products/${id}`, + `/v1/products/${encodeURIComponent(id)}`, params, options ) as any; @@ -60,7 +60,7 @@ export class ProductResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/products/${id}`, + `/v1/products/${encodeURIComponent(id)}`, params, options ) as any; @@ -141,7 +141,9 @@ export class ProductResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v1/products/${productId}/features/${id}`, + `/v1/products/${encodeURIComponent( + productId + )}/features/${encodeURIComponent(id)}`, params, options ) as any; @@ -157,7 +159,9 @@ export class ProductResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/products/${productId}/features/${id}`, + `/v1/products/${encodeURIComponent( + productId + )}/features/${encodeURIComponent(id)}`, params, options ) as any; @@ -172,7 +176,7 @@ export class ProductResource extends StripeResource { ): ApiListPromise { return this._makeRequest( 'GET', - `/v1/products/${id}/features`, + `/v1/products/${encodeURIComponent(id)}/features`, params, options, { @@ -190,7 +194,7 @@ export class ProductResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/products/${id}/features`, + `/v1/products/${encodeURIComponent(id)}/features`, params, options ) as any; diff --git a/src/resources/PromotionCodes.ts b/src/resources/PromotionCodes.ts index 7db70fc280..5d2e2a515d 100644 --- a/src/resources/PromotionCodes.ts +++ b/src/resources/PromotionCodes.ts @@ -48,7 +48,7 @@ export class PromotionCodeResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/promotion_codes/${id}`, + `/v1/promotion_codes/${encodeURIComponent(id)}`, params, options ) as any; @@ -63,7 +63,7 @@ export class PromotionCodeResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/promotion_codes/${id}`, + `/v1/promotion_codes/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Quotes.ts b/src/resources/Quotes.ts index b94604d125..eaf0184d66 100644 --- a/src/resources/Quotes.ts +++ b/src/resources/Quotes.ts @@ -253,76 +253,86 @@ export class QuoteResource extends StripeResource { params?: QuoteRetrieveParams, options?: RequestOptions ): Promise> { - return this._makeRequest('GET', `/v1/quotes/${id}`, params, options, { - responseSchema: { - kind: 'object', - fields: { - computed: { - kind: 'object', - fields: { - upfront: { - kind: 'object', - fields: { - line_items: { - kind: 'object', - fields: { - data: { - kind: 'array', - element: { - kind: 'object', - fields: { - price: { - kind: 'nullable', - inner: { - kind: 'object', - fields: { - currency_options: { - kind: 'array', - element: { - kind: 'object', - fields: { - tiers: { - kind: 'array', - element: { - kind: 'object', - fields: { - flat_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + return this._makeRequest( + 'GET', + `/v1/quotes/${encodeURIComponent(id)}`, + params, + options, + { + responseSchema: { + kind: 'object', + fields: { + computed: { + kind: 'object', + fields: { + upfront: { + kind: 'object', + fields: { + line_items: { + kind: 'object', + fields: { + data: { + kind: 'array', + element: { + kind: 'object', + fields: { + price: { + kind: 'nullable', + inner: { + kind: 'object', + fields: { + currency_options: { + kind: 'array', + element: { + kind: 'object', + fields: { + tiers: { + kind: 'array', + element: { + kind: 'object', + fields: { + flat_amount_decimal: { + kind: 'nullable', + inner: { + kind: 'decimal_string', + }, + }, + unit_amount_decimal: { + kind: 'nullable', + inner: { + kind: 'decimal_string', + }, + }, }, }, }, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, - }, - tiers: { - kind: 'array', - element: { - kind: 'object', - fields: { - flat_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + tiers: { + kind: 'array', + element: { + kind: 'object', + fields: { + flat_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, @@ -337,8 +347,8 @@ export class QuoteResource extends StripeResource { }, }, }, - }, - }) as any; + } + ) as any; } /** * A quote models prices and services for a customer. @@ -348,93 +358,103 @@ export class QuoteResource extends StripeResource { params?: QuoteUpdateParams, options?: RequestOptions ): Promise> { - return this._makeRequest('POST', `/v1/quotes/${id}`, params, options, { - requestSchema: { - kind: 'object', - fields: { - line_items: { - kind: 'array', - element: { - kind: 'object', - fields: { - price_data: { - kind: 'object', - fields: {unit_amount_decimal: {kind: 'decimal_string'}}, + return this._makeRequest( + 'POST', + `/v1/quotes/${encodeURIComponent(id)}`, + params, + options, + { + requestSchema: { + kind: 'object', + fields: { + line_items: { + kind: 'array', + element: { + kind: 'object', + fields: { + price_data: { + kind: 'object', + fields: {unit_amount_decimal: {kind: 'decimal_string'}}, + }, }, }, }, }, }, - }, - responseSchema: { - kind: 'object', - fields: { - computed: { - kind: 'object', - fields: { - upfront: { - kind: 'object', - fields: { - line_items: { - kind: 'object', - fields: { - data: { - kind: 'array', - element: { - kind: 'object', - fields: { - price: { - kind: 'nullable', - inner: { - kind: 'object', - fields: { - currency_options: { - kind: 'array', - element: { - kind: 'object', - fields: { - tiers: { - kind: 'array', - element: { - kind: 'object', - fields: { - flat_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + responseSchema: { + kind: 'object', + fields: { + computed: { + kind: 'object', + fields: { + upfront: { + kind: 'object', + fields: { + line_items: { + kind: 'object', + fields: { + data: { + kind: 'array', + element: { + kind: 'object', + fields: { + price: { + kind: 'nullable', + inner: { + kind: 'object', + fields: { + currency_options: { + kind: 'array', + element: { + kind: 'object', + fields: { + tiers: { + kind: 'array', + element: { + kind: 'object', + fields: { + flat_amount_decimal: { + kind: 'nullable', + inner: { + kind: 'decimal_string', + }, + }, + unit_amount_decimal: { + kind: 'nullable', + inner: { + kind: 'decimal_string', + }, + }, }, }, }, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, - }, - tiers: { - kind: 'array', - element: { - kind: 'object', - fields: { - flat_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + tiers: { + kind: 'array', + element: { + kind: 'object', + fields: { + flat_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, @@ -449,8 +469,8 @@ export class QuoteResource extends StripeResource { }, }, }, - }, - }) as any; + } + ) as any; } /** * Accepts the specified quote. @@ -462,7 +482,7 @@ export class QuoteResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/quotes/${id}/accept`, + `/v1/quotes/${encodeURIComponent(id)}/accept`, params, options, { @@ -567,7 +587,7 @@ export class QuoteResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/quotes/${id}/cancel`, + `/v1/quotes/${encodeURIComponent(id)}/cancel`, params, options, { @@ -672,7 +692,7 @@ export class QuoteResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/quotes/${id}/finalize`, + `/v1/quotes/${encodeURIComponent(id)}/finalize`, params, options, { @@ -775,10 +795,16 @@ export class QuoteResource extends StripeResource { params?: QuotePdfParams, options?: RequestOptions ): Promise { - return this._makeRequest('GET', `/v1/quotes/${id}/pdf`, params, options, { - apiBase: 'files', - streaming: true, - }) as any; + return this._makeRequest( + 'GET', + `/v1/quotes/${encodeURIComponent(id)}/pdf`, + params, + options, + { + apiBase: 'files', + streaming: true, + } + ) as any; } /** * When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. @@ -790,7 +816,7 @@ export class QuoteResource extends StripeResource { ): ApiListPromise { return this._makeRequest( 'GET', - `/v1/quotes/${id}/computed_upfront_line_items`, + `/v1/quotes/${encodeURIComponent(id)}/computed_upfront_line_items`, params, options, { @@ -877,7 +903,7 @@ export class QuoteResource extends StripeResource { ): ApiListPromise { return this._makeRequest( 'GET', - `/v1/quotes/${id}/line_items`, + `/v1/quotes/${encodeURIComponent(id)}/line_items`, params, options, { diff --git a/src/resources/Radar/EarlyFraudWarnings.ts b/src/resources/Radar/EarlyFraudWarnings.ts index c7f1b012f1..9041171b37 100644 --- a/src/resources/Radar/EarlyFraudWarnings.ts +++ b/src/resources/Radar/EarlyFraudWarnings.ts @@ -36,7 +36,7 @@ export class EarlyFraudWarningResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/radar/early_fraud_warnings/${id}`, + `/v1/radar/early_fraud_warnings/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Radar/ValueListItems.ts b/src/resources/Radar/ValueListItems.ts index 0faa1fd143..964a345970 100644 --- a/src/resources/Radar/ValueListItems.ts +++ b/src/resources/Radar/ValueListItems.ts @@ -15,7 +15,7 @@ export class ValueListItemResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v1/radar/value_list_items/${id}`, + `/v1/radar/value_list_items/${encodeURIComponent(id)}`, params, options ) as any; @@ -30,7 +30,7 @@ export class ValueListItemResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/radar/value_list_items/${id}`, + `/v1/radar/value_list_items/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Radar/ValueLists.ts b/src/resources/Radar/ValueLists.ts index dc4f1956d3..75f56cb302 100644 --- a/src/resources/Radar/ValueLists.ts +++ b/src/resources/Radar/ValueLists.ts @@ -21,7 +21,7 @@ export class ValueListResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v1/radar/value_lists/${id}`, + `/v1/radar/value_lists/${encodeURIComponent(id)}`, params, options ) as any; @@ -36,7 +36,7 @@ export class ValueListResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/radar/value_lists/${id}`, + `/v1/radar/value_lists/${encodeURIComponent(id)}`, params, options ) as any; @@ -51,7 +51,7 @@ export class ValueListResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/radar/value_lists/${id}`, + `/v1/radar/value_lists/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Refunds.ts b/src/resources/Refunds.ts index a24c8643e7..d31356bb1b 100644 --- a/src/resources/Refunds.ts +++ b/src/resources/Refunds.ts @@ -55,7 +55,7 @@ export class RefundResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/refunds/${id}`, + `/v1/refunds/${encodeURIComponent(id)}`, params, options ) as any; @@ -72,7 +72,7 @@ export class RefundResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/refunds/${id}`, + `/v1/refunds/${encodeURIComponent(id)}`, params, options ) as any; @@ -89,7 +89,7 @@ export class RefundResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/refunds/${id}/cancel`, + `/v1/refunds/${encodeURIComponent(id)}/cancel`, params, options ) as any; diff --git a/src/resources/Reporting/ReportRuns.ts b/src/resources/Reporting/ReportRuns.ts index 48c384baca..b9427e51a7 100644 --- a/src/resources/Reporting/ReportRuns.ts +++ b/src/resources/Reporting/ReportRuns.ts @@ -47,7 +47,7 @@ export class ReportRunResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/reporting/report_runs/${id}`, + `/v1/reporting/report_runs/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Reporting/ReportTypes.ts b/src/resources/Reporting/ReportTypes.ts index 17df8320aa..0ccb28731e 100644 --- a/src/resources/Reporting/ReportTypes.ts +++ b/src/resources/Reporting/ReportTypes.ts @@ -31,7 +31,7 @@ export class ReportTypeResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/reporting/report_types/${id}`, + `/v1/reporting/report_types/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Reviews.ts b/src/resources/Reviews.ts index 2ae2974581..8f185f3666 100644 --- a/src/resources/Reviews.ts +++ b/src/resources/Reviews.ts @@ -28,7 +28,7 @@ export class ReviewResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/reviews/${id}`, + `/v1/reviews/${encodeURIComponent(id)}`, params, options ) as any; @@ -43,7 +43,7 @@ export class ReviewResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/reviews/${id}/approve`, + `/v1/reviews/${encodeURIComponent(id)}/approve`, params, options ) as any; diff --git a/src/resources/SetupIntents.ts b/src/resources/SetupIntents.ts index 251f8d079b..ebef3da105 100644 --- a/src/resources/SetupIntents.ts +++ b/src/resources/SetupIntents.ts @@ -62,7 +62,7 @@ export class SetupIntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/setup_intents/${id}`, + `/v1/setup_intents/${encodeURIComponent(id)}`, params, options ) as any; @@ -77,7 +77,7 @@ export class SetupIntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/setup_intents/${id}`, + `/v1/setup_intents/${encodeURIComponent(id)}`, params, options ) as any; @@ -94,7 +94,7 @@ export class SetupIntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/setup_intents/${id}/cancel`, + `/v1/setup_intents/${encodeURIComponent(id)}/cancel`, params, options ) as any; @@ -122,7 +122,7 @@ export class SetupIntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/setup_intents/${id}/confirm`, + `/v1/setup_intents/${encodeURIComponent(id)}/confirm`, params, options ) as any; @@ -137,7 +137,7 @@ export class SetupIntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/setup_intents/${id}/verify_microdeposits`, + `/v1/setup_intents/${encodeURIComponent(id)}/verify_microdeposits`, params, options ) as any; diff --git a/src/resources/ShippingRates.ts b/src/resources/ShippingRates.ts index f9e49805b4..a3129c061e 100644 --- a/src/resources/ShippingRates.ts +++ b/src/resources/ShippingRates.ts @@ -47,7 +47,7 @@ export class ShippingRateResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/shipping_rates/${id}`, + `/v1/shipping_rates/${encodeURIComponent(id)}`, params, options ) as any; @@ -62,7 +62,7 @@ export class ShippingRateResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/shipping_rates/${id}`, + `/v1/shipping_rates/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Sigma/ScheduledQueryRuns.ts b/src/resources/Sigma/ScheduledQueryRuns.ts index 1bef6f3150..9b7a835b82 100644 --- a/src/resources/Sigma/ScheduledQueryRuns.ts +++ b/src/resources/Sigma/ScheduledQueryRuns.ts @@ -33,7 +33,7 @@ export class ScheduledQueryRunResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/sigma/scheduled_query_runs/${id}`, + `/v1/sigma/scheduled_query_runs/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Sources.ts b/src/resources/Sources.ts index 2b7ec97282..501edf017c 100644 --- a/src/resources/Sources.ts +++ b/src/resources/Sources.ts @@ -24,7 +24,7 @@ export class SourceResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/sources/${id}`, + `/v1/sources/${encodeURIComponent(id)}`, params, options ) as any; @@ -41,7 +41,7 @@ export class SourceResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/sources/${id}`, + `/v1/sources/${encodeURIComponent(id)}`, params, options ) as any; @@ -65,7 +65,7 @@ export class SourceResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/sources/${id}/verify`, + `/v1/sources/${encodeURIComponent(id)}/verify`, params, options ) as any; @@ -80,7 +80,7 @@ export class SourceResource extends StripeResource { ): ApiListPromise { return this._makeRequest( 'GET', - `/v1/sources/${id}/source_transactions`, + `/v1/sources/${encodeURIComponent(id)}/source_transactions`, params, options, { diff --git a/src/resources/SubscriptionItems.ts b/src/resources/SubscriptionItems.ts index 85dc89531e..35efff48fc 100644 --- a/src/resources/SubscriptionItems.ts +++ b/src/resources/SubscriptionItems.ts @@ -25,7 +25,7 @@ export class SubscriptionItemResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v1/subscription_items/${id}`, + `/v1/subscription_items/${encodeURIComponent(id)}`, params, options ) as any; @@ -40,7 +40,7 @@ export class SubscriptionItemResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/subscription_items/${id}`, + `/v1/subscription_items/${encodeURIComponent(id)}`, params, options, { @@ -140,7 +140,7 @@ export class SubscriptionItemResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/subscription_items/${id}`, + `/v1/subscription_items/${encodeURIComponent(id)}`, params, options, { diff --git a/src/resources/SubscriptionSchedules.ts b/src/resources/SubscriptionSchedules.ts index 6557f07316..c9d07c8027 100644 --- a/src/resources/SubscriptionSchedules.ts +++ b/src/resources/SubscriptionSchedules.ts @@ -109,7 +109,7 @@ export class SubscriptionScheduleResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/subscription_schedules/${id}`, + `/v1/subscription_schedules/${encodeURIComponent(id)}`, params, options ) as any; @@ -124,7 +124,7 @@ export class SubscriptionScheduleResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/subscription_schedules/${id}`, + `/v1/subscription_schedules/${encodeURIComponent(id)}`, params, options, { @@ -182,7 +182,7 @@ export class SubscriptionScheduleResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/subscription_schedules/${id}/cancel`, + `/v1/subscription_schedules/${encodeURIComponent(id)}/cancel`, params, options ) as any; @@ -197,7 +197,7 @@ export class SubscriptionScheduleResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/subscription_schedules/${id}/release`, + `/v1/subscription_schedules/${encodeURIComponent(id)}/release`, params, options ) as any; diff --git a/src/resources/Subscriptions.ts b/src/resources/Subscriptions.ts index 73892c3bc3..c5d55706d5 100644 --- a/src/resources/Subscriptions.ts +++ b/src/resources/Subscriptions.ts @@ -46,7 +46,7 @@ export class SubscriptionResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v1/subscriptions/${id}`, + `/v1/subscriptions/${encodeURIComponent(id)}`, params, options, { @@ -159,7 +159,7 @@ export class SubscriptionResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/subscriptions/${id}`, + `/v1/subscriptions/${encodeURIComponent(id)}`, params, options, { @@ -292,7 +292,7 @@ export class SubscriptionResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/subscriptions/${id}`, + `/v1/subscriptions/${encodeURIComponent(id)}`, params, options, { @@ -434,7 +434,7 @@ export class SubscriptionResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v1/subscriptions/${id}/discount`, + `/v1/subscriptions/${encodeURIComponent(id)}/discount`, params, options ) as any; @@ -829,7 +829,7 @@ export class SubscriptionResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/subscriptions/${id}/migrate`, + `/v1/subscriptions/${encodeURIComponent(id)}/migrate`, params, options, { @@ -942,7 +942,7 @@ export class SubscriptionResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/subscriptions/${id}/resume`, + `/v1/subscriptions/${encodeURIComponent(id)}/resume`, params, options, { diff --git a/src/resources/Tax/Calculations.ts b/src/resources/Tax/Calculations.ts index a5f88cf082..85c2d187e6 100644 --- a/src/resources/Tax/Calculations.ts +++ b/src/resources/Tax/Calculations.ts @@ -21,7 +21,7 @@ export class CalculationResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/tax/calculations/${id}`, + `/v1/tax/calculations/${encodeURIComponent(id)}`, params, options ) as any; @@ -50,7 +50,7 @@ export class CalculationResource extends StripeResource { ): ApiListPromise { return this._makeRequest( 'GET', - `/v1/tax/calculations/${id}/line_items`, + `/v1/tax/calculations/${encodeURIComponent(id)}/line_items`, params, options, { diff --git a/src/resources/Tax/Registrations.ts b/src/resources/Tax/Registrations.ts index 587e0a302f..2158181196 100644 --- a/src/resources/Tax/Registrations.ts +++ b/src/resources/Tax/Registrations.ts @@ -40,7 +40,7 @@ export class RegistrationResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/tax/registrations/${id}`, + `/v1/tax/registrations/${encodeURIComponent(id)}`, params, options ) as any; @@ -57,7 +57,7 @@ export class RegistrationResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/tax/registrations/${id}`, + `/v1/tax/registrations/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Tax/Transactions.ts b/src/resources/Tax/Transactions.ts index f90523e105..b313f55b6b 100644 --- a/src/resources/Tax/Transactions.ts +++ b/src/resources/Tax/Transactions.ts @@ -21,7 +21,7 @@ export class TransactionResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/tax/transactions/${id}`, + `/v1/tax/transactions/${encodeURIComponent(id)}`, params, options ) as any; @@ -64,7 +64,7 @@ export class TransactionResource extends StripeResource { ): ApiListPromise { return this._makeRequest( 'GET', - `/v1/tax/transactions/${id}/line_items`, + `/v1/tax/transactions/${encodeURIComponent(id)}/line_items`, params, options, { diff --git a/src/resources/TaxCodes.ts b/src/resources/TaxCodes.ts index 9adbf98b3c..ff3c9dfef8 100644 --- a/src/resources/TaxCodes.ts +++ b/src/resources/TaxCodes.ts @@ -26,7 +26,7 @@ export class TaxCodeResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/tax_codes/${id}`, + `/v1/tax_codes/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/TaxIds.ts b/src/resources/TaxIds.ts index 0b6388c759..51c3809b80 100644 --- a/src/resources/TaxIds.ts +++ b/src/resources/TaxIds.ts @@ -18,7 +18,7 @@ export class TaxIdResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v1/tax_ids/${id}`, + `/v1/tax_ids/${encodeURIComponent(id)}`, params, options ) as any; @@ -33,7 +33,7 @@ export class TaxIdResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/tax_ids/${id}`, + `/v1/tax_ids/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/TaxRates.ts b/src/resources/TaxRates.ts index 4f50d1cfd2..0a4dd86b49 100644 --- a/src/resources/TaxRates.ts +++ b/src/resources/TaxRates.ts @@ -41,7 +41,7 @@ export class TaxRateResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/tax_rates/${id}`, + `/v1/tax_rates/${encodeURIComponent(id)}`, params, options ) as any; @@ -56,7 +56,7 @@ export class TaxRateResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/tax_rates/${id}`, + `/v1/tax_rates/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Terminal/Configurations.ts b/src/resources/Terminal/Configurations.ts index 5406d9bc0e..6d56d9706b 100644 --- a/src/resources/Terminal/Configurations.ts +++ b/src/resources/Terminal/Configurations.ts @@ -16,7 +16,7 @@ export class ConfigurationResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v1/terminal/configurations/${id}`, + `/v1/terminal/configurations/${encodeURIComponent(id)}`, params, options ) as any; @@ -31,7 +31,7 @@ export class ConfigurationResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/terminal/configurations/${id}`, + `/v1/terminal/configurations/${encodeURIComponent(id)}`, params, options ) as any; @@ -46,7 +46,7 @@ export class ConfigurationResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/terminal/configurations/${id}`, + `/v1/terminal/configurations/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Terminal/Locations.ts b/src/resources/Terminal/Locations.ts index 84b0107520..69a7913a85 100644 --- a/src/resources/Terminal/Locations.ts +++ b/src/resources/Terminal/Locations.ts @@ -23,7 +23,7 @@ export class LocationResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v1/terminal/locations/${id}`, + `/v1/terminal/locations/${encodeURIComponent(id)}`, params, options ) as any; @@ -38,7 +38,7 @@ export class LocationResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/terminal/locations/${id}`, + `/v1/terminal/locations/${encodeURIComponent(id)}`, params, options ) as any; @@ -53,7 +53,7 @@ export class LocationResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/terminal/locations/${id}`, + `/v1/terminal/locations/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Terminal/Readers.ts b/src/resources/Terminal/Readers.ts index af763eec76..0337a7b791 100644 --- a/src/resources/Terminal/Readers.ts +++ b/src/resources/Terminal/Readers.ts @@ -27,7 +27,7 @@ export class ReaderResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v1/terminal/readers/${id}`, + `/v1/terminal/readers/${encodeURIComponent(id)}`, params, options ) as any; @@ -42,7 +42,7 @@ export class ReaderResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/terminal/readers/${id}`, + `/v1/terminal/readers/${encodeURIComponent(id)}`, params, options ) as any; @@ -57,7 +57,7 @@ export class ReaderResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/terminal/readers/${id}`, + `/v1/terminal/readers/${encodeURIComponent(id)}`, params, options ) as any; @@ -97,7 +97,7 @@ export class ReaderResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/terminal/readers/${id}/cancel_action`, + `/v1/terminal/readers/${encodeURIComponent(id)}/cancel_action`, params, options ) as any; @@ -112,7 +112,7 @@ export class ReaderResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/terminal/readers/${id}/collect_inputs`, + `/v1/terminal/readers/${encodeURIComponent(id)}/collect_inputs`, params, options ) as any; @@ -127,7 +127,7 @@ export class ReaderResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/terminal/readers/${id}/collect_payment_method`, + `/v1/terminal/readers/${encodeURIComponent(id)}/collect_payment_method`, params, options ) as any; @@ -142,7 +142,7 @@ export class ReaderResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/terminal/readers/${id}/confirm_payment_intent`, + `/v1/terminal/readers/${encodeURIComponent(id)}/confirm_payment_intent`, params, options ) as any; @@ -157,7 +157,7 @@ export class ReaderResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/terminal/readers/${id}/process_payment_intent`, + `/v1/terminal/readers/${encodeURIComponent(id)}/process_payment_intent`, params, options ) as any; @@ -172,7 +172,7 @@ export class ReaderResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/terminal/readers/${id}/process_setup_intent`, + `/v1/terminal/readers/${encodeURIComponent(id)}/process_setup_intent`, params, options ) as any; @@ -187,7 +187,7 @@ export class ReaderResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/terminal/readers/${id}/refund_payment`, + `/v1/terminal/readers/${encodeURIComponent(id)}/refund_payment`, params, options ) as any; @@ -202,7 +202,7 @@ export class ReaderResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/terminal/readers/${id}/set_reader_display`, + `/v1/terminal/readers/${encodeURIComponent(id)}/set_reader_display`, params, options ) as any; diff --git a/src/resources/TestHelpers/Customers.ts b/src/resources/TestHelpers/Customers.ts index cbe4f9b0ab..cd636bf59f 100644 --- a/src/resources/TestHelpers/Customers.ts +++ b/src/resources/TestHelpers/Customers.ts @@ -15,7 +15,7 @@ export class CustomerResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/customers/${id}/fund_cash_balance`, + `/v1/test_helpers/customers/${encodeURIComponent(id)}/fund_cash_balance`, params, options ) as any; diff --git a/src/resources/TestHelpers/Issuing/Authorizations.ts b/src/resources/TestHelpers/Issuing/Authorizations.ts index ad8cd52473..e18ef67c01 100644 --- a/src/resources/TestHelpers/Issuing/Authorizations.ts +++ b/src/resources/TestHelpers/Issuing/Authorizations.ts @@ -231,7 +231,9 @@ export class AuthorizationResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/issuing/authorizations/${id}/capture`, + `/v1/test_helpers/issuing/authorizations/${encodeURIComponent( + id + )}/capture`, params, options, { @@ -463,7 +465,9 @@ export class AuthorizationResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/issuing/authorizations/${id}/expire`, + `/v1/test_helpers/issuing/authorizations/${encodeURIComponent( + id + )}/expire`, params, options, { @@ -642,7 +646,9 @@ export class AuthorizationResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/issuing/authorizations/${id}/finalize_amount`, + `/v1/test_helpers/issuing/authorizations/${encodeURIComponent( + id + )}/finalize_amount`, params, options, { @@ -858,7 +864,9 @@ export class AuthorizationResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/issuing/authorizations/${id}/fraud_challenges/respond`, + `/v1/test_helpers/issuing/authorizations/${encodeURIComponent( + id + )}/fraud_challenges/respond`, params, options, { @@ -1037,7 +1045,9 @@ export class AuthorizationResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/issuing/authorizations/${id}/increment`, + `/v1/test_helpers/issuing/authorizations/${encodeURIComponent( + id + )}/increment`, params, options, { @@ -1216,7 +1226,9 @@ export class AuthorizationResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/issuing/authorizations/${id}/reverse`, + `/v1/test_helpers/issuing/authorizations/${encodeURIComponent( + id + )}/reverse`, params, options, { diff --git a/src/resources/TestHelpers/Issuing/Cards.ts b/src/resources/TestHelpers/Issuing/Cards.ts index ad5b0e1e40..7864332cdd 100644 --- a/src/resources/TestHelpers/Issuing/Cards.ts +++ b/src/resources/TestHelpers/Issuing/Cards.ts @@ -15,7 +15,9 @@ export class CardResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/issuing/cards/${id}/shipping/deliver`, + `/v1/test_helpers/issuing/cards/${encodeURIComponent( + id + )}/shipping/deliver`, params, options ) as any; @@ -30,7 +32,7 @@ export class CardResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/issuing/cards/${id}/shipping/fail`, + `/v1/test_helpers/issuing/cards/${encodeURIComponent(id)}/shipping/fail`, params, options ) as any; @@ -45,7 +47,9 @@ export class CardResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/issuing/cards/${id}/shipping/return`, + `/v1/test_helpers/issuing/cards/${encodeURIComponent( + id + )}/shipping/return`, params, options ) as any; @@ -60,7 +64,7 @@ export class CardResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/issuing/cards/${id}/shipping/ship`, + `/v1/test_helpers/issuing/cards/${encodeURIComponent(id)}/shipping/ship`, params, options ) as any; @@ -75,7 +79,9 @@ export class CardResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/issuing/cards/${id}/shipping/submit`, + `/v1/test_helpers/issuing/cards/${encodeURIComponent( + id + )}/shipping/submit`, params, options ) as any; diff --git a/src/resources/TestHelpers/Issuing/PersonalizationDesigns.ts b/src/resources/TestHelpers/Issuing/PersonalizationDesigns.ts index b86a482368..5a0a2e3b99 100644 --- a/src/resources/TestHelpers/Issuing/PersonalizationDesigns.ts +++ b/src/resources/TestHelpers/Issuing/PersonalizationDesigns.ts @@ -15,7 +15,9 @@ export class PersonalizationDesignResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/issuing/personalization_designs/${id}/activate`, + `/v1/test_helpers/issuing/personalization_designs/${encodeURIComponent( + id + )}/activate`, params, options ) as any; @@ -30,7 +32,9 @@ export class PersonalizationDesignResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/issuing/personalization_designs/${id}/deactivate`, + `/v1/test_helpers/issuing/personalization_designs/${encodeURIComponent( + id + )}/deactivate`, params, options ) as any; @@ -45,7 +49,9 @@ export class PersonalizationDesignResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/issuing/personalization_designs/${id}/reject`, + `/v1/test_helpers/issuing/personalization_designs/${encodeURIComponent( + id + )}/reject`, params, options ) as any; diff --git a/src/resources/TestHelpers/Issuing/Transactions.ts b/src/resources/TestHelpers/Issuing/Transactions.ts index 1b4383a32d..dd468d9fc1 100644 --- a/src/resources/TestHelpers/Issuing/Transactions.ts +++ b/src/resources/TestHelpers/Issuing/Transactions.ts @@ -16,7 +16,7 @@ export class TransactionResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/issuing/transactions/${id}/refund`, + `/v1/test_helpers/issuing/transactions/${encodeURIComponent(id)}/refund`, params, options, { diff --git a/src/resources/TestHelpers/Refunds.ts b/src/resources/TestHelpers/Refunds.ts index f232bed37e..3afd9b369d 100644 --- a/src/resources/TestHelpers/Refunds.ts +++ b/src/resources/TestHelpers/Refunds.ts @@ -15,7 +15,7 @@ export class RefundResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/refunds/${id}/expire`, + `/v1/test_helpers/refunds/${encodeURIComponent(id)}/expire`, params, options ) as any; diff --git a/src/resources/TestHelpers/Terminal/Readers.ts b/src/resources/TestHelpers/Terminal/Readers.ts index ffcc817e74..ef9cf350b1 100644 --- a/src/resources/TestHelpers/Terminal/Readers.ts +++ b/src/resources/TestHelpers/Terminal/Readers.ts @@ -15,7 +15,9 @@ export class ReaderResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/terminal/readers/${id}/present_payment_method`, + `/v1/test_helpers/terminal/readers/${encodeURIComponent( + id + )}/present_payment_method`, params, options ) as any; @@ -30,7 +32,9 @@ export class ReaderResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/terminal/readers/${id}/succeed_input_collection`, + `/v1/test_helpers/terminal/readers/${encodeURIComponent( + id + )}/succeed_input_collection`, params, options ) as any; @@ -45,7 +49,9 @@ export class ReaderResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/terminal/readers/${id}/timeout_input_collection`, + `/v1/test_helpers/terminal/readers/${encodeURIComponent( + id + )}/timeout_input_collection`, params, options ) as any; diff --git a/src/resources/TestHelpers/TestClocks.ts b/src/resources/TestHelpers/TestClocks.ts index c55665177a..3568c6b4fc 100644 --- a/src/resources/TestHelpers/TestClocks.ts +++ b/src/resources/TestHelpers/TestClocks.ts @@ -15,7 +15,7 @@ export class TestClockResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v1/test_helpers/test_clocks/${id}`, + `/v1/test_helpers/test_clocks/${encodeURIComponent(id)}`, params, options ) as any; @@ -30,7 +30,7 @@ export class TestClockResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/test_helpers/test_clocks/${id}`, + `/v1/test_helpers/test_clocks/${encodeURIComponent(id)}`, params, options ) as any; @@ -76,7 +76,7 @@ export class TestClockResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/test_clocks/${id}/advance`, + `/v1/test_helpers/test_clocks/${encodeURIComponent(id)}/advance`, params, options ) as any; diff --git a/src/resources/TestHelpers/Treasury/InboundTransfers.ts b/src/resources/TestHelpers/Treasury/InboundTransfers.ts index f28488d7bc..ef2d3d7a46 100644 --- a/src/resources/TestHelpers/Treasury/InboundTransfers.ts +++ b/src/resources/TestHelpers/Treasury/InboundTransfers.ts @@ -15,7 +15,9 @@ export class InboundTransferResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/treasury/inbound_transfers/${id}/fail`, + `/v1/test_helpers/treasury/inbound_transfers/${encodeURIComponent( + id + )}/fail`, params, options ) as any; @@ -30,7 +32,9 @@ export class InboundTransferResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/treasury/inbound_transfers/${id}/return`, + `/v1/test_helpers/treasury/inbound_transfers/${encodeURIComponent( + id + )}/return`, params, options ) as any; @@ -45,7 +49,9 @@ export class InboundTransferResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/treasury/inbound_transfers/${id}/succeed`, + `/v1/test_helpers/treasury/inbound_transfers/${encodeURIComponent( + id + )}/succeed`, params, options ) as any; diff --git a/src/resources/TestHelpers/Treasury/OutboundPayments.ts b/src/resources/TestHelpers/Treasury/OutboundPayments.ts index bbfd3c4800..33c37ba101 100644 --- a/src/resources/TestHelpers/Treasury/OutboundPayments.ts +++ b/src/resources/TestHelpers/Treasury/OutboundPayments.ts @@ -15,7 +15,7 @@ export class OutboundPaymentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/treasury/outbound_payments/${id}`, + `/v1/test_helpers/treasury/outbound_payments/${encodeURIComponent(id)}`, params, options ) as any; @@ -30,7 +30,9 @@ export class OutboundPaymentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/treasury/outbound_payments/${id}/fail`, + `/v1/test_helpers/treasury/outbound_payments/${encodeURIComponent( + id + )}/fail`, params, options ) as any; @@ -45,7 +47,9 @@ export class OutboundPaymentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/treasury/outbound_payments/${id}/post`, + `/v1/test_helpers/treasury/outbound_payments/${encodeURIComponent( + id + )}/post`, params, options ) as any; @@ -60,7 +64,9 @@ export class OutboundPaymentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/treasury/outbound_payments/${id}/return`, + `/v1/test_helpers/treasury/outbound_payments/${encodeURIComponent( + id + )}/return`, params, options ) as any; diff --git a/src/resources/TestHelpers/Treasury/OutboundTransfers.ts b/src/resources/TestHelpers/Treasury/OutboundTransfers.ts index 93b541796e..934fbccf9f 100644 --- a/src/resources/TestHelpers/Treasury/OutboundTransfers.ts +++ b/src/resources/TestHelpers/Treasury/OutboundTransfers.ts @@ -15,7 +15,7 @@ export class OutboundTransferResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/treasury/outbound_transfers/${id}`, + `/v1/test_helpers/treasury/outbound_transfers/${encodeURIComponent(id)}`, params, options ) as any; @@ -30,7 +30,9 @@ export class OutboundTransferResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/treasury/outbound_transfers/${id}/fail`, + `/v1/test_helpers/treasury/outbound_transfers/${encodeURIComponent( + id + )}/fail`, params, options ) as any; @@ -45,7 +47,9 @@ export class OutboundTransferResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/treasury/outbound_transfers/${id}/post`, + `/v1/test_helpers/treasury/outbound_transfers/${encodeURIComponent( + id + )}/post`, params, options ) as any; @@ -60,7 +64,9 @@ export class OutboundTransferResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/treasury/outbound_transfers/${id}/return`, + `/v1/test_helpers/treasury/outbound_transfers/${encodeURIComponent( + id + )}/return`, params, options ) as any; diff --git a/src/resources/Tokens.ts b/src/resources/Tokens.ts index 1f8070fea2..b90368b22a 100644 --- a/src/resources/Tokens.ts +++ b/src/resources/Tokens.ts @@ -20,7 +20,12 @@ export class TokenResource extends StripeResource { params?: TokenRetrieveParams, options?: RequestOptions ): Promise> { - return this._makeRequest('GET', `/v1/tokens/${id}`, params, options) as any; + return this._makeRequest( + 'GET', + `/v1/tokens/${encodeURIComponent(id)}`, + params, + options + ) as any; } /** * Creates a single-use token that represents a bank account's details. diff --git a/src/resources/Topups.ts b/src/resources/Topups.ts index b75afed55b..eac382b2b9 100644 --- a/src/resources/Topups.ts +++ b/src/resources/Topups.ts @@ -41,7 +41,12 @@ export class TopupResource extends StripeResource { params?: TopupRetrieveParams, options?: RequestOptions ): Promise> { - return this._makeRequest('GET', `/v1/topups/${id}`, params, options) as any; + return this._makeRequest( + 'GET', + `/v1/topups/${encodeURIComponent(id)}`, + params, + options + ) as any; } /** * Updates the metadata of a top-up. Other top-up details are not editable by design. @@ -53,7 +58,7 @@ export class TopupResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/topups/${id}`, + `/v1/topups/${encodeURIComponent(id)}`, params, options ) as any; @@ -68,7 +73,7 @@ export class TopupResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/topups/${id}/cancel`, + `/v1/topups/${encodeURIComponent(id)}/cancel`, params, options ) as any; diff --git a/src/resources/Transfers.ts b/src/resources/Transfers.ts index d92b8aaa49..e756dced6c 100644 --- a/src/resources/Transfers.ts +++ b/src/resources/Transfers.ts @@ -45,7 +45,7 @@ export class TransferResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/transfers/${id}`, + `/v1/transfers/${encodeURIComponent(id)}`, params, options ) as any; @@ -62,7 +62,7 @@ export class TransferResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/transfers/${id}`, + `/v1/transfers/${encodeURIComponent(id)}`, params, options ) as any; @@ -77,7 +77,7 @@ export class TransferResource extends StripeResource { ): ApiListPromise { return this._makeRequest( 'GET', - `/v1/transfers/${id}/reversals`, + `/v1/transfers/${encodeURIComponent(id)}/reversals`, params, options, { @@ -99,7 +99,7 @@ export class TransferResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/transfers/${id}/reversals`, + `/v1/transfers/${encodeURIComponent(id)}/reversals`, params, options ) as any; @@ -115,7 +115,9 @@ export class TransferResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/transfers/${transferId}/reversals/${id}`, + `/v1/transfers/${encodeURIComponent( + transferId + )}/reversals/${encodeURIComponent(id)}`, params, options ) as any; @@ -133,7 +135,9 @@ export class TransferResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/transfers/${transferId}/reversals/${id}`, + `/v1/transfers/${encodeURIComponent( + transferId + )}/reversals/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Treasury/CreditReversals.ts b/src/resources/Treasury/CreditReversals.ts index 8118360d54..5ef7dff71e 100644 --- a/src/resources/Treasury/CreditReversals.ts +++ b/src/resources/Treasury/CreditReversals.ts @@ -47,7 +47,7 @@ export class CreditReversalResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/treasury/credit_reversals/${id}`, + `/v1/treasury/credit_reversals/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Treasury/DebitReversals.ts b/src/resources/Treasury/DebitReversals.ts index f5acd1b5ee..bd62987e4b 100644 --- a/src/resources/Treasury/DebitReversals.ts +++ b/src/resources/Treasury/DebitReversals.ts @@ -47,7 +47,7 @@ export class DebitReversalResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/treasury/debit_reversals/${id}`, + `/v1/treasury/debit_reversals/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Treasury/FinancialAccounts.ts b/src/resources/Treasury/FinancialAccounts.ts index b3a2327d52..d0cc057d67 100644 --- a/src/resources/Treasury/FinancialAccounts.ts +++ b/src/resources/Treasury/FinancialAccounts.ts @@ -53,7 +53,7 @@ export class FinancialAccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/treasury/financial_accounts/${id}`, + `/v1/treasury/financial_accounts/${encodeURIComponent(id)}`, params, options ) as any; @@ -68,7 +68,7 @@ export class FinancialAccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/treasury/financial_accounts/${id}`, + `/v1/treasury/financial_accounts/${encodeURIComponent(id)}`, params, options ) as any; @@ -83,7 +83,7 @@ export class FinancialAccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/treasury/financial_accounts/${id}/close`, + `/v1/treasury/financial_accounts/${encodeURIComponent(id)}/close`, params, options ) as any; @@ -98,7 +98,7 @@ export class FinancialAccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/treasury/financial_accounts/${id}/features`, + `/v1/treasury/financial_accounts/${encodeURIComponent(id)}/features`, params, options ) as any; @@ -113,7 +113,7 @@ export class FinancialAccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/treasury/financial_accounts/${id}/features`, + `/v1/treasury/financial_accounts/${encodeURIComponent(id)}/features`, params, options ) as any; diff --git a/src/resources/Treasury/InboundTransfers.ts b/src/resources/Treasury/InboundTransfers.ts index c4e8314958..cdc312e200 100644 --- a/src/resources/Treasury/InboundTransfers.ts +++ b/src/resources/Treasury/InboundTransfers.ts @@ -53,7 +53,7 @@ export class InboundTransferResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/treasury/inbound_transfers/${id}`, + `/v1/treasury/inbound_transfers/${encodeURIComponent(id)}`, params, options ) as any; @@ -68,7 +68,7 @@ export class InboundTransferResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/treasury/inbound_transfers/${id}/cancel`, + `/v1/treasury/inbound_transfers/${encodeURIComponent(id)}/cancel`, params, options ) as any; diff --git a/src/resources/Treasury/OutboundPayments.ts b/src/resources/Treasury/OutboundPayments.ts index 863e50a80a..a09c507984 100644 --- a/src/resources/Treasury/OutboundPayments.ts +++ b/src/resources/Treasury/OutboundPayments.ts @@ -56,7 +56,7 @@ export class OutboundPaymentResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/treasury/outbound_payments/${id}`, + `/v1/treasury/outbound_payments/${encodeURIComponent(id)}`, params, options ) as any; @@ -71,7 +71,7 @@ export class OutboundPaymentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/treasury/outbound_payments/${id}/cancel`, + `/v1/treasury/outbound_payments/${encodeURIComponent(id)}/cancel`, params, options ) as any; diff --git a/src/resources/Treasury/OutboundTransfers.ts b/src/resources/Treasury/OutboundTransfers.ts index 637c46a8c1..9a106b53ac 100644 --- a/src/resources/Treasury/OutboundTransfers.ts +++ b/src/resources/Treasury/OutboundTransfers.ts @@ -54,7 +54,7 @@ export class OutboundTransferResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/treasury/outbound_transfers/${id}`, + `/v1/treasury/outbound_transfers/${encodeURIComponent(id)}`, params, options ) as any; @@ -69,7 +69,7 @@ export class OutboundTransferResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/treasury/outbound_transfers/${id}/cancel`, + `/v1/treasury/outbound_transfers/${encodeURIComponent(id)}/cancel`, params, options ) as any; diff --git a/src/resources/Treasury/ReceivedCredits.ts b/src/resources/Treasury/ReceivedCredits.ts index b4621ace0c..e828731efc 100644 --- a/src/resources/Treasury/ReceivedCredits.ts +++ b/src/resources/Treasury/ReceivedCredits.ts @@ -37,7 +37,7 @@ export class ReceivedCreditResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/treasury/received_credits/${id}`, + `/v1/treasury/received_credits/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Treasury/ReceivedDebits.ts b/src/resources/Treasury/ReceivedDebits.ts index 8bc89118aa..dc687b66a8 100644 --- a/src/resources/Treasury/ReceivedDebits.ts +++ b/src/resources/Treasury/ReceivedDebits.ts @@ -33,7 +33,7 @@ export class ReceivedDebitResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/treasury/received_debits/${id}`, + `/v1/treasury/received_debits/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Treasury/TransactionEntries.ts b/src/resources/Treasury/TransactionEntries.ts index 685b1b2536..b85f6b2915 100644 --- a/src/resources/Treasury/TransactionEntries.ts +++ b/src/resources/Treasury/TransactionEntries.ts @@ -238,7 +238,7 @@ export class TransactionEntryResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/treasury/transaction_entries/${id}`, + `/v1/treasury/transaction_entries/${encodeURIComponent(id)}`, params, options, { diff --git a/src/resources/Treasury/Transactions.ts b/src/resources/Treasury/Transactions.ts index 0c094b7ac6..6f3055ff44 100644 --- a/src/resources/Treasury/Transactions.ts +++ b/src/resources/Treasury/Transactions.ts @@ -280,7 +280,7 @@ export class TransactionResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/treasury/transactions/${id}`, + `/v1/treasury/transactions/${encodeURIComponent(id)}`, params, options, { diff --git a/src/resources/V2/Commerce/ProductCatalog/Imports.ts b/src/resources/V2/Commerce/ProductCatalog/Imports.ts index 1ea1f7dc50..b62909961d 100644 --- a/src/resources/V2/Commerce/ProductCatalog/Imports.ts +++ b/src/resources/V2/Commerce/ProductCatalog/Imports.ts @@ -135,7 +135,7 @@ export class ImportResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/commerce/product_catalog/imports/${id}`, + `/v2/commerce/product_catalog/imports/${encodeURIComponent(id)}`, params, options, { diff --git a/src/resources/V2/Core/AccountTokens.ts b/src/resources/V2/Core/AccountTokens.ts index c77ec89955..f6b27848ca 100644 --- a/src/resources/V2/Core/AccountTokens.ts +++ b/src/resources/V2/Core/AccountTokens.ts @@ -57,7 +57,7 @@ export class AccountTokenResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/core/account_tokens/${id}`, + `/v2/core/account_tokens/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/Core/Accounts.ts b/src/resources/V2/Core/Accounts.ts index 0c93da8e52..8911e7fe2a 100644 --- a/src/resources/V2/Core/Accounts.ts +++ b/src/resources/V2/Core/Accounts.ts @@ -122,7 +122,7 @@ export class AccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/core/accounts/${id}`, + `/v2/core/accounts/${encodeURIComponent(id)}`, params, options, { @@ -159,7 +159,7 @@ export class AccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/core/accounts/${id}`, + `/v2/core/accounts/${encodeURIComponent(id)}`, params, options, { @@ -215,7 +215,7 @@ export class AccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/core/accounts/${id}/close`, + `/v2/core/accounts/${encodeURIComponent(id)}/close`, params, options, { diff --git a/src/resources/V2/Core/Accounts/PersonTokens.ts b/src/resources/V2/Core/Accounts/PersonTokens.ts index b3e5aa7313..c53344ae5d 100644 --- a/src/resources/V2/Core/Accounts/PersonTokens.ts +++ b/src/resources/V2/Core/Accounts/PersonTokens.ts @@ -12,13 +12,13 @@ export class PersonTokenResource extends StripeResource { * @throws Stripe.RateLimitError */ create( - id: string, + accountId: string, params?: V2.Core.Accounts.PersonTokenCreateParams, options?: RequestOptions ): Promise> { return this._makeRequest( 'POST', - `/v2/core/accounts/${id}/person_tokens`, + `/v2/core/accounts/${encodeURIComponent(accountId)}/person_tokens`, params, options, { @@ -46,7 +46,9 @@ export class PersonTokenResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/core/accounts/${accountId}/person_tokens/${id}`, + `/v2/core/accounts/${encodeURIComponent( + accountId + )}/person_tokens/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/Core/Accounts/Persons.ts b/src/resources/V2/Core/Accounts/Persons.ts index a96a42748d..b1e5e1bc65 100644 --- a/src/resources/V2/Core/Accounts/Persons.ts +++ b/src/resources/V2/Core/Accounts/Persons.ts @@ -17,13 +17,13 @@ export class PersonResource extends StripeResource { * @throws Stripe.RateLimitError */ list( - id: string, + accountId: string, params?: V2.Core.Accounts.PersonListParams, options?: RequestOptions ): V2ListPromise { return this._makeRequest( 'GET', - `/v2/core/accounts/${id}/persons`, + `/v2/core/accounts/${encodeURIComponent(accountId)}/persons`, params, options, { @@ -53,13 +53,13 @@ export class PersonResource extends StripeResource { * @throws Stripe.RateLimitError */ create( - id: string, + accountId: string, params?: V2.Core.Accounts.PersonCreateParams, options?: RequestOptions ): Promise> { return this._makeRequest( 'POST', - `/v2/core/accounts/${id}/persons`, + `/v2/core/accounts/${encodeURIComponent(accountId)}/persons`, params, options, { @@ -96,7 +96,9 @@ export class PersonResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v2/core/accounts/${accountId}/persons/${id}`, + `/v2/core/accounts/${encodeURIComponent( + accountId + )}/persons/${encodeURIComponent(id)}`, params, options ) as any; @@ -113,7 +115,9 @@ export class PersonResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/core/accounts/${accountId}/persons/${id}`, + `/v2/core/accounts/${encodeURIComponent( + accountId + )}/persons/${encodeURIComponent(id)}`, params, options, { @@ -141,7 +145,9 @@ export class PersonResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/core/accounts/${accountId}/persons/${id}`, + `/v2/core/accounts/${encodeURIComponent( + accountId + )}/persons/${encodeURIComponent(id)}`, params, options, { diff --git a/src/resources/V2/Core/EventDestinations.ts b/src/resources/V2/Core/EventDestinations.ts index d4832a9806..9a3c55936b 100644 --- a/src/resources/V2/Core/EventDestinations.ts +++ b/src/resources/V2/Core/EventDestinations.ts @@ -48,7 +48,7 @@ export class EventDestinationResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v2/core/event_destinations/${id}`, + `/v2/core/event_destinations/${encodeURIComponent(id)}`, params, options ) as any; @@ -63,7 +63,7 @@ export class EventDestinationResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/core/event_destinations/${id}`, + `/v2/core/event_destinations/${encodeURIComponent(id)}`, params, options ) as any; @@ -78,7 +78,7 @@ export class EventDestinationResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/core/event_destinations/${id}`, + `/v2/core/event_destinations/${encodeURIComponent(id)}`, params, options ) as any; @@ -93,7 +93,7 @@ export class EventDestinationResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/core/event_destinations/${id}/disable`, + `/v2/core/event_destinations/${encodeURIComponent(id)}/disable`, params, options ) as any; @@ -108,7 +108,7 @@ export class EventDestinationResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/core/event_destinations/${id}/enable`, + `/v2/core/event_destinations/${encodeURIComponent(id)}/enable`, params, options ) as any; @@ -123,7 +123,7 @@ export class EventDestinationResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/core/event_destinations/${id}/ping`, + `/v2/core/event_destinations/${encodeURIComponent(id)}/ping`, params, options ) as any; diff --git a/src/resources/V2/Core/Events.ts b/src/resources/V2/Core/Events.ts index 08fa987f58..57633bd699 100644 --- a/src/resources/V2/Core/Events.ts +++ b/src/resources/V2/Core/Events.ts @@ -35,9 +35,15 @@ export class EventResource extends StripeResource { const transformResponseData = (response: any): any => { return this.addFetchRelatedObjectIfNeeded(response); }; - return this._makeRequest('GET', `/v2/core/events/${id}`, params, options, { - transformResponseData: transformResponseData, - }) as any; + return this._makeRequest( + 'GET', + `/v2/core/events/${encodeURIComponent(id)}`, + params, + options, + { + transformResponseData: transformResponseData, + } + ) as any; } /** * @private diff --git a/src/resources/WebhookEndpoints.ts b/src/resources/WebhookEndpoints.ts index a8121a030a..2be3a02882 100644 --- a/src/resources/WebhookEndpoints.ts +++ b/src/resources/WebhookEndpoints.ts @@ -20,7 +20,7 @@ export class WebhookEndpointResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v1/webhook_endpoints/${id}`, + `/v1/webhook_endpoints/${encodeURIComponent(id)}`, params, options ) as any; @@ -35,7 +35,7 @@ export class WebhookEndpointResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/webhook_endpoints/${id}`, + `/v1/webhook_endpoints/${encodeURIComponent(id)}`, params, options ) as any; @@ -50,7 +50,7 @@ export class WebhookEndpointResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/webhook_endpoints/${id}`, + `/v1/webhook_endpoints/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/test/resources/Customers.spec.js b/test/resources/Customers.spec.js index 9ae8130c2d..07e129f924 100644 --- a/test/resources/Customers.spec.js +++ b/test/resources/Customers.spec.js @@ -470,4 +470,40 @@ describe('Customers Resource', () => { }); }); }); + + describe('Path parameter encoding', () => { + // these specific methods aren't important, just that they have 1+ path params + it('URL-encodes path separators in IDs', () => { + stripe.customers.retrieve('cus_123/sources'); + expect(stripe.LAST_REQUEST).to.deep.equal({ + method: 'GET', + url: '/v1/customers/cus_123%2Fsources', + headers: {}, + data: null, + settings: {}, + }); + }); + + it('URL-encodes query metacharacters in IDs', () => { + stripe.customers.retrieve('cus_123?expand[]=sources'); + expect(stripe.LAST_REQUEST).to.deep.equal({ + method: 'GET', + url: '/v1/customers/cus_123%3Fexpand%5B%5D%3Dsources', + headers: {}, + data: null, + settings: {}, + }); + }); + + it('URL-encodes both parent and child IDs in nested resources', () => { + stripe.customers.retrieveSource('cus/123', 'card?id'); + expect(stripe.LAST_REQUEST).to.deep.equal({ + method: 'GET', + url: '/v1/customers/cus%2F123/sources/card%3Fid', + headers: {}, + data: null, + settings: {}, + }); + }); + }); }); From ed488fc1e45de0eb37da3edd38175b4622749542 Mon Sep 17 00:00:00 2001 From: David Brownman Date: Fri, 12 Jun 2026 16:15:23 -0700 Subject: [PATCH 2/5] Bump version to 22.2.1 --- CHANGELOG.md | 54 +++++++++++++++++++++++------------------- VERSION | 2 +- package.json | 2 +- src/stripe.core.ts | 2 +- src/stripe.esm.node.ts | 2 +- 5 files changed, 34 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 743068935d..98fd028307 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 22.2.1 - 2026-06-12 +* [#2750](https://github.com/stripe/stripe-node/pull/2750) URI Encode path params +* [#2747](https://github.com/stripe/stripe-node/pull/2747) Fix V2ListIterator: concurrency guard and empty page handling +* [#2740](https://github.com/stripe/stripe-node/pull/2740) Add "source" field to user-agent header +* [#2734](https://github.com/stripe/stripe-node/pull/2734) Fix parseHttpHeaderAsNumber to return undefined instead of NaN + ## 22.2.0 - 2026-05-27 This release changes the pinned API version to 2026-05-27.dahlia. @@ -58,22 +64,22 @@ This release changes the pinned API version to 2026-05-27.dahlia. * Adds `V2List` and `V2ListPromise` types to represent API v2 list responses. These types include deprecated fields from the previously returned list shapes. These fields will be removed in the next major release. * [#2715](https://github.com/stripe/stripe-node/pull/2715) Add WinterTC compatibility ESLint rule * [#2711](https://github.com/stripe/stripe-node/pull/2711) Export manually maintained types for OAuthToken and OAuth param classes - ```ts - // ❌ Before (v22.0.0-v22.1.1) - const oAuthToken: Stripe.OAuthToken = {}; - - // ✅ After (works on v22.1.2+) - const oAuthToken: Stripe.OAuthToken = {}; + ```ts + // ❌ Before (v22.0.0-v22.1.1) + const oAuthToken: Stripe.OAuthToken = {}; + + // ✅ After (works on v22.1.2+) + const oAuthToken: Stripe.OAuthToken = {}; ``` * [#2712](https://github.com/stripe/stripe-node/pull/2712) Exported types for nested param classes - * Types inside nested param class namespaces(e.g. `Stripe.V2.Core.AccountCreateParams.Configuration`, `Stripe.V2.Core.AccountCreateParams.Dashboard`) are now accessible. + * Types inside nested param class namespaces(e.g. `Stripe.V2.Core.AccountCreateParams.Configuration`, `Stripe.V2.Core.AccountCreateParams.Dashboard`) are now accessible. ## 22.1.1 - 2026-05-06 * [#2703](https://github.com/stripe/stripe-node/pull/2703) Export Decimal type from Stripe namespace - + - Added `Stripe.Decimal` as a usable type in the `Stripe` namespace, enabling type annotations like `function takesDecimal(d: Stripe.Decimal)`. * [#2704](https://github.com/stripe/stripe-node/pull/2704) Fix file upload regression: restore multipart request data processor - + - Fixed file uploads failing with `StripeInvalidRequestError` on the `/v1/files` endpoint since v22. ## 22.1.0 - 2026-04-23 @@ -124,32 +130,32 @@ This release changes the pinned API version to 2026-04-22.dahlia. ## 22.0.2 - 2026-04-16 * [#2685](https://github.com/stripe/stripe-node/pull/2685) Adds `parseEventNotificationAsync` to match existing sync function * [#2681](https://github.com/stripe/stripe-node/pull/2681) Add emitEventBodies config to include bodies in request/response events - - Added `emitEventBodies` config option to include request and response bodies in `request`/`response` events. + - Added `emitEventBodies` config option to include request and response bodies in `request`/`response` events. - Changed `httpClient` config type from `HttpClient` class to `HttpClientInterface` interface. * [#2670](https://github.com/stripe/stripe-node/pull/2670) tolerance, receivedAt, timestamp are now optional in Webhook.ts * [#2677](https://github.com/stripe/stripe-node/pull/2677) Fixed named export for Bun - ```ts - // ✅ Fixed - import { Stripe } from 'stripe'; + ```ts + // ✅ Fixed + import { Stripe } from 'stripe'; ``` ## 22.0.1 - 2026-04-08 * [#2669](https://github.com/stripe/stripe-node/pull/2669) Add constructor based initialization for CJS based TypeScript imports - * Initialization of Stripe class with `new` keyword is now possible for CJS based TypeScript project. Resolves: [2660](https://github.com/stripe/stripe-node/issues/2660) - ```ts - import Stripe = require('stripe'); - // ✅ Both statements work - const stripeNew: Stripe.Stripe = new Stripe('sk_test_...'); - const stripeCalled: Stripe.Stripe = Stripe('sk_test_...'); + * Initialization of Stripe class with `new` keyword is now possible for CJS based TypeScript project. Resolves: [2660](https://github.com/stripe/stripe-node/issues/2660) + ```ts + import Stripe = require('stripe'); + // ✅ Both statements work + const stripeNew: Stripe.Stripe = new Stripe('sk_test_...'); + const stripeCalled: Stripe.Stripe = Stripe('sk_test_...'); ``` * [#2664](https://github.com/stripe/stripe-node/pull/2664) Fixed nested service param exports in the Stripe namespace * Resolves: [2658](https://github.com/stripe/stripe-node/issues/2658), [2662](https://github.com/stripe/stripe-node/issues/2662) * [#2667](https://github.com/stripe/stripe-node/pull/2667) Add type safety to Stripe constructor config (no runtime change) - - Fixed some compile-time checks (no runtime changes) - - Fixed `Stripe` constructor config parameter to use `StripeConfig` type instead of `Record`, restoring compile-time type safety. - - Added missing `authenticator` property to `StripeConfig`. - - Fixed `Stripe.API_VERSION` to retain the literal API version type. - - Fixed `StripeConfig.stripeContext` to accept `StripeContext` objects in addition to strings. + - Fixed some compile-time checks (no runtime changes) + - Fixed `Stripe` constructor config parameter to use `StripeConfig` type instead of `Record`, restoring compile-time type safety. + - Added missing `authenticator` property to `StripeConfig`. + - Fixed `Stripe.API_VERSION` to retain the literal API version type. + - Fixed `StripeConfig.stripeContext` to accept `StripeContext` objects in addition to strings. * [#2663](https://github.com/stripe/stripe-node/pull/2663) Throw a more descriptive error when calling `rawRequest` with absolute urls * [#2652](https://github.com/stripe/stripe-node/pull/2652) Added `string[]` to `WebhookHeader` type for compatibility with express * Added `string[]` to the type of `signature` param in `stripe.webhooks.construct_event` method. diff --git a/VERSION b/VERSION index 44e031ba9b..0398faf11c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -22.2.0 +22.2.1 diff --git a/package.json b/package.json index 9d201f4e84..f3d39b60ca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stripe", - "version": "22.2.0", + "version": "22.2.1", "description": "Stripe API wrapper", "keywords": [ "stripe", diff --git a/src/stripe.core.ts b/src/stripe.core.ts index fb23db6f0a..d26d23ecb8 100644 --- a/src/stripe.core.ts +++ b/src/stripe.core.ts @@ -947,7 +947,7 @@ const defaultRequestSenderFactory: RequestSenderFactory = (stripe) => new RequestSender(stripe, StripeResource.MAX_BUFFERED_REQUEST_METRICS); export class Stripe { - static PACKAGE_VERSION = '22.2.0'; + static PACKAGE_VERSION = '22.2.1'; static API_VERSION: typeof ApiVersion = ApiVersion; static aiAgent = ''; static AI_AGENT = ''; diff --git a/src/stripe.esm.node.ts b/src/stripe.esm.node.ts index f5ef936278..9016ad7f5c 100644 --- a/src/stripe.esm.node.ts +++ b/src/stripe.esm.node.ts @@ -948,7 +948,7 @@ const defaultRequestSenderFactory: RequestSenderFactory = (stripe) => new RequestSender(stripe, StripeResource.MAX_BUFFERED_REQUEST_METRICS); export class Stripe { - static PACKAGE_VERSION = '22.2.0'; + static PACKAGE_VERSION = '22.2.1'; static API_VERSION: typeof ApiVersion = ApiVersion; static aiAgent = ''; static AI_AGENT = ''; From d3b8ecd0a3b75a11c387b3664ce9dab69e88430c Mon Sep 17 00:00:00 2001 From: jar-stripe Date: Fri, 12 Jun 2026 16:49:47 -0700 Subject: [PATCH 3/5] Remove retired manual API tests covered by generated examples (#2752) Remove retired manual API tests fully covered by generated examples Committed-By-Agent: claude Co-authored-by: Claude Sonnet 4.6 --- test/resources/AccountLinks.spec.js | 30 --- test/resources/ApplicationFees.spec.js | 74 ------- test/resources/BalanceTransactions.spec.js | 32 --- .../BillingPortal/Configurations.spec.js | 73 ------- test/resources/BillingPortal/Sessions.spec.js | 27 --- test/resources/Charges.spec.js | 87 -------- test/resources/Checkout/Sessions.spec.js | 68 ------ test/resources/CountrySpecs.spec.js | 33 --- test/resources/Coupons.spec.js | 84 -------- test/resources/CreditNotes.spec.js | 119 ----------- test/resources/Disputes.spec.js | 58 ----- test/resources/Events.spec.js | 32 --- test/resources/FileLinks.spec.js | 58 ----- .../Identity/VerificationReport.spec.js | 34 --- .../Identity/VerificationSession.spec.js | 96 --------- test/resources/InvoiceItems.spec.js | 75 ------- test/resources/Invoices.spec.js | 151 ------------- test/resources/Issuing/Authorization.spec.js | 83 -------- test/resources/Issuing/Cardholders.spec.js | 80 ------- test/resources/Issuing/Cards.spec.js | 78 ------- test/resources/Issuing/Disputes.spec.js | 99 --------- test/resources/Issuing/Transactions.spec.js | 59 ------ test/resources/Mandates.spec.js | 21 -- test/resources/PaymentIntents.spec.js | 106 ---------- test/resources/PaymentMethods.spec.js | 94 --------- test/resources/Payouts.spec.js | 91 -------- test/resources/Plans.spec.js | 137 ------------ test/resources/Prices.spec.js | 78 ------- test/resources/Products.spec.js | 94 --------- test/resources/PromotionCodes.spec.js | 69 ------ .../Radar/EarlyFraudWarnings.spec.js | 34 --- test/resources/Radar/ValueListItems.spec.js | 70 ------- test/resources/Radar/ValueLists.spec.js | 85 -------- test/resources/Refunds.spec.js | 65 ------ test/resources/Reporting/ReportRuns.spec.js | 59 ------ test/resources/Reporting/ReportTypes.spec.js | 36 ---- test/resources/Reviews.spec.js | 45 ---- test/resources/SetupAttempts.spec.js | 19 -- test/resources/SetupIntents.spec.js | 91 -------- .../Sigma/ScheduledQueryRuns.spec.js | 34 --- test/resources/SubscriptionItems.spec.js | 85 -------- test/resources/SubscriptionSchedule.spec.js | 96 --------- test/resources/Subscriptions.spec.js | 198 ------------------ test/resources/TaxCodes.spec.js | 32 --- test/resources/TaxRates.spec.js | 67 ------ .../Terminal/ConnectionTokens.spec.js | 22 -- test/resources/Terminal/Locations.spec.js | 97 --------- test/resources/Terminal/Readers.spec.js | 85 -------- .../TestHelpers/Terminal/Readers.spec.js | 23 -- test/resources/Tokens.spec.js | 34 --- test/resources/Topups.spec.js | 83 -------- test/resources/Transfers.spec.js | 64 ------ test/resources/WebhookEndpoints.spec.js | 82 -------- 53 files changed, 3726 deletions(-) delete mode 100644 test/resources/AccountLinks.spec.js delete mode 100644 test/resources/ApplicationFees.spec.js delete mode 100644 test/resources/BalanceTransactions.spec.js delete mode 100644 test/resources/BillingPortal/Configurations.spec.js delete mode 100644 test/resources/BillingPortal/Sessions.spec.js delete mode 100644 test/resources/Charges.spec.js delete mode 100644 test/resources/Checkout/Sessions.spec.js delete mode 100644 test/resources/CountrySpecs.spec.js delete mode 100644 test/resources/Coupons.spec.js delete mode 100644 test/resources/CreditNotes.spec.js delete mode 100644 test/resources/Disputes.spec.js delete mode 100644 test/resources/Events.spec.js delete mode 100644 test/resources/FileLinks.spec.js delete mode 100644 test/resources/Identity/VerificationReport.spec.js delete mode 100644 test/resources/Identity/VerificationSession.spec.js delete mode 100644 test/resources/InvoiceItems.spec.js delete mode 100644 test/resources/Invoices.spec.js delete mode 100644 test/resources/Issuing/Authorization.spec.js delete mode 100644 test/resources/Issuing/Cardholders.spec.js delete mode 100644 test/resources/Issuing/Cards.spec.js delete mode 100644 test/resources/Issuing/Disputes.spec.js delete mode 100644 test/resources/Issuing/Transactions.spec.js delete mode 100644 test/resources/Mandates.spec.js delete mode 100644 test/resources/PaymentIntents.spec.js delete mode 100644 test/resources/PaymentMethods.spec.js delete mode 100644 test/resources/Payouts.spec.js delete mode 100644 test/resources/Plans.spec.js delete mode 100644 test/resources/Prices.spec.js delete mode 100644 test/resources/Products.spec.js delete mode 100644 test/resources/PromotionCodes.spec.js delete mode 100644 test/resources/Radar/EarlyFraudWarnings.spec.js delete mode 100644 test/resources/Radar/ValueListItems.spec.js delete mode 100644 test/resources/Radar/ValueLists.spec.js delete mode 100644 test/resources/Refunds.spec.js delete mode 100644 test/resources/Reporting/ReportRuns.spec.js delete mode 100644 test/resources/Reporting/ReportTypes.spec.js delete mode 100644 test/resources/Reviews.spec.js delete mode 100644 test/resources/SetupAttempts.spec.js delete mode 100644 test/resources/SetupIntents.spec.js delete mode 100644 test/resources/Sigma/ScheduledQueryRuns.spec.js delete mode 100644 test/resources/SubscriptionItems.spec.js delete mode 100644 test/resources/SubscriptionSchedule.spec.js delete mode 100644 test/resources/Subscriptions.spec.js delete mode 100644 test/resources/TaxCodes.spec.js delete mode 100644 test/resources/TaxRates.spec.js delete mode 100644 test/resources/Terminal/ConnectionTokens.spec.js delete mode 100644 test/resources/Terminal/Locations.spec.js delete mode 100644 test/resources/Terminal/Readers.spec.js delete mode 100644 test/resources/TestHelpers/Terminal/Readers.spec.js delete mode 100644 test/resources/Tokens.spec.js delete mode 100644 test/resources/Topups.spec.js delete mode 100644 test/resources/Transfers.spec.js delete mode 100644 test/resources/WebhookEndpoints.spec.js diff --git a/test/resources/AccountLinks.spec.js b/test/resources/AccountLinks.spec.js deleted file mode 100644 index 3c762631e1..0000000000 --- a/test/resources/AccountLinks.spec.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('AccountLinks Resource', () => { - describe('create', () => { - it('Sends the correct request', () => { - stripe.accountLinks.create({ - account: 'acct_123', - failure_url: 'https://stripe.com/failure', - success_url: 'https://stripe.com/success', - type: 'custom_account_verification', - }); - - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/account_links', - headers: {}, - data: { - account: 'acct_123', - failure_url: 'https://stripe.com/failure', - success_url: 'https://stripe.com/success', - type: 'custom_account_verification', - }, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/ApplicationFees.spec.js b/test/resources/ApplicationFees.spec.js deleted file mode 100644 index 00c474fbdd..0000000000 --- a/test/resources/ApplicationFees.spec.js +++ /dev/null @@ -1,74 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('ApplicationFee Resource', () => { - describe('list', () => { - it('Sends the correct request', () => { - stripe.applicationFees.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/application_fees', - data: null, - headers: {}, - settings: {}, - }); - }); - }); - - describe('refunds', () => { - it('Sends the correct update request', () => { - stripe.applicationFees.updateRefund( - 'appFeeIdExample3242', - 'refundIdExample2312', - {metadata: {key: 'value'}} - ); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: - '/v1/application_fees/appFeeIdExample3242/refunds/refundIdExample2312', - data: {metadata: {key: 'value'}}, - headers: {}, - settings: {}, - }); - }); - - it('Sends the correct create request', () => { - stripe.applicationFees.createRefund('appFeeIdExample3242', {amount: 100}); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/application_fees/appFeeIdExample3242/refunds', - data: {amount: 100}, - headers: {}, - settings: {}, - }); - }); - - it('Sends the correct list request', () => { - stripe.applicationFees.listRefunds('appFeeIdExample3242'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/application_fees/appFeeIdExample3242/refunds', - data: null, - headers: {}, - settings: {}, - }); - }); - - it('Sends the correct retrieve request', () => { - stripe.applicationFees.retrieveRefund( - 'appFeeIdExample3242', - 'refundIdExample2312' - ); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: - '/v1/application_fees/appFeeIdExample3242/refunds/refundIdExample2312', - data: null, - headers: {}, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/BalanceTransactions.spec.js b/test/resources/BalanceTransactions.spec.js deleted file mode 100644 index 66b64d8622..0000000000 --- a/test/resources/BalanceTransactions.spec.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('BalanceTransactions Resource', function() { - describe('retrieve', function() { - it('Sends the correct request', function() { - stripe.balanceTransactions.retrieve('txn_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/balance_transactions/txn_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('list', function() { - it('Sends the correct request', function() { - stripe.balanceTransactions.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/balance_transactions', - headers: {}, - data: null, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/BillingPortal/Configurations.spec.js b/test/resources/BillingPortal/Configurations.spec.js deleted file mode 100644 index 6838ee16d6..0000000000 --- a/test/resources/BillingPortal/Configurations.spec.js +++ /dev/null @@ -1,73 +0,0 @@ -'use strict'; - -const stripe = require('../../testUtils.js').getSpyableStripe(); - -const expect = require('chai').expect; - -describe('BillingPortal', () => { - describe('Configurations Resource', () => { - describe('create', () => { - it('Sends the correct request', () => { - const params = { - business_profile: { - privacy_policy_url: 'https://example.com/privacy', - terms_of_service_url: 'https://example.com/tos', - }, - features: { - customer_update: { - allowed_updates: ['address'], - enabled: true, - }, - }, - }; - stripe.billingPortal.configurations.create(params); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/billing_portal/configurations', - headers: {}, - data: params, - settings: {}, - }); - }); - }); - describe('update', () => { - it('Sends the correct request', () => { - const params = { - active: false, - }; - stripe.billingPortal.configurations.update('bpc_123', params); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/billing_portal/configurations/bpc_123', - headers: {}, - data: params, - settings: {}, - }); - }); - }); - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.billingPortal.configurations.retrieve('bpc_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/billing_portal/configurations/bpc_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - describe('list', () => { - it('Sends the correct request', () => { - stripe.billingPortal.configurations.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/billing_portal/configurations', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - }); -}); diff --git a/test/resources/BillingPortal/Sessions.spec.js b/test/resources/BillingPortal/Sessions.spec.js deleted file mode 100644 index 7676d76a60..0000000000 --- a/test/resources/BillingPortal/Sessions.spec.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -const stripe = require('../../testUtils.js').getSpyableStripe(); - -const expect = require('chai').expect; - -describe('BillingPortal', () => { - describe('Sessions Resource', () => { - describe('create', () => { - it('Sends the correct request', () => { - const params = { - customer: 'cus_123', - return_url: 'https://stripe.com/return', - }; - stripe.billingPortal.sessions.create(params); - - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/billing_portal/sessions', - headers: {}, - data: params, - settings: {}, - }); - }); - }); - }); -}); diff --git a/test/resources/Charges.spec.js b/test/resources/Charges.spec.js deleted file mode 100644 index 5007323987..0000000000 --- a/test/resources/Charges.spec.js +++ /dev/null @@ -1,87 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('Charge Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.charges.retrieve('chargeIdFoo123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/charges/chargeIdFoo123', - data: null, - headers: {}, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - stripe.charges.create({ - amount: '1500', - currency: 'usd', - shipping: { - address: { - line1: 'foo', - }, - }, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/charges', - data: { - amount: '1500', - currency: 'usd', - shipping: { - address: { - line1: 'foo', - }, - }, - }, - headers: {}, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.charges.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/charges', - data: null, - headers: {}, - settings: {}, - }); - }); - }); - - describe('capture', () => { - it('Sends the correct request', () => { - stripe.charges.capture('chargeIdExample3242', {amount: 23}); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/charges/chargeIdExample3242/capture', - headers: {}, - data: {amount: 23}, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.charges.update('chargeIdExample3242', {description: 'foo321'}); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/charges/chargeIdExample3242', - headers: {}, - data: {description: 'foo321'}, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/Checkout/Sessions.spec.js b/test/resources/Checkout/Sessions.spec.js deleted file mode 100644 index 465b67bfce..0000000000 --- a/test/resources/Checkout/Sessions.spec.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; - -const stripe = require('../../testUtils.js').getSpyableStripe(); - -const expect = require('chai').expect; - -describe('Checkout', () => { - describe('Sessions Resource', () => { - describe('create', () => { - it('Sends the correct request', () => { - const params = { - cancel_url: 'https://stripe.com/cancel', - client_reference_id: '1234', - line_items: [ - { - amount: 123, - currency: 'usd', - description: 'item 1', - images: ['https://stripe.com/img1'], - name: 'name', - quantity: 2, - }, - ], - payment_intent_data: { - receipt_email: 'test@stripe.com', - }, - payment_method_types: ['card'], - success_url: 'https://stripe.com/success', - }; - stripe.checkout.sessions.create(params); - - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/checkout/sessions', - headers: {}, - data: params, - settings: {}, - }); - }); - }); - - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.checkout.sessions.retrieve('cs_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/checkout/sessions/cs_123', - data: null, - headers: {}, - settings: {}, - }); - }); - }); - - describe('listLineItems', () => { - it('Sends the correct request', () => { - stripe.checkout.sessions.listLineItems('cs_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/checkout/sessions/cs_123/line_items', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - }); -}); diff --git a/test/resources/CountrySpecs.spec.js b/test/resources/CountrySpecs.spec.js deleted file mode 100644 index 7ec709589c..0000000000 --- a/test/resources/CountrySpecs.spec.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('CountrySpecs Resource', () => { - describe('list', () => { - it('Sends the correct request', () => { - stripe.countrySpecs.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/country_specs', - data: null, - headers: {}, - settings: {}, - }); - }); - }); - - describe('retrieve', () => { - it('Sends the correct request', () => { - const country = 'US'; - stripe.countrySpecs.retrieve(country); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: `/v1/country_specs/${country}`, - data: null, - headers: {}, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/Coupons.spec.js b/test/resources/Coupons.spec.js deleted file mode 100644 index 35bd3a2e62..0000000000 --- a/test/resources/Coupons.spec.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('Coupons Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.coupons.retrieve('couponId123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/coupons/couponId123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('del', () => { - it('Sends the correct request', () => { - stripe.coupons.del('couponId123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'DELETE', - url: '/v1/coupons/couponId123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.coupons.update('couponId123', { - metadata: {a: '1234'}, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/coupons/couponId123', - headers: {}, - data: { - metadata: {a: '1234'}, - }, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - stripe.coupons.create({ - percent_off: 25, - duration: 'repeating', - duration_in_months: 4, - }); - - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/coupons', - headers: {}, - data: { - percent_off: 25, - duration: 'repeating', - duration_in_months: 4, - }, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.coupons.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/coupons', - headers: {}, - data: null, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/CreditNotes.spec.js b/test/resources/CreditNotes.spec.js deleted file mode 100644 index 72b8a01ad6..0000000000 --- a/test/resources/CreditNotes.spec.js +++ /dev/null @@ -1,119 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('CreditNotes Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.creditNotes.retrieve('cn_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/credit_notes/cn_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - const data = { - amount: 100, - invoice: 'in_123', - reason: 'duplicate', - }; - stripe.creditNotes.create(data); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/credit_notes', - headers: {}, - data, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.creditNotes.list({count: 25}); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/credit_notes?count=25', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('listLineItems', () => { - it('Sends the correct request', () => { - stripe.creditNotes.listLineItems('cn_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/credit_notes/cn_123/lines', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('listPreviewLineItems', () => { - it('Sends the correct request', () => { - stripe.creditNotes.listPreviewLineItems(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/credit_notes/preview/lines', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.creditNotes.update('cn_123', {application_fee: 200}); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/credit_notes/cn_123', - headers: {}, - data: {application_fee: 200}, - settings: {}, - }); - }); - }); - - describe('preview', () => { - it('Sends the correct request', () => { - const data = { - amount: 100, - invoice: 'in_123', - }; - stripe.creditNotes.preview(data); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/credit_notes/preview?amount=100&invoice=in_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('voidCreditNote', () => { - it('Sends the correct request', () => { - stripe.creditNotes.voidCreditNote('cn_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/credit_notes/cn_123/void', - headers: {}, - data: {}, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/Disputes.spec.js b/test/resources/Disputes.spec.js deleted file mode 100644 index 5500113eb6..0000000000 --- a/test/resources/Disputes.spec.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('Dispute Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.disputes.retrieve('dp_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/disputes/dp_123', - data: null, - headers: {}, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.disputes.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/disputes', - data: null, - headers: {}, - settings: {}, - }); - }); - }); - - describe('close', () => { - it('Sends the correct request', () => { - stripe.disputes.close('dp_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/disputes/dp_123/close', - headers: {}, - data: {}, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.disputes.update('dp_123', {evidence: {customer_name: 'Bob'}}); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/disputes/dp_123', - headers: {}, - data: {evidence: {customer_name: 'Bob'}}, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/Events.spec.js b/test/resources/Events.spec.js deleted file mode 100644 index b51581b032..0000000000 --- a/test/resources/Events.spec.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('Events Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.events.retrieve('eventIdBaz'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/events/eventIdBaz', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.events.list({count: 25}); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/events?count=25', - headers: {}, - data: null, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/FileLinks.spec.js b/test/resources/FileLinks.spec.js deleted file mode 100644 index a927f39e4d..0000000000 --- a/test/resources/FileLinks.spec.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('FileLinks Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.fileLinks.retrieve('link_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/file_links/link_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - stripe.fileLinks.create({file: 'file_123'}); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/file_links', - headers: {}, - data: {file: 'file_123'}, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.fileLinks.update('link_123', {metadata: {key: 'value'}}); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/file_links/link_123', - headers: {}, - data: {metadata: {key: 'value'}}, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.fileLinks.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/file_links', - headers: {}, - data: null, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/Identity/VerificationReport.spec.js b/test/resources/Identity/VerificationReport.spec.js deleted file mode 100644 index 2649072eb5..0000000000 --- a/test/resources/Identity/VerificationReport.spec.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -const stripe = require('../../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('Identity', () => { - describe('VerificationReport Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.identity.verificationReports.retrieve('vr_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/identity/verification_reports/vr_123', - data: null, - headers: {}, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.identity.verificationReports.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/identity/verification_reports', - data: null, - headers: {}, - settings: {}, - }); - }); - }); - }); -}); diff --git a/test/resources/Identity/VerificationSession.spec.js b/test/resources/Identity/VerificationSession.spec.js deleted file mode 100644 index 6f033891b6..0000000000 --- a/test/resources/Identity/VerificationSession.spec.js +++ /dev/null @@ -1,96 +0,0 @@ -'use strict'; - -const stripe = require('../../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('Identity', () => { - describe('VerificationSession Resource', () => { - describe('create', () => { - it('Sends the correct request', () => { - stripe.identity.verificationSessions.create({type: 'id_number'}); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/identity/verification_sessions', - data: {type: 'id_number'}, - headers: {}, - settings: {}, - }); - }); - }); - - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.identity.verificationSessions.retrieve('vs_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/identity/verification_sessions/vs_123', - data: null, - headers: {}, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.identity.verificationSessions.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/identity/verification_sessions', - data: null, - headers: {}, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.identity.verificationSessions.update('vs_123', { - metadata: { - thing1: true, - thing2: 'yes', - }, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/identity/verification_sessions/vs_123', - headers: {}, - data: { - metadata: { - thing1: true, - thing2: 'yes', - }, - }, - settings: {}, - }); - }); - }); - - describe('cancel', () => { - it('Sends the correct request', () => { - stripe.identity.verificationSessions.cancel('vs_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/identity/verification_sessions/vs_123/cancel', - headers: {}, - data: {}, - settings: {}, - }); - }); - }); - - describe('redact', () => { - it('Sends the correct request', () => { - stripe.identity.verificationSessions.redact('vs_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/identity/verification_sessions/vs_123/redact', - headers: {}, - data: {}, - settings: {}, - }); - }); - }); - }); -}); diff --git a/test/resources/InvoiceItems.spec.js b/test/resources/InvoiceItems.spec.js deleted file mode 100644 index d0e0f7c8d9..0000000000 --- a/test/resources/InvoiceItems.spec.js +++ /dev/null @@ -1,75 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('InvoiceItems Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.invoiceItems.retrieve('invoiceItemIdTesting123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/invoiceitems/invoiceItemIdTesting123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - stripe.invoiceItems.create({ - customer: 'cust_id_888', - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/invoiceitems', - headers: {}, - data: {customer: 'cust_id_888'}, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.invoiceItems.update('invoiceItemId1', { - amount: 1900, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/invoiceitems/invoiceItemId1', - headers: {}, - data: {amount: 1900}, - settings: {}, - }); - }); - }); - - describe('del', () => { - it('Sends the correct request', () => { - stripe.invoiceItems.del('invoiceItemId2'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'DELETE', - url: '/v1/invoiceitems/invoiceItemId2', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.invoiceItems.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/invoiceitems', - headers: {}, - data: null, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/Invoices.spec.js b/test/resources/Invoices.spec.js deleted file mode 100644 index 6a6b0798ec..0000000000 --- a/test/resources/Invoices.spec.js +++ /dev/null @@ -1,151 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('Invoices Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.invoices.retrieve('in_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/invoices/in_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - stripe.invoices.create({application_fee: 111}); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/invoices', - headers: {}, - data: {application_fee: 111}, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.invoices.list({count: 25}); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/invoices?count=25', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.invoices.update('in_123', {application_fee: 200}); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/invoices/in_123', - headers: {}, - data: {application_fee: 200}, - settings: {}, - }); - }); - }); - - describe('del', () => { - it('Sends the correct request', () => { - stripe.invoices.del('in_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'DELETE', - url: '/v1/invoices/in_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('listLineItems', () => { - it('Sends the correct request', () => { - stripe.invoices.listLineItems('in_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/invoices/in_123/lines', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('finalizeInvoice', () => { - it('Sends the correct request', () => { - stripe.invoices.finalizeInvoice('in_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/invoices/in_123/finalize', - headers: {}, - data: {}, - settings: {}, - }); - }); - }); - - describe('mark uncollectible', () => { - it('Sends the correct request', () => { - stripe.invoices.markUncollectible('in_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/invoices/in_123/mark_uncollectible', - headers: {}, - data: {}, - settings: {}, - }); - }); - }); - - describe('pay', () => { - it('Sends the correct request', () => { - stripe.invoices.pay('in_123', { - source: 'tok_FooBar', - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/invoices/in_123/pay', - headers: {}, - data: {source: 'tok_FooBar'}, - settings: {}, - }); - }); - }); - - describe('sendInvoice', () => { - it('Sends the correct request', () => { - stripe.invoices.sendInvoice('in_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/invoices/in_123/send', - headers: {}, - data: {}, - settings: {}, - }); - }); - }); - - describe('voidInvoice', () => { - it('Sends the correct request', () => { - stripe.invoices.voidInvoice('in_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/invoices/in_123/void', - headers: {}, - data: {}, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/Issuing/Authorization.spec.js b/test/resources/Issuing/Authorization.spec.js deleted file mode 100644 index 77fac6ecc0..0000000000 --- a/test/resources/Issuing/Authorization.spec.js +++ /dev/null @@ -1,83 +0,0 @@ -'use strict'; - -const stripe = require('../../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('Issuing', () => { - describe('Authorization Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.issuing.authorizations.retrieve('iauth_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/issuing/authorizations/iauth_123', - data: null, - headers: {}, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.issuing.authorizations.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/issuing/authorizations', - data: null, - headers: {}, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.issuing.authorizations.update('iauth_123', { - metadata: { - thing1: true, - thing2: 'yes', - }, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/issuing/authorizations/iauth_123', - headers: {}, - data: { - metadata: { - thing1: true, - thing2: 'yes', - }, - }, - settings: {}, - }); - }); - }); - - describe('approve', () => { - it('Sends the correct request', () => { - stripe.issuing.authorizations.approve('iauth_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/issuing/authorizations/iauth_123/approve', - headers: {}, - data: {}, - settings: {}, - }); - }); - }); - - describe('decline', () => { - it('Sends the correct request', () => { - stripe.issuing.authorizations.decline('iauth_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/issuing/authorizations/iauth_123/decline', - headers: {}, - data: {}, - settings: {}, - }); - }); - }); - }); -}); diff --git a/test/resources/Issuing/Cardholders.spec.js b/test/resources/Issuing/Cardholders.spec.js deleted file mode 100644 index 6986aff663..0000000000 --- a/test/resources/Issuing/Cardholders.spec.js +++ /dev/null @@ -1,80 +0,0 @@ -'use strict'; - -const stripe = require('../../testUtils.js').getSpyableStripe(); - -const expect = require('chai').expect; - -describe('Issuing', () => { - describe('Cardholders Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.issuing.cardholders.retrieve('ich_123'); - - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/issuing/cardholders/ich_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - stripe.issuing.cardholders.create({ - billing: {}, - name: 'Tim Testperson', - type: 'individual', - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/issuing/cardholders', - headers: {}, - data: { - billing: {}, - name: 'Tim Testperson', - type: 'individual', - }, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.issuing.cardholders.update('ich_123', { - metadata: { - thing1: true, - thing2: 'yes', - }, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/issuing/cardholders/ich_123', - headers: {}, - data: { - metadata: { - thing1: true, - thing2: 'yes', - }, - }, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.issuing.cardholders.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/issuing/cardholders', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - }); -}); diff --git a/test/resources/Issuing/Cards.spec.js b/test/resources/Issuing/Cards.spec.js deleted file mode 100644 index 45ea750031..0000000000 --- a/test/resources/Issuing/Cards.spec.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; - -const stripe = require('../../testUtils.js').getSpyableStripe(); - -const expect = require('chai').expect; - -describe('Issuing', () => { - describe('Cards Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.issuing.cards.retrieve('ic_123'); - - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/issuing/cards/ic_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - stripe.issuing.cards.create({ - currency: 'usd', - type: 'physical', - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/issuing/cards', - headers: {}, - data: { - currency: 'usd', - type: 'physical', - }, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.issuing.cards.update('ic_123', { - metadata: { - thing1: true, - thing2: 'yes', - }, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/issuing/cards/ic_123', - headers: {}, - data: { - metadata: { - thing1: true, - thing2: 'yes', - }, - }, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.issuing.cards.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/issuing/cards', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - }); -}); diff --git a/test/resources/Issuing/Disputes.spec.js b/test/resources/Issuing/Disputes.spec.js deleted file mode 100644 index 49a9804b36..0000000000 --- a/test/resources/Issuing/Disputes.spec.js +++ /dev/null @@ -1,99 +0,0 @@ -'use strict'; - -const stripe = require('../../testUtils.js').getSpyableStripe(); - -const expect = require('chai').expect; - -describe('Issuing', () => { - describe('Disputes Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.issuing.disputes.retrieve('idp_123'); - - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/issuing/disputes/idp_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - stripe.issuing.disputes.create({ - transaction: 'ipi_123', - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/issuing/disputes', - headers: {}, - data: { - transaction: 'ipi_123', - }, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.issuing.disputes.update('idp_123', { - metadata: { - thing1: true, - thing2: 'yes', - }, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/issuing/disputes/idp_123', - headers: {}, - data: { - metadata: { - thing1: true, - thing2: 'yes', - }, - }, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.issuing.disputes.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/issuing/disputes', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('submit', () => { - it('Sends the correct request', () => { - stripe.issuing.disputes.submit('idp_123', { - metadata: { - thing1: true, - thing2: 'yes', - }, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/issuing/disputes/idp_123/submit', - headers: {}, - data: { - metadata: { - thing1: true, - thing2: 'yes', - }, - }, - settings: {}, - }); - }); - }); - }); -}); diff --git a/test/resources/Issuing/Transactions.spec.js b/test/resources/Issuing/Transactions.spec.js deleted file mode 100644 index 78195a1daf..0000000000 --- a/test/resources/Issuing/Transactions.spec.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; - -const stripe = require('../../testUtils.js').getSpyableStripe(); - -const expect = require('chai').expect; - -describe('Issuing', () => { - describe('Transactions Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.issuing.transactions.retrieve('ipi_123'); - - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/issuing/transactions/ipi_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.issuing.transactions.update('ipi_123', { - metadata: { - thing1: true, - thing2: 'yes', - }, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/issuing/transactions/ipi_123', - headers: {}, - data: { - metadata: { - thing1: true, - thing2: 'yes', - }, - }, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.issuing.transactions.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/issuing/transactions', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - }); -}); diff --git a/test/resources/Mandates.spec.js b/test/resources/Mandates.spec.js deleted file mode 100644 index f528bf03e0..0000000000 --- a/test/resources/Mandates.spec.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -const MANDATE_TEST_ID = 'mandate_123'; - -describe('Mandate Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.mandates.retrieve(MANDATE_TEST_ID); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: `/v1/mandates/${MANDATE_TEST_ID}`, - data: null, - headers: {}, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/PaymentIntents.spec.js b/test/resources/PaymentIntents.spec.js deleted file mode 100644 index b22e66591e..0000000000 --- a/test/resources/PaymentIntents.spec.js +++ /dev/null @@ -1,106 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -const PAYMENT_INTENT_TEST_ID = 'pi_123'; - -describe('Payment Intents Resource', () => { - describe('create', () => { - it('Sends the correct request', () => { - const params = { - amount: 200, - currency: 'usd', - payment_method_types: ['card'], - }; - stripe.paymentIntents.create(params); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/payment_intents', - headers: {}, - data: params, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.paymentIntents.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/payment_intents', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.paymentIntents.retrieve(PAYMENT_INTENT_TEST_ID); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: `/v1/payment_intents/${PAYMENT_INTENT_TEST_ID}`, - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.paymentIntents.update(PAYMENT_INTENT_TEST_ID, { - metadata: {key: 'value'}, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: `/v1/payment_intents/${PAYMENT_INTENT_TEST_ID}`, - headers: {}, - data: {metadata: {key: 'value'}}, - settings: {}, - }); - }); - }); - - describe('cancel', () => { - it('Sends the correct request', () => { - stripe.paymentIntents.cancel(PAYMENT_INTENT_TEST_ID); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: `/v1/payment_intents/${PAYMENT_INTENT_TEST_ID}/cancel`, - headers: {}, - data: {}, - settings: {}, - }); - }); - }); - - describe('capture', () => { - it('Sends the correct request', () => { - stripe.paymentIntents.capture(PAYMENT_INTENT_TEST_ID); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: `/v1/payment_intents/${PAYMENT_INTENT_TEST_ID}/capture`, - headers: {}, - data: {}, - settings: {}, - }); - }); - }); - - describe('confirm', () => { - it('Sends the correct request', () => { - stripe.paymentIntents.confirm(PAYMENT_INTENT_TEST_ID); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: `/v1/payment_intents/${PAYMENT_INTENT_TEST_ID}/confirm`, - headers: {}, - data: {}, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/PaymentMethods.spec.js b/test/resources/PaymentMethods.spec.js deleted file mode 100644 index 3509f19535..0000000000 --- a/test/resources/PaymentMethods.spec.js +++ /dev/null @@ -1,94 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('PaymentMethods Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.paymentMethods.retrieve('pm_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/payment_methods/pm_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - const data = { - type: 'card', - }; - stripe.paymentMethods.create(data); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/payment_methods', - headers: {}, - data, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - const data = { - customer: 'cus_123', - type: 'card', - }; - stripe.paymentMethods.list(data); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/payment_methods?customer=cus_123&type=card', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - const data = { - metadata: {key: 'value'}, - }; - stripe.paymentMethods.update('pm_123', data); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/payment_methods/pm_123', - headers: {}, - data, - settings: {}, - }); - }); - }); - - describe('attach', () => { - it('Sends the correct request', () => { - stripe.paymentMethods.attach('pm_123', {customer: 'cus_123'}); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/payment_methods/pm_123/attach', - headers: {}, - data: {customer: 'cus_123'}, - settings: {}, - }); - }); - }); - - describe('detach', () => { - it('Sends the correct request', () => { - stripe.paymentMethods.detach('pm_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/payment_methods/pm_123/detach', - headers: {}, - data: {}, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/Payouts.spec.js b/test/resources/Payouts.spec.js deleted file mode 100644 index d16131814d..0000000000 --- a/test/resources/Payouts.spec.js +++ /dev/null @@ -1,91 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -const PAYOUT_TEST_ID = 'po_testid1'; - -describe('Payouts Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.payouts.retrieve(PAYOUT_TEST_ID); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: `/v1/payouts/${PAYOUT_TEST_ID}`, - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - stripe.payouts.create({ - amount: 200, - currency: 'usd', - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/payouts', - headers: {}, - data: {amount: 200, currency: 'usd'}, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.payouts.update(PAYOUT_TEST_ID, { - metadata: {key: 'value'}, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: `/v1/payouts/${PAYOUT_TEST_ID}`, - headers: {}, - data: {metadata: {key: 'value'}}, - settings: {}, - }); - }); - }); - - describe('cancel', () => { - it('Sends the correct request', () => { - stripe.payouts.cancel(PAYOUT_TEST_ID); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: `/v1/payouts/${PAYOUT_TEST_ID}/cancel`, - headers: {}, - data: {}, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.payouts.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/payouts', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('reverse', () => { - it('Sends the correct request', () => { - stripe.payouts.reverse(PAYOUT_TEST_ID); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: `/v1/payouts/${PAYOUT_TEST_ID}/reverse`, - headers: {}, - data: {}, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/Plans.spec.js b/test/resources/Plans.spec.js deleted file mode 100644 index 0b8ee9eeb8..0000000000 --- a/test/resources/Plans.spec.js +++ /dev/null @@ -1,137 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('Plans Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.plans.retrieve('plan_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/plans/plan_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - stripe.plans.create({ - amount: 200, - currency: 'usd', - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/plans', - headers: {}, - data: {amount: 200, currency: 'usd'}, - settings: {}, - }); - }); - - it('Sends the correct request for metered', () => { - stripe.plans.create({ - amount: 200, - currency: 'usd', - usage_type: 'metered', - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/plans', - headers: {}, - data: {amount: 200, currency: 'usd', usage_type: 'metered'}, - settings: {}, - }); - }); - - it('Sends the correct request for tiered plans', () => { - stripe.plans.create({ - currency: 'usd', - billing_scheme: 'tiered', - tiers: [ - {up_to: 123, amount: 100}, - {up_to: 'inf', amount: 200}, - ], - tiers_mode: 'volume', - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/plans', - headers: {}, - data: { - currency: 'usd', - billing_scheme: 'tiered', - tiers: [ - {up_to: 123, amount: 100}, - {up_to: 'inf', amount: 200}, - ], - tiers_mode: 'volume', - }, - settings: {}, - }); - }); - - it('Sends the correct request for transform usage plans', () => { - stripe.plans.create({ - amount: 200, - currency: 'usd', - transform_usage: {divide_by: 123, round: 'up'}, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/plans', - headers: {}, - data: { - amount: 200, - currency: 'usd', - transform_usage: {divide_by: 123, round: 'up'}, - }, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.plans.update('plan_123', { - active: false, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/plans/plan_123', - headers: {}, - data: {active: false}, - settings: {}, - }); - }); - }); - - describe('del', () => { - it('Sends the correct request', () => { - stripe.plans.del('plan_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'DELETE', - url: '/v1/plans/plan_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.plans.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/plans', - headers: {}, - data: null, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/Prices.spec.js b/test/resources/Prices.spec.js deleted file mode 100644 index 11c8777058..0000000000 --- a/test/resources/Prices.spec.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('Plans Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.prices.retrieve('price_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/prices/price_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - stripe.prices.create({ - unit_amount: 200, - currency: 'usd', - recurring: { - interval: 'month', - }, - product_data: { - name: 'Product name', - }, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/prices', - headers: {}, - data: { - unit_amount: 200, - currency: 'usd', - recurring: { - interval: 'month', - }, - product_data: { - name: 'Product name', - }, - }, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.prices.update('price_123', { - active: false, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/prices/price_123', - headers: {}, - data: {active: false}, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.prices.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/prices', - headers: {}, - data: null, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/Products.spec.js b/test/resources/Products.spec.js deleted file mode 100644 index e45b1a440a..0000000000 --- a/test/resources/Products.spec.js +++ /dev/null @@ -1,94 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('Product Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.products.retrieve('productIdFoo123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/products/productIdFoo123', - data: null, - headers: {}, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - stripe.products.create({ - name: 'Llamas', - active: true, - type: 'good', - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/products', - data: { - name: 'Llamas', - active: true, - type: 'good', - }, - headers: {}, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.products.list({ - limit: 3, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/products?limit=3', - data: null, - headers: {}, - settings: {}, - }); - }); - - it('Supports filtering by shippable', () => { - stripe.products.list({ - shippable: true, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/products?shippable=true', - data: null, - headers: {}, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.products.update('productIdFoo3242', {caption: 'test'}); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/products/productIdFoo3242', - headers: {}, - data: {caption: 'test'}, - settings: {}, - }); - }); - }); - - describe('del', () => { - it('Sends the correct request', () => { - stripe.products.del('productIdFoo3242'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'DELETE', - url: '/v1/products/productIdFoo3242', - headers: {}, - data: null, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/PromotionCodes.spec.js b/test/resources/PromotionCodes.spec.js deleted file mode 100644 index 36cb3431e7..0000000000 --- a/test/resources/PromotionCodes.spec.js +++ /dev/null @@ -1,69 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('PromotionCodes Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.promotionCodes.retrieve('promo_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/promotion_codes/promo_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.promotionCodes.update('promo_123', { - metadata: {a: '1234'}, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/promotion_codes/promo_123', - headers: {}, - data: { - metadata: {a: '1234'}, - }, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - stripe.promotionCodes.create({ - coupon: 'co_123', - code: 'MYCODE', - }); - - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/promotion_codes', - headers: {}, - data: { - coupon: 'co_123', - code: 'MYCODE', - }, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.promotionCodes.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/promotion_codes', - headers: {}, - data: null, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/Radar/EarlyFraudWarnings.spec.js b/test/resources/Radar/EarlyFraudWarnings.spec.js deleted file mode 100644 index 3423cced26..0000000000 --- a/test/resources/Radar/EarlyFraudWarnings.spec.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -const stripe = require('../../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('Radar', () => { - describe('EarlyFraudWarnings Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.radar.earlyFraudWarnings.retrieve('issfr_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/radar/early_fraud_warnings/issfr_123', - data: null, - headers: {}, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.radar.earlyFraudWarnings.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/radar/early_fraud_warnings', - data: null, - headers: {}, - settings: {}, - }); - }); - }); - }); -}); diff --git a/test/resources/Radar/ValueListItems.spec.js b/test/resources/Radar/ValueListItems.spec.js deleted file mode 100644 index 0316b4aa5f..0000000000 --- a/test/resources/Radar/ValueListItems.spec.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict'; - -const stripe = require('../../testUtils.js').getSpyableStripe(); - -const expect = require('chai').expect; - -describe('Radar', () => { - describe('ValueLists Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.radar.valueListItems.retrieve('rsli_123'); - - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/radar/value_list_items/rsli_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - stripe.radar.valueListItems.create({ - value_list: 'rsl_123', - value: 'value', - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/radar/value_list_items', - headers: {}, - data: { - value_list: 'rsl_123', - value: 'value', - }, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.radar.valueListItems.list({ - value_list: 'rsl_123', - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/radar/value_list_items?value_list=rsl_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('del', () => { - it('Sends the correct request', () => { - stripe.radar.valueListItems.del('rsli_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'DELETE', - url: '/v1/radar/value_list_items/rsli_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - }); -}); diff --git a/test/resources/Radar/ValueLists.spec.js b/test/resources/Radar/ValueLists.spec.js deleted file mode 100644 index ca5f987258..0000000000 --- a/test/resources/Radar/ValueLists.spec.js +++ /dev/null @@ -1,85 +0,0 @@ -'use strict'; - -const stripe = require('../../testUtils.js').getSpyableStripe(); - -const expect = require('chai').expect; - -describe('Radar', () => { - describe('ValueLists Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.radar.valueLists.retrieve('rsl_123'); - - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/radar/value_lists/rsl_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - stripe.radar.valueLists.create({ - alias: 'alias', - name: 'name', - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/radar/value_lists', - headers: {}, - data: { - alias: 'alias', - name: 'name', - }, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.radar.valueLists.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/radar/value_lists', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('del', () => { - it('Sends the correct request', () => { - stripe.radar.valueLists.del('rsl_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'DELETE', - url: '/v1/radar/value_lists/rsl_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.radar.valueLists.update('rsl_123', { - metadata: {a: '1234'}, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/radar/value_lists/rsl_123', - headers: {}, - data: { - metadata: {a: '1234'}, - }, - settings: {}, - }); - }); - }); - }); -}); diff --git a/test/resources/Refunds.spec.js b/test/resources/Refunds.spec.js deleted file mode 100644 index 3e99e46318..0000000000 --- a/test/resources/Refunds.spec.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('Refund Resource', () => { - describe('create', () => { - it('Sends the correct request', () => { - stripe.refunds.create({ - amount: '300', - charge: 'ch_123', - }); - - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/refunds', - headers: {}, - data: { - amount: '300', - charge: 'ch_123', - }, - settings: {}, - }); - }); - }); - - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.refunds.retrieve('re_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/refunds/re_123', - data: null, - headers: {}, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.refunds.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/refunds', - data: null, - headers: {}, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.refunds.update('re_123', {metadata: {key: 'abcd'}}); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/refunds/re_123', - headers: {}, - data: {metadata: {key: 'abcd'}}, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/Reporting/ReportRuns.spec.js b/test/resources/Reporting/ReportRuns.spec.js deleted file mode 100644 index 07a8bd9724..0000000000 --- a/test/resources/Reporting/ReportRuns.spec.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; - -const stripe = require('../../testUtils.js').getSpyableStripe(); - -const expect = require('chai').expect; - -describe('Reporting', () => { - describe('ReportRuns Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.reporting.reportRuns.retrieve('frr_123'); - - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/reporting/report_runs/frr_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - stripe.reporting.reportRuns.create({ - parameters: { - connected_account: 'acct_123', - }, - report_type: 'activity.summary.1', - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/reporting/report_runs', - headers: {}, - data: { - parameters: { - connected_account: 'acct_123', - }, - report_type: 'activity.summary.1', - }, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.reporting.reportRuns.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/reporting/report_runs', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - }); -}); diff --git a/test/resources/Reporting/ReportTypes.spec.js b/test/resources/Reporting/ReportTypes.spec.js deleted file mode 100644 index 673b61f586..0000000000 --- a/test/resources/Reporting/ReportTypes.spec.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -const stripe = require('../../testUtils.js').getSpyableStripe(); - -const expect = require('chai').expect; - -describe('Reporting', () => { - describe('ReportTypes Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.reporting.reportTypes.retrieve('activity.summary.1'); - - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/reporting/report_types/activity.summary.1', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.reporting.reportTypes.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/reporting/report_types', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - }); -}); diff --git a/test/resources/Reviews.spec.js b/test/resources/Reviews.spec.js deleted file mode 100644 index c4c571c564..0000000000 --- a/test/resources/Reviews.spec.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('Review Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.reviews.retrieve('prv_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/reviews/prv_123', - data: null, - headers: {}, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.reviews.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/reviews', - data: null, - headers: {}, - settings: {}, - }); - }); - }); - - describe('approve', () => { - it('Sends the correct request', () => { - stripe.reviews.approve('prv_123', {amount: 23}); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/reviews/prv_123/approve', - headers: {}, - data: {amount: 23}, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/SetupAttempts.spec.js b/test/resources/SetupAttempts.spec.js deleted file mode 100644 index 7a89cd7c98..0000000000 --- a/test/resources/SetupAttempts.spec.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('Setup Attempts Resource', () => { - describe('list', () => { - it('Sends the correct request', () => { - stripe.setupAttempts.list({setup_intent: 'si_123'}); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/setup_attempts?setup_intent=si_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/SetupIntents.spec.js b/test/resources/SetupIntents.spec.js deleted file mode 100644 index e52b2f3969..0000000000 --- a/test/resources/SetupIntents.spec.js +++ /dev/null @@ -1,91 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -const SETUP_INTENT_TEST_ID = 'seti_123'; - -describe('Setup Intents Resource', () => { - describe('create', () => { - it('Sends the correct request', () => { - const params = { - payment_method_types: ['card'], - }; - stripe.setupIntents.create(params); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/setup_intents', - headers: {}, - data: params, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.setupIntents.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/setup_intents', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.setupIntents.retrieve(SETUP_INTENT_TEST_ID); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: `/v1/setup_intents/${SETUP_INTENT_TEST_ID}`, - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.setupIntents.update(SETUP_INTENT_TEST_ID, { - metadata: {key: 'value'}, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: `/v1/setup_intents/${SETUP_INTENT_TEST_ID}`, - headers: {}, - data: {metadata: {key: 'value'}}, - settings: {}, - }); - }); - }); - - describe('cancel', () => { - it('Sends the correct request', () => { - stripe.setupIntents.cancel(SETUP_INTENT_TEST_ID); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: `/v1/setup_intents/${SETUP_INTENT_TEST_ID}/cancel`, - headers: {}, - data: {}, - settings: {}, - }); - }); - }); - - describe('confirm', () => { - it('Sends the correct request', () => { - stripe.setupIntents.confirm(SETUP_INTENT_TEST_ID); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: `/v1/setup_intents/${SETUP_INTENT_TEST_ID}/confirm`, - headers: {}, - data: {}, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/Sigma/ScheduledQueryRuns.spec.js b/test/resources/Sigma/ScheduledQueryRuns.spec.js deleted file mode 100644 index a8c4802fa9..0000000000 --- a/test/resources/Sigma/ScheduledQueryRuns.spec.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -const stripe = require('../../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('Sigma', () => { - describe('ScheduledQueryRun Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.sigma.scheduledQueryRuns.retrieve('sqr_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/sigma/scheduled_query_runs/sqr_123', - data: null, - headers: {}, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.sigma.scheduledQueryRuns.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/sigma/scheduled_query_runs', - data: null, - headers: {}, - settings: {}, - }); - }); - }); - }); -}); diff --git a/test/resources/SubscriptionItems.spec.js b/test/resources/SubscriptionItems.spec.js deleted file mode 100644 index 6273ef555d..0000000000 --- a/test/resources/SubscriptionItems.spec.js +++ /dev/null @@ -1,85 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('SubscriptionItems Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.subscriptionItems.retrieve('test_sub_item'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/subscription_items/test_sub_item', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('del', () => { - it('Sends the correct request', () => { - stripe.subscriptionItems.del('test_sub_item'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'DELETE', - url: '/v1/subscription_items/test_sub_item', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.subscriptionItems.update('test_sub_item', { - plan: 'gold', - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/subscription_items/test_sub_item', - headers: {}, - data: { - plan: 'gold', - }, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - stripe.subscriptionItems.create({ - subscription: 'test_sub', - plan: 'gold', - }); - - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/subscription_items', - headers: {}, - data: { - subscription: 'test_sub', - plan: 'gold', - }, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.subscriptionItems.list({ - limit: 3, - subscription: 'test_sub', - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/subscription_items?limit=3&subscription=test_sub', - headers: {}, - data: null, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/SubscriptionSchedule.spec.js b/test/resources/SubscriptionSchedule.spec.js deleted file mode 100644 index 831431ad03..0000000000 --- a/test/resources/SubscriptionSchedule.spec.js +++ /dev/null @@ -1,96 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -const SCHEDULE_TEST_ID = 'sub_sched_123'; - -describe('Subscription Schedule Resource', () => { - describe('cancel', () => { - it('Sends the correct request', () => { - const data = { - invoice_now: true, - }; - stripe.subscriptionSchedules.cancel(SCHEDULE_TEST_ID, data); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: `/v1/subscription_schedules/${SCHEDULE_TEST_ID}/cancel`, - data, - headers: {}, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - const data = { - customer: 'cus_123', - }; - stripe.subscriptionSchedules.create(data); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/subscription_schedules', - data, - headers: {}, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.subscriptionSchedules.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/subscription_schedules', - data: null, - headers: {}, - settings: {}, - }); - }); - }); - - describe('release', () => { - it('Sends the correct request', () => { - const data = { - preserve_cancel_date: true, - }; - stripe.subscriptionSchedules.release(SCHEDULE_TEST_ID, data); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: `/v1/subscription_schedules/${SCHEDULE_TEST_ID}/release`, - data, - headers: {}, - settings: {}, - }); - }); - }); - - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.subscriptionSchedules.retrieve(SCHEDULE_TEST_ID); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/subscription_schedules/sub_sched_123', - data: null, - headers: {}, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - const data = {metadata: {key: 'value'}}; - stripe.subscriptionSchedules.update(SCHEDULE_TEST_ID, data); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: `/v1/subscription_schedules/${SCHEDULE_TEST_ID}`, - data, - headers: {}, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/Subscriptions.spec.js b/test/resources/Subscriptions.spec.js deleted file mode 100644 index e0be6bb232..0000000000 --- a/test/resources/Subscriptions.spec.js +++ /dev/null @@ -1,198 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('subscriptions Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.subscriptions.retrieve('test_sub'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/subscriptions/test_sub', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.subscriptions.update('test_sub', { - metadata: {a: '1234'}, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/subscriptions/test_sub', - headers: {}, - data: { - metadata: {a: '1234'}, - }, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - stripe.subscriptions.create({ - customer: 'test_cus', - plan: 'gold', - }); - - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/subscriptions', - headers: {}, - data: { - customer: 'test_cus', - plan: 'gold', - }, - settings: {}, - }); - }); - }); - - describe('update with items array', () => { - it('Sends the correct request', () => { - stripe.subscriptions.update('test_sub', { - items: [ - { - plan: 'foo', - quantity: 2, - }, - ], - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/subscriptions/test_sub', - headers: {}, - data: { - items: [ - { - plan: 'foo', - quantity: 2, - }, - ], - }, - settings: {}, - }); - }); - }); - - describe('create with items array', () => { - it('Sends the correct request', () => { - stripe.subscriptions.create({ - items: [ - { - plan: 'foo', - quantity: 2, - }, - ], - }); - - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/subscriptions', - headers: {}, - data: { - items: [ - { - plan: 'foo', - quantity: 2, - }, - ], - }, - settings: {}, - }); - }); - }); - - describe('update with items object', () => { - it('Sends the correct request', () => { - stripe.subscriptions.update('test_sub', { - items: { - '0': { - plan: 'foo', - quantity: 2, - }, - }, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/subscriptions/test_sub', - headers: {}, - data: { - items: { - '0': { - plan: 'foo', - quantity: 2, - }, - }, - }, - settings: {}, - }); - }); - }); - - describe('create with items object', () => { - it('Sends the correct request', () => { - stripe.subscriptions.create({ - items: { - '0': { - plan: 'foo', - quantity: 2, - }, - }, - }); - - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/subscriptions', - headers: {}, - data: { - items: { - '0': { - plan: 'foo', - quantity: 2, - }, - }, - }, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.subscriptions.list({ - limit: 3, - customer: 'test_cus', - plan: 'gold', - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/subscriptions?limit=3&customer=test_cus&plan=gold', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('Discount methods', () => { - describe('deleteDiscount', () => { - it('Sends the correct request', () => { - stripe.subscriptions.deleteDiscount('test_sub'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'DELETE', - url: '/v1/subscriptions/test_sub/discount', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - }); -}); diff --git a/test/resources/TaxCodes.spec.js b/test/resources/TaxCodes.spec.js deleted file mode 100644 index 1ee5980d91..0000000000 --- a/test/resources/TaxCodes.spec.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('TaxCodes Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.taxCodes.retrieve('txcd_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/tax_codes/txcd_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.taxCodes.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/tax_codes', - headers: {}, - data: null, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/TaxRates.spec.js b/test/resources/TaxRates.spec.js deleted file mode 100644 index 6dcd33bdab..0000000000 --- a/test/resources/TaxRates.spec.js +++ /dev/null @@ -1,67 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('TaxRates Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.taxRates.retrieve('txr_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/tax_rates/txr_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - const data = { - metadata: {a: '1234'}, - }; - stripe.taxRates.update('txr_123', data); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/tax_rates/txr_123', - headers: {}, - data, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - const data = { - display_name: 'name', - inclusive: false, - percentage: 10.15, - }; - stripe.taxRates.create(data); - - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/tax_rates', - headers: {}, - data, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.taxRates.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/tax_rates', - headers: {}, - data: null, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/Terminal/ConnectionTokens.spec.js b/test/resources/Terminal/ConnectionTokens.spec.js deleted file mode 100644 index 19d62dd9b5..0000000000 --- a/test/resources/Terminal/ConnectionTokens.spec.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -const stripe = require('../../testUtils.js').getSpyableStripe(); - -const expect = require('chai').expect; - -describe('Terminal', () => { - describe('ConnectionToken Resource', () => { - describe('create', () => { - it('Sends the correct request', () => { - stripe.terminal.connectionTokens.create({}); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/terminal/connection_tokens', - headers: {}, - data: {}, - settings: {}, - }); - }); - }); - }); -}); diff --git a/test/resources/Terminal/Locations.spec.js b/test/resources/Terminal/Locations.spec.js deleted file mode 100644 index f7e0c446ee..0000000000 --- a/test/resources/Terminal/Locations.spec.js +++ /dev/null @@ -1,97 +0,0 @@ -'use strict'; - -const stripe = require('../../testUtils.js').getSpyableStripe(); - -const expect = require('chai').expect; - -describe('Terminal', () => { - describe('Locations Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.terminal.locations.retrieve('loc_123'); - - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/terminal/locations/loc_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - stripe.terminal.locations.create({ - display_name: 'name', - address: { - line1: 'line1', - country: 'US', - postal_code: '12345', - state: 'CA', - city: 'San Francisco', - }, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/terminal/locations', - headers: {}, - data: { - display_name: 'name', - address: { - line1: 'line1', - country: 'US', - postal_code: '12345', - state: 'CA', - city: 'San Francisco', - }, - }, - settings: {}, - }); - }); - }); - - describe('del', () => { - it('Sends the correct request', () => { - stripe.terminal.locations.del('loc_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'DELETE', - url: '/v1/terminal/locations/loc_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.terminal.locations.update('loc_123', { - display_name: 'name', - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/terminal/locations/loc_123', - headers: {}, - data: { - display_name: 'name', - }, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.terminal.locations.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/terminal/locations', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - }); -}); diff --git a/test/resources/Terminal/Readers.spec.js b/test/resources/Terminal/Readers.spec.js deleted file mode 100644 index c430349d93..0000000000 --- a/test/resources/Terminal/Readers.spec.js +++ /dev/null @@ -1,85 +0,0 @@ -'use strict'; - -const stripe = require('../../testUtils.js').getSpyableStripe(); - -const expect = require('chai').expect; - -describe('Terminal', () => { - describe('Readers Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.terminal.readers.retrieve('rdr_123'); - - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/terminal/readers/rdr_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - stripe.terminal.readers.create({ - registration_code: 'a-b-c', - label: 'name', - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/terminal/readers', - headers: {}, - data: { - registration_code: 'a-b-c', - label: 'name', - }, - settings: {}, - }); - }); - }); - - describe('del', () => { - it('Sends the correct request', () => { - stripe.terminal.readers.del('rdr_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'DELETE', - url: '/v1/terminal/readers/rdr_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.terminal.readers.update('rdr_123', { - label: 'name', - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/terminal/readers/rdr_123', - headers: {}, - data: { - label: 'name', - }, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.terminal.readers.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/terminal/readers', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - }); -}); diff --git a/test/resources/TestHelpers/Terminal/Readers.spec.js b/test/resources/TestHelpers/Terminal/Readers.spec.js deleted file mode 100644 index 6be1a90c95..0000000000 --- a/test/resources/TestHelpers/Terminal/Readers.spec.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -const stripe = require('../../../testUtils.js').getSpyableStripe(); - -const expect = require('chai').expect; - -describe('Terminal', () => { - describe('Readers Resource', () => { - describe('update', () => { - it('Sends the correct request', () => { - stripe.testHelpers.terminal.readers.presentPaymentMethod('rdr_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: - '/v1/test_helpers/terminal/readers/rdr_123/present_payment_method', - headers: {}, - data: {}, - settings: {}, - }); - }); - }); - }); -}); diff --git a/test/resources/Tokens.spec.js b/test/resources/Tokens.spec.js deleted file mode 100644 index 20119905e6..0000000000 --- a/test/resources/Tokens.spec.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('Tokens Resource', () => { - describe('create', () => { - it('Sends the correct request', () => { - stripe.tokens.create({ - card: {number: 123}, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/tokens', - headers: {}, - data: {card: {number: 123}}, - settings: {}, - }); - }); - }); - - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.tokens.retrieve('tokenId1'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/tokens/tokenId1', - headers: {}, - data: null, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/Topups.spec.js b/test/resources/Topups.spec.js deleted file mode 100644 index d1b2df64ab..0000000000 --- a/test/resources/Topups.spec.js +++ /dev/null @@ -1,83 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('Topup Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.topups.retrieve('tu_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/topups/tu_123', - data: null, - headers: {}, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - stripe.topups.create({ - source: 'src_123', - amount: '1500', - currency: 'usd', - description: 'a topup', - statement_descriptor: 'creating a topup', - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/topups', - data: { - source: 'src_123', - amount: '1500', - currency: 'usd', - description: 'a topup', - statement_descriptor: 'creating a topup', - }, - headers: {}, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.topups.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/topups', - data: null, - headers: {}, - settings: {}, - }); - }); - }); - - describe('cancel', () => { - it('Sends the correct request', () => { - stripe.topups.cancel('tu_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/topups/tu_123/cancel', - headers: {}, - data: {}, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.topups.update('tu_123', {metadata: {key: 'value'}}); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/topups/tu_123', - headers: {}, - data: {metadata: {key: 'value'}}, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/Transfers.spec.js b/test/resources/Transfers.spec.js deleted file mode 100644 index cb5f936bfb..0000000000 --- a/test/resources/Transfers.spec.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('Transfers Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.transfers.retrieve('transferId1'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/transfers/transferId1', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - stripe.transfers.create({ - amount: 200, - currency: 'usd', - recipient: {}, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/transfers', - headers: {}, - data: {amount: 200, currency: 'usd', recipient: {}}, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.transfers.update('transferId6654', { - amount: 300, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/transfers/transferId6654', - headers: {}, - data: {amount: 300}, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.transfers.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/transfers', - headers: {}, - data: null, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/WebhookEndpoints.spec.js b/test/resources/WebhookEndpoints.spec.js deleted file mode 100644 index 8bd01cf850..0000000000 --- a/test/resources/WebhookEndpoints.spec.js +++ /dev/null @@ -1,82 +0,0 @@ -'use strict'; - -const stripe = require('../testUtils.js').getSpyableStripe(); -const expect = require('chai').expect; - -describe('WebhookEndpoints Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.webhookEndpoints.retrieve('we_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/webhook_endpoints/we_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('del', () => { - it('Sends the correct request', () => { - stripe.webhookEndpoints.del('we_123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'DELETE', - url: '/v1/webhook_endpoints/we_123', - headers: {}, - data: null, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.webhookEndpoints.update('we_123', { - enabled_events: ['charge.succeeded'], - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/webhook_endpoints/we_123', - headers: {}, - data: { - enabled_events: ['charge.succeeded'], - }, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - stripe.webhookEndpoints.create({ - enabled_events: ['charge.succeeded'], - url: 'https://stripe.com', - }); - - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/webhook_endpoints', - headers: {}, - data: { - enabled_events: ['charge.succeeded'], - url: 'https://stripe.com', - }, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.webhookEndpoints.list(); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/webhook_endpoints', - headers: {}, - data: null, - settings: {}, - }); - }); - }); -}); From 56a570f8445392ab51cced01681e1591f7c7c9c2 Mon Sep 17 00:00:00 2001 From: David Brownman Date: Tue, 16 Jun 2026 12:33:01 -0700 Subject: [PATCH 4/5] Add PR disclaimer to README (#2754) --- README.md | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 32f6db2bae..b3c2d87c87 100644 --- a/README.md +++ b/README.md @@ -51,20 +51,19 @@ console.log(customer.id); ``` Or using CJS: + ```js const Stripe = require('stripe'); const stripeClient = Stripe('sk_test_...'); -stripeClient.customers.create({ - email: 'customer@example.com', -}) - .then(customer => console.log(customer.id)) - .catch(error => console.error(error)); +stripeClient.customers + .create({ + email: 'customer@example.com', + }) + .then((customer) => console.log(customer.id)) + .catch((error) => console.error(error)); ``` - - - > [!WARNING] > If you're using `v17.x.x` or later and getting an error about a missing API key despite being sure it's available, it's likely you're importing the file that instantiates `Stripe` while the key isn't present (for instance, during a build step). > If that's the case, consider instantiating the client lazily: @@ -424,7 +423,11 @@ const header = stripeClient.webhooks.generateTestHeaderString({ secret, }); -const event = stripeClient.webhooks.constructEvent(payloadString, header, secret); +const event = stripeClient.webhooks.constructEvent( + payloadString, + header, + secret +); // Do something with mocked signed event expect(event.id).to.equal(payload.id); @@ -441,8 +444,9 @@ See [undocumented params and properties](https://docs.stripe.com/sdks/server-sid If you're writing a plugin that uses the library, we'd appreciate it if you instantiated your stripe client with `appInfo`, eg; With ES modules or TypeScript: + ```js -import Stripe from "stripe"; +import Stripe from 'stripe'; const stripeClient = new Stripe(apiKey, { appInfo: { name: 'MyAwesomePlugin', @@ -453,6 +457,7 @@ const stripeClient = new Stripe(apiKey, { ``` Or using CJS: + ```js const Stripe = require('stripe'); const stripeClient = Stripe('sk_test_...', { @@ -464,7 +469,6 @@ const stripeClient = Stripe('sk_test_...', { }); ``` - This information is passed along when the library makes calls to the Stripe API. ### Auto-pagination @@ -637,6 +641,9 @@ New features and bug fixes are released on the latest major version of the `stri ## Development +> [!WARNING] +> External contributions to this repo from first-time contributors are currently on hiatus. If you'd like to see a change made to the package, please open an issue.( + [Contribution guidelines for this project](CONTRIBUTING.md) The tests depend on [stripe-mock][stripe-mock], so make sure to fetch and From c7b1eeb006fd7da846ba641b4f52d8761e8cd177 Mon Sep 17 00:00:00 2001 From: David Brownman Date: Tue, 16 Jun 2026 16:30:12 -0700 Subject: [PATCH 5/5] codegen --- src/resources/AccountNotices.ts | 4 +- src/resources/Accounts.ts | 2 +- src/resources/Capital/FinancingOffers.ts | 4 +- .../Capital/FinancingTransactions.ts | 2 +- src/resources/Checkout/Sessions.ts | 2 +- src/resources/DelegatedCheckout/Orders.ts | 2 +- .../DelegatedCheckout/RequestedSessions.ts | 16 +- src/resources/ExternalAccounts.ts | 6 +- .../FinancialConnections/Accounts.ts | 4 +- .../FinancialConnections/Authorizations.ts | 2 +- .../FinancialConnections/Institutions.ts | 2 +- src/resources/FrMealVouchersOnboardings.ts | 4 +- src/resources/FxQuotes.ts | 2 +- src/resources/GiftCardOperations.ts | 2 +- src/resources/GiftCards.ts | 12 +- src/resources/Identity/BlocklistEntries.ts | 4 +- src/resources/Invoices.ts | 2 +- .../Issuing/CreditUnderwritingRecords.ts | 10 +- .../Issuing/DisputeSettlementDetails.ts | 2 +- src/resources/Issuing/FraudLiabilityDebits.ts | 2 +- src/resources/Issuing/Programs.ts | 4 +- src/resources/Margins.ts | 4 +- .../Orchestration/PaymentAttempts.ts | 2 +- src/resources/Orders.ts | 266 +++++++++--------- src/resources/PaymentAttemptRecords.ts | 18 +- src/resources/PaymentIntents.ts | 10 +- src/resources/PaymentLocationCapabilities.ts | 4 +- src/resources/PaymentLocations.ts | 6 +- src/resources/PaymentMethods.ts | 2 +- src/resources/Privacy/RedactionJobs.ts | 12 +- src/resources/Quotes.ts | 242 ++++++++-------- src/resources/Radar/AccountEvaluations.ts | 4 +- src/resources/Radar/CustomerEvaluations.ts | 2 +- src/resources/Reserve/Holds.ts | 2 +- src/resources/Reserve/Plans.ts | 2 +- src/resources/Reserve/Releases.ts | 2 +- src/resources/SharedPayment/GrantedTokens.ts | 2 +- src/resources/SharedPayment/IssuedTokens.ts | 4 +- src/resources/SubscriptionSchedules.ts | 2 +- src/resources/Subscriptions.ts | 4 +- src/resources/Tax/Forms.ts | 4 +- src/resources/Tax/Locations.ts | 2 +- src/resources/TaxFunds.ts | 2 +- src/resources/Terminal/ReaderCollectedData.ts | 2 +- .../TestHelpers/Capital/FinancingOffers.ts | 4 +- src/resources/TestHelpers/Issuing/Disputes.ts | 14 +- src/resources/TestHelpers/PaymentIntents.ts | 4 +- .../SharedPayment/GrantedTokens.ts | 4 +- src/resources/V2/Billing/BillSettings.ts | 4 +- .../V2/Billing/BillSettings/Versions.ts | 6 +- src/resources/V2/Billing/Cadences.ts | 6 +- .../V2/Billing/Cadences/SpendModifierRules.ts | 8 +- .../V2/Billing/CollectionSettings.ts | 4 +- .../V2/Billing/CollectionSettings/Versions.ts | 8 +- src/resources/V2/Billing/Contracts.ts | 8 +- .../LicensePricing/QuantityChanges.ts | 6 +- .../V2/Billing/CustomPricingUnits.ts | 4 +- src/resources/V2/Billing/Intents.ts | 10 +- src/resources/V2/Billing/Intents/Actions.ts | 6 +- src/resources/V2/Billing/LicenseFees.ts | 4 +- .../V2/Billing/LicenseFees/Versions.ts | 6 +- src/resources/V2/Billing/LicensedItems.ts | 4 +- src/resources/V2/Billing/MeteredItems.ts | 4 +- src/resources/V2/Billing/OneTimeItems.ts | 4 +- .../V2/Billing/PricingPlanSubscriptions.ts | 8 +- src/resources/V2/Billing/PricingPlans.ts | 4 +- .../V2/Billing/PricingPlans/Components.ts | 20 +- .../V2/Billing/PricingPlans/Versions.ts | 6 +- src/resources/V2/Billing/Profiles.ts | 4 +- .../V2/Billing/RateCardSubscriptions.ts | 6 +- src/resources/V2/Billing/RateCards.ts | 6 +- .../CustomPricingUnitOverageRates.ts | 16 +- src/resources/V2/Billing/RateCards/Rates.ts | 12 +- .../V2/Billing/RateCards/Versions.ts | 6 +- src/resources/V2/Billing/ServiceActions.ts | 4 +- .../V2/Core/Accounts/PersonTokens.ts | 2 +- src/resources/V2/Core/Accounts/Persons.ts | 4 +- src/resources/V2/Core/ApprovalRequests.ts | 8 +- src/resources/V2/Core/BatchJobs.ts | 4 +- src/resources/V2/Core/ClaimableSandboxes.ts | 6 +- src/resources/V2/Core/ConnectionSessions.ts | 2 +- src/resources/V2/Core/FeeBatches.ts | 2 +- src/resources/V2/Core/FeeEntries.ts | 2 +- src/resources/V2/Core/Vault/GbBankAccounts.ts | 12 +- src/resources/V2/Core/Vault/UsBankAccounts.ts | 14 +- src/resources/V2/Data/Reporting/QueryRuns.ts | 2 +- src/resources/V2/Extend/WorkflowRuns.ts | 2 +- src/resources/V2/Extend/Workflows.ts | 4 +- src/resources/V2/Iam/ActivityLogs.ts | 2 +- src/resources/V2/Iam/ApiKeys.ts | 8 +- .../V2/MoneyManagement/Adjustments.ts | 2 +- .../V2/MoneyManagement/CurrencyConversions.ts | 2 +- .../V2/MoneyManagement/DebitDisputes.ts | 2 +- .../V2/MoneyManagement/FinancialAccounts.ts | 6 +- .../FinancialAccounts/Statements.ts | 8 +- .../V2/MoneyManagement/FinancialAddresses.ts | 2 +- .../V2/MoneyManagement/InboundTransfers.ts | 2 +- .../MoneyManagement/OutboundPaymentQuotes.ts | 2 +- .../V2/MoneyManagement/OutboundPayments.ts | 4 +- .../MoneyManagement/OutboundSetupIntents.ts | 8 +- .../V2/MoneyManagement/OutboundTransfers.ts | 6 +- .../V2/MoneyManagement/PayoutMethods.ts | 6 +- .../V2/MoneyManagement/ReceivedCredits.ts | 2 +- .../V2/MoneyManagement/ReceivedDebits.ts | 2 +- .../MoneyManagement/RecipientVerifications.ts | 6 +- .../V2/MoneyManagement/TransactionEntries.ts | 2 +- .../V2/MoneyManagement/Transactions.ts | 2 +- src/resources/V2/Network/BusinessProfiles.ts | 2 +- .../V2/OrchestratedCommerce/Agreements.ts | 8 +- .../V2/Payments/OffSessionPayments.ts | 10 +- .../Payments/SettlementAllocationIntents.ts | 12 +- .../SettlementAllocationIntents/Splits.ts | 16 +- src/resources/V2/Reporting/ReportRuns.ts | 2 +- src/resources/V2/Reporting/Reports.ts | 2 +- src/resources/V2/Signals/AccountSignals.ts | 2 +- src/resources/V2/Tax/ManualRules.ts | 6 +- .../V2/TestHelpers/FinancialAddresses.ts | 6 +- 117 files changed, 618 insertions(+), 486 deletions(-) diff --git a/src/resources/AccountNotices.ts b/src/resources/AccountNotices.ts index e60ba11b8c..7d22c0a22f 100644 --- a/src/resources/AccountNotices.ts +++ b/src/resources/AccountNotices.ts @@ -26,7 +26,7 @@ export class AccountNoticeResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/account_notices/${id}`, + `/v1/account_notices/${encodeURIComponent(id)}`, params, options ) as any; @@ -41,7 +41,7 @@ export class AccountNoticeResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/account_notices/${id}`, + `/v1/account_notices/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Accounts.ts b/src/resources/Accounts.ts index 56b80043dc..6129c4e423 100644 --- a/src/resources/Accounts.ts +++ b/src/resources/Accounts.ts @@ -460,7 +460,7 @@ export class AccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/accounts/${id}/signals`, + `/v1/accounts/${encodeURIComponent(id)}/signals`, params, options ) as any; diff --git a/src/resources/Capital/FinancingOffers.ts b/src/resources/Capital/FinancingOffers.ts index b59824dc03..d2cc1bd7b7 100644 --- a/src/resources/Capital/FinancingOffers.ts +++ b/src/resources/Capital/FinancingOffers.ts @@ -32,7 +32,7 @@ export class FinancingOfferResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/capital/financing_offers/${id}`, + `/v1/capital/financing_offers/${encodeURIComponent(id)}`, params, options ) as any; @@ -48,7 +48,7 @@ export class FinancingOfferResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/capital/financing_offers/${id}/mark_delivered`, + `/v1/capital/financing_offers/${encodeURIComponent(id)}/mark_delivered`, params, options ) as any; diff --git a/src/resources/Capital/FinancingTransactions.ts b/src/resources/Capital/FinancingTransactions.ts index 0d04be0233..60e4cb8b73 100644 --- a/src/resources/Capital/FinancingTransactions.ts +++ b/src/resources/Capital/FinancingTransactions.ts @@ -33,7 +33,7 @@ export class FinancingTransactionResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/capital/financing_transactions/${id}`, + `/v1/capital/financing_transactions/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Checkout/Sessions.ts b/src/resources/Checkout/Sessions.ts index b5575dd249..3d620ea8c0 100644 --- a/src/resources/Checkout/Sessions.ts +++ b/src/resources/Checkout/Sessions.ts @@ -462,7 +462,7 @@ export class SessionResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/checkout/sessions/${id}/approve`, + `/v1/checkout/sessions/${encodeURIComponent(id)}/approve`, params, options, { diff --git a/src/resources/DelegatedCheckout/Orders.ts b/src/resources/DelegatedCheckout/Orders.ts index 3d6ad0f8a8..a80452b0a9 100644 --- a/src/resources/DelegatedCheckout/Orders.ts +++ b/src/resources/DelegatedCheckout/Orders.ts @@ -15,7 +15,7 @@ export class OrderResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/delegated_checkout/orders/${id}`, + `/v1/delegated_checkout/orders/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/DelegatedCheckout/RequestedSessions.ts b/src/resources/DelegatedCheckout/RequestedSessions.ts index cb4a5bf8ca..1c6b481ece 100644 --- a/src/resources/DelegatedCheckout/RequestedSessions.ts +++ b/src/resources/DelegatedCheckout/RequestedSessions.ts @@ -24,7 +24,7 @@ export class RequestedSessionResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/delegated_checkout/requested_sessions/${id}`, + `/v1/delegated_checkout/requested_sessions/${encodeURIComponent(id)}`, params, options ) as any; @@ -39,7 +39,7 @@ export class RequestedSessionResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/delegated_checkout/requested_sessions/${id}`, + `/v1/delegated_checkout/requested_sessions/${encodeURIComponent(id)}`, params, options ) as any; @@ -68,7 +68,9 @@ export class RequestedSessionResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/delegated_checkout/requested_sessions/${id}/confirm`, + `/v1/delegated_checkout/requested_sessions/${encodeURIComponent( + id + )}/confirm`, params, options ) as any; @@ -83,7 +85,9 @@ export class RequestedSessionResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/delegated_checkout/requested_sessions/${id}/expire`, + `/v1/delegated_checkout/requested_sessions/${encodeURIComponent( + id + )}/expire`, params, options ) as any; @@ -98,7 +102,9 @@ export class RequestedSessionResource extends StripeResource { ): ApiListPromise { return this._makeRequest( 'GET', - `/v1/delegated_checkout/requested_sessions/${id}/orders`, + `/v1/delegated_checkout/requested_sessions/${encodeURIComponent( + id + )}/orders`, params, options, { diff --git a/src/resources/ExternalAccounts.ts b/src/resources/ExternalAccounts.ts index 79e4c607dc..9ec49a0b5a 100644 --- a/src/resources/ExternalAccounts.ts +++ b/src/resources/ExternalAccounts.ts @@ -17,7 +17,7 @@ export class ExternalAccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v1/external_accounts/${id}`, + `/v1/external_accounts/${encodeURIComponent(id)}`, params, options ) as any; @@ -32,7 +32,7 @@ export class ExternalAccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/external_accounts/${id}`, + `/v1/external_accounts/${encodeURIComponent(id)}`, params, options ) as any; @@ -54,7 +54,7 @@ export class ExternalAccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/external_accounts/${id}`, + `/v1/external_accounts/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/FinancialConnections/Accounts.ts b/src/resources/FinancialConnections/Accounts.ts index d1228f48b5..b20e8511ae 100644 --- a/src/resources/FinancialConnections/Accounts.ts +++ b/src/resources/FinancialConnections/Accounts.ts @@ -114,7 +114,9 @@ export class AccountResource extends StripeResource { ): ApiListPromise { return this._makeRequest( 'GET', - `/v1/financial_connections/accounts/${id}/inferred_balances`, + `/v1/financial_connections/accounts/${encodeURIComponent( + id + )}/inferred_balances`, params, options, { diff --git a/src/resources/FinancialConnections/Authorizations.ts b/src/resources/FinancialConnections/Authorizations.ts index 03373d7f63..7f0a6178da 100644 --- a/src/resources/FinancialConnections/Authorizations.ts +++ b/src/resources/FinancialConnections/Authorizations.ts @@ -17,7 +17,7 @@ export class AuthorizationResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/financial_connections/authorizations/${id}`, + `/v1/financial_connections/authorizations/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/FinancialConnections/Institutions.ts b/src/resources/FinancialConnections/Institutions.ts index 43a2a46e7a..7099b22173 100644 --- a/src/resources/FinancialConnections/Institutions.ts +++ b/src/resources/FinancialConnections/Institutions.ts @@ -32,7 +32,7 @@ export class InstitutionResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/financial_connections/institutions/${id}`, + `/v1/financial_connections/institutions/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/FrMealVouchersOnboardings.ts b/src/resources/FrMealVouchersOnboardings.ts index 7f7bb77a8d..e02ece8d05 100644 --- a/src/resources/FrMealVouchersOnboardings.ts +++ b/src/resources/FrMealVouchersOnboardings.ts @@ -49,7 +49,7 @@ export class FrMealVouchersOnboardingResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/fr_meal_vouchers_onboardings/${id}`, + `/v1/fr_meal_vouchers_onboardings/${encodeURIComponent(id)}`, params, options ) as any; @@ -68,7 +68,7 @@ export class FrMealVouchersOnboardingResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/fr_meal_vouchers_onboardings/${id}`, + `/v1/fr_meal_vouchers_onboardings/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/FxQuotes.ts b/src/resources/FxQuotes.ts index 06fe8f32d7..9a036e4ec3 100644 --- a/src/resources/FxQuotes.ts +++ b/src/resources/FxQuotes.ts @@ -35,7 +35,7 @@ export class FxQuoteResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/fx_quotes/${id}`, + `/v1/fx_quotes/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/GiftCardOperations.ts b/src/resources/GiftCardOperations.ts index 18ba590b1c..724b09c202 100644 --- a/src/resources/GiftCardOperations.ts +++ b/src/resources/GiftCardOperations.ts @@ -15,7 +15,7 @@ export class GiftCardOperationResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/gift_card_operations/${id}`, + `/v1/gift_card_operations/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/GiftCards.ts b/src/resources/GiftCards.ts index f4fa919ac9..14f4e18156 100644 --- a/src/resources/GiftCards.ts +++ b/src/resources/GiftCards.ts @@ -15,7 +15,7 @@ export class GiftCardResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/gift_cards/${id}`, + `/v1/gift_cards/${encodeURIComponent(id)}`, params, options ) as any; @@ -39,7 +39,7 @@ export class GiftCardResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/gift_cards/${id}/activate`, + `/v1/gift_cards/${encodeURIComponent(id)}/activate`, params, options ) as any; @@ -54,7 +54,7 @@ export class GiftCardResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/gift_cards/${id}/cashout`, + `/v1/gift_cards/${encodeURIComponent(id)}/cashout`, params, options ) as any; @@ -69,7 +69,7 @@ export class GiftCardResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/gift_cards/${id}/check_balance`, + `/v1/gift_cards/${encodeURIComponent(id)}/check_balance`, params, options ) as any; @@ -84,7 +84,7 @@ export class GiftCardResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/gift_cards/${id}/reload`, + `/v1/gift_cards/${encodeURIComponent(id)}/reload`, params, options ) as any; @@ -99,7 +99,7 @@ export class GiftCardResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/gift_cards/${id}/void_operation`, + `/v1/gift_cards/${encodeURIComponent(id)}/void_operation`, params, options ) as any; diff --git a/src/resources/Identity/BlocklistEntries.ts b/src/resources/Identity/BlocklistEntries.ts index 027364fbf6..d47c26cec1 100644 --- a/src/resources/Identity/BlocklistEntries.ts +++ b/src/resources/Identity/BlocklistEntries.ts @@ -61,7 +61,7 @@ export class BlocklistEntryResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/identity/blocklist_entries/${id}`, + `/v1/identity/blocklist_entries/${encodeURIComponent(id)}`, params, options ) as any; @@ -82,7 +82,7 @@ export class BlocklistEntryResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/identity/blocklist_entries/${id}/disable`, + `/v1/identity/blocklist_entries/${encodeURIComponent(id)}/disable`, params, options ) as any; diff --git a/src/resources/Invoices.ts b/src/resources/Invoices.ts index d6db340b9a..a4c84d6a5d 100644 --- a/src/resources/Invoices.ts +++ b/src/resources/Invoices.ts @@ -451,7 +451,7 @@ export class InvoiceResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/invoices/${id}/detach_payment`, + `/v1/invoices/${encodeURIComponent(id)}/detach_payment`, params, options, { diff --git a/src/resources/Issuing/CreditUnderwritingRecords.ts b/src/resources/Issuing/CreditUnderwritingRecords.ts index a81f2f3f6c..09356e64db 100644 --- a/src/resources/Issuing/CreditUnderwritingRecords.ts +++ b/src/resources/Issuing/CreditUnderwritingRecords.ts @@ -32,7 +32,7 @@ export class CreditUnderwritingRecordResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/issuing/credit_underwriting_records/${id}`, + `/v1/issuing/credit_underwriting_records/${encodeURIComponent(id)}`, params, options ) as any; @@ -47,7 +47,9 @@ export class CreditUnderwritingRecordResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/issuing/credit_underwriting_records/${id}/correct`, + `/v1/issuing/credit_underwriting_records/${encodeURIComponent( + id + )}/correct`, params, options ) as any; @@ -62,7 +64,9 @@ export class CreditUnderwritingRecordResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/issuing/credit_underwriting_records/${id}/report_decision`, + `/v1/issuing/credit_underwriting_records/${encodeURIComponent( + id + )}/report_decision`, params, options ) as any; diff --git a/src/resources/Issuing/DisputeSettlementDetails.ts b/src/resources/Issuing/DisputeSettlementDetails.ts index a4620bc14d..64090fa38f 100644 --- a/src/resources/Issuing/DisputeSettlementDetails.ts +++ b/src/resources/Issuing/DisputeSettlementDetails.ts @@ -32,7 +32,7 @@ export class DisputeSettlementDetailResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/issuing/dispute_settlement_details/${id}`, + `/v1/issuing/dispute_settlement_details/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Issuing/FraudLiabilityDebits.ts b/src/resources/Issuing/FraudLiabilityDebits.ts index b88490744d..d38f0eec1d 100644 --- a/src/resources/Issuing/FraudLiabilityDebits.ts +++ b/src/resources/Issuing/FraudLiabilityDebits.ts @@ -33,7 +33,7 @@ export class FraudLiabilityDebitResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/issuing/fraud_liability_debits/${id}`, + `/v1/issuing/fraud_liability_debits/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Issuing/Programs.ts b/src/resources/Issuing/Programs.ts index 077aa9cb9b..574a9e2263 100644 --- a/src/resources/Issuing/Programs.ts +++ b/src/resources/Issuing/Programs.ts @@ -45,7 +45,7 @@ export class ProgramResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/issuing/programs/${id}`, + `/v1/issuing/programs/${encodeURIComponent(id)}`, params, options ) as any; @@ -60,7 +60,7 @@ export class ProgramResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/issuing/programs/${id}`, + `/v1/issuing/programs/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Margins.ts b/src/resources/Margins.ts index a26e52d3d8..ce5ed9ead7 100644 --- a/src/resources/Margins.ts +++ b/src/resources/Margins.ts @@ -40,7 +40,7 @@ export class MarginResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/billing/margins/${id}`, + `/v1/billing/margins/${encodeURIComponent(id)}`, params, options ) as any; @@ -55,7 +55,7 @@ export class MarginResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/billing/margins/${id}`, + `/v1/billing/margins/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Orchestration/PaymentAttempts.ts b/src/resources/Orchestration/PaymentAttempts.ts index 949853fef6..8b80c523cb 100644 --- a/src/resources/Orchestration/PaymentAttempts.ts +++ b/src/resources/Orchestration/PaymentAttempts.ts @@ -14,7 +14,7 @@ export class PaymentAttemptResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/orchestration/payment_attempts/${id}`, + `/v1/orchestration/payment_attempts/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Orders.ts b/src/resources/Orders.ts index 41ce346612..232577cd66 100644 --- a/src/resources/Orders.ts +++ b/src/resources/Orders.ts @@ -223,70 +223,76 @@ export class OrderResource extends StripeResource { params?: OrderRetrieveParams, options?: RequestOptions ): Promise> { - return this._makeRequest('GET', `/v1/orders/${id}`, params, options, { - responseSchema: { - kind: 'object', - fields: { - line_items: { - kind: 'object', - fields: { - data: { - kind: 'array', - element: { - kind: 'object', - fields: { - price: { - kind: 'nullable', - inner: { - kind: 'object', - fields: { - currency_options: { - kind: 'array', - element: { - kind: 'object', - fields: { - tiers: { - kind: 'array', - element: { - kind: 'object', - fields: { - flat_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + return this._makeRequest( + 'GET', + `/v1/orders/${encodeURIComponent(id)}`, + params, + options, + { + responseSchema: { + kind: 'object', + fields: { + line_items: { + kind: 'object', + fields: { + data: { + kind: 'array', + element: { + kind: 'object', + fields: { + price: { + kind: 'nullable', + inner: { + kind: 'object', + fields: { + currency_options: { + kind: 'array', + element: { + kind: 'object', + fields: { + tiers: { + kind: 'array', + element: { + kind: 'object', + fields: { + flat_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, - }, - tiers: { - kind: 'array', - element: { - kind: 'object', - fields: { - flat_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + tiers: { + kind: 'array', + element: { + kind: 'object', + fields: { + flat_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, @@ -297,8 +303,8 @@ export class OrderResource extends StripeResource { }, }, }, - }, - }) as any; + } + ) as any; } /** * Updates the specific order by setting the values of the parameters passed. Any parameters not provided will be left unchanged. @@ -308,87 +314,93 @@ export class OrderResource extends StripeResource { params?: OrderUpdateParams, options?: RequestOptions ): Promise> { - return this._makeRequest('POST', `/v1/orders/${id}`, params, options, { - requestSchema: { - kind: 'object', - fields: { - line_items: { - kind: 'array', - element: { - kind: 'object', - fields: { - price_data: { - kind: 'object', - fields: {unit_amount_decimal: {kind: 'decimal_string'}}, + return this._makeRequest( + 'POST', + `/v1/orders/${encodeURIComponent(id)}`, + params, + options, + { + requestSchema: { + kind: 'object', + fields: { + line_items: { + kind: 'array', + element: { + kind: 'object', + fields: { + price_data: { + kind: 'object', + fields: {unit_amount_decimal: {kind: 'decimal_string'}}, + }, }, }, }, }, }, - }, - responseSchema: { - kind: 'object', - fields: { - line_items: { - kind: 'object', - fields: { - data: { - kind: 'array', - element: { - kind: 'object', - fields: { - price: { - kind: 'nullable', - inner: { - kind: 'object', - fields: { - currency_options: { - kind: 'array', - element: { - kind: 'object', - fields: { - tiers: { - kind: 'array', - element: { - kind: 'object', - fields: { - flat_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + responseSchema: { + kind: 'object', + fields: { + line_items: { + kind: 'object', + fields: { + data: { + kind: 'array', + element: { + kind: 'object', + fields: { + price: { + kind: 'nullable', + inner: { + kind: 'object', + fields: { + currency_options: { + kind: 'array', + element: { + kind: 'object', + fields: { + tiers: { + kind: 'array', + element: { + kind: 'object', + fields: { + flat_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, - }, - tiers: { - kind: 'array', - element: { - kind: 'object', - fields: { - flat_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + tiers: { + kind: 'array', + element: { + kind: 'object', + fields: { + flat_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: {kind: 'decimal_string'}, + unit_amount_decimal: { + kind: 'nullable', + inner: {kind: 'decimal_string'}, + }, }, }, }, @@ -399,8 +411,8 @@ export class OrderResource extends StripeResource { }, }, }, - }, - }) as any; + } + ) as any; } /** * Submitting an Order transitions the status to processing and creates a PaymentIntent object so the order can be paid. If the Order has an amount_total of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the [reopen](https://docs.stripe.com/api#reopen_order) method is called. @@ -412,7 +424,7 @@ export class OrderResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/orders/${id}/submit`, + `/v1/orders/${encodeURIComponent(id)}/submit`, params, options, { diff --git a/src/resources/PaymentAttemptRecords.ts b/src/resources/PaymentAttemptRecords.ts index d223ac05a6..c7af361d2a 100644 --- a/src/resources/PaymentAttemptRecords.ts +++ b/src/resources/PaymentAttemptRecords.ts @@ -55,7 +55,9 @@ export class PaymentAttemptRecordResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_attempt_records/${id}/report_authenticated`, + `/v1/payment_attempt_records/${encodeURIComponent( + id + )}/report_authenticated`, params, options ) as any; @@ -70,7 +72,7 @@ export class PaymentAttemptRecordResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_attempt_records/${id}/report_authorized`, + `/v1/payment_attempt_records/${encodeURIComponent(id)}/report_authorized`, params, options ) as any; @@ -85,7 +87,7 @@ export class PaymentAttemptRecordResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_attempt_records/${id}/report_canceled`, + `/v1/payment_attempt_records/${encodeURIComponent(id)}/report_canceled`, params, options ) as any; @@ -100,7 +102,7 @@ export class PaymentAttemptRecordResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_attempt_records/${id}/report_failed`, + `/v1/payment_attempt_records/${encodeURIComponent(id)}/report_failed`, params, options ) as any; @@ -115,7 +117,7 @@ export class PaymentAttemptRecordResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_attempt_records/${id}/report_guaranteed`, + `/v1/payment_attempt_records/${encodeURIComponent(id)}/report_guaranteed`, params, options ) as any; @@ -130,7 +132,9 @@ export class PaymentAttemptRecordResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_attempt_records/${id}/report_informational`, + `/v1/payment_attempt_records/${encodeURIComponent( + id + )}/report_informational`, params, options ) as any; @@ -145,7 +149,7 @@ export class PaymentAttemptRecordResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_attempt_records/${id}/report_refund`, + `/v1/payment_attempt_records/${encodeURIComponent(id)}/report_refund`, params, options ) as any; diff --git a/src/resources/PaymentIntents.ts b/src/resources/PaymentIntents.ts index c9d517e787..263c4d5021 100644 --- a/src/resources/PaymentIntents.ts +++ b/src/resources/PaymentIntents.ts @@ -247,7 +247,7 @@ export class PaymentIntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_intents/${id}/decrement_authorization`, + `/v1/payment_intents/${encodeURIComponent(id)}/decrement_authorization`, params, options ) as any; @@ -309,7 +309,7 @@ export class PaymentIntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_intents/${id}/reauthorize`, + `/v1/payment_intents/${encodeURIComponent(id)}/reauthorize`, params, options ) as any; @@ -324,7 +324,9 @@ export class PaymentIntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_intents/${id}/update_crypto_refund_address`, + `/v1/payment_intents/${encodeURIComponent( + id + )}/update_crypto_refund_address`, params, options ) as any; @@ -354,7 +356,7 @@ export class PaymentIntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test/payment_intents/${id}/trigger_action`, + `/v1/test/payment_intents/${encodeURIComponent(id)}/trigger_action`, params, options ) as any; diff --git a/src/resources/PaymentLocationCapabilities.ts b/src/resources/PaymentLocationCapabilities.ts index cc711aaaae..1af1b0ad9b 100644 --- a/src/resources/PaymentLocationCapabilities.ts +++ b/src/resources/PaymentLocationCapabilities.ts @@ -31,7 +31,7 @@ export class PaymentLocationCapabilityResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/payment_location_capabilities/${id}`, + `/v1/payment_location_capabilities/${encodeURIComponent(id)}`, params, options ) as any; @@ -46,7 +46,7 @@ export class PaymentLocationCapabilityResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_location_capabilities/${id}`, + `/v1/payment_location_capabilities/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/PaymentLocations.ts b/src/resources/PaymentLocations.ts index b72ad40084..168a221d78 100644 --- a/src/resources/PaymentLocations.ts +++ b/src/resources/PaymentLocations.ts @@ -15,7 +15,7 @@ export class PaymentLocationResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v1/payment_locations/${id}`, + `/v1/payment_locations/${encodeURIComponent(id)}`, params, options ) as any; @@ -30,7 +30,7 @@ export class PaymentLocationResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/payment_locations/${id}`, + `/v1/payment_locations/${encodeURIComponent(id)}`, params, options ) as any; @@ -45,7 +45,7 @@ export class PaymentLocationResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_locations/${id}`, + `/v1/payment_locations/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/PaymentMethods.ts b/src/resources/PaymentMethods.ts index 5151a6c8dd..e8c6869794 100644 --- a/src/resources/PaymentMethods.ts +++ b/src/resources/PaymentMethods.ts @@ -111,7 +111,7 @@ export class PaymentMethodResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/payment_methods/${id}/check_balance`, + `/v1/payment_methods/${encodeURIComponent(id)}/check_balance`, params, options ) as any; diff --git a/src/resources/Privacy/RedactionJobs.ts b/src/resources/Privacy/RedactionJobs.ts index dffbdcf0fa..37d5fd83f6 100644 --- a/src/resources/Privacy/RedactionJobs.ts +++ b/src/resources/Privacy/RedactionJobs.ts @@ -47,7 +47,7 @@ export class RedactionJobResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/privacy/redaction_jobs/${id}`, + `/v1/privacy/redaction_jobs/${encodeURIComponent(id)}`, params, options ) as any; @@ -64,7 +64,7 @@ export class RedactionJobResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/privacy/redaction_jobs/${id}`, + `/v1/privacy/redaction_jobs/${encodeURIComponent(id)}`, params, options ) as any; @@ -81,7 +81,7 @@ export class RedactionJobResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/privacy/redaction_jobs/${id}/cancel`, + `/v1/privacy/redaction_jobs/${encodeURIComponent(id)}/cancel`, params, options ) as any; @@ -100,7 +100,7 @@ export class RedactionJobResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/privacy/redaction_jobs/${id}/run`, + `/v1/privacy/redaction_jobs/${encodeURIComponent(id)}/run`, params, options ) as any; @@ -119,7 +119,7 @@ export class RedactionJobResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/privacy/redaction_jobs/${id}/validate`, + `/v1/privacy/redaction_jobs/${encodeURIComponent(id)}/validate`, params, options ) as any; @@ -134,7 +134,7 @@ export class RedactionJobResource extends StripeResource { ): ApiListPromise { return this._makeRequest( 'GET', - `/v1/privacy/redaction_jobs/${id}/validation_errors`, + `/v1/privacy/redaction_jobs/${encodeURIComponent(id)}/validation_errors`, params, options, { diff --git a/src/resources/Quotes.ts b/src/resources/Quotes.ts index 4165938986..9fed638965 100644 --- a/src/resources/Quotes.ts +++ b/src/resources/Quotes.ts @@ -513,62 +513,62 @@ export class QuoteResource extends StripeResource { }, }, }, - }, - status_details: { - kind: 'nullable', - inner: { - kind: 'object', - fields: { - stale: { - kind: 'object', - fields: { - last_reason: { - kind: 'nullable', - inner: { - kind: 'object', - fields: { - subscription_changed: { - kind: 'object', - fields: { - previous_subscription: { - kind: 'nullable', - inner: { - kind: 'object', - fields: { - items: { - kind: 'object', - fields: { - data: { - kind: 'array', - element: { - kind: 'object', - fields: { - plan: { - kind: 'object', - fields: { - amount_decimal: { - kind: 'nullable', - inner: { - kind: 'decimal_string', + status_details: { + kind: 'nullable', + inner: { + kind: 'object', + fields: { + stale: { + kind: 'object', + fields: { + last_reason: { + kind: 'nullable', + inner: { + kind: 'object', + fields: { + subscription_changed: { + kind: 'object', + fields: { + previous_subscription: { + kind: 'nullable', + inner: { + kind: 'object', + fields: { + items: { + kind: 'object', + fields: { + data: { + kind: 'array', + element: { + kind: 'object', + fields: { + plan: { + kind: 'object', + fields: { + amount_decimal: { + kind: 'nullable', + inner: { + kind: 'decimal_string', + }, }, - }, - tiers: { - kind: 'array', - element: { - kind: 'object', - fields: { - flat_amount_decimal: { - kind: 'nullable', - inner: { - kind: - 'decimal_string', + tiers: { + kind: 'array', + element: { + kind: 'object', + fields: { + flat_amount_decimal: { + kind: 'nullable', + inner: { + kind: + 'decimal_string', + }, }, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: { - kind: - 'decimal_string', + unit_amount_decimal: { + kind: 'nullable', + inner: { + kind: + 'decimal_string', + }, }, }, }, @@ -715,62 +715,62 @@ export class QuoteResource extends StripeResource { }, }, }, - }, - status_details: { - kind: 'nullable', - inner: { - kind: 'object', - fields: { - stale: { - kind: 'object', - fields: { - last_reason: { - kind: 'nullable', - inner: { - kind: 'object', - fields: { - subscription_changed: { - kind: 'object', - fields: { - previous_subscription: { - kind: 'nullable', - inner: { - kind: 'object', - fields: { - items: { - kind: 'object', - fields: { - data: { - kind: 'array', - element: { - kind: 'object', - fields: { - plan: { - kind: 'object', - fields: { - amount_decimal: { - kind: 'nullable', - inner: { - kind: 'decimal_string', + status_details: { + kind: 'nullable', + inner: { + kind: 'object', + fields: { + stale: { + kind: 'object', + fields: { + last_reason: { + kind: 'nullable', + inner: { + kind: 'object', + fields: { + subscription_changed: { + kind: 'object', + fields: { + previous_subscription: { + kind: 'nullable', + inner: { + kind: 'object', + fields: { + items: { + kind: 'object', + fields: { + data: { + kind: 'array', + element: { + kind: 'object', + fields: { + plan: { + kind: 'object', + fields: { + amount_decimal: { + kind: 'nullable', + inner: { + kind: 'decimal_string', + }, }, - }, - tiers: { - kind: 'array', - element: { - kind: 'object', - fields: { - flat_amount_decimal: { - kind: 'nullable', - inner: { - kind: - 'decimal_string', + tiers: { + kind: 'array', + element: { + kind: 'object', + fields: { + flat_amount_decimal: { + kind: 'nullable', + inner: { + kind: + 'decimal_string', + }, }, - }, - unit_amount_decimal: { - kind: 'nullable', - inner: { - kind: - 'decimal_string', + unit_amount_decimal: { + kind: 'nullable', + inner: { + kind: + 'decimal_string', + }, }, }, }, @@ -1365,7 +1365,7 @@ export class QuoteResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/quotes/${id}/mark_draft`, + `/v1/quotes/${encodeURIComponent(id)}/mark_draft`, params, options, { @@ -1550,7 +1550,7 @@ export class QuoteResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/quotes/${id}/mark_stale`, + `/v1/quotes/${encodeURIComponent(id)}/mark_stale`, params, options, { @@ -1735,7 +1735,7 @@ export class QuoteResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/quotes/${id}/reestimate`, + `/v1/quotes/${encodeURIComponent(id)}/reestimate`, params, options, { @@ -1940,7 +1940,9 @@ export class QuoteResource extends StripeResource { ): ApiListPromise { return this._makeRequest( 'GET', - `/v1/quotes/${quoteId}/preview_invoices/${id}/lines`, + `/v1/quotes/${encodeURIComponent( + quoteId + )}/preview_invoices/${encodeURIComponent(id)}/lines`, params, options, { @@ -2072,9 +2074,15 @@ export class QuoteResource extends StripeResource { params?: QuoteListLinesParams, options?: RequestOptions ): ApiListPromise { - return this._makeRequest('GET', `/v1/quotes/${id}/lines`, params, options, { - methodType: 'list', - }) as any; + return this._makeRequest( + 'GET', + `/v1/quotes/${encodeURIComponent(id)}/lines`, + params, + options, + { + methodType: 'list', + } + ) as any; } /** * When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. @@ -2173,7 +2181,7 @@ export class QuoteResource extends StripeResource { ): ApiListPromise { return this._makeRequest( 'GET', - `/v1/quotes/${id}/preview_invoices`, + `/v1/quotes/${encodeURIComponent(id)}/preview_invoices`, params, options, { @@ -2233,7 +2241,7 @@ export class QuoteResource extends StripeResource { ): ApiListPromise { return this._makeRequest( 'GET', - `/v1/quotes/${id}/preview_subscription_schedules`, + `/v1/quotes/${encodeURIComponent(id)}/preview_subscription_schedules`, params, options, { diff --git a/src/resources/Radar/AccountEvaluations.ts b/src/resources/Radar/AccountEvaluations.ts index c0f7152c45..d6c2b821f8 100644 --- a/src/resources/Radar/AccountEvaluations.ts +++ b/src/resources/Radar/AccountEvaluations.ts @@ -14,7 +14,7 @@ export class AccountEvaluationResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/radar/account_evaluations/${id}`, + `/v1/radar/account_evaluations/${encodeURIComponent(id)}`, params, options ) as any; @@ -43,7 +43,7 @@ export class AccountEvaluationResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/radar/account_evaluations/${id}/report_event`, + `/v1/radar/account_evaluations/${encodeURIComponent(id)}/report_event`, params, options ) as any; diff --git a/src/resources/Radar/CustomerEvaluations.ts b/src/resources/Radar/CustomerEvaluations.ts index e4d850a878..e3c4f792d3 100644 --- a/src/resources/Radar/CustomerEvaluations.ts +++ b/src/resources/Radar/CustomerEvaluations.ts @@ -28,7 +28,7 @@ export class CustomerEvaluationResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/radar/customer_evaluations/${id}/report`, + `/v1/radar/customer_evaluations/${encodeURIComponent(id)}/report`, params, options ) as any; diff --git a/src/resources/Reserve/Holds.ts b/src/resources/Reserve/Holds.ts index f9b9ff08d3..161bc423ab 100644 --- a/src/resources/Reserve/Holds.ts +++ b/src/resources/Reserve/Holds.ts @@ -28,7 +28,7 @@ export class HoldResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/reserve/holds/${id}`, + `/v1/reserve/holds/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Reserve/Plans.ts b/src/resources/Reserve/Plans.ts index 833b16e70e..257a920407 100644 --- a/src/resources/Reserve/Plans.ts +++ b/src/resources/Reserve/Plans.ts @@ -15,7 +15,7 @@ export class PlanResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/reserve/plans/${id}`, + `/v1/reserve/plans/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Reserve/Releases.ts b/src/resources/Reserve/Releases.ts index cc6c134e95..8a9e907f42 100644 --- a/src/resources/Reserve/Releases.ts +++ b/src/resources/Reserve/Releases.ts @@ -30,7 +30,7 @@ export class ReleaseResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/reserve/releases/${id}`, + `/v1/reserve/releases/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/SharedPayment/GrantedTokens.ts b/src/resources/SharedPayment/GrantedTokens.ts index 0d3fa6868b..7d5b9d8b40 100644 --- a/src/resources/SharedPayment/GrantedTokens.ts +++ b/src/resources/SharedPayment/GrantedTokens.ts @@ -18,7 +18,7 @@ export class GrantedTokenResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/shared_payment/granted_tokens/${id}`, + `/v1/shared_payment/granted_tokens/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/SharedPayment/IssuedTokens.ts b/src/resources/SharedPayment/IssuedTokens.ts index 1439692c86..2478d2d75a 100644 --- a/src/resources/SharedPayment/IssuedTokens.ts +++ b/src/resources/SharedPayment/IssuedTokens.ts @@ -14,7 +14,7 @@ export class IssuedTokenResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/shared_payment/issued_tokens/${id}`, + `/v1/shared_payment/issued_tokens/${encodeURIComponent(id)}`, params, options ) as any; @@ -43,7 +43,7 @@ export class IssuedTokenResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/shared_payment/issued_tokens/${id}/revoke`, + `/v1/shared_payment/issued_tokens/${encodeURIComponent(id)}/revoke`, params, options ) as any; diff --git a/src/resources/SubscriptionSchedules.ts b/src/resources/SubscriptionSchedules.ts index 6029b01e1c..d31d4f049b 100644 --- a/src/resources/SubscriptionSchedules.ts +++ b/src/resources/SubscriptionSchedules.ts @@ -183,7 +183,7 @@ export class SubscriptionScheduleResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/subscription_schedules/${id}/amend`, + `/v1/subscription_schedules/${encodeURIComponent(id)}/amend`, params, options ) as any; diff --git a/src/resources/Subscriptions.ts b/src/resources/Subscriptions.ts index f87bc53252..41bedc39fe 100644 --- a/src/resources/Subscriptions.ts +++ b/src/resources/Subscriptions.ts @@ -829,7 +829,7 @@ export class SubscriptionResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/subscriptions/${id}/attach_cadence`, + `/v1/subscriptions/${encodeURIComponent(id)}/attach_cadence`, params, options, { @@ -1055,7 +1055,7 @@ export class SubscriptionResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/subscriptions/${id}/pause`, + `/v1/subscriptions/${encodeURIComponent(id)}/pause`, params, options, { diff --git a/src/resources/Tax/Forms.ts b/src/resources/Tax/Forms.ts index 37d461bf0f..f8b2351587 100644 --- a/src/resources/Tax/Forms.ts +++ b/src/resources/Tax/Forms.ts @@ -32,7 +32,7 @@ export class FormResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/tax/forms/${id}`, + `/v1/tax/forms/${encodeURIComponent(id)}`, params, options ) as any; @@ -47,7 +47,7 @@ export class FormResource extends StripeResource { ): Promise { return this._makeRequest( 'GET', - `/v1/tax/forms/${id}/pdf`, + `/v1/tax/forms/${encodeURIComponent(id)}/pdf`, params, options, { diff --git a/src/resources/Tax/Locations.ts b/src/resources/Tax/Locations.ts index 87db202ac0..e52761b91e 100644 --- a/src/resources/Tax/Locations.ts +++ b/src/resources/Tax/Locations.ts @@ -44,7 +44,7 @@ export class LocationResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/tax/locations/${id}`, + `/v1/tax/locations/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/TaxFunds.ts b/src/resources/TaxFunds.ts index 22e7372c3c..a596556f22 100644 --- a/src/resources/TaxFunds.ts +++ b/src/resources/TaxFunds.ts @@ -27,7 +27,7 @@ export class TaxFundResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/tax_funds/${id}`, + `/v1/tax_funds/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/Terminal/ReaderCollectedData.ts b/src/resources/Terminal/ReaderCollectedData.ts index 6cebf62e48..b1729b45f4 100644 --- a/src/resources/Terminal/ReaderCollectedData.ts +++ b/src/resources/Terminal/ReaderCollectedData.ts @@ -14,7 +14,7 @@ export class ReaderCollectedDatumResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v1/terminal/reader_collected_data/${id}`, + `/v1/terminal/reader_collected_data/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/TestHelpers/Capital/FinancingOffers.ts b/src/resources/TestHelpers/Capital/FinancingOffers.ts index e973be791a..cee5b10698 100644 --- a/src/resources/TestHelpers/Capital/FinancingOffers.ts +++ b/src/resources/TestHelpers/Capital/FinancingOffers.ts @@ -29,7 +29,9 @@ export class FinancingOfferResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/capital/financing_offers/${id}/refill`, + `/v1/test_helpers/capital/financing_offers/${encodeURIComponent( + id + )}/refill`, params, options ) as any; diff --git a/src/resources/TestHelpers/Issuing/Disputes.ts b/src/resources/TestHelpers/Issuing/Disputes.ts index d9d37dbc05..d752b71eb0 100644 --- a/src/resources/TestHelpers/Issuing/Disputes.ts +++ b/src/resources/TestHelpers/Issuing/Disputes.ts @@ -15,7 +15,7 @@ export class DisputeResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/issuing/disputes/${id}/close`, + `/v1/test_helpers/issuing/disputes/${encodeURIComponent(id)}/close`, params, options ) as any; @@ -30,7 +30,9 @@ export class DisputeResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/issuing/disputes/${id}/simulate_network_lifecycle_dispute_response`, + `/v1/test_helpers/issuing/disputes/${encodeURIComponent( + id + )}/simulate_network_lifecycle_dispute_response`, params, options ) as any; @@ -45,7 +47,9 @@ export class DisputeResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/issuing/disputes/${id}/simulate_network_lifecycle_pre_arbitration_response`, + `/v1/test_helpers/issuing/disputes/${encodeURIComponent( + id + )}/simulate_network_lifecycle_pre_arbitration_response`, params, options ) as any; @@ -60,7 +64,9 @@ export class DisputeResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/issuing/disputes/${id}/simulate_network_lifecycle_pre_arbitration_submission`, + `/v1/test_helpers/issuing/disputes/${encodeURIComponent( + id + )}/simulate_network_lifecycle_pre_arbitration_submission`, params, options ) as any; diff --git a/src/resources/TestHelpers/PaymentIntents.ts b/src/resources/TestHelpers/PaymentIntents.ts index c0b62de5d4..7a79e86097 100644 --- a/src/resources/TestHelpers/PaymentIntents.ts +++ b/src/resources/TestHelpers/PaymentIntents.ts @@ -15,7 +15,9 @@ export class PaymentIntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/payment_intents/${id}/simulate_crypto_deposit`, + `/v1/test_helpers/payment_intents/${encodeURIComponent( + id + )}/simulate_crypto_deposit`, params, options ) as any; diff --git a/src/resources/TestHelpers/SharedPayment/GrantedTokens.ts b/src/resources/TestHelpers/SharedPayment/GrantedTokens.ts index 75154ceef1..96d2b4b783 100644 --- a/src/resources/TestHelpers/SharedPayment/GrantedTokens.ts +++ b/src/resources/TestHelpers/SharedPayment/GrantedTokens.ts @@ -30,7 +30,9 @@ export class GrantedTokenResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v1/test_helpers/shared_payment/granted_tokens/${id}/revoke`, + `/v1/test_helpers/shared_payment/granted_tokens/${encodeURIComponent( + id + )}/revoke`, params, options ) as any; diff --git a/src/resources/V2/Billing/BillSettings.ts b/src/resources/V2/Billing/BillSettings.ts index 5c9e94a0c6..ffda233d72 100644 --- a/src/resources/V2/Billing/BillSettings.ts +++ b/src/resources/V2/Billing/BillSettings.ts @@ -52,7 +52,7 @@ export class BillSettingResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/billing/bill_settings/${id}`, + `/v2/billing/bill_settings/${encodeURIComponent(id)}`, params, options ) as any; @@ -67,7 +67,7 @@ export class BillSettingResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/billing/bill_settings/${id}`, + `/v2/billing/bill_settings/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/Billing/BillSettings/Versions.ts b/src/resources/V2/Billing/BillSettings/Versions.ts index 24d6469955..a668dfffdb 100644 --- a/src/resources/V2/Billing/BillSettings/Versions.ts +++ b/src/resources/V2/Billing/BillSettings/Versions.ts @@ -15,7 +15,7 @@ export class VersionResource extends StripeResource { ): V2ListPromise { return this._makeRequest( 'GET', - `/v2/billing/bill_settings/${billSettingId}/versions`, + `/v2/billing/bill_settings/${encodeURIComponent(billSettingId)}/versions`, params, options, { @@ -34,7 +34,9 @@ export class VersionResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/billing/bill_settings/${billSettingId}/versions/${id}`, + `/v2/billing/bill_settings/${encodeURIComponent( + billSettingId + )}/versions/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/Billing/Cadences.ts b/src/resources/V2/Billing/Cadences.ts index 830821c6c3..00628725f3 100644 --- a/src/resources/V2/Billing/Cadences.ts +++ b/src/resources/V2/Billing/Cadences.ts @@ -133,7 +133,7 @@ export class CadenceResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/billing/cadences/${id}`, + `/v2/billing/cadences/${encodeURIComponent(id)}`, params, options, { @@ -191,7 +191,7 @@ export class CadenceResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/billing/cadences/${id}`, + `/v2/billing/cadences/${encodeURIComponent(id)}`, params, options, { @@ -249,7 +249,7 @@ export class CadenceResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/billing/cadences/${id}/cancel`, + `/v2/billing/cadences/${encodeURIComponent(id)}/cancel`, params, options, { diff --git a/src/resources/V2/Billing/Cadences/SpendModifierRules.ts b/src/resources/V2/Billing/Cadences/SpendModifierRules.ts index 8fee1738fe..55cc6d4fa0 100644 --- a/src/resources/V2/Billing/Cadences/SpendModifierRules.ts +++ b/src/resources/V2/Billing/Cadences/SpendModifierRules.ts @@ -15,7 +15,9 @@ export class SpendModifierRuleResource extends StripeResource { ): V2ListPromise { return this._makeRequest( 'GET', - `/v2/billing/cadences/${cadenceId}/spend_modifier_rules`, + `/v2/billing/cadences/${encodeURIComponent( + cadenceId + )}/spend_modifier_rules`, params, options, { @@ -34,7 +36,9 @@ export class SpendModifierRuleResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/billing/cadences/${cadenceId}/spend_modifier_rules/${id}`, + `/v2/billing/cadences/${encodeURIComponent( + cadenceId + )}/spend_modifier_rules/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/Billing/CollectionSettings.ts b/src/resources/V2/Billing/CollectionSettings.ts index a5a20ac576..cc654f6ff6 100644 --- a/src/resources/V2/Billing/CollectionSettings.ts +++ b/src/resources/V2/Billing/CollectionSettings.ts @@ -119,7 +119,7 @@ export class CollectionSettingResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/billing/collection_settings/${id}`, + `/v2/billing/collection_settings/${encodeURIComponent(id)}`, params, options, { @@ -155,7 +155,7 @@ export class CollectionSettingResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/billing/collection_settings/${id}`, + `/v2/billing/collection_settings/${encodeURIComponent(id)}`, params, options, { diff --git a/src/resources/V2/Billing/CollectionSettings/Versions.ts b/src/resources/V2/Billing/CollectionSettings/Versions.ts index d0a44d4274..68cebe3149 100644 --- a/src/resources/V2/Billing/CollectionSettings/Versions.ts +++ b/src/resources/V2/Billing/CollectionSettings/Versions.ts @@ -15,7 +15,9 @@ export class VersionResource extends StripeResource { ): V2ListPromise { return this._makeRequest( 'GET', - `/v2/billing/collection_settings/${collectionSettingId}/versions`, + `/v2/billing/collection_settings/${encodeURIComponent( + collectionSettingId + )}/versions`, params, options, { @@ -61,7 +63,9 @@ export class VersionResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/billing/collection_settings/${collectionSettingId}/versions/${id}`, + `/v2/billing/collection_settings/${encodeURIComponent( + collectionSettingId + )}/versions/${encodeURIComponent(id)}`, params, options, { diff --git a/src/resources/V2/Billing/Contracts.ts b/src/resources/V2/Billing/Contracts.ts index 7dad3ef4db..936a4a1b79 100644 --- a/src/resources/V2/Billing/Contracts.ts +++ b/src/resources/V2/Billing/Contracts.ts @@ -172,7 +172,7 @@ export class ContractResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/billing/contracts/${id}`, + `/v2/billing/contracts/${encodeURIComponent(id)}`, params, options, { @@ -229,7 +229,7 @@ export class ContractResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/billing/contracts/${id}`, + `/v2/billing/contracts/${encodeURIComponent(id)}`, params, options, { @@ -316,7 +316,7 @@ export class ContractResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/billing/contracts/${id}/activate`, + `/v2/billing/contracts/${encodeURIComponent(id)}/activate`, params, options, { @@ -373,7 +373,7 @@ export class ContractResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/billing/contracts/${id}/cancel`, + `/v2/billing/contracts/${encodeURIComponent(id)}/cancel`, params, options, { diff --git a/src/resources/V2/Billing/Contracts/LicensePricing/QuantityChanges.ts b/src/resources/V2/Billing/Contracts/LicensePricing/QuantityChanges.ts index 915edf81f1..5a045c9bd0 100644 --- a/src/resources/V2/Billing/Contracts/LicensePricing/QuantityChanges.ts +++ b/src/resources/V2/Billing/Contracts/LicensePricing/QuantityChanges.ts @@ -16,7 +16,11 @@ export class QuantityChangeResource extends StripeResource { ): V2ListPromise { return this._makeRequest( 'GET', - `/v2/billing/contracts/${contractId}/license_pricing/${licensePricingId}/quantity_changes`, + `/v2/billing/contracts/${encodeURIComponent( + contractId + )}/license_pricing/${encodeURIComponent( + licensePricingId + )}/quantity_changes`, params, options, { diff --git a/src/resources/V2/Billing/CustomPricingUnits.ts b/src/resources/V2/Billing/CustomPricingUnits.ts index f70fb1f548..6e7cd59efe 100644 --- a/src/resources/V2/Billing/CustomPricingUnits.ts +++ b/src/resources/V2/Billing/CustomPricingUnits.ts @@ -46,7 +46,7 @@ export class CustomPricingUnitResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/billing/custom_pricing_units/${id}`, + `/v2/billing/custom_pricing_units/${encodeURIComponent(id)}`, params, options ) as any; @@ -61,7 +61,7 @@ export class CustomPricingUnitResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/billing/custom_pricing_units/${id}`, + `/v2/billing/custom_pricing_units/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/Billing/Intents.ts b/src/resources/V2/Billing/Intents.ts index 625d5dc772..55cc75bbc5 100644 --- a/src/resources/V2/Billing/Intents.ts +++ b/src/resources/V2/Billing/Intents.ts @@ -70,7 +70,7 @@ export class IntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/billing/intents/${id}`, + `/v2/billing/intents/${encodeURIComponent(id)}`, params, options ) as any; @@ -85,7 +85,7 @@ export class IntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/billing/intents/${id}/cancel`, + `/v2/billing/intents/${encodeURIComponent(id)}/cancel`, params, options ) as any; @@ -100,7 +100,7 @@ export class IntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/billing/intents/${id}/commit`, + `/v2/billing/intents/${encodeURIComponent(id)}/commit`, params, options ) as any; @@ -115,7 +115,7 @@ export class IntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/billing/intents/${id}/release_reservation`, + `/v2/billing/intents/${encodeURIComponent(id)}/release_reservation`, params, options ) as any; @@ -130,7 +130,7 @@ export class IntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/billing/intents/${id}/reserve`, + `/v2/billing/intents/${encodeURIComponent(id)}/reserve`, params, options ) as any; diff --git a/src/resources/V2/Billing/Intents/Actions.ts b/src/resources/V2/Billing/Intents/Actions.ts index a5db0334f3..19ff6a539e 100644 --- a/src/resources/V2/Billing/Intents/Actions.ts +++ b/src/resources/V2/Billing/Intents/Actions.ts @@ -15,7 +15,7 @@ export class ActionResource extends StripeResource { ): V2ListPromise { return this._makeRequest( 'GET', - `/v2/billing/intents/${intentId}/actions`, + `/v2/billing/intents/${encodeURIComponent(intentId)}/actions`, params, options, { @@ -61,7 +61,9 @@ export class ActionResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/billing/intents/${intentId}/actions/${id}`, + `/v2/billing/intents/${encodeURIComponent( + intentId + )}/actions/${encodeURIComponent(id)}`, params, options, { diff --git a/src/resources/V2/Billing/LicenseFees.ts b/src/resources/V2/Billing/LicenseFees.ts index 4b1ba1cefd..76e58bc2f2 100644 --- a/src/resources/V2/Billing/LicenseFees.ts +++ b/src/resources/V2/Billing/LicenseFees.ts @@ -112,7 +112,7 @@ export class LicenseFeeResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/billing/license_fees/${id}`, + `/v2/billing/license_fees/${encodeURIComponent(id)}`, params, options, { @@ -145,7 +145,7 @@ export class LicenseFeeResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/billing/license_fees/${id}`, + `/v2/billing/license_fees/${encodeURIComponent(id)}`, params, options, { diff --git a/src/resources/V2/Billing/LicenseFees/Versions.ts b/src/resources/V2/Billing/LicenseFees/Versions.ts index d6d0251efa..da7b41eba1 100644 --- a/src/resources/V2/Billing/LicenseFees/Versions.ts +++ b/src/resources/V2/Billing/LicenseFees/Versions.ts @@ -15,7 +15,7 @@ export class VersionResource extends StripeResource { ): V2ListPromise { return this._makeRequest( 'GET', - `/v2/billing/license_fees/${licenseFeeId}/versions`, + `/v2/billing/license_fees/${encodeURIComponent(licenseFeeId)}/versions`, params, options, { @@ -58,7 +58,9 @@ export class VersionResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/billing/license_fees/${licenseFeeId}/versions/${id}`, + `/v2/billing/license_fees/${encodeURIComponent( + licenseFeeId + )}/versions/${encodeURIComponent(id)}`, params, options, { diff --git a/src/resources/V2/Billing/LicensedItems.ts b/src/resources/V2/Billing/LicensedItems.ts index 6303c2eced..db1627e9d9 100644 --- a/src/resources/V2/Billing/LicensedItems.ts +++ b/src/resources/V2/Billing/LicensedItems.ts @@ -46,7 +46,7 @@ export class LicensedItemResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/billing/licensed_items/${id}`, + `/v2/billing/licensed_items/${encodeURIComponent(id)}`, params, options ) as any; @@ -61,7 +61,7 @@ export class LicensedItemResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/billing/licensed_items/${id}`, + `/v2/billing/licensed_items/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/Billing/MeteredItems.ts b/src/resources/V2/Billing/MeteredItems.ts index b11ac494ef..880cc6a31d 100644 --- a/src/resources/V2/Billing/MeteredItems.ts +++ b/src/resources/V2/Billing/MeteredItems.ts @@ -46,7 +46,7 @@ export class MeteredItemResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/billing/metered_items/${id}`, + `/v2/billing/metered_items/${encodeURIComponent(id)}`, params, options ) as any; @@ -61,7 +61,7 @@ export class MeteredItemResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/billing/metered_items/${id}`, + `/v2/billing/metered_items/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/Billing/OneTimeItems.ts b/src/resources/V2/Billing/OneTimeItems.ts index 8250c319fc..c8d6c57855 100644 --- a/src/resources/V2/Billing/OneTimeItems.ts +++ b/src/resources/V2/Billing/OneTimeItems.ts @@ -46,7 +46,7 @@ export class OneTimeItemResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/billing/one_time_items/${id}`, + `/v2/billing/one_time_items/${encodeURIComponent(id)}`, params, options ) as any; @@ -61,7 +61,7 @@ export class OneTimeItemResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/billing/one_time_items/${id}`, + `/v2/billing/one_time_items/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/Billing/PricingPlanSubscriptions.ts b/src/resources/V2/Billing/PricingPlanSubscriptions.ts index a940bf8b74..8618d1fc1a 100644 --- a/src/resources/V2/Billing/PricingPlanSubscriptions.ts +++ b/src/resources/V2/Billing/PricingPlanSubscriptions.ts @@ -106,7 +106,7 @@ export class PricingPlanSubscriptionResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/billing/pricing_plan_subscriptions/${id}`, + `/v2/billing/pricing_plan_subscriptions/${encodeURIComponent(id)}`, params, options, { @@ -185,7 +185,7 @@ export class PricingPlanSubscriptionResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/billing/pricing_plan_subscriptions/${id}`, + `/v2/billing/pricing_plan_subscriptions/${encodeURIComponent(id)}`, params, options, { @@ -264,7 +264,9 @@ export class PricingPlanSubscriptionResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/billing/pricing_plan_subscriptions/${id}/remove_discounts`, + `/v2/billing/pricing_plan_subscriptions/${encodeURIComponent( + id + )}/remove_discounts`, params, options, { diff --git a/src/resources/V2/Billing/PricingPlans.ts b/src/resources/V2/Billing/PricingPlans.ts index 441d17d66a..524758d63a 100644 --- a/src/resources/V2/Billing/PricingPlans.ts +++ b/src/resources/V2/Billing/PricingPlans.ts @@ -56,7 +56,7 @@ export class PricingPlanResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/billing/pricing_plans/${id}`, + `/v2/billing/pricing_plans/${encodeURIComponent(id)}`, params, options ) as any; @@ -71,7 +71,7 @@ export class PricingPlanResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/billing/pricing_plans/${id}`, + `/v2/billing/pricing_plans/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/Billing/PricingPlans/Components.ts b/src/resources/V2/Billing/PricingPlans/Components.ts index 757d8fa964..afc1976253 100644 --- a/src/resources/V2/Billing/PricingPlans/Components.ts +++ b/src/resources/V2/Billing/PricingPlans/Components.ts @@ -17,7 +17,9 @@ export class ComponentResource extends StripeResource { ): V2ListPromise { return this._makeRequest( 'GET', - `/v2/billing/pricing_plans/${pricingPlanId}/components`, + `/v2/billing/pricing_plans/${encodeURIComponent( + pricingPlanId + )}/components`, params, options, { @@ -35,7 +37,9 @@ export class ComponentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/billing/pricing_plans/${pricingPlanId}/components`, + `/v2/billing/pricing_plans/${encodeURIComponent( + pricingPlanId + )}/components`, params, options ) as any; @@ -51,7 +55,9 @@ export class ComponentResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v2/billing/pricing_plans/${pricingPlanId}/components/${id}`, + `/v2/billing/pricing_plans/${encodeURIComponent( + pricingPlanId + )}/components/${encodeURIComponent(id)}`, params, options ) as any; @@ -67,7 +73,9 @@ export class ComponentResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/billing/pricing_plans/${pricingPlanId}/components/${id}`, + `/v2/billing/pricing_plans/${encodeURIComponent( + pricingPlanId + )}/components/${encodeURIComponent(id)}`, params, options ) as any; @@ -83,7 +91,9 @@ export class ComponentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/billing/pricing_plans/${pricingPlanId}/components/${id}`, + `/v2/billing/pricing_plans/${encodeURIComponent( + pricingPlanId + )}/components/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/Billing/PricingPlans/Versions.ts b/src/resources/V2/Billing/PricingPlans/Versions.ts index 976962a740..9b883d5f88 100644 --- a/src/resources/V2/Billing/PricingPlans/Versions.ts +++ b/src/resources/V2/Billing/PricingPlans/Versions.ts @@ -15,7 +15,7 @@ export class VersionResource extends StripeResource { ): V2ListPromise { return this._makeRequest( 'GET', - `/v2/billing/pricing_plans/${pricingPlanId}/versions`, + `/v2/billing/pricing_plans/${encodeURIComponent(pricingPlanId)}/versions`, params, options, { @@ -34,7 +34,9 @@ export class VersionResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/billing/pricing_plans/${pricingPlanId}/versions/${id}`, + `/v2/billing/pricing_plans/${encodeURIComponent( + pricingPlanId + )}/versions/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/Billing/Profiles.ts b/src/resources/V2/Billing/Profiles.ts index 499df2a83c..9e52d4bcaf 100644 --- a/src/resources/V2/Billing/Profiles.ts +++ b/src/resources/V2/Billing/Profiles.ts @@ -40,7 +40,7 @@ export class ProfileResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/billing/profiles/${id}`, + `/v2/billing/profiles/${encodeURIComponent(id)}`, params, options ) as any; @@ -55,7 +55,7 @@ export class ProfileResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/billing/profiles/${id}`, + `/v2/billing/profiles/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/Billing/RateCardSubscriptions.ts b/src/resources/V2/Billing/RateCardSubscriptions.ts index 1b096a9074..7acccff75b 100644 --- a/src/resources/V2/Billing/RateCardSubscriptions.ts +++ b/src/resources/V2/Billing/RateCardSubscriptions.ts @@ -46,7 +46,7 @@ export class RateCardSubscriptionResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/billing/rate_card_subscriptions/${id}`, + `/v2/billing/rate_card_subscriptions/${encodeURIComponent(id)}`, params, options ) as any; @@ -61,7 +61,7 @@ export class RateCardSubscriptionResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/billing/rate_card_subscriptions/${id}`, + `/v2/billing/rate_card_subscriptions/${encodeURIComponent(id)}`, params, options ) as any; @@ -76,7 +76,7 @@ export class RateCardSubscriptionResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/billing/rate_card_subscriptions/${id}/cancel`, + `/v2/billing/rate_card_subscriptions/${encodeURIComponent(id)}/cancel`, params, options ) as any; diff --git a/src/resources/V2/Billing/RateCards.ts b/src/resources/V2/Billing/RateCards.ts index 82d65933f1..fd36a4776c 100644 --- a/src/resources/V2/Billing/RateCards.ts +++ b/src/resources/V2/Billing/RateCards.ts @@ -56,7 +56,7 @@ export class RateCardResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/billing/rate_cards/${id}`, + `/v2/billing/rate_cards/${encodeURIComponent(id)}`, params, options ) as any; @@ -71,7 +71,7 @@ export class RateCardResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/billing/rate_cards/${id}`, + `/v2/billing/rate_cards/${encodeURIComponent(id)}`, params, options ) as any; @@ -86,7 +86,7 @@ export class RateCardResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/billing/rate_cards/${id}/modify_rates`, + `/v2/billing/rate_cards/${encodeURIComponent(id)}/modify_rates`, params, options, { diff --git a/src/resources/V2/Billing/RateCards/CustomPricingUnitOverageRates.ts b/src/resources/V2/Billing/RateCards/CustomPricingUnitOverageRates.ts index 5513b4d5aa..e179874be9 100644 --- a/src/resources/V2/Billing/RateCards/CustomPricingUnitOverageRates.ts +++ b/src/resources/V2/Billing/RateCards/CustomPricingUnitOverageRates.ts @@ -17,7 +17,9 @@ export class CustomPricingUnitOverageRateResource extends StripeResource { ): V2ListPromise { return this._makeRequest( 'GET', - `/v2/billing/rate_cards/${rateCardId}/custom_pricing_unit_overage_rates`, + `/v2/billing/rate_cards/${encodeURIComponent( + rateCardId + )}/custom_pricing_unit_overage_rates`, params, options, { @@ -35,7 +37,9 @@ export class CustomPricingUnitOverageRateResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/billing/rate_cards/${rateCardId}/custom_pricing_unit_overage_rates`, + `/v2/billing/rate_cards/${encodeURIComponent( + rateCardId + )}/custom_pricing_unit_overage_rates`, params, options ) as any; @@ -51,7 +55,9 @@ export class CustomPricingUnitOverageRateResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v2/billing/rate_cards/${rateCardId}/custom_pricing_unit_overage_rates/${id}`, + `/v2/billing/rate_cards/${encodeURIComponent( + rateCardId + )}/custom_pricing_unit_overage_rates/${encodeURIComponent(id)}`, params, options ) as any; @@ -67,7 +73,9 @@ export class CustomPricingUnitOverageRateResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/billing/rate_cards/${rateCardId}/custom_pricing_unit_overage_rates/${id}`, + `/v2/billing/rate_cards/${encodeURIComponent( + rateCardId + )}/custom_pricing_unit_overage_rates/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/Billing/RateCards/Rates.ts b/src/resources/V2/Billing/RateCards/Rates.ts index 9b2526d368..7a7383024a 100644 --- a/src/resources/V2/Billing/RateCards/Rates.ts +++ b/src/resources/V2/Billing/RateCards/Rates.ts @@ -17,7 +17,7 @@ export class RateResource extends StripeResource { ): V2ListPromise { return this._makeRequest( 'GET', - `/v2/billing/rate_cards/${rateCardId}/rates`, + `/v2/billing/rate_cards/${encodeURIComponent(rateCardId)}/rates`, params, options, { @@ -60,7 +60,7 @@ export class RateResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/billing/rate_cards/${rateCardId}/rates`, + `/v2/billing/rate_cards/${encodeURIComponent(rateCardId)}/rates`, params, options, { @@ -110,7 +110,9 @@ export class RateResource extends StripeResource { ): Promise> { return this._makeRequest( 'DELETE', - `/v2/billing/rate_cards/${rateCardId}/rates/${id}`, + `/v2/billing/rate_cards/${encodeURIComponent( + rateCardId + )}/rates/${encodeURIComponent(id)}`, params, options ) as any; @@ -126,7 +128,9 @@ export class RateResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/billing/rate_cards/${rateCardId}/rates/${id}`, + `/v2/billing/rate_cards/${encodeURIComponent( + rateCardId + )}/rates/${encodeURIComponent(id)}`, params, options, { diff --git a/src/resources/V2/Billing/RateCards/Versions.ts b/src/resources/V2/Billing/RateCards/Versions.ts index bb9b36ab12..4908aa3ca8 100644 --- a/src/resources/V2/Billing/RateCards/Versions.ts +++ b/src/resources/V2/Billing/RateCards/Versions.ts @@ -15,7 +15,7 @@ export class VersionResource extends StripeResource { ): V2ListPromise { return this._makeRequest( 'GET', - `/v2/billing/rate_cards/${rateCardId}/versions`, + `/v2/billing/rate_cards/${encodeURIComponent(rateCardId)}/versions`, params, options, { @@ -34,7 +34,9 @@ export class VersionResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/billing/rate_cards/${rateCardId}/versions/${id}`, + `/v2/billing/rate_cards/${encodeURIComponent( + rateCardId + )}/versions/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/Billing/ServiceActions.ts b/src/resources/V2/Billing/ServiceActions.ts index 1d343ca6ff..d0d6e039b9 100644 --- a/src/resources/V2/Billing/ServiceActions.ts +++ b/src/resources/V2/Billing/ServiceActions.ts @@ -99,7 +99,7 @@ export class ServiceActionResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/billing/service_actions/${id}`, + `/v2/billing/service_actions/${encodeURIComponent(id)}`, params, options, { @@ -149,7 +149,7 @@ export class ServiceActionResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/billing/service_actions/${id}`, + `/v2/billing/service_actions/${encodeURIComponent(id)}`, params, options, { diff --git a/src/resources/V2/Core/Accounts/PersonTokens.ts b/src/resources/V2/Core/Accounts/PersonTokens.ts index 628582b6ef..a76fc137e6 100644 --- a/src/resources/V2/Core/Accounts/PersonTokens.ts +++ b/src/resources/V2/Core/Accounts/PersonTokens.ts @@ -18,7 +18,7 @@ export class PersonTokenResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/core/accounts/${accountId}/person_tokens`, + `/v2/core/accounts/${encodeURIComponent(accountId)}/person_tokens`, params, options, { diff --git a/src/resources/V2/Core/Accounts/Persons.ts b/src/resources/V2/Core/Accounts/Persons.ts index 782ad22144..d76eac58c5 100644 --- a/src/resources/V2/Core/Accounts/Persons.ts +++ b/src/resources/V2/Core/Accounts/Persons.ts @@ -23,7 +23,7 @@ export class PersonResource extends StripeResource { ): V2ListPromise { return this._makeRequest( 'GET', - `/v2/core/accounts/${accountId}/persons`, + `/v2/core/accounts/${encodeURIComponent(accountId)}/persons`, params, options, { @@ -59,7 +59,7 @@ export class PersonResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/core/accounts/${accountId}/persons`, + `/v2/core/accounts/${encodeURIComponent(accountId)}/persons`, params, options, { diff --git a/src/resources/V2/Core/ApprovalRequests.ts b/src/resources/V2/Core/ApprovalRequests.ts index bb8c49f515..0bb461a0a5 100644 --- a/src/resources/V2/Core/ApprovalRequests.ts +++ b/src/resources/V2/Core/ApprovalRequests.ts @@ -33,7 +33,7 @@ export class ApprovalRequestResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/core/approval_requests/${id}`, + `/v2/core/approval_requests/${encodeURIComponent(id)}`, params, options ) as any; @@ -49,7 +49,7 @@ export class ApprovalRequestResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/core/approval_requests/${id}/cancel`, + `/v2/core/approval_requests/${encodeURIComponent(id)}/cancel`, params, options ) as any; @@ -65,7 +65,7 @@ export class ApprovalRequestResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/core/approval_requests/${id}/execute`, + `/v2/core/approval_requests/${encodeURIComponent(id)}/execute`, params, options ) as any; @@ -81,7 +81,7 @@ export class ApprovalRequestResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/core/approval_requests/${id}/submit`, + `/v2/core/approval_requests/${encodeURIComponent(id)}/submit`, params, options ) as any; diff --git a/src/resources/V2/Core/BatchJobs.ts b/src/resources/V2/Core/BatchJobs.ts index c5fdc3186a..21bd1d2773 100644 --- a/src/resources/V2/Core/BatchJobs.ts +++ b/src/resources/V2/Core/BatchJobs.ts @@ -90,7 +90,7 @@ export class BatchJobResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/core/batch_jobs/${id}`, + `/v2/core/batch_jobs/${encodeURIComponent(id)}`, params, options, { @@ -172,7 +172,7 @@ export class BatchJobResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/core/batch_jobs/${id}/cancel`, + `/v2/core/batch_jobs/${encodeURIComponent(id)}/cancel`, params, options, { diff --git a/src/resources/V2/Core/ClaimableSandboxes.ts b/src/resources/V2/Core/ClaimableSandboxes.ts index 9be58df862..ea4ad97532 100644 --- a/src/resources/V2/Core/ClaimableSandboxes.ts +++ b/src/resources/V2/Core/ClaimableSandboxes.ts @@ -31,7 +31,7 @@ export class ClaimableSandboxResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/core/claimable_sandboxes/${id}`, + `/v2/core/claimable_sandboxes/${encodeURIComponent(id)}`, params, options ) as any; @@ -47,7 +47,9 @@ export class ClaimableSandboxResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/core/claimable_sandboxes/${id}/renew_onboarding_link`, + `/v2/core/claimable_sandboxes/${encodeURIComponent( + id + )}/renew_onboarding_link`, params, options ) as any; diff --git a/src/resources/V2/Core/ConnectionSessions.ts b/src/resources/V2/Core/ConnectionSessions.ts index f77a56333f..8a792eff45 100644 --- a/src/resources/V2/Core/ConnectionSessions.ts +++ b/src/resources/V2/Core/ConnectionSessions.ts @@ -28,7 +28,7 @@ export class ConnectionSessionResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/core/connection_sessions/${id}`, + `/v2/core/connection_sessions/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/Core/FeeBatches.ts b/src/resources/V2/Core/FeeBatches.ts index 3fae250c12..3e1a3f728d 100644 --- a/src/resources/V2/Core/FeeBatches.ts +++ b/src/resources/V2/Core/FeeBatches.ts @@ -25,7 +25,7 @@ export class FeeBatchResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/core/fee_batches/${id}`, + `/v2/core/fee_batches/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/Core/FeeEntries.ts b/src/resources/V2/Core/FeeEntries.ts index 4aa75167f5..f7286198b5 100644 --- a/src/resources/V2/Core/FeeEntries.ts +++ b/src/resources/V2/Core/FeeEntries.ts @@ -25,7 +25,7 @@ export class FeeEntryResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/core/fee_entries/${id}`, + `/v2/core/fee_entries/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/Core/Vault/GbBankAccounts.ts b/src/resources/V2/Core/Vault/GbBankAccounts.ts index 805a47d36f..b32df03947 100644 --- a/src/resources/V2/Core/Vault/GbBankAccounts.ts +++ b/src/resources/V2/Core/Vault/GbBankAccounts.ts @@ -45,7 +45,7 @@ export class GbBankAccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/core/vault/gb_bank_accounts/${id}`, + `/v2/core/vault/gb_bank_accounts/${encodeURIComponent(id)}`, params, options ) as any; @@ -63,7 +63,9 @@ export class GbBankAccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/core/vault/gb_bank_accounts/${id}/acknowledge_confirmation_of_payee`, + `/v2/core/vault/gb_bank_accounts/${encodeURIComponent( + id + )}/acknowledge_confirmation_of_payee`, params, options ) as any; @@ -79,7 +81,7 @@ export class GbBankAccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/core/vault/gb_bank_accounts/${id}/archive`, + `/v2/core/vault/gb_bank_accounts/${encodeURIComponent(id)}/archive`, params, options ) as any; @@ -97,7 +99,9 @@ export class GbBankAccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/core/vault/gb_bank_accounts/${id}/initiate_confirmation_of_payee`, + `/v2/core/vault/gb_bank_accounts/${encodeURIComponent( + id + )}/initiate_confirmation_of_payee`, params, options ) as any; diff --git a/src/resources/V2/Core/Vault/UsBankAccounts.ts b/src/resources/V2/Core/Vault/UsBankAccounts.ts index 0ba8313baa..adb5b1e118 100644 --- a/src/resources/V2/Core/Vault/UsBankAccounts.ts +++ b/src/resources/V2/Core/Vault/UsBankAccounts.ts @@ -48,7 +48,7 @@ export class UsBankAccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/core/vault/us_bank_accounts/${id}`, + `/v2/core/vault/us_bank_accounts/${encodeURIComponent(id)}`, params, options ) as any; @@ -66,7 +66,7 @@ export class UsBankAccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/core/vault/us_bank_accounts/${id}`, + `/v2/core/vault/us_bank_accounts/${encodeURIComponent(id)}`, params, options ) as any; @@ -85,7 +85,7 @@ export class UsBankAccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/core/vault/us_bank_accounts/${id}/archive`, + `/v2/core/vault/us_bank_accounts/${encodeURIComponent(id)}/archive`, params, options ) as any; @@ -100,7 +100,9 @@ export class UsBankAccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/core/vault/us_bank_accounts/${id}/confirm_microdeposits`, + `/v2/core/vault/us_bank_accounts/${encodeURIComponent( + id + )}/confirm_microdeposits`, params, options ) as any; @@ -115,7 +117,9 @@ export class UsBankAccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/core/vault/us_bank_accounts/${id}/send_microdeposits`, + `/v2/core/vault/us_bank_accounts/${encodeURIComponent( + id + )}/send_microdeposits`, params, options ) as any; diff --git a/src/resources/V2/Data/Reporting/QueryRuns.ts b/src/resources/V2/Data/Reporting/QueryRuns.ts index 3e8455bebe..a8aba72607 100644 --- a/src/resources/V2/Data/Reporting/QueryRuns.ts +++ b/src/resources/V2/Data/Reporting/QueryRuns.ts @@ -42,7 +42,7 @@ export class QueryRunResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/data/reporting/query_runs/${id}`, + `/v2/data/reporting/query_runs/${encodeURIComponent(id)}`, params, options, { diff --git a/src/resources/V2/Extend/WorkflowRuns.ts b/src/resources/V2/Extend/WorkflowRuns.ts index 28c44b1488..c7ad21a4be 100644 --- a/src/resources/V2/Extend/WorkflowRuns.ts +++ b/src/resources/V2/Extend/WorkflowRuns.ts @@ -31,7 +31,7 @@ export class WorkflowRunResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/extend/workflow_runs/${id}`, + `/v2/extend/workflow_runs/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/Extend/Workflows.ts b/src/resources/V2/Extend/Workflows.ts index 7fe1cfbfed..76fcd745cd 100644 --- a/src/resources/V2/Extend/Workflows.ts +++ b/src/resources/V2/Extend/Workflows.ts @@ -26,7 +26,7 @@ export class WorkflowResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/extend/workflows/${id}`, + `/v2/extend/workflows/${encodeURIComponent(id)}`, params, options ) as any; @@ -42,7 +42,7 @@ export class WorkflowResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/extend/workflows/${id}/invoke`, + `/v2/extend/workflows/${encodeURIComponent(id)}/invoke`, params, options ) as any; diff --git a/src/resources/V2/Iam/ActivityLogs.ts b/src/resources/V2/Iam/ActivityLogs.ts index 7a91da249c..276daf9a38 100644 --- a/src/resources/V2/Iam/ActivityLogs.ts +++ b/src/resources/V2/Iam/ActivityLogs.ts @@ -25,7 +25,7 @@ export class ActivityLogResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/iam/activity_logs/${id}`, + `/v2/iam/activity_logs/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/Iam/ApiKeys.ts b/src/resources/V2/Iam/ApiKeys.ts index 35e2fb996c..b9bda17cf0 100644 --- a/src/resources/V2/Iam/ApiKeys.ts +++ b/src/resources/V2/Iam/ApiKeys.ts @@ -39,7 +39,7 @@ export class ApiKeyResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/iam/api_keys/${id}`, + `/v2/iam/api_keys/${encodeURIComponent(id)}`, params, options ) as any; @@ -54,7 +54,7 @@ export class ApiKeyResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/iam/api_keys/${id}`, + `/v2/iam/api_keys/${encodeURIComponent(id)}`, params, options ) as any; @@ -69,7 +69,7 @@ export class ApiKeyResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/iam/api_keys/${id}/expire`, + `/v2/iam/api_keys/${encodeURIComponent(id)}/expire`, params, options ) as any; @@ -84,7 +84,7 @@ export class ApiKeyResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/iam/api_keys/${id}/rotate`, + `/v2/iam/api_keys/${encodeURIComponent(id)}/rotate`, params, options ) as any; diff --git a/src/resources/V2/MoneyManagement/Adjustments.ts b/src/resources/V2/MoneyManagement/Adjustments.ts index d295ab2143..efee1d8a26 100644 --- a/src/resources/V2/MoneyManagement/Adjustments.ts +++ b/src/resources/V2/MoneyManagement/Adjustments.ts @@ -32,7 +32,7 @@ export class AdjustmentResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/money_management/adjustments/${id}`, + `/v2/money_management/adjustments/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/MoneyManagement/CurrencyConversions.ts b/src/resources/V2/MoneyManagement/CurrencyConversions.ts index f3883f514b..c653f20c8e 100644 --- a/src/resources/V2/MoneyManagement/CurrencyConversions.ts +++ b/src/resources/V2/MoneyManagement/CurrencyConversions.ts @@ -48,7 +48,7 @@ export class CurrencyConversionResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/money_management/currency_conversions/${id}`, + `/v2/money_management/currency_conversions/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/MoneyManagement/DebitDisputes.ts b/src/resources/V2/MoneyManagement/DebitDisputes.ts index 6806e9e17c..c41e5a67a7 100644 --- a/src/resources/V2/MoneyManagement/DebitDisputes.ts +++ b/src/resources/V2/MoneyManagement/DebitDisputes.ts @@ -46,7 +46,7 @@ export class DebitDisputeResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/money_management/debit_disputes/${id}`, + `/v2/money_management/debit_disputes/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/MoneyManagement/FinancialAccounts.ts b/src/resources/V2/MoneyManagement/FinancialAccounts.ts index 7cf1ea3084..57bd26a7de 100644 --- a/src/resources/V2/MoneyManagement/FinancialAccounts.ts +++ b/src/resources/V2/MoneyManagement/FinancialAccounts.ts @@ -56,7 +56,7 @@ export class FinancialAccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/money_management/financial_accounts/${id}`, + `/v2/money_management/financial_accounts/${encodeURIComponent(id)}`, params, options ) as any; @@ -71,7 +71,7 @@ export class FinancialAccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/money_management/financial_accounts/${id}`, + `/v2/money_management/financial_accounts/${encodeURIComponent(id)}`, params, options ) as any; @@ -87,7 +87,7 @@ export class FinancialAccountResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/money_management/financial_accounts/${id}/close`, + `/v2/money_management/financial_accounts/${encodeURIComponent(id)}/close`, params, options ) as any; diff --git a/src/resources/V2/MoneyManagement/FinancialAccounts/Statements.ts b/src/resources/V2/MoneyManagement/FinancialAccounts/Statements.ts index 787428fa2c..25c71f9267 100644 --- a/src/resources/V2/MoneyManagement/FinancialAccounts/Statements.ts +++ b/src/resources/V2/MoneyManagement/FinancialAccounts/Statements.ts @@ -15,7 +15,9 @@ export class StatementResource extends StripeResource { ): V2ListPromise { return this._makeRequest( 'GET', - `/v2/money_management/financial_accounts/${financialAccountId}/statements`, + `/v2/money_management/financial_accounts/${encodeURIComponent( + financialAccountId + )}/statements`, params, options, { @@ -54,7 +56,9 @@ export class StatementResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/money_management/financial_accounts/${financialAccountId}/statements/${id}`, + `/v2/money_management/financial_accounts/${encodeURIComponent( + financialAccountId + )}/statements/${encodeURIComponent(id)}`, params, options, { diff --git a/src/resources/V2/MoneyManagement/FinancialAddresses.ts b/src/resources/V2/MoneyManagement/FinancialAddresses.ts index de226ac6df..1472226aaf 100644 --- a/src/resources/V2/MoneyManagement/FinancialAddresses.ts +++ b/src/resources/V2/MoneyManagement/FinancialAddresses.ts @@ -48,7 +48,7 @@ export class FinancialAddressResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/money_management/financial_addresses/${id}`, + `/v2/money_management/financial_addresses/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/MoneyManagement/InboundTransfers.ts b/src/resources/V2/MoneyManagement/InboundTransfers.ts index b58391bafb..0f40cb1f08 100644 --- a/src/resources/V2/MoneyManagement/InboundTransfers.ts +++ b/src/resources/V2/MoneyManagement/InboundTransfers.ts @@ -47,7 +47,7 @@ export class InboundTransferResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/money_management/inbound_transfers/${id}`, + `/v2/money_management/inbound_transfers/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/MoneyManagement/OutboundPaymentQuotes.ts b/src/resources/V2/MoneyManagement/OutboundPaymentQuotes.ts index 273777cada..070a8601e1 100644 --- a/src/resources/V2/MoneyManagement/OutboundPaymentQuotes.ts +++ b/src/resources/V2/MoneyManagement/OutboundPaymentQuotes.ts @@ -30,7 +30,7 @@ export class OutboundPaymentQuoteResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/money_management/outbound_payment_quotes/${id}`, + `/v2/money_management/outbound_payment_quotes/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/MoneyManagement/OutboundPayments.ts b/src/resources/V2/MoneyManagement/OutboundPayments.ts index 8abcac633f..da6187e674 100644 --- a/src/resources/V2/MoneyManagement/OutboundPayments.ts +++ b/src/resources/V2/MoneyManagement/OutboundPayments.ts @@ -51,7 +51,7 @@ export class OutboundPaymentResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/money_management/outbound_payments/${id}`, + `/v2/money_management/outbound_payments/${encodeURIComponent(id)}`, params, options ) as any; @@ -68,7 +68,7 @@ export class OutboundPaymentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/money_management/outbound_payments/${id}/cancel`, + `/v2/money_management/outbound_payments/${encodeURIComponent(id)}/cancel`, params, options ) as any; diff --git a/src/resources/V2/MoneyManagement/OutboundSetupIntents.ts b/src/resources/V2/MoneyManagement/OutboundSetupIntents.ts index ab5beeb7ac..a2b6a8b2ef 100644 --- a/src/resources/V2/MoneyManagement/OutboundSetupIntents.ts +++ b/src/resources/V2/MoneyManagement/OutboundSetupIntents.ts @@ -50,7 +50,7 @@ export class OutboundSetupIntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/money_management/outbound_setup_intents/${id}`, + `/v2/money_management/outbound_setup_intents/${encodeURIComponent(id)}`, params, options ) as any; @@ -69,7 +69,7 @@ export class OutboundSetupIntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/money_management/outbound_setup_intents/${id}`, + `/v2/money_management/outbound_setup_intents/${encodeURIComponent(id)}`, params, options ) as any; @@ -84,7 +84,9 @@ export class OutboundSetupIntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/money_management/outbound_setup_intents/${id}/cancel`, + `/v2/money_management/outbound_setup_intents/${encodeURIComponent( + id + )}/cancel`, params, options ) as any; diff --git a/src/resources/V2/MoneyManagement/OutboundTransfers.ts b/src/resources/V2/MoneyManagement/OutboundTransfers.ts index 9faa1f7fe6..3250923c50 100644 --- a/src/resources/V2/MoneyManagement/OutboundTransfers.ts +++ b/src/resources/V2/MoneyManagement/OutboundTransfers.ts @@ -49,7 +49,7 @@ export class OutboundTransferResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/money_management/outbound_transfers/${id}`, + `/v2/money_management/outbound_transfers/${encodeURIComponent(id)}`, params, options ) as any; @@ -66,7 +66,9 @@ export class OutboundTransferResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/money_management/outbound_transfers/${id}/cancel`, + `/v2/money_management/outbound_transfers/${encodeURIComponent( + id + )}/cancel`, params, options ) as any; diff --git a/src/resources/V2/MoneyManagement/PayoutMethods.ts b/src/resources/V2/MoneyManagement/PayoutMethods.ts index 9b3f1bdc80..104a0164f9 100644 --- a/src/resources/V2/MoneyManagement/PayoutMethods.ts +++ b/src/resources/V2/MoneyManagement/PayoutMethods.ts @@ -32,7 +32,7 @@ export class PayoutMethodResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/money_management/payout_methods/${id}`, + `/v2/money_management/payout_methods/${encodeURIComponent(id)}`, params, options ) as any; @@ -52,7 +52,7 @@ export class PayoutMethodResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/money_management/payout_methods/${id}/archive`, + `/v2/money_management/payout_methods/${encodeURIComponent(id)}/archive`, params, options ) as any; @@ -70,7 +70,7 @@ export class PayoutMethodResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/money_management/payout_methods/${id}/unarchive`, + `/v2/money_management/payout_methods/${encodeURIComponent(id)}/unarchive`, params, options ) as any; diff --git a/src/resources/V2/MoneyManagement/ReceivedCredits.ts b/src/resources/V2/MoneyManagement/ReceivedCredits.ts index 241aa7e516..68133ee9e5 100644 --- a/src/resources/V2/MoneyManagement/ReceivedCredits.ts +++ b/src/resources/V2/MoneyManagement/ReceivedCredits.ts @@ -32,7 +32,7 @@ export class ReceivedCreditResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/money_management/received_credits/${id}`, + `/v2/money_management/received_credits/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/MoneyManagement/ReceivedDebits.ts b/src/resources/V2/MoneyManagement/ReceivedDebits.ts index dc5278db47..c35822e598 100644 --- a/src/resources/V2/MoneyManagement/ReceivedDebits.ts +++ b/src/resources/V2/MoneyManagement/ReceivedDebits.ts @@ -32,7 +32,7 @@ export class ReceivedDebitResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/money_management/received_debits/${id}`, + `/v2/money_management/received_debits/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/MoneyManagement/RecipientVerifications.ts b/src/resources/V2/MoneyManagement/RecipientVerifications.ts index 35f502697e..52e84cd17b 100644 --- a/src/resources/V2/MoneyManagement/RecipientVerifications.ts +++ b/src/resources/V2/MoneyManagement/RecipientVerifications.ts @@ -28,7 +28,7 @@ export class RecipientVerificationResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/money_management/recipient_verifications/${id}`, + `/v2/money_management/recipient_verifications/${encodeURIComponent(id)}`, params, options ) as any; @@ -43,7 +43,9 @@ export class RecipientVerificationResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/money_management/recipient_verifications/${id}/acknowledge`, + `/v2/money_management/recipient_verifications/${encodeURIComponent( + id + )}/acknowledge`, params, options ) as any; diff --git a/src/resources/V2/MoneyManagement/TransactionEntries.ts b/src/resources/V2/MoneyManagement/TransactionEntries.ts index 6957786967..0e1e186b2b 100644 --- a/src/resources/V2/MoneyManagement/TransactionEntries.ts +++ b/src/resources/V2/MoneyManagement/TransactionEntries.ts @@ -32,7 +32,7 @@ export class TransactionEntryResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/money_management/transaction_entries/${id}`, + `/v2/money_management/transaction_entries/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/MoneyManagement/Transactions.ts b/src/resources/V2/MoneyManagement/Transactions.ts index a3b10baa20..e04cfb0bc4 100644 --- a/src/resources/V2/MoneyManagement/Transactions.ts +++ b/src/resources/V2/MoneyManagement/Transactions.ts @@ -32,7 +32,7 @@ export class TransactionResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/money_management/transactions/${id}`, + `/v2/money_management/transactions/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/Network/BusinessProfiles.ts b/src/resources/V2/Network/BusinessProfiles.ts index 8f48022a8c..ce5dbebbca 100644 --- a/src/resources/V2/Network/BusinessProfiles.ts +++ b/src/resources/V2/Network/BusinessProfiles.ts @@ -28,7 +28,7 @@ export class BusinessProfileResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/network/business_profiles/${id}`, + `/v2/network/business_profiles/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/OrchestratedCommerce/Agreements.ts b/src/resources/V2/OrchestratedCommerce/Agreements.ts index 981b77aebb..38c6a197d7 100644 --- a/src/resources/V2/OrchestratedCommerce/Agreements.ts +++ b/src/resources/V2/OrchestratedCommerce/Agreements.ts @@ -45,7 +45,7 @@ export class AgreementResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/orchestrated_commerce/agreements/${id}`, + `/v2/orchestrated_commerce/agreements/${encodeURIComponent(id)}`, params, options ) as any; @@ -60,7 +60,7 @@ export class AgreementResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/orchestrated_commerce/agreements/${id}/confirm`, + `/v2/orchestrated_commerce/agreements/${encodeURIComponent(id)}/confirm`, params, options ) as any; @@ -75,7 +75,9 @@ export class AgreementResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/orchestrated_commerce/agreements/${id}/terminate`, + `/v2/orchestrated_commerce/agreements/${encodeURIComponent( + id + )}/terminate`, params, options ) as any; diff --git a/src/resources/V2/Payments/OffSessionPayments.ts b/src/resources/V2/Payments/OffSessionPayments.ts index 42faf3f504..7ee5304fdc 100644 --- a/src/resources/V2/Payments/OffSessionPayments.ts +++ b/src/resources/V2/Payments/OffSessionPayments.ts @@ -47,7 +47,7 @@ export class OffSessionPaymentResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/payments/off_session_payments/${id}`, + `/v2/payments/off_session_payments/${encodeURIComponent(id)}`, params, options ) as any; @@ -62,7 +62,7 @@ export class OffSessionPaymentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/payments/off_session_payments/${id}/cancel`, + `/v2/payments/off_session_payments/${encodeURIComponent(id)}/cancel`, params, options ) as any; @@ -77,7 +77,7 @@ export class OffSessionPaymentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/payments/off_session_payments/${id}/capture`, + `/v2/payments/off_session_payments/${encodeURIComponent(id)}/capture`, params, options ) as any; @@ -92,7 +92,7 @@ export class OffSessionPaymentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/payments/off_session_payments/${id}/pause`, + `/v2/payments/off_session_payments/${encodeURIComponent(id)}/pause`, params, options ) as any; @@ -107,7 +107,7 @@ export class OffSessionPaymentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/payments/off_session_payments/${id}/resume`, + `/v2/payments/off_session_payments/${encodeURIComponent(id)}/resume`, params, options ) as any; diff --git a/src/resources/V2/Payments/SettlementAllocationIntents.ts b/src/resources/V2/Payments/SettlementAllocationIntents.ts index 8de679615b..fe7137cd74 100644 --- a/src/resources/V2/Payments/SettlementAllocationIntents.ts +++ b/src/resources/V2/Payments/SettlementAllocationIntents.ts @@ -54,7 +54,7 @@ export class SettlementAllocationIntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/payments/settlement_allocation_intents/${id}`, + `/v2/payments/settlement_allocation_intents/${encodeURIComponent(id)}`, params, options ) as any; @@ -69,7 +69,7 @@ export class SettlementAllocationIntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/payments/settlement_allocation_intents/${id}`, + `/v2/payments/settlement_allocation_intents/${encodeURIComponent(id)}`, params, options ) as any; @@ -84,7 +84,9 @@ export class SettlementAllocationIntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/payments/settlement_allocation_intents/${id}/cancel`, + `/v2/payments/settlement_allocation_intents/${encodeURIComponent( + id + )}/cancel`, params, options ) as any; @@ -99,7 +101,9 @@ export class SettlementAllocationIntentResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/payments/settlement_allocation_intents/${id}/submit`, + `/v2/payments/settlement_allocation_intents/${encodeURIComponent( + id + )}/submit`, params, options ) as any; diff --git a/src/resources/V2/Payments/SettlementAllocationIntents/Splits.ts b/src/resources/V2/Payments/SettlementAllocationIntents/Splits.ts index a796c7fb9d..5d20e4b47a 100644 --- a/src/resources/V2/Payments/SettlementAllocationIntents/Splits.ts +++ b/src/resources/V2/Payments/SettlementAllocationIntents/Splits.ts @@ -17,7 +17,9 @@ export class SplitResource extends StripeResource { ): V2ListPromise { return this._makeRequest( 'GET', - `/v2/payments/settlement_allocation_intents/${settlementAllocationIntentId}/splits`, + `/v2/payments/settlement_allocation_intents/${encodeURIComponent( + settlementAllocationIntentId + )}/splits`, params, options, { @@ -35,7 +37,9 @@ export class SplitResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/payments/settlement_allocation_intents/${settlementAllocationIntentId}/splits`, + `/v2/payments/settlement_allocation_intents/${encodeURIComponent( + settlementAllocationIntentId + )}/splits`, params, options ) as any; @@ -51,7 +55,9 @@ export class SplitResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/payments/settlement_allocation_intents/${settlementAllocationIntentId}/splits/${id}`, + `/v2/payments/settlement_allocation_intents/${encodeURIComponent( + settlementAllocationIntentId + )}/splits/${encodeURIComponent(id)}`, params, options ) as any; @@ -67,7 +73,9 @@ export class SplitResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/payments/settlement_allocation_intents/${settlementAllocationIntentId}/splits/${id}/cancel`, + `/v2/payments/settlement_allocation_intents/${encodeURIComponent( + settlementAllocationIntentId + )}/splits/${encodeURIComponent(id)}/cancel`, params, options ) as any; diff --git a/src/resources/V2/Reporting/ReportRuns.ts b/src/resources/V2/Reporting/ReportRuns.ts index 97690e981c..6486ccb480 100644 --- a/src/resources/V2/Reporting/ReportRuns.ts +++ b/src/resources/V2/Reporting/ReportRuns.ts @@ -46,7 +46,7 @@ export class ReportRunResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/reporting/report_runs/${id}`, + `/v2/reporting/report_runs/${encodeURIComponent(id)}`, params, options, { diff --git a/src/resources/V2/Reporting/Reports.ts b/src/resources/V2/Reporting/Reports.ts index 250dd4d8ba..e9a5a5b1df 100644 --- a/src/resources/V2/Reporting/Reports.ts +++ b/src/resources/V2/Reporting/Reports.ts @@ -16,7 +16,7 @@ export class ReportResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/reporting/reports/${id}`, + `/v2/reporting/reports/${encodeURIComponent(id)}`, params, options ) as any; diff --git a/src/resources/V2/Signals/AccountSignals.ts b/src/resources/V2/Signals/AccountSignals.ts index 9ecf0885d5..15905604f2 100644 --- a/src/resources/V2/Signals/AccountSignals.ts +++ b/src/resources/V2/Signals/AccountSignals.ts @@ -53,7 +53,7 @@ export class AccountSignalResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/signals/account_signals/${id}`, + `/v2/signals/account_signals/${encodeURIComponent(id)}`, params, options, { diff --git a/src/resources/V2/Tax/ManualRules.ts b/src/resources/V2/Tax/ManualRules.ts index 5f1d3951b4..acacb1b545 100644 --- a/src/resources/V2/Tax/ManualRules.ts +++ b/src/resources/V2/Tax/ManualRules.ts @@ -104,7 +104,7 @@ export class ManualRuleResource extends StripeResource { ): Promise> { return this._makeRequest( 'GET', - `/v2/tax/manual_rules/${id}`, + `/v2/tax/manual_rules/${encodeURIComponent(id)}`, params, options, { @@ -141,7 +141,7 @@ export class ManualRuleResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/tax/manual_rules/${id}`, + `/v2/tax/manual_rules/${encodeURIComponent(id)}`, params, options, { @@ -198,7 +198,7 @@ export class ManualRuleResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/tax/manual_rules/${id}/deactivate`, + `/v2/tax/manual_rules/${encodeURIComponent(id)}/deactivate`, params, options, { diff --git a/src/resources/V2/TestHelpers/FinancialAddresses.ts b/src/resources/V2/TestHelpers/FinancialAddresses.ts index 242b4a8be3..b29e0f6e86 100644 --- a/src/resources/V2/TestHelpers/FinancialAddresses.ts +++ b/src/resources/V2/TestHelpers/FinancialAddresses.ts @@ -18,7 +18,7 @@ export class FinancialAddressResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/test_helpers/financial_addresses/${id}/credit`, + `/v2/test_helpers/financial_addresses/${encodeURIComponent(id)}/credit`, params, options ) as any; @@ -34,7 +34,9 @@ export class FinancialAddressResource extends StripeResource { ): Promise> { return this._makeRequest( 'POST', - `/v2/test_helpers/financial_addresses/${id}/generate_microdeposits`, + `/v2/test_helpers/financial_addresses/${encodeURIComponent( + id + )}/generate_microdeposits`, params, options ) as any;