From 3e80143129af5046c42cbec338c9049aa525face Mon Sep 17 00:00:00 2001 From: anniel-stripe <97691964+anniel-stripe@users.noreply.github.com> Date: Wed, 16 Nov 2022 11:36:51 -0800 Subject: [PATCH] Next major release changes (#1608) * Update StripeSignatureVerificationError to accept header and payload strings * Build * Update supported runtime versions * Remove Orders and subscription_data[items] * Remove SKU resource * Remove SKUs.spec.js * Remove deprecated configuration setter methods (#1597) * Remove deprecated config properties * Update test and remove config properties from types/ * Remove setProtocol from types, refactor old tests * Replace more require('../lib/stripe') with Stripe * Remove global stripe from EphemeralKeys test * Rename local stripe to newStripe in stripe.spec.js * Refactor EphemeralKeys.spec.js * Remove more deprecated items (#1600) Remove remaining deprecated items * Generate files for next major (#1603) * Generate next major * Deprecate StripeResource.path and related interfaces (#1604) * Deprecate path * More fully deprecate * Fix linting errors * Revert "Fix linting errors" This reverts commit 68ac772749e6e403650ad22fdeb448c6af09293e. * Revert "Deprecate StripeResource.path and related interfaces (#1604)" This reverts commit 9c9de9e9852369e575a701b33e8e47e277862a14. * fix tests to work without Invoices defining fullPAth Co-authored-by: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com> Co-authored-by: Richard Marmorstein * Update LatestApiVersion and types reference * Update all references to latest API version * Regenerate * Latest API version * fix tests * Update API_VERSION and references * Format Co-authored-by: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com> Co-authored-by: Richard Marmorstein Co-authored-by: Pavel Krymets Co-authored-by: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> --- .github/workflows/main.yml | 1 - API_VERSION | 2 +- README.md | 4 +- .../typescript-node-express/express-ts.ts | 2 +- lib/Error.js | 8 +- lib/StripeMethod.basic.js | 26 - lib/StripeResource.js | 13 +- lib/Webhooks.js | 30 +- lib/apiVersion.js | 2 +- lib/resources.js | 2 - lib/resources/AccountLinks.js | 3 +- lib/resources/Accounts.js | 43 +- lib/resources/ApplePayDomains.js | 9 +- lib/resources/ApplicationFees.js | 13 +- lib/resources/Apps/Secrets.js | 9 +- lib/resources/Balance.js | 3 +- lib/resources/BalanceTransactions.js | 5 +- lib/resources/BillingPortal/Configurations.js | 9 +- lib/resources/BillingPortal/Sessions.js | 3 +- lib/resources/Charges.js | 13 +- lib/resources/Checkout/Sessions.js | 11 +- lib/resources/CountrySpecs.js | 5 +- lib/resources/Coupons.js | 11 +- lib/resources/CreditNotes.js | 17 +- lib/resources/Customers.js | 58 +- lib/resources/Disputes.js | 9 +- lib/resources/EphemeralKeys.js | 5 +- lib/resources/Events.js | 5 +- lib/resources/ExchangeRates.js | 5 +- lib/resources/FileLinks.js | 9 +- lib/resources/Files.js | 6 +- .../FinancialConnections/Accounts.js | 11 +- .../FinancialConnections/Sessions.js | 5 +- lib/resources/Identity/VerificationReports.js | 5 +- .../Identity/VerificationSessions.js | 13 +- lib/resources/InvoiceItems.js | 11 +- lib/resources/Invoices.js | 29 +- lib/resources/Issuing/Authorizations.js | 11 +- lib/resources/Issuing/Cardholders.js | 9 +- lib/resources/Issuing/Cards.js | 9 +- lib/resources/Issuing/Disputes.js | 11 +- lib/resources/Issuing/Transactions.js | 7 +- lib/resources/Mandates.js | 3 +- lib/resources/Orders.js | 41 - lib/resources/PaymentIntents.js | 23 +- lib/resources/PaymentLinks.js | 11 +- lib/resources/PaymentMethods.js | 13 +- lib/resources/Payouts.js | 13 +- lib/resources/Plans.js | 11 +- lib/resources/Prices.js | 11 +- lib/resources/Products.js | 13 +- lib/resources/PromotionCodes.js | 9 +- lib/resources/Quotes.js | 21 +- lib/resources/Radar/EarlyFraudWarnings.js | 5 +- lib/resources/Radar/ValueListItems.js | 9 +- lib/resources/Radar/ValueLists.js | 11 +- lib/resources/Refunds.js | 11 +- lib/resources/Reporting/ReportRuns.js | 7 +- lib/resources/Reporting/ReportTypes.js | 5 +- lib/resources/Reviews.js | 7 +- lib/resources/SKUs.js | 28 - lib/resources/SetupAttempts.js | 3 +- lib/resources/SetupIntents.js | 15 +- lib/resources/ShippingRates.js | 9 +- lib/resources/Sigma/ScheduledQueryRuns.js | 5 +- lib/resources/Sources.js | 11 +- lib/resources/SubscriptionItems.js | 16 +- lib/resources/SubscriptionSchedules.js | 13 +- lib/resources/Subscriptions.js | 17 +- lib/resources/TaxCodes.js | 5 +- lib/resources/TaxRates.js | 9 +- lib/resources/Terminal/Configurations.js | 11 +- lib/resources/Terminal/ConnectionTokens.js | 3 +- lib/resources/Terminal/Locations.js | 11 +- lib/resources/Terminal/Readers.js | 19 +- lib/resources/TestHelpers/Customers.js | 3 +- lib/resources/TestHelpers/Issuing/Cards.js | 9 +- lib/resources/TestHelpers/Refunds.js | 3 +- lib/resources/TestHelpers/Terminal/Readers.js | 4 +- lib/resources/TestHelpers/TestClocks.js | 11 +- .../TestHelpers/Treasury/InboundTransfers.js | 7 +- .../TestHelpers/Treasury/OutboundPayments.js | 7 +- .../TestHelpers/Treasury/OutboundTransfers.js | 10 +- .../TestHelpers/Treasury/ReceivedCredits.js | 3 +- .../TestHelpers/Treasury/ReceivedDebits.js | 3 +- lib/resources/Tokens.js | 5 +- lib/resources/Topups.js | 11 +- lib/resources/Transfers.js | 17 +- lib/resources/Treasury/CreditReversals.js | 7 +- lib/resources/Treasury/DebitReversals.js | 7 +- lib/resources/Treasury/FinancialAccounts.js | 13 +- lib/resources/Treasury/InboundTransfers.js | 9 +- lib/resources/Treasury/OutboundPayments.js | 9 +- lib/resources/Treasury/OutboundTransfers.js | 9 +- lib/resources/Treasury/ReceivedCredits.js | 5 +- lib/resources/Treasury/ReceivedDebits.js | 5 +- lib/resources/Treasury/TransactionEntries.js | 5 +- lib/resources/Treasury/Transactions.js | 5 +- lib/resources/WebhookEndpoints.js | 11 +- lib/stripe.js | 160 +- lib/utils.js | 39 +- package.json | 4 +- src/Error.ts | 11 +- src/StripeMethod.basic.js | 32 - src/StripeResource.ts | 15 +- src/Types.d.ts | 2 - src/Webhooks.ts | 30 +- src/apiVersion.js | 2 +- src/resources.js | 2 - src/resources/AccountLinks.js | 4 +- src/resources/Accounts.js | 44 +- src/resources/ApplePayDomains.js | 10 +- src/resources/ApplicationFees.js | 14 +- src/resources/Apps/Secrets.js | 10 +- src/resources/Balance.js | 4 +- src/resources/BalanceTransactions.js | 6 +- src/resources/BillingPortal/Configurations.js | 10 +- src/resources/BillingPortal/Sessions.js | 4 +- src/resources/Charges.js | 14 +- src/resources/Checkout/Sessions.js | 12 +- src/resources/CountrySpecs.js | 6 +- src/resources/Coupons.js | 12 +- src/resources/CreditNotes.js | 18 +- src/resources/Customers.js | 59 +- src/resources/Disputes.js | 10 +- src/resources/EphemeralKeys.js | 6 +- src/resources/Events.js | 6 +- src/resources/ExchangeRates.js | 6 +- src/resources/FileLinks.js | 10 +- src/resources/Files.js | 7 +- .../FinancialConnections/Accounts.js | 12 +- .../FinancialConnections/Sessions.js | 6 +- src/resources/Identity/VerificationReports.js | 6 +- .../Identity/VerificationSessions.js | 14 +- src/resources/InvoiceItems.js | 12 +- src/resources/Invoices.js | 30 +- src/resources/Issuing/Authorizations.js | 12 +- src/resources/Issuing/Cardholders.js | 10 +- src/resources/Issuing/Cards.js | 10 +- src/resources/Issuing/Disputes.js | 12 +- src/resources/Issuing/Transactions.js | 8 +- src/resources/Mandates.js | 4 +- src/resources/Orders.js | 52 - src/resources/PaymentIntents.js | 24 +- src/resources/PaymentLinks.js | 12 +- src/resources/PaymentMethods.js | 14 +- src/resources/Payouts.js | 14 +- src/resources/Plans.js | 12 +- src/resources/Prices.js | 12 +- src/resources/Products.js | 14 +- src/resources/PromotionCodes.js | 10 +- src/resources/Quotes.js | 22 +- src/resources/Radar/EarlyFraudWarnings.js | 6 +- src/resources/Radar/ValueListItems.js | 10 +- src/resources/Radar/ValueLists.js | 12 +- src/resources/Refunds.js | 12 +- src/resources/Reporting/ReportRuns.js | 8 +- src/resources/Reporting/ReportTypes.js | 6 +- src/resources/Reviews.js | 8 +- src/resources/SKUs.js | 36 - src/resources/SetupAttempts.js | 4 +- src/resources/SetupIntents.js | 16 +- src/resources/ShippingRates.js | 10 +- src/resources/Sigma/ScheduledQueryRuns.js | 6 +- src/resources/Sources.js | 12 +- src/resources/SubscriptionItems.js | 17 +- src/resources/SubscriptionSchedules.js | 14 +- src/resources/Subscriptions.js | 18 +- src/resources/TaxCodes.js | 6 +- src/resources/TaxRates.js | 10 +- src/resources/Terminal/Configurations.js | 12 +- src/resources/Terminal/ConnectionTokens.js | 4 +- src/resources/Terminal/Locations.js | 12 +- src/resources/Terminal/Readers.js | 20 +- src/resources/TestHelpers/Customers.js | 4 +- src/resources/TestHelpers/Issuing/Cards.js | 10 +- src/resources/TestHelpers/Refunds.js | 4 +- src/resources/TestHelpers/Terminal/Readers.js | 5 +- src/resources/TestHelpers/TestClocks.js | 12 +- .../TestHelpers/Treasury/InboundTransfers.js | 8 +- .../TestHelpers/Treasury/OutboundPayments.js | 8 +- .../TestHelpers/Treasury/OutboundTransfers.js | 11 +- .../TestHelpers/Treasury/ReceivedCredits.js | 4 +- .../TestHelpers/Treasury/ReceivedDebits.js | 4 +- src/resources/Tokens.js | 6 +- src/resources/Topups.js | 12 +- src/resources/Transfers.js | 18 +- src/resources/Treasury/CreditReversals.js | 8 +- src/resources/Treasury/DebitReversals.js | 8 +- src/resources/Treasury/FinancialAccounts.js | 14 +- src/resources/Treasury/InboundTransfers.js | 10 +- src/resources/Treasury/OutboundPayments.js | 10 +- src/resources/Treasury/OutboundTransfers.js | 10 +- src/resources/Treasury/ReceivedCredits.js | 6 +- src/resources/Treasury/ReceivedDebits.js | 6 +- src/resources/Treasury/TransactionEntries.js | 6 +- src/resources/Treasury/Transactions.js | 6 +- src/resources/WebhookEndpoints.js | 12 +- src/stripe.ts | 170 +- src/utils.ts | 40 +- test/StripeResource.spec.js | 30 +- test/resources/EphemeralKeys.spec.js | 36 +- test/resources/SKUs.spec.js | 98 - .../resources/generated_examples_test.spec.js | 35 - test/stripe.spec.js | 112 +- test/telemetry.spec.js | 30 +- test/utils.spec.js | 85 - testUtils/index.js | 4 +- types/2022-08-01/Orders.d.ts | 3356 ----------------- types/2022-08-01/SKUs.d.ts | 453 --- .../AccountLinks.d.ts | 0 .../{2022-08-01 => 2022-11-15}/Accounts.d.ts | 0 .../ApplePayDomains.d.ts | 0 .../ApplicationFees.d.ts | 0 .../Applications.d.ts | 0 .../Apps/Secrets.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Balance.d.ts | 0 .../BalanceTransactions.d.ts | 0 .../BankAccounts.d.ts | 0 .../BillingPortal/Configurations.d.ts | 0 .../BillingPortal/Sessions.d.ts | 0 .../Capabilities.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Cards.d.ts | 0 .../CashBalances.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Charges.d.ts | 2 +- .../Checkout/Sessions.d.ts | 28 - .../ConnectCollectionTransfers.d.ts | 0 .../CountrySpecs.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Coupons.d.ts | 0 .../CreditNoteLineItems.d.ts | 0 .../CreditNotes.d.ts | 0 .../CustomerBalanceTransactions.d.ts | 0 .../CustomerCashBalanceTransactions.d.ts | 0 .../CustomerSources.d.ts | 0 .../{2022-08-01 => 2022-11-15}/Customers.d.ts | 0 .../{2022-08-01 => 2022-11-15}/Discounts.d.ts | 0 .../{2022-08-01 => 2022-11-15}/Disputes.d.ts | 0 .../EphemeralKeys.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Events.d.ts | 0 .../ExchangeRates.d.ts | 0 .../ExternalAccounts.d.ts | 0 .../FeeRefunds.d.ts | 0 .../{2022-08-01 => 2022-11-15}/FileLinks.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Files.d.ts | 0 .../FinancialConnections/AccountOwners.d.ts | 0 .../AccountOwnerships.d.ts | 0 .../FinancialConnections/Accounts.d.ts | 0 .../FinancialConnections/Sessions.d.ts | 0 .../FundingInstructions.d.ts | 0 .../Identity/VerificationReports.d.ts | 0 .../Identity/VerificationSessions.d.ts | 0 .../InvoiceItems.d.ts | 0 .../InvoiceLineItems.d.ts | 0 .../{2022-08-01 => 2022-11-15}/Invoices.d.ts | 0 .../Issuing/Authorizations.d.ts | 0 .../Issuing/Cardholders.d.ts | 0 .../Issuing/Cards.d.ts | 0 .../Issuing/Disputes.d.ts | 0 .../Issuing/Transactions.d.ts | 0 .../{2022-08-01 => 2022-11-15}/LineItems.d.ts | 7 - .../LoginLinks.d.ts | 0 .../{2022-08-01 => 2022-11-15}/Mandates.d.ts | 0 .../PaymentIntents.d.ts | 10 +- .../PaymentLinks.d.ts | 0 .../PaymentMethods.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Payouts.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Persons.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Plans.d.ts | 0 .../PlatformTaxFees.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Prices.d.ts | 0 .../{2022-08-01 => 2022-11-15}/Products.d.ts | 0 .../PromotionCodes.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Quotes.d.ts | 0 .../Radar/EarlyFraudWarnings.d.ts | 0 .../Radar/ValueListItems.d.ts | 0 .../Radar/ValueLists.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Refunds.d.ts | 4 - .../Reporting/ReportRuns.d.ts | 0 .../Reporting/ReportTypes.d.ts | 0 .../ReserveTransactions.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Reviews.d.ts | 0 .../SetupAttempts.d.ts | 0 .../SetupIntents.d.ts | 0 .../ShippingRates.d.ts | 0 .../Sigma/ScheduledQueryRuns.d.ts | 0 .../SourceMandateNotifications.d.ts | 0 .../SourceTransactions.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Sources.d.ts | 0 .../SubscriptionItems.d.ts | 0 .../SubscriptionSchedules.d.ts | 0 .../Subscriptions.d.ts | 0 .../{2022-08-01 => 2022-11-15}/TaxCodes.d.ts | 0 .../TaxDeductedAtSources.d.ts | 0 types/{2022-08-01 => 2022-11-15}/TaxIds.d.ts | 0 .../{2022-08-01 => 2022-11-15}/TaxRates.d.ts | 0 .../Terminal/Configurations.d.ts | 0 .../Terminal/ConnectionTokens.d.ts | 0 .../Terminal/Locations.d.ts | 0 .../Terminal/Readers.d.ts | 0 .../TestHelpers/Customers.d.ts | 0 .../TestHelpers/Issuing/Cards.d.ts | 0 .../TestHelpers/Refunds.d.ts | 0 .../TestHelpers/Terminal/Readers.d.ts | 0 .../TestHelpers/TestClocks.d.ts | 0 .../Treasury/InboundTransfers.d.ts | 0 .../Treasury/OutboundPayments.d.ts | 0 .../Treasury/OutboundTransfers.d.ts | 0 .../TestHelpers/Treasury/ReceivedCredits.d.ts | 0 .../TestHelpers/Treasury/ReceivedDebits.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Tokens.d.ts | 0 types/{2022-08-01 => 2022-11-15}/Topups.d.ts | 0 .../TransferReversals.d.ts | 0 .../{2022-08-01 => 2022-11-15}/Transfers.d.ts | 0 .../Treasury/CreditReversals.d.ts | 0 .../Treasury/DebitReversals.d.ts | 0 .../Treasury/FinancialAccountFeatures.d.ts | 0 .../Treasury/FinancialAccounts.d.ts | 0 .../Treasury/InboundTransfers.d.ts | 0 .../Treasury/OutboundPayments.d.ts | 0 .../Treasury/OutboundTransfers.d.ts | 0 .../Treasury/ReceivedCredits.d.ts | 0 .../Treasury/ReceivedDebits.d.ts | 0 .../Treasury/TransactionEntries.d.ts | 0 .../Treasury/Transactions.d.ts | 0 .../UsageRecordSummaries.d.ts | 0 .../UsageRecords.d.ts | 0 .../WebhookEndpoints.d.ts | 3 +- types/{2022-08-01 => 2022-11-15}/index.d.ts | 27 - types/lib.d.ts | 2 +- types/test/typescriptTest.ts | 18 +- 330 files changed, 990 insertions(+), 5951 deletions(-) delete mode 100644 lib/StripeMethod.basic.js delete mode 100644 lib/resources/Orders.js delete mode 100644 lib/resources/SKUs.js delete mode 100644 src/StripeMethod.basic.js delete mode 100644 src/resources/Orders.js delete mode 100644 src/resources/SKUs.js delete mode 100644 test/resources/SKUs.spec.js delete mode 100644 types/2022-08-01/Orders.d.ts delete mode 100644 types/2022-08-01/SKUs.d.ts rename types/{2022-08-01 => 2022-11-15}/AccountLinks.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Accounts.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/ApplePayDomains.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/ApplicationFees.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Applications.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Apps/Secrets.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Balance.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/BalanceTransactions.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/BankAccounts.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/BillingPortal/Configurations.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/BillingPortal/Sessions.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Capabilities.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Cards.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/CashBalances.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Charges.d.ts (99%) rename types/{2022-08-01 => 2022-11-15}/Checkout/Sessions.d.ts (99%) rename types/{2022-08-01 => 2022-11-15}/ConnectCollectionTransfers.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/CountrySpecs.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Coupons.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/CreditNoteLineItems.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/CreditNotes.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/CustomerBalanceTransactions.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/CustomerCashBalanceTransactions.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/CustomerSources.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Customers.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Discounts.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Disputes.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/EphemeralKeys.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Events.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/ExchangeRates.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/ExternalAccounts.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/FeeRefunds.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/FileLinks.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Files.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/FinancialConnections/AccountOwners.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/FinancialConnections/AccountOwnerships.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/FinancialConnections/Accounts.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/FinancialConnections/Sessions.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/FundingInstructions.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Identity/VerificationReports.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Identity/VerificationSessions.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/InvoiceItems.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/InvoiceLineItems.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Invoices.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Issuing/Authorizations.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Issuing/Cardholders.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Issuing/Cards.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Issuing/Disputes.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Issuing/Transactions.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/LineItems.d.ts (93%) rename types/{2022-08-01 => 2022-11-15}/LoginLinks.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Mandates.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/PaymentIntents.d.ts (99%) rename types/{2022-08-01 => 2022-11-15}/PaymentLinks.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/PaymentMethods.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Payouts.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Persons.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Plans.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/PlatformTaxFees.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Prices.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Products.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/PromotionCodes.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Quotes.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Radar/EarlyFraudWarnings.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Radar/ValueListItems.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Radar/ValueLists.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Refunds.d.ts (97%) rename types/{2022-08-01 => 2022-11-15}/Reporting/ReportRuns.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Reporting/ReportTypes.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/ReserveTransactions.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Reviews.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/SetupAttempts.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/SetupIntents.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/ShippingRates.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Sigma/ScheduledQueryRuns.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/SourceMandateNotifications.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/SourceTransactions.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Sources.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/SubscriptionItems.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/SubscriptionSchedules.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Subscriptions.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TaxCodes.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TaxDeductedAtSources.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TaxIds.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TaxRates.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Terminal/Configurations.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Terminal/ConnectionTokens.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Terminal/Locations.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Terminal/Readers.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TestHelpers/Customers.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TestHelpers/Issuing/Cards.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TestHelpers/Refunds.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TestHelpers/Terminal/Readers.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TestHelpers/TestClocks.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TestHelpers/Treasury/InboundTransfers.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TestHelpers/Treasury/OutboundPayments.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TestHelpers/Treasury/OutboundTransfers.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TestHelpers/Treasury/ReceivedCredits.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TestHelpers/Treasury/ReceivedDebits.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Tokens.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Topups.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/TransferReversals.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Transfers.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Treasury/CreditReversals.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Treasury/DebitReversals.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Treasury/FinancialAccountFeatures.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Treasury/FinancialAccounts.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Treasury/InboundTransfers.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Treasury/OutboundPayments.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Treasury/OutboundTransfers.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Treasury/ReceivedCredits.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Treasury/ReceivedDebits.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Treasury/TransactionEntries.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/Treasury/Transactions.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/UsageRecordSummaries.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/UsageRecords.d.ts (100%) rename types/{2022-08-01 => 2022-11-15}/WebhookEndpoints.d.ts (99%) rename types/{2022-08-01 => 2022-11-15}/index.d.ts (91%) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 33f05239e1..15c420c8c3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -69,7 +69,6 @@ jobs: - "16" - "14" - "12" - - "10" runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 diff --git a/API_VERSION b/API_VERSION index 0366ceb901..63dfe03884 100644 --- a/API_VERSION +++ b/API_VERSION @@ -1 +1 @@ -2022-08-01 +2022-11-15 diff --git a/README.md b/README.md index 12801a9ef0..13b2974a8d 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ See [video demonstrations][youtube-playlist] covering how to use the library. ## Requirements -Node 8, 10 or higher. +Node 12 or higher. ## Installation @@ -73,7 +73,7 @@ and instantiate it as `new Stripe()` with the latest API version. ```ts import Stripe from 'stripe'; const stripe = new Stripe('sk_test_...', { - apiVersion: '2022-08-01', + apiVersion: '2022-11-15', }); const createCustomer = async () => { diff --git a/examples/webhook-signing/typescript-node-express/express-ts.ts b/examples/webhook-signing/typescript-node-express/express-ts.ts index c0a4c1d4b7..88b6da04b2 100644 --- a/examples/webhook-signing/typescript-node-express/express-ts.ts +++ b/examples/webhook-signing/typescript-node-express/express-ts.ts @@ -5,7 +5,7 @@ import env from 'dotenv'; env.config(); const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, { - apiVersion: '2022-08-01', + apiVersion: '2022-11-15', }); const webhookSecret: string = process.env.STRIPE_WEBHOOK_SECRET; diff --git a/lib/Error.js b/lib/Error.js index 0b5c8ad8db..dfdfb447fd 100644 --- a/lib/Error.js +++ b/lib/Error.js @@ -95,7 +95,13 @@ class StripeConnectionError extends StripeError {} * SignatureVerificationError is raised when the signature verification for a * webhook fails */ -class StripeSignatureVerificationError extends StripeError {} +class StripeSignatureVerificationError extends StripeError { + constructor(header, payload, raw = {}) { + super(raw); + this.header = header; + this.payload = payload; + } +} /** * IdempotencyError is raised in cases where an idempotency key was used * improperly. diff --git a/lib/StripeMethod.basic.js b/lib/StripeMethod.basic.js deleted file mode 100644 index 1949b543c9..0000000000 --- a/lib/StripeMethod.basic.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; -const stripeMethod = require('./StripeMethod'); -// DEPRECATED: These were kept for backwards compatibility in case users were -// using this, but basic methods are now explicitly defined on a resource. -module.exports = { - create: stripeMethod({ - method: 'POST', - }), - list: stripeMethod({ - method: 'GET', - methodType: 'list', - }), - retrieve: stripeMethod({ - method: 'GET', - path: '/{id}', - }), - update: stripeMethod({ - method: 'POST', - path: '{id}', - }), - // Avoid 'delete' keyword in JS - del: stripeMethod({ - method: 'DELETE', - path: '{id}', - }), -}; diff --git a/lib/StripeResource.js b/lib/StripeResource.js index 4ca71e7517..6ca731d883 100644 --- a/lib/StripeResource.js +++ b/lib/StripeResource.js @@ -12,9 +12,8 @@ const { const {HttpClient} = require('./net/HttpClient'); // Provide extension mechanism for Stripe Resource Sub-Classes StripeResource.extend = utils.protoExtend; -// Expose method-creator & prepared (basic) methods +// Expose method-creator StripeResource.method = require('./StripeMethod'); -StripeResource.BASIC_METHODS = require('./StripeMethod.basic'); StripeResource.MAX_BUFFERED_REQUEST_METRICS = 100; const MAX_RETRY_AFTER_WAIT = 60; /** @@ -35,14 +34,6 @@ function StripeResource(stripe, deprecatedUrlData) { this.resourcePath = this.path; // @ts-ignore changing type of path this.path = utils.makeURLInterpolator(this.path); - // DEPRECATED: This was kept for backwards compatibility in case users were - // using this, but basic methods are now explicitly defined on a resource. - if (this.includeBasic) { - this.includeBasic.forEach(function(methodName) { - // @ts-ignore - this[methodName] = StripeResource.BASIC_METHODS[methodName]; - }, this); - } this.initialize(...arguments); } StripeResource.prototype = { @@ -95,8 +86,6 @@ StripeResource.prototype = { // interface and so we need to preserve backwards compatibility. return parts.join('/').replace(/\/{2,}/g, '/'); }, - // DEPRECATED: Here for backcompat in case users relied on this. - wrapTimeout: utils.callbackifyPromiseWithTimeout, _addHeadersDirectlyToObject(obj, headers) { // For convenience, make some headers easily accessible on // lastResponse. diff --git a/lib/Webhooks.js b/lib/Webhooks.js index ce6322201e..23690d44a3 100644 --- a/lib/Webhooks.js +++ b/lib/Webhooks.js @@ -145,23 +145,13 @@ function parseEventDetails(encodedPayload, encodedHeader, expectedScheme) { : encodedHeader; const details = parseHeader(decodedHeader, expectedScheme); if (!details || details.timestamp === -1) { - throw new StripeSignatureVerificationError({ + throw new StripeSignatureVerificationError(decodedHeader, decodedPayload, { message: 'Unable to extract timestamp and signatures from header', - // @ts-expect-error Type '{ decodedHeader: any; decodedPayload: any; }' is not assignable to type 'string'. - detail: { - decodedHeader, - decodedPayload, - }, }); } if (!details.signatures.length) { - throw new StripeSignatureVerificationError({ + throw new StripeSignatureVerificationError(decodedHeader, decodedPayload, { message: 'No signatures found with expected scheme', - // @ts-expect-error Type '{ decodedHeader: any; decodedPayload: any; }' is not assignable to type 'string'. - detail: { - decodedHeader, - decodedPayload, - }, }); } return { @@ -182,27 +172,19 @@ function validateComputedSignature( utils.secureCompare.bind(utils, expectedSignature) ).length; if (!signatureFound) { - throw new StripeSignatureVerificationError({ + // @ts-ignore + throw new StripeSignatureVerificationError(header, payload, { message: 'No signatures found matching the expected signature for payload.' + ' Are you passing the raw request body you received from Stripe?' + ' https://github.com/stripe/stripe-node#webhook-signing', - // @ts-expect-error Type '{ header: any; payload: any; }' is not assignable to type 'string'. - detail: { - header, - payload, - }, }); } const timestampAge = Math.floor(Date.now() / 1000) - details.timestamp; if (tolerance > 0 && timestampAge > tolerance) { - throw new StripeSignatureVerificationError({ + // @ts-ignore + throw new StripeSignatureVerificationError(header, payload, { message: 'Timestamp outside the tolerance zone', - // @ts-expect-error Type '{ header: any; payload: any; }' is not assignable to type 'string'. - detail: { - header, - payload, - }, }); } return true; diff --git a/lib/apiVersion.js b/lib/apiVersion.js index 518f4476ab..d28b6bac34 100644 --- a/lib/apiVersion.js +++ b/lib/apiVersion.js @@ -1,3 +1,3 @@ 'use strict'; // File generated from our OpenAPI spec -module.exports = {ApiVersion: '2022-08-01'}; +module.exports = {ApiVersion: '2022-11-15'}; diff --git a/lib/resources.js b/lib/resources.js index 60e5444aad..eb497e3587 100644 --- a/lib/resources.js +++ b/lib/resources.js @@ -25,7 +25,6 @@ module.exports = { InvoiceItems: require('./resources/InvoiceItems'), Mandates: require('./resources/Mandates'), OAuth: require('./resources/OAuth'), - Orders: require('./resources/Orders'), PaymentIntents: require('./resources/PaymentIntents'), PaymentLinks: require('./resources/PaymentLinks'), PaymentMethods: require('./resources/PaymentMethods'), @@ -40,7 +39,6 @@ module.exports = { SetupAttempts: require('./resources/SetupAttempts'), SetupIntents: require('./resources/SetupIntents'), ShippingRates: require('./resources/ShippingRates'), - Skus: require('./resources/SKUs'), Sources: require('./resources/Sources'), Subscriptions: require('./resources/Subscriptions'), SubscriptionItems: require('./resources/SubscriptionItems'), diff --git a/lib/resources/AccountLinks.js b/lib/resources/AccountLinks.js index 2e8453e200..45a2185524 100644 --- a/lib/resources/AccountLinks.js +++ b/lib/resources/AccountLinks.js @@ -3,9 +3,8 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'account_links', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/account_links', }), }); diff --git a/lib/resources/Accounts.js b/lib/resources/Accounts.js index 44d78baf59..63aa6e6bb5 100644 --- a/lib/resources/Accounts.js +++ b/lib/resources/Accounts.js @@ -4,10 +4,9 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; // Since path can either be `account` or `accounts`, support both through stripeMethod path; module.exports = StripeResource.extend({ - path: '', create: stripeMethod({ method: 'POST', - path: 'accounts', + fullPath: '/v1/accounts', }), retrieve(id) { // No longer allow an api key to be passed as the first string to this function due to ambiguity between @@ -15,7 +14,7 @@ module.exports = StripeResource.extend({ if (typeof id === 'string') { return stripeMethod({ method: 'GET', - path: 'accounts/{id}', + fullPath: '/v1/accounts/{id}', }).apply(this, arguments); } else { if (id === null || id === undefined) { @@ -24,84 +23,84 @@ module.exports = StripeResource.extend({ } return stripeMethod({ method: 'GET', - path: 'account', + fullPath: '/v1/account', }).apply(this, arguments); } }, update: stripeMethod({ method: 'POST', - path: 'accounts/{account}', + fullPath: '/v1/accounts/{account}', }), list: stripeMethod({ method: 'GET', - path: 'accounts', + fullPath: '/v1/accounts', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: 'accounts/{account}', + fullPath: '/v1/accounts/{account}', }), reject: stripeMethod({ method: 'POST', - path: 'accounts/{account}/reject', + fullPath: '/v1/accounts/{account}/reject', }), retrieveCapability: stripeMethod({ method: 'GET', - path: 'accounts/{account}/capabilities/{capability}', + fullPath: '/v1/accounts/{account}/capabilities/{capability}', }), updateCapability: stripeMethod({ method: 'POST', - path: 'accounts/{account}/capabilities/{capability}', + fullPath: '/v1/accounts/{account}/capabilities/{capability}', }), listCapabilities: stripeMethod({ method: 'GET', - path: 'accounts/{account}/capabilities', + fullPath: '/v1/accounts/{account}/capabilities', methodType: 'list', }), createExternalAccount: stripeMethod({ method: 'POST', - path: 'accounts/{account}/external_accounts', + fullPath: '/v1/accounts/{account}/external_accounts', }), retrieveExternalAccount: stripeMethod({ method: 'GET', - path: 'accounts/{account}/external_accounts/{id}', + fullPath: '/v1/accounts/{account}/external_accounts/{id}', }), updateExternalAccount: stripeMethod({ method: 'POST', - path: 'accounts/{account}/external_accounts/{id}', + fullPath: '/v1/accounts/{account}/external_accounts/{id}', }), listExternalAccounts: stripeMethod({ method: 'GET', - path: 'accounts/{account}/external_accounts', + fullPath: '/v1/accounts/{account}/external_accounts', methodType: 'list', }), deleteExternalAccount: stripeMethod({ method: 'DELETE', - path: 'accounts/{account}/external_accounts/{id}', + fullPath: '/v1/accounts/{account}/external_accounts/{id}', }), createLoginLink: stripeMethod({ method: 'POST', - path: 'accounts/{account}/login_links', + fullPath: '/v1/accounts/{account}/login_links', }), createPerson: stripeMethod({ method: 'POST', - path: 'accounts/{account}/persons', + fullPath: '/v1/accounts/{account}/persons', }), retrievePerson: stripeMethod({ method: 'GET', - path: 'accounts/{account}/persons/{person}', + fullPath: '/v1/accounts/{account}/persons/{person}', }), updatePerson: stripeMethod({ method: 'POST', - path: 'accounts/{account}/persons/{person}', + fullPath: '/v1/accounts/{account}/persons/{person}', }), listPersons: stripeMethod({ method: 'GET', - path: 'accounts/{account}/persons', + fullPath: '/v1/accounts/{account}/persons', methodType: 'list', }), deletePerson: stripeMethod({ method: 'DELETE', - path: 'accounts/{account}/persons/{person}', + fullPath: '/v1/accounts/{account}/persons/{person}', }), }); diff --git a/lib/resources/ApplePayDomains.js b/lib/resources/ApplePayDomains.js index e9a24f3638..4ca4546ec3 100644 --- a/lib/resources/ApplePayDomains.js +++ b/lib/resources/ApplePayDomains.js @@ -3,22 +3,21 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'apple_pay/domains', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/apple_pay/domains', }), retrieve: stripeMethod({ method: 'GET', - path: '/{domain}', + fullPath: '/v1/apple_pay/domains/{domain}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/apple_pay/domains', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{domain}', + fullPath: '/v1/apple_pay/domains/{domain}', }), }); diff --git a/lib/resources/ApplicationFees.js b/lib/resources/ApplicationFees.js index c2e524df7a..7f0fa49662 100644 --- a/lib/resources/ApplicationFees.js +++ b/lib/resources/ApplicationFees.js @@ -3,31 +3,30 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'application_fees', retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/application_fees/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/application_fees', methodType: 'list', }), createRefund: stripeMethod({ method: 'POST', - path: '/{id}/refunds', + fullPath: '/v1/application_fees/{id}/refunds', }), retrieveRefund: stripeMethod({ method: 'GET', - path: '/{fee}/refunds/{id}', + fullPath: '/v1/application_fees/{fee}/refunds/{id}', }), updateRefund: stripeMethod({ method: 'POST', - path: '/{fee}/refunds/{id}', + fullPath: '/v1/application_fees/{fee}/refunds/{id}', }), listRefunds: stripeMethod({ method: 'GET', - path: '/{id}/refunds', + fullPath: '/v1/application_fees/{id}/refunds', methodType: 'list', }), }); diff --git a/lib/resources/Apps/Secrets.js b/lib/resources/Apps/Secrets.js index d5a0831a6f..112e3539e5 100644 --- a/lib/resources/Apps/Secrets.js +++ b/lib/resources/Apps/Secrets.js @@ -3,22 +3,21 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'apps/secrets', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/apps/secrets', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/apps/secrets', methodType: 'list', }), deleteWhere: stripeMethod({ method: 'POST', - path: '/delete', + fullPath: '/v1/apps/secrets/delete', }), find: stripeMethod({ method: 'GET', - path: '/find', + fullPath: '/v1/apps/secrets/find', }), }); diff --git a/lib/resources/Balance.js b/lib/resources/Balance.js index 9b6f692d86..84378bb100 100644 --- a/lib/resources/Balance.js +++ b/lib/resources/Balance.js @@ -3,9 +3,8 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'balance', retrieve: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/balance', }), }); diff --git a/lib/resources/BalanceTransactions.js b/lib/resources/BalanceTransactions.js index 00438d0dc0..3e205b9dc5 100644 --- a/lib/resources/BalanceTransactions.js +++ b/lib/resources/BalanceTransactions.js @@ -3,14 +3,13 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'balance_transactions', retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/balance_transactions/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/balance_transactions', methodType: 'list', }), }); diff --git a/lib/resources/BillingPortal/Configurations.js b/lib/resources/BillingPortal/Configurations.js index 624852cb04..df450890e9 100644 --- a/lib/resources/BillingPortal/Configurations.js +++ b/lib/resources/BillingPortal/Configurations.js @@ -3,22 +3,21 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'billing_portal/configurations', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/billing_portal/configurations', }), retrieve: stripeMethod({ method: 'GET', - path: '/{configuration}', + fullPath: '/v1/billing_portal/configurations/{configuration}', }), update: stripeMethod({ method: 'POST', - path: '/{configuration}', + fullPath: '/v1/billing_portal/configurations/{configuration}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/billing_portal/configurations', methodType: 'list', }), }); diff --git a/lib/resources/BillingPortal/Sessions.js b/lib/resources/BillingPortal/Sessions.js index 909b3e077e..db2e2e5d2a 100644 --- a/lib/resources/BillingPortal/Sessions.js +++ b/lib/resources/BillingPortal/Sessions.js @@ -3,9 +3,8 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'billing_portal/sessions', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/billing_portal/sessions', }), }); diff --git a/lib/resources/Charges.js b/lib/resources/Charges.js index ebe6b16a76..6e3302700c 100644 --- a/lib/resources/Charges.js +++ b/lib/resources/Charges.js @@ -3,31 +3,30 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'charges', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/charges', }), retrieve: stripeMethod({ method: 'GET', - path: '/{charge}', + fullPath: '/v1/charges/{charge}', }), update: stripeMethod({ method: 'POST', - path: '/{charge}', + fullPath: '/v1/charges/{charge}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/charges', methodType: 'list', }), capture: stripeMethod({ method: 'POST', - path: '/{charge}/capture', + fullPath: '/v1/charges/{charge}/capture', }), search: stripeMethod({ method: 'GET', - path: '/search', + fullPath: '/v1/charges/search', methodType: 'search', }), }); diff --git a/lib/resources/Checkout/Sessions.js b/lib/resources/Checkout/Sessions.js index 9e3e61f000..ecaafb11d2 100644 --- a/lib/resources/Checkout/Sessions.js +++ b/lib/resources/Checkout/Sessions.js @@ -3,27 +3,26 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'checkout/sessions', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/checkout/sessions', }), retrieve: stripeMethod({ method: 'GET', - path: '/{session}', + fullPath: '/v1/checkout/sessions/{session}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/checkout/sessions', methodType: 'list', }), expire: stripeMethod({ method: 'POST', - path: '/{session}/expire', + fullPath: '/v1/checkout/sessions/{session}/expire', }), listLineItems: stripeMethod({ method: 'GET', - path: '/{session}/line_items', + fullPath: '/v1/checkout/sessions/{session}/line_items', methodType: 'list', }), }); diff --git a/lib/resources/CountrySpecs.js b/lib/resources/CountrySpecs.js index 5f76abfdcd..6a9d410b4d 100644 --- a/lib/resources/CountrySpecs.js +++ b/lib/resources/CountrySpecs.js @@ -3,14 +3,13 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'country_specs', retrieve: stripeMethod({ method: 'GET', - path: '/{country}', + fullPath: '/v1/country_specs/{country}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/country_specs', methodType: 'list', }), }); diff --git a/lib/resources/Coupons.js b/lib/resources/Coupons.js index 0e3d7c8acb..043eeead74 100644 --- a/lib/resources/Coupons.js +++ b/lib/resources/Coupons.js @@ -3,26 +3,25 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'coupons', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/coupons', }), retrieve: stripeMethod({ method: 'GET', - path: '/{coupon}', + fullPath: '/v1/coupons/{coupon}', }), update: stripeMethod({ method: 'POST', - path: '/{coupon}', + fullPath: '/v1/coupons/{coupon}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/coupons', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{coupon}', + fullPath: '/v1/coupons/{coupon}', }), }); diff --git a/lib/resources/CreditNotes.js b/lib/resources/CreditNotes.js index 94865f45e6..6574070881 100644 --- a/lib/resources/CreditNotes.js +++ b/lib/resources/CreditNotes.js @@ -3,40 +3,39 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'credit_notes', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/credit_notes', }), retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/credit_notes/{id}', }), update: stripeMethod({ method: 'POST', - path: '/{id}', + fullPath: '/v1/credit_notes/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/credit_notes', methodType: 'list', }), listPreviewLineItems: stripeMethod({ method: 'GET', - path: '/preview/lines', + fullPath: '/v1/credit_notes/preview/lines', methodType: 'list', }), preview: stripeMethod({ method: 'GET', - path: '/preview', + fullPath: '/v1/credit_notes/preview', }), voidCreditNote: stripeMethod({ method: 'POST', - path: '/{id}/void', + fullPath: '/v1/credit_notes/{id}/void', }), listLineItems: stripeMethod({ method: 'GET', - path: '/{creditNote}/lines', + fullPath: '/v1/credit_notes/{credit_note}/lines', methodType: 'list', }), }); diff --git a/lib/resources/Customers.js b/lib/resources/Customers.js index d0236d5444..0c98e91590 100644 --- a/lib/resources/Customers.js +++ b/lib/resources/Customers.js @@ -3,124 +3,124 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'customers', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/customers', }), retrieve: stripeMethod({ method: 'GET', - path: '/{customer}', + fullPath: '/v1/customers/{customer}', }), update: stripeMethod({ method: 'POST', - path: '/{customer}', + fullPath: '/v1/customers/{customer}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/customers', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{customer}', + fullPath: '/v1/customers/{customer}', }), createFundingInstructions: stripeMethod({ method: 'POST', - path: '/{customer}/funding_instructions', + fullPath: '/v1/customers/{customer}/funding_instructions', }), deleteDiscount: stripeMethod({ method: 'DELETE', - path: '/{customer}/discount', + fullPath: '/v1/customers/{customer}/discount', }), listPaymentMethods: stripeMethod({ method: 'GET', - path: '/{customer}/payment_methods', + fullPath: '/v1/customers/{customer}/payment_methods', methodType: 'list', }), retrievePaymentMethod: stripeMethod({ method: 'GET', - path: '/{customer}/payment_methods/{paymentMethod}', + fullPath: '/v1/customers/{customer}/payment_methods/{payment_method}', }), search: stripeMethod({ method: 'GET', - path: '/search', + fullPath: '/v1/customers/search', methodType: 'search', }), retrieveCashBalance: stripeMethod({ method: 'GET', - path: '/{customer}/cash_balance', + fullPath: '/v1/customers/{customer}/cash_balance', }), updateCashBalance: stripeMethod({ method: 'POST', - path: '/{customer}/cash_balance', + fullPath: '/v1/customers/{customer}/cash_balance', }), createBalanceTransaction: stripeMethod({ method: 'POST', - path: '/{customer}/balance_transactions', + fullPath: '/v1/customers/{customer}/balance_transactions', }), retrieveBalanceTransaction: stripeMethod({ method: 'GET', - path: '/{customer}/balance_transactions/{transaction}', + fullPath: '/v1/customers/{customer}/balance_transactions/{transaction}', }), updateBalanceTransaction: stripeMethod({ method: 'POST', - path: '/{customer}/balance_transactions/{transaction}', + fullPath: '/v1/customers/{customer}/balance_transactions/{transaction}', }), listBalanceTransactions: stripeMethod({ method: 'GET', - path: '/{customer}/balance_transactions', + fullPath: '/v1/customers/{customer}/balance_transactions', methodType: 'list', }), retrieveCashBalanceTransaction: stripeMethod({ method: 'GET', - path: '/{customer}/cash_balance_transactions/{transaction}', + fullPath: + '/v1/customers/{customer}/cash_balance_transactions/{transaction}', }), listCashBalanceTransactions: stripeMethod({ method: 'GET', - path: '/{customer}/cash_balance_transactions', + fullPath: '/v1/customers/{customer}/cash_balance_transactions', methodType: 'list', }), createSource: stripeMethod({ method: 'POST', - path: '/{customer}/sources', + fullPath: '/v1/customers/{customer}/sources', }), retrieveSource: stripeMethod({ method: 'GET', - path: '/{customer}/sources/{id}', + fullPath: '/v1/customers/{customer}/sources/{id}', }), updateSource: stripeMethod({ method: 'POST', - path: '/{customer}/sources/{id}', + fullPath: '/v1/customers/{customer}/sources/{id}', }), listSources: stripeMethod({ method: 'GET', - path: '/{customer}/sources', + fullPath: '/v1/customers/{customer}/sources', methodType: 'list', }), deleteSource: stripeMethod({ method: 'DELETE', - path: '/{customer}/sources/{id}', + fullPath: '/v1/customers/{customer}/sources/{id}', }), verifySource: stripeMethod({ method: 'POST', - path: '/{customer}/sources/{id}/verify', + fullPath: '/v1/customers/{customer}/sources/{id}/verify', }), createTaxId: stripeMethod({ method: 'POST', - path: '/{customer}/tax_ids', + fullPath: '/v1/customers/{customer}/tax_ids', }), retrieveTaxId: stripeMethod({ method: 'GET', - path: '/{customer}/tax_ids/{id}', + fullPath: '/v1/customers/{customer}/tax_ids/{id}', }), listTaxIds: stripeMethod({ method: 'GET', - path: '/{customer}/tax_ids', + fullPath: '/v1/customers/{customer}/tax_ids', methodType: 'list', }), deleteTaxId: stripeMethod({ method: 'DELETE', - path: '/{customer}/tax_ids/{id}', + fullPath: '/v1/customers/{customer}/tax_ids/{id}', }), }); diff --git a/lib/resources/Disputes.js b/lib/resources/Disputes.js index 6ca079cd87..3679668634 100644 --- a/lib/resources/Disputes.js +++ b/lib/resources/Disputes.js @@ -3,22 +3,21 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'disputes', retrieve: stripeMethod({ method: 'GET', - path: '/{dispute}', + fullPath: '/v1/disputes/{dispute}', }), update: stripeMethod({ method: 'POST', - path: '/{dispute}', + fullPath: '/v1/disputes/{dispute}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/disputes', methodType: 'list', }), close: stripeMethod({ method: 'POST', - path: '/{dispute}/close', + fullPath: '/v1/disputes/{dispute}/close', }), }); diff --git a/lib/resources/EphemeralKeys.js b/lib/resources/EphemeralKeys.js index 962d341761..186a3b091e 100644 --- a/lib/resources/EphemeralKeys.js +++ b/lib/resources/EphemeralKeys.js @@ -3,10 +3,9 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'ephemeral_keys', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/ephemeral_keys', validator: (data, options) => { if (!options.headers || !options.headers['Stripe-Version']) { throw new Error( @@ -17,6 +16,6 @@ module.exports = StripeResource.extend({ }), del: stripeMethod({ method: 'DELETE', - path: '/{key}', + fullPath: '/v1/ephemeral_keys/{key}', }), }); diff --git a/lib/resources/Events.js b/lib/resources/Events.js index 5c2c8ceb86..e148e305ae 100644 --- a/lib/resources/Events.js +++ b/lib/resources/Events.js @@ -3,14 +3,13 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'events', retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/events/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/events', methodType: 'list', }), }); diff --git a/lib/resources/ExchangeRates.js b/lib/resources/ExchangeRates.js index 3c1464a3ae..f92da86aab 100644 --- a/lib/resources/ExchangeRates.js +++ b/lib/resources/ExchangeRates.js @@ -3,14 +3,13 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'exchange_rates', retrieve: stripeMethod({ method: 'GET', - path: '/{rateId}', + fullPath: '/v1/exchange_rates/{rate_id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/exchange_rates', methodType: 'list', }), }); diff --git a/lib/resources/FileLinks.js b/lib/resources/FileLinks.js index 805e37ee5d..b474227b31 100644 --- a/lib/resources/FileLinks.js +++ b/lib/resources/FileLinks.js @@ -3,22 +3,21 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'file_links', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/file_links', }), retrieve: stripeMethod({ method: 'GET', - path: '/{link}', + fullPath: '/v1/file_links/{link}', }), update: stripeMethod({ method: 'POST', - path: '/{link}', + fullPath: '/v1/file_links/{link}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/file_links', methodType: 'list', }), }); diff --git a/lib/resources/Files.js b/lib/resources/Files.js index b436f465d9..11856b1323 100644 --- a/lib/resources/Files.js +++ b/lib/resources/Files.js @@ -4,9 +4,9 @@ const {multipartRequestDataProcessor} = require('../multipart'); const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'files', create: stripeMethod({ method: 'POST', + fullPath: '/v1/files', headers: { 'Content-Type': 'multipart/form-data', }, @@ -14,11 +14,11 @@ module.exports = StripeResource.extend({ }), retrieve: stripeMethod({ method: 'GET', - path: '/{file}', + fullPath: '/v1/files/{file}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/files', methodType: 'list', }), requestDataProcessor: multipartRequestDataProcessor, diff --git a/lib/resources/FinancialConnections/Accounts.js b/lib/resources/FinancialConnections/Accounts.js index 2a85a3b0d8..8ce36e37b2 100644 --- a/lib/resources/FinancialConnections/Accounts.js +++ b/lib/resources/FinancialConnections/Accounts.js @@ -3,27 +3,26 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'financial_connections/accounts', retrieve: stripeMethod({ method: 'GET', - path: '/{account}', + fullPath: '/v1/financial_connections/accounts/{account}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/financial_connections/accounts', methodType: 'list', }), disconnect: stripeMethod({ method: 'POST', - path: '/{account}/disconnect', + fullPath: '/v1/financial_connections/accounts/{account}/disconnect', }), listOwners: stripeMethod({ method: 'GET', - path: '/{account}/owners', + fullPath: '/v1/financial_connections/accounts/{account}/owners', methodType: 'list', }), refresh: stripeMethod({ method: 'POST', - path: '/{account}/refresh', + fullPath: '/v1/financial_connections/accounts/{account}/refresh', }), }); diff --git a/lib/resources/FinancialConnections/Sessions.js b/lib/resources/FinancialConnections/Sessions.js index 0508a13fc3..b5bbb4c641 100644 --- a/lib/resources/FinancialConnections/Sessions.js +++ b/lib/resources/FinancialConnections/Sessions.js @@ -3,13 +3,12 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'financial_connections/sessions', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/financial_connections/sessions', }), retrieve: stripeMethod({ method: 'GET', - path: '/{session}', + fullPath: '/v1/financial_connections/sessions/{session}', }), }); diff --git a/lib/resources/Identity/VerificationReports.js b/lib/resources/Identity/VerificationReports.js index 058451119b..3bd584a265 100644 --- a/lib/resources/Identity/VerificationReports.js +++ b/lib/resources/Identity/VerificationReports.js @@ -3,14 +3,13 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'identity/verification_reports', retrieve: stripeMethod({ method: 'GET', - path: '/{report}', + fullPath: '/v1/identity/verification_reports/{report}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/identity/verification_reports', methodType: 'list', }), }); diff --git a/lib/resources/Identity/VerificationSessions.js b/lib/resources/Identity/VerificationSessions.js index 4f9ae5d151..e9d3b72e87 100644 --- a/lib/resources/Identity/VerificationSessions.js +++ b/lib/resources/Identity/VerificationSessions.js @@ -3,30 +3,29 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'identity/verification_sessions', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/identity/verification_sessions', }), retrieve: stripeMethod({ method: 'GET', - path: '/{session}', + fullPath: '/v1/identity/verification_sessions/{session}', }), update: stripeMethod({ method: 'POST', - path: '/{session}', + fullPath: '/v1/identity/verification_sessions/{session}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/identity/verification_sessions', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{session}/cancel', + fullPath: '/v1/identity/verification_sessions/{session}/cancel', }), redact: stripeMethod({ method: 'POST', - path: '/{session}/redact', + fullPath: '/v1/identity/verification_sessions/{session}/redact', }), }); diff --git a/lib/resources/InvoiceItems.js b/lib/resources/InvoiceItems.js index 58ed3d88fd..1a961fddb8 100644 --- a/lib/resources/InvoiceItems.js +++ b/lib/resources/InvoiceItems.js @@ -3,26 +3,25 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'invoiceitems', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/invoiceitems', }), retrieve: stripeMethod({ method: 'GET', - path: '/{invoiceitem}', + fullPath: '/v1/invoiceitems/{invoiceitem}', }), update: stripeMethod({ method: 'POST', - path: '/{invoiceitem}', + fullPath: '/v1/invoiceitems/{invoiceitem}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/invoiceitems', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{invoiceitem}', + fullPath: '/v1/invoiceitems/{invoiceitem}', }), }); diff --git a/lib/resources/Invoices.js b/lib/resources/Invoices.js index 67237d020d..e1ac39f34f 100644 --- a/lib/resources/Invoices.js +++ b/lib/resources/Invoices.js @@ -3,65 +3,64 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'invoices', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/invoices', }), retrieve: stripeMethod({ method: 'GET', - path: '/{invoice}', + fullPath: '/v1/invoices/{invoice}', }), update: stripeMethod({ method: 'POST', - path: '/{invoice}', + fullPath: '/v1/invoices/{invoice}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/invoices', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{invoice}', + fullPath: '/v1/invoices/{invoice}', }), finalizeInvoice: stripeMethod({ method: 'POST', - path: '/{invoice}/finalize', + fullPath: '/v1/invoices/{invoice}/finalize', }), listUpcomingLines: stripeMethod({ method: 'GET', - path: '/upcoming/lines', + fullPath: '/v1/invoices/upcoming/lines', methodType: 'list', }), markUncollectible: stripeMethod({ method: 'POST', - path: '/{invoice}/mark_uncollectible', + fullPath: '/v1/invoices/{invoice}/mark_uncollectible', }), pay: stripeMethod({ method: 'POST', - path: '/{invoice}/pay', + fullPath: '/v1/invoices/{invoice}/pay', }), retrieveUpcoming: stripeMethod({ method: 'GET', - path: '/upcoming', + fullPath: '/v1/invoices/upcoming', }), search: stripeMethod({ method: 'GET', - path: '/search', + fullPath: '/v1/invoices/search', methodType: 'search', }), sendInvoice: stripeMethod({ method: 'POST', - path: '/{invoice}/send', + fullPath: '/v1/invoices/{invoice}/send', }), voidInvoice: stripeMethod({ method: 'POST', - path: '/{invoice}/void', + fullPath: '/v1/invoices/{invoice}/void', }), listLineItems: stripeMethod({ method: 'GET', - path: '/{invoice}/lines', + fullPath: '/v1/invoices/{invoice}/lines', methodType: 'list', }), }); diff --git a/lib/resources/Issuing/Authorizations.js b/lib/resources/Issuing/Authorizations.js index 649d2b0595..7d9e894b97 100644 --- a/lib/resources/Issuing/Authorizations.js +++ b/lib/resources/Issuing/Authorizations.js @@ -3,26 +3,25 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'issuing/authorizations', retrieve: stripeMethod({ method: 'GET', - path: '/{authorization}', + fullPath: '/v1/issuing/authorizations/{authorization}', }), update: stripeMethod({ method: 'POST', - path: '/{authorization}', + fullPath: '/v1/issuing/authorizations/{authorization}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/issuing/authorizations', methodType: 'list', }), approve: stripeMethod({ method: 'POST', - path: '/{authorization}/approve', + fullPath: '/v1/issuing/authorizations/{authorization}/approve', }), decline: stripeMethod({ method: 'POST', - path: '/{authorization}/decline', + fullPath: '/v1/issuing/authorizations/{authorization}/decline', }), }); diff --git a/lib/resources/Issuing/Cardholders.js b/lib/resources/Issuing/Cardholders.js index 20f17017b3..a76764eba3 100644 --- a/lib/resources/Issuing/Cardholders.js +++ b/lib/resources/Issuing/Cardholders.js @@ -3,22 +3,21 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'issuing/cardholders', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/issuing/cardholders', }), retrieve: stripeMethod({ method: 'GET', - path: '/{cardholder}', + fullPath: '/v1/issuing/cardholders/{cardholder}', }), update: stripeMethod({ method: 'POST', - path: '/{cardholder}', + fullPath: '/v1/issuing/cardholders/{cardholder}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/issuing/cardholders', methodType: 'list', }), }); diff --git a/lib/resources/Issuing/Cards.js b/lib/resources/Issuing/Cards.js index 35d66cd465..98cc817f1e 100644 --- a/lib/resources/Issuing/Cards.js +++ b/lib/resources/Issuing/Cards.js @@ -3,22 +3,21 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'issuing/cards', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/issuing/cards', }), retrieve: stripeMethod({ method: 'GET', - path: '/{card}', + fullPath: '/v1/issuing/cards/{card}', }), update: stripeMethod({ method: 'POST', - path: '/{card}', + fullPath: '/v1/issuing/cards/{card}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/issuing/cards', methodType: 'list', }), }); diff --git a/lib/resources/Issuing/Disputes.js b/lib/resources/Issuing/Disputes.js index 4d14d03db2..803d4b6149 100644 --- a/lib/resources/Issuing/Disputes.js +++ b/lib/resources/Issuing/Disputes.js @@ -3,26 +3,25 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'issuing/disputes', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/issuing/disputes', }), retrieve: stripeMethod({ method: 'GET', - path: '/{dispute}', + fullPath: '/v1/issuing/disputes/{dispute}', }), update: stripeMethod({ method: 'POST', - path: '/{dispute}', + fullPath: '/v1/issuing/disputes/{dispute}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/issuing/disputes', methodType: 'list', }), submit: stripeMethod({ method: 'POST', - path: '/{dispute}/submit', + fullPath: '/v1/issuing/disputes/{dispute}/submit', }), }); diff --git a/lib/resources/Issuing/Transactions.js b/lib/resources/Issuing/Transactions.js index 23a8e4f41e..789dd7e3df 100644 --- a/lib/resources/Issuing/Transactions.js +++ b/lib/resources/Issuing/Transactions.js @@ -3,18 +3,17 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'issuing/transactions', retrieve: stripeMethod({ method: 'GET', - path: '/{transaction}', + fullPath: '/v1/issuing/transactions/{transaction}', }), update: stripeMethod({ method: 'POST', - path: '/{transaction}', + fullPath: '/v1/issuing/transactions/{transaction}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/issuing/transactions', methodType: 'list', }), }); diff --git a/lib/resources/Mandates.js b/lib/resources/Mandates.js index 37bc7fae45..06240ae2d2 100644 --- a/lib/resources/Mandates.js +++ b/lib/resources/Mandates.js @@ -3,9 +3,8 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'mandates', retrieve: stripeMethod({ method: 'GET', - path: '/{mandate}', + fullPath: '/v1/mandates/{mandate}', }), }); diff --git a/lib/resources/Orders.js b/lib/resources/Orders.js deleted file mode 100644 index 61697d6a14..0000000000 --- a/lib/resources/Orders.js +++ /dev/null @@ -1,41 +0,0 @@ -// File generated from our OpenAPI spec -'use strict'; -const StripeResource = require('../StripeResource'); -const stripeMethod = StripeResource.method; -module.exports = StripeResource.extend({ - path: 'orders', - create: stripeMethod({ - method: 'POST', - path: '', - }), - retrieve: stripeMethod({ - method: 'GET', - path: '/{id}', - }), - update: stripeMethod({ - method: 'POST', - path: '/{id}', - }), - list: stripeMethod({ - method: 'GET', - path: '', - methodType: 'list', - }), - cancel: stripeMethod({ - method: 'POST', - path: '/{id}/cancel', - }), - listLineItems: stripeMethod({ - method: 'GET', - path: '/{id}/line_items', - methodType: 'list', - }), - reopen: stripeMethod({ - method: 'POST', - path: '/{id}/reopen', - }), - submit: stripeMethod({ - method: 'POST', - path: '/{id}/submit', - }), -}); diff --git a/lib/resources/PaymentIntents.js b/lib/resources/PaymentIntents.js index b79f5aa6f5..963f1688e6 100644 --- a/lib/resources/PaymentIntents.js +++ b/lib/resources/PaymentIntents.js @@ -3,51 +3,50 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'payment_intents', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/payment_intents', }), retrieve: stripeMethod({ method: 'GET', - path: '/{intent}', + fullPath: '/v1/payment_intents/{intent}', }), update: stripeMethod({ method: 'POST', - path: '/{intent}', + fullPath: '/v1/payment_intents/{intent}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/payment_intents', methodType: 'list', }), applyCustomerBalance: stripeMethod({ method: 'POST', - path: '/{intent}/apply_customer_balance', + fullPath: '/v1/payment_intents/{intent}/apply_customer_balance', }), cancel: stripeMethod({ method: 'POST', - path: '/{intent}/cancel', + fullPath: '/v1/payment_intents/{intent}/cancel', }), capture: stripeMethod({ method: 'POST', - path: '/{intent}/capture', + fullPath: '/v1/payment_intents/{intent}/capture', }), confirm: stripeMethod({ method: 'POST', - path: '/{intent}/confirm', + fullPath: '/v1/payment_intents/{intent}/confirm', }), incrementAuthorization: stripeMethod({ method: 'POST', - path: '/{intent}/increment_authorization', + fullPath: '/v1/payment_intents/{intent}/increment_authorization', }), search: stripeMethod({ method: 'GET', - path: '/search', + fullPath: '/v1/payment_intents/search', methodType: 'search', }), verifyMicrodeposits: stripeMethod({ method: 'POST', - path: '/{intent}/verify_microdeposits', + fullPath: '/v1/payment_intents/{intent}/verify_microdeposits', }), }); diff --git a/lib/resources/PaymentLinks.js b/lib/resources/PaymentLinks.js index b2e76d285f..86acf3cb8c 100644 --- a/lib/resources/PaymentLinks.js +++ b/lib/resources/PaymentLinks.js @@ -3,27 +3,26 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'payment_links', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/payment_links', }), retrieve: stripeMethod({ method: 'GET', - path: '/{paymentLink}', + fullPath: '/v1/payment_links/{payment_link}', }), update: stripeMethod({ method: 'POST', - path: '/{paymentLink}', + fullPath: '/v1/payment_links/{payment_link}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/payment_links', methodType: 'list', }), listLineItems: stripeMethod({ method: 'GET', - path: '/{paymentLink}/line_items', + fullPath: '/v1/payment_links/{payment_link}/line_items', methodType: 'list', }), }); diff --git a/lib/resources/PaymentMethods.js b/lib/resources/PaymentMethods.js index dff07ab37e..85fc630698 100644 --- a/lib/resources/PaymentMethods.js +++ b/lib/resources/PaymentMethods.js @@ -3,30 +3,29 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'payment_methods', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/payment_methods', }), retrieve: stripeMethod({ method: 'GET', - path: '/{paymentMethod}', + fullPath: '/v1/payment_methods/{payment_method}', }), update: stripeMethod({ method: 'POST', - path: '/{paymentMethod}', + fullPath: '/v1/payment_methods/{payment_method}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/payment_methods', methodType: 'list', }), attach: stripeMethod({ method: 'POST', - path: '/{paymentMethod}/attach', + fullPath: '/v1/payment_methods/{payment_method}/attach', }), detach: stripeMethod({ method: 'POST', - path: '/{paymentMethod}/detach', + fullPath: '/v1/payment_methods/{payment_method}/detach', }), }); diff --git a/lib/resources/Payouts.js b/lib/resources/Payouts.js index 3ba5176ffc..fd8ddde975 100644 --- a/lib/resources/Payouts.js +++ b/lib/resources/Payouts.js @@ -3,30 +3,29 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'payouts', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/payouts', }), retrieve: stripeMethod({ method: 'GET', - path: '/{payout}', + fullPath: '/v1/payouts/{payout}', }), update: stripeMethod({ method: 'POST', - path: '/{payout}', + fullPath: '/v1/payouts/{payout}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/payouts', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{payout}/cancel', + fullPath: '/v1/payouts/{payout}/cancel', }), reverse: stripeMethod({ method: 'POST', - path: '/{payout}/reverse', + fullPath: '/v1/payouts/{payout}/reverse', }), }); diff --git a/lib/resources/Plans.js b/lib/resources/Plans.js index ade0a6cab4..a39523bd8c 100644 --- a/lib/resources/Plans.js +++ b/lib/resources/Plans.js @@ -3,26 +3,25 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'plans', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/plans', }), retrieve: stripeMethod({ method: 'GET', - path: '/{plan}', + fullPath: '/v1/plans/{plan}', }), update: stripeMethod({ method: 'POST', - path: '/{plan}', + fullPath: '/v1/plans/{plan}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/plans', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{plan}', + fullPath: '/v1/plans/{plan}', }), }); diff --git a/lib/resources/Prices.js b/lib/resources/Prices.js index f48b5b9981..7406e1362f 100644 --- a/lib/resources/Prices.js +++ b/lib/resources/Prices.js @@ -3,27 +3,26 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'prices', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/prices', }), retrieve: stripeMethod({ method: 'GET', - path: '/{price}', + fullPath: '/v1/prices/{price}', }), update: stripeMethod({ method: 'POST', - path: '/{price}', + fullPath: '/v1/prices/{price}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/prices', methodType: 'list', }), search: stripeMethod({ method: 'GET', - path: '/search', + fullPath: '/v1/prices/search', methodType: 'search', }), }); diff --git a/lib/resources/Products.js b/lib/resources/Products.js index fdb03d6a30..eba8e78d30 100644 --- a/lib/resources/Products.js +++ b/lib/resources/Products.js @@ -3,31 +3,30 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'products', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/products', }), retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/products/{id}', }), update: stripeMethod({ method: 'POST', - path: '/{id}', + fullPath: '/v1/products/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/products', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{id}', + fullPath: '/v1/products/{id}', }), search: stripeMethod({ method: 'GET', - path: '/search', + fullPath: '/v1/products/search', methodType: 'search', }), }); diff --git a/lib/resources/PromotionCodes.js b/lib/resources/PromotionCodes.js index 77d3ac71bd..e112795f02 100644 --- a/lib/resources/PromotionCodes.js +++ b/lib/resources/PromotionCodes.js @@ -3,22 +3,21 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'promotion_codes', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/promotion_codes', }), retrieve: stripeMethod({ method: 'GET', - path: '/{promotionCode}', + fullPath: '/v1/promotion_codes/{promotion_code}', }), update: stripeMethod({ method: 'POST', - path: '/{promotionCode}', + fullPath: '/v1/promotion_codes/{promotion_code}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/promotion_codes', methodType: 'list', }), }); diff --git a/lib/resources/Quotes.js b/lib/resources/Quotes.js index ca6073104d..f5c97a375b 100644 --- a/lib/resources/Quotes.js +++ b/lib/resources/Quotes.js @@ -3,50 +3,49 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'quotes', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/quotes', }), retrieve: stripeMethod({ method: 'GET', - path: '/{quote}', + fullPath: '/v1/quotes/{quote}', }), update: stripeMethod({ method: 'POST', - path: '/{quote}', + fullPath: '/v1/quotes/{quote}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/quotes', methodType: 'list', }), accept: stripeMethod({ method: 'POST', - path: '/{quote}/accept', + fullPath: '/v1/quotes/{quote}/accept', }), cancel: stripeMethod({ method: 'POST', - path: '/{quote}/cancel', + fullPath: '/v1/quotes/{quote}/cancel', }), finalizeQuote: stripeMethod({ method: 'POST', - path: '/{quote}/finalize', + fullPath: '/v1/quotes/{quote}/finalize', }), listComputedUpfrontLineItems: stripeMethod({ method: 'GET', - path: '/{quote}/computed_upfront_line_items', + fullPath: '/v1/quotes/{quote}/computed_upfront_line_items', methodType: 'list', }), listLineItems: stripeMethod({ method: 'GET', - path: '/{quote}/line_items', + fullPath: '/v1/quotes/{quote}/line_items', methodType: 'list', }), pdf: stripeMethod({ host: 'files.stripe.com', method: 'GET', - path: '/{quote}/pdf', + fullPath: '/v1/quotes/{quote}/pdf', streaming: true, }), }); diff --git a/lib/resources/Radar/EarlyFraudWarnings.js b/lib/resources/Radar/EarlyFraudWarnings.js index 3b32b7aee5..5eaf23768a 100644 --- a/lib/resources/Radar/EarlyFraudWarnings.js +++ b/lib/resources/Radar/EarlyFraudWarnings.js @@ -3,14 +3,13 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'radar/early_fraud_warnings', retrieve: stripeMethod({ method: 'GET', - path: '/{earlyFraudWarning}', + fullPath: '/v1/radar/early_fraud_warnings/{early_fraud_warning}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/radar/early_fraud_warnings', methodType: 'list', }), }); diff --git a/lib/resources/Radar/ValueListItems.js b/lib/resources/Radar/ValueListItems.js index 2555807345..4fd46fd0ac 100644 --- a/lib/resources/Radar/ValueListItems.js +++ b/lib/resources/Radar/ValueListItems.js @@ -3,22 +3,21 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'radar/value_list_items', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/radar/value_list_items', }), retrieve: stripeMethod({ method: 'GET', - path: '/{item}', + fullPath: '/v1/radar/value_list_items/{item}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/radar/value_list_items', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{item}', + fullPath: '/v1/radar/value_list_items/{item}', }), }); diff --git a/lib/resources/Radar/ValueLists.js b/lib/resources/Radar/ValueLists.js index 8f3b6f9648..e89b5500c8 100644 --- a/lib/resources/Radar/ValueLists.js +++ b/lib/resources/Radar/ValueLists.js @@ -3,26 +3,25 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'radar/value_lists', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/radar/value_lists', }), retrieve: stripeMethod({ method: 'GET', - path: '/{valueList}', + fullPath: '/v1/radar/value_lists/{value_list}', }), update: stripeMethod({ method: 'POST', - path: '/{valueList}', + fullPath: '/v1/radar/value_lists/{value_list}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/radar/value_lists', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{valueList}', + fullPath: '/v1/radar/value_lists/{value_list}', }), }); diff --git a/lib/resources/Refunds.js b/lib/resources/Refunds.js index 698646e681..87d3f6e1dc 100644 --- a/lib/resources/Refunds.js +++ b/lib/resources/Refunds.js @@ -3,26 +3,25 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'refunds', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/refunds', }), retrieve: stripeMethod({ method: 'GET', - path: '/{refund}', + fullPath: '/v1/refunds/{refund}', }), update: stripeMethod({ method: 'POST', - path: '/{refund}', + fullPath: '/v1/refunds/{refund}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/refunds', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{refund}/cancel', + fullPath: '/v1/refunds/{refund}/cancel', }), }); diff --git a/lib/resources/Reporting/ReportRuns.js b/lib/resources/Reporting/ReportRuns.js index 0d0055f6da..d6e853aff0 100644 --- a/lib/resources/Reporting/ReportRuns.js +++ b/lib/resources/Reporting/ReportRuns.js @@ -3,18 +3,17 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'reporting/report_runs', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/reporting/report_runs', }), retrieve: stripeMethod({ method: 'GET', - path: '/{reportRun}', + fullPath: '/v1/reporting/report_runs/{report_run}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/reporting/report_runs', methodType: 'list', }), }); diff --git a/lib/resources/Reporting/ReportTypes.js b/lib/resources/Reporting/ReportTypes.js index 7a1f1bb67c..58e8075460 100644 --- a/lib/resources/Reporting/ReportTypes.js +++ b/lib/resources/Reporting/ReportTypes.js @@ -3,14 +3,13 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'reporting/report_types', retrieve: stripeMethod({ method: 'GET', - path: '/{reportType}', + fullPath: '/v1/reporting/report_types/{report_type}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/reporting/report_types', methodType: 'list', }), }); diff --git a/lib/resources/Reviews.js b/lib/resources/Reviews.js index f4426b2703..201fbc1d64 100644 --- a/lib/resources/Reviews.js +++ b/lib/resources/Reviews.js @@ -3,18 +3,17 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'reviews', retrieve: stripeMethod({ method: 'GET', - path: '/{review}', + fullPath: '/v1/reviews/{review}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/reviews', methodType: 'list', }), approve: stripeMethod({ method: 'POST', - path: '/{review}/approve', + fullPath: '/v1/reviews/{review}/approve', }), }); diff --git a/lib/resources/SKUs.js b/lib/resources/SKUs.js deleted file mode 100644 index 9347fb54e0..0000000000 --- a/lib/resources/SKUs.js +++ /dev/null @@ -1,28 +0,0 @@ -// File generated from our OpenAPI spec -'use strict'; -const StripeResource = require('../StripeResource'); -const stripeMethod = StripeResource.method; -module.exports = StripeResource.extend({ - path: 'skus', - create: stripeMethod({ - method: 'POST', - path: '', - }), - retrieve: stripeMethod({ - method: 'GET', - path: '/{id}', - }), - update: stripeMethod({ - method: 'POST', - path: '/{id}', - }), - list: stripeMethod({ - method: 'GET', - path: '', - methodType: 'list', - }), - del: stripeMethod({ - method: 'DELETE', - path: '/{id}', - }), -}); diff --git a/lib/resources/SetupAttempts.js b/lib/resources/SetupAttempts.js index c8144bf284..36f232f4b9 100644 --- a/lib/resources/SetupAttempts.js +++ b/lib/resources/SetupAttempts.js @@ -3,10 +3,9 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'setup_attempts', list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/setup_attempts', methodType: 'list', }), }); diff --git a/lib/resources/SetupIntents.js b/lib/resources/SetupIntents.js index adbf79a340..9ce7ca7231 100644 --- a/lib/resources/SetupIntents.js +++ b/lib/resources/SetupIntents.js @@ -3,34 +3,33 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'setup_intents', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/setup_intents', }), retrieve: stripeMethod({ method: 'GET', - path: '/{intent}', + fullPath: '/v1/setup_intents/{intent}', }), update: stripeMethod({ method: 'POST', - path: '/{intent}', + fullPath: '/v1/setup_intents/{intent}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/setup_intents', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{intent}/cancel', + fullPath: '/v1/setup_intents/{intent}/cancel', }), confirm: stripeMethod({ method: 'POST', - path: '/{intent}/confirm', + fullPath: '/v1/setup_intents/{intent}/confirm', }), verifyMicrodeposits: stripeMethod({ method: 'POST', - path: '/{intent}/verify_microdeposits', + fullPath: '/v1/setup_intents/{intent}/verify_microdeposits', }), }); diff --git a/lib/resources/ShippingRates.js b/lib/resources/ShippingRates.js index 859f07772d..abda3a77c0 100644 --- a/lib/resources/ShippingRates.js +++ b/lib/resources/ShippingRates.js @@ -3,22 +3,21 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'shipping_rates', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/shipping_rates', }), retrieve: stripeMethod({ method: 'GET', - path: '/{shippingRateToken}', + fullPath: '/v1/shipping_rates/{shipping_rate_token}', }), update: stripeMethod({ method: 'POST', - path: '/{shippingRateToken}', + fullPath: '/v1/shipping_rates/{shipping_rate_token}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/shipping_rates', methodType: 'list', }), }); diff --git a/lib/resources/Sigma/ScheduledQueryRuns.js b/lib/resources/Sigma/ScheduledQueryRuns.js index e518c11a46..4e6c7211a1 100644 --- a/lib/resources/Sigma/ScheduledQueryRuns.js +++ b/lib/resources/Sigma/ScheduledQueryRuns.js @@ -3,14 +3,13 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'sigma/scheduled_query_runs', retrieve: stripeMethod({ method: 'GET', - path: '/{scheduledQueryRun}', + fullPath: '/v1/sigma/scheduled_query_runs/{scheduled_query_run}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/sigma/scheduled_query_runs', methodType: 'list', }), }); diff --git a/lib/resources/Sources.js b/lib/resources/Sources.js index 8dc06c4df6..e26f8ad3b9 100644 --- a/lib/resources/Sources.js +++ b/lib/resources/Sources.js @@ -3,26 +3,25 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'sources', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/sources', }), retrieve: stripeMethod({ method: 'GET', - path: '/{source}', + fullPath: '/v1/sources/{source}', }), update: stripeMethod({ method: 'POST', - path: '/{source}', + fullPath: '/v1/sources/{source}', }), listSourceTransactions: stripeMethod({ method: 'GET', - path: '/{source}/source_transactions', + fullPath: '/v1/sources/{source}/source_transactions', methodType: 'list', }), verify: stripeMethod({ method: 'POST', - path: '/{source}/verify', + fullPath: '/v1/sources/{source}/verify', }), }); diff --git a/lib/resources/SubscriptionItems.js b/lib/resources/SubscriptionItems.js index 8d05380657..7681fb88ac 100644 --- a/lib/resources/SubscriptionItems.js +++ b/lib/resources/SubscriptionItems.js @@ -3,35 +3,35 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'subscription_items', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/subscription_items', }), retrieve: stripeMethod({ method: 'GET', - path: '/{item}', + fullPath: '/v1/subscription_items/{item}', }), update: stripeMethod({ method: 'POST', - path: '/{item}', + fullPath: '/v1/subscription_items/{item}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/subscription_items', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{item}', + fullPath: '/v1/subscription_items/{item}', }), createUsageRecord: stripeMethod({ method: 'POST', - path: '/{subscriptionItem}/usage_records', + fullPath: '/v1/subscription_items/{subscription_item}/usage_records', }), listUsageRecordSummaries: stripeMethod({ method: 'GET', - path: '/{subscriptionItem}/usage_record_summaries', + fullPath: + '/v1/subscription_items/{subscription_item}/usage_record_summaries', methodType: 'list', }), }); diff --git a/lib/resources/SubscriptionSchedules.js b/lib/resources/SubscriptionSchedules.js index 4bb9916c21..c2d3e634f3 100644 --- a/lib/resources/SubscriptionSchedules.js +++ b/lib/resources/SubscriptionSchedules.js @@ -3,30 +3,29 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'subscription_schedules', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/subscription_schedules', }), retrieve: stripeMethod({ method: 'GET', - path: '/{schedule}', + fullPath: '/v1/subscription_schedules/{schedule}', }), update: stripeMethod({ method: 'POST', - path: '/{schedule}', + fullPath: '/v1/subscription_schedules/{schedule}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/subscription_schedules', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{schedule}/cancel', + fullPath: '/v1/subscription_schedules/{schedule}/cancel', }), release: stripeMethod({ method: 'POST', - path: '/{schedule}/release', + fullPath: '/v1/subscription_schedules/{schedule}/release', }), }); diff --git a/lib/resources/Subscriptions.js b/lib/resources/Subscriptions.js index 14494398b8..4790d2d0ca 100644 --- a/lib/resources/Subscriptions.js +++ b/lib/resources/Subscriptions.js @@ -3,39 +3,38 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'subscriptions', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/subscriptions', }), retrieve: stripeMethod({ method: 'GET', - path: '/{subscriptionExposedId}', + fullPath: '/v1/subscriptions/{subscription_exposed_id}', }), update: stripeMethod({ method: 'POST', - path: '/{subscriptionExposedId}', + fullPath: '/v1/subscriptions/{subscription_exposed_id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/subscriptions', methodType: 'list', }), cancel: stripeMethod({ method: 'DELETE', - path: '/{subscriptionExposedId}', + fullPath: '/v1/subscriptions/{subscription_exposed_id}', }), del: stripeMethod({ method: 'DELETE', - path: '/{subscriptionExposedId}', + fullPath: '/v1/subscriptions/{subscription_exposed_id}', }), deleteDiscount: stripeMethod({ method: 'DELETE', - path: '/{subscriptionExposedId}/discount', + fullPath: '/v1/subscriptions/{subscription_exposed_id}/discount', }), search: stripeMethod({ method: 'GET', - path: '/search', + fullPath: '/v1/subscriptions/search', methodType: 'search', }), }); diff --git a/lib/resources/TaxCodes.js b/lib/resources/TaxCodes.js index 37c76cfb2d..d590878674 100644 --- a/lib/resources/TaxCodes.js +++ b/lib/resources/TaxCodes.js @@ -3,14 +3,13 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'tax_codes', retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/tax_codes/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/tax_codes', methodType: 'list', }), }); diff --git a/lib/resources/TaxRates.js b/lib/resources/TaxRates.js index 2d2242c80d..e4975933ad 100644 --- a/lib/resources/TaxRates.js +++ b/lib/resources/TaxRates.js @@ -3,22 +3,21 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'tax_rates', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/tax_rates', }), retrieve: stripeMethod({ method: 'GET', - path: '/{taxRate}', + fullPath: '/v1/tax_rates/{tax_rate}', }), update: stripeMethod({ method: 'POST', - path: '/{taxRate}', + fullPath: '/v1/tax_rates/{tax_rate}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/tax_rates', methodType: 'list', }), }); diff --git a/lib/resources/Terminal/Configurations.js b/lib/resources/Terminal/Configurations.js index c040bbc9f7..02c8297c27 100644 --- a/lib/resources/Terminal/Configurations.js +++ b/lib/resources/Terminal/Configurations.js @@ -3,26 +3,25 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'terminal/configurations', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/terminal/configurations', }), retrieve: stripeMethod({ method: 'GET', - path: '/{configuration}', + fullPath: '/v1/terminal/configurations/{configuration}', }), update: stripeMethod({ method: 'POST', - path: '/{configuration}', + fullPath: '/v1/terminal/configurations/{configuration}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/terminal/configurations', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{configuration}', + fullPath: '/v1/terminal/configurations/{configuration}', }), }); diff --git a/lib/resources/Terminal/ConnectionTokens.js b/lib/resources/Terminal/ConnectionTokens.js index fc16a45e17..640a6b8712 100644 --- a/lib/resources/Terminal/ConnectionTokens.js +++ b/lib/resources/Terminal/ConnectionTokens.js @@ -3,9 +3,8 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'terminal/connection_tokens', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/terminal/connection_tokens', }), }); diff --git a/lib/resources/Terminal/Locations.js b/lib/resources/Terminal/Locations.js index e89ac4c4d7..6b893361a6 100644 --- a/lib/resources/Terminal/Locations.js +++ b/lib/resources/Terminal/Locations.js @@ -3,26 +3,25 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'terminal/locations', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/terminal/locations', }), retrieve: stripeMethod({ method: 'GET', - path: '/{location}', + fullPath: '/v1/terminal/locations/{location}', }), update: stripeMethod({ method: 'POST', - path: '/{location}', + fullPath: '/v1/terminal/locations/{location}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/terminal/locations', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{location}', + fullPath: '/v1/terminal/locations/{location}', }), }); diff --git a/lib/resources/Terminal/Readers.js b/lib/resources/Terminal/Readers.js index ec5cbae9a0..879835e91c 100644 --- a/lib/resources/Terminal/Readers.js +++ b/lib/resources/Terminal/Readers.js @@ -3,42 +3,41 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'terminal/readers', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/terminal/readers', }), retrieve: stripeMethod({ method: 'GET', - path: '/{reader}', + fullPath: '/v1/terminal/readers/{reader}', }), update: stripeMethod({ method: 'POST', - path: '/{reader}', + fullPath: '/v1/terminal/readers/{reader}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/terminal/readers', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{reader}', + fullPath: '/v1/terminal/readers/{reader}', }), cancelAction: stripeMethod({ method: 'POST', - path: '/{reader}/cancel_action', + fullPath: '/v1/terminal/readers/{reader}/cancel_action', }), processPaymentIntent: stripeMethod({ method: 'POST', - path: '/{reader}/process_payment_intent', + fullPath: '/v1/terminal/readers/{reader}/process_payment_intent', }), processSetupIntent: stripeMethod({ method: 'POST', - path: '/{reader}/process_setup_intent', + fullPath: '/v1/terminal/readers/{reader}/process_setup_intent', }), setReaderDisplay: stripeMethod({ method: 'POST', - path: '/{reader}/set_reader_display', + fullPath: '/v1/terminal/readers/{reader}/set_reader_display', }), }); diff --git a/lib/resources/TestHelpers/Customers.js b/lib/resources/TestHelpers/Customers.js index 418ac2b91b..98bb0b651f 100644 --- a/lib/resources/TestHelpers/Customers.js +++ b/lib/resources/TestHelpers/Customers.js @@ -3,9 +3,8 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/customers', fundCashBalance: stripeMethod({ method: 'POST', - path: '/{customer}/fund_cash_balance', + fullPath: '/v1/test_helpers/customers/{customer}/fund_cash_balance', }), }); diff --git a/lib/resources/TestHelpers/Issuing/Cards.js b/lib/resources/TestHelpers/Issuing/Cards.js index 67d2ae6841..4e13f2245e 100644 --- a/lib/resources/TestHelpers/Issuing/Cards.js +++ b/lib/resources/TestHelpers/Issuing/Cards.js @@ -3,21 +3,20 @@ const StripeResource = require('../../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/issuing/cards', deliverCard: stripeMethod({ method: 'POST', - path: '/{card}/shipping/deliver', + fullPath: '/v1/test_helpers/issuing/cards/{card}/shipping/deliver', }), failCard: stripeMethod({ method: 'POST', - path: '/{card}/shipping/fail', + fullPath: '/v1/test_helpers/issuing/cards/{card}/shipping/fail', }), returnCard: stripeMethod({ method: 'POST', - path: '/{card}/shipping/return', + fullPath: '/v1/test_helpers/issuing/cards/{card}/shipping/return', }), shipCard: stripeMethod({ method: 'POST', - path: '/{card}/shipping/ship', + fullPath: '/v1/test_helpers/issuing/cards/{card}/shipping/ship', }), }); diff --git a/lib/resources/TestHelpers/Refunds.js b/lib/resources/TestHelpers/Refunds.js index 23c6e4a536..79f2f221bc 100644 --- a/lib/resources/TestHelpers/Refunds.js +++ b/lib/resources/TestHelpers/Refunds.js @@ -3,9 +3,8 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/refunds', expire: stripeMethod({ method: 'POST', - path: '/{refund}/expire', + fullPath: '/v1/test_helpers/refunds/{refund}/expire', }), }); diff --git a/lib/resources/TestHelpers/Terminal/Readers.js b/lib/resources/TestHelpers/Terminal/Readers.js index 9e1b961009..a828c20ccf 100644 --- a/lib/resources/TestHelpers/Terminal/Readers.js +++ b/lib/resources/TestHelpers/Terminal/Readers.js @@ -3,9 +3,9 @@ const StripeResource = require('../../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/terminal/readers', presentPaymentMethod: stripeMethod({ method: 'POST', - path: '/{reader}/present_payment_method', + fullPath: + '/v1/test_helpers/terminal/readers/{reader}/present_payment_method', }), }); diff --git a/lib/resources/TestHelpers/TestClocks.js b/lib/resources/TestHelpers/TestClocks.js index 23e443c940..d3686c123e 100644 --- a/lib/resources/TestHelpers/TestClocks.js +++ b/lib/resources/TestHelpers/TestClocks.js @@ -3,26 +3,25 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/test_clocks', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/test_helpers/test_clocks', }), retrieve: stripeMethod({ method: 'GET', - path: '/{testClock}', + fullPath: '/v1/test_helpers/test_clocks/{test_clock}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/test_helpers/test_clocks', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{testClock}', + fullPath: '/v1/test_helpers/test_clocks/{test_clock}', }), advance: stripeMethod({ method: 'POST', - path: '/{testClock}/advance', + fullPath: '/v1/test_helpers/test_clocks/{test_clock}/advance', }), }); diff --git a/lib/resources/TestHelpers/Treasury/InboundTransfers.js b/lib/resources/TestHelpers/Treasury/InboundTransfers.js index a565bdb064..0143e4b71a 100644 --- a/lib/resources/TestHelpers/Treasury/InboundTransfers.js +++ b/lib/resources/TestHelpers/Treasury/InboundTransfers.js @@ -3,17 +3,16 @@ const StripeResource = require('../../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/treasury/inbound_transfers', fail: stripeMethod({ method: 'POST', - path: '/{id}/fail', + fullPath: '/v1/test_helpers/treasury/inbound_transfers/{id}/fail', }), returnInboundTransfer: stripeMethod({ method: 'POST', - path: '/{id}/return', + fullPath: '/v1/test_helpers/treasury/inbound_transfers/{id}/return', }), succeed: stripeMethod({ method: 'POST', - path: '/{id}/succeed', + fullPath: '/v1/test_helpers/treasury/inbound_transfers/{id}/succeed', }), }); diff --git a/lib/resources/TestHelpers/Treasury/OutboundPayments.js b/lib/resources/TestHelpers/Treasury/OutboundPayments.js index 3b0e9c0b28..7bed50182d 100644 --- a/lib/resources/TestHelpers/Treasury/OutboundPayments.js +++ b/lib/resources/TestHelpers/Treasury/OutboundPayments.js @@ -3,17 +3,16 @@ const StripeResource = require('../../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/treasury/outbound_payments', fail: stripeMethod({ method: 'POST', - path: '/{id}/fail', + fullPath: '/v1/test_helpers/treasury/outbound_payments/{id}/fail', }), post: stripeMethod({ method: 'POST', - path: '/{id}/post', + fullPath: '/v1/test_helpers/treasury/outbound_payments/{id}/post', }), returnOutboundPayment: stripeMethod({ method: 'POST', - path: '/{id}/return', + fullPath: '/v1/test_helpers/treasury/outbound_payments/{id}/return', }), }); diff --git a/lib/resources/TestHelpers/Treasury/OutboundTransfers.js b/lib/resources/TestHelpers/Treasury/OutboundTransfers.js index 70c4282770..f38f2a6743 100644 --- a/lib/resources/TestHelpers/Treasury/OutboundTransfers.js +++ b/lib/resources/TestHelpers/Treasury/OutboundTransfers.js @@ -3,17 +3,19 @@ const StripeResource = require('../../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/treasury/outbound_transfers', fail: stripeMethod({ method: 'POST', - path: '/{outboundTransfer}/fail', + fullPath: + '/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail', }), post: stripeMethod({ method: 'POST', - path: '/{outboundTransfer}/post', + fullPath: + '/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post', }), returnOutboundTransfer: stripeMethod({ method: 'POST', - path: '/{outboundTransfer}/return', + fullPath: + '/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return', }), }); diff --git a/lib/resources/TestHelpers/Treasury/ReceivedCredits.js b/lib/resources/TestHelpers/Treasury/ReceivedCredits.js index c13b41e601..3461023f91 100644 --- a/lib/resources/TestHelpers/Treasury/ReceivedCredits.js +++ b/lib/resources/TestHelpers/Treasury/ReceivedCredits.js @@ -3,9 +3,8 @@ const StripeResource = require('../../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/treasury/received_credits', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/test_helpers/treasury/received_credits', }), }); diff --git a/lib/resources/TestHelpers/Treasury/ReceivedDebits.js b/lib/resources/TestHelpers/Treasury/ReceivedDebits.js index 245ff75520..9d27e31246 100644 --- a/lib/resources/TestHelpers/Treasury/ReceivedDebits.js +++ b/lib/resources/TestHelpers/Treasury/ReceivedDebits.js @@ -3,9 +3,8 @@ const StripeResource = require('../../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/treasury/received_debits', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/test_helpers/treasury/received_debits', }), }); diff --git a/lib/resources/Tokens.js b/lib/resources/Tokens.js index d840debbf9..aba36dc673 100644 --- a/lib/resources/Tokens.js +++ b/lib/resources/Tokens.js @@ -3,13 +3,12 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'tokens', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/tokens', }), retrieve: stripeMethod({ method: 'GET', - path: '/{token}', + fullPath: '/v1/tokens/{token}', }), }); diff --git a/lib/resources/Topups.js b/lib/resources/Topups.js index e894b6f6b6..98a373ce13 100644 --- a/lib/resources/Topups.js +++ b/lib/resources/Topups.js @@ -3,26 +3,25 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'topups', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/topups', }), retrieve: stripeMethod({ method: 'GET', - path: '/{topup}', + fullPath: '/v1/topups/{topup}', }), update: stripeMethod({ method: 'POST', - path: '/{topup}', + fullPath: '/v1/topups/{topup}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/topups', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{topup}/cancel', + fullPath: '/v1/topups/{topup}/cancel', }), }); diff --git a/lib/resources/Transfers.js b/lib/resources/Transfers.js index c45b376bd4..f046445237 100644 --- a/lib/resources/Transfers.js +++ b/lib/resources/Transfers.js @@ -3,39 +3,38 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'transfers', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/transfers', }), retrieve: stripeMethod({ method: 'GET', - path: '/{transfer}', + fullPath: '/v1/transfers/{transfer}', }), update: stripeMethod({ method: 'POST', - path: '/{transfer}', + fullPath: '/v1/transfers/{transfer}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/transfers', methodType: 'list', }), createReversal: stripeMethod({ method: 'POST', - path: '/{id}/reversals', + fullPath: '/v1/transfers/{id}/reversals', }), retrieveReversal: stripeMethod({ method: 'GET', - path: '/{transfer}/reversals/{id}', + fullPath: '/v1/transfers/{transfer}/reversals/{id}', }), updateReversal: stripeMethod({ method: 'POST', - path: '/{transfer}/reversals/{id}', + fullPath: '/v1/transfers/{transfer}/reversals/{id}', }), listReversals: stripeMethod({ method: 'GET', - path: '/{id}/reversals', + fullPath: '/v1/transfers/{id}/reversals', methodType: 'list', }), }); diff --git a/lib/resources/Treasury/CreditReversals.js b/lib/resources/Treasury/CreditReversals.js index 58139a528d..39f5765ddc 100644 --- a/lib/resources/Treasury/CreditReversals.js +++ b/lib/resources/Treasury/CreditReversals.js @@ -3,18 +3,17 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/credit_reversals', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/treasury/credit_reversals', }), retrieve: stripeMethod({ method: 'GET', - path: '/{creditReversal}', + fullPath: '/v1/treasury/credit_reversals/{credit_reversal}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/credit_reversals', methodType: 'list', }), }); diff --git a/lib/resources/Treasury/DebitReversals.js b/lib/resources/Treasury/DebitReversals.js index 4e1e252504..e0c91bc57e 100644 --- a/lib/resources/Treasury/DebitReversals.js +++ b/lib/resources/Treasury/DebitReversals.js @@ -3,18 +3,17 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/debit_reversals', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/treasury/debit_reversals', }), retrieve: stripeMethod({ method: 'GET', - path: '/{debitReversal}', + fullPath: '/v1/treasury/debit_reversals/{debit_reversal}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/debit_reversals', methodType: 'list', }), }); diff --git a/lib/resources/Treasury/FinancialAccounts.js b/lib/resources/Treasury/FinancialAccounts.js index d52bbea9f1..370fab541e 100644 --- a/lib/resources/Treasury/FinancialAccounts.js +++ b/lib/resources/Treasury/FinancialAccounts.js @@ -3,30 +3,29 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/financial_accounts', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/treasury/financial_accounts', }), retrieve: stripeMethod({ method: 'GET', - path: '/{financialAccount}', + fullPath: '/v1/treasury/financial_accounts/{financial_account}', }), update: stripeMethod({ method: 'POST', - path: '/{financialAccount}', + fullPath: '/v1/treasury/financial_accounts/{financial_account}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/financial_accounts', methodType: 'list', }), retrieveFeatures: stripeMethod({ method: 'GET', - path: '/{financialAccount}/features', + fullPath: '/v1/treasury/financial_accounts/{financial_account}/features', }), updateFeatures: stripeMethod({ method: 'POST', - path: '/{financialAccount}/features', + fullPath: '/v1/treasury/financial_accounts/{financial_account}/features', }), }); diff --git a/lib/resources/Treasury/InboundTransfers.js b/lib/resources/Treasury/InboundTransfers.js index ecb36ecf31..ef54bf4dca 100644 --- a/lib/resources/Treasury/InboundTransfers.js +++ b/lib/resources/Treasury/InboundTransfers.js @@ -3,22 +3,21 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/inbound_transfers', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/treasury/inbound_transfers', }), retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/treasury/inbound_transfers/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/inbound_transfers', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{inboundTransfer}/cancel', + fullPath: '/v1/treasury/inbound_transfers/{inbound_transfer}/cancel', }), }); diff --git a/lib/resources/Treasury/OutboundPayments.js b/lib/resources/Treasury/OutboundPayments.js index 9e707e38ec..2bab72b957 100644 --- a/lib/resources/Treasury/OutboundPayments.js +++ b/lib/resources/Treasury/OutboundPayments.js @@ -3,22 +3,21 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/outbound_payments', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/treasury/outbound_payments', }), retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/treasury/outbound_payments/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/outbound_payments', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{id}/cancel', + fullPath: '/v1/treasury/outbound_payments/{id}/cancel', }), }); diff --git a/lib/resources/Treasury/OutboundTransfers.js b/lib/resources/Treasury/OutboundTransfers.js index b7f024445c..749b57f884 100644 --- a/lib/resources/Treasury/OutboundTransfers.js +++ b/lib/resources/Treasury/OutboundTransfers.js @@ -3,22 +3,21 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/outbound_transfers', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/treasury/outbound_transfers', }), retrieve: stripeMethod({ method: 'GET', - path: '/{outboundTransfer}', + fullPath: '/v1/treasury/outbound_transfers/{outbound_transfer}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/outbound_transfers', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{outboundTransfer}/cancel', + fullPath: '/v1/treasury/outbound_transfers/{outbound_transfer}/cancel', }), }); diff --git a/lib/resources/Treasury/ReceivedCredits.js b/lib/resources/Treasury/ReceivedCredits.js index 23abb51d70..0c32c22d7d 100644 --- a/lib/resources/Treasury/ReceivedCredits.js +++ b/lib/resources/Treasury/ReceivedCredits.js @@ -3,14 +3,13 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/received_credits', retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/treasury/received_credits/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/received_credits', methodType: 'list', }), }); diff --git a/lib/resources/Treasury/ReceivedDebits.js b/lib/resources/Treasury/ReceivedDebits.js index 38e197bee3..e4448c1173 100644 --- a/lib/resources/Treasury/ReceivedDebits.js +++ b/lib/resources/Treasury/ReceivedDebits.js @@ -3,14 +3,13 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/received_debits', retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/treasury/received_debits/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/received_debits', methodType: 'list', }), }); diff --git a/lib/resources/Treasury/TransactionEntries.js b/lib/resources/Treasury/TransactionEntries.js index 8b64e41a80..9500b9f8fc 100644 --- a/lib/resources/Treasury/TransactionEntries.js +++ b/lib/resources/Treasury/TransactionEntries.js @@ -3,14 +3,13 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/transaction_entries', retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/treasury/transaction_entries/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/transaction_entries', methodType: 'list', }), }); diff --git a/lib/resources/Treasury/Transactions.js b/lib/resources/Treasury/Transactions.js index bcf4143114..9896e74250 100644 --- a/lib/resources/Treasury/Transactions.js +++ b/lib/resources/Treasury/Transactions.js @@ -3,14 +3,13 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/transactions', retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/treasury/transactions/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/transactions', methodType: 'list', }), }); diff --git a/lib/resources/WebhookEndpoints.js b/lib/resources/WebhookEndpoints.js index 3027842505..272a9ac078 100644 --- a/lib/resources/WebhookEndpoints.js +++ b/lib/resources/WebhookEndpoints.js @@ -3,26 +3,25 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'webhook_endpoints', create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/webhook_endpoints', }), retrieve: stripeMethod({ method: 'GET', - path: '/{webhookEndpoint}', + fullPath: '/v1/webhook_endpoints/{webhook_endpoint}', }), update: stripeMethod({ method: 'POST', - path: '/{webhookEndpoint}', + fullPath: '/v1/webhook_endpoints/{webhook_endpoint}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/webhook_endpoints', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{webhookEndpoint}', + fullPath: '/v1/webhook_endpoints/{webhook_endpoint}', }), }); diff --git a/lib/stripe.js b/lib/stripe.js index c4341c1b82..7288061bad 100644 --- a/lib/stripe.js +++ b/lib/stripe.js @@ -150,7 +150,7 @@ Stripe.createSubtleCryptoProvider = (subtleCrypto) => { }; Stripe.prototype = { // Properties are set in the constructor above - _appInfo: null, + _appInfo: undefined, on: null, off: null, once: null, @@ -162,93 +162,6 @@ Stripe.prototype = { _prevRequestMetrics: null, _emitter: null, _enableTelemetry: null, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * host: 'example.com', - * port: '8080', - * protocol: 'http', - * }); - * - */ - setHost(host, port, protocol) { - emitWarning( - '`setHost` is deprecated. Use the `host` config option instead.' - ); - this._setApiField('host', host); - if (port) { - this.setPort(port); - } - if (protocol) { - this.setProtocol(protocol); - } - }, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * protocol: 'http', - * }); - * - */ - setProtocol(protocol) { - emitWarning( - '`setProtocol` is deprecated. Use the `protocol` config option instead.' - ); - this._setApiField('protocol', protocol.toLowerCase()); - }, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * port: 3000, - * }); - * - */ - setPort(port) { - emitWarning( - '`setPort` is deprecated. Use the `port` config option instead.' - ); - this._setApiField('port', port); - }, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * apiVersion: API_VERSION, - * }); - * - */ - setApiVersion(version) { - emitWarning( - '`setApiVersion` is deprecated. Use the `apiVersion` config or request option instead.' - ); - if (version) { - this._setApiField('version', version); - } - }, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY); - * - * Or, for Stripe Connect, use `stripeAccount` instead: - * - * const stripe = new Stripe(API_KEY, { - * stripeAccount: 'acct_...', - * }); - * - * Or, to use a different apiKey on a given request: - * - * stripe.customers.create(params, {apiKey: 'sk_test_...'}); - */ - setApiKey(key) { - emitWarning( - '`setApiKey` is deprecated. Use the `apiKey` request option instead.' - ); - this._setApiKey(key); - }, /** * @private */ @@ -257,37 +170,6 @@ Stripe.prototype = { this._setApiField('auth', `Bearer ${key}`); } }, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * timeout: TIMEOUT_MS, - * }); - */ - setTimeout(timeout) { - emitWarning( - '`setTimeout` is deprecated. Use the `timeout` config or request option instead.' - ); - this._setApiField('timeout', timeout == null ? DEFAULT_TIMEOUT : timeout); - }, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * appInfo: { - * name: 'MyPlugin', - * version: '1.4.2', - * url: 'https://myplugin.com', - * partner_id: '1234', - * }, - * }); - */ - setAppInfo(info) { - emitWarning( - '`setAppInfo` is deprecated. Use the `appInfo` config option instead.' - ); - this._setAppInfo(info); - }, /** * @private * This may be removed in the future. @@ -312,21 +194,6 @@ Stripe.prototype = { undefined ); }, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const ProxyAgent = require('https-proxy-agent'); - * const stripe = new Stripe(API_KEY, { - * httpAgent: new ProxyAgent(process.env.http_proxy), - * }); - * - */ - setHttpAgent(agent) { - emitWarning( - '`setHttpAgent` is deprecated. Use the `httpAgent` config option instead.' - ); - this._setApiField('agent', agent); - }, /** * @private * This may be removed in the future. @@ -379,17 +246,6 @@ Stripe.prototype = { getMaxNetworkRetries() { return this.getApiField('maxNetworkRetries'); }, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * maxNetworkRetries: 2, - * }); - * - */ - setMaxNetworkRetries(maxNetworkRetries) { - this._setApiNumberField('maxNetworkRetries', maxNetworkRetries); - }, /** * @private * This may be removed in the future. @@ -478,20 +334,6 @@ Stripe.prototype = { } return formatted; }, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * telemetry: false, - * }); - * - */ - setTelemetryEnabled(enableTelemetry) { - emitWarning( - '`setTelemetryEnabled` is deprecated. Use the `telemetry` config option instead.' - ); - this._enableTelemetry = enableTelemetry; - }, getTelemetryEnabled() { return this._enableTelemetry; }, diff --git a/lib/utils.js b/lib/utils.js index 5031266832..d803d84932 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -23,25 +23,12 @@ const OPTIONS_KEYS = [ 'timeout', 'host', ]; -const DEPRECATED_OPTIONS = { - api_key: 'apiKey', - idempotency_key: 'idempotencyKey', - stripe_account: 'stripeAccount', - stripe_version: 'apiVersion', - stripeVersion: 'apiVersion', -}; -const DEPRECATED_OPTIONS_KEYS = Object.keys(DEPRECATED_OPTIONS); const utils = { isOptionsHash(o) { return ( o && typeof o === 'object' && - (OPTIONS_KEYS.some((prop) => - Object.prototype.hasOwnProperty.call(o, prop) - ) || - DEPRECATED_OPTIONS_KEYS.some((prop) => - Object.prototype.hasOwnProperty.call(o, prop) - )) + OPTIONS_KEYS.some((prop) => Object.prototype.hasOwnProperty.call(o, prop)) ); }, /** @@ -143,27 +130,9 @@ const utils = { (key) => !OPTIONS_KEYS.includes(key) ); if (extraKeys.length) { - const nonDeprecated = extraKeys.filter((key) => { - if (!DEPRECATED_OPTIONS[key]) { - return true; - } - const newParam = DEPRECATED_OPTIONS[key]; - if (params[newParam]) { - throw Error( - `Both '${newParam}' and '${key}' were provided; please remove '${key}', which is deprecated.` - ); - } - /** - * TODO turn this into a hard error in a future major version (once we have fixed our docs). - */ - emitWarning(`'${key}' is deprecated; use '${newParam}' instead.`); - params[newParam] = params[key]; - }); - if (nonDeprecated.length) { - emitWarning( - `Invalid options found (${extraKeys.join(', ')}); ignoring.` - ); - } + emitWarning( + `Invalid options found (${extraKeys.join(', ')}); ignoring.` + ); } if (params.apiKey) { opts.auth = params.apiKey; diff --git a/package.json b/package.json index ec9d30a6a0..e7c6cb83c5 100644 --- a/package.json +++ b/package.json @@ -22,10 +22,10 @@ }, "bugs": "https://github.com/stripe/stripe-node/issues", "engines": { - "node": "^8.1 || >=10.*" + "node": ">=12.*" }, "main": "lib/stripe.js", - "types": "types/2022-08-01/index.d.ts", + "types": "types/2022-11-15/index.d.ts", "devDependencies": { "@typescript-eslint/eslint-plugin": "^4.33.0", "@typescript-eslint/parser": "^4.33.0", diff --git a/src/Error.ts b/src/Error.ts index b5489fe001..98c27ec02e 100644 --- a/src/Error.ts +++ b/src/Error.ts @@ -127,7 +127,16 @@ class StripeConnectionError extends StripeError {} * SignatureVerificationError is raised when the signature verification for a * webhook fails */ -class StripeSignatureVerificationError extends StripeError {} +class StripeSignatureVerificationError extends StripeError { + header: string; + payload: string; + + constructor(header: string, payload: string, raw: StripeRawError = {}) { + super(raw); + this.header = header; + this.payload = payload; + } +} /** * IdempotencyError is raised in cases where an idempotency key was used diff --git a/src/StripeMethod.basic.js b/src/StripeMethod.basic.js deleted file mode 100644 index b9be5302e4..0000000000 --- a/src/StripeMethod.basic.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -const stripeMethod = require('./StripeMethod'); - -// DEPRECATED: These were kept for backwards compatibility in case users were -// using this, but basic methods are now explicitly defined on a resource. -module.exports = { - create: stripeMethod({ - method: 'POST', - }), - - list: stripeMethod({ - method: 'GET', - methodType: 'list', - }), - - retrieve: stripeMethod({ - method: 'GET', - path: '/{id}', - }), - - update: stripeMethod({ - method: 'POST', - path: '{id}', - }), - - // Avoid 'delete' keyword in JS - del: stripeMethod({ - method: 'DELETE', - path: '{id}', - }), -}; diff --git a/src/StripeResource.ts b/src/StripeResource.ts index b273a9ae77..b99cbfd0a8 100644 --- a/src/StripeResource.ts +++ b/src/StripeResource.ts @@ -15,9 +15,8 @@ const {HttpClient} = require('./net/HttpClient'); // Provide extension mechanism for Stripe Resource Sub-Classes StripeResource.extend = utils.protoExtend; -// Expose method-creator & prepared (basic) methods +// Expose method-creator StripeResource.method = require('./StripeMethod'); -StripeResource.BASIC_METHODS = require('./StripeMethod.basic'); StripeResource.MAX_BUFFERED_REQUEST_METRICS = 100; const MAX_RETRY_AFTER_WAIT = 60; @@ -45,14 +44,7 @@ function StripeResource( this.resourcePath = this.path; // @ts-ignore changing type of path this.path = utils.makeURLInterpolator(this.path); - // DEPRECATED: This was kept for backwards compatibility in case users were - // using this, but basic methods are now explicitly defined on a resource. - if (this.includeBasic) { - this.includeBasic.forEach(function(methodName) { - // @ts-ignore - this[methodName] = StripeResource.BASIC_METHODS[methodName]; - }, this); - } + this.initialize(...arguments); } @@ -119,9 +111,6 @@ StripeResource.prototype = { return parts.join('/').replace(/\/{2,}/g, '/'); }, - // DEPRECATED: Here for backcompat in case users relied on this. - wrapTimeout: utils.callbackifyPromiseWithTimeout, - _addHeadersDirectlyToObject(obj: any, headers: RequestHeaders): void { // For convenience, make some headers easily accessible on // lastResponse. diff --git a/src/Types.d.ts b/src/Types.d.ts index b1cc7e9e59..037ad8d207 100644 --- a/src/Types.d.ts +++ b/src/Types.d.ts @@ -112,8 +112,6 @@ type StripeObject = { callback: (userAgent: string) => void ) => void; getUname: (callback: (uname: string) => void) => void; - setProtocol: (protocol: string) => void; - setPort: (port: number) => void; getClientUserAgent: (callback: (clientUserAgent: string) => void) => void; getTelemetryEnabled: () => boolean; getAppInfoAsString: () => string; diff --git a/src/Webhooks.ts b/src/Webhooks.ts index 955da33bb6..bbbccbe656 100644 --- a/src/Webhooks.ts +++ b/src/Webhooks.ts @@ -239,24 +239,14 @@ function parseEventDetails( const details = parseHeader(decodedHeader, expectedScheme); if (!details || details.timestamp === -1) { - throw new StripeSignatureVerificationError({ + throw new StripeSignatureVerificationError(decodedHeader, decodedPayload, { message: 'Unable to extract timestamp and signatures from header', - // @ts-expect-error Type '{ decodedHeader: any; decodedPayload: any; }' is not assignable to type 'string'. - detail: { - decodedHeader, - decodedPayload, - }, }); } if (!details.signatures.length) { - throw new StripeSignatureVerificationError({ + throw new StripeSignatureVerificationError(decodedHeader, decodedPayload, { message: 'No signatures found with expected scheme', - // @ts-expect-error Type '{ decodedHeader: any; decodedPayload: any; }' is not assignable to type 'string'. - detail: { - decodedHeader, - decodedPayload, - }, }); } @@ -280,29 +270,21 @@ function validateComputedSignature( ).length; if (!signatureFound) { - throw new StripeSignatureVerificationError({ + // @ts-ignore + throw new StripeSignatureVerificationError(header, payload, { message: 'No signatures found matching the expected signature for payload.' + ' Are you passing the raw request body you received from Stripe?' + ' https://github.com/stripe/stripe-node#webhook-signing', - // @ts-expect-error Type '{ header: any; payload: any; }' is not assignable to type 'string'. - detail: { - header, - payload, - }, }); } const timestampAge = Math.floor(Date.now() / 1000) - details.timestamp; if (tolerance > 0 && timestampAge > tolerance) { - throw new StripeSignatureVerificationError({ + // @ts-ignore + throw new StripeSignatureVerificationError(header, payload, { message: 'Timestamp outside the tolerance zone', - // @ts-expect-error Type '{ header: any; payload: any; }' is not assignable to type 'string'. - detail: { - header, - payload, - }, }); } diff --git a/src/apiVersion.js b/src/apiVersion.js index 704a3619eb..f164407310 100644 --- a/src/apiVersion.js +++ b/src/apiVersion.js @@ -1,3 +1,3 @@ // File generated from our OpenAPI spec -module.exports = {ApiVersion: '2022-08-01'}; +module.exports = {ApiVersion: '2022-11-15'}; diff --git a/src/resources.js b/src/resources.js index 825c8f1d9d..5e36ae42d3 100644 --- a/src/resources.js +++ b/src/resources.js @@ -28,7 +28,6 @@ module.exports = { InvoiceItems: require('./resources/InvoiceItems'), Mandates: require('./resources/Mandates'), OAuth: require('./resources/OAuth'), - Orders: require('./resources/Orders'), PaymentIntents: require('./resources/PaymentIntents'), PaymentLinks: require('./resources/PaymentLinks'), PaymentMethods: require('./resources/PaymentMethods'), @@ -43,7 +42,6 @@ module.exports = { SetupAttempts: require('./resources/SetupAttempts'), SetupIntents: require('./resources/SetupIntents'), ShippingRates: require('./resources/ShippingRates'), - Skus: require('./resources/SKUs'), Sources: require('./resources/Sources'), Subscriptions: require('./resources/Subscriptions'), SubscriptionItems: require('./resources/SubscriptionItems'), diff --git a/src/resources/AccountLinks.js b/src/resources/AccountLinks.js index 41e02b1ec5..713304f703 100644 --- a/src/resources/AccountLinks.js +++ b/src/resources/AccountLinks.js @@ -6,10 +6,8 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'account_links', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/account_links', }), }); diff --git a/src/resources/Accounts.js b/src/resources/Accounts.js index 351c055f23..9956629e30 100644 --- a/src/resources/Accounts.js +++ b/src/resources/Accounts.js @@ -7,11 +7,9 @@ const stripeMethod = StripeResource.method; // Since path can either be `account` or `accounts`, support both through stripeMethod path; module.exports = StripeResource.extend({ - path: '', - create: stripeMethod({ method: 'POST', - path: 'accounts', + fullPath: '/v1/accounts', }), retrieve(id) { @@ -20,7 +18,7 @@ module.exports = StripeResource.extend({ if (typeof id === 'string') { return stripeMethod({ method: 'GET', - path: 'accounts/{id}', + fullPath: '/v1/accounts/{id}', }).apply(this, arguments); } else { if (id === null || id === undefined) { @@ -29,102 +27,102 @@ module.exports = StripeResource.extend({ } return stripeMethod({ method: 'GET', - path: 'account', + fullPath: '/v1/account', }).apply(this, arguments); } }, update: stripeMethod({ method: 'POST', - path: 'accounts/{account}', + fullPath: '/v1/accounts/{account}', }), list: stripeMethod({ method: 'GET', - path: 'accounts', + fullPath: '/v1/accounts', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: 'accounts/{account}', + fullPath: '/v1/accounts/{account}', }), reject: stripeMethod({ method: 'POST', - path: 'accounts/{account}/reject', + fullPath: '/v1/accounts/{account}/reject', }), retrieveCapability: stripeMethod({ method: 'GET', - path: 'accounts/{account}/capabilities/{capability}', + fullPath: '/v1/accounts/{account}/capabilities/{capability}', }), updateCapability: stripeMethod({ method: 'POST', - path: 'accounts/{account}/capabilities/{capability}', + fullPath: '/v1/accounts/{account}/capabilities/{capability}', }), listCapabilities: stripeMethod({ method: 'GET', - path: 'accounts/{account}/capabilities', + fullPath: '/v1/accounts/{account}/capabilities', methodType: 'list', }), createExternalAccount: stripeMethod({ method: 'POST', - path: 'accounts/{account}/external_accounts', + fullPath: '/v1/accounts/{account}/external_accounts', }), retrieveExternalAccount: stripeMethod({ method: 'GET', - path: 'accounts/{account}/external_accounts/{id}', + fullPath: '/v1/accounts/{account}/external_accounts/{id}', }), updateExternalAccount: stripeMethod({ method: 'POST', - path: 'accounts/{account}/external_accounts/{id}', + fullPath: '/v1/accounts/{account}/external_accounts/{id}', }), listExternalAccounts: stripeMethod({ method: 'GET', - path: 'accounts/{account}/external_accounts', + fullPath: '/v1/accounts/{account}/external_accounts', methodType: 'list', }), deleteExternalAccount: stripeMethod({ method: 'DELETE', - path: 'accounts/{account}/external_accounts/{id}', + fullPath: '/v1/accounts/{account}/external_accounts/{id}', }), createLoginLink: stripeMethod({ method: 'POST', - path: 'accounts/{account}/login_links', + fullPath: '/v1/accounts/{account}/login_links', }), createPerson: stripeMethod({ method: 'POST', - path: 'accounts/{account}/persons', + fullPath: '/v1/accounts/{account}/persons', }), retrievePerson: stripeMethod({ method: 'GET', - path: 'accounts/{account}/persons/{person}', + fullPath: '/v1/accounts/{account}/persons/{person}', }), updatePerson: stripeMethod({ method: 'POST', - path: 'accounts/{account}/persons/{person}', + fullPath: '/v1/accounts/{account}/persons/{person}', }), listPersons: stripeMethod({ method: 'GET', - path: 'accounts/{account}/persons', + fullPath: '/v1/accounts/{account}/persons', methodType: 'list', }), deletePerson: stripeMethod({ method: 'DELETE', - path: 'accounts/{account}/persons/{person}', + fullPath: '/v1/accounts/{account}/persons/{person}', }), }); diff --git a/src/resources/ApplePayDomains.js b/src/resources/ApplePayDomains.js index 76a8c59585..363e375f2e 100644 --- a/src/resources/ApplePayDomains.js +++ b/src/resources/ApplePayDomains.js @@ -6,26 +6,24 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'apple_pay/domains', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/apple_pay/domains', }), retrieve: stripeMethod({ method: 'GET', - path: '/{domain}', + fullPath: '/v1/apple_pay/domains/{domain}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/apple_pay/domains', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{domain}', + fullPath: '/v1/apple_pay/domains/{domain}', }), }); diff --git a/src/resources/ApplicationFees.js b/src/resources/ApplicationFees.js index ebd6372aca..21affd640b 100644 --- a/src/resources/ApplicationFees.js +++ b/src/resources/ApplicationFees.js @@ -6,37 +6,35 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'application_fees', - retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/application_fees/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/application_fees', methodType: 'list', }), createRefund: stripeMethod({ method: 'POST', - path: '/{id}/refunds', + fullPath: '/v1/application_fees/{id}/refunds', }), retrieveRefund: stripeMethod({ method: 'GET', - path: '/{fee}/refunds/{id}', + fullPath: '/v1/application_fees/{fee}/refunds/{id}', }), updateRefund: stripeMethod({ method: 'POST', - path: '/{fee}/refunds/{id}', + fullPath: '/v1/application_fees/{fee}/refunds/{id}', }), listRefunds: stripeMethod({ method: 'GET', - path: '/{id}/refunds', + fullPath: '/v1/application_fees/{id}/refunds', methodType: 'list', }), }); diff --git a/src/resources/Apps/Secrets.js b/src/resources/Apps/Secrets.js index 238037508f..7003cb2a43 100644 --- a/src/resources/Apps/Secrets.js +++ b/src/resources/Apps/Secrets.js @@ -6,26 +6,24 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'apps/secrets', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/apps/secrets', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/apps/secrets', methodType: 'list', }), deleteWhere: stripeMethod({ method: 'POST', - path: '/delete', + fullPath: '/v1/apps/secrets/delete', }), find: stripeMethod({ method: 'GET', - path: '/find', + fullPath: '/v1/apps/secrets/find', }), }); diff --git a/src/resources/Balance.js b/src/resources/Balance.js index ac7a9ae459..8cb2c44bd7 100644 --- a/src/resources/Balance.js +++ b/src/resources/Balance.js @@ -6,10 +6,8 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'balance', - retrieve: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/balance', }), }); diff --git a/src/resources/BalanceTransactions.js b/src/resources/BalanceTransactions.js index adbe3d41f9..4e0c9d0e88 100644 --- a/src/resources/BalanceTransactions.js +++ b/src/resources/BalanceTransactions.js @@ -6,16 +6,14 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'balance_transactions', - retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/balance_transactions/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/balance_transactions', methodType: 'list', }), }); diff --git a/src/resources/BillingPortal/Configurations.js b/src/resources/BillingPortal/Configurations.js index ff3200160a..cda7d157ff 100644 --- a/src/resources/BillingPortal/Configurations.js +++ b/src/resources/BillingPortal/Configurations.js @@ -6,26 +6,24 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'billing_portal/configurations', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/billing_portal/configurations', }), retrieve: stripeMethod({ method: 'GET', - path: '/{configuration}', + fullPath: '/v1/billing_portal/configurations/{configuration}', }), update: stripeMethod({ method: 'POST', - path: '/{configuration}', + fullPath: '/v1/billing_portal/configurations/{configuration}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/billing_portal/configurations', methodType: 'list', }), }); diff --git a/src/resources/BillingPortal/Sessions.js b/src/resources/BillingPortal/Sessions.js index 04f0ef6805..b2dbd1c963 100644 --- a/src/resources/BillingPortal/Sessions.js +++ b/src/resources/BillingPortal/Sessions.js @@ -6,10 +6,8 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'billing_portal/sessions', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/billing_portal/sessions', }), }); diff --git a/src/resources/Charges.js b/src/resources/Charges.js index f4546063f7..87b18dc1ac 100644 --- a/src/resources/Charges.js +++ b/src/resources/Charges.js @@ -6,37 +6,35 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'charges', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/charges', }), retrieve: stripeMethod({ method: 'GET', - path: '/{charge}', + fullPath: '/v1/charges/{charge}', }), update: stripeMethod({ method: 'POST', - path: '/{charge}', + fullPath: '/v1/charges/{charge}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/charges', methodType: 'list', }), capture: stripeMethod({ method: 'POST', - path: '/{charge}/capture', + fullPath: '/v1/charges/{charge}/capture', }), search: stripeMethod({ method: 'GET', - path: '/search', + fullPath: '/v1/charges/search', methodType: 'search', }), }); diff --git a/src/resources/Checkout/Sessions.js b/src/resources/Checkout/Sessions.js index 1cef4d65d7..cf9bfb2489 100644 --- a/src/resources/Checkout/Sessions.js +++ b/src/resources/Checkout/Sessions.js @@ -6,32 +6,30 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'checkout/sessions', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/checkout/sessions', }), retrieve: stripeMethod({ method: 'GET', - path: '/{session}', + fullPath: '/v1/checkout/sessions/{session}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/checkout/sessions', methodType: 'list', }), expire: stripeMethod({ method: 'POST', - path: '/{session}/expire', + fullPath: '/v1/checkout/sessions/{session}/expire', }), listLineItems: stripeMethod({ method: 'GET', - path: '/{session}/line_items', + fullPath: '/v1/checkout/sessions/{session}/line_items', methodType: 'list', }), }); diff --git a/src/resources/CountrySpecs.js b/src/resources/CountrySpecs.js index 789f99054a..f21b9ab490 100644 --- a/src/resources/CountrySpecs.js +++ b/src/resources/CountrySpecs.js @@ -6,16 +6,14 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'country_specs', - retrieve: stripeMethod({ method: 'GET', - path: '/{country}', + fullPath: '/v1/country_specs/{country}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/country_specs', methodType: 'list', }), }); diff --git a/src/resources/Coupons.js b/src/resources/Coupons.js index 11bed027fe..3b62c60ece 100644 --- a/src/resources/Coupons.js +++ b/src/resources/Coupons.js @@ -6,31 +6,29 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'coupons', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/coupons', }), retrieve: stripeMethod({ method: 'GET', - path: '/{coupon}', + fullPath: '/v1/coupons/{coupon}', }), update: stripeMethod({ method: 'POST', - path: '/{coupon}', + fullPath: '/v1/coupons/{coupon}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/coupons', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{coupon}', + fullPath: '/v1/coupons/{coupon}', }), }); diff --git a/src/resources/CreditNotes.js b/src/resources/CreditNotes.js index e435282d00..eda7d9e29d 100644 --- a/src/resources/CreditNotes.js +++ b/src/resources/CreditNotes.js @@ -6,48 +6,46 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'credit_notes', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/credit_notes', }), retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/credit_notes/{id}', }), update: stripeMethod({ method: 'POST', - path: '/{id}', + fullPath: '/v1/credit_notes/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/credit_notes', methodType: 'list', }), listPreviewLineItems: stripeMethod({ method: 'GET', - path: '/preview/lines', + fullPath: '/v1/credit_notes/preview/lines', methodType: 'list', }), preview: stripeMethod({ method: 'GET', - path: '/preview', + fullPath: '/v1/credit_notes/preview', }), voidCreditNote: stripeMethod({ method: 'POST', - path: '/{id}/void', + fullPath: '/v1/credit_notes/{id}/void', }), listLineItems: stripeMethod({ method: 'GET', - path: '/{creditNote}/lines', + fullPath: '/v1/credit_notes/{credit_note}/lines', methodType: 'list', }), }); diff --git a/src/resources/Customers.js b/src/resources/Customers.js index e3b8e8fab8..234e5573ba 100644 --- a/src/resources/Customers.js +++ b/src/resources/Customers.js @@ -6,152 +6,151 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'customers', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/customers', }), retrieve: stripeMethod({ method: 'GET', - path: '/{customer}', + fullPath: '/v1/customers/{customer}', }), update: stripeMethod({ method: 'POST', - path: '/{customer}', + fullPath: '/v1/customers/{customer}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/customers', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{customer}', + fullPath: '/v1/customers/{customer}', }), createFundingInstructions: stripeMethod({ method: 'POST', - path: '/{customer}/funding_instructions', + fullPath: '/v1/customers/{customer}/funding_instructions', }), deleteDiscount: stripeMethod({ method: 'DELETE', - path: '/{customer}/discount', + fullPath: '/v1/customers/{customer}/discount', }), listPaymentMethods: stripeMethod({ method: 'GET', - path: '/{customer}/payment_methods', + fullPath: '/v1/customers/{customer}/payment_methods', methodType: 'list', }), retrievePaymentMethod: stripeMethod({ method: 'GET', - path: '/{customer}/payment_methods/{paymentMethod}', + fullPath: '/v1/customers/{customer}/payment_methods/{payment_method}', }), search: stripeMethod({ method: 'GET', - path: '/search', + fullPath: '/v1/customers/search', methodType: 'search', }), retrieveCashBalance: stripeMethod({ method: 'GET', - path: '/{customer}/cash_balance', + fullPath: '/v1/customers/{customer}/cash_balance', }), updateCashBalance: stripeMethod({ method: 'POST', - path: '/{customer}/cash_balance', + fullPath: '/v1/customers/{customer}/cash_balance', }), createBalanceTransaction: stripeMethod({ method: 'POST', - path: '/{customer}/balance_transactions', + fullPath: '/v1/customers/{customer}/balance_transactions', }), retrieveBalanceTransaction: stripeMethod({ method: 'GET', - path: '/{customer}/balance_transactions/{transaction}', + fullPath: '/v1/customers/{customer}/balance_transactions/{transaction}', }), updateBalanceTransaction: stripeMethod({ method: 'POST', - path: '/{customer}/balance_transactions/{transaction}', + fullPath: '/v1/customers/{customer}/balance_transactions/{transaction}', }), listBalanceTransactions: stripeMethod({ method: 'GET', - path: '/{customer}/balance_transactions', + fullPath: '/v1/customers/{customer}/balance_transactions', methodType: 'list', }), retrieveCashBalanceTransaction: stripeMethod({ method: 'GET', - path: '/{customer}/cash_balance_transactions/{transaction}', + fullPath: + '/v1/customers/{customer}/cash_balance_transactions/{transaction}', }), listCashBalanceTransactions: stripeMethod({ method: 'GET', - path: '/{customer}/cash_balance_transactions', + fullPath: '/v1/customers/{customer}/cash_balance_transactions', methodType: 'list', }), createSource: stripeMethod({ method: 'POST', - path: '/{customer}/sources', + fullPath: '/v1/customers/{customer}/sources', }), retrieveSource: stripeMethod({ method: 'GET', - path: '/{customer}/sources/{id}', + fullPath: '/v1/customers/{customer}/sources/{id}', }), updateSource: stripeMethod({ method: 'POST', - path: '/{customer}/sources/{id}', + fullPath: '/v1/customers/{customer}/sources/{id}', }), listSources: stripeMethod({ method: 'GET', - path: '/{customer}/sources', + fullPath: '/v1/customers/{customer}/sources', methodType: 'list', }), deleteSource: stripeMethod({ method: 'DELETE', - path: '/{customer}/sources/{id}', + fullPath: '/v1/customers/{customer}/sources/{id}', }), verifySource: stripeMethod({ method: 'POST', - path: '/{customer}/sources/{id}/verify', + fullPath: '/v1/customers/{customer}/sources/{id}/verify', }), createTaxId: stripeMethod({ method: 'POST', - path: '/{customer}/tax_ids', + fullPath: '/v1/customers/{customer}/tax_ids', }), retrieveTaxId: stripeMethod({ method: 'GET', - path: '/{customer}/tax_ids/{id}', + fullPath: '/v1/customers/{customer}/tax_ids/{id}', }), listTaxIds: stripeMethod({ method: 'GET', - path: '/{customer}/tax_ids', + fullPath: '/v1/customers/{customer}/tax_ids', methodType: 'list', }), deleteTaxId: stripeMethod({ method: 'DELETE', - path: '/{customer}/tax_ids/{id}', + fullPath: '/v1/customers/{customer}/tax_ids/{id}', }), }); diff --git a/src/resources/Disputes.js b/src/resources/Disputes.js index 1318758949..d40c7a8fd8 100644 --- a/src/resources/Disputes.js +++ b/src/resources/Disputes.js @@ -6,26 +6,24 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'disputes', - retrieve: stripeMethod({ method: 'GET', - path: '/{dispute}', + fullPath: '/v1/disputes/{dispute}', }), update: stripeMethod({ method: 'POST', - path: '/{dispute}', + fullPath: '/v1/disputes/{dispute}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/disputes', methodType: 'list', }), close: stripeMethod({ method: 'POST', - path: '/{dispute}/close', + fullPath: '/v1/disputes/{dispute}/close', }), }); diff --git a/src/resources/EphemeralKeys.js b/src/resources/EphemeralKeys.js index 2f9b02694c..45c632b744 100644 --- a/src/resources/EphemeralKeys.js +++ b/src/resources/EphemeralKeys.js @@ -6,11 +6,9 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'ephemeral_keys', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/ephemeral_keys', validator: (data, options) => { if (!options.headers || !options.headers['Stripe-Version']) { throw new Error( @@ -22,6 +20,6 @@ module.exports = StripeResource.extend({ del: stripeMethod({ method: 'DELETE', - path: '/{key}', + fullPath: '/v1/ephemeral_keys/{key}', }), }); diff --git a/src/resources/Events.js b/src/resources/Events.js index 79ee31d45a..cb0b5ee931 100644 --- a/src/resources/Events.js +++ b/src/resources/Events.js @@ -6,16 +6,14 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'events', - retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/events/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/events', methodType: 'list', }), }); diff --git a/src/resources/ExchangeRates.js b/src/resources/ExchangeRates.js index 021e972336..bd6aec6ba9 100644 --- a/src/resources/ExchangeRates.js +++ b/src/resources/ExchangeRates.js @@ -6,16 +6,14 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'exchange_rates', - retrieve: stripeMethod({ method: 'GET', - path: '/{rateId}', + fullPath: '/v1/exchange_rates/{rate_id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/exchange_rates', methodType: 'list', }), }); diff --git a/src/resources/FileLinks.js b/src/resources/FileLinks.js index 7c7a6e117d..0cc3afe7c7 100644 --- a/src/resources/FileLinks.js +++ b/src/resources/FileLinks.js @@ -6,26 +6,24 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'file_links', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/file_links', }), retrieve: stripeMethod({ method: 'GET', - path: '/{link}', + fullPath: '/v1/file_links/{link}', }), update: stripeMethod({ method: 'POST', - path: '/{link}', + fullPath: '/v1/file_links/{link}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/file_links', methodType: 'list', }), }); diff --git a/src/resources/Files.js b/src/resources/Files.js index 5dee82d1d2..fbe9ce87b5 100644 --- a/src/resources/Files.js +++ b/src/resources/Files.js @@ -7,10 +7,9 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'files', - create: stripeMethod({ method: 'POST', + fullPath: '/v1/files', headers: { 'Content-Type': 'multipart/form-data', }, @@ -19,12 +18,12 @@ module.exports = StripeResource.extend({ retrieve: stripeMethod({ method: 'GET', - path: '/{file}', + fullPath: '/v1/files/{file}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/files', methodType: 'list', }), diff --git a/src/resources/FinancialConnections/Accounts.js b/src/resources/FinancialConnections/Accounts.js index 674f42ec48..e795b2283a 100644 --- a/src/resources/FinancialConnections/Accounts.js +++ b/src/resources/FinancialConnections/Accounts.js @@ -6,32 +6,30 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'financial_connections/accounts', - retrieve: stripeMethod({ method: 'GET', - path: '/{account}', + fullPath: '/v1/financial_connections/accounts/{account}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/financial_connections/accounts', methodType: 'list', }), disconnect: stripeMethod({ method: 'POST', - path: '/{account}/disconnect', + fullPath: '/v1/financial_connections/accounts/{account}/disconnect', }), listOwners: stripeMethod({ method: 'GET', - path: '/{account}/owners', + fullPath: '/v1/financial_connections/accounts/{account}/owners', methodType: 'list', }), refresh: stripeMethod({ method: 'POST', - path: '/{account}/refresh', + fullPath: '/v1/financial_connections/accounts/{account}/refresh', }), }); diff --git a/src/resources/FinancialConnections/Sessions.js b/src/resources/FinancialConnections/Sessions.js index 0e968a437b..077390c48d 100644 --- a/src/resources/FinancialConnections/Sessions.js +++ b/src/resources/FinancialConnections/Sessions.js @@ -6,15 +6,13 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'financial_connections/sessions', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/financial_connections/sessions', }), retrieve: stripeMethod({ method: 'GET', - path: '/{session}', + fullPath: '/v1/financial_connections/sessions/{session}', }), }); diff --git a/src/resources/Identity/VerificationReports.js b/src/resources/Identity/VerificationReports.js index 6d78faa7a0..6c8734c889 100644 --- a/src/resources/Identity/VerificationReports.js +++ b/src/resources/Identity/VerificationReports.js @@ -6,16 +6,14 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'identity/verification_reports', - retrieve: stripeMethod({ method: 'GET', - path: '/{report}', + fullPath: '/v1/identity/verification_reports/{report}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/identity/verification_reports', methodType: 'list', }), }); diff --git a/src/resources/Identity/VerificationSessions.js b/src/resources/Identity/VerificationSessions.js index 02345e1210..47f442ba02 100644 --- a/src/resources/Identity/VerificationSessions.js +++ b/src/resources/Identity/VerificationSessions.js @@ -6,36 +6,34 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'identity/verification_sessions', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/identity/verification_sessions', }), retrieve: stripeMethod({ method: 'GET', - path: '/{session}', + fullPath: '/v1/identity/verification_sessions/{session}', }), update: stripeMethod({ method: 'POST', - path: '/{session}', + fullPath: '/v1/identity/verification_sessions/{session}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/identity/verification_sessions', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{session}/cancel', + fullPath: '/v1/identity/verification_sessions/{session}/cancel', }), redact: stripeMethod({ method: 'POST', - path: '/{session}/redact', + fullPath: '/v1/identity/verification_sessions/{session}/redact', }), }); diff --git a/src/resources/InvoiceItems.js b/src/resources/InvoiceItems.js index c7cb5586be..715c07e8a3 100644 --- a/src/resources/InvoiceItems.js +++ b/src/resources/InvoiceItems.js @@ -6,31 +6,29 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'invoiceitems', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/invoiceitems', }), retrieve: stripeMethod({ method: 'GET', - path: '/{invoiceitem}', + fullPath: '/v1/invoiceitems/{invoiceitem}', }), update: stripeMethod({ method: 'POST', - path: '/{invoiceitem}', + fullPath: '/v1/invoiceitems/{invoiceitem}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/invoiceitems', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{invoiceitem}', + fullPath: '/v1/invoiceitems/{invoiceitem}', }), }); diff --git a/src/resources/Invoices.js b/src/resources/Invoices.js index 21543c1f3a..4e1866f0ac 100644 --- a/src/resources/Invoices.js +++ b/src/resources/Invoices.js @@ -6,79 +6,77 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'invoices', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/invoices', }), retrieve: stripeMethod({ method: 'GET', - path: '/{invoice}', + fullPath: '/v1/invoices/{invoice}', }), update: stripeMethod({ method: 'POST', - path: '/{invoice}', + fullPath: '/v1/invoices/{invoice}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/invoices', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{invoice}', + fullPath: '/v1/invoices/{invoice}', }), finalizeInvoice: stripeMethod({ method: 'POST', - path: '/{invoice}/finalize', + fullPath: '/v1/invoices/{invoice}/finalize', }), listUpcomingLines: stripeMethod({ method: 'GET', - path: '/upcoming/lines', + fullPath: '/v1/invoices/upcoming/lines', methodType: 'list', }), markUncollectible: stripeMethod({ method: 'POST', - path: '/{invoice}/mark_uncollectible', + fullPath: '/v1/invoices/{invoice}/mark_uncollectible', }), pay: stripeMethod({ method: 'POST', - path: '/{invoice}/pay', + fullPath: '/v1/invoices/{invoice}/pay', }), retrieveUpcoming: stripeMethod({ method: 'GET', - path: '/upcoming', + fullPath: '/v1/invoices/upcoming', }), search: stripeMethod({ method: 'GET', - path: '/search', + fullPath: '/v1/invoices/search', methodType: 'search', }), sendInvoice: stripeMethod({ method: 'POST', - path: '/{invoice}/send', + fullPath: '/v1/invoices/{invoice}/send', }), voidInvoice: stripeMethod({ method: 'POST', - path: '/{invoice}/void', + fullPath: '/v1/invoices/{invoice}/void', }), listLineItems: stripeMethod({ method: 'GET', - path: '/{invoice}/lines', + fullPath: '/v1/invoices/{invoice}/lines', methodType: 'list', }), }); diff --git a/src/resources/Issuing/Authorizations.js b/src/resources/Issuing/Authorizations.js index 5310d0ea8b..78afe9a49d 100644 --- a/src/resources/Issuing/Authorizations.js +++ b/src/resources/Issuing/Authorizations.js @@ -6,31 +6,29 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'issuing/authorizations', - retrieve: stripeMethod({ method: 'GET', - path: '/{authorization}', + fullPath: '/v1/issuing/authorizations/{authorization}', }), update: stripeMethod({ method: 'POST', - path: '/{authorization}', + fullPath: '/v1/issuing/authorizations/{authorization}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/issuing/authorizations', methodType: 'list', }), approve: stripeMethod({ method: 'POST', - path: '/{authorization}/approve', + fullPath: '/v1/issuing/authorizations/{authorization}/approve', }), decline: stripeMethod({ method: 'POST', - path: '/{authorization}/decline', + fullPath: '/v1/issuing/authorizations/{authorization}/decline', }), }); diff --git a/src/resources/Issuing/Cardholders.js b/src/resources/Issuing/Cardholders.js index 7b340e6912..bb00cde297 100644 --- a/src/resources/Issuing/Cardholders.js +++ b/src/resources/Issuing/Cardholders.js @@ -6,26 +6,24 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'issuing/cardholders', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/issuing/cardholders', }), retrieve: stripeMethod({ method: 'GET', - path: '/{cardholder}', + fullPath: '/v1/issuing/cardholders/{cardholder}', }), update: stripeMethod({ method: 'POST', - path: '/{cardholder}', + fullPath: '/v1/issuing/cardholders/{cardholder}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/issuing/cardholders', methodType: 'list', }), }); diff --git a/src/resources/Issuing/Cards.js b/src/resources/Issuing/Cards.js index efc2cbc10f..f197403f1b 100644 --- a/src/resources/Issuing/Cards.js +++ b/src/resources/Issuing/Cards.js @@ -6,26 +6,24 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'issuing/cards', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/issuing/cards', }), retrieve: stripeMethod({ method: 'GET', - path: '/{card}', + fullPath: '/v1/issuing/cards/{card}', }), update: stripeMethod({ method: 'POST', - path: '/{card}', + fullPath: '/v1/issuing/cards/{card}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/issuing/cards', methodType: 'list', }), }); diff --git a/src/resources/Issuing/Disputes.js b/src/resources/Issuing/Disputes.js index f62a2be96d..67eab915d3 100644 --- a/src/resources/Issuing/Disputes.js +++ b/src/resources/Issuing/Disputes.js @@ -6,31 +6,29 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'issuing/disputes', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/issuing/disputes', }), retrieve: stripeMethod({ method: 'GET', - path: '/{dispute}', + fullPath: '/v1/issuing/disputes/{dispute}', }), update: stripeMethod({ method: 'POST', - path: '/{dispute}', + fullPath: '/v1/issuing/disputes/{dispute}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/issuing/disputes', methodType: 'list', }), submit: stripeMethod({ method: 'POST', - path: '/{dispute}/submit', + fullPath: '/v1/issuing/disputes/{dispute}/submit', }), }); diff --git a/src/resources/Issuing/Transactions.js b/src/resources/Issuing/Transactions.js index 22b438429d..eee0eb821a 100644 --- a/src/resources/Issuing/Transactions.js +++ b/src/resources/Issuing/Transactions.js @@ -6,21 +6,19 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'issuing/transactions', - retrieve: stripeMethod({ method: 'GET', - path: '/{transaction}', + fullPath: '/v1/issuing/transactions/{transaction}', }), update: stripeMethod({ method: 'POST', - path: '/{transaction}', + fullPath: '/v1/issuing/transactions/{transaction}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/issuing/transactions', methodType: 'list', }), }); diff --git a/src/resources/Mandates.js b/src/resources/Mandates.js index 6d9ced9f82..678e732d31 100644 --- a/src/resources/Mandates.js +++ b/src/resources/Mandates.js @@ -6,10 +6,8 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'mandates', - retrieve: stripeMethod({ method: 'GET', - path: '/{mandate}', + fullPath: '/v1/mandates/{mandate}', }), }); diff --git a/src/resources/Orders.js b/src/resources/Orders.js deleted file mode 100644 index a216b32fc7..0000000000 --- a/src/resources/Orders.js +++ /dev/null @@ -1,52 +0,0 @@ -// File generated from our OpenAPI spec - -'use strict'; - -const StripeResource = require('../StripeResource'); -const stripeMethod = StripeResource.method; - -module.exports = StripeResource.extend({ - path: 'orders', - - create: stripeMethod({ - method: 'POST', - path: '', - }), - - retrieve: stripeMethod({ - method: 'GET', - path: '/{id}', - }), - - update: stripeMethod({ - method: 'POST', - path: '/{id}', - }), - - list: stripeMethod({ - method: 'GET', - path: '', - methodType: 'list', - }), - - cancel: stripeMethod({ - method: 'POST', - path: '/{id}/cancel', - }), - - listLineItems: stripeMethod({ - method: 'GET', - path: '/{id}/line_items', - methodType: 'list', - }), - - reopen: stripeMethod({ - method: 'POST', - path: '/{id}/reopen', - }), - - submit: stripeMethod({ - method: 'POST', - path: '/{id}/submit', - }), -}); diff --git a/src/resources/PaymentIntents.js b/src/resources/PaymentIntents.js index d6addba0d3..a90d20f2ec 100644 --- a/src/resources/PaymentIntents.js +++ b/src/resources/PaymentIntents.js @@ -6,62 +6,60 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'payment_intents', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/payment_intents', }), retrieve: stripeMethod({ method: 'GET', - path: '/{intent}', + fullPath: '/v1/payment_intents/{intent}', }), update: stripeMethod({ method: 'POST', - path: '/{intent}', + fullPath: '/v1/payment_intents/{intent}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/payment_intents', methodType: 'list', }), applyCustomerBalance: stripeMethod({ method: 'POST', - path: '/{intent}/apply_customer_balance', + fullPath: '/v1/payment_intents/{intent}/apply_customer_balance', }), cancel: stripeMethod({ method: 'POST', - path: '/{intent}/cancel', + fullPath: '/v1/payment_intents/{intent}/cancel', }), capture: stripeMethod({ method: 'POST', - path: '/{intent}/capture', + fullPath: '/v1/payment_intents/{intent}/capture', }), confirm: stripeMethod({ method: 'POST', - path: '/{intent}/confirm', + fullPath: '/v1/payment_intents/{intent}/confirm', }), incrementAuthorization: stripeMethod({ method: 'POST', - path: '/{intent}/increment_authorization', + fullPath: '/v1/payment_intents/{intent}/increment_authorization', }), search: stripeMethod({ method: 'GET', - path: '/search', + fullPath: '/v1/payment_intents/search', methodType: 'search', }), verifyMicrodeposits: stripeMethod({ method: 'POST', - path: '/{intent}/verify_microdeposits', + fullPath: '/v1/payment_intents/{intent}/verify_microdeposits', }), }); diff --git a/src/resources/PaymentLinks.js b/src/resources/PaymentLinks.js index a357cedd89..2eb101ca69 100644 --- a/src/resources/PaymentLinks.js +++ b/src/resources/PaymentLinks.js @@ -6,32 +6,30 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'payment_links', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/payment_links', }), retrieve: stripeMethod({ method: 'GET', - path: '/{paymentLink}', + fullPath: '/v1/payment_links/{payment_link}', }), update: stripeMethod({ method: 'POST', - path: '/{paymentLink}', + fullPath: '/v1/payment_links/{payment_link}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/payment_links', methodType: 'list', }), listLineItems: stripeMethod({ method: 'GET', - path: '/{paymentLink}/line_items', + fullPath: '/v1/payment_links/{payment_link}/line_items', methodType: 'list', }), }); diff --git a/src/resources/PaymentMethods.js b/src/resources/PaymentMethods.js index bd74b2ee5f..682d1bae3b 100644 --- a/src/resources/PaymentMethods.js +++ b/src/resources/PaymentMethods.js @@ -6,36 +6,34 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'payment_methods', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/payment_methods', }), retrieve: stripeMethod({ method: 'GET', - path: '/{paymentMethod}', + fullPath: '/v1/payment_methods/{payment_method}', }), update: stripeMethod({ method: 'POST', - path: '/{paymentMethod}', + fullPath: '/v1/payment_methods/{payment_method}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/payment_methods', methodType: 'list', }), attach: stripeMethod({ method: 'POST', - path: '/{paymentMethod}/attach', + fullPath: '/v1/payment_methods/{payment_method}/attach', }), detach: stripeMethod({ method: 'POST', - path: '/{paymentMethod}/detach', + fullPath: '/v1/payment_methods/{payment_method}/detach', }), }); diff --git a/src/resources/Payouts.js b/src/resources/Payouts.js index a3b8e0cd66..0fa971792f 100644 --- a/src/resources/Payouts.js +++ b/src/resources/Payouts.js @@ -6,36 +6,34 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'payouts', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/payouts', }), retrieve: stripeMethod({ method: 'GET', - path: '/{payout}', + fullPath: '/v1/payouts/{payout}', }), update: stripeMethod({ method: 'POST', - path: '/{payout}', + fullPath: '/v1/payouts/{payout}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/payouts', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{payout}/cancel', + fullPath: '/v1/payouts/{payout}/cancel', }), reverse: stripeMethod({ method: 'POST', - path: '/{payout}/reverse', + fullPath: '/v1/payouts/{payout}/reverse', }), }); diff --git a/src/resources/Plans.js b/src/resources/Plans.js index bd55a157da..c9032c1ab1 100644 --- a/src/resources/Plans.js +++ b/src/resources/Plans.js @@ -6,31 +6,29 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'plans', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/plans', }), retrieve: stripeMethod({ method: 'GET', - path: '/{plan}', + fullPath: '/v1/plans/{plan}', }), update: stripeMethod({ method: 'POST', - path: '/{plan}', + fullPath: '/v1/plans/{plan}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/plans', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{plan}', + fullPath: '/v1/plans/{plan}', }), }); diff --git a/src/resources/Prices.js b/src/resources/Prices.js index c509fdcbc0..e290429ecb 100644 --- a/src/resources/Prices.js +++ b/src/resources/Prices.js @@ -6,32 +6,30 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'prices', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/prices', }), retrieve: stripeMethod({ method: 'GET', - path: '/{price}', + fullPath: '/v1/prices/{price}', }), update: stripeMethod({ method: 'POST', - path: '/{price}', + fullPath: '/v1/prices/{price}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/prices', methodType: 'list', }), search: stripeMethod({ method: 'GET', - path: '/search', + fullPath: '/v1/prices/search', methodType: 'search', }), }); diff --git a/src/resources/Products.js b/src/resources/Products.js index 3886020cf8..5a995c89f1 100644 --- a/src/resources/Products.js +++ b/src/resources/Products.js @@ -6,37 +6,35 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'products', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/products', }), retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/products/{id}', }), update: stripeMethod({ method: 'POST', - path: '/{id}', + fullPath: '/v1/products/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/products', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{id}', + fullPath: '/v1/products/{id}', }), search: stripeMethod({ method: 'GET', - path: '/search', + fullPath: '/v1/products/search', methodType: 'search', }), }); diff --git a/src/resources/PromotionCodes.js b/src/resources/PromotionCodes.js index c8afa0e478..be942e9999 100644 --- a/src/resources/PromotionCodes.js +++ b/src/resources/PromotionCodes.js @@ -6,26 +6,24 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'promotion_codes', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/promotion_codes', }), retrieve: stripeMethod({ method: 'GET', - path: '/{promotionCode}', + fullPath: '/v1/promotion_codes/{promotion_code}', }), update: stripeMethod({ method: 'POST', - path: '/{promotionCode}', + fullPath: '/v1/promotion_codes/{promotion_code}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/promotion_codes', methodType: 'list', }), }); diff --git a/src/resources/Quotes.js b/src/resources/Quotes.js index 62aebb65a9..0631c6f116 100644 --- a/src/resources/Quotes.js +++ b/src/resources/Quotes.js @@ -6,60 +6,58 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'quotes', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/quotes', }), retrieve: stripeMethod({ method: 'GET', - path: '/{quote}', + fullPath: '/v1/quotes/{quote}', }), update: stripeMethod({ method: 'POST', - path: '/{quote}', + fullPath: '/v1/quotes/{quote}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/quotes', methodType: 'list', }), accept: stripeMethod({ method: 'POST', - path: '/{quote}/accept', + fullPath: '/v1/quotes/{quote}/accept', }), cancel: stripeMethod({ method: 'POST', - path: '/{quote}/cancel', + fullPath: '/v1/quotes/{quote}/cancel', }), finalizeQuote: stripeMethod({ method: 'POST', - path: '/{quote}/finalize', + fullPath: '/v1/quotes/{quote}/finalize', }), listComputedUpfrontLineItems: stripeMethod({ method: 'GET', - path: '/{quote}/computed_upfront_line_items', + fullPath: '/v1/quotes/{quote}/computed_upfront_line_items', methodType: 'list', }), listLineItems: stripeMethod({ method: 'GET', - path: '/{quote}/line_items', + fullPath: '/v1/quotes/{quote}/line_items', methodType: 'list', }), pdf: stripeMethod({ host: 'files.stripe.com', method: 'GET', - path: '/{quote}/pdf', + fullPath: '/v1/quotes/{quote}/pdf', streaming: true, }), }); diff --git a/src/resources/Radar/EarlyFraudWarnings.js b/src/resources/Radar/EarlyFraudWarnings.js index 9282648d86..4e38d1c655 100644 --- a/src/resources/Radar/EarlyFraudWarnings.js +++ b/src/resources/Radar/EarlyFraudWarnings.js @@ -6,16 +6,14 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'radar/early_fraud_warnings', - retrieve: stripeMethod({ method: 'GET', - path: '/{earlyFraudWarning}', + fullPath: '/v1/radar/early_fraud_warnings/{early_fraud_warning}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/radar/early_fraud_warnings', methodType: 'list', }), }); diff --git a/src/resources/Radar/ValueListItems.js b/src/resources/Radar/ValueListItems.js index 75bcb8947c..df0b8c9800 100644 --- a/src/resources/Radar/ValueListItems.js +++ b/src/resources/Radar/ValueListItems.js @@ -6,26 +6,24 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'radar/value_list_items', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/radar/value_list_items', }), retrieve: stripeMethod({ method: 'GET', - path: '/{item}', + fullPath: '/v1/radar/value_list_items/{item}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/radar/value_list_items', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{item}', + fullPath: '/v1/radar/value_list_items/{item}', }), }); diff --git a/src/resources/Radar/ValueLists.js b/src/resources/Radar/ValueLists.js index ace1edaa2d..68025810e3 100644 --- a/src/resources/Radar/ValueLists.js +++ b/src/resources/Radar/ValueLists.js @@ -6,31 +6,29 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'radar/value_lists', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/radar/value_lists', }), retrieve: stripeMethod({ method: 'GET', - path: '/{valueList}', + fullPath: '/v1/radar/value_lists/{value_list}', }), update: stripeMethod({ method: 'POST', - path: '/{valueList}', + fullPath: '/v1/radar/value_lists/{value_list}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/radar/value_lists', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{valueList}', + fullPath: '/v1/radar/value_lists/{value_list}', }), }); diff --git a/src/resources/Refunds.js b/src/resources/Refunds.js index c859fc577c..380688d9b0 100644 --- a/src/resources/Refunds.js +++ b/src/resources/Refunds.js @@ -6,31 +6,29 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'refunds', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/refunds', }), retrieve: stripeMethod({ method: 'GET', - path: '/{refund}', + fullPath: '/v1/refunds/{refund}', }), update: stripeMethod({ method: 'POST', - path: '/{refund}', + fullPath: '/v1/refunds/{refund}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/refunds', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{refund}/cancel', + fullPath: '/v1/refunds/{refund}/cancel', }), }); diff --git a/src/resources/Reporting/ReportRuns.js b/src/resources/Reporting/ReportRuns.js index 84eb179f90..c3ecf96c83 100644 --- a/src/resources/Reporting/ReportRuns.js +++ b/src/resources/Reporting/ReportRuns.js @@ -6,21 +6,19 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'reporting/report_runs', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/reporting/report_runs', }), retrieve: stripeMethod({ method: 'GET', - path: '/{reportRun}', + fullPath: '/v1/reporting/report_runs/{report_run}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/reporting/report_runs', methodType: 'list', }), }); diff --git a/src/resources/Reporting/ReportTypes.js b/src/resources/Reporting/ReportTypes.js index b4b25f8043..48e08548d9 100644 --- a/src/resources/Reporting/ReportTypes.js +++ b/src/resources/Reporting/ReportTypes.js @@ -6,16 +6,14 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'reporting/report_types', - retrieve: stripeMethod({ method: 'GET', - path: '/{reportType}', + fullPath: '/v1/reporting/report_types/{report_type}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/reporting/report_types', methodType: 'list', }), }); diff --git a/src/resources/Reviews.js b/src/resources/Reviews.js index 9400e8b89a..f9b515b464 100644 --- a/src/resources/Reviews.js +++ b/src/resources/Reviews.js @@ -6,21 +6,19 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'reviews', - retrieve: stripeMethod({ method: 'GET', - path: '/{review}', + fullPath: '/v1/reviews/{review}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/reviews', methodType: 'list', }), approve: stripeMethod({ method: 'POST', - path: '/{review}/approve', + fullPath: '/v1/reviews/{review}/approve', }), }); diff --git a/src/resources/SKUs.js b/src/resources/SKUs.js deleted file mode 100644 index 26812405ff..0000000000 --- a/src/resources/SKUs.js +++ /dev/null @@ -1,36 +0,0 @@ -// File generated from our OpenAPI spec - -'use strict'; - -const StripeResource = require('../StripeResource'); -const stripeMethod = StripeResource.method; - -module.exports = StripeResource.extend({ - path: 'skus', - - create: stripeMethod({ - method: 'POST', - path: '', - }), - - retrieve: stripeMethod({ - method: 'GET', - path: '/{id}', - }), - - update: stripeMethod({ - method: 'POST', - path: '/{id}', - }), - - list: stripeMethod({ - method: 'GET', - path: '', - methodType: 'list', - }), - - del: stripeMethod({ - method: 'DELETE', - path: '/{id}', - }), -}); diff --git a/src/resources/SetupAttempts.js b/src/resources/SetupAttempts.js index 9bb8c1d3e3..7076944edf 100644 --- a/src/resources/SetupAttempts.js +++ b/src/resources/SetupAttempts.js @@ -6,11 +6,9 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'setup_attempts', - list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/setup_attempts', methodType: 'list', }), }); diff --git a/src/resources/SetupIntents.js b/src/resources/SetupIntents.js index 7aea8dcf75..507c8c9b13 100644 --- a/src/resources/SetupIntents.js +++ b/src/resources/SetupIntents.js @@ -6,41 +6,39 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'setup_intents', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/setup_intents', }), retrieve: stripeMethod({ method: 'GET', - path: '/{intent}', + fullPath: '/v1/setup_intents/{intent}', }), update: stripeMethod({ method: 'POST', - path: '/{intent}', + fullPath: '/v1/setup_intents/{intent}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/setup_intents', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{intent}/cancel', + fullPath: '/v1/setup_intents/{intent}/cancel', }), confirm: stripeMethod({ method: 'POST', - path: '/{intent}/confirm', + fullPath: '/v1/setup_intents/{intent}/confirm', }), verifyMicrodeposits: stripeMethod({ method: 'POST', - path: '/{intent}/verify_microdeposits', + fullPath: '/v1/setup_intents/{intent}/verify_microdeposits', }), }); diff --git a/src/resources/ShippingRates.js b/src/resources/ShippingRates.js index d7eb52ac16..a24e83468d 100644 --- a/src/resources/ShippingRates.js +++ b/src/resources/ShippingRates.js @@ -6,26 +6,24 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'shipping_rates', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/shipping_rates', }), retrieve: stripeMethod({ method: 'GET', - path: '/{shippingRateToken}', + fullPath: '/v1/shipping_rates/{shipping_rate_token}', }), update: stripeMethod({ method: 'POST', - path: '/{shippingRateToken}', + fullPath: '/v1/shipping_rates/{shipping_rate_token}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/shipping_rates', methodType: 'list', }), }); diff --git a/src/resources/Sigma/ScheduledQueryRuns.js b/src/resources/Sigma/ScheduledQueryRuns.js index a8cb8e60a6..0396103a9b 100644 --- a/src/resources/Sigma/ScheduledQueryRuns.js +++ b/src/resources/Sigma/ScheduledQueryRuns.js @@ -6,16 +6,14 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'sigma/scheduled_query_runs', - retrieve: stripeMethod({ method: 'GET', - path: '/{scheduledQueryRun}', + fullPath: '/v1/sigma/scheduled_query_runs/{scheduled_query_run}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/sigma/scheduled_query_runs', methodType: 'list', }), }); diff --git a/src/resources/Sources.js b/src/resources/Sources.js index 5008001c5c..258245ce2a 100644 --- a/src/resources/Sources.js +++ b/src/resources/Sources.js @@ -6,31 +6,29 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'sources', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/sources', }), retrieve: stripeMethod({ method: 'GET', - path: '/{source}', + fullPath: '/v1/sources/{source}', }), update: stripeMethod({ method: 'POST', - path: '/{source}', + fullPath: '/v1/sources/{source}', }), listSourceTransactions: stripeMethod({ method: 'GET', - path: '/{source}/source_transactions', + fullPath: '/v1/sources/{source}/source_transactions', methodType: 'list', }), verify: stripeMethod({ method: 'POST', - path: '/{source}/verify', + fullPath: '/v1/sources/{source}/verify', }), }); diff --git a/src/resources/SubscriptionItems.js b/src/resources/SubscriptionItems.js index 62423a22cb..a58a6e45cb 100644 --- a/src/resources/SubscriptionItems.js +++ b/src/resources/SubscriptionItems.js @@ -6,42 +6,41 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'subscription_items', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/subscription_items', }), retrieve: stripeMethod({ method: 'GET', - path: '/{item}', + fullPath: '/v1/subscription_items/{item}', }), update: stripeMethod({ method: 'POST', - path: '/{item}', + fullPath: '/v1/subscription_items/{item}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/subscription_items', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{item}', + fullPath: '/v1/subscription_items/{item}', }), createUsageRecord: stripeMethod({ method: 'POST', - path: '/{subscriptionItem}/usage_records', + fullPath: '/v1/subscription_items/{subscription_item}/usage_records', }), listUsageRecordSummaries: stripeMethod({ method: 'GET', - path: '/{subscriptionItem}/usage_record_summaries', + fullPath: + '/v1/subscription_items/{subscription_item}/usage_record_summaries', methodType: 'list', }), }); diff --git a/src/resources/SubscriptionSchedules.js b/src/resources/SubscriptionSchedules.js index 9c9249e3d9..9932c3fa78 100644 --- a/src/resources/SubscriptionSchedules.js +++ b/src/resources/SubscriptionSchedules.js @@ -6,36 +6,34 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'subscription_schedules', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/subscription_schedules', }), retrieve: stripeMethod({ method: 'GET', - path: '/{schedule}', + fullPath: '/v1/subscription_schedules/{schedule}', }), update: stripeMethod({ method: 'POST', - path: '/{schedule}', + fullPath: '/v1/subscription_schedules/{schedule}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/subscription_schedules', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{schedule}/cancel', + fullPath: '/v1/subscription_schedules/{schedule}/cancel', }), release: stripeMethod({ method: 'POST', - path: '/{schedule}/release', + fullPath: '/v1/subscription_schedules/{schedule}/release', }), }); diff --git a/src/resources/Subscriptions.js b/src/resources/Subscriptions.js index bd0dc644c7..834abd3bd9 100644 --- a/src/resources/Subscriptions.js +++ b/src/resources/Subscriptions.js @@ -6,47 +6,45 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'subscriptions', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/subscriptions', }), retrieve: stripeMethod({ method: 'GET', - path: '/{subscriptionExposedId}', + fullPath: '/v1/subscriptions/{subscription_exposed_id}', }), update: stripeMethod({ method: 'POST', - path: '/{subscriptionExposedId}', + fullPath: '/v1/subscriptions/{subscription_exposed_id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/subscriptions', methodType: 'list', }), cancel: stripeMethod({ method: 'DELETE', - path: '/{subscriptionExposedId}', + fullPath: '/v1/subscriptions/{subscription_exposed_id}', }), del: stripeMethod({ method: 'DELETE', - path: '/{subscriptionExposedId}', + fullPath: '/v1/subscriptions/{subscription_exposed_id}', }), deleteDiscount: stripeMethod({ method: 'DELETE', - path: '/{subscriptionExposedId}/discount', + fullPath: '/v1/subscriptions/{subscription_exposed_id}/discount', }), search: stripeMethod({ method: 'GET', - path: '/search', + fullPath: '/v1/subscriptions/search', methodType: 'search', }), }); diff --git a/src/resources/TaxCodes.js b/src/resources/TaxCodes.js index 57bf52ff3e..828617b2a8 100644 --- a/src/resources/TaxCodes.js +++ b/src/resources/TaxCodes.js @@ -6,16 +6,14 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'tax_codes', - retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/tax_codes/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/tax_codes', methodType: 'list', }), }); diff --git a/src/resources/TaxRates.js b/src/resources/TaxRates.js index e429895f7b..dbe45632e0 100644 --- a/src/resources/TaxRates.js +++ b/src/resources/TaxRates.js @@ -6,26 +6,24 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'tax_rates', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/tax_rates', }), retrieve: stripeMethod({ method: 'GET', - path: '/{taxRate}', + fullPath: '/v1/tax_rates/{tax_rate}', }), update: stripeMethod({ method: 'POST', - path: '/{taxRate}', + fullPath: '/v1/tax_rates/{tax_rate}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/tax_rates', methodType: 'list', }), }); diff --git a/src/resources/Terminal/Configurations.js b/src/resources/Terminal/Configurations.js index 4a7d069a8e..efdf67cc12 100644 --- a/src/resources/Terminal/Configurations.js +++ b/src/resources/Terminal/Configurations.js @@ -6,31 +6,29 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'terminal/configurations', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/terminal/configurations', }), retrieve: stripeMethod({ method: 'GET', - path: '/{configuration}', + fullPath: '/v1/terminal/configurations/{configuration}', }), update: stripeMethod({ method: 'POST', - path: '/{configuration}', + fullPath: '/v1/terminal/configurations/{configuration}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/terminal/configurations', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{configuration}', + fullPath: '/v1/terminal/configurations/{configuration}', }), }); diff --git a/src/resources/Terminal/ConnectionTokens.js b/src/resources/Terminal/ConnectionTokens.js index 2e1a1b5155..d210bb9388 100644 --- a/src/resources/Terminal/ConnectionTokens.js +++ b/src/resources/Terminal/ConnectionTokens.js @@ -6,10 +6,8 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'terminal/connection_tokens', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/terminal/connection_tokens', }), }); diff --git a/src/resources/Terminal/Locations.js b/src/resources/Terminal/Locations.js index 161e0dd014..3d87dce2a4 100644 --- a/src/resources/Terminal/Locations.js +++ b/src/resources/Terminal/Locations.js @@ -6,31 +6,29 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'terminal/locations', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/terminal/locations', }), retrieve: stripeMethod({ method: 'GET', - path: '/{location}', + fullPath: '/v1/terminal/locations/{location}', }), update: stripeMethod({ method: 'POST', - path: '/{location}', + fullPath: '/v1/terminal/locations/{location}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/terminal/locations', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{location}', + fullPath: '/v1/terminal/locations/{location}', }), }); diff --git a/src/resources/Terminal/Readers.js b/src/resources/Terminal/Readers.js index 05a8a53ef5..7f19d13d29 100644 --- a/src/resources/Terminal/Readers.js +++ b/src/resources/Terminal/Readers.js @@ -6,51 +6,49 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'terminal/readers', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/terminal/readers', }), retrieve: stripeMethod({ method: 'GET', - path: '/{reader}', + fullPath: '/v1/terminal/readers/{reader}', }), update: stripeMethod({ method: 'POST', - path: '/{reader}', + fullPath: '/v1/terminal/readers/{reader}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/terminal/readers', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{reader}', + fullPath: '/v1/terminal/readers/{reader}', }), cancelAction: stripeMethod({ method: 'POST', - path: '/{reader}/cancel_action', + fullPath: '/v1/terminal/readers/{reader}/cancel_action', }), processPaymentIntent: stripeMethod({ method: 'POST', - path: '/{reader}/process_payment_intent', + fullPath: '/v1/terminal/readers/{reader}/process_payment_intent', }), processSetupIntent: stripeMethod({ method: 'POST', - path: '/{reader}/process_setup_intent', + fullPath: '/v1/terminal/readers/{reader}/process_setup_intent', }), setReaderDisplay: stripeMethod({ method: 'POST', - path: '/{reader}/set_reader_display', + fullPath: '/v1/terminal/readers/{reader}/set_reader_display', }), }); diff --git a/src/resources/TestHelpers/Customers.js b/src/resources/TestHelpers/Customers.js index 64796a11da..c0671f9b0a 100644 --- a/src/resources/TestHelpers/Customers.js +++ b/src/resources/TestHelpers/Customers.js @@ -6,10 +6,8 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/customers', - fundCashBalance: stripeMethod({ method: 'POST', - path: '/{customer}/fund_cash_balance', + fullPath: '/v1/test_helpers/customers/{customer}/fund_cash_balance', }), }); diff --git a/src/resources/TestHelpers/Issuing/Cards.js b/src/resources/TestHelpers/Issuing/Cards.js index 0f8c50f7d0..a814ff6503 100644 --- a/src/resources/TestHelpers/Issuing/Cards.js +++ b/src/resources/TestHelpers/Issuing/Cards.js @@ -6,25 +6,23 @@ const StripeResource = require('../../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/issuing/cards', - deliverCard: stripeMethod({ method: 'POST', - path: '/{card}/shipping/deliver', + fullPath: '/v1/test_helpers/issuing/cards/{card}/shipping/deliver', }), failCard: stripeMethod({ method: 'POST', - path: '/{card}/shipping/fail', + fullPath: '/v1/test_helpers/issuing/cards/{card}/shipping/fail', }), returnCard: stripeMethod({ method: 'POST', - path: '/{card}/shipping/return', + fullPath: '/v1/test_helpers/issuing/cards/{card}/shipping/return', }), shipCard: stripeMethod({ method: 'POST', - path: '/{card}/shipping/ship', + fullPath: '/v1/test_helpers/issuing/cards/{card}/shipping/ship', }), }); diff --git a/src/resources/TestHelpers/Refunds.js b/src/resources/TestHelpers/Refunds.js index 7aac415e77..5302e65277 100644 --- a/src/resources/TestHelpers/Refunds.js +++ b/src/resources/TestHelpers/Refunds.js @@ -6,10 +6,8 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/refunds', - expire: stripeMethod({ method: 'POST', - path: '/{refund}/expire', + fullPath: '/v1/test_helpers/refunds/{refund}/expire', }), }); diff --git a/src/resources/TestHelpers/Terminal/Readers.js b/src/resources/TestHelpers/Terminal/Readers.js index ab660b0f95..f303abc122 100644 --- a/src/resources/TestHelpers/Terminal/Readers.js +++ b/src/resources/TestHelpers/Terminal/Readers.js @@ -6,10 +6,9 @@ const StripeResource = require('../../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/terminal/readers', - presentPaymentMethod: stripeMethod({ method: 'POST', - path: '/{reader}/present_payment_method', + fullPath: + '/v1/test_helpers/terminal/readers/{reader}/present_payment_method', }), }); diff --git a/src/resources/TestHelpers/TestClocks.js b/src/resources/TestHelpers/TestClocks.js index adae9ae446..a0beacd365 100644 --- a/src/resources/TestHelpers/TestClocks.js +++ b/src/resources/TestHelpers/TestClocks.js @@ -6,31 +6,29 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/test_clocks', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/test_helpers/test_clocks', }), retrieve: stripeMethod({ method: 'GET', - path: '/{testClock}', + fullPath: '/v1/test_helpers/test_clocks/{test_clock}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/test_helpers/test_clocks', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{testClock}', + fullPath: '/v1/test_helpers/test_clocks/{test_clock}', }), advance: stripeMethod({ method: 'POST', - path: '/{testClock}/advance', + fullPath: '/v1/test_helpers/test_clocks/{test_clock}/advance', }), }); diff --git a/src/resources/TestHelpers/Treasury/InboundTransfers.js b/src/resources/TestHelpers/Treasury/InboundTransfers.js index 178816ad58..e1a55c0b80 100644 --- a/src/resources/TestHelpers/Treasury/InboundTransfers.js +++ b/src/resources/TestHelpers/Treasury/InboundTransfers.js @@ -6,20 +6,18 @@ const StripeResource = require('../../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/treasury/inbound_transfers', - fail: stripeMethod({ method: 'POST', - path: '/{id}/fail', + fullPath: '/v1/test_helpers/treasury/inbound_transfers/{id}/fail', }), returnInboundTransfer: stripeMethod({ method: 'POST', - path: '/{id}/return', + fullPath: '/v1/test_helpers/treasury/inbound_transfers/{id}/return', }), succeed: stripeMethod({ method: 'POST', - path: '/{id}/succeed', + fullPath: '/v1/test_helpers/treasury/inbound_transfers/{id}/succeed', }), }); diff --git a/src/resources/TestHelpers/Treasury/OutboundPayments.js b/src/resources/TestHelpers/Treasury/OutboundPayments.js index 3a1b4d6516..b7da93e659 100644 --- a/src/resources/TestHelpers/Treasury/OutboundPayments.js +++ b/src/resources/TestHelpers/Treasury/OutboundPayments.js @@ -6,20 +6,18 @@ const StripeResource = require('../../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/treasury/outbound_payments', - fail: stripeMethod({ method: 'POST', - path: '/{id}/fail', + fullPath: '/v1/test_helpers/treasury/outbound_payments/{id}/fail', }), post: stripeMethod({ method: 'POST', - path: '/{id}/post', + fullPath: '/v1/test_helpers/treasury/outbound_payments/{id}/post', }), returnOutboundPayment: stripeMethod({ method: 'POST', - path: '/{id}/return', + fullPath: '/v1/test_helpers/treasury/outbound_payments/{id}/return', }), }); diff --git a/src/resources/TestHelpers/Treasury/OutboundTransfers.js b/src/resources/TestHelpers/Treasury/OutboundTransfers.js index 90d7d6236b..55b1a25064 100644 --- a/src/resources/TestHelpers/Treasury/OutboundTransfers.js +++ b/src/resources/TestHelpers/Treasury/OutboundTransfers.js @@ -6,20 +6,21 @@ const StripeResource = require('../../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/treasury/outbound_transfers', - fail: stripeMethod({ method: 'POST', - path: '/{outboundTransfer}/fail', + fullPath: + '/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail', }), post: stripeMethod({ method: 'POST', - path: '/{outboundTransfer}/post', + fullPath: + '/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post', }), returnOutboundTransfer: stripeMethod({ method: 'POST', - path: '/{outboundTransfer}/return', + fullPath: + '/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return', }), }); diff --git a/src/resources/TestHelpers/Treasury/ReceivedCredits.js b/src/resources/TestHelpers/Treasury/ReceivedCredits.js index 8c3e5f0286..53614059ca 100644 --- a/src/resources/TestHelpers/Treasury/ReceivedCredits.js +++ b/src/resources/TestHelpers/Treasury/ReceivedCredits.js @@ -6,10 +6,8 @@ const StripeResource = require('../../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/treasury/received_credits', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/test_helpers/treasury/received_credits', }), }); diff --git a/src/resources/TestHelpers/Treasury/ReceivedDebits.js b/src/resources/TestHelpers/Treasury/ReceivedDebits.js index e25dc03bd2..e19cf15581 100644 --- a/src/resources/TestHelpers/Treasury/ReceivedDebits.js +++ b/src/resources/TestHelpers/Treasury/ReceivedDebits.js @@ -6,10 +6,8 @@ const StripeResource = require('../../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'test_helpers/treasury/received_debits', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/test_helpers/treasury/received_debits', }), }); diff --git a/src/resources/Tokens.js b/src/resources/Tokens.js index 76e4d33774..b1a5ae070f 100644 --- a/src/resources/Tokens.js +++ b/src/resources/Tokens.js @@ -6,15 +6,13 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'tokens', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/tokens', }), retrieve: stripeMethod({ method: 'GET', - path: '/{token}', + fullPath: '/v1/tokens/{token}', }), }); diff --git a/src/resources/Topups.js b/src/resources/Topups.js index e65fe5d14a..31c005d946 100644 --- a/src/resources/Topups.js +++ b/src/resources/Topups.js @@ -6,31 +6,29 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'topups', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/topups', }), retrieve: stripeMethod({ method: 'GET', - path: '/{topup}', + fullPath: '/v1/topups/{topup}', }), update: stripeMethod({ method: 'POST', - path: '/{topup}', + fullPath: '/v1/topups/{topup}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/topups', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{topup}/cancel', + fullPath: '/v1/topups/{topup}/cancel', }), }); diff --git a/src/resources/Transfers.js b/src/resources/Transfers.js index 656128c392..743c887335 100644 --- a/src/resources/Transfers.js +++ b/src/resources/Transfers.js @@ -6,47 +6,45 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'transfers', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/transfers', }), retrieve: stripeMethod({ method: 'GET', - path: '/{transfer}', + fullPath: '/v1/transfers/{transfer}', }), update: stripeMethod({ method: 'POST', - path: '/{transfer}', + fullPath: '/v1/transfers/{transfer}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/transfers', methodType: 'list', }), createReversal: stripeMethod({ method: 'POST', - path: '/{id}/reversals', + fullPath: '/v1/transfers/{id}/reversals', }), retrieveReversal: stripeMethod({ method: 'GET', - path: '/{transfer}/reversals/{id}', + fullPath: '/v1/transfers/{transfer}/reversals/{id}', }), updateReversal: stripeMethod({ method: 'POST', - path: '/{transfer}/reversals/{id}', + fullPath: '/v1/transfers/{transfer}/reversals/{id}', }), listReversals: stripeMethod({ method: 'GET', - path: '/{id}/reversals', + fullPath: '/v1/transfers/{id}/reversals', methodType: 'list', }), }); diff --git a/src/resources/Treasury/CreditReversals.js b/src/resources/Treasury/CreditReversals.js index 9039b816a2..952693666c 100644 --- a/src/resources/Treasury/CreditReversals.js +++ b/src/resources/Treasury/CreditReversals.js @@ -6,21 +6,19 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/credit_reversals', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/treasury/credit_reversals', }), retrieve: stripeMethod({ method: 'GET', - path: '/{creditReversal}', + fullPath: '/v1/treasury/credit_reversals/{credit_reversal}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/credit_reversals', methodType: 'list', }), }); diff --git a/src/resources/Treasury/DebitReversals.js b/src/resources/Treasury/DebitReversals.js index f95bfe5372..abbab8694b 100644 --- a/src/resources/Treasury/DebitReversals.js +++ b/src/resources/Treasury/DebitReversals.js @@ -6,21 +6,19 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/debit_reversals', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/treasury/debit_reversals', }), retrieve: stripeMethod({ method: 'GET', - path: '/{debitReversal}', + fullPath: '/v1/treasury/debit_reversals/{debit_reversal}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/debit_reversals', methodType: 'list', }), }); diff --git a/src/resources/Treasury/FinancialAccounts.js b/src/resources/Treasury/FinancialAccounts.js index a30b1273b6..0a1a47ba14 100644 --- a/src/resources/Treasury/FinancialAccounts.js +++ b/src/resources/Treasury/FinancialAccounts.js @@ -6,36 +6,34 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/financial_accounts', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/treasury/financial_accounts', }), retrieve: stripeMethod({ method: 'GET', - path: '/{financialAccount}', + fullPath: '/v1/treasury/financial_accounts/{financial_account}', }), update: stripeMethod({ method: 'POST', - path: '/{financialAccount}', + fullPath: '/v1/treasury/financial_accounts/{financial_account}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/financial_accounts', methodType: 'list', }), retrieveFeatures: stripeMethod({ method: 'GET', - path: '/{financialAccount}/features', + fullPath: '/v1/treasury/financial_accounts/{financial_account}/features', }), updateFeatures: stripeMethod({ method: 'POST', - path: '/{financialAccount}/features', + fullPath: '/v1/treasury/financial_accounts/{financial_account}/features', }), }); diff --git a/src/resources/Treasury/InboundTransfers.js b/src/resources/Treasury/InboundTransfers.js index 468adba0e7..84ecb300f7 100644 --- a/src/resources/Treasury/InboundTransfers.js +++ b/src/resources/Treasury/InboundTransfers.js @@ -6,26 +6,24 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/inbound_transfers', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/treasury/inbound_transfers', }), retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/treasury/inbound_transfers/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/inbound_transfers', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{inboundTransfer}/cancel', + fullPath: '/v1/treasury/inbound_transfers/{inbound_transfer}/cancel', }), }); diff --git a/src/resources/Treasury/OutboundPayments.js b/src/resources/Treasury/OutboundPayments.js index 5d08eaad0d..b4c6191816 100644 --- a/src/resources/Treasury/OutboundPayments.js +++ b/src/resources/Treasury/OutboundPayments.js @@ -6,26 +6,24 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/outbound_payments', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/treasury/outbound_payments', }), retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/treasury/outbound_payments/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/outbound_payments', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{id}/cancel', + fullPath: '/v1/treasury/outbound_payments/{id}/cancel', }), }); diff --git a/src/resources/Treasury/OutboundTransfers.js b/src/resources/Treasury/OutboundTransfers.js index 40d72465dd..b5dfa874e9 100644 --- a/src/resources/Treasury/OutboundTransfers.js +++ b/src/resources/Treasury/OutboundTransfers.js @@ -6,26 +6,24 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/outbound_transfers', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/treasury/outbound_transfers', }), retrieve: stripeMethod({ method: 'GET', - path: '/{outboundTransfer}', + fullPath: '/v1/treasury/outbound_transfers/{outbound_transfer}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/outbound_transfers', methodType: 'list', }), cancel: stripeMethod({ method: 'POST', - path: '/{outboundTransfer}/cancel', + fullPath: '/v1/treasury/outbound_transfers/{outbound_transfer}/cancel', }), }); diff --git a/src/resources/Treasury/ReceivedCredits.js b/src/resources/Treasury/ReceivedCredits.js index 98b11b1699..160f659c19 100644 --- a/src/resources/Treasury/ReceivedCredits.js +++ b/src/resources/Treasury/ReceivedCredits.js @@ -6,16 +6,14 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/received_credits', - retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/treasury/received_credits/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/received_credits', methodType: 'list', }), }); diff --git a/src/resources/Treasury/ReceivedDebits.js b/src/resources/Treasury/ReceivedDebits.js index c472144aa9..b946b42ee9 100644 --- a/src/resources/Treasury/ReceivedDebits.js +++ b/src/resources/Treasury/ReceivedDebits.js @@ -6,16 +6,14 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/received_debits', - retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/treasury/received_debits/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/received_debits', methodType: 'list', }), }); diff --git a/src/resources/Treasury/TransactionEntries.js b/src/resources/Treasury/TransactionEntries.js index a52c432d68..067109bd81 100644 --- a/src/resources/Treasury/TransactionEntries.js +++ b/src/resources/Treasury/TransactionEntries.js @@ -6,16 +6,14 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/transaction_entries', - retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/treasury/transaction_entries/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/transaction_entries', methodType: 'list', }), }); diff --git a/src/resources/Treasury/Transactions.js b/src/resources/Treasury/Transactions.js index a810413116..db1c5788f3 100644 --- a/src/resources/Treasury/Transactions.js +++ b/src/resources/Treasury/Transactions.js @@ -6,16 +6,14 @@ const StripeResource = require('../../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'treasury/transactions', - retrieve: stripeMethod({ method: 'GET', - path: '/{id}', + fullPath: '/v1/treasury/transactions/{id}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/treasury/transactions', methodType: 'list', }), }); diff --git a/src/resources/WebhookEndpoints.js b/src/resources/WebhookEndpoints.js index 2f73d65031..b98d09e906 100644 --- a/src/resources/WebhookEndpoints.js +++ b/src/resources/WebhookEndpoints.js @@ -6,31 +6,29 @@ const StripeResource = require('../StripeResource'); const stripeMethod = StripeResource.method; module.exports = StripeResource.extend({ - path: 'webhook_endpoints', - create: stripeMethod({ method: 'POST', - path: '', + fullPath: '/v1/webhook_endpoints', }), retrieve: stripeMethod({ method: 'GET', - path: '/{webhookEndpoint}', + fullPath: '/v1/webhook_endpoints/{webhook_endpoint}', }), update: stripeMethod({ method: 'POST', - path: '/{webhookEndpoint}', + fullPath: '/v1/webhook_endpoints/{webhook_endpoint}', }), list: stripeMethod({ method: 'GET', - path: '', + fullPath: '/v1/webhook_endpoints', methodType: 'list', }), del: stripeMethod({ method: 'DELETE', - path: '/{webhookEndpoint}', + fullPath: '/v1/webhook_endpoints/{webhook_endpoint}', }), }); diff --git a/src/stripe.ts b/src/stripe.ts index b53719fa77..a662ccda54 100644 --- a/src/stripe.ts +++ b/src/stripe.ts @@ -186,7 +186,7 @@ Stripe.createSubtleCryptoProvider = ( Stripe.prototype = { // Properties are set in the constructor above - _appInfo: null!, + _appInfo: undefined!, on: null!, off: null!, once: null!, @@ -199,98 +199,6 @@ Stripe.prototype = { _emitter: null!, _enableTelemetry: null!, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * host: 'example.com', - * port: '8080', - * protocol: 'http', - * }); - * - */ - setHost(host: string, port: number, protocol: string): void { - emitWarning( - '`setHost` is deprecated. Use the `host` config option instead.' - ); - this._setApiField('host', host); - if (port) { - this.setPort(port); - } - if (protocol) { - this.setProtocol(protocol); - } - }, - - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * protocol: 'http', - * }); - * - */ - setProtocol(protocol: string): void { - emitWarning( - '`setProtocol` is deprecated. Use the `protocol` config option instead.' - ); - this._setApiField('protocol', protocol.toLowerCase()); - }, - - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * port: 3000, - * }); - * - */ - setPort(port: number): void { - emitWarning( - '`setPort` is deprecated. Use the `port` config option instead.' - ); - this._setApiField('port', port); - }, - - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * apiVersion: API_VERSION, - * }); - * - */ - setApiVersion(version: string): void { - emitWarning( - '`setApiVersion` is deprecated. Use the `apiVersion` config or request option instead.' - ); - if (version) { - this._setApiField('version', version); - } - }, - - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY); - * - * Or, for Stripe Connect, use `stripeAccount` instead: - * - * const stripe = new Stripe(API_KEY, { - * stripeAccount: 'acct_...', - * }); - * - * Or, to use a different apiKey on a given request: - * - * stripe.customers.create(params, {apiKey: 'sk_test_...'}); - */ - setApiKey(key: string): void { - emitWarning( - '`setApiKey` is deprecated. Use the `apiKey` request option instead.' - ); - this._setApiKey(key); - }, - /** * @private */ @@ -300,39 +208,6 @@ Stripe.prototype = { } }, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * timeout: TIMEOUT_MS, - * }); - */ - setTimeout(timeout: number): void { - emitWarning( - '`setTimeout` is deprecated. Use the `timeout` config or request option instead.' - ); - this._setApiField('timeout', timeout == null ? DEFAULT_TIMEOUT : timeout); - }, - - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * appInfo: { - * name: 'MyPlugin', - * version: '1.4.2', - * url: 'https://myplugin.com', - * partner_id: '1234', - * }, - * }); - */ - setAppInfo(info: AppInfo): void { - emitWarning( - '`setAppInfo` is deprecated. Use the `appInfo` config option instead.' - ); - this._setAppInfo(info); - }, - /** * @private * This may be removed in the future. @@ -363,22 +238,6 @@ Stripe.prototype = { ); }, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const ProxyAgent = require('https-proxy-agent'); - * const stripe = new Stripe(API_KEY, { - * httpAgent: new ProxyAgent(process.env.http_proxy), - * }); - * - */ - setHttpAgent(agent: string): void { - emitWarning( - '`setHttpAgent` is deprecated. Use the `httpAgent` config option instead.' - ); - this._setApiField('agent', agent); - }, - /** * @private * This may be removed in the future. @@ -442,18 +301,6 @@ Stripe.prototype = { return this.getApiField('maxNetworkRetries'); }, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * maxNetworkRetries: 2, - * }); - * - */ - setMaxNetworkRetries(maxNetworkRetries: number): void { - this._setApiNumberField('maxNetworkRetries', maxNetworkRetries); - }, - /** * @private * This may be removed in the future. @@ -565,21 +412,6 @@ Stripe.prototype = { return formatted; }, - /** - * @deprecated will be removed in a future major version. Use the config object instead: - * - * const stripe = new Stripe(API_KEY, { - * telemetry: false, - * }); - * - */ - setTelemetryEnabled(enableTelemetry: boolean): void { - emitWarning( - '`setTelemetryEnabled` is deprecated. Use the `telemetry` config option instead.' - ); - this._enableTelemetry = enableTelemetry; - }, - getTelemetryEnabled(): boolean { return this._enableTelemetry; }, diff --git a/src/utils.ts b/src/utils.ts index 9eb3971cc9..2e289937bf 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -25,15 +25,6 @@ const OPTIONS_KEYS = [ 'host', ]; -const DEPRECATED_OPTIONS = { - api_key: 'apiKey', - idempotency_key: 'idempotencyKey', - stripe_account: 'stripeAccount', - stripe_version: 'apiVersion', - stripeVersion: 'apiVersion', -} as Record; -const DEPRECATED_OPTIONS_KEYS = Object.keys(DEPRECATED_OPTIONS); - type Settings = { timeout?: number; maxNetworkRetries?: number; @@ -52,12 +43,7 @@ const utils = { return ( o && typeof o === 'object' && - (OPTIONS_KEYS.some((prop) => - Object.prototype.hasOwnProperty.call(o, prop) - ) || - DEPRECATED_OPTIONS_KEYS.some((prop) => - Object.prototype.hasOwnProperty.call(o, prop) - )) + OPTIONS_KEYS.some((prop) => Object.prototype.hasOwnProperty.call(o, prop)) ); }, @@ -172,27 +158,9 @@ const utils = { ); if (extraKeys.length) { - const nonDeprecated = extraKeys.filter((key) => { - if (!DEPRECATED_OPTIONS[key]) { - return true; - } - const newParam = DEPRECATED_OPTIONS[key]; - if (params[newParam]) { - throw Error( - `Both '${newParam}' and '${key}' were provided; please remove '${key}', which is deprecated.` - ); - } - /** - * TODO turn this into a hard error in a future major version (once we have fixed our docs). - */ - emitWarning(`'${key}' is deprecated; use '${newParam}' instead.`); - params[newParam] = params[key]; - }); - if (nonDeprecated.length) { - emitWarning( - `Invalid options found (${extraKeys.join(', ')}); ignoring.` - ); - } + emitWarning( + `Invalid options found (${extraKeys.join(', ')}); ignoring.` + ); } if (params.apiKey) { diff --git a/test/StripeResource.spec.js b/test/StripeResource.spec.js index 78b999aedb..d852c9f95f 100644 --- a/test/StripeResource.spec.js +++ b/test/StripeResource.spec.js @@ -22,23 +22,33 @@ const { describe('StripeResource', () => { describe('createResourcePathWithSymbols', () => { + let testResource; + before(() => { + testResource = new (StripeResource.extend({ + path: 'widgets', + create: stripeMethod({ + method: 'POST', + path: '', + }), + }))(stripe); + }); it('Generates a path when there is a symbol', () => { - stripe.invoices.create({}); - const path = stripe.invoices.createResourcePathWithSymbols('{id}'); - expect(path).to.equal('/invoices/{id}'); + testResource.create({}); + const path = testResource.createResourcePathWithSymbols('{id}'); + expect(path).to.equal('/widgets/{id}'); }); it('Generates a path when there is nothing beyond the resource path', () => { - stripe.invoices.create({}); - const path = stripe.invoices.createResourcePathWithSymbols(''); + testResource.create({}); + const path = testResource.createResourcePathWithSymbols(''); // This explicitly shouldn't have a trailing slash. - expect(path).to.equal('/invoices'); + expect(path).to.equal('/widgets'); }); it('Handles accidental double slashes', () => { - stripe.invoices.create({}); - const path = stripe.invoices.createResourcePathWithSymbols('/{id}'); - expect(path).to.equal('/invoices/{id}'); + testResource.create({}); + const path = testResource.createResourcePathWithSymbols('/{id}'); + expect(path).to.equal('/widgets/{id}'); }); }); @@ -1023,8 +1033,6 @@ describe('StripeResource', () => { describe('Request Timeout', () => { it('should allow the setting of a request timeout on a per-request basis', (done) => { - stripe.setTimeout(1000); - stripe.charges.create({}); expect(stripe.LAST_REQUEST.settings).to.deep.equal({}); diff --git a/test/resources/EphemeralKeys.spec.js b/test/resources/EphemeralKeys.spec.js index 2a64f5a978..e77866ea29 100644 --- a/test/resources/EphemeralKeys.spec.js +++ b/test/resources/EphemeralKeys.spec.js @@ -1,9 +1,9 @@ 'use strict'; -const stripe = require('../../testUtils').getSpyableStripe(); +const getSpyableStripe = require('../../testUtils').getSpyableStripe; const expect = require('chai').expect; -function errorsOnNoStripeVersion() { +function errorsOnNoStripeVersion(stripe) { return expect( stripe.ephemeralKeys.create({customer: 'cus_123'}) ).to.be.eventually.rejectedWith( @@ -11,7 +11,7 @@ function errorsOnNoStripeVersion() { ); } -function sendsCorrectStripeVersion() { +function sendsCorrectStripeVersion(stripe) { stripe.ephemeralKeys.create( {customer: 'cus_123'}, {apiVersion: '2017-06-05'} @@ -32,6 +32,8 @@ function sendsCorrectStripeVersion() { describe('EphemeralKey Resource', () => { describe('create', () => { + const stripe = getSpyableStripe(); + it('Sends the correct request', () => { stripe.ephemeralKeys.create( {customer: 'cus_123'}, @@ -51,43 +53,35 @@ describe('EphemeralKey Resource', () => { }); describe('when an api version is set', () => { - beforeEach(function() { - this.oldVersion = stripe.getApiField('version'); - stripe.setApiVersion('2017-05-25'); - }); - - afterEach(function() { - stripe.setApiVersion(this.oldVersion); + const stripe = getSpyableStripe({ + apiVersion: '2017-05-25', }); it('Errors if no stripe-version is specified', () => - errorsOnNoStripeVersion()); + errorsOnNoStripeVersion(stripe)); it('Sends the correct stripe-version', () => { - sendsCorrectStripeVersion(); + sendsCorrectStripeVersion(stripe); }); }); describe('when no api version is set', () => { - beforeEach(function() { - this.oldVersion = stripe.getApiField('version'); - stripe.setApiVersion(null); - }); - - afterEach(function() { - stripe.setApiVersion(this.oldVersion); + const stripe = getSpyableStripe({ + apiVersion: null, }); it('Errors if no stripe-version is specified', () => - errorsOnNoStripeVersion()); + errorsOnNoStripeVersion(stripe)); it('Sends the correct stripe-version', () => { - sendsCorrectStripeVersion(); + sendsCorrectStripeVersion(stripe); }); }); }); describe('delete', () => { + const stripe = getSpyableStripe(); + it('Sends the correct request', () => { stripe.ephemeralKeys.del('ephkey_123'); expect(stripe.LAST_REQUEST).to.deep.equal({ diff --git a/test/resources/SKUs.spec.js b/test/resources/SKUs.spec.js deleted file mode 100644 index d165427075..0000000000 --- a/test/resources/SKUs.spec.js +++ /dev/null @@ -1,98 +0,0 @@ -'use strict'; - -const stripe = require('../../testUtils').getSpyableStripe(); -const expect = require('chai').expect; - -describe('SKU Resource', () => { - describe('retrieve', () => { - it('Sends the correct request', () => { - stripe.skus.retrieve('skuIdFoo123'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/skus/skuIdFoo123', - data: {}, - headers: {}, - settings: {}, - }); - }); - }); - - describe('create', () => { - it('Sends the correct request', () => { - stripe.skus.create({ - currency: 'usd', - inventory: {type: 'finite', quantity: 500}, - attributes: {size: 'Medium', gender: 'Unisex'}, - price: 500, - product: 'prodIdTest123', - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/skus', - data: { - currency: 'usd', - inventory: {type: 'finite', quantity: 500}, - attributes: {size: 'Medium', gender: 'Unisex'}, - price: 500, - product: 'prodIdTest123', - }, - headers: {}, - settings: {}, - }); - }); - }); - - describe('list', () => { - it('Sends the correct request', () => { - stripe.skus.list({ - limit: 3, - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/skus?limit=3', - data: {}, - headers: {}, - settings: {}, - }); - }); - - it('Supports filtering by product', () => { - stripe.skus.list({ - product: 'prodId123', - }); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'GET', - url: '/v1/skus?product=prodId123', - data: {}, - headers: {}, - settings: {}, - }); - }); - }); - - describe('update', () => { - it('Sends the correct request', () => { - stripe.skus.update('skuIdFoo3242', {caption: 'test'}); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'POST', - url: '/v1/skus/skuIdFoo3242', - headers: {}, - data: {caption: 'test'}, - settings: {}, - }); - }); - }); - - describe('del', () => { - it('Sends the correct request', () => { - stripe.skus.del('skuIdFoo3242'); - expect(stripe.LAST_REQUEST).to.deep.equal({ - method: 'DELETE', - url: '/v1/skus/skuIdFoo3242', - headers: {}, - data: {}, - settings: {}, - }); - }); - }); -}); diff --git a/test/resources/generated_examples_test.spec.js b/test/resources/generated_examples_test.spec.js index 526d209001..d51bcf971a 100644 --- a/test/resources/generated_examples_test.spec.js +++ b/test/resources/generated_examples_test.spec.js @@ -2270,41 +2270,6 @@ describe('Sigma.ScheduledQueryRun', function() { }); }); -describe('Sku', function() { - it('list method', async function() { - const skus = await stripe.skus.list({limit: 3}); - expect(skus).not.to.be.null; - }); - - it('create method', async function() { - const sku = await stripe.skus.create({ - attributes: {size: 'Medium', gender: 'Unisex'}, - price: 1500, - currency: 'usd', - inventory: {type: 'finite', quantity: 500}, - product: 'prod_xxxxxxxxxxxxx', - }); - expect(sku).not.to.be.null; - }); - - it('del method', async function() { - const deleted = await stripe.skus.del('sku_xxxxxxxxxxxxx'); - expect(deleted).not.to.be.null; - }); - - it('retrieve method', async function() { - const sku = await stripe.skus.retrieve('sku_xxxxxxxxxxxxx'); - expect(sku).not.to.be.null; - }); - - it('update method', async function() { - const sku = await stripe.skus.update('sku_xxxxxxxxxxxxx', { - metadata: {order_id: '6735'}, - }); - expect(sku).not.to.be.null; - }); -}); - describe('Source', function() { it('retrieve method', async function() { const source = await stripe.sources.retrieve('src_xxxxxxxxxxxxx'); diff --git a/test/stripe.spec.js b/test/stripe.spec.js index c2111b39b1..f3d4c3b9c4 100644 --- a/test/stripe.spec.js +++ b/test/stripe.spec.js @@ -111,8 +111,8 @@ describe('Stripe Module', function() { }); cases.forEach((item) => { - const stripe = Stripe(testUtils.getUserStripeKey(), item); - expect(stripe.getApiField('version')).to.equal(null); + const newStripe = Stripe(testUtils.getUserStripeKey(), item); + expect(newStripe.getApiField('version')).to.equal(null); }); }); @@ -178,22 +178,22 @@ describe('Stripe Module', function() { it('Should include whether typescript: true was passed, respecting reinstantiations', () => { return new Promise((resolve) => resolve()) .then(() => { - const stripe = new Stripe('sk_test_123', { + const newStripe = new Stripe('sk_test_123', { typescript: true, }); return expect( new Promise((resolve, reject) => { - stripe.getClientUserAgent((c) => { + newStripe.getClientUserAgent((c) => { resolve(JSON.parse(c)); }); }) ).to.eventually.have.property('typescript', 'true'); }) .then(() => { - const stripe = new Stripe('sk_test_123', {}); + const newStripe = new Stripe('sk_test_123', {}); return expect( new Promise((resolve, reject) => { - stripe.getClientUserAgent((c) => { + newStripe.getClientUserAgent((c) => { resolve(JSON.parse(c)); }); }) @@ -276,25 +276,28 @@ describe('Stripe Module', function() { }); }); - describe('setTimeout', () => { + describe('timeout config', () => { const defaultTimeout = 80000; it('Should define a default of 80000', () => { expect(stripe.getApiField('timeout')).to.equal(defaultTimeout); }); it('Should allow me to set a custom timeout', () => { - stripe.setTimeout(900); - expect(stripe.getApiField('timeout')).to.equal(900); + const newStripe = Stripe('sk_test', { + timeout: 900, + }); + expect(newStripe.getApiField('timeout')).to.equal(900); }); it('Should allow me to set null, to reset to the default', () => { - stripe.setTimeout(null); - expect(stripe.getApiField('timeout')).to.equal(defaultTimeout); + const newStripe = Stripe('sk_test', { + timeout: null, + }); + expect(newStripe.getApiField('timeout')).to.equal(defaultTimeout); }); }); - describe('setAppInfo', () => { + describe('appInfo config', () => { describe('when given nothing or an empty object', () => { it('should unset stripe._appInfo', () => { - stripe.setAppInfo(); expect(stripe._appInfo).to.be.undefined; }); }); @@ -308,7 +311,9 @@ describe('Stripe Module', function() { describe('when given a non-object variable', () => { it('should throw an error', () => { expect(() => { - stripe.setAppInfo('foo'); + Stripe('sk_test', { + appInfo: 'foo', + }); }).to.throw(/AppInfo must be an object./); }); }); @@ -316,18 +321,24 @@ describe('Stripe Module', function() { describe('when given an object with no `name`', () => { it('should throw an error', () => { expect(() => { - stripe.setAppInfo({}); + Stripe('sk_test', { + appInfo: {}, + }); }).to.throw(/AppInfo.name is required/); expect(() => { - stripe.setAppInfo({ - version: '1.2.3', + Stripe('sk_test', { + appInfo: { + version: '1.2.3', + }, }); }).to.throw(/AppInfo.name is required/); expect(() => { - stripe.setAppInfo({ - cats: '42', + Stripe('sk_test', { + appInfo: { + cats: '42', + }, }); }).to.throw(/AppInfo.name is required/); }); @@ -335,50 +346,60 @@ describe('Stripe Module', function() { describe('when given at least a `name`', () => { it('should set name, partner ID, url, and version of stripe._appInfo', () => { - stripe.setAppInfo({ - name: 'MyAwesomeApp', + let newStripe = Stripe('sk_test', { + appInfo: { + name: 'MyAwesomeApp', + }, }); - expect(stripe._appInfo).to.eql({ + expect(newStripe._appInfo).to.eql({ name: 'MyAwesomeApp', }); - stripe.setAppInfo({ - name: 'MyAwesomeApp', - version: '1.2.345', + newStripe = Stripe('sk_test', { + appInfo: { + name: 'MyAwesomeApp', + version: '1.2.345', + }, }); - expect(stripe._appInfo).to.eql({ + expect(newStripe._appInfo).to.eql({ name: 'MyAwesomeApp', version: '1.2.345', }); - stripe.setAppInfo({ - name: 'MyAwesomeApp', - url: 'https://myawesomeapp.info', + newStripe = Stripe('sk_test', { + appInfo: { + name: 'MyAwesomeApp', + url: 'https://myawesomeapp.info', + }, }); - expect(stripe._appInfo).to.eql({ + expect(newStripe._appInfo).to.eql({ name: 'MyAwesomeApp', url: 'https://myawesomeapp.info', }); - stripe.setAppInfo({ - name: 'MyAwesomeApp', - partner_id: 'partner_1234', + newStripe = Stripe('sk_test', { + appInfo: { + name: 'MyAwesomeApp', + partner_id: 'partner_1234', + }, }); - expect(stripe._appInfo).to.eql({ + expect(newStripe._appInfo).to.eql({ name: 'MyAwesomeApp', partner_id: 'partner_1234', }); }); it('should ignore any invalid properties', () => { - stripe.setAppInfo({ - name: 'MyAwesomeApp', - partner_id: 'partner_1234', - version: '1.2.345', - url: 'https://myawesomeapp.info', - countOfRadishes: 512, + const newStripe = Stripe('sk_test', { + appInfo: { + name: 'MyAwesomeApp', + partner_id: 'partner_1234', + version: '1.2.345', + url: 'https://myawesomeapp.info', + countOfRadishes: 512, + }, }); - expect(stripe._appInfo).to.eql({ + expect(newStripe._appInfo).to.eql({ name: 'MyAwesomeApp', partner_id: 'partner_1234', version: '1.2.345', @@ -394,12 +415,14 @@ describe('Stripe Module', function() { url: 'https://myawesomeapp.info', }; - stripe.setAppInfo(appInfo); + const newStripe = Stripe('sk_test', { + appInfo, + }); - stripe.getClientUserAgent((uaString) => { + newStripe.getClientUserAgent((uaString) => { expect(JSON.parse(uaString).application).to.eql(appInfo); - expect(stripe.getAppInfoAsString()).to.eql( + expect(newStripe.getAppInfoAsString()).to.eql( `${appInfo.name}/${appInfo.version} (${appInfo.url})` ); @@ -496,7 +519,6 @@ describe('Stripe Module', function() { describe('errors', () => { it('Exports errors as types', () => { - const Stripe = require('../lib/stripe'); expect( new Stripe.errors.StripeInvalidRequestError({ message: 'error', diff --git a/test/telemetry.spec.js b/test/telemetry.spec.js index f408c92c60..c73650ac34 100644 --- a/test/telemetry.spec.js +++ b/test/telemetry.spec.js @@ -58,10 +58,14 @@ describe('Client Telemetry', () => { }, (host, port) => { const stripe = require('../lib/stripe')( - 'sk_test_FEiILxKZwnmmocJDUjUNO6pa' + 'sk_test_FEiILxKZwnmmocJDUjUNO6pa', + { + telemetry: false, + host, + port, + protocol: 'http', + } ); - stripe.setTelemetryEnabled(false); - stripe.setHost(host, port, 'http'); stripe.balance .retrieve() @@ -104,10 +108,14 @@ describe('Client Telemetry', () => { }, (host, port) => { const stripe = require('../lib/stripe')( - 'sk_test_FEiILxKZwnmmocJDUjUNO6pa' + 'sk_test_FEiILxKZwnmmocJDUjUNO6pa', + { + telemetry: true, + host, + port, + protocol: 'http', + } ); - stripe.setTelemetryEnabled(true); - stripe.setHost(host, port, 'http'); stripe.balance .retrieve() @@ -152,10 +160,14 @@ describe('Client Telemetry', () => { }, (host, port) => { const stripe = require('../lib/stripe')( - 'sk_test_FEiILxKZwnmmocJDUjUNO6pa' + 'sk_test_FEiILxKZwnmmocJDUjUNO6pa', + { + telemetry: true, + host, + port, + protocol: 'http', + } ); - stripe.setTelemetryEnabled(true); - stripe.setHost(host, port, 'http'); Promise.all([stripe.balance.retrieve(), stripe.balance.retrieve()]) .then(() => diff --git a/test/utils.spec.js b/test/utils.spec.js index 91a6e1f9f9..5162f5dcbf 100644 --- a/test/utils.spec.js +++ b/test/utils.spec.js @@ -309,91 +309,6 @@ describe('utils', () => { }); }); - it('parses snake case for backwards compatibility', () => { - return new Promise((resolve, reject) => { - const args = [ - { - api_key: 'sk_test_iiiiiiiiiiiiiiiiiiiiiiii', - idempotency_key: 'key', - stripe_account: 'acct_123', - stripe_version: '2019-08-08', - }, - ]; - const desiredWarnings = [ - "Stripe: 'api_key' is deprecated; use 'apiKey' instead.", - "Stripe: 'idempotency_key' is deprecated; use 'idempotencyKey' instead.", - "Stripe: 'stripe_account' is deprecated; use 'stripeAccount' instead.", - "Stripe: 'stripe_version' is deprecated; use 'apiVersion' instead.", - ]; - - const warnings = []; - const onWarn = (message) => { - warnings.push(message); - if (warnings.length === desiredWarnings.length) { - expect(warnings).to.deep.equal(desiredWarnings); - resolve(); - } - }; - handleWarnings(() => { - expect(utils.getOptionsFromArgs(args)).to.deep.equal({ - auth: 'sk_test_iiiiiiiiiiiiiiiiiiiiiiii', - headers: { - 'Idempotency-Key': 'key', - 'Stripe-Version': '2019-08-08', - 'Stripe-Account': 'acct_123', - }, - settings: {}, - }); - }, onWarn); - }); - }); - - it('parses stripeVersion for backwards compatibility', () => { - return new Promise((resolve, reject) => { - const args = [ - { - apiKey: 'sk_test_iiiiiiiiiiiiiiiiiiiiiiii', - stripeVersion: '2019-08-08', - }, - ]; - const desiredWarnings = [ - "Stripe: 'stripeVersion' is deprecated; use 'apiVersion' instead.", - ]; - - const warnings = []; - const onWarn = (message) => { - warnings.push(message); - if (warnings.length === desiredWarnings.length) { - expect(warnings).to.deep.equal(desiredWarnings); - resolve(); - } - }; - handleWarnings(() => { - expect(utils.getOptionsFromArgs(args)).to.deep.equal({ - auth: 'sk_test_iiiiiiiiiiiiiiiiiiiiiiii', - headers: { - 'Stripe-Version': '2019-08-08', - }, - settings: {}, - }); - }, onWarn); - }); - }); - - it('errors if you pass both a deprecated and non-deprecated version of the same param', () => { - const args = [ - { - stripeVersion: 'bad', - apiVersion: 'good', - }, - ]; - expect(() => { - utils.getOptionsFromArgs(args); - }).to.throw( - "Both 'apiVersion' and 'stripeVersion' were provided; please remove 'stripeVersion', which is deprecated." - ); - }); - it('warns if the hash contains something that does not belong', (done) => { const args = [ {foo: 'bar'}, diff --git a/testUtils/index.js b/testUtils/index.js index f527a44765..4e090fc4c1 100644 --- a/testUtils/index.js +++ b/testUtils/index.js @@ -58,12 +58,12 @@ const utils = (module.exports = { return key; }, - getSpyableStripe: () => { + getSpyableStripe: (config) => { // Provide a testable stripe instance // That is, with mock-requests built in and hookable const stripe = require('../lib/stripe'); - const stripeInstance = stripe('fakeAuthToken'); + const stripeInstance = stripe('fakeAuthToken', config); stripeInstance.REQUESTS = []; diff --git a/types/2022-08-01/Orders.d.ts b/types/2022-08-01/Orders.d.ts deleted file mode 100644 index 06dd2e9034..0000000000 --- a/types/2022-08-01/Orders.d.ts +++ /dev/null @@ -1,3356 +0,0 @@ -// File generated from our OpenAPI spec - -declare module 'stripe' { - namespace Stripe { - /** - * An Order describes a purchase being made by a customer, including the - * products & quantities being purchased, the order status, the payment information, - * and the billing/shipping details. - * - * Related guide: [Orders overview](https://stripe.com/docs/orders) - */ - interface Order { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'order'; - - /** - * Order cost before any discounts or taxes are applied. A positive integer representing the subtotal of the order in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - */ - amount_subtotal: number; - - /** - * Total order cost after discounts and taxes are applied. A positive integer representing the cost of the order in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). To submit an order, the total must be either 0 or at least $0.50 USD or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). - */ - amount_total: number; - - /** - * ID of the Connect application that created the Order, if any. - */ - application: string | Stripe.Application | null; - - automatic_tax?: Order.AutomaticTax; - - /** - * Customer billing details associated with the order. - */ - billing_details: Order.BillingDetails | null; - - /** - * The client secret of this Order. Used for client-side retrieval using a publishable key. - * - * The client secret can be used to complete a payment for an Order from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret. - * - * Refer to our docs for [creating and processing an order](https://stripe.com/docs/orders-beta/create-and-process) to learn about how client_secret should be handled. - */ - client_secret: string | null; - - /** - * Time at which the object was created. Measured in seconds since the Unix epoch. - */ - created: number; - - /** - * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). - */ - currency: string; - - /** - * The customer which this orders belongs to. - */ - customer: string | Stripe.Customer | Stripe.DeletedCustomer | null; - - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description: string | null; - - /** - * The discounts applied to the order. Use `expand[]=discounts` to expand each discount. - */ - discounts: Array | null; - - /** - * A recent IP address of the purchaser used for tax reporting and tax location inference. - */ - ip_address: string | null; - - /** - * A list of line items the customer is ordering. Each line item includes information about the product, the quantity, and the resulting cost. There is a maximum of 100 line items. - */ - line_items?: ApiList; - - /** - * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - */ - livemode: boolean; - - /** - * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - */ - metadata: Stripe.Metadata | null; - - payment: Order.Payment; - - /** - * The details of the customer cost of shipping, including the customer chosen ShippingRate. - */ - shipping_cost: Order.ShippingCost | null; - - /** - * Customer shipping information associated with the order. - */ - shipping_details: Order.ShippingDetails | null; - - /** - * The overall status of the order. - */ - status: Order.Status; - - tax_details?: Order.TaxDetails; - - total_details: Order.TotalDetails; - } - - namespace Order { - interface AutomaticTax { - /** - * Whether Stripe automatically computes tax on this Order. - */ - enabled: boolean; - - /** - * The status of the most recent automated tax calculation for this Order. - */ - status: AutomaticTax.Status | null; - } - - namespace AutomaticTax { - type Status = 'complete' | 'failed' | 'requires_location_inputs'; - } - - interface BillingDetails { - /** - * Billing address for the order. - */ - address: Stripe.Address | null; - - /** - * Email address for the order. - */ - email: string | null; - - /** - * Full name for the order. - */ - name: string | null; - - /** - * Billing phone number for the order (including extension). - */ - phone: string | null; - } - - interface Payment { - /** - * ID of the payment intent associated with this order. Null when the order is `open`. - */ - payment_intent: string | Stripe.PaymentIntent | null; - - /** - * Settings describing how the order should configure generated PaymentIntents. - */ - settings: Payment.Settings | null; - - /** - * The status of the underlying payment associated with this order, if any. Null when the order is `open`. - */ - status: Payment.Status | null; - } - - namespace Payment { - interface Settings { - /** - * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. - */ - application_fee_amount: number | null; - - /** - * Indicates whether order has been opted into using [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods) to manage payment method types. - */ - automatic_payment_methods: Settings.AutomaticPaymentMethods | null; - - /** - * PaymentMethod-specific configuration to provide to the order's PaymentIntent. - */ - payment_method_options: Settings.PaymentMethodOptions | null; - - /** - * The list of [payment method types](https://stripe.com/docs/payments/payment-methods/overview) to provide to the order's PaymentIntent. Do not include this attribute if you prefer to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). - */ - payment_method_types: Array | null; - - /** - * The URL to redirect the customer to after they authenticate their payment. - */ - return_url: string | null; - - /** - * For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. - */ - statement_descriptor: string | null; - - /** - * Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. - */ - statement_descriptor_suffix: string | null; - - /** - * Provides configuration for completing a transfer for the order after it is paid. - */ - transfer_data: Settings.TransferData | null; - } - - namespace Settings { - interface AutomaticPaymentMethods { - /** - * Whether this Order has been opted into managing payment method types via the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). - */ - enabled: boolean; - } - - interface PaymentMethodOptions { - acss_debit?: PaymentMethodOptions.AcssDebit; - - afterpay_clearpay?: PaymentMethodOptions.AfterpayClearpay; - - alipay?: PaymentMethodOptions.Alipay; - - bancontact?: PaymentMethodOptions.Bancontact; - - card?: PaymentMethodOptions.Card; - - customer_balance?: PaymentMethodOptions.CustomerBalance; - - ideal?: PaymentMethodOptions.Ideal; - - klarna?: PaymentMethodOptions.Klarna; - - link?: PaymentMethodOptions.Link; - - oxxo?: PaymentMethodOptions.Oxxo; - - p24?: PaymentMethodOptions.P24; - - paypal?: PaymentMethodOptions.Paypal; - - sepa_debit?: PaymentMethodOptions.SepaDebit; - - sofort?: PaymentMethodOptions.Sofort; - - wechat_pay?: PaymentMethodOptions.WechatPay; - } - - namespace PaymentMethodOptions { - interface AcssDebit { - mandate_options?: AcssDebit.MandateOptions; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: AcssDebit.SetupFutureUsage; - - /** - * Bank account verification method. - */ - verification_method?: AcssDebit.VerificationMethod; - } - - namespace AcssDebit { - interface MandateOptions { - /** - * A URL for custom mandate text - */ - custom_mandate_url?: string; - - /** - * Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. - */ - interval_description: string | null; - - /** - * Payment schedule for the mandate. - */ - payment_schedule: MandateOptions.PaymentSchedule | null; - - /** - * Transaction type of the mandate. - */ - transaction_type: MandateOptions.TransactionType | null; - } - - namespace MandateOptions { - type PaymentSchedule = 'combined' | 'interval' | 'sporadic'; - - type TransactionType = 'business' | 'personal'; - } - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - - type VerificationMethod = - | 'automatic' - | 'instant' - | 'microdeposits'; - } - - interface AfterpayClearpay { - /** - * Controls when the funds will be captured from the customer's account. - */ - capture_method?: AfterpayClearpay.CaptureMethod; - - /** - * Order identifier shown to the user in Afterpay's online portal. We recommend using a value that helps you answer any questions a customer might have about the payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. - */ - reference: string | null; - - /** - * Indicates that you intend to make future payments with the payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - namespace AfterpayClearpay { - type CaptureMethod = 'automatic' | 'manual'; - } - - interface Alipay { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: Alipay.SetupFutureUsage; - } - - namespace Alipay { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Bancontact { - /** - * Preferred language of the Bancontact authorization page that the customer is redirected to. - */ - preferred_language: Bancontact.PreferredLanguage; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: Bancontact.SetupFutureUsage; - } - - namespace Bancontact { - type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; - - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Card { - /** - * Controls when the funds will be captured from the customer's account. - */ - capture_method: Card.CaptureMethod; - - /** - * Indicates that you intend to make future payments with the payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Card.SetupFutureUsage; - } - - namespace Card { - type CaptureMethod = 'automatic' | 'manual'; - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface CustomerBalance { - bank_transfer?: CustomerBalance.BankTransfer; - - /** - * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. - */ - funding_type: 'bank_transfer' | null; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - namespace CustomerBalance { - interface BankTransfer { - eu_bank_transfer?: BankTransfer.EuBankTransfer; - - /** - * List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. - * - * Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. - */ - requested_address_types?: Array< - BankTransfer.RequestedAddressType - >; - - /** - * The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. - */ - type: BankTransfer.Type | null; - } - - namespace BankTransfer { - interface EuBankTransfer { - /** - * The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. - */ - country: EuBankTransfer.Country; - } - - namespace EuBankTransfer { - type Country = 'DE' | 'ES' | 'FR' | 'IE' | 'NL'; - } - - type RequestedAddressType = - | 'iban' - | 'sepa' - | 'sort_code' - | 'spei' - | 'zengin'; - - type Type = - | 'eu_bank_transfer' - | 'gb_bank_transfer' - | 'jp_bank_transfer' - | 'mx_bank_transfer'; - } - } - - interface Ideal { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: Ideal.SetupFutureUsage; - } - - namespace Ideal { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Klarna { - /** - * Controls when the funds will be captured from the customer's account. - */ - capture_method?: 'manual'; - - /** - * Preferred locale of the Klarna checkout page that the customer is redirected to. - */ - preferred_locale: string | null; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface Link { - /** - * Controls when the funds will be captured from the customer's account. - */ - capture_method?: 'manual'; - - /** - * Token used for persistent Link logins. - */ - persistent_token: string | null; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: Link.SetupFutureUsage; - } - - namespace Link { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Oxxo { - /** - * The number of calendar days before an OXXO invoice expires. For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. - */ - expires_after_days: number; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface P24 { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - interface Paypal { - /** - * Controls when the funds will be captured from the customer's account. - */ - capture_method?: 'manual'; - - /** - * Preferred locale of the PayPal checkout page that the customer is redirected to. - */ - preferred_locale: string | null; - } - - interface SepaDebit { - mandate_options?: SepaDebit.MandateOptions; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: SepaDebit.SetupFutureUsage; - } - - namespace SepaDebit { - interface MandateOptions {} - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface Sofort { - /** - * Preferred language of the SOFORT authorization page that the customer is redirected to. - */ - preferred_language: Sofort.PreferredLanguage | null; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: Sofort.SetupFutureUsage; - } - - namespace Sofort { - type PreferredLanguage = - | 'de' - | 'en' - | 'es' - | 'fr' - | 'it' - | 'nl' - | 'pl'; - - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface WechatPay { - /** - * The app ID registered with WeChat Pay. Only required when client is ios or android. - */ - app_id: string | null; - - /** - * The client type that the end customer will pay from - */ - client: WechatPay.Client | null; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - */ - setup_future_usage?: 'none'; - } - - namespace WechatPay { - type Client = 'android' | 'ios' | 'web'; - } - } - - type PaymentMethodType = - | 'acss_debit' - | 'afterpay_clearpay' - | 'alipay' - | 'au_becs_debit' - | 'bacs_debit' - | 'bancontact' - | 'card' - | 'customer_balance' - | 'eps' - | 'fpx' - | 'giropay' - | 'grabpay' - | 'ideal' - | 'klarna' - | 'link' - | 'oxxo' - | 'p24' - | 'sepa_debit' - | 'sofort' - | 'wechat_pay'; - - interface TransferData { - /** - * The amount that will be transferred automatically when the order is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. - */ - amount: number | null; - - /** - * ID of the Connected account receiving the transfer. - */ - destination: string | Stripe.Account; - } - } - - type Status = - | 'canceled' - | 'complete' - | 'not_required' - | 'processing' - | 'requires_action' - | 'requires_capture' - | 'requires_confirmation' - | 'requires_payment_method'; - } - - interface ShippingCost { - /** - * Total shipping cost before any discounts or taxes are applied. - */ - amount_subtotal: number; - - /** - * Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0. - */ - amount_tax: number; - - /** - * Total shipping cost after discounts and taxes are applied. - */ - amount_total: number; - - /** - * The ID of the ShippingRate for this order. - */ - shipping_rate: string | Stripe.ShippingRate | null; - - /** - * The taxes applied to the shipping rate. - */ - taxes?: Array; - } - - namespace ShippingCost { - interface Tax { - /** - * Amount of tax applied for this rate. - */ - amount: number; - - /** - * Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. - * - * Related guide: [Tax Rates](https://stripe.com/docs/billing/taxes/tax-rates). - */ - rate: Stripe.TaxRate; - } - } - - interface ShippingDetails { - /** - * Recipient shipping address. Required if the order includes products that are shippable. - */ - address: Stripe.Address | null; - - /** - * Recipient name. - */ - name: string | null; - - /** - * Recipient phone (including extension). - */ - phone: string | null; - } - - type Status = - | 'canceled' - | 'complete' - | 'open' - | 'processing' - | 'submitted'; - - interface TaxDetails { - /** - * Describes the purchaser's tax exemption status. One of `none`, `exempt`, or `reverse`. - */ - tax_exempt: TaxDetails.TaxExempt; - - /** - * The purchaser's tax IDs to be used in calculation of tax for this Order. - */ - tax_ids: Array; - } - - namespace TaxDetails { - type TaxExempt = 'exempt' | 'none' | 'reverse'; - - interface TaxId { - /** - * The type of the tax ID, one of `eu_vat`, `br_cnpj`, `br_cpf`, `eu_oss_vat`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown` - */ - type: TaxId.Type; - - /** - * The value of the tax ID. - */ - value: string | null; - } - - namespace TaxId { - type Type = - | 'ae_trn' - | 'au_abn' - | 'au_arn' - | 'bg_uic' - | 'br_cnpj' - | 'br_cpf' - | 'ca_bn' - | 'ca_gst_hst' - | 'ca_pst_bc' - | 'ca_pst_mb' - | 'ca_pst_sk' - | 'ca_qst' - | 'ch_vat' - | 'cl_tin' - | 'eg_tin' - | 'es_cif' - | 'eu_oss_vat' - | 'eu_vat' - | 'gb_vat' - | 'ge_vat' - | 'hk_br' - | 'hu_tin' - | 'id_npwp' - | 'il_vat' - | 'in_gst' - | 'is_vat' - | 'jp_cn' - | 'jp_rn' - | 'jp_trn' - | 'ke_pin' - | 'kr_brn' - | 'li_uid' - | 'mx_rfc' - | 'my_frp' - | 'my_itn' - | 'my_sst' - | 'no_vat' - | 'nz_gst' - | 'ph_tin' - | 'ru_inn' - | 'ru_kpp' - | 'sa_vat' - | 'sg_gst' - | 'sg_uen' - | 'si_tin' - | 'th_vat' - | 'tr_tin' - | 'tw_vat' - | 'ua_vat' - | 'unknown' - | 'us_ein' - | 'za_vat'; - } - } - - interface TotalDetails { - /** - * This is the sum of all the discounts. - */ - amount_discount: number; - - /** - * This is the sum of all the shipping amounts. - */ - amount_shipping: number | null; - - /** - * This is the sum of all the tax amounts. - */ - amount_tax: number; - - breakdown?: TotalDetails.Breakdown; - } - - namespace TotalDetails { - interface Breakdown { - /** - * The aggregated discounts. - */ - discounts: Array; - - /** - * The aggregated tax amounts by rate. - */ - taxes: Array; - } - - namespace Breakdown { - interface Discount { - /** - * The amount discounted. - */ - amount: number; - - /** - * A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes). - * It contains information about when the discount began, when it will end, and what it is applied to. - * - * Related guide: [Applying Discounts to Subscriptions](https://stripe.com/docs/billing/subscriptions/discounts). - */ - discount: Stripe.Discount; - } - - interface Tax { - /** - * Amount of tax applied for this rate. - */ - amount: number; - - /** - * Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. - * - * Related guide: [Tax Rates](https://stripe.com/docs/billing/taxes/tax-rates). - */ - rate: Stripe.TaxRate; - } - } - } - } - - interface OrderCreateParams { - /** - * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). - */ - currency: string; - - /** - * A list of line items the customer is ordering. Each line item includes information about the product, the quantity, and the resulting cost. - */ - line_items: Array; - - /** - * Settings for automatic tax calculation for this order. - */ - automatic_tax?: OrderCreateParams.AutomaticTax; - - /** - * Billing details for the customer. If a customer is provided, this will be automatically populated with values from that customer if override values are not provided. - */ - billing_details?: Stripe.Emptyable; - - /** - * The customer associated with this order. - */ - customer?: string; - - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description?: string; - - /** - * The coupons, promotion codes, and/or discounts to apply to the order. - */ - discounts?: Stripe.Emptyable>; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The IP address of the purchaser for this order. - */ - ip_address?: string; - - /** - * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. - */ - metadata?: Stripe.MetadataParam; - - /** - * Payment information associated with the order, including payment settings. - */ - payment?: OrderCreateParams.Payment; - - /** - * Settings for the customer cost of shipping for this order. - */ - shipping_cost?: Stripe.Emptyable; - - /** - * Shipping details for the order. - */ - shipping_details?: Stripe.Emptyable; - - /** - * Additional tax details about the purchaser to be used for this order. - */ - tax_details?: OrderCreateParams.TaxDetails; - } - - namespace OrderCreateParams { - interface AutomaticTax { - /** - * Enable automatic tax calculation which will automatically compute tax rates on this order. - */ - enabled: boolean; - } - - interface BillingDetails { - /** - * The billing address provided by the customer. - */ - address?: Stripe.AddressParam; - - /** - * The billing email provided by the customer. - */ - email?: string; - - /** - * The billing name provided by the customer. - */ - name?: string; - - /** - * The billing phone number provided by the customer. - */ - phone?: string; - } - - interface Discount { - /** - * ID of the coupon to create a new discount for. - */ - coupon?: string; - - /** - * ID of an existing discount on the object (or one of its ancestors) to reuse. - */ - discount?: string; - - /** - * ID of the promotion code to create a new discount for. - */ - promotion_code?: string; - } - - interface LineItem { - /** - * The description for the line item. Will default to the name of the associated product. - */ - description?: string; - - /** - * The discounts applied to this line item. - */ - discounts?: Stripe.Emptyable>; - - /** - * The ID of a [Price](https://stripe.com/docs/api/prices) to add to the Order. - * - * The `price` parameter is an alternative to using the `product` parameter. If each of your products are sold at a single price, you can set `Product.default_price` and then pass the `product` parameter when creating a line item. If your products are sold at several possible prices, use the `price` parameter to explicitly specify which one to use. - */ - price?: string; - - /** - * Data used to generate a new Price object inline. - * - * The `price_data` parameter is an alternative to using the `product` or `price` parameters. If you create products upfront and configure a `Product.default_price`, pass the `product` parameter when creating a line item. If you prefer not to define products upfront, or if you charge variable prices, pass the `price_data` parameter to describe the price for this line item. - * - * Each time you pass `price_data` we create a Price for the product. This Price is hidden in both the Dashboard and API lists and cannot be reused. - */ - price_data?: LineItem.PriceData; - - /** - * The ID of a [Product](https://stripe.com/docs/api/products) to add to the Order. - * - * The product must have a `default_price` specified. Otherwise, specify the price by passing the `price` or `price_data` parameter. - */ - product?: string; - - /** - * Defines a Product inline and adds it to the Order. - * - * `product_data` is an alternative to the `product` parameter. If you created a Product upfront, use the `product` parameter to refer to the existing Product. But if you prefer not to create Products upfront, pass the `product_data` parameter to define a Product inline as part of configuring the Order. - * - * `product_data` automatically creates a Product, just as if you had manually created the Product. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates. - */ - product_data?: LineItem.ProductData; - - /** - * The quantity of the line item. - */ - quantity?: number; - - /** - * The tax rates applied to this line item. - */ - tax_rates?: Stripe.Emptyable>; - } - - namespace LineItem { - interface Discount { - /** - * ID of the coupon to create a new discount for. - */ - coupon?: string; - - /** - * ID of an existing discount on the object (or one of its ancestors) to reuse. - */ - discount?: string; - } - - interface PriceData { - /** - * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). - */ - currency?: string; - - /** - * ID of the product this price belongs to. - * - * Use this to implement a variable-pricing model in your integration. This is required if `product_data` is not specifed. - */ - product?: string; - - /** - * Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - */ - tax_behavior?: PriceData.TaxBehavior; - - /** - * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - */ - unit_amount?: number; - - /** - * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - */ - unit_amount_decimal?: string; - } - - namespace PriceData { - type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; - } - - interface ProductData { - /** - * The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. - */ - description?: string; - - /** - * A unique identifier for this product. - * - * `product_data` automatically creates a Product with this ID. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates. If any of the fields in the existing Product are different from the values in `product_data`, `product_data` updates the existing Product with the new information. So set `product_data[id]` to the same string every time you sell the same product, but don't re-use the same string for different products. - */ - id: string; - - /** - * A list of up to 8 URLs of images for this product, meant to be displayable to the customer. - */ - images?: Stripe.Emptyable>; - - /** - * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. - */ - metadata?: Stripe.Emptyable; - - /** - * The product's name, meant to be displayable to the customer. - */ - name: string; - - /** - * The dimensions of this product for shipping purposes. - */ - package_dimensions?: Stripe.Emptyable; - - /** - * Whether this product is shipped (i.e., physical goods). - */ - shippable?: boolean; - - /** - * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - */ - tax_code?: string; - - /** - * A URL of a publicly-accessible webpage for this product. - */ - url?: Stripe.Emptyable; - } - - namespace ProductData { - interface PackageDimensions { - /** - * Height, in inches. Maximum precision is 2 decimal places. - */ - height: number; - - /** - * Length, in inches. Maximum precision is 2 decimal places. - */ - length: number; - - /** - * Weight, in ounces. Maximum precision is 2 decimal places. - */ - weight: number; - - /** - * Width, in inches. Maximum precision is 2 decimal places. - */ - width: number; - } - } - } - - interface Payment { - /** - * Settings describing how the order should configure generated PaymentIntents. - */ - settings: Payment.Settings; - } - - namespace Payment { - interface Settings { - /** - * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. - */ - application_fee_amount?: number; - - /** - * PaymentMethod-specific configuration to provide to the order's PaymentIntent. - */ - payment_method_options?: Settings.PaymentMethodOptions; - - /** - * The list of [payment method types](https://stripe.com/docs/payments/payment-methods/overview) to provide to the order's PaymentIntent. Do not include this attribute if you prefer to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). - */ - payment_method_types?: Array; - - /** - * The URL to redirect the customer to after they authenticate their payment. - */ - return_url?: string; - - /** - * For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. - */ - statement_descriptor?: string; - - /** - * Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. - */ - statement_descriptor_suffix?: string; - - /** - * Provides configuration for completing a transfer for the order after it is paid. - */ - transfer_data?: Settings.TransferData; - } - - namespace Settings { - interface PaymentMethodOptions { - /** - * If paying by `acss_debit`, this sub-hash contains details about the ACSS Debit payment method options to pass to the order's PaymentIntent. - */ - acss_debit?: PaymentMethodOptions.AcssDebit; - - /** - * If paying by `afterpay_clearpay`, this sub-hash contains details about the AfterpayClearpay payment method options to pass to the order's PaymentIntent. - */ - afterpay_clearpay?: PaymentMethodOptions.AfterpayClearpay; - - /** - * If paying by `alipay`, this sub-hash contains details about the Alipay payment method options to pass to the order's PaymentIntent. - */ - alipay?: PaymentMethodOptions.Alipay; - - /** - * If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the order's PaymentIntent. - */ - bancontact?: PaymentMethodOptions.Bancontact; - - /** - * If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the order's PaymentIntent. - */ - card?: PaymentMethodOptions.Card; - - /** - * If paying by `customer_balance`, this sub-hash contains details about the Customer Balance payment method options to pass to the order's PaymentIntent. - */ - customer_balance?: PaymentMethodOptions.CustomerBalance; - - /** - * If paying by `ideal`, this sub-hash contains details about the iDEAL payment method options to pass to the order's PaymentIntent. - */ - ideal?: PaymentMethodOptions.Ideal; - - /** - * If paying by `klarna`, this sub-hash contains details about the Klarna payment method options to pass to the order's PaymentIntent. - */ - klarna?: PaymentMethodOptions.Klarna; - - /** - * If paying by `link`, this sub-hash contains details about the Link payment method options to pass to the order's PaymentIntent. - */ - link?: PaymentMethodOptions.Link; - - /** - * If paying by `oxxo`, this sub-hash contains details about the OXXO payment method options to pass to the order's PaymentIntent. - */ - oxxo?: PaymentMethodOptions.Oxxo; - - /** - * If paying by `p24`, this sub-hash contains details about the P24 payment method options to pass to the order's PaymentIntent. - */ - p24?: PaymentMethodOptions.P24; - - /** - * If paying by `sepa_debit`, this sub-hash contains details about the SEPA Debit payment method options to pass to the order's PaymentIntent. - */ - sepa_debit?: PaymentMethodOptions.SepaDebit; - - /** - * If paying by `sofort`, this sub-hash contains details about the Sofort payment method options to pass to the order's PaymentIntent. - */ - sofort?: PaymentMethodOptions.Sofort; - - /** - * If paying by `wechat_pay`, this sub-hash contains details about the WeChat Pay payment method options to pass to the order's PaymentIntent. - */ - wechat_pay?: PaymentMethodOptions.WechatPay; - } - - namespace PaymentMethodOptions { - interface AcssDebit { - /** - * Additional fields for Mandate creation - */ - mandate_options?: AcssDebit.MandateOptions; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - - /** - * Verification method for the intent - */ - verification_method?: AcssDebit.VerificationMethod; - } - - namespace AcssDebit { - interface MandateOptions { - /** - * A URL for custom mandate text to render during confirmation step. - * The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, - * or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. - */ - custom_mandate_url?: Stripe.Emptyable; - - /** - * Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. - */ - interval_description?: string; - - /** - * Payment schedule for the mandate. - */ - payment_schedule?: MandateOptions.PaymentSchedule; - - /** - * Transaction type of the mandate. - */ - transaction_type?: MandateOptions.TransactionType; - } - - namespace MandateOptions { - type PaymentSchedule = 'combined' | 'interval' | 'sporadic'; - - type TransactionType = 'business' | 'personal'; - } - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - - type VerificationMethod = - | 'automatic' - | 'instant' - | 'microdeposits'; - } - - interface AfterpayClearpay { - /** - * Controls when the funds will be captured from the customer's account. - * - * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - * - * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - */ - capture_method?: AfterpayClearpay.CaptureMethod; - - /** - * Order identifier shown to the customer in Afterpay's online portal. We recommend using a value that helps you answer any questions a customer might have about - * the payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. - */ - reference?: string; - - /** - * Indicates that you intend to make future payments with the payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - namespace AfterpayClearpay { - type CaptureMethod = 'automatic' | 'manual'; - } - - interface Alipay { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Alipay { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Bancontact { - /** - * Preferred language of the Bancontact authorization page that the customer is redirected to. - */ - preferred_language?: Bancontact.PreferredLanguage; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable< - Bancontact.SetupFutureUsage - >; - } - - namespace Bancontact { - type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; - - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Card { - /** - * Controls when the funds will be captured from the customer's account. - */ - capture_method?: Card.CaptureMethod; - - /** - * Indicates that you intend to make future payments with the payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Card.SetupFutureUsage; - } - - namespace Card { - type CaptureMethod = 'automatic' | 'manual'; - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface CustomerBalance { - /** - * Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. - */ - bank_transfer?: CustomerBalance.BankTransfer; - - /** - * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. - */ - funding_type?: 'bank_transfer'; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - namespace CustomerBalance { - interface BankTransfer { - eu_bank_transfer?: BankTransfer.EuBankTransfer; - - /** - * List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. - * - * Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. - */ - requested_address_types?: Array< - BankTransfer.RequestedAddressType - >; - - /** - * The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. - */ - type: BankTransfer.Type; - } - - namespace BankTransfer { - interface EuBankTransfer { - /** - * The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. - */ - country: string; - } - - type RequestedAddressType = - | 'iban' - | 'sepa' - | 'sort_code' - | 'spei' - | 'zengin'; - - type Type = - | 'eu_bank_transfer' - | 'gb_bank_transfer' - | 'jp_bank_transfer' - | 'mx_bank_transfer'; - } - } - - interface Ideal { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Ideal { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Klarna { - /** - * Controls when the funds will be captured from the customer's account. - * - * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - * - * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - */ - capture_method?: Stripe.Emptyable<'manual'>; - - /** - * Preferred language of the Klarna authorization page that the customer is redirected to - */ - preferred_locale?: Klarna.PreferredLocale; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - namespace Klarna { - type PreferredLocale = - | 'da-DK' - | 'de-AT' - | 'de-CH' - | 'de-DE' - | 'en-AT' - | 'en-AU' - | 'en-BE' - | 'en-CA' - | 'en-CH' - | 'en-DE' - | 'en-DK' - | 'en-ES' - | 'en-FI' - | 'en-FR' - | 'en-GB' - | 'en-IE' - | 'en-IT' - | 'en-NL' - | 'en-NO' - | 'en-NZ' - | 'en-PL' - | 'en-PT' - | 'en-SE' - | 'en-US' - | 'es-ES' - | 'es-US' - | 'fi-FI' - | 'fr-BE' - | 'fr-CA' - | 'fr-CH' - | 'fr-FR' - | 'it-CH' - | 'it-IT' - | 'nb-NO' - | 'nl-BE' - | 'nl-NL' - | 'pl-PL' - | 'pt-PT' - | 'sv-FI' - | 'sv-SE'; - } - - interface Link { - /** - * Controls when the funds will be captured from the customer's account. - * - * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - * - * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - */ - capture_method?: Stripe.Emptyable<'manual'>; - - /** - * Token used for persistent Link logins. - */ - persistent_token?: string; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Link { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Oxxo { - /** - * The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. - */ - expires_after_days?: number; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface P24 { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - - /** - * Confirm that the payer has accepted the P24 terms and conditions. - */ - tos_shown_and_accepted?: boolean; - } - - interface SepaDebit { - /** - * Additional fields for Mandate creation - */ - mandate_options?: SepaDebit.MandateOptions; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace SepaDebit { - interface MandateOptions {} - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface Sofort { - /** - * Language shown to the payer on redirect. - */ - preferred_language?: Stripe.Emptyable; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Sofort { - type PreferredLanguage = - | 'de' - | 'en' - | 'es' - | 'fr' - | 'it' - | 'nl' - | 'pl'; - - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface WechatPay { - /** - * The app ID registered with WeChat Pay. Only required when client is ios or android. - */ - app_id?: string; - - /** - * The client type that the end customer will pay from - */ - client: WechatPay.Client; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - namespace WechatPay { - type Client = 'android' | 'ios' | 'web'; - } - } - - type PaymentMethodType = - | 'acss_debit' - | 'afterpay_clearpay' - | 'alipay' - | 'au_becs_debit' - | 'bacs_debit' - | 'bancontact' - | 'card' - | 'customer_balance' - | 'eps' - | 'fpx' - | 'giropay' - | 'grabpay' - | 'ideal' - | 'klarna' - | 'link' - | 'oxxo' - | 'p24' - | 'sepa_debit' - | 'sofort' - | 'wechat_pay'; - - interface TransferData { - /** - * The amount that will be transferred automatically when the order is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. - */ - amount?: number; - - /** - * ID of the Connected account receiving the transfer. - */ - destination: string; - } - } - } - - interface ShippingCost { - /** - * The ID of the shipping rate to use for this order. - */ - shipping_rate?: string; - - /** - * Parameters to create a new ad-hoc shipping rate for this order. - */ - shipping_rate_data?: ShippingCost.ShippingRateData; - } - - namespace ShippingCost { - interface ShippingRateData { - /** - * The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. - */ - delivery_estimate?: ShippingRateData.DeliveryEstimate; - - /** - * The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. - */ - display_name: string; - - /** - * Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. - */ - fixed_amount?: ShippingRateData.FixedAmount; - - /** - * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. - */ - metadata?: Stripe.MetadataParam; - - /** - * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. - */ - tax_behavior?: ShippingRateData.TaxBehavior; - - /** - * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. - */ - tax_code?: string; - - /** - * The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. - */ - type?: 'fixed_amount'; - } - - namespace ShippingRateData { - interface DeliveryEstimate { - /** - * The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. - */ - maximum?: DeliveryEstimate.Maximum; - - /** - * The lower bound of the estimated range. If empty, represents no lower bound. - */ - minimum?: DeliveryEstimate.Minimum; - } - - namespace DeliveryEstimate { - interface Maximum { - /** - * A unit of time. - */ - unit: Maximum.Unit; - - /** - * Must be greater than 0. - */ - value: number; - } - - namespace Maximum { - type Unit = 'business_day' | 'day' | 'hour' | 'month' | 'week'; - } - - interface Minimum { - /** - * A unit of time. - */ - unit: Minimum.Unit; - - /** - * Must be greater than 0. - */ - value: number; - } - - namespace Minimum { - type Unit = 'business_day' | 'day' | 'hour' | 'month' | 'week'; - } - } - - interface FixedAmount { - /** - * A non-negative integer in cents representing how much to charge. - */ - amount: number; - - /** - * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). - */ - currency: string; - - /** - * Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). - */ - currency_options?: { - [key: string]: FixedAmount.CurrencyOptions; - }; - } - - namespace FixedAmount { - interface CurrencyOptions { - /** - * A non-negative integer in cents representing how much to charge. - */ - amount: number; - - /** - * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. - */ - tax_behavior?: CurrencyOptions.TaxBehavior; - } - - namespace CurrencyOptions { - type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; - } - } - - type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; - } - } - - interface ShippingDetails { - /** - * The shipping address for the order. - */ - address: Stripe.AddressParam; - - /** - * The name of the recipient of the order. - */ - name: string; - - /** - * The phone number (including extension) for the recipient of the order. - */ - phone?: string; - } - - interface TaxDetails { - /** - * The purchaser's tax exemption status. One of `none`, `exempt`, or `reverse`. - */ - tax_exempt?: Stripe.Emptyable; - - /** - * The purchaser's tax IDs to be used for this order. - */ - tax_ids?: Array; - } - - namespace TaxDetails { - type TaxExempt = 'exempt' | 'none' | 'reverse'; - - interface TaxId { - /** - * Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `bg_uic`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ph_tin`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat` - */ - type: TaxId.Type; - - /** - * Value of the tax ID. - */ - value: string; - } - - namespace TaxId { - type Type = - | 'ae_trn' - | 'au_abn' - | 'au_arn' - | 'bg_uic' - | 'br_cnpj' - | 'br_cpf' - | 'ca_bn' - | 'ca_gst_hst' - | 'ca_pst_bc' - | 'ca_pst_mb' - | 'ca_pst_sk' - | 'ca_qst' - | 'ch_vat' - | 'cl_tin' - | 'eg_tin' - | 'es_cif' - | 'eu_oss_vat' - | 'eu_vat' - | 'gb_vat' - | 'ge_vat' - | 'hk_br' - | 'hu_tin' - | 'id_npwp' - | 'il_vat' - | 'in_gst' - | 'is_vat' - | 'jp_cn' - | 'jp_rn' - | 'jp_trn' - | 'ke_pin' - | 'kr_brn' - | 'li_uid' - | 'mx_rfc' - | 'my_frp' - | 'my_itn' - | 'my_sst' - | 'no_vat' - | 'nz_gst' - | 'ph_tin' - | 'ru_inn' - | 'ru_kpp' - | 'sa_vat' - | 'sg_gst' - | 'sg_uen' - | 'si_tin' - | 'th_vat' - | 'tr_tin' - | 'tw_vat' - | 'ua_vat' - | 'us_ein' - | 'za_vat'; - } - } - } - - interface OrderRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface OrderUpdateParams { - /** - * Settings for automatic tax calculation for this order. - */ - automatic_tax?: OrderUpdateParams.AutomaticTax; - - /** - * Billing details for the customer. If a customer is provided, this will be automatically populated with values from that customer if override values are not provided. - */ - billing_details?: Stripe.Emptyable; - - /** - * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). - */ - currency?: string; - - /** - * The customer associated with this order. - */ - customer?: string; - - /** - * An arbitrary string attached to the object. Often useful for displaying to users. - */ - description?: string; - - /** - * The coupons, promotion codes, and/or discounts to apply to the order. Pass the empty string `""` to unset this field. - */ - discounts?: Stripe.Emptyable>; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The IP address of the purchaser for this order. - */ - ip_address?: string; - - /** - * A list of line items the customer is ordering. Each line item includes information about the product, the quantity, and the resulting cost. - */ - line_items?: Array; - - /** - * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. - */ - metadata?: Stripe.Emptyable; - - /** - * Payment information associated with the order, including payment settings. - */ - payment?: OrderUpdateParams.Payment; - - /** - * Settings for the customer cost of shipping for this order. - */ - shipping_cost?: Stripe.Emptyable; - - /** - * Shipping details for the order. - */ - shipping_details?: Stripe.Emptyable; - - /** - * Additional tax details about the purchaser to be used for this order. - */ - tax_details?: OrderUpdateParams.TaxDetails; - } - - namespace OrderUpdateParams { - interface AutomaticTax { - /** - * Enable automatic tax calculation which will automatically compute tax rates on this order. - */ - enabled: boolean; - } - - interface BillingDetails { - /** - * The billing address provided by the customer. - */ - address?: Stripe.AddressParam; - - /** - * The billing email provided by the customer. - */ - email?: string; - - /** - * The billing name provided by the customer. - */ - name?: string; - - /** - * The billing phone number provided by the customer. - */ - phone?: string; - } - - interface Discount { - /** - * ID of the coupon to create a new discount for. - */ - coupon?: string; - - /** - * ID of an existing discount on the object (or one of its ancestors) to reuse. - */ - discount?: string; - - /** - * ID of the promotion code to create a new discount for. - */ - promotion_code?: string; - } - - interface LineItem { - /** - * The description for the line item. Will default to the name of the associated product. - */ - description?: string; - - /** - * The discounts applied to this line item. - */ - discounts?: Stripe.Emptyable>; - - /** - * The ID of an existing line item on the order. - */ - id?: string; - - /** - * The ID of a [Price](https://stripe.com/docs/api/prices) to add to the Order. - * - * The `price` parameter is an alternative to using the `product` parameter. If each of your products are sold at a single price, you can set `Product.default_price` and then pass the `product` parameter when creating a line item. If your products are sold at several possible prices, use the `price` parameter to explicitly specify which one to use. - */ - price?: string; - - /** - * Data used to generate a new Price object inline. - * - * The `price_data` parameter is an alternative to using the `product` or `price` parameters. If you create products upfront and configure a `Product.default_price`, pass the `product` parameter when creating a line item. If you prefer not to define products upfront, or if you charge variable prices, pass the `price_data` parameter to describe the price for this line item. - * - * Each time you pass `price_data` we create a Price for the product. This Price is hidden in both the Dashboard and API lists and cannot be reused. - */ - price_data?: LineItem.PriceData; - - /** - * The ID of a [Product](https://stripe.com/docs/api/products) to add to the Order. - * - * The product must have a `default_price` specified. Otherwise, specify the price by passing the `price` or `price_data` parameter. - */ - product?: string; - - /** - * Defines a Product inline and adds it to the Order. - * - * `product_data` is an alternative to the `product` parameter. If you created a Product upfront, use the `product` parameter to refer to the existing Product. But if you prefer not to create Products upfront, pass the `product_data` parameter to define a Product inline as part of configuring the Order. - * - * `product_data` automatically creates a Product, just as if you had manually created the Product. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates. - */ - product_data?: LineItem.ProductData; - - /** - * The quantity of the line item. - */ - quantity?: number; - - /** - * The tax rates applied to this line item. - */ - tax_rates?: Stripe.Emptyable>; - } - - namespace LineItem { - interface Discount { - /** - * ID of the coupon to create a new discount for. - */ - coupon?: string; - - /** - * ID of an existing discount on the object (or one of its ancestors) to reuse. - */ - discount?: string; - } - - interface PriceData { - /** - * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). - */ - currency?: string; - - /** - * ID of the product this price belongs to. - * - * Use this to implement a variable-pricing model in your integration. This is required if `product_data` is not specifed. - */ - product?: string; - - /** - * Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. - */ - tax_behavior?: PriceData.TaxBehavior; - - /** - * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - */ - unit_amount?: number; - - /** - * Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. - */ - unit_amount_decimal?: string; - } - - namespace PriceData { - type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; - } - - interface ProductData { - /** - * The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. - */ - description?: string; - - /** - * A unique identifier for this product. - * - * `product_data` automatically creates a Product with this ID. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates. If any of the fields in the existing Product are different from the values in `product_data`, `product_data` updates the existing Product with the new information. So set `product_data[id]` to the same string every time you sell the same product, but don't re-use the same string for different products. - */ - id: string; - - /** - * A list of up to 8 URLs of images for this product, meant to be displayable to the customer. - */ - images?: Stripe.Emptyable>; - - /** - * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. - */ - metadata?: Stripe.Emptyable; - - /** - * The product's name, meant to be displayable to the customer. - */ - name: string; - - /** - * The dimensions of this product for shipping purposes. - */ - package_dimensions?: Stripe.Emptyable; - - /** - * Whether this product is shipped (i.e., physical goods). - */ - shippable?: boolean; - - /** - * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - */ - tax_code?: string; - - /** - * A URL of a publicly-accessible webpage for this product. - */ - url?: Stripe.Emptyable; - } - - namespace ProductData { - interface PackageDimensions { - /** - * Height, in inches. Maximum precision is 2 decimal places. - */ - height: number; - - /** - * Length, in inches. Maximum precision is 2 decimal places. - */ - length: number; - - /** - * Weight, in ounces. Maximum precision is 2 decimal places. - */ - weight: number; - - /** - * Width, in inches. Maximum precision is 2 decimal places. - */ - width: number; - } - } - } - - interface Payment { - /** - * Settings describing how the order should configure generated PaymentIntents. - */ - settings: Payment.Settings; - } - - namespace Payment { - interface Settings { - /** - * The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. - */ - application_fee_amount?: Stripe.Emptyable; - - /** - * PaymentMethod-specific configuration to provide to the order's PaymentIntent. - */ - payment_method_options?: Settings.PaymentMethodOptions; - - /** - * The list of [payment method types](https://stripe.com/docs/payments/payment-methods/overview) to provide to the order's PaymentIntent. Do not include this attribute if you prefer to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). - */ - payment_method_types?: Array; - - /** - * The URL to redirect the customer to after they authenticate their payment. - */ - return_url?: Stripe.Emptyable; - - /** - * For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. - */ - statement_descriptor?: string; - - /** - * Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. - */ - statement_descriptor_suffix?: string; - - /** - * Provides configuration for completing a transfer for the order after it is paid. - */ - transfer_data?: Stripe.Emptyable; - } - - namespace Settings { - interface PaymentMethodOptions { - /** - * If paying by `acss_debit`, this sub-hash contains details about the ACSS Debit payment method options to pass to the order's PaymentIntent. - */ - acss_debit?: Stripe.Emptyable; - - /** - * If paying by `afterpay_clearpay`, this sub-hash contains details about the AfterpayClearpay payment method options to pass to the order's PaymentIntent. - */ - afterpay_clearpay?: Stripe.Emptyable< - PaymentMethodOptions.AfterpayClearpay - >; - - /** - * If paying by `alipay`, this sub-hash contains details about the Alipay payment method options to pass to the order's PaymentIntent. - */ - alipay?: Stripe.Emptyable; - - /** - * If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the order's PaymentIntent. - */ - bancontact?: Stripe.Emptyable; - - /** - * If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the order's PaymentIntent. - */ - card?: Stripe.Emptyable; - - /** - * If paying by `customer_balance`, this sub-hash contains details about the Customer Balance payment method options to pass to the order's PaymentIntent. - */ - customer_balance?: Stripe.Emptyable< - PaymentMethodOptions.CustomerBalance - >; - - /** - * If paying by `ideal`, this sub-hash contains details about the iDEAL payment method options to pass to the order's PaymentIntent. - */ - ideal?: Stripe.Emptyable; - - /** - * If paying by `klarna`, this sub-hash contains details about the Klarna payment method options to pass to the order's PaymentIntent. - */ - klarna?: Stripe.Emptyable; - - /** - * If paying by `link`, this sub-hash contains details about the Link payment method options to pass to the order's PaymentIntent. - */ - link?: Stripe.Emptyable; - - /** - * If paying by `oxxo`, this sub-hash contains details about the OXXO payment method options to pass to the order's PaymentIntent. - */ - oxxo?: Stripe.Emptyable; - - /** - * If paying by `p24`, this sub-hash contains details about the P24 payment method options to pass to the order's PaymentIntent. - */ - p24?: Stripe.Emptyable; - - /** - * If paying by `sepa_debit`, this sub-hash contains details about the SEPA Debit payment method options to pass to the order's PaymentIntent. - */ - sepa_debit?: Stripe.Emptyable; - - /** - * If paying by `sofort`, this sub-hash contains details about the Sofort payment method options to pass to the order's PaymentIntent. - */ - sofort?: Stripe.Emptyable; - - /** - * If paying by `wechat_pay`, this sub-hash contains details about the WeChat Pay payment method options to pass to the order's PaymentIntent. - */ - wechat_pay?: Stripe.Emptyable; - } - - namespace PaymentMethodOptions { - interface AcssDebit { - /** - * Additional fields for Mandate creation - */ - mandate_options?: AcssDebit.MandateOptions; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - - /** - * Verification method for the intent - */ - verification_method?: AcssDebit.VerificationMethod; - } - - namespace AcssDebit { - interface MandateOptions { - /** - * A URL for custom mandate text to render during confirmation step. - * The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, - * or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. - */ - custom_mandate_url?: Stripe.Emptyable; - - /** - * Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. - */ - interval_description?: string; - - /** - * Payment schedule for the mandate. - */ - payment_schedule?: MandateOptions.PaymentSchedule; - - /** - * Transaction type of the mandate. - */ - transaction_type?: MandateOptions.TransactionType; - } - - namespace MandateOptions { - type PaymentSchedule = 'combined' | 'interval' | 'sporadic'; - - type TransactionType = 'business' | 'personal'; - } - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - - type VerificationMethod = - | 'automatic' - | 'instant' - | 'microdeposits'; - } - - interface AfterpayClearpay { - /** - * Controls when the funds will be captured from the customer's account. - * - * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - * - * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - */ - capture_method?: AfterpayClearpay.CaptureMethod; - - /** - * Order identifier shown to the customer in Afterpay's online portal. We recommend using a value that helps you answer any questions a customer might have about - * the payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. - */ - reference?: string; - - /** - * Indicates that you intend to make future payments with the payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - namespace AfterpayClearpay { - type CaptureMethod = 'automatic' | 'manual'; - } - - interface Alipay { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Alipay { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Bancontact { - /** - * Preferred language of the Bancontact authorization page that the customer is redirected to. - */ - preferred_language?: Bancontact.PreferredLanguage; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable< - Bancontact.SetupFutureUsage - >; - } - - namespace Bancontact { - type PreferredLanguage = 'de' | 'en' | 'fr' | 'nl'; - - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Card { - /** - * Controls when the funds will be captured from the customer's account. - */ - capture_method?: Card.CaptureMethod; - - /** - * Indicates that you intend to make future payments with the payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Card.SetupFutureUsage; - } - - namespace Card { - type CaptureMethod = 'automatic' | 'manual'; - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface CustomerBalance { - /** - * Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. - */ - bank_transfer?: CustomerBalance.BankTransfer; - - /** - * The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. - */ - funding_type?: 'bank_transfer'; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - namespace CustomerBalance { - interface BankTransfer { - eu_bank_transfer?: BankTransfer.EuBankTransfer; - - /** - * List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. - * - * Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. - */ - requested_address_types?: Array< - BankTransfer.RequestedAddressType - >; - - /** - * The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`. - */ - type: BankTransfer.Type; - } - - namespace BankTransfer { - interface EuBankTransfer { - /** - * The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`. - */ - country: string; - } - - type RequestedAddressType = - | 'iban' - | 'sepa' - | 'sort_code' - | 'spei' - | 'zengin'; - - type Type = - | 'eu_bank_transfer' - | 'gb_bank_transfer' - | 'jp_bank_transfer' - | 'mx_bank_transfer'; - } - } - - interface Ideal { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Ideal { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Klarna { - /** - * Controls when the funds will be captured from the customer's account. - * - * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - * - * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - */ - capture_method?: Stripe.Emptyable<'manual'>; - - /** - * Preferred language of the Klarna authorization page that the customer is redirected to - */ - preferred_locale?: Klarna.PreferredLocale; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - namespace Klarna { - type PreferredLocale = - | 'da-DK' - | 'de-AT' - | 'de-CH' - | 'de-DE' - | 'en-AT' - | 'en-AU' - | 'en-BE' - | 'en-CA' - | 'en-CH' - | 'en-DE' - | 'en-DK' - | 'en-ES' - | 'en-FI' - | 'en-FR' - | 'en-GB' - | 'en-IE' - | 'en-IT' - | 'en-NL' - | 'en-NO' - | 'en-NZ' - | 'en-PL' - | 'en-PT' - | 'en-SE' - | 'en-US' - | 'es-ES' - | 'es-US' - | 'fi-FI' - | 'fr-BE' - | 'fr-CA' - | 'fr-CH' - | 'fr-FR' - | 'it-CH' - | 'it-IT' - | 'nb-NO' - | 'nl-BE' - | 'nl-NL' - | 'pl-PL' - | 'pt-PT' - | 'sv-FI' - | 'sv-SE'; - } - - interface Link { - /** - * Controls when the funds will be captured from the customer's account. - * - * If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - * - * If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - */ - capture_method?: Stripe.Emptyable<'manual'>; - - /** - * Token used for persistent Link logins. - */ - persistent_token?: string; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Link { - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface Oxxo { - /** - * The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. - */ - expires_after_days?: number; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - interface P24 { - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - - /** - * Confirm that the payer has accepted the P24 terms and conditions. - */ - tos_shown_and_accepted?: boolean; - } - - interface SepaDebit { - /** - * Additional fields for Mandate creation - */ - mandate_options?: SepaDebit.MandateOptions; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace SepaDebit { - interface MandateOptions {} - - type SetupFutureUsage = 'none' | 'off_session' | 'on_session'; - } - - interface Sofort { - /** - * Language shown to the payer on redirect. - */ - preferred_language?: Stripe.Emptyable; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: Stripe.Emptyable; - } - - namespace Sofort { - type PreferredLanguage = - | 'de' - | 'en' - | 'es' - | 'fr' - | 'it' - | 'nl' - | 'pl'; - - type SetupFutureUsage = 'none' | 'off_session'; - } - - interface WechatPay { - /** - * The app ID registered with WeChat Pay. Only required when client is ios or android. - */ - app_id?: string; - - /** - * The client type that the end customer will pay from - */ - client: WechatPay.Client; - - /** - * Indicates that you intend to make future payments with this PaymentIntent's payment method. - * - * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. - * - * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - * - * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - */ - setup_future_usage?: 'none'; - } - - namespace WechatPay { - type Client = 'android' | 'ios' | 'web'; - } - } - - type PaymentMethodType = - | 'acss_debit' - | 'afterpay_clearpay' - | 'alipay' - | 'au_becs_debit' - | 'bacs_debit' - | 'bancontact' - | 'card' - | 'customer_balance' - | 'eps' - | 'fpx' - | 'giropay' - | 'grabpay' - | 'ideal' - | 'klarna' - | 'link' - | 'oxxo' - | 'p24' - | 'sepa_debit' - | 'sofort' - | 'wechat_pay'; - - interface TransferData { - /** - * The amount that will be transferred automatically when the order is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. - */ - amount?: number; - - /** - * ID of the Connected account receiving the transfer. - */ - destination: string; - } - } - } - - interface ShippingCost { - /** - * The ID of the shipping rate to use for this order. - */ - shipping_rate?: string; - - /** - * Parameters to create a new ad-hoc shipping rate for this order. - */ - shipping_rate_data?: ShippingCost.ShippingRateData; - } - - namespace ShippingCost { - interface ShippingRateData { - /** - * The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. - */ - delivery_estimate?: ShippingRateData.DeliveryEstimate; - - /** - * The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. - */ - display_name: string; - - /** - * Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. - */ - fixed_amount?: ShippingRateData.FixedAmount; - - /** - * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. - */ - metadata?: Stripe.MetadataParam; - - /** - * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. - */ - tax_behavior?: ShippingRateData.TaxBehavior; - - /** - * A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. - */ - tax_code?: string; - - /** - * The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. - */ - type?: 'fixed_amount'; - } - - namespace ShippingRateData { - interface DeliveryEstimate { - /** - * The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. - */ - maximum?: DeliveryEstimate.Maximum; - - /** - * The lower bound of the estimated range. If empty, represents no lower bound. - */ - minimum?: DeliveryEstimate.Minimum; - } - - namespace DeliveryEstimate { - interface Maximum { - /** - * A unit of time. - */ - unit: Maximum.Unit; - - /** - * Must be greater than 0. - */ - value: number; - } - - namespace Maximum { - type Unit = 'business_day' | 'day' | 'hour' | 'month' | 'week'; - } - - interface Minimum { - /** - * A unit of time. - */ - unit: Minimum.Unit; - - /** - * Must be greater than 0. - */ - value: number; - } - - namespace Minimum { - type Unit = 'business_day' | 'day' | 'hour' | 'month' | 'week'; - } - } - - interface FixedAmount { - /** - * A non-negative integer in cents representing how much to charge. - */ - amount: number; - - /** - * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). - */ - currency: string; - - /** - * Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). - */ - currency_options?: { - [key: string]: FixedAmount.CurrencyOptions; - }; - } - - namespace FixedAmount { - interface CurrencyOptions { - /** - * A non-negative integer in cents representing how much to charge. - */ - amount: number; - - /** - * Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. - */ - tax_behavior?: CurrencyOptions.TaxBehavior; - } - - namespace CurrencyOptions { - type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; - } - } - - type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified'; - } - } - - interface ShippingDetails { - /** - * The shipping address for the order. - */ - address: Stripe.AddressParam; - - /** - * The name of the recipient of the order. - */ - name: string; - - /** - * The phone number (including extension) for the recipient of the order. - */ - phone?: string; - } - - interface TaxDetails { - /** - * The purchaser's tax exemption status. One of `none`, `exempt`, or `reverse`. - */ - tax_exempt?: Stripe.Emptyable; - - /** - * The purchaser's tax IDs to be used for this order. - */ - tax_ids?: Array; - } - - namespace TaxDetails { - type TaxExempt = 'exempt' | 'none' | 'reverse'; - - interface TaxId { - /** - * Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `bg_uic`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ph_tin`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat` - */ - type: TaxId.Type; - - /** - * Value of the tax ID. - */ - value: string; - } - - namespace TaxId { - type Type = - | 'ae_trn' - | 'au_abn' - | 'au_arn' - | 'bg_uic' - | 'br_cnpj' - | 'br_cpf' - | 'ca_bn' - | 'ca_gst_hst' - | 'ca_pst_bc' - | 'ca_pst_mb' - | 'ca_pst_sk' - | 'ca_qst' - | 'ch_vat' - | 'cl_tin' - | 'eg_tin' - | 'es_cif' - | 'eu_oss_vat' - | 'eu_vat' - | 'gb_vat' - | 'ge_vat' - | 'hk_br' - | 'hu_tin' - | 'id_npwp' - | 'il_vat' - | 'in_gst' - | 'is_vat' - | 'jp_cn' - | 'jp_rn' - | 'jp_trn' - | 'ke_pin' - | 'kr_brn' - | 'li_uid' - | 'mx_rfc' - | 'my_frp' - | 'my_itn' - | 'my_sst' - | 'no_vat' - | 'nz_gst' - | 'ph_tin' - | 'ru_inn' - | 'ru_kpp' - | 'sa_vat' - | 'sg_gst' - | 'sg_uen' - | 'si_tin' - | 'th_vat' - | 'tr_tin' - | 'tw_vat' - | 'ua_vat' - | 'us_ein' - | 'za_vat'; - } - } - } - - interface OrderListParams extends PaginationParams { - /** - * Only return orders for the given customer. - */ - customer?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface OrderCancelParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface OrderListLineItemsParams extends PaginationParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface OrderReopenParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface OrderSubmitParams { - /** - * `expected_total` should always be set to the order's `amount_total` field. If they don't match, submitting the order will fail. This helps detect race conditions where something else concurrently modifies the order. - */ - expected_total: number; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - class OrdersResource { - /** - * Creates a new open order object. - */ - create( - params: OrderCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the details of an existing order. Supply the unique order ID from either an order creation request or the order list, and Stripe will return the corresponding order information. - */ - retrieve( - id: string, - params?: OrderRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates the specific order by setting the values of the parameters passed. Any parameters not provided will be left unchanged. - */ - update( - id: string, - params?: OrderUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of your orders. The orders are returned sorted by creation date, with the most recently created orders appearing first. - */ - list( - params?: OrderListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * Cancels the order as well as the payment intent if one is attached. - */ - cancel( - id: string, - params?: OrderCancelParams, - options?: RequestOptions - ): Promise>; - cancel( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * When retrieving an order, 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. - */ - listLineItems( - id: string, - params?: OrderListLineItemsParams, - options?: RequestOptions - ): ApiListPromise; - listLineItems( - id: string, - options?: RequestOptions - ): ApiListPromise; - - /** - * Reopens a submitted order. - */ - reopen( - id: string, - params?: OrderReopenParams, - options?: RequestOptions - ): Promise>; - reopen( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * 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://stripe.com/docs/api#reopen_order) method is called. - */ - submit( - id: string, - params: OrderSubmitParams, - options?: RequestOptions - ): Promise>; - } - } -} diff --git a/types/2022-08-01/SKUs.d.ts b/types/2022-08-01/SKUs.d.ts deleted file mode 100644 index 8653c30301..0000000000 --- a/types/2022-08-01/SKUs.d.ts +++ /dev/null @@ -1,453 +0,0 @@ -// File generated from our OpenAPI spec - -declare module 'stripe' { - namespace Stripe { - /** - * Stores representations of [stock keeping units](http://en.wikipedia.org/wiki/Stock_keeping_unit). - * SKUs describe specific product variations, taking into account any combination of: attributes, - * currency, and cost. For example, a product may be a T-shirt, whereas a specific SKU represents - * the `size: large`, `color: red` version of that shirt. - * - * Can also be used to manage inventory. - */ - interface Sku { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'sku'; - - /** - * Whether the SKU is available for purchase. - */ - active: boolean; - - /** - * A dictionary of attributes and values for the attributes defined by the product. If, for example, a product's attributes are `["size", "gender"]`, a valid SKU has the following dictionary of attributes: `{"size": "Medium", "gender": "Unisex"}`. - */ - attributes: { - [key: string]: string; - }; - - /** - * Time at which the object was created. Measured in seconds since the Unix epoch. - */ - created: number; - - /** - * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). - */ - currency: string; - - deleted?: void; - - /** - * The URL of an image for this SKU, meant to be displayable to the customer. - */ - image: string | null; - - inventory: Sku.Inventory; - - /** - * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - */ - livemode: boolean; - - /** - * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - */ - metadata: Stripe.Metadata; - - /** - * The dimensions of this SKU for shipping purposes. - */ - package_dimensions: Sku.PackageDimensions | null; - - /** - * The cost of the item as a positive integer in the smallest currency unit (that is, 100 cents to charge $1.00, or 100 to charge ¥100, Japanese Yen being a zero-decimal currency). - */ - price: number; - - /** - * The ID of the product this SKU is associated with. The product must be currently active. - */ - product: string | Stripe.Product; - - /** - * Time at which the object was last updated. Measured in seconds since the Unix epoch. - */ - updated: number; - } - - namespace Sku { - interface Inventory { - /** - * The count of inventory available. Will be present if and only if `type` is `finite`. - */ - quantity: number | null; - - /** - * Inventory type. Possible values are `finite`, `bucket` (not quantified), and `infinite`. - */ - type: string; - - /** - * An indicator of the inventory available. Possible values are `in_stock`, `limited`, and `out_of_stock`. Will be present if and only if `type` is `bucket`. - */ - value: string | null; - } - - interface PackageDimensions { - /** - * Height, in inches. - */ - height: number; - - /** - * Length, in inches. - */ - length: number; - - /** - * Weight, in ounces. - */ - weight: number; - - /** - * Width, in inches. - */ - width: number; - } - } - - /** - * The DeletedSku object. - */ - interface DeletedSku { - /** - * Unique identifier for the object. - */ - id: string; - - /** - * String representing the object's type. Objects of the same type share the same value. - */ - object: 'sku'; - - /** - * Always true for a deleted object - */ - deleted: true; - } - - interface SkuCreateParams { - /** - * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). - */ - currency: string; - - /** - * Description of the SKU's inventory. - */ - inventory: SkuCreateParams.Inventory; - - /** - * The cost of the item as a nonnegative integer in the smallest currency unit (that is, 100 cents to charge $1.00, or 100 to charge ¥100, Japanese Yen being a zero-decimal currency). - */ - price: number; - - /** - * The ID of the product this SKU is associated with. Must be a product with type `good`. - */ - product: string; - - /** - * Whether the SKU is available for purchase. Default to `true`. - */ - active?: boolean; - - /** - * A dictionary of attributes and values for the attributes defined by the product. If, for example, a product's attributes are `["size", "gender"]`, a valid SKU has the following dictionary of attributes: `{"size": "Medium", "gender": "Unisex"}`. - */ - attributes?: { - [key: string]: string; - }; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The identifier for the SKU. Must be unique. If not provided, an identifier will be randomly generated. - */ - id?: string; - - /** - * The URL of an image for this SKU, meant to be displayable to the customer. - */ - image?: string; - - /** - * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. - */ - metadata?: Stripe.MetadataParam; - - /** - * The dimensions of this SKU for shipping purposes. - */ - package_dimensions?: SkuCreateParams.PackageDimensions; - } - - namespace SkuCreateParams { - interface Inventory { - /** - * The count of inventory available. Required if `type` is `finite`. - */ - quantity?: number; - - /** - * Inventory type. Possible values are `finite`, `bucket` (not quantified), and `infinite`. - */ - type: Inventory.Type; - - /** - * An indicator of the inventory available. Possible values are `in_stock`, `limited`, and `out_of_stock`. Will be present if and only if `type` is `bucket`. - */ - value?: Stripe.Emptyable; - } - - namespace Inventory { - type Type = 'bucket' | 'finite' | 'infinite'; - - type Value = 'in_stock' | 'limited' | 'out_of_stock'; - } - - interface PackageDimensions { - /** - * Height, in inches. Maximum precision is 2 decimal places. - */ - height: number; - - /** - * Length, in inches. Maximum precision is 2 decimal places. - */ - length: number; - - /** - * Weight, in ounces. Maximum precision is 2 decimal places. - */ - weight: number; - - /** - * Width, in inches. Maximum precision is 2 decimal places. - */ - width: number; - } - } - - interface SkuRetrieveParams { - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - } - - interface SkuUpdateParams { - /** - * Whether this SKU is available for purchase. - */ - active?: boolean; - - /** - * A dictionary of attributes and values for the attributes defined by the product. When specified, `attributes` will partially update the existing attributes dictionary on the product, with the postcondition that a value must be present for each attribute key on the product. - */ - attributes?: { - [key: string]: string; - }; - - /** - * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). - */ - currency?: string; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * The URL of an image for this SKU, meant to be displayable to the customer. - */ - image?: string; - - /** - * Description of the SKU's inventory. - */ - inventory?: SkuUpdateParams.Inventory; - - /** - * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. - */ - metadata?: Stripe.Emptyable; - - /** - * The dimensions of this SKU for shipping purposes. - */ - package_dimensions?: Stripe.Emptyable; - - /** - * The cost of the item as a positive integer in the smallest currency unit (that is, 100 cents to charge $1.00, or 100 to charge ¥100, Japanese Yen being a zero-decimal currency). - */ - price?: number; - - /** - * The ID of the product that this SKU should belong to. The product must exist, have the same set of attribute names as the SKU's current product, and be of type `good`. - */ - product?: string; - } - - namespace SkuUpdateParams { - interface Inventory { - /** - * The count of inventory available. Required if `type` is `finite`. - */ - quantity?: number; - - /** - * Inventory type. Possible values are `finite`, `bucket` (not quantified), and `infinite`. - */ - type?: Inventory.Type; - - /** - * An indicator of the inventory available. Possible values are `in_stock`, `limited`, and `out_of_stock`. Will be present if and only if `type` is `bucket`. - */ - value?: Stripe.Emptyable; - } - - namespace Inventory { - type Type = 'bucket' | 'finite' | 'infinite'; - - type Value = 'in_stock' | 'limited' | 'out_of_stock'; - } - - interface PackageDimensions { - /** - * Height, in inches. Maximum precision is 2 decimal places. - */ - height: number; - - /** - * Length, in inches. Maximum precision is 2 decimal places. - */ - length: number; - - /** - * Weight, in ounces. Maximum precision is 2 decimal places. - */ - weight: number; - - /** - * Width, in inches. Maximum precision is 2 decimal places. - */ - width: number; - } - } - - interface SkuListParams extends PaginationParams { - /** - * Only return SKUs that are active or inactive (e.g., pass `false` to list all inactive products). - */ - active?: boolean; - - /** - * Only return SKUs that have the specified key-value pairs in this partially constructed dictionary. Can be specified only if `product` is also supplied. For instance, if the associated product has attributes `["color", "size"]`, passing in `attributes[color]=red` returns all the SKUs for this product that have `color` set to `red`. - */ - attributes?: { - [key: string]: string; - }; - - /** - * Specifies which fields in the response should be expanded. - */ - expand?: Array; - - /** - * Only return SKUs with the given IDs. - */ - ids?: Array; - - /** - * Only return SKUs that are either in stock or out of stock (e.g., pass `false` to list all SKUs that are out of stock). If no value is provided, all SKUs are returned. - */ - in_stock?: boolean; - - /** - * The ID of the product whose SKUs will be retrieved. Must be a product with type `good`. - */ - product?: string; - } - - interface SkuDeleteParams {} - - class SkusResource { - /** - * Creates a new SKU associated with a product. - */ - create( - params: SkuCreateParams, - options?: RequestOptions - ): Promise>; - - /** - * Retrieves the details of an existing SKU. Supply the unique SKU identifier from either a SKU creation request or from the product, and Stripe will return the corresponding SKU information. - */ - retrieve( - id: string, - params?: SkuRetrieveParams, - options?: RequestOptions - ): Promise>; - retrieve( - id: string, - options?: RequestOptions - ): Promise>; - - /** - * Updates the specific SKU by setting the values of the parameters passed. Any parameters not provided will be left unchanged. - * - * Note that a SKU's attributes are not editable. Instead, you would need to deactivate the existing SKU and create a new one with the new attribute values. - */ - update( - id: string, - params?: SkuUpdateParams, - options?: RequestOptions - ): Promise>; - - /** - * Returns a list of your SKUs. The SKUs are returned sorted by creation date, with the most recently created SKUs appearing first. - */ - list( - params?: SkuListParams, - options?: RequestOptions - ): ApiListPromise; - list(options?: RequestOptions): ApiListPromise; - - /** - * Delete a SKU. Deleting a SKU is only possible until it has been used in an order. - */ - del( - id: string, - params?: SkuDeleteParams, - options?: RequestOptions - ): Promise>; - del( - id: string, - options?: RequestOptions - ): Promise>; - } - } -} diff --git a/types/2022-08-01/AccountLinks.d.ts b/types/2022-11-15/AccountLinks.d.ts similarity index 100% rename from types/2022-08-01/AccountLinks.d.ts rename to types/2022-11-15/AccountLinks.d.ts diff --git a/types/2022-08-01/Accounts.d.ts b/types/2022-11-15/Accounts.d.ts similarity index 100% rename from types/2022-08-01/Accounts.d.ts rename to types/2022-11-15/Accounts.d.ts diff --git a/types/2022-08-01/ApplePayDomains.d.ts b/types/2022-11-15/ApplePayDomains.d.ts similarity index 100% rename from types/2022-08-01/ApplePayDomains.d.ts rename to types/2022-11-15/ApplePayDomains.d.ts diff --git a/types/2022-08-01/ApplicationFees.d.ts b/types/2022-11-15/ApplicationFees.d.ts similarity index 100% rename from types/2022-08-01/ApplicationFees.d.ts rename to types/2022-11-15/ApplicationFees.d.ts diff --git a/types/2022-08-01/Applications.d.ts b/types/2022-11-15/Applications.d.ts similarity index 100% rename from types/2022-08-01/Applications.d.ts rename to types/2022-11-15/Applications.d.ts diff --git a/types/2022-08-01/Apps/Secrets.d.ts b/types/2022-11-15/Apps/Secrets.d.ts similarity index 100% rename from types/2022-08-01/Apps/Secrets.d.ts rename to types/2022-11-15/Apps/Secrets.d.ts diff --git a/types/2022-08-01/Balance.d.ts b/types/2022-11-15/Balance.d.ts similarity index 100% rename from types/2022-08-01/Balance.d.ts rename to types/2022-11-15/Balance.d.ts diff --git a/types/2022-08-01/BalanceTransactions.d.ts b/types/2022-11-15/BalanceTransactions.d.ts similarity index 100% rename from types/2022-08-01/BalanceTransactions.d.ts rename to types/2022-11-15/BalanceTransactions.d.ts diff --git a/types/2022-08-01/BankAccounts.d.ts b/types/2022-11-15/BankAccounts.d.ts similarity index 100% rename from types/2022-08-01/BankAccounts.d.ts rename to types/2022-11-15/BankAccounts.d.ts diff --git a/types/2022-08-01/BillingPortal/Configurations.d.ts b/types/2022-11-15/BillingPortal/Configurations.d.ts similarity index 100% rename from types/2022-08-01/BillingPortal/Configurations.d.ts rename to types/2022-11-15/BillingPortal/Configurations.d.ts diff --git a/types/2022-08-01/BillingPortal/Sessions.d.ts b/types/2022-11-15/BillingPortal/Sessions.d.ts similarity index 100% rename from types/2022-08-01/BillingPortal/Sessions.d.ts rename to types/2022-11-15/BillingPortal/Sessions.d.ts diff --git a/types/2022-08-01/Capabilities.d.ts b/types/2022-11-15/Capabilities.d.ts similarity index 100% rename from types/2022-08-01/Capabilities.d.ts rename to types/2022-11-15/Capabilities.d.ts diff --git a/types/2022-08-01/Cards.d.ts b/types/2022-11-15/Cards.d.ts similarity index 100% rename from types/2022-08-01/Cards.d.ts rename to types/2022-11-15/Cards.d.ts diff --git a/types/2022-08-01/CashBalances.d.ts b/types/2022-11-15/CashBalances.d.ts similarity index 100% rename from types/2022-08-01/CashBalances.d.ts rename to types/2022-11-15/CashBalances.d.ts diff --git a/types/2022-08-01/Charges.d.ts b/types/2022-11-15/Charges.d.ts similarity index 99% rename from types/2022-08-01/Charges.d.ts rename to types/2022-11-15/Charges.d.ts index 752f3b41ca..177f810fa7 100644 --- a/types/2022-08-01/Charges.d.ts +++ b/types/2022-11-15/Charges.d.ts @@ -204,7 +204,7 @@ declare module 'stripe' { /** * A list of refunds that have been applied to the charge. */ - refunds?: ApiList; + refunds: ApiList | null; /** * ID of the review associated with this charge if one exists. diff --git a/types/2022-08-01/Checkout/Sessions.d.ts b/types/2022-11-15/Checkout/Sessions.d.ts similarity index 99% rename from types/2022-08-01/Checkout/Sessions.d.ts rename to types/2022-11-15/Checkout/Sessions.d.ts index 2b6fd8e96c..dc63b7c02a 100644 --- a/types/2022-08-01/Checkout/Sessions.d.ts +++ b/types/2022-11-15/Checkout/Sessions.d.ts @@ -1728,11 +1728,6 @@ declare module 'stripe' { */ adjustable_quantity?: LineItem.AdjustableQuantity; - /** - * [Deprecated] The amount to be collected per unit of the line item. If specified, must also pass `currency` and `name`. - */ - amount?: number; - /** * The [tax rates](https://stripe.com/docs/api/tax_rates) that will be applied to this line item depending on the customer's billing/shipping address. We currently support the following countries: US, GB, AU, and all countries in the EU. */ @@ -3130,11 +3125,6 @@ declare module 'stripe' { */ description?: string; - /** - * This parameter is deprecated. Use the line_items parameter on the Session instead. - */ - items?: Array; - /** * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. */ @@ -3170,24 +3160,6 @@ declare module 'stripe' { } namespace SubscriptionData { - interface Item { - /** - * Plan ID for this item. - */ - plan: string; - - /** - * The quantity of the subscription item being purchased. Quantity should not be defined when `recurring.usage_type=metered`. - */ - quantity?: number; - - /** - * The tax rates which apply to this item. When set, the `default_tax_rates` - * on `subscription_data` do not apply to this item. - */ - tax_rates?: Array; - } - interface TransferData { /** * A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. diff --git a/types/2022-08-01/ConnectCollectionTransfers.d.ts b/types/2022-11-15/ConnectCollectionTransfers.d.ts similarity index 100% rename from types/2022-08-01/ConnectCollectionTransfers.d.ts rename to types/2022-11-15/ConnectCollectionTransfers.d.ts diff --git a/types/2022-08-01/CountrySpecs.d.ts b/types/2022-11-15/CountrySpecs.d.ts similarity index 100% rename from types/2022-08-01/CountrySpecs.d.ts rename to types/2022-11-15/CountrySpecs.d.ts diff --git a/types/2022-08-01/Coupons.d.ts b/types/2022-11-15/Coupons.d.ts similarity index 100% rename from types/2022-08-01/Coupons.d.ts rename to types/2022-11-15/Coupons.d.ts diff --git a/types/2022-08-01/CreditNoteLineItems.d.ts b/types/2022-11-15/CreditNoteLineItems.d.ts similarity index 100% rename from types/2022-08-01/CreditNoteLineItems.d.ts rename to types/2022-11-15/CreditNoteLineItems.d.ts diff --git a/types/2022-08-01/CreditNotes.d.ts b/types/2022-11-15/CreditNotes.d.ts similarity index 100% rename from types/2022-08-01/CreditNotes.d.ts rename to types/2022-11-15/CreditNotes.d.ts diff --git a/types/2022-08-01/CustomerBalanceTransactions.d.ts b/types/2022-11-15/CustomerBalanceTransactions.d.ts similarity index 100% rename from types/2022-08-01/CustomerBalanceTransactions.d.ts rename to types/2022-11-15/CustomerBalanceTransactions.d.ts diff --git a/types/2022-08-01/CustomerCashBalanceTransactions.d.ts b/types/2022-11-15/CustomerCashBalanceTransactions.d.ts similarity index 100% rename from types/2022-08-01/CustomerCashBalanceTransactions.d.ts rename to types/2022-11-15/CustomerCashBalanceTransactions.d.ts diff --git a/types/2022-08-01/CustomerSources.d.ts b/types/2022-11-15/CustomerSources.d.ts similarity index 100% rename from types/2022-08-01/CustomerSources.d.ts rename to types/2022-11-15/CustomerSources.d.ts diff --git a/types/2022-08-01/Customers.d.ts b/types/2022-11-15/Customers.d.ts similarity index 100% rename from types/2022-08-01/Customers.d.ts rename to types/2022-11-15/Customers.d.ts diff --git a/types/2022-08-01/Discounts.d.ts b/types/2022-11-15/Discounts.d.ts similarity index 100% rename from types/2022-08-01/Discounts.d.ts rename to types/2022-11-15/Discounts.d.ts diff --git a/types/2022-08-01/Disputes.d.ts b/types/2022-11-15/Disputes.d.ts similarity index 100% rename from types/2022-08-01/Disputes.d.ts rename to types/2022-11-15/Disputes.d.ts diff --git a/types/2022-08-01/EphemeralKeys.d.ts b/types/2022-11-15/EphemeralKeys.d.ts similarity index 100% rename from types/2022-08-01/EphemeralKeys.d.ts rename to types/2022-11-15/EphemeralKeys.d.ts diff --git a/types/2022-08-01/Events.d.ts b/types/2022-11-15/Events.d.ts similarity index 100% rename from types/2022-08-01/Events.d.ts rename to types/2022-11-15/Events.d.ts diff --git a/types/2022-08-01/ExchangeRates.d.ts b/types/2022-11-15/ExchangeRates.d.ts similarity index 100% rename from types/2022-08-01/ExchangeRates.d.ts rename to types/2022-11-15/ExchangeRates.d.ts diff --git a/types/2022-08-01/ExternalAccounts.d.ts b/types/2022-11-15/ExternalAccounts.d.ts similarity index 100% rename from types/2022-08-01/ExternalAccounts.d.ts rename to types/2022-11-15/ExternalAccounts.d.ts diff --git a/types/2022-08-01/FeeRefunds.d.ts b/types/2022-11-15/FeeRefunds.d.ts similarity index 100% rename from types/2022-08-01/FeeRefunds.d.ts rename to types/2022-11-15/FeeRefunds.d.ts diff --git a/types/2022-08-01/FileLinks.d.ts b/types/2022-11-15/FileLinks.d.ts similarity index 100% rename from types/2022-08-01/FileLinks.d.ts rename to types/2022-11-15/FileLinks.d.ts diff --git a/types/2022-08-01/Files.d.ts b/types/2022-11-15/Files.d.ts similarity index 100% rename from types/2022-08-01/Files.d.ts rename to types/2022-11-15/Files.d.ts diff --git a/types/2022-08-01/FinancialConnections/AccountOwners.d.ts b/types/2022-11-15/FinancialConnections/AccountOwners.d.ts similarity index 100% rename from types/2022-08-01/FinancialConnections/AccountOwners.d.ts rename to types/2022-11-15/FinancialConnections/AccountOwners.d.ts diff --git a/types/2022-08-01/FinancialConnections/AccountOwnerships.d.ts b/types/2022-11-15/FinancialConnections/AccountOwnerships.d.ts similarity index 100% rename from types/2022-08-01/FinancialConnections/AccountOwnerships.d.ts rename to types/2022-11-15/FinancialConnections/AccountOwnerships.d.ts diff --git a/types/2022-08-01/FinancialConnections/Accounts.d.ts b/types/2022-11-15/FinancialConnections/Accounts.d.ts similarity index 100% rename from types/2022-08-01/FinancialConnections/Accounts.d.ts rename to types/2022-11-15/FinancialConnections/Accounts.d.ts diff --git a/types/2022-08-01/FinancialConnections/Sessions.d.ts b/types/2022-11-15/FinancialConnections/Sessions.d.ts similarity index 100% rename from types/2022-08-01/FinancialConnections/Sessions.d.ts rename to types/2022-11-15/FinancialConnections/Sessions.d.ts diff --git a/types/2022-08-01/FundingInstructions.d.ts b/types/2022-11-15/FundingInstructions.d.ts similarity index 100% rename from types/2022-08-01/FundingInstructions.d.ts rename to types/2022-11-15/FundingInstructions.d.ts diff --git a/types/2022-08-01/Identity/VerificationReports.d.ts b/types/2022-11-15/Identity/VerificationReports.d.ts similarity index 100% rename from types/2022-08-01/Identity/VerificationReports.d.ts rename to types/2022-11-15/Identity/VerificationReports.d.ts diff --git a/types/2022-08-01/Identity/VerificationSessions.d.ts b/types/2022-11-15/Identity/VerificationSessions.d.ts similarity index 100% rename from types/2022-08-01/Identity/VerificationSessions.d.ts rename to types/2022-11-15/Identity/VerificationSessions.d.ts diff --git a/types/2022-08-01/InvoiceItems.d.ts b/types/2022-11-15/InvoiceItems.d.ts similarity index 100% rename from types/2022-08-01/InvoiceItems.d.ts rename to types/2022-11-15/InvoiceItems.d.ts diff --git a/types/2022-08-01/InvoiceLineItems.d.ts b/types/2022-11-15/InvoiceLineItems.d.ts similarity index 100% rename from types/2022-08-01/InvoiceLineItems.d.ts rename to types/2022-11-15/InvoiceLineItems.d.ts diff --git a/types/2022-08-01/Invoices.d.ts b/types/2022-11-15/Invoices.d.ts similarity index 100% rename from types/2022-08-01/Invoices.d.ts rename to types/2022-11-15/Invoices.d.ts diff --git a/types/2022-08-01/Issuing/Authorizations.d.ts b/types/2022-11-15/Issuing/Authorizations.d.ts similarity index 100% rename from types/2022-08-01/Issuing/Authorizations.d.ts rename to types/2022-11-15/Issuing/Authorizations.d.ts diff --git a/types/2022-08-01/Issuing/Cardholders.d.ts b/types/2022-11-15/Issuing/Cardholders.d.ts similarity index 100% rename from types/2022-08-01/Issuing/Cardholders.d.ts rename to types/2022-11-15/Issuing/Cardholders.d.ts diff --git a/types/2022-08-01/Issuing/Cards.d.ts b/types/2022-11-15/Issuing/Cards.d.ts similarity index 100% rename from types/2022-08-01/Issuing/Cards.d.ts rename to types/2022-11-15/Issuing/Cards.d.ts diff --git a/types/2022-08-01/Issuing/Disputes.d.ts b/types/2022-11-15/Issuing/Disputes.d.ts similarity index 100% rename from types/2022-08-01/Issuing/Disputes.d.ts rename to types/2022-11-15/Issuing/Disputes.d.ts diff --git a/types/2022-08-01/Issuing/Transactions.d.ts b/types/2022-11-15/Issuing/Transactions.d.ts similarity index 100% rename from types/2022-08-01/Issuing/Transactions.d.ts rename to types/2022-11-15/Issuing/Transactions.d.ts diff --git a/types/2022-08-01/LineItems.d.ts b/types/2022-11-15/LineItems.d.ts similarity index 93% rename from types/2022-08-01/LineItems.d.ts rename to types/2022-11-15/LineItems.d.ts index eff3ec0f3c..9c88c9a8ba 100644 --- a/types/2022-08-01/LineItems.d.ts +++ b/types/2022-11-15/LineItems.d.ts @@ -56,13 +56,6 @@ declare module 'stripe' { */ price: Stripe.Price | null; - /** - * The ID of the product for this line item. - * - * This will always be the same as `price.product`. - */ - product?: string | Stripe.Product | Stripe.DeletedProduct; - /** * The quantity of products being purchased. */ diff --git a/types/2022-08-01/LoginLinks.d.ts b/types/2022-11-15/LoginLinks.d.ts similarity index 100% rename from types/2022-08-01/LoginLinks.d.ts rename to types/2022-11-15/LoginLinks.d.ts diff --git a/types/2022-08-01/Mandates.d.ts b/types/2022-11-15/Mandates.d.ts similarity index 100% rename from types/2022-08-01/Mandates.d.ts rename to types/2022-11-15/Mandates.d.ts diff --git a/types/2022-08-01/PaymentIntents.d.ts b/types/2022-11-15/PaymentIntents.d.ts similarity index 99% rename from types/2022-08-01/PaymentIntents.d.ts rename to types/2022-11-15/PaymentIntents.d.ts index 83b8bd9406..d9af3bb497 100644 --- a/types/2022-08-01/PaymentIntents.d.ts +++ b/types/2022-11-15/PaymentIntents.d.ts @@ -73,11 +73,6 @@ declare module 'stripe' { */ capture_method: PaymentIntent.CaptureMethod; - /** - * Charges that were created by this PaymentIntent, if any. - */ - charges?: ApiList; - /** * The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key. * @@ -123,6 +118,11 @@ declare module 'stripe' { */ last_payment_error: PaymentIntent.LastPaymentError | null; + /** + * The latest charge created by this payment intent. + */ + latest_charge?: string | Stripe.Charge | null; + /** * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. */ diff --git a/types/2022-08-01/PaymentLinks.d.ts b/types/2022-11-15/PaymentLinks.d.ts similarity index 100% rename from types/2022-08-01/PaymentLinks.d.ts rename to types/2022-11-15/PaymentLinks.d.ts diff --git a/types/2022-08-01/PaymentMethods.d.ts b/types/2022-11-15/PaymentMethods.d.ts similarity index 100% rename from types/2022-08-01/PaymentMethods.d.ts rename to types/2022-11-15/PaymentMethods.d.ts diff --git a/types/2022-08-01/Payouts.d.ts b/types/2022-11-15/Payouts.d.ts similarity index 100% rename from types/2022-08-01/Payouts.d.ts rename to types/2022-11-15/Payouts.d.ts diff --git a/types/2022-08-01/Persons.d.ts b/types/2022-11-15/Persons.d.ts similarity index 100% rename from types/2022-08-01/Persons.d.ts rename to types/2022-11-15/Persons.d.ts diff --git a/types/2022-08-01/Plans.d.ts b/types/2022-11-15/Plans.d.ts similarity index 100% rename from types/2022-08-01/Plans.d.ts rename to types/2022-11-15/Plans.d.ts diff --git a/types/2022-08-01/PlatformTaxFees.d.ts b/types/2022-11-15/PlatformTaxFees.d.ts similarity index 100% rename from types/2022-08-01/PlatformTaxFees.d.ts rename to types/2022-11-15/PlatformTaxFees.d.ts diff --git a/types/2022-08-01/Prices.d.ts b/types/2022-11-15/Prices.d.ts similarity index 100% rename from types/2022-08-01/Prices.d.ts rename to types/2022-11-15/Prices.d.ts diff --git a/types/2022-08-01/Products.d.ts b/types/2022-11-15/Products.d.ts similarity index 100% rename from types/2022-08-01/Products.d.ts rename to types/2022-11-15/Products.d.ts diff --git a/types/2022-08-01/PromotionCodes.d.ts b/types/2022-11-15/PromotionCodes.d.ts similarity index 100% rename from types/2022-08-01/PromotionCodes.d.ts rename to types/2022-11-15/PromotionCodes.d.ts diff --git a/types/2022-08-01/Quotes.d.ts b/types/2022-11-15/Quotes.d.ts similarity index 100% rename from types/2022-08-01/Quotes.d.ts rename to types/2022-11-15/Quotes.d.ts diff --git a/types/2022-08-01/Radar/EarlyFraudWarnings.d.ts b/types/2022-11-15/Radar/EarlyFraudWarnings.d.ts similarity index 100% rename from types/2022-08-01/Radar/EarlyFraudWarnings.d.ts rename to types/2022-11-15/Radar/EarlyFraudWarnings.d.ts diff --git a/types/2022-08-01/Radar/ValueListItems.d.ts b/types/2022-11-15/Radar/ValueListItems.d.ts similarity index 100% rename from types/2022-08-01/Radar/ValueListItems.d.ts rename to types/2022-11-15/Radar/ValueListItems.d.ts diff --git a/types/2022-08-01/Radar/ValueLists.d.ts b/types/2022-11-15/Radar/ValueLists.d.ts similarity index 100% rename from types/2022-08-01/Radar/ValueLists.d.ts rename to types/2022-11-15/Radar/ValueLists.d.ts diff --git a/types/2022-08-01/Refunds.d.ts b/types/2022-11-15/Refunds.d.ts similarity index 97% rename from types/2022-08-01/Refunds.d.ts rename to types/2022-11-15/Refunds.d.ts index 97e274cd4b..f620ad25da 100644 --- a/types/2022-08-01/Refunds.d.ts +++ b/types/2022-11-15/Refunds.d.ts @@ -7,10 +7,6 @@ declare module 'stripe' { * but not yet refunded. Funds will be refunded to the credit or debit card that * was originally charged. * - * Stripe Tax users with recurring payments and invoices can create [Credit Notes](https://stripe.com/docs/api/credit_notes), - * which reduce overall tax liability because tax is correctly recalculated and - * apportioned to the related invoice. - * * Related guide: [Refunds](https://stripe.com/docs/refunds). */ interface Refund { diff --git a/types/2022-08-01/Reporting/ReportRuns.d.ts b/types/2022-11-15/Reporting/ReportRuns.d.ts similarity index 100% rename from types/2022-08-01/Reporting/ReportRuns.d.ts rename to types/2022-11-15/Reporting/ReportRuns.d.ts diff --git a/types/2022-08-01/Reporting/ReportTypes.d.ts b/types/2022-11-15/Reporting/ReportTypes.d.ts similarity index 100% rename from types/2022-08-01/Reporting/ReportTypes.d.ts rename to types/2022-11-15/Reporting/ReportTypes.d.ts diff --git a/types/2022-08-01/ReserveTransactions.d.ts b/types/2022-11-15/ReserveTransactions.d.ts similarity index 100% rename from types/2022-08-01/ReserveTransactions.d.ts rename to types/2022-11-15/ReserveTransactions.d.ts diff --git a/types/2022-08-01/Reviews.d.ts b/types/2022-11-15/Reviews.d.ts similarity index 100% rename from types/2022-08-01/Reviews.d.ts rename to types/2022-11-15/Reviews.d.ts diff --git a/types/2022-08-01/SetupAttempts.d.ts b/types/2022-11-15/SetupAttempts.d.ts similarity index 100% rename from types/2022-08-01/SetupAttempts.d.ts rename to types/2022-11-15/SetupAttempts.d.ts diff --git a/types/2022-08-01/SetupIntents.d.ts b/types/2022-11-15/SetupIntents.d.ts similarity index 100% rename from types/2022-08-01/SetupIntents.d.ts rename to types/2022-11-15/SetupIntents.d.ts diff --git a/types/2022-08-01/ShippingRates.d.ts b/types/2022-11-15/ShippingRates.d.ts similarity index 100% rename from types/2022-08-01/ShippingRates.d.ts rename to types/2022-11-15/ShippingRates.d.ts diff --git a/types/2022-08-01/Sigma/ScheduledQueryRuns.d.ts b/types/2022-11-15/Sigma/ScheduledQueryRuns.d.ts similarity index 100% rename from types/2022-08-01/Sigma/ScheduledQueryRuns.d.ts rename to types/2022-11-15/Sigma/ScheduledQueryRuns.d.ts diff --git a/types/2022-08-01/SourceMandateNotifications.d.ts b/types/2022-11-15/SourceMandateNotifications.d.ts similarity index 100% rename from types/2022-08-01/SourceMandateNotifications.d.ts rename to types/2022-11-15/SourceMandateNotifications.d.ts diff --git a/types/2022-08-01/SourceTransactions.d.ts b/types/2022-11-15/SourceTransactions.d.ts similarity index 100% rename from types/2022-08-01/SourceTransactions.d.ts rename to types/2022-11-15/SourceTransactions.d.ts diff --git a/types/2022-08-01/Sources.d.ts b/types/2022-11-15/Sources.d.ts similarity index 100% rename from types/2022-08-01/Sources.d.ts rename to types/2022-11-15/Sources.d.ts diff --git a/types/2022-08-01/SubscriptionItems.d.ts b/types/2022-11-15/SubscriptionItems.d.ts similarity index 100% rename from types/2022-08-01/SubscriptionItems.d.ts rename to types/2022-11-15/SubscriptionItems.d.ts diff --git a/types/2022-08-01/SubscriptionSchedules.d.ts b/types/2022-11-15/SubscriptionSchedules.d.ts similarity index 100% rename from types/2022-08-01/SubscriptionSchedules.d.ts rename to types/2022-11-15/SubscriptionSchedules.d.ts diff --git a/types/2022-08-01/Subscriptions.d.ts b/types/2022-11-15/Subscriptions.d.ts similarity index 100% rename from types/2022-08-01/Subscriptions.d.ts rename to types/2022-11-15/Subscriptions.d.ts diff --git a/types/2022-08-01/TaxCodes.d.ts b/types/2022-11-15/TaxCodes.d.ts similarity index 100% rename from types/2022-08-01/TaxCodes.d.ts rename to types/2022-11-15/TaxCodes.d.ts diff --git a/types/2022-08-01/TaxDeductedAtSources.d.ts b/types/2022-11-15/TaxDeductedAtSources.d.ts similarity index 100% rename from types/2022-08-01/TaxDeductedAtSources.d.ts rename to types/2022-11-15/TaxDeductedAtSources.d.ts diff --git a/types/2022-08-01/TaxIds.d.ts b/types/2022-11-15/TaxIds.d.ts similarity index 100% rename from types/2022-08-01/TaxIds.d.ts rename to types/2022-11-15/TaxIds.d.ts diff --git a/types/2022-08-01/TaxRates.d.ts b/types/2022-11-15/TaxRates.d.ts similarity index 100% rename from types/2022-08-01/TaxRates.d.ts rename to types/2022-11-15/TaxRates.d.ts diff --git a/types/2022-08-01/Terminal/Configurations.d.ts b/types/2022-11-15/Terminal/Configurations.d.ts similarity index 100% rename from types/2022-08-01/Terminal/Configurations.d.ts rename to types/2022-11-15/Terminal/Configurations.d.ts diff --git a/types/2022-08-01/Terminal/ConnectionTokens.d.ts b/types/2022-11-15/Terminal/ConnectionTokens.d.ts similarity index 100% rename from types/2022-08-01/Terminal/ConnectionTokens.d.ts rename to types/2022-11-15/Terminal/ConnectionTokens.d.ts diff --git a/types/2022-08-01/Terminal/Locations.d.ts b/types/2022-11-15/Terminal/Locations.d.ts similarity index 100% rename from types/2022-08-01/Terminal/Locations.d.ts rename to types/2022-11-15/Terminal/Locations.d.ts diff --git a/types/2022-08-01/Terminal/Readers.d.ts b/types/2022-11-15/Terminal/Readers.d.ts similarity index 100% rename from types/2022-08-01/Terminal/Readers.d.ts rename to types/2022-11-15/Terminal/Readers.d.ts diff --git a/types/2022-08-01/TestHelpers/Customers.d.ts b/types/2022-11-15/TestHelpers/Customers.d.ts similarity index 100% rename from types/2022-08-01/TestHelpers/Customers.d.ts rename to types/2022-11-15/TestHelpers/Customers.d.ts diff --git a/types/2022-08-01/TestHelpers/Issuing/Cards.d.ts b/types/2022-11-15/TestHelpers/Issuing/Cards.d.ts similarity index 100% rename from types/2022-08-01/TestHelpers/Issuing/Cards.d.ts rename to types/2022-11-15/TestHelpers/Issuing/Cards.d.ts diff --git a/types/2022-08-01/TestHelpers/Refunds.d.ts b/types/2022-11-15/TestHelpers/Refunds.d.ts similarity index 100% rename from types/2022-08-01/TestHelpers/Refunds.d.ts rename to types/2022-11-15/TestHelpers/Refunds.d.ts diff --git a/types/2022-08-01/TestHelpers/Terminal/Readers.d.ts b/types/2022-11-15/TestHelpers/Terminal/Readers.d.ts similarity index 100% rename from types/2022-08-01/TestHelpers/Terminal/Readers.d.ts rename to types/2022-11-15/TestHelpers/Terminal/Readers.d.ts diff --git a/types/2022-08-01/TestHelpers/TestClocks.d.ts b/types/2022-11-15/TestHelpers/TestClocks.d.ts similarity index 100% rename from types/2022-08-01/TestHelpers/TestClocks.d.ts rename to types/2022-11-15/TestHelpers/TestClocks.d.ts diff --git a/types/2022-08-01/TestHelpers/Treasury/InboundTransfers.d.ts b/types/2022-11-15/TestHelpers/Treasury/InboundTransfers.d.ts similarity index 100% rename from types/2022-08-01/TestHelpers/Treasury/InboundTransfers.d.ts rename to types/2022-11-15/TestHelpers/Treasury/InboundTransfers.d.ts diff --git a/types/2022-08-01/TestHelpers/Treasury/OutboundPayments.d.ts b/types/2022-11-15/TestHelpers/Treasury/OutboundPayments.d.ts similarity index 100% rename from types/2022-08-01/TestHelpers/Treasury/OutboundPayments.d.ts rename to types/2022-11-15/TestHelpers/Treasury/OutboundPayments.d.ts diff --git a/types/2022-08-01/TestHelpers/Treasury/OutboundTransfers.d.ts b/types/2022-11-15/TestHelpers/Treasury/OutboundTransfers.d.ts similarity index 100% rename from types/2022-08-01/TestHelpers/Treasury/OutboundTransfers.d.ts rename to types/2022-11-15/TestHelpers/Treasury/OutboundTransfers.d.ts diff --git a/types/2022-08-01/TestHelpers/Treasury/ReceivedCredits.d.ts b/types/2022-11-15/TestHelpers/Treasury/ReceivedCredits.d.ts similarity index 100% rename from types/2022-08-01/TestHelpers/Treasury/ReceivedCredits.d.ts rename to types/2022-11-15/TestHelpers/Treasury/ReceivedCredits.d.ts diff --git a/types/2022-08-01/TestHelpers/Treasury/ReceivedDebits.d.ts b/types/2022-11-15/TestHelpers/Treasury/ReceivedDebits.d.ts similarity index 100% rename from types/2022-08-01/TestHelpers/Treasury/ReceivedDebits.d.ts rename to types/2022-11-15/TestHelpers/Treasury/ReceivedDebits.d.ts diff --git a/types/2022-08-01/Tokens.d.ts b/types/2022-11-15/Tokens.d.ts similarity index 100% rename from types/2022-08-01/Tokens.d.ts rename to types/2022-11-15/Tokens.d.ts diff --git a/types/2022-08-01/Topups.d.ts b/types/2022-11-15/Topups.d.ts similarity index 100% rename from types/2022-08-01/Topups.d.ts rename to types/2022-11-15/Topups.d.ts diff --git a/types/2022-08-01/TransferReversals.d.ts b/types/2022-11-15/TransferReversals.d.ts similarity index 100% rename from types/2022-08-01/TransferReversals.d.ts rename to types/2022-11-15/TransferReversals.d.ts diff --git a/types/2022-08-01/Transfers.d.ts b/types/2022-11-15/Transfers.d.ts similarity index 100% rename from types/2022-08-01/Transfers.d.ts rename to types/2022-11-15/Transfers.d.ts diff --git a/types/2022-08-01/Treasury/CreditReversals.d.ts b/types/2022-11-15/Treasury/CreditReversals.d.ts similarity index 100% rename from types/2022-08-01/Treasury/CreditReversals.d.ts rename to types/2022-11-15/Treasury/CreditReversals.d.ts diff --git a/types/2022-08-01/Treasury/DebitReversals.d.ts b/types/2022-11-15/Treasury/DebitReversals.d.ts similarity index 100% rename from types/2022-08-01/Treasury/DebitReversals.d.ts rename to types/2022-11-15/Treasury/DebitReversals.d.ts diff --git a/types/2022-08-01/Treasury/FinancialAccountFeatures.d.ts b/types/2022-11-15/Treasury/FinancialAccountFeatures.d.ts similarity index 100% rename from types/2022-08-01/Treasury/FinancialAccountFeatures.d.ts rename to types/2022-11-15/Treasury/FinancialAccountFeatures.d.ts diff --git a/types/2022-08-01/Treasury/FinancialAccounts.d.ts b/types/2022-11-15/Treasury/FinancialAccounts.d.ts similarity index 100% rename from types/2022-08-01/Treasury/FinancialAccounts.d.ts rename to types/2022-11-15/Treasury/FinancialAccounts.d.ts diff --git a/types/2022-08-01/Treasury/InboundTransfers.d.ts b/types/2022-11-15/Treasury/InboundTransfers.d.ts similarity index 100% rename from types/2022-08-01/Treasury/InboundTransfers.d.ts rename to types/2022-11-15/Treasury/InboundTransfers.d.ts diff --git a/types/2022-08-01/Treasury/OutboundPayments.d.ts b/types/2022-11-15/Treasury/OutboundPayments.d.ts similarity index 100% rename from types/2022-08-01/Treasury/OutboundPayments.d.ts rename to types/2022-11-15/Treasury/OutboundPayments.d.ts diff --git a/types/2022-08-01/Treasury/OutboundTransfers.d.ts b/types/2022-11-15/Treasury/OutboundTransfers.d.ts similarity index 100% rename from types/2022-08-01/Treasury/OutboundTransfers.d.ts rename to types/2022-11-15/Treasury/OutboundTransfers.d.ts diff --git a/types/2022-08-01/Treasury/ReceivedCredits.d.ts b/types/2022-11-15/Treasury/ReceivedCredits.d.ts similarity index 100% rename from types/2022-08-01/Treasury/ReceivedCredits.d.ts rename to types/2022-11-15/Treasury/ReceivedCredits.d.ts diff --git a/types/2022-08-01/Treasury/ReceivedDebits.d.ts b/types/2022-11-15/Treasury/ReceivedDebits.d.ts similarity index 100% rename from types/2022-08-01/Treasury/ReceivedDebits.d.ts rename to types/2022-11-15/Treasury/ReceivedDebits.d.ts diff --git a/types/2022-08-01/Treasury/TransactionEntries.d.ts b/types/2022-11-15/Treasury/TransactionEntries.d.ts similarity index 100% rename from types/2022-08-01/Treasury/TransactionEntries.d.ts rename to types/2022-11-15/Treasury/TransactionEntries.d.ts diff --git a/types/2022-08-01/Treasury/Transactions.d.ts b/types/2022-11-15/Treasury/Transactions.d.ts similarity index 100% rename from types/2022-08-01/Treasury/Transactions.d.ts rename to types/2022-11-15/Treasury/Transactions.d.ts diff --git a/types/2022-08-01/UsageRecordSummaries.d.ts b/types/2022-11-15/UsageRecordSummaries.d.ts similarity index 100% rename from types/2022-08-01/UsageRecordSummaries.d.ts rename to types/2022-11-15/UsageRecordSummaries.d.ts diff --git a/types/2022-08-01/UsageRecords.d.ts b/types/2022-11-15/UsageRecords.d.ts similarity index 100% rename from types/2022-08-01/UsageRecords.d.ts rename to types/2022-11-15/UsageRecords.d.ts diff --git a/types/2022-08-01/WebhookEndpoints.d.ts b/types/2022-11-15/WebhookEndpoints.d.ts similarity index 99% rename from types/2022-08-01/WebhookEndpoints.d.ts rename to types/2022-11-15/WebhookEndpoints.d.ts index 17d2b739e1..fcdb1516f5 100644 --- a/types/2022-08-01/WebhookEndpoints.d.ts +++ b/types/2022-11-15/WebhookEndpoints.d.ts @@ -230,7 +230,8 @@ declare module 'stripe' { | '2019-12-03' | '2020-03-02' | '2020-08-27' - | '2022-08-01'; + | '2022-08-01' + | '2022-11-15'; type EnabledEvent = | '*' diff --git a/types/2022-08-01/index.d.ts b/types/2022-11-15/index.d.ts similarity index 91% rename from types/2022-08-01/index.d.ts rename to types/2022-11-15/index.d.ts index ab72cdea9f..d53f23723c 100644 --- a/types/2022-08-01/index.d.ts +++ b/types/2022-11-15/index.d.ts @@ -59,7 +59,6 @@ /// /// /// -/// /// /// /// @@ -79,7 +78,6 @@ /// /// /// -/// /// /// /// @@ -136,8 +134,6 @@ declare module 'stripe' { constructor(apiKey: string, config: Stripe.StripeConfig); - setAppInfo(info: Stripe.AppInfo): void; - StripeResource: Stripe.StripeResource; /** @@ -163,7 +159,6 @@ declare module 'stripe' { invoices: Stripe.InvoicesResource; invoiceItems: Stripe.InvoiceItemsResource; mandates: Stripe.MandatesResource; - orders: Stripe.OrdersResource; paymentIntents: Stripe.PaymentIntentsResource; paymentLinks: Stripe.PaymentLinksResource; paymentMethods: Stripe.PaymentMethodsResource; @@ -178,7 +173,6 @@ declare module 'stripe' { setupAttempts: Stripe.SetupAttemptsResource; setupIntents: Stripe.SetupIntentsResource; shippingRates: Stripe.ShippingRatesResource; - skus: Stripe.SkusResource; sources: Stripe.SourcesResource; subscriptions: Stripe.SubscriptionsResource; subscriptionItems: Stripe.SubscriptionItemsResource; @@ -285,27 +279,6 @@ declare module 'stripe' { event: 'response', handler: (event: Stripe.ResponseEvent) => void ): void; - - setProtocol(protocol: string): void; - - /** @deprecated Please use the StripeConfig object instead. */ - setHost(host: string, port?: string | number, protocol?: string): void; - - /** @deprecated Please use the StripeConfig object instead. */ - setPort(port: string | number): void; - /** @deprecated Please use the StripeConfig object instead. */ - setApiVersion(version: Stripe.LatestApiVersion): void; - /** @deprecated Please use the StripeConfig object instead. */ - setApiKey(key: string): void; - - /** @deprecated Please use the StripeConfig object instead. */ - setTimeout(timeout?: number): void; - /** @deprecated Please use the StripeConfig object instead. */ - setMaxNetworkRetries(maxNetworkRetries: number): void; - /** @deprecated Please use the StripeConfig object instead. */ - setTelemetryEnabled(enabled: boolean): void; - /** @deprecated Please use the StripeConfig object instead. */ - setHttpAgent(agent: Stripe.HttpAgent): void; } export default Stripe; diff --git a/types/lib.d.ts b/types/lib.d.ts index cf4b19e211..f63308e3a4 100644 --- a/types/lib.d.ts +++ b/types/lib.d.ts @@ -52,7 +52,7 @@ declare module 'stripe' { }; static MAX_BUFFERED_REQUEST_METRICS: number; } - export type LatestApiVersion = '2022-08-01'; + export type LatestApiVersion = '2022-11-15'; export type HttpAgent = Agent; export type HttpProtocol = 'http' | 'https'; diff --git a/types/test/typescriptTest.ts b/types/test/typescriptTest.ts index ebd0b7da64..08c2418b2b 100644 --- a/types/test/typescriptTest.ts +++ b/types/test/typescriptTest.ts @@ -5,11 +5,11 @@ * and to perform a basic sanity check that types are exported as intended. */ -/// +/// import Stripe from 'stripe'; let stripe = new Stripe('sk_test_123', { - apiVersion: '2022-08-01', + apiVersion: '2022-11-15', }); // @ts-ignore lazily ignore apiVersion requirement. @@ -27,7 +27,7 @@ stripe = new Stripe('sk_test_123', { // Check config object. stripe = new Stripe('sk_test_123', { - apiVersion: '2022-08-01', + apiVersion: '2022-11-15', typescript: true, maxNetworkRetries: 1, timeout: 1000, @@ -35,21 +35,17 @@ stripe = new Stripe('sk_test_123', { port: 123, telemetry: true, httpClient: Stripe.createNodeHttpClient(), + appInfo: { + name: 'my-wordpress-plugin', + }, }); -stripe.setTimeout(3000); -stripe.setAppInfo({ - name: 'my-wordpress-plugin', -}); - -stripe.setHost('host', 'port', 'protocol'); - (async (): Promise => { const params: Stripe.CustomerCreateParams = { description: 'test', }; const opts: Stripe.RequestOptions = { - apiVersion: '2022-08-01', + apiVersion: '2022-11-15', }; const customer: Stripe.Customer = await stripe.customers.create(params, opts);