├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ ├── config.yml │ └── feature_request.yml ├── pull_request_template.md └── workflows │ ├── main.yml │ └── rules.yml ├── .gitignore ├── .mise.toml ├── .mocharc.js ├── .npmignore ├── .npmrc ├── .prettierignore ├── .prettierrc ├── .vscode ├── extensions.json └── settings.json ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── Makefile ├── OPENAPI_VERSION ├── README.md ├── VERSION ├── examples ├── snippets │ ├── README.md │ ├── example_template.ts │ ├── meter_event_stream.ts │ ├── package.json │ ├── thinevent_webhook_handler.js │ └── yarn.lock └── webhook-signing │ ├── .env.example │ ├── .eslintrc.js │ ├── .gitignore │ ├── README.md │ ├── deno │ ├── main.ts │ └── package.json │ ├── express │ ├── main.ts │ └── package.json │ ├── koa │ ├── main.ts │ └── package.json │ ├── nestjs │ ├── app.controller.ts │ ├── app.module.ts │ ├── config.ts │ ├── main.ts │ └── package.json │ ├── nextjs │ ├── .gitignore │ ├── app │ │ └── api │ │ │ └── webhooks │ │ │ └── route.ts │ ├── main.ts │ ├── next-env.d.ts │ ├── package.json │ └── pages │ │ └── api │ │ └── webhooks.ts │ ├── prepare.sh │ ├── test │ ├── main.ts │ └── package.json │ └── tsconfig.json ├── justfile ├── package.json ├── scripts └── updateAPIVersion.js ├── src ├── Error.ts ├── RequestSender.ts ├── ResourceNamespace.ts ├── StripeEmitter.ts ├── StripeMethod.ts ├── StripeResource.ts ├── Types.d.ts ├── Webhooks.ts ├── apiVersion.ts ├── autoPagination.ts ├── crypto │ ├── CryptoProvider.ts │ ├── NodeCryptoProvider.ts │ └── SubtleCryptoProvider.ts ├── multipart.ts ├── net │ ├── FetchHttpClient.ts │ ├── HttpClient.ts │ └── NodeHttpClient.ts ├── platform │ ├── NodePlatformFunctions.ts │ ├── PlatformFunctions.ts │ └── WebPlatformFunctions.ts ├── resources.ts ├── resources │ ├── AccountLinks.ts │ ├── AccountSessions.ts │ ├── Accounts.ts │ ├── ApplePayDomains.ts │ ├── ApplicationFees.ts │ ├── Apps │ │ └── Secrets.ts │ ├── Balance.ts │ ├── BalanceTransactions.ts │ ├── Billing │ │ ├── Alerts.ts │ │ ├── CreditBalanceSummary.ts │ │ ├── CreditBalanceTransactions.ts │ │ ├── CreditGrants.ts │ │ ├── MeterEventAdjustments.ts │ │ ├── MeterEvents.ts │ │ └── Meters.ts │ ├── BillingPortal │ │ ├── Configurations.ts │ │ └── Sessions.ts │ ├── Charges.ts │ ├── Checkout │ │ └── Sessions.ts │ ├── Climate │ │ ├── Orders.ts │ │ ├── Products.ts │ │ └── Suppliers.ts │ ├── ConfirmationTokens.ts │ ├── CountrySpecs.ts │ ├── Coupons.ts │ ├── CreditNotes.ts │ ├── CustomerSessions.ts │ ├── Customers.ts │ ├── Disputes.ts │ ├── Entitlements │ │ ├── ActiveEntitlements.ts │ │ └── Features.ts │ ├── EphemeralKeys.ts │ ├── Events.ts │ ├── ExchangeRates.ts │ ├── FileLinks.ts │ ├── Files.ts │ ├── FinancialConnections │ │ ├── Accounts.ts │ │ ├── Sessions.ts │ │ └── Transactions.ts │ ├── Forwarding │ │ └── Requests.ts │ ├── Identity │ │ ├── VerificationReports.ts │ │ └── VerificationSessions.ts │ ├── InvoiceItems.ts │ ├── InvoicePayments.ts │ ├── InvoiceRenderingTemplates.ts │ ├── Invoices.ts │ ├── Issuing │ │ ├── Authorizations.ts │ │ ├── Cardholders.ts │ │ ├── Cards.ts │ │ ├── Disputes.ts │ │ ├── PersonalizationDesigns.ts │ │ ├── PhysicalBundles.ts │ │ ├── Tokens.ts │ │ └── Transactions.ts │ ├── Mandates.ts │ ├── OAuth.ts │ ├── PaymentIntents.ts │ ├── PaymentLinks.ts │ ├── PaymentMethodConfigurations.ts │ ├── PaymentMethodDomains.ts │ ├── PaymentMethods.ts │ ├── Payouts.ts │ ├── Plans.ts │ ├── Prices.ts │ ├── Products.ts │ ├── PromotionCodes.ts │ ├── Quotes.ts │ ├── Radar │ │ ├── EarlyFraudWarnings.ts │ │ ├── ValueListItems.ts │ │ └── ValueLists.ts │ ├── Refunds.ts │ ├── Reporting │ │ ├── ReportRuns.ts │ │ └── ReportTypes.ts │ ├── Reviews.ts │ ├── SetupAttempts.ts │ ├── SetupIntents.ts │ ├── ShippingRates.ts │ ├── Sigma │ │ └── ScheduledQueryRuns.ts │ ├── Sources.ts │ ├── SubscriptionItems.ts │ ├── SubscriptionSchedules.ts │ ├── Subscriptions.ts │ ├── Tax │ │ ├── Calculations.ts │ │ ├── Registrations.ts │ │ ├── Settings.ts │ │ └── Transactions.ts │ ├── TaxCodes.ts │ ├── TaxIds.ts │ ├── TaxRates.ts │ ├── Terminal │ │ ├── Configurations.ts │ │ ├── ConnectionTokens.ts │ │ ├── Locations.ts │ │ └── Readers.ts │ ├── TestHelpers │ │ ├── ConfirmationTokens.ts │ │ ├── Customers.ts │ │ ├── Issuing │ │ │ ├── Authorizations.ts │ │ │ ├── Cards.ts │ │ │ ├── PersonalizationDesigns.ts │ │ │ └── Transactions.ts │ │ ├── Refunds.ts │ │ ├── Terminal │ │ │ └── Readers.ts │ │ ├── TestClocks.ts │ │ └── Treasury │ │ │ ├── InboundTransfers.ts │ │ │ ├── OutboundPayments.ts │ │ │ ├── OutboundTransfers.ts │ │ │ ├── ReceivedCredits.ts │ │ │ └── ReceivedDebits.ts │ ├── Tokens.ts │ ├── Topups.ts │ ├── Transfers.ts │ ├── Treasury │ │ ├── CreditReversals.ts │ │ ├── DebitReversals.ts │ │ ├── FinancialAccounts.ts │ │ ├── InboundTransfers.ts │ │ ├── OutboundPayments.ts │ │ ├── OutboundTransfers.ts │ │ ├── ReceivedCredits.ts │ │ ├── ReceivedDebits.ts │ │ ├── TransactionEntries.ts │ │ └── Transactions.ts │ ├── V2 │ │ ├── Billing │ │ │ ├── MeterEventAdjustments.ts │ │ │ ├── MeterEventSession.ts │ │ │ ├── MeterEventStream.ts │ │ │ └── MeterEvents.ts │ │ └── Core │ │ │ ├── EventDestinations.ts │ │ │ └── Events.ts │ └── WebhookEndpoints.ts ├── stripe.cjs.node.ts ├── stripe.cjs.worker.ts ├── stripe.core.ts ├── stripe.esm.node.ts ├── stripe.esm.worker.ts └── utils.ts ├── test ├── .eslintrc.js ├── Error.spec.ts ├── Integration.spec.ts ├── PlatformFunctions.spec.ts ├── RequestSender.spec.ts ├── StripeResource.spec.ts ├── Webhook.spec.ts ├── autoPagination.spec.ts ├── crypto │ ├── NodeCryptoProvider.spec.ts │ ├── SubtleCryptoProvider.spec.ts │ └── helpers.ts ├── net │ ├── FetchHttpClient.spec.ts │ ├── NodeHttpClient.spec.ts │ └── helpers.ts ├── resources │ ├── Account.spec.js │ ├── AccountLinks.spec.js │ ├── ApplePayDomains.spec.js │ ├── ApplicationFees.spec.js │ ├── Balance.spec.js │ ├── BalanceTransactions.spec.js │ ├── BillingPortal │ │ ├── Configurations.spec.js │ │ └── Sessions.spec.js │ ├── Charges.spec.js │ ├── Checkout │ │ └── Sessions.spec.js │ ├── CountrySpecs.spec.js │ ├── Coupons.spec.js │ ├── CreditNotes.spec.js │ ├── Customers.spec.js │ ├── Disputes.spec.js │ ├── EphemeralKeys.spec.js │ ├── Events.spec.js │ ├── ExchangeRates.spec.js │ ├── FileLinks.spec.js │ ├── Files.spec.js │ ├── Identity │ │ ├── VerificationReport.spec.js │ │ └── VerificationSession.spec.js │ ├── Integration.spec.js │ ├── InvoiceItems.spec.js │ ├── Invoices.spec.js │ ├── Issuing │ │ ├── Authorization.spec.js │ │ ├── Cardholders.spec.js │ │ ├── Cards.spec.js │ │ ├── Disputes.spec.js │ │ └── Transactions.spec.js │ ├── Mandates.spec.js │ ├── OAuth.spec.js │ ├── PaymentIntents.spec.js │ ├── PaymentMethods.spec.js │ ├── Payouts.spec.js │ ├── Plans.spec.js │ ├── Prices.spec.js │ ├── Products.spec.js │ ├── PromotionCodes.spec.js │ ├── Quotes.spec.js │ ├── Radar │ │ ├── EarlyFraudWarnings.spec.js │ │ ├── ValueListItems.spec.js │ │ └── ValueLists.spec.js │ ├── Refunds.spec.js │ ├── Reporting │ │ ├── ReportRuns.spec.js │ │ └── ReportTypes.spec.js │ ├── Reviews.spec.js │ ├── SetupAttempts.spec.js │ ├── SetupIntents.spec.js │ ├── Sigma │ │ └── ScheduledQueryRuns.spec.js │ ├── Sources.spec.js │ ├── SubscriptionItems.spec.js │ ├── SubscriptionSchedule.spec.js │ ├── Subscriptions.spec.js │ ├── TaxCodes.spec.js │ ├── TaxRates.spec.js │ ├── Terminal │ │ ├── ConnectionTokens.spec.js │ │ ├── Locations.spec.js │ │ └── Readers.spec.js │ ├── TestHelpers │ │ └── Terminal │ │ │ └── Readers.spec.js │ ├── Tokens.spec.js │ ├── Topups.spec.js │ ├── Transfers.spec.js │ ├── V2 │ │ └── Core │ │ │ └── Events.spec.js │ ├── WebhookEndpoints.spec.js │ ├── data │ │ └── minimal.pdf │ └── generated_examples_test.spec.js ├── setup.js ├── stripe.spec.ts ├── telemetry.spec.ts ├── testUtils.ts └── utils.spec.ts ├── testProjects ├── cjs │ ├── .eslintrc.js │ ├── index.js │ └── package.json ├── cloudflare-pages │ ├── functions │ │ └── index.js │ └── package.json ├── cloudflare-worker │ ├── package.json │ ├── src │ │ └── index.js │ └── wrangler.toml ├── esbuild │ ├── index.js │ └── package.json ├── mjs-ts │ ├── .eslintrc.js │ ├── index.ts │ └── package.json └── mjs │ ├── .eslintrc.cjs │ ├── index.js │ └── package.json ├── tsconfig.cjs.json ├── tsconfig.esm.json ├── tsconfig.json ├── types ├── .eslintrc.js ├── AccountLinks.d.ts ├── AccountLinksResource.d.ts ├── AccountSessions.d.ts ├── AccountSessionsResource.d.ts ├── Accounts.d.ts ├── AccountsResource.d.ts ├── ApplePayDomains.d.ts ├── ApplePayDomainsResource.d.ts ├── ApplicationFees.d.ts ├── ApplicationFeesResource.d.ts ├── Applications.d.ts ├── Apps │ ├── Secrets.d.ts │ └── SecretsResource.d.ts ├── Balance.d.ts ├── BalanceResource.d.ts ├── BalanceTransactionSources.d.ts ├── BalanceTransactions.d.ts ├── BalanceTransactionsResource.d.ts ├── BankAccounts.d.ts ├── Billing │ ├── AlertTriggereds.d.ts │ ├── Alerts.d.ts │ ├── AlertsResource.d.ts │ ├── CreditBalanceSummary.d.ts │ ├── CreditBalanceSummaryResource.d.ts │ ├── CreditBalanceTransactions.d.ts │ ├── CreditBalanceTransactionsResource.d.ts │ ├── CreditGrants.d.ts │ ├── CreditGrantsResource.d.ts │ ├── MeterEventAdjustments.d.ts │ ├── MeterEventAdjustmentsResource.d.ts │ ├── MeterEventSummaries.d.ts │ ├── MeterEvents.d.ts │ ├── MeterEventsResource.d.ts │ ├── Meters.d.ts │ └── MetersResource.d.ts ├── BillingPortal │ ├── Configurations.d.ts │ ├── ConfigurationsResource.d.ts │ ├── Sessions.d.ts │ └── SessionsResource.d.ts ├── Capabilities.d.ts ├── Cards.d.ts ├── CashBalances.d.ts ├── Charges.d.ts ├── ChargesResource.d.ts ├── Checkout │ ├── Sessions.d.ts │ └── SessionsResource.d.ts ├── Climate │ ├── Orders.d.ts │ ├── OrdersResource.d.ts │ ├── Products.d.ts │ ├── ProductsResource.d.ts │ ├── Suppliers.d.ts │ └── SuppliersResource.d.ts ├── ConfirmationTokens.d.ts ├── ConfirmationTokensResource.d.ts ├── ConnectCollectionTransfers.d.ts ├── CountrySpecs.d.ts ├── CountrySpecsResource.d.ts ├── Coupons.d.ts ├── CouponsResource.d.ts ├── CreditNoteLineItems.d.ts ├── CreditNotes.d.ts ├── CreditNotesResource.d.ts ├── CustomerBalanceTransactions.d.ts ├── CustomerCashBalanceTransactions.d.ts ├── CustomerSessions.d.ts ├── CustomerSessionsResource.d.ts ├── CustomerSources.d.ts ├── Customers.d.ts ├── CustomersResource.d.ts ├── Discounts.d.ts ├── Disputes.d.ts ├── DisputesResource.d.ts ├── Entitlements │ ├── ActiveEntitlementSummaries.d.ts │ ├── ActiveEntitlements.d.ts │ ├── ActiveEntitlementsResource.d.ts │ ├── Features.d.ts │ └── FeaturesResource.d.ts ├── EphemeralKeys.d.ts ├── EphemeralKeysResource.d.ts ├── Errors.d.ts ├── EventTypes.d.ts ├── Events.d.ts ├── EventsResource.d.ts ├── ExchangeRates.d.ts ├── ExchangeRatesResource.d.ts ├── ExternalAccounts.d.ts ├── FeeRefunds.d.ts ├── FileLinks.d.ts ├── FileLinksResource.d.ts ├── Files.d.ts ├── FilesResource.d.ts ├── FinancialConnections │ ├── AccountOwners.d.ts │ ├── AccountOwnerships.d.ts │ ├── Accounts.d.ts │ ├── AccountsResource.d.ts │ ├── Sessions.d.ts │ ├── SessionsResource.d.ts │ ├── Transactions.d.ts │ └── TransactionsResource.d.ts ├── Forwarding │ ├── Requests.d.ts │ └── RequestsResource.d.ts ├── FundingInstructions.d.ts ├── Identity │ ├── VerificationReports.d.ts │ ├── VerificationReportsResource.d.ts │ ├── VerificationSessions.d.ts │ └── VerificationSessionsResource.d.ts ├── InvoiceItems.d.ts ├── InvoiceItemsResource.d.ts ├── InvoiceLineItems.d.ts ├── InvoicePayments.d.ts ├── InvoicePaymentsResource.d.ts ├── InvoiceRenderingTemplates.d.ts ├── InvoiceRenderingTemplatesResource.d.ts ├── Invoices.d.ts ├── InvoicesResource.d.ts ├── Issuing │ ├── Authorizations.d.ts │ ├── AuthorizationsResource.d.ts │ ├── Cardholders.d.ts │ ├── CardholdersResource.d.ts │ ├── Cards.d.ts │ ├── CardsResource.d.ts │ ├── Disputes.d.ts │ ├── DisputesResource.d.ts │ ├── PersonalizationDesigns.d.ts │ ├── PersonalizationDesignsResource.d.ts │ ├── PhysicalBundles.d.ts │ ├── PhysicalBundlesResource.d.ts │ ├── Tokens.d.ts │ ├── TokensResource.d.ts │ ├── Transactions.d.ts │ └── TransactionsResource.d.ts ├── LineItems.d.ts ├── LoginLinks.d.ts ├── Mandates.d.ts ├── MandatesResource.d.ts ├── OAuth.d.ts ├── PaymentIntents.d.ts ├── PaymentIntentsResource.d.ts ├── PaymentLinks.d.ts ├── PaymentLinksResource.d.ts ├── PaymentMethodConfigurations.d.ts ├── PaymentMethodConfigurationsResource.d.ts ├── PaymentMethodDomains.d.ts ├── PaymentMethodDomainsResource.d.ts ├── PaymentMethods.d.ts ├── PaymentMethodsResource.d.ts ├── Payouts.d.ts ├── PayoutsResource.d.ts ├── Persons.d.ts ├── Plans.d.ts ├── PlansResource.d.ts ├── Prices.d.ts ├── PricesResource.d.ts ├── ProductFeatures.d.ts ├── Products.d.ts ├── ProductsResource.d.ts ├── PromotionCodes.d.ts ├── PromotionCodesResource.d.ts ├── Quotes.d.ts ├── QuotesResource.d.ts ├── Radar │ ├── EarlyFraudWarnings.d.ts │ ├── EarlyFraudWarningsResource.d.ts │ ├── ValueListItems.d.ts │ ├── ValueListItemsResource.d.ts │ ├── ValueLists.d.ts │ └── ValueListsResource.d.ts ├── Refunds.d.ts ├── RefundsResource.d.ts ├── Reporting │ ├── ReportRuns.d.ts │ ├── ReportRunsResource.d.ts │ ├── ReportTypes.d.ts │ └── ReportTypesResource.d.ts ├── ReserveTransactions.d.ts ├── Reviews.d.ts ├── ReviewsResource.d.ts ├── SetupAttempts.d.ts ├── SetupAttemptsResource.d.ts ├── SetupIntents.d.ts ├── SetupIntentsResource.d.ts ├── ShippingRates.d.ts ├── ShippingRatesResource.d.ts ├── Sigma │ ├── ScheduledQueryRuns.d.ts │ └── ScheduledQueryRunsResource.d.ts ├── SourceMandateNotifications.d.ts ├── SourceTransactions.d.ts ├── Sources.d.ts ├── SourcesResource.d.ts ├── SubscriptionItems.d.ts ├── SubscriptionItemsResource.d.ts ├── SubscriptionSchedules.d.ts ├── SubscriptionSchedulesResource.d.ts ├── Subscriptions.d.ts ├── SubscriptionsResource.d.ts ├── Tax │ ├── CalculationLineItems.d.ts │ ├── Calculations.d.ts │ ├── CalculationsResource.d.ts │ ├── Registrations.d.ts │ ├── RegistrationsResource.d.ts │ ├── Settings.d.ts │ ├── SettingsResource.d.ts │ ├── TransactionLineItems.d.ts │ ├── Transactions.d.ts │ └── TransactionsResource.d.ts ├── TaxCodes.d.ts ├── TaxCodesResource.d.ts ├── TaxDeductedAtSources.d.ts ├── TaxIds.d.ts ├── TaxIdsResource.d.ts ├── TaxRates.d.ts ├── TaxRatesResource.d.ts ├── Terminal │ ├── Configurations.d.ts │ ├── ConfigurationsResource.d.ts │ ├── ConnectionTokens.d.ts │ ├── ConnectionTokensResource.d.ts │ ├── Locations.d.ts │ ├── LocationsResource.d.ts │ ├── Readers.d.ts │ └── ReadersResource.d.ts ├── TestHelpers │ ├── ConfirmationTokensResource.d.ts │ ├── CustomersResource.d.ts │ ├── Issuing │ │ ├── AuthorizationsResource.d.ts │ │ ├── CardsResource.d.ts │ │ ├── PersonalizationDesignsResource.d.ts │ │ └── TransactionsResource.d.ts │ ├── RefundsResource.d.ts │ ├── Terminal │ │ └── ReadersResource.d.ts │ ├── TestClocks.d.ts │ ├── TestClocksResource.d.ts │ └── Treasury │ │ ├── InboundTransfersResource.d.ts │ │ ├── OutboundPaymentsResource.d.ts │ │ ├── OutboundTransfersResource.d.ts │ │ ├── ReceivedCreditsResource.d.ts │ │ └── ReceivedDebitsResource.d.ts ├── ThinEvent.d.ts ├── Tokens.d.ts ├── TokensResource.d.ts ├── Topups.d.ts ├── TopupsResource.d.ts ├── TransferReversals.d.ts ├── Transfers.d.ts ├── TransfersResource.d.ts ├── Treasury │ ├── CreditReversals.d.ts │ ├── CreditReversalsResource.d.ts │ ├── DebitReversals.d.ts │ ├── DebitReversalsResource.d.ts │ ├── FinancialAccountFeatures.d.ts │ ├── FinancialAccounts.d.ts │ ├── FinancialAccountsResource.d.ts │ ├── InboundTransfers.d.ts │ ├── InboundTransfersResource.d.ts │ ├── OutboundPayments.d.ts │ ├── OutboundPaymentsResource.d.ts │ ├── OutboundTransfers.d.ts │ ├── OutboundTransfersResource.d.ts │ ├── ReceivedCredits.d.ts │ ├── ReceivedCreditsResource.d.ts │ ├── ReceivedDebits.d.ts │ ├── ReceivedDebitsResource.d.ts │ ├── TransactionEntries.d.ts │ ├── TransactionEntriesResource.d.ts │ ├── Transactions.d.ts │ └── TransactionsResource.d.ts ├── UpcomingInvoices.d.ts ├── V2 │ ├── Billing │ │ ├── MeterEventAdjustments.d.ts │ │ ├── MeterEventAdjustmentsResource.d.ts │ │ ├── MeterEventSessionResource.d.ts │ │ ├── MeterEventSessions.d.ts │ │ ├── MeterEventStreamResource.d.ts │ │ ├── MeterEvents.d.ts │ │ └── MeterEventsResource.d.ts │ ├── Core │ │ ├── EventDestinationsResource.d.ts │ │ └── EventsResource.d.ts │ ├── EventDestinations.d.ts │ ├── EventTypes.d.ts │ └── Events.d.ts ├── WebhookEndpoints.d.ts ├── WebhookEndpointsResource.d.ts ├── Webhooks.d.ts ├── crypto │ └── crypto.d.ts ├── index.d.ts ├── lib.d.ts ├── net │ └── net.d.ts ├── shared.d.ts └── test │ ├── .eslintrc.js │ ├── tsconfig.json │ └── typescriptTest.ts └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 2 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [justfile] 12 | indent_size = 4 13 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | *.node*.js 2 | node_modules 3 | cjs 4 | esm 5 | testProjects 6 | examples/** 7 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # All files should be reviewed by a member of the SDKs team 2 | * @stripe/api-library-reviewers 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Stripe support 4 | url: https://support.stripe.com/ 5 | about: | 6 | Please only file issues here that you believe represent actual bugs or feature requests for the Stripe Node library. 7 | 8 | If you're having general trouble with your Stripe integration, please reach out to support. 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: Feature request 2 | description: Suggest an idea for this library 3 | labels: ["feature-request"] 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: | 8 | Thanks for taking the time to fill out this feature request! 9 | - type: textarea 10 | id: problem 11 | attributes: 12 | label: Is your feature request related to a problem? Please describe. 13 | description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 14 | - type: textarea 15 | id: solution 16 | attributes: 17 | label: Describe the solution you'd like 18 | description: A clear and concise description of what you want to happen. 19 | - type: textarea 20 | id: alternatives 21 | attributes: 22 | label: Describe alternatives you've considered 23 | description: A clear and concise description of any alternative solutions or features you've considered. 24 | - type: textarea 25 | id: context 26 | attributes: 27 | label: Additional context 28 | description: Add any other context about the feature request here. 29 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ### Why? 2 | 3 | 4 | ### What? 5 | 9 | 10 | ### See Also 11 | 12 | -------------------------------------------------------------------------------- /.github/workflows/rules.yml: -------------------------------------------------------------------------------- 1 | 2 | name: rules 3 | 4 | on: 5 | workflow_dispatch: {} 6 | pull_request: 7 | types: 8 | - auto_merge_enabled 9 | 10 | jobs: 11 | require_merge_commit_on_merge_script_pr: 12 | name: Merge script PRs must create merge commits 13 | if: ${{ contains(github.head_ref, '/merge-') }} 14 | runs-on: ubuntu-latest 15 | steps: 16 | - run: | 17 | if ${{ github.event.pull_request.auto_merge.merge_method != 'merge' }}; then 18 | echo "Auto-merge method must be 'merge' instead of '${{github.event.pull_request.auto_merge.merge_method}}'" 19 | exit 1 20 | fi 21 | 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | cjs 3 | esm 4 | .npm-debug.log 5 | tags 6 | .nyc_output 7 | coverage 8 | .idea 9 | testProjects/**/node_modules 10 | testProjects/**/dist 11 | testProjects/**/package-lock.json 12 | testProjects/**/_worker.* 13 | -------------------------------------------------------------------------------- /.mise.toml: -------------------------------------------------------------------------------- 1 | [tools] 2 | # used in unit tests 3 | deno = "1" 4 | -------------------------------------------------------------------------------- /.mocharc.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // Configuration for our Mocha test suite. 4 | const config = { 5 | color: true, 6 | // Run tests in parallel. 7 | parallel: true, 8 | // Recurse through all tests in the test directory. 9 | recursive: true, 10 | extension: ["js", "ts"], 11 | require: "ts-node/register/transpile-only,./test/setup", 12 | }; 13 | 14 | if (process.argv.find(a => a.includes('WebStorm'))) { 15 | // Parallel doesn't work correctly when running from JetBrains WebStorm 16 | config.parallel = false; 17 | } 18 | 19 | // Ensure we are using the 'as promised' libs before any tests are run: 20 | require('chai').use(require('chai-as-promised')); 21 | 22 | module.exports = config; 23 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # This file is written to be a whitelist instead of a blacklist. Start by 2 | # ignoring everything, then add back the files we want to be included in the 3 | # final NPM package. 4 | * 5 | 6 | # And these are the files that are allowed. 7 | !/CHANGELOG.md 8 | !/LICENSE 9 | !/README.md 10 | !/VERSION 11 | !/OPENAPI_VERSION 12 | !/package.json 13 | !/cjs/**/* 14 | !/esm/**/* 15 | !/types/**/* 16 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | package-lock = false 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # internal files of the nextjs example 2 | .next 3 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "arrowParens": "always", 3 | "trailingComma": "es5", 4 | "bracketSpacing": false, 5 | "singleQuote": true 6 | } 7 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "EditorConfig.editorconfig", // default 4 | "dbaeumer.vscode-eslint", // linting 5 | "esbenp.prettier-vscode" // formatting 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | // Show the path in the top window bar. 3 | "window.title": "${rootName}${separator}${activeEditorMedium}", 4 | 5 | // Formatting 6 | "editor.formatOnSave": true, 7 | 8 | "typescript.updateImportsOnFileMove.enabled": "always", 9 | "javascript.updateImportsOnFileMove.enabled": "always", 10 | "[typescript][javascript]": { 11 | "editor.defaultFormatter": "esbenp.prettier-vscode" 12 | }, 13 | 14 | // Extension settings 15 | "npm.packageManager": "yarn", 16 | "editor.codeActionsOnSave": { 17 | "source.fixAll.eslint": "explicit", 18 | // eslint handles import sorting, don't let VSCode fight it 19 | "source.organizeImports": "never" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2011 Ask Bjørn Hansen 2 | Copyright (C) 2013 Stripe, Inc. (https://stripe.com) 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # NOTE: this file is deprecated and slated for deletion; prefer using the equivalent `just` commands. 2 | 3 | .PHONY: codegen-format update-version test ci-test 4 | update-version: 5 | @echo "$(VERSION)" > VERSION 6 | @perl -pi -e 's|"version": "[.\-\d\w]+"|"version": "$(VERSION)"|' package.json 7 | @perl -pi -e "s|Stripe.PACKAGE_VERSION = '[.\-\d\w]+'|Stripe.PACKAGE_VERSION = '$(VERSION)'|" src/stripe.core.ts 8 | 9 | codegen-format: 10 | yarn && yarn fix 11 | 12 | ci-test: 13 | yarn && yarn test 14 | 15 | test: ci-test 16 | -------------------------------------------------------------------------------- /OPENAPI_VERSION: -------------------------------------------------------------------------------- 1 | v1773 -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 18.2.1 2 | -------------------------------------------------------------------------------- /examples/snippets/README.md: -------------------------------------------------------------------------------- 1 | ## Setup 2 | 3 | 1. From the stripe-node root folder, run `just build` or `just build-dev` to build the modules. `just build-dev` produces source maps for each of the SDK .ts files. This is optional but very useful when troubleshooting SDK behavior. 4 | 2. Then, from this snippets folder, run `yarn` to install node dependencies for the example snippets. This will reference the local Stripe SDK modules created in step 1. 5 | 6 | If on step 2 you see an error `Error: unsure how to copy this: /Users/jar/stripe/sdks/node/.git/fsmonitor--daemon.ipc`: 7 | run `rm /path/to/node/sdk/.git/fsmonitor--daemon.ipc && yarn` 8 | This file is used by a file monitor built into git. Removing it temporarily does not seem to affect its operation, and this one liner will let `yarn` succeed. 9 | 10 | Note that if you modify the stripe-node code, rerun step 1 and then run `yarn upgrade stripe` from this folder to pull in the new built package. 11 | 12 | ## Running an example 13 | 14 | If your example is in typescript, run: 15 | `yarn run ts-node your_example.ts` 16 | 17 | If your example is in javascript, run: 18 | `node your_example.js` 19 | or 20 | `node your_example.mjs` 21 | 22 | ## Adding a new example 23 | 24 | 1. Clone new_example.ts 25 | 2. Implement your example 26 | 3. Run it (as per above) 27 | 4. 👍 28 | -------------------------------------------------------------------------------- /examples/snippets/example_template.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * example_template.py - This is a template for defining new examples. It is not intended to be used directly. 3 | 4 | * 5 | 6 | * In this example, we: 7 | * - 8 | * - 13 | */ 14 | 15 | import {Stripe} from 'stripe'; 16 | 17 | const apiKey = '{{API_KEY}}'; 18 | 19 | console.log('Hello World'); 20 | // const client = new Stripe(apiKey); 21 | // client.v2.... 22 | -------------------------------------------------------------------------------- /examples/snippets/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "snippets", 3 | "version": "1.0.0", 4 | "description": "example Stripe SDK code snippets", 5 | "main": "index.js", 6 | "license": "ISC", 7 | "dependencies": { 8 | "express": "^4.21.0", 9 | "stripe": "file:../..", 10 | "ts-node": "^10.9.2", 11 | "typescript": "^5.6.2" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/webhook-signing/.env.example: -------------------------------------------------------------------------------- 1 | # Stripe keys 2 | STRIPE_SECRET_KEY= 3 | STRIPE_WEBHOOK_SECRET=whsec_0000000000000000000000000000000000000000000000000000000000000000 4 | -------------------------------------------------------------------------------- /examples/webhook-signing/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | node: true, 4 | }, 5 | parserOptions: { 6 | warnOnUnsupportedTypeScriptVersion: false, 7 | }, 8 | root: true, 9 | parser: '@typescript-eslint/parser', 10 | plugins: ['@typescript-eslint', 'prettier'], 11 | extends: [ 12 | 'eslint:recommended', 13 | 'plugin:@typescript-eslint/eslint-recommended', 14 | 'plugin:@typescript-eslint/recommended', 15 | 'plugin:prettier/recommended', 16 | ], 17 | rules: { 18 | '@typescript-eslint/no-use-before-define': 0, 19 | '@typescript-eslint/no-empty-interface': 0, 20 | '@typescript-eslint/no-unused-vars': 0, 21 | '@typescript-eslint/triple-slash-reference': 0, 22 | '@typescript-eslint/ban-ts-ignore': 0, 23 | }, 24 | }; 25 | -------------------------------------------------------------------------------- /examples/webhook-signing/.gitignore: -------------------------------------------------------------------------------- 1 | */tsconfig.json 2 | **/.eslintrc.js 3 | **/package-lock.json 4 | .env 5 | express-ts.js 6 | deno.lock 7 | -------------------------------------------------------------------------------- /examples/webhook-signing/deno/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "webhook-signing-example-deno", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "./main.ts", 6 | "scripts": { 7 | "run": "deno run --allow-net --allow-env --allow-read main.ts", 8 | "prepare": "../prepare.sh" 9 | }, 10 | "author": "", 11 | "license": "ISC" 12 | } 13 | -------------------------------------------------------------------------------- /examples/webhook-signing/express/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "webhook-signing-example-express", 3 | "version": "1.0.0", 4 | "description": "Express webhook parsing sample", 5 | "repository": {}, 6 | "main": "./main.ts", 7 | "scripts": { 8 | "run": "ts-node-transpile-only ./main.ts", 9 | "prepare": "../prepare.sh" 10 | }, 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "dotenv": "^8.2.0", 15 | "express": "^4.17.1", 16 | "koa": "^2.14.1", 17 | "stripe": "^11.9.1" 18 | }, 19 | "devDependencies": { 20 | "eslint": "^8.33.0", 21 | "@types/koa": "^2.13.5", 22 | "@types/koa-bodyparser": "^4.3.10", 23 | "@types/node": "^13.1.4", 24 | "typescript": "^4.8.3", 25 | "ts-node": "^10.9.1" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /examples/webhook-signing/koa/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "webhook-signing-example-koa", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "./main.ts", 6 | "scripts": { 7 | "run": "ts-node-transpile-only ./main.ts", 8 | "prepare": "../prepare.sh" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "dotenv": "^8.2.0", 14 | "koa": "^2.14.1", 15 | "stripe": "^11.9.1", 16 | "koa-bodyparser": "^4.3.0" 17 | }, 18 | "devDependencies": { 19 | "eslint": "^8.33.0", 20 | "@types/node": "^13.1.4", 21 | "@types/koa": "^2.13.5", 22 | "@types/koa-bodyparser": "^4.3.10", 23 | "typescript": "^4.8.3", 24 | "ts-node": "^10.9.1" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /examples/webhook-signing/nestjs/app.module.ts: -------------------------------------------------------------------------------- 1 | import {Module} from '@nestjs/common'; 2 | import {ConfigModule} from '@nestjs/config'; 3 | import {config} from './config'; 4 | import {AppController} from './app.controller'; 5 | 6 | @Module({ 7 | controllers: [AppController], 8 | imports: [ 9 | ConfigModule.forRoot({ 10 | isGlobal: true, 11 | load: [config], 12 | envFilePath: `.env`, 13 | }), 14 | ], 15 | }) 16 | export class AppModule {} 17 | -------------------------------------------------------------------------------- /examples/webhook-signing/nestjs/config.ts: -------------------------------------------------------------------------------- 1 | type Config = { 2 | Stripe: { 3 | secret_key: string; 4 | webhook_secret: string; 5 | }; 6 | }; 7 | 8 | export const config = (): Config => ({ 9 | Stripe: { 10 | secret_key: process.env.STRIPE_SECRET_KEY || '', 11 | webhook_secret: process.env.STRIPE_WEBHOOK_SECRET || '', 12 | }, 13 | }); 14 | -------------------------------------------------------------------------------- /examples/webhook-signing/nestjs/main.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env -S npm run-script run 2 | 3 | import {NestFactory} from '@nestjs/core'; 4 | import {INestApplication} from '@nestjs/common'; 5 | import {AppModule} from './app.module'; 6 | 7 | async function bootstrap() { 8 | const app = await NestFactory.create(AppModule, { 9 | rawBody: true, 10 | }); 11 | app.enableCors({ 12 | origin: '*', 13 | }); 14 | 15 | await app.listen(0); 16 | console.log(`Webhook endpoint available at ${await app.getUrl()}/webhooks`); 17 | } 18 | bootstrap(); 19 | -------------------------------------------------------------------------------- /examples/webhook-signing/nestjs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "webhook-signing-example-nestjs", 3 | "version": "1.0.0", 4 | "description": "Nestjs webhook parsing sample", 5 | "repository": {}, 6 | "main": "./main.ts", 7 | "scripts": { 8 | "run": "ts-node-transpile-only ./main.ts", 9 | "prepare": "../prepare.sh" 10 | }, 11 | "author": "Ali karimi", 12 | "license": "ISC", 13 | "dependencies": { 14 | "@nestjs/common": "^11.0.16", 15 | "@nestjs/config": "^3.0.0", 16 | "@nestjs/core": "^10.2.1", 17 | "dotenv": "^16.3.1", 18 | "@nestjs/platform-express": "^10.2.1", 19 | "reflect-metadata": "^0.1.13", 20 | "rxjs": "^7.8.1", 21 | "stripe": "^12.18.0" 22 | }, 23 | "devDependencies": { 24 | "eslint": "^8.33.0", 25 | "@types/node": "^20.5.4", 26 | "@types/express": "^4.17.17", 27 | "typescript": "^5.2.2", 28 | "ts-node": "^10.9.1" 29 | } 30 | } -------------------------------------------------------------------------------- /examples/webhook-signing/nextjs/.gitignore: -------------------------------------------------------------------------------- 1 | .next 2 | -------------------------------------------------------------------------------- /examples/webhook-signing/nextjs/main.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env -S npm run-script run 2 | 3 | /* 4 | ATTENTION: this file exists to support github/stripe/stripe-node example test infrastructure 5 | You don't need to copy this file to your NextJS project. 6 | */ 7 | 8 | import child_process from 'child_process'; 9 | 10 | const process = child_process.exec('npm run dev --verbose'); 11 | process.stdout.on('data', (line) => { 12 | const match = /url: (.*)/gm.exec(line); 13 | if (match) { 14 | console.log(`Webhook endpoint available at ${match[1]}/api/webhooks`); 15 | } 16 | console.log(line); 17 | }); 18 | -------------------------------------------------------------------------------- /examples/webhook-signing/nextjs/next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | // NOTE: This file should not be edited 5 | // see https://nextjs.org/docs/basic-features/typescript for more information. 6 | -------------------------------------------------------------------------------- /examples/webhook-signing/nextjs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "webhook-signing-example-nextjs", 3 | "version": "1.0.0", 4 | "description": "NextJS webhook parsing sample", 5 | "repository": {}, 6 | "main": "./main.ts", 7 | "scripts": { 8 | "run": "ts-node-transpile-only ./main.ts", 9 | "prepare": "../prepare.sh", 10 | "dev": "next dev --port 0" 11 | }, 12 | "author": "", 13 | "license": "ISC", 14 | "dependencies": { 15 | "dotenv": "^8.2.0", 16 | "next": "^13.1.6", 17 | "react": "^18.2.0", 18 | "react-dom": "^18.2.0", 19 | "stripe": "^11.9.1" 20 | }, 21 | "devDependencies": { 22 | "@types/node": "^13.1.4", 23 | "@types/react": "18.0.27", 24 | "eslint": "^8.33.0", 25 | "typescript": "^4.8.3", 26 | "ts-node": "^10.9.1" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /examples/webhook-signing/prepare.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -eu -o pipefail 3 | 4 | cp -f ../.eslintrc.js . 5 | cp -f ../tsconfig.json . 6 | cp -n ../.env.example ./.env || true 7 | eslint --quiet . 8 | -------------------------------------------------------------------------------- /examples/webhook-signing/test/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "webhook-signing-example-koa", 3 | "version": "1.0.0", 4 | "description": "Koa webhook parsing sample", 5 | "repository": {}, 6 | "main": "./main.ts", 7 | "scripts": { 8 | "run": "ts-node-transpile-only ./main.ts", 9 | "prepare": "../prepare.sh" 10 | }, 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "dotenv": "^8.2.0", 15 | "stripe": "^11.9.1" 16 | }, 17 | "devDependencies": { 18 | "eslint": "^8.33.0", 19 | "@types/node": "^13.1.4", 20 | "typescript": "^4.8.3", 21 | "ts-node": "^10.9.1" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /examples/webhook-signing/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ 4 | "target": "es5", 5 | /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ 6 | "module": "commonjs", 7 | 8 | /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ 9 | "esModuleInterop": true, 10 | 11 | /* Advanced Options */ 12 | /* Disallow inconsistently-cased references to the same file. */ 13 | "forceConsistentCasingInFileNames": true, 14 | 15 | "experimentalDecorators": true, 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/ResourceNamespace.ts: -------------------------------------------------------------------------------- 1 | // ResourceNamespace allows you to create nested resources, i.e. `stripe.issuing.cards`. 2 | 3 | import {StripeObject, StripeResourceObject} from './Types.js'; 4 | 5 | export type StripeResourceNamespaceObject = { 6 | [key: string]: StripeResourceObject | StripeResourceNamespaceObject; 7 | }; 8 | 9 | // It also works recursively, so you could do i.e. `stripe.billing.invoicing.pay`. 10 | function ResourceNamespace( 11 | this: StripeResourceNamespaceObject, 12 | stripe: StripeObject, 13 | resources: Record< 14 | string, 15 | new (...args: any[]) => StripeResourceObject | StripeResourceNamespaceObject 16 | > 17 | ): void { 18 | for (const name in resources) { 19 | if (!Object.prototype.hasOwnProperty.call(resources, name)) { 20 | continue; 21 | } 22 | const camelCaseName = name[0].toLowerCase() + name.substring(1); 23 | 24 | const resource = new resources[name](stripe); 25 | 26 | this[camelCaseName] = resource; 27 | } 28 | } 29 | 30 | export function resourceNamespace( 31 | namespace: string, 32 | resources: Record< 33 | string, 34 | new (...args: any[]) => StripeResourceObject | StripeResourceNamespaceObject 35 | > 36 | ): new (stripe: StripeObject) => StripeResourceNamespaceObject { 37 | return function(stripe: StripeObject): StripeResourceNamespaceObject { 38 | return new (ResourceNamespace as any)(stripe, resources); 39 | } as any; 40 | } 41 | -------------------------------------------------------------------------------- /src/apiVersion.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | export const ApiVersion = '2025-05-28.basil'; 4 | -------------------------------------------------------------------------------- /src/crypto/NodeCryptoProvider.ts: -------------------------------------------------------------------------------- 1 | import * as crypto from 'crypto'; 2 | import {CryptoProvider} from './CryptoProvider.js'; 3 | 4 | /** 5 | * `CryptoProvider which uses the Node `crypto` package for its computations. 6 | */ 7 | export class NodeCryptoProvider extends CryptoProvider { 8 | /** @override */ 9 | computeHMACSignature(payload: string, secret: string): string { 10 | return crypto 11 | .createHmac('sha256', secret) 12 | .update(payload, 'utf8') 13 | .digest('hex'); 14 | } 15 | 16 | /** @override */ 17 | async computeHMACSignatureAsync( 18 | payload: string, 19 | secret: string 20 | ): Promise { 21 | const signature = await this.computeHMACSignature(payload, secret); 22 | return signature; 23 | } 24 | 25 | /** @override */ 26 | async computeSHA256Async(data: Uint8Array): Promise { 27 | return new Uint8Array( 28 | await crypto 29 | .createHash('sha256') 30 | .update(data) 31 | .digest() 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/resources/AccountLinks.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const AccountLinks = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/account_links'}), 7 | }); 8 | -------------------------------------------------------------------------------- /src/resources/AccountSessions.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const AccountSessions = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/account_sessions'}), 7 | }); 8 | -------------------------------------------------------------------------------- /src/resources/ApplePayDomains.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const ApplePayDomains = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/apple_pay/domains'}), 7 | retrieve: stripeMethod({ 8 | method: 'GET', 9 | fullPath: '/v1/apple_pay/domains/{domain}', 10 | }), 11 | list: stripeMethod({ 12 | method: 'GET', 13 | fullPath: '/v1/apple_pay/domains', 14 | methodType: 'list', 15 | }), 16 | del: stripeMethod({ 17 | method: 'DELETE', 18 | fullPath: '/v1/apple_pay/domains/{domain}', 19 | }), 20 | }); 21 | -------------------------------------------------------------------------------- /src/resources/ApplicationFees.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const ApplicationFees = StripeResource.extend({ 6 | retrieve: stripeMethod({ 7 | method: 'GET', 8 | fullPath: '/v1/application_fees/{id}', 9 | }), 10 | list: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/application_fees', 13 | methodType: 'list', 14 | }), 15 | createRefund: stripeMethod({ 16 | method: 'POST', 17 | fullPath: '/v1/application_fees/{id}/refunds', 18 | }), 19 | listRefunds: stripeMethod({ 20 | method: 'GET', 21 | fullPath: '/v1/application_fees/{id}/refunds', 22 | methodType: 'list', 23 | }), 24 | retrieveRefund: stripeMethod({ 25 | method: 'GET', 26 | fullPath: '/v1/application_fees/{fee}/refunds/{id}', 27 | }), 28 | updateRefund: stripeMethod({ 29 | method: 'POST', 30 | fullPath: '/v1/application_fees/{fee}/refunds/{id}', 31 | }), 32 | }); 33 | -------------------------------------------------------------------------------- /src/resources/Apps/Secrets.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Secrets = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/apps/secrets'}), 7 | list: stripeMethod({ 8 | method: 'GET', 9 | fullPath: '/v1/apps/secrets', 10 | methodType: 'list', 11 | }), 12 | deleteWhere: stripeMethod({ 13 | method: 'POST', 14 | fullPath: '/v1/apps/secrets/delete', 15 | }), 16 | find: stripeMethod({method: 'GET', fullPath: '/v1/apps/secrets/find'}), 17 | }); 18 | -------------------------------------------------------------------------------- /src/resources/Balance.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Balance = StripeResource.extend({ 6 | retrieve: stripeMethod({method: 'GET', fullPath: '/v1/balance'}), 7 | }); 8 | -------------------------------------------------------------------------------- /src/resources/BalanceTransactions.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const BalanceTransactions = StripeResource.extend({ 6 | retrieve: stripeMethod({ 7 | method: 'GET', 8 | fullPath: '/v1/balance_transactions/{id}', 9 | }), 10 | list: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/balance_transactions', 13 | methodType: 'list', 14 | }), 15 | }); 16 | -------------------------------------------------------------------------------- /src/resources/Billing/Alerts.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Alerts = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/billing/alerts'}), 7 | retrieve: stripeMethod({method: 'GET', fullPath: '/v1/billing/alerts/{id}'}), 8 | list: stripeMethod({ 9 | method: 'GET', 10 | fullPath: '/v1/billing/alerts', 11 | methodType: 'list', 12 | }), 13 | activate: stripeMethod({ 14 | method: 'POST', 15 | fullPath: '/v1/billing/alerts/{id}/activate', 16 | }), 17 | archive: stripeMethod({ 18 | method: 'POST', 19 | fullPath: '/v1/billing/alerts/{id}/archive', 20 | }), 21 | deactivate: stripeMethod({ 22 | method: 'POST', 23 | fullPath: '/v1/billing/alerts/{id}/deactivate', 24 | }), 25 | }); 26 | -------------------------------------------------------------------------------- /src/resources/Billing/CreditBalanceSummary.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const CreditBalanceSummary = StripeResource.extend({ 6 | retrieve: stripeMethod({ 7 | method: 'GET', 8 | fullPath: '/v1/billing/credit_balance_summary', 9 | }), 10 | }); 11 | -------------------------------------------------------------------------------- /src/resources/Billing/CreditBalanceTransactions.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const CreditBalanceTransactions = StripeResource.extend({ 6 | retrieve: stripeMethod({ 7 | method: 'GET', 8 | fullPath: '/v1/billing/credit_balance_transactions/{id}', 9 | }), 10 | list: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/billing/credit_balance_transactions', 13 | methodType: 'list', 14 | }), 15 | }); 16 | -------------------------------------------------------------------------------- /src/resources/Billing/CreditGrants.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const CreditGrants = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/billing/credit_grants'}), 7 | retrieve: stripeMethod({ 8 | method: 'GET', 9 | fullPath: '/v1/billing/credit_grants/{id}', 10 | }), 11 | update: stripeMethod({ 12 | method: 'POST', 13 | fullPath: '/v1/billing/credit_grants/{id}', 14 | }), 15 | list: stripeMethod({ 16 | method: 'GET', 17 | fullPath: '/v1/billing/credit_grants', 18 | methodType: 'list', 19 | }), 20 | expire: stripeMethod({ 21 | method: 'POST', 22 | fullPath: '/v1/billing/credit_grants/{id}/expire', 23 | }), 24 | voidGrant: stripeMethod({ 25 | method: 'POST', 26 | fullPath: '/v1/billing/credit_grants/{id}/void', 27 | }), 28 | }); 29 | -------------------------------------------------------------------------------- /src/resources/Billing/MeterEventAdjustments.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const MeterEventAdjustments = StripeResource.extend({ 6 | create: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/billing/meter_event_adjustments', 9 | }), 10 | }); 11 | -------------------------------------------------------------------------------- /src/resources/Billing/MeterEvents.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const MeterEvents = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/billing/meter_events'}), 7 | }); 8 | -------------------------------------------------------------------------------- /src/resources/Billing/Meters.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Meters = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/billing/meters'}), 7 | retrieve: stripeMethod({method: 'GET', fullPath: '/v1/billing/meters/{id}'}), 8 | update: stripeMethod({method: 'POST', fullPath: '/v1/billing/meters/{id}'}), 9 | list: stripeMethod({ 10 | method: 'GET', 11 | fullPath: '/v1/billing/meters', 12 | methodType: 'list', 13 | }), 14 | deactivate: stripeMethod({ 15 | method: 'POST', 16 | fullPath: '/v1/billing/meters/{id}/deactivate', 17 | }), 18 | listEventSummaries: stripeMethod({ 19 | method: 'GET', 20 | fullPath: '/v1/billing/meters/{id}/event_summaries', 21 | methodType: 'list', 22 | }), 23 | reactivate: stripeMethod({ 24 | method: 'POST', 25 | fullPath: '/v1/billing/meters/{id}/reactivate', 26 | }), 27 | }); 28 | -------------------------------------------------------------------------------- /src/resources/BillingPortal/Configurations.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Configurations = StripeResource.extend({ 6 | create: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/billing_portal/configurations', 9 | }), 10 | retrieve: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/billing_portal/configurations/{configuration}', 13 | }), 14 | update: stripeMethod({ 15 | method: 'POST', 16 | fullPath: '/v1/billing_portal/configurations/{configuration}', 17 | }), 18 | list: stripeMethod({ 19 | method: 'GET', 20 | fullPath: '/v1/billing_portal/configurations', 21 | methodType: 'list', 22 | }), 23 | }); 24 | -------------------------------------------------------------------------------- /src/resources/BillingPortal/Sessions.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Sessions = StripeResource.extend({ 6 | create: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/billing_portal/sessions', 9 | }), 10 | }); 11 | -------------------------------------------------------------------------------- /src/resources/Charges.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Charges = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/charges'}), 7 | retrieve: stripeMethod({method: 'GET', fullPath: '/v1/charges/{charge}'}), 8 | update: stripeMethod({method: 'POST', fullPath: '/v1/charges/{charge}'}), 9 | list: stripeMethod({ 10 | method: 'GET', 11 | fullPath: '/v1/charges', 12 | methodType: 'list', 13 | }), 14 | capture: stripeMethod({ 15 | method: 'POST', 16 | fullPath: '/v1/charges/{charge}/capture', 17 | }), 18 | search: stripeMethod({ 19 | method: 'GET', 20 | fullPath: '/v1/charges/search', 21 | methodType: 'search', 22 | }), 23 | }); 24 | -------------------------------------------------------------------------------- /src/resources/Checkout/Sessions.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Sessions = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/checkout/sessions'}), 7 | retrieve: stripeMethod({ 8 | method: 'GET', 9 | fullPath: '/v1/checkout/sessions/{session}', 10 | }), 11 | update: stripeMethod({ 12 | method: 'POST', 13 | fullPath: '/v1/checkout/sessions/{session}', 14 | }), 15 | list: stripeMethod({ 16 | method: 'GET', 17 | fullPath: '/v1/checkout/sessions', 18 | methodType: 'list', 19 | }), 20 | expire: stripeMethod({ 21 | method: 'POST', 22 | fullPath: '/v1/checkout/sessions/{session}/expire', 23 | }), 24 | listLineItems: stripeMethod({ 25 | method: 'GET', 26 | fullPath: '/v1/checkout/sessions/{session}/line_items', 27 | methodType: 'list', 28 | }), 29 | }); 30 | -------------------------------------------------------------------------------- /src/resources/Climate/Orders.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Orders = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/climate/orders'}), 7 | retrieve: stripeMethod({ 8 | method: 'GET', 9 | fullPath: '/v1/climate/orders/{order}', 10 | }), 11 | update: stripeMethod({ 12 | method: 'POST', 13 | fullPath: '/v1/climate/orders/{order}', 14 | }), 15 | list: stripeMethod({ 16 | method: 'GET', 17 | fullPath: '/v1/climate/orders', 18 | methodType: 'list', 19 | }), 20 | cancel: stripeMethod({ 21 | method: 'POST', 22 | fullPath: '/v1/climate/orders/{order}/cancel', 23 | }), 24 | }); 25 | -------------------------------------------------------------------------------- /src/resources/Climate/Products.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Products = StripeResource.extend({ 6 | retrieve: stripeMethod({ 7 | method: 'GET', 8 | fullPath: '/v1/climate/products/{product}', 9 | }), 10 | list: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/climate/products', 13 | methodType: 'list', 14 | }), 15 | }); 16 | -------------------------------------------------------------------------------- /src/resources/Climate/Suppliers.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Suppliers = StripeResource.extend({ 6 | retrieve: stripeMethod({ 7 | method: 'GET', 8 | fullPath: '/v1/climate/suppliers/{supplier}', 9 | }), 10 | list: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/climate/suppliers', 13 | methodType: 'list', 14 | }), 15 | }); 16 | -------------------------------------------------------------------------------- /src/resources/ConfirmationTokens.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const ConfirmationTokens = StripeResource.extend({ 6 | retrieve: stripeMethod({ 7 | method: 'GET', 8 | fullPath: '/v1/confirmation_tokens/{confirmation_token}', 9 | }), 10 | }); 11 | -------------------------------------------------------------------------------- /src/resources/CountrySpecs.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const CountrySpecs = StripeResource.extend({ 6 | retrieve: stripeMethod({ 7 | method: 'GET', 8 | fullPath: '/v1/country_specs/{country}', 9 | }), 10 | list: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/country_specs', 13 | methodType: 'list', 14 | }), 15 | }); 16 | -------------------------------------------------------------------------------- /src/resources/Coupons.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Coupons = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/coupons'}), 7 | retrieve: stripeMethod({method: 'GET', fullPath: '/v1/coupons/{coupon}'}), 8 | update: stripeMethod({method: 'POST', fullPath: '/v1/coupons/{coupon}'}), 9 | list: stripeMethod({ 10 | method: 'GET', 11 | fullPath: '/v1/coupons', 12 | methodType: 'list', 13 | }), 14 | del: stripeMethod({method: 'DELETE', fullPath: '/v1/coupons/{coupon}'}), 15 | }); 16 | -------------------------------------------------------------------------------- /src/resources/CreditNotes.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const CreditNotes = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/credit_notes'}), 7 | retrieve: stripeMethod({method: 'GET', fullPath: '/v1/credit_notes/{id}'}), 8 | update: stripeMethod({method: 'POST', fullPath: '/v1/credit_notes/{id}'}), 9 | list: stripeMethod({ 10 | method: 'GET', 11 | fullPath: '/v1/credit_notes', 12 | methodType: 'list', 13 | }), 14 | listLineItems: stripeMethod({ 15 | method: 'GET', 16 | fullPath: '/v1/credit_notes/{credit_note}/lines', 17 | methodType: 'list', 18 | }), 19 | listPreviewLineItems: stripeMethod({ 20 | method: 'GET', 21 | fullPath: '/v1/credit_notes/preview/lines', 22 | methodType: 'list', 23 | }), 24 | preview: stripeMethod({method: 'GET', fullPath: '/v1/credit_notes/preview'}), 25 | voidCreditNote: stripeMethod({ 26 | method: 'POST', 27 | fullPath: '/v1/credit_notes/{id}/void', 28 | }), 29 | }); 30 | -------------------------------------------------------------------------------- /src/resources/CustomerSessions.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const CustomerSessions = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/customer_sessions'}), 7 | }); 8 | -------------------------------------------------------------------------------- /src/resources/Disputes.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Disputes = StripeResource.extend({ 6 | retrieve: stripeMethod({method: 'GET', fullPath: '/v1/disputes/{dispute}'}), 7 | update: stripeMethod({method: 'POST', fullPath: '/v1/disputes/{dispute}'}), 8 | list: stripeMethod({ 9 | method: 'GET', 10 | fullPath: '/v1/disputes', 11 | methodType: 'list', 12 | }), 13 | close: stripeMethod({ 14 | method: 'POST', 15 | fullPath: '/v1/disputes/{dispute}/close', 16 | }), 17 | }); 18 | -------------------------------------------------------------------------------- /src/resources/Entitlements/ActiveEntitlements.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const ActiveEntitlements = StripeResource.extend({ 6 | retrieve: stripeMethod({ 7 | method: 'GET', 8 | fullPath: '/v1/entitlements/active_entitlements/{id}', 9 | }), 10 | list: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/entitlements/active_entitlements', 13 | methodType: 'list', 14 | }), 15 | }); 16 | -------------------------------------------------------------------------------- /src/resources/Entitlements/Features.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Features = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/entitlements/features'}), 7 | retrieve: stripeMethod({ 8 | method: 'GET', 9 | fullPath: '/v1/entitlements/features/{id}', 10 | }), 11 | update: stripeMethod({ 12 | method: 'POST', 13 | fullPath: '/v1/entitlements/features/{id}', 14 | }), 15 | list: stripeMethod({ 16 | method: 'GET', 17 | fullPath: '/v1/entitlements/features', 18 | methodType: 'list', 19 | }), 20 | }); 21 | -------------------------------------------------------------------------------- /src/resources/EphemeralKeys.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const EphemeralKeys = StripeResource.extend({ 6 | create: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/ephemeral_keys', 9 | validator: (data, options) => { 10 | if (!options.headers || !options.headers['Stripe-Version']) { 11 | throw new Error( 12 | 'Passing apiVersion in a separate options hash is required to create an ephemeral key. See https://stripe.com/docs/api/versioning?lang=node' 13 | ); 14 | } 15 | }, 16 | }), 17 | del: stripeMethod({method: 'DELETE', fullPath: '/v1/ephemeral_keys/{key}'}), 18 | }); 19 | -------------------------------------------------------------------------------- /src/resources/Events.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Events = StripeResource.extend({ 6 | retrieve: stripeMethod({method: 'GET', fullPath: '/v1/events/{id}'}), 7 | list: stripeMethod({ 8 | method: 'GET', 9 | fullPath: '/v1/events', 10 | methodType: 'list', 11 | }), 12 | }); 13 | -------------------------------------------------------------------------------- /src/resources/ExchangeRates.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const ExchangeRates = StripeResource.extend({ 6 | retrieve: stripeMethod({ 7 | method: 'GET', 8 | fullPath: '/v1/exchange_rates/{rate_id}', 9 | }), 10 | list: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/exchange_rates', 13 | methodType: 'list', 14 | }), 15 | }); 16 | -------------------------------------------------------------------------------- /src/resources/FileLinks.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const FileLinks = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/file_links'}), 7 | retrieve: stripeMethod({method: 'GET', fullPath: '/v1/file_links/{link}'}), 8 | update: stripeMethod({method: 'POST', fullPath: '/v1/file_links/{link}'}), 9 | list: stripeMethod({ 10 | method: 'GET', 11 | fullPath: '/v1/file_links', 12 | methodType: 'list', 13 | }), 14 | }); 15 | -------------------------------------------------------------------------------- /src/resources/Files.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {multipartRequestDataProcessor} from '../multipart.js'; 4 | import {StripeResource} from '../StripeResource.js'; 5 | const stripeMethod = StripeResource.method; 6 | export const Files = StripeResource.extend({ 7 | create: stripeMethod({ 8 | method: 'POST', 9 | fullPath: '/v1/files', 10 | headers: { 11 | 'Content-Type': 'multipart/form-data', 12 | }, 13 | host: 'files.stripe.com', 14 | }), 15 | retrieve: stripeMethod({method: 'GET', fullPath: '/v1/files/{file}'}), 16 | list: stripeMethod({ 17 | method: 'GET', 18 | fullPath: '/v1/files', 19 | methodType: 'list', 20 | }), 21 | 22 | requestDataProcessor: multipartRequestDataProcessor, 23 | }); 24 | -------------------------------------------------------------------------------- /src/resources/FinancialConnections/Accounts.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Accounts = StripeResource.extend({ 6 | retrieve: stripeMethod({ 7 | method: 'GET', 8 | fullPath: '/v1/financial_connections/accounts/{account}', 9 | }), 10 | list: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/financial_connections/accounts', 13 | methodType: 'list', 14 | }), 15 | disconnect: stripeMethod({ 16 | method: 'POST', 17 | fullPath: '/v1/financial_connections/accounts/{account}/disconnect', 18 | }), 19 | listOwners: stripeMethod({ 20 | method: 'GET', 21 | fullPath: '/v1/financial_connections/accounts/{account}/owners', 22 | methodType: 'list', 23 | }), 24 | refresh: stripeMethod({ 25 | method: 'POST', 26 | fullPath: '/v1/financial_connections/accounts/{account}/refresh', 27 | }), 28 | subscribe: stripeMethod({ 29 | method: 'POST', 30 | fullPath: '/v1/financial_connections/accounts/{account}/subscribe', 31 | }), 32 | unsubscribe: stripeMethod({ 33 | method: 'POST', 34 | fullPath: '/v1/financial_connections/accounts/{account}/unsubscribe', 35 | }), 36 | }); 37 | -------------------------------------------------------------------------------- /src/resources/FinancialConnections/Sessions.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Sessions = StripeResource.extend({ 6 | create: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/financial_connections/sessions', 9 | }), 10 | retrieve: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/financial_connections/sessions/{session}', 13 | }), 14 | }); 15 | -------------------------------------------------------------------------------- /src/resources/FinancialConnections/Transactions.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Transactions = StripeResource.extend({ 6 | retrieve: stripeMethod({ 7 | method: 'GET', 8 | fullPath: '/v1/financial_connections/transactions/{transaction}', 9 | }), 10 | list: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/financial_connections/transactions', 13 | methodType: 'list', 14 | }), 15 | }); 16 | -------------------------------------------------------------------------------- /src/resources/Forwarding/Requests.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Requests = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/forwarding/requests'}), 7 | retrieve: stripeMethod({ 8 | method: 'GET', 9 | fullPath: '/v1/forwarding/requests/{id}', 10 | }), 11 | list: stripeMethod({ 12 | method: 'GET', 13 | fullPath: '/v1/forwarding/requests', 14 | methodType: 'list', 15 | }), 16 | }); 17 | -------------------------------------------------------------------------------- /src/resources/Identity/VerificationReports.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const VerificationReports = StripeResource.extend({ 6 | retrieve: stripeMethod({ 7 | method: 'GET', 8 | fullPath: '/v1/identity/verification_reports/{report}', 9 | }), 10 | list: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/identity/verification_reports', 13 | methodType: 'list', 14 | }), 15 | }); 16 | -------------------------------------------------------------------------------- /src/resources/Identity/VerificationSessions.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const VerificationSessions = StripeResource.extend({ 6 | create: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/identity/verification_sessions', 9 | }), 10 | retrieve: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/identity/verification_sessions/{session}', 13 | }), 14 | update: stripeMethod({ 15 | method: 'POST', 16 | fullPath: '/v1/identity/verification_sessions/{session}', 17 | }), 18 | list: stripeMethod({ 19 | method: 'GET', 20 | fullPath: '/v1/identity/verification_sessions', 21 | methodType: 'list', 22 | }), 23 | cancel: stripeMethod({ 24 | method: 'POST', 25 | fullPath: '/v1/identity/verification_sessions/{session}/cancel', 26 | }), 27 | redact: stripeMethod({ 28 | method: 'POST', 29 | fullPath: '/v1/identity/verification_sessions/{session}/redact', 30 | }), 31 | }); 32 | -------------------------------------------------------------------------------- /src/resources/InvoiceItems.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const InvoiceItems = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/invoiceitems'}), 7 | retrieve: stripeMethod({ 8 | method: 'GET', 9 | fullPath: '/v1/invoiceitems/{invoiceitem}', 10 | }), 11 | update: stripeMethod({ 12 | method: 'POST', 13 | fullPath: '/v1/invoiceitems/{invoiceitem}', 14 | }), 15 | list: stripeMethod({ 16 | method: 'GET', 17 | fullPath: '/v1/invoiceitems', 18 | methodType: 'list', 19 | }), 20 | del: stripeMethod({ 21 | method: 'DELETE', 22 | fullPath: '/v1/invoiceitems/{invoiceitem}', 23 | }), 24 | }); 25 | -------------------------------------------------------------------------------- /src/resources/InvoicePayments.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const InvoicePayments = StripeResource.extend({ 6 | retrieve: stripeMethod({ 7 | method: 'GET', 8 | fullPath: '/v1/invoice_payments/{invoice_payment}', 9 | }), 10 | list: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/invoice_payments', 13 | methodType: 'list', 14 | }), 15 | }); 16 | -------------------------------------------------------------------------------- /src/resources/InvoiceRenderingTemplates.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const InvoiceRenderingTemplates = StripeResource.extend({ 6 | retrieve: stripeMethod({ 7 | method: 'GET', 8 | fullPath: '/v1/invoice_rendering_templates/{template}', 9 | }), 10 | list: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/invoice_rendering_templates', 13 | methodType: 'list', 14 | }), 15 | archive: stripeMethod({ 16 | method: 'POST', 17 | fullPath: '/v1/invoice_rendering_templates/{template}/archive', 18 | }), 19 | unarchive: stripeMethod({ 20 | method: 'POST', 21 | fullPath: '/v1/invoice_rendering_templates/{template}/unarchive', 22 | }), 23 | }); 24 | -------------------------------------------------------------------------------- /src/resources/Issuing/Authorizations.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Authorizations = StripeResource.extend({ 6 | retrieve: stripeMethod({ 7 | method: 'GET', 8 | fullPath: '/v1/issuing/authorizations/{authorization}', 9 | }), 10 | update: stripeMethod({ 11 | method: 'POST', 12 | fullPath: '/v1/issuing/authorizations/{authorization}', 13 | }), 14 | list: stripeMethod({ 15 | method: 'GET', 16 | fullPath: '/v1/issuing/authorizations', 17 | methodType: 'list', 18 | }), 19 | approve: stripeMethod({ 20 | method: 'POST', 21 | fullPath: '/v1/issuing/authorizations/{authorization}/approve', 22 | }), 23 | decline: stripeMethod({ 24 | method: 'POST', 25 | fullPath: '/v1/issuing/authorizations/{authorization}/decline', 26 | }), 27 | }); 28 | -------------------------------------------------------------------------------- /src/resources/Issuing/Cardholders.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Cardholders = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/issuing/cardholders'}), 7 | retrieve: stripeMethod({ 8 | method: 'GET', 9 | fullPath: '/v1/issuing/cardholders/{cardholder}', 10 | }), 11 | update: stripeMethod({ 12 | method: 'POST', 13 | fullPath: '/v1/issuing/cardholders/{cardholder}', 14 | }), 15 | list: stripeMethod({ 16 | method: 'GET', 17 | fullPath: '/v1/issuing/cardholders', 18 | methodType: 'list', 19 | }), 20 | }); 21 | -------------------------------------------------------------------------------- /src/resources/Issuing/Cards.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Cards = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/issuing/cards'}), 7 | retrieve: stripeMethod({method: 'GET', fullPath: '/v1/issuing/cards/{card}'}), 8 | update: stripeMethod({method: 'POST', fullPath: '/v1/issuing/cards/{card}'}), 9 | list: stripeMethod({ 10 | method: 'GET', 11 | fullPath: '/v1/issuing/cards', 12 | methodType: 'list', 13 | }), 14 | }); 15 | -------------------------------------------------------------------------------- /src/resources/Issuing/Disputes.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Disputes = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/issuing/disputes'}), 7 | retrieve: stripeMethod({ 8 | method: 'GET', 9 | fullPath: '/v1/issuing/disputes/{dispute}', 10 | }), 11 | update: stripeMethod({ 12 | method: 'POST', 13 | fullPath: '/v1/issuing/disputes/{dispute}', 14 | }), 15 | list: stripeMethod({ 16 | method: 'GET', 17 | fullPath: '/v1/issuing/disputes', 18 | methodType: 'list', 19 | }), 20 | submit: stripeMethod({ 21 | method: 'POST', 22 | fullPath: '/v1/issuing/disputes/{dispute}/submit', 23 | }), 24 | }); 25 | -------------------------------------------------------------------------------- /src/resources/Issuing/PersonalizationDesigns.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const PersonalizationDesigns = StripeResource.extend({ 6 | create: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/issuing/personalization_designs', 9 | }), 10 | retrieve: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/issuing/personalization_designs/{personalization_design}', 13 | }), 14 | update: stripeMethod({ 15 | method: 'POST', 16 | fullPath: '/v1/issuing/personalization_designs/{personalization_design}', 17 | }), 18 | list: stripeMethod({ 19 | method: 'GET', 20 | fullPath: '/v1/issuing/personalization_designs', 21 | methodType: 'list', 22 | }), 23 | }); 24 | -------------------------------------------------------------------------------- /src/resources/Issuing/PhysicalBundles.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const PhysicalBundles = StripeResource.extend({ 6 | retrieve: stripeMethod({ 7 | method: 'GET', 8 | fullPath: '/v1/issuing/physical_bundles/{physical_bundle}', 9 | }), 10 | list: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/issuing/physical_bundles', 13 | methodType: 'list', 14 | }), 15 | }); 16 | -------------------------------------------------------------------------------- /src/resources/Issuing/Tokens.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Tokens = StripeResource.extend({ 6 | retrieve: stripeMethod({ 7 | method: 'GET', 8 | fullPath: '/v1/issuing/tokens/{token}', 9 | }), 10 | update: stripeMethod({ 11 | method: 'POST', 12 | fullPath: '/v1/issuing/tokens/{token}', 13 | }), 14 | list: stripeMethod({ 15 | method: 'GET', 16 | fullPath: '/v1/issuing/tokens', 17 | methodType: 'list', 18 | }), 19 | }); 20 | -------------------------------------------------------------------------------- /src/resources/Issuing/Transactions.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Transactions = StripeResource.extend({ 6 | retrieve: stripeMethod({ 7 | method: 'GET', 8 | fullPath: '/v1/issuing/transactions/{transaction}', 9 | }), 10 | update: stripeMethod({ 11 | method: 'POST', 12 | fullPath: '/v1/issuing/transactions/{transaction}', 13 | }), 14 | list: stripeMethod({ 15 | method: 'GET', 16 | fullPath: '/v1/issuing/transactions', 17 | methodType: 'list', 18 | }), 19 | }); 20 | -------------------------------------------------------------------------------- /src/resources/Mandates.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Mandates = StripeResource.extend({ 6 | retrieve: stripeMethod({method: 'GET', fullPath: '/v1/mandates/{mandate}'}), 7 | }); 8 | -------------------------------------------------------------------------------- /src/resources/PaymentIntents.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const PaymentIntents = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/payment_intents'}), 7 | retrieve: stripeMethod({ 8 | method: 'GET', 9 | fullPath: '/v1/payment_intents/{intent}', 10 | }), 11 | update: stripeMethod({ 12 | method: 'POST', 13 | fullPath: '/v1/payment_intents/{intent}', 14 | }), 15 | list: stripeMethod({ 16 | method: 'GET', 17 | fullPath: '/v1/payment_intents', 18 | methodType: 'list', 19 | }), 20 | applyCustomerBalance: stripeMethod({ 21 | method: 'POST', 22 | fullPath: '/v1/payment_intents/{intent}/apply_customer_balance', 23 | }), 24 | cancel: stripeMethod({ 25 | method: 'POST', 26 | fullPath: '/v1/payment_intents/{intent}/cancel', 27 | }), 28 | capture: stripeMethod({ 29 | method: 'POST', 30 | fullPath: '/v1/payment_intents/{intent}/capture', 31 | }), 32 | confirm: stripeMethod({ 33 | method: 'POST', 34 | fullPath: '/v1/payment_intents/{intent}/confirm', 35 | }), 36 | incrementAuthorization: stripeMethod({ 37 | method: 'POST', 38 | fullPath: '/v1/payment_intents/{intent}/increment_authorization', 39 | }), 40 | search: stripeMethod({ 41 | method: 'GET', 42 | fullPath: '/v1/payment_intents/search', 43 | methodType: 'search', 44 | }), 45 | verifyMicrodeposits: stripeMethod({ 46 | method: 'POST', 47 | fullPath: '/v1/payment_intents/{intent}/verify_microdeposits', 48 | }), 49 | }); 50 | -------------------------------------------------------------------------------- /src/resources/PaymentLinks.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const PaymentLinks = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/payment_links'}), 7 | retrieve: stripeMethod({ 8 | method: 'GET', 9 | fullPath: '/v1/payment_links/{payment_link}', 10 | }), 11 | update: stripeMethod({ 12 | method: 'POST', 13 | fullPath: '/v1/payment_links/{payment_link}', 14 | }), 15 | list: stripeMethod({ 16 | method: 'GET', 17 | fullPath: '/v1/payment_links', 18 | methodType: 'list', 19 | }), 20 | listLineItems: stripeMethod({ 21 | method: 'GET', 22 | fullPath: '/v1/payment_links/{payment_link}/line_items', 23 | methodType: 'list', 24 | }), 25 | }); 26 | -------------------------------------------------------------------------------- /src/resources/PaymentMethodConfigurations.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const PaymentMethodConfigurations = StripeResource.extend({ 6 | create: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/payment_method_configurations', 9 | }), 10 | retrieve: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/payment_method_configurations/{configuration}', 13 | }), 14 | update: stripeMethod({ 15 | method: 'POST', 16 | fullPath: '/v1/payment_method_configurations/{configuration}', 17 | }), 18 | list: stripeMethod({ 19 | method: 'GET', 20 | fullPath: '/v1/payment_method_configurations', 21 | methodType: 'list', 22 | }), 23 | }); 24 | -------------------------------------------------------------------------------- /src/resources/PaymentMethodDomains.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const PaymentMethodDomains = StripeResource.extend({ 6 | create: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/payment_method_domains', 9 | }), 10 | retrieve: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/payment_method_domains/{payment_method_domain}', 13 | }), 14 | update: stripeMethod({ 15 | method: 'POST', 16 | fullPath: '/v1/payment_method_domains/{payment_method_domain}', 17 | }), 18 | list: stripeMethod({ 19 | method: 'GET', 20 | fullPath: '/v1/payment_method_domains', 21 | methodType: 'list', 22 | }), 23 | validate: stripeMethod({ 24 | method: 'POST', 25 | fullPath: '/v1/payment_method_domains/{payment_method_domain}/validate', 26 | }), 27 | }); 28 | -------------------------------------------------------------------------------- /src/resources/PaymentMethods.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const PaymentMethods = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/payment_methods'}), 7 | retrieve: stripeMethod({ 8 | method: 'GET', 9 | fullPath: '/v1/payment_methods/{payment_method}', 10 | }), 11 | update: stripeMethod({ 12 | method: 'POST', 13 | fullPath: '/v1/payment_methods/{payment_method}', 14 | }), 15 | list: stripeMethod({ 16 | method: 'GET', 17 | fullPath: '/v1/payment_methods', 18 | methodType: 'list', 19 | }), 20 | attach: stripeMethod({ 21 | method: 'POST', 22 | fullPath: '/v1/payment_methods/{payment_method}/attach', 23 | }), 24 | detach: stripeMethod({ 25 | method: 'POST', 26 | fullPath: '/v1/payment_methods/{payment_method}/detach', 27 | }), 28 | }); 29 | -------------------------------------------------------------------------------- /src/resources/Payouts.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Payouts = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/payouts'}), 7 | retrieve: stripeMethod({method: 'GET', fullPath: '/v1/payouts/{payout}'}), 8 | update: stripeMethod({method: 'POST', fullPath: '/v1/payouts/{payout}'}), 9 | list: stripeMethod({ 10 | method: 'GET', 11 | fullPath: '/v1/payouts', 12 | methodType: 'list', 13 | }), 14 | cancel: stripeMethod({ 15 | method: 'POST', 16 | fullPath: '/v1/payouts/{payout}/cancel', 17 | }), 18 | reverse: stripeMethod({ 19 | method: 'POST', 20 | fullPath: '/v1/payouts/{payout}/reverse', 21 | }), 22 | }); 23 | -------------------------------------------------------------------------------- /src/resources/Plans.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Plans = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/plans'}), 7 | retrieve: stripeMethod({method: 'GET', fullPath: '/v1/plans/{plan}'}), 8 | update: stripeMethod({method: 'POST', fullPath: '/v1/plans/{plan}'}), 9 | list: stripeMethod({ 10 | method: 'GET', 11 | fullPath: '/v1/plans', 12 | methodType: 'list', 13 | }), 14 | del: stripeMethod({method: 'DELETE', fullPath: '/v1/plans/{plan}'}), 15 | }); 16 | -------------------------------------------------------------------------------- /src/resources/Prices.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Prices = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/prices'}), 7 | retrieve: stripeMethod({method: 'GET', fullPath: '/v1/prices/{price}'}), 8 | update: stripeMethod({method: 'POST', fullPath: '/v1/prices/{price}'}), 9 | list: stripeMethod({ 10 | method: 'GET', 11 | fullPath: '/v1/prices', 12 | methodType: 'list', 13 | }), 14 | search: stripeMethod({ 15 | method: 'GET', 16 | fullPath: '/v1/prices/search', 17 | methodType: 'search', 18 | }), 19 | }); 20 | -------------------------------------------------------------------------------- /src/resources/Products.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Products = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/products'}), 7 | retrieve: stripeMethod({method: 'GET', fullPath: '/v1/products/{id}'}), 8 | update: stripeMethod({method: 'POST', fullPath: '/v1/products/{id}'}), 9 | list: stripeMethod({ 10 | method: 'GET', 11 | fullPath: '/v1/products', 12 | methodType: 'list', 13 | }), 14 | del: stripeMethod({method: 'DELETE', fullPath: '/v1/products/{id}'}), 15 | createFeature: stripeMethod({ 16 | method: 'POST', 17 | fullPath: '/v1/products/{product}/features', 18 | }), 19 | deleteFeature: stripeMethod({ 20 | method: 'DELETE', 21 | fullPath: '/v1/products/{product}/features/{id}', 22 | }), 23 | listFeatures: stripeMethod({ 24 | method: 'GET', 25 | fullPath: '/v1/products/{product}/features', 26 | methodType: 'list', 27 | }), 28 | retrieveFeature: stripeMethod({ 29 | method: 'GET', 30 | fullPath: '/v1/products/{product}/features/{id}', 31 | }), 32 | search: stripeMethod({ 33 | method: 'GET', 34 | fullPath: '/v1/products/search', 35 | methodType: 'search', 36 | }), 37 | }); 38 | -------------------------------------------------------------------------------- /src/resources/PromotionCodes.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const PromotionCodes = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/promotion_codes'}), 7 | retrieve: stripeMethod({ 8 | method: 'GET', 9 | fullPath: '/v1/promotion_codes/{promotion_code}', 10 | }), 11 | update: stripeMethod({ 12 | method: 'POST', 13 | fullPath: '/v1/promotion_codes/{promotion_code}', 14 | }), 15 | list: stripeMethod({ 16 | method: 'GET', 17 | fullPath: '/v1/promotion_codes', 18 | methodType: 'list', 19 | }), 20 | }); 21 | -------------------------------------------------------------------------------- /src/resources/Quotes.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Quotes = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/quotes'}), 7 | retrieve: stripeMethod({method: 'GET', fullPath: '/v1/quotes/{quote}'}), 8 | update: stripeMethod({method: 'POST', fullPath: '/v1/quotes/{quote}'}), 9 | list: stripeMethod({ 10 | method: 'GET', 11 | fullPath: '/v1/quotes', 12 | methodType: 'list', 13 | }), 14 | accept: stripeMethod({method: 'POST', fullPath: '/v1/quotes/{quote}/accept'}), 15 | cancel: stripeMethod({method: 'POST', fullPath: '/v1/quotes/{quote}/cancel'}), 16 | finalizeQuote: stripeMethod({ 17 | method: 'POST', 18 | fullPath: '/v1/quotes/{quote}/finalize', 19 | }), 20 | listComputedUpfrontLineItems: stripeMethod({ 21 | method: 'GET', 22 | fullPath: '/v1/quotes/{quote}/computed_upfront_line_items', 23 | methodType: 'list', 24 | }), 25 | listLineItems: stripeMethod({ 26 | method: 'GET', 27 | fullPath: '/v1/quotes/{quote}/line_items', 28 | methodType: 'list', 29 | }), 30 | pdf: stripeMethod({ 31 | method: 'GET', 32 | fullPath: '/v1/quotes/{quote}/pdf', 33 | host: 'files.stripe.com', 34 | streaming: true, 35 | }), 36 | }); 37 | -------------------------------------------------------------------------------- /src/resources/Radar/EarlyFraudWarnings.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const EarlyFraudWarnings = StripeResource.extend({ 6 | retrieve: stripeMethod({ 7 | method: 'GET', 8 | fullPath: '/v1/radar/early_fraud_warnings/{early_fraud_warning}', 9 | }), 10 | list: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/radar/early_fraud_warnings', 13 | methodType: 'list', 14 | }), 15 | }); 16 | -------------------------------------------------------------------------------- /src/resources/Radar/ValueListItems.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const ValueListItems = StripeResource.extend({ 6 | create: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/radar/value_list_items', 9 | }), 10 | retrieve: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/radar/value_list_items/{item}', 13 | }), 14 | list: stripeMethod({ 15 | method: 'GET', 16 | fullPath: '/v1/radar/value_list_items', 17 | methodType: 'list', 18 | }), 19 | del: stripeMethod({ 20 | method: 'DELETE', 21 | fullPath: '/v1/radar/value_list_items/{item}', 22 | }), 23 | }); 24 | -------------------------------------------------------------------------------- /src/resources/Radar/ValueLists.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const ValueLists = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/radar/value_lists'}), 7 | retrieve: stripeMethod({ 8 | method: 'GET', 9 | fullPath: '/v1/radar/value_lists/{value_list}', 10 | }), 11 | update: stripeMethod({ 12 | method: 'POST', 13 | fullPath: '/v1/radar/value_lists/{value_list}', 14 | }), 15 | list: stripeMethod({ 16 | method: 'GET', 17 | fullPath: '/v1/radar/value_lists', 18 | methodType: 'list', 19 | }), 20 | del: stripeMethod({ 21 | method: 'DELETE', 22 | fullPath: '/v1/radar/value_lists/{value_list}', 23 | }), 24 | }); 25 | -------------------------------------------------------------------------------- /src/resources/Refunds.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Refunds = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/refunds'}), 7 | retrieve: stripeMethod({method: 'GET', fullPath: '/v1/refunds/{refund}'}), 8 | update: stripeMethod({method: 'POST', fullPath: '/v1/refunds/{refund}'}), 9 | list: stripeMethod({ 10 | method: 'GET', 11 | fullPath: '/v1/refunds', 12 | methodType: 'list', 13 | }), 14 | cancel: stripeMethod({ 15 | method: 'POST', 16 | fullPath: '/v1/refunds/{refund}/cancel', 17 | }), 18 | }); 19 | -------------------------------------------------------------------------------- /src/resources/Reporting/ReportRuns.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const ReportRuns = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/reporting/report_runs'}), 7 | retrieve: stripeMethod({ 8 | method: 'GET', 9 | fullPath: '/v1/reporting/report_runs/{report_run}', 10 | }), 11 | list: stripeMethod({ 12 | method: 'GET', 13 | fullPath: '/v1/reporting/report_runs', 14 | methodType: 'list', 15 | }), 16 | }); 17 | -------------------------------------------------------------------------------- /src/resources/Reporting/ReportTypes.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const ReportTypes = StripeResource.extend({ 6 | retrieve: stripeMethod({ 7 | method: 'GET', 8 | fullPath: '/v1/reporting/report_types/{report_type}', 9 | }), 10 | list: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/reporting/report_types', 13 | methodType: 'list', 14 | }), 15 | }); 16 | -------------------------------------------------------------------------------- /src/resources/Reviews.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Reviews = StripeResource.extend({ 6 | retrieve: stripeMethod({method: 'GET', fullPath: '/v1/reviews/{review}'}), 7 | list: stripeMethod({ 8 | method: 'GET', 9 | fullPath: '/v1/reviews', 10 | methodType: 'list', 11 | }), 12 | approve: stripeMethod({ 13 | method: 'POST', 14 | fullPath: '/v1/reviews/{review}/approve', 15 | }), 16 | }); 17 | -------------------------------------------------------------------------------- /src/resources/SetupAttempts.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const SetupAttempts = StripeResource.extend({ 6 | list: stripeMethod({ 7 | method: 'GET', 8 | fullPath: '/v1/setup_attempts', 9 | methodType: 'list', 10 | }), 11 | }); 12 | -------------------------------------------------------------------------------- /src/resources/SetupIntents.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const SetupIntents = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/setup_intents'}), 7 | retrieve: stripeMethod({ 8 | method: 'GET', 9 | fullPath: '/v1/setup_intents/{intent}', 10 | }), 11 | update: stripeMethod({ 12 | method: 'POST', 13 | fullPath: '/v1/setup_intents/{intent}', 14 | }), 15 | list: stripeMethod({ 16 | method: 'GET', 17 | fullPath: '/v1/setup_intents', 18 | methodType: 'list', 19 | }), 20 | cancel: stripeMethod({ 21 | method: 'POST', 22 | fullPath: '/v1/setup_intents/{intent}/cancel', 23 | }), 24 | confirm: stripeMethod({ 25 | method: 'POST', 26 | fullPath: '/v1/setup_intents/{intent}/confirm', 27 | }), 28 | verifyMicrodeposits: stripeMethod({ 29 | method: 'POST', 30 | fullPath: '/v1/setup_intents/{intent}/verify_microdeposits', 31 | }), 32 | }); 33 | -------------------------------------------------------------------------------- /src/resources/ShippingRates.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const ShippingRates = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/shipping_rates'}), 7 | retrieve: stripeMethod({ 8 | method: 'GET', 9 | fullPath: '/v1/shipping_rates/{shipping_rate_token}', 10 | }), 11 | update: stripeMethod({ 12 | method: 'POST', 13 | fullPath: '/v1/shipping_rates/{shipping_rate_token}', 14 | }), 15 | list: stripeMethod({ 16 | method: 'GET', 17 | fullPath: '/v1/shipping_rates', 18 | methodType: 'list', 19 | }), 20 | }); 21 | -------------------------------------------------------------------------------- /src/resources/Sigma/ScheduledQueryRuns.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const ScheduledQueryRuns = StripeResource.extend({ 6 | retrieve: stripeMethod({ 7 | method: 'GET', 8 | fullPath: '/v1/sigma/scheduled_query_runs/{scheduled_query_run}', 9 | }), 10 | list: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/sigma/scheduled_query_runs', 13 | methodType: 'list', 14 | }), 15 | }); 16 | -------------------------------------------------------------------------------- /src/resources/Sources.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Sources = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/sources'}), 7 | retrieve: stripeMethod({method: 'GET', fullPath: '/v1/sources/{source}'}), 8 | update: stripeMethod({method: 'POST', fullPath: '/v1/sources/{source}'}), 9 | listSourceTransactions: stripeMethod({ 10 | method: 'GET', 11 | fullPath: '/v1/sources/{source}/source_transactions', 12 | methodType: 'list', 13 | }), 14 | verify: stripeMethod({ 15 | method: 'POST', 16 | fullPath: '/v1/sources/{source}/verify', 17 | }), 18 | }); 19 | -------------------------------------------------------------------------------- /src/resources/SubscriptionItems.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const SubscriptionItems = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/subscription_items'}), 7 | retrieve: stripeMethod({ 8 | method: 'GET', 9 | fullPath: '/v1/subscription_items/{item}', 10 | }), 11 | update: stripeMethod({ 12 | method: 'POST', 13 | fullPath: '/v1/subscription_items/{item}', 14 | }), 15 | list: stripeMethod({ 16 | method: 'GET', 17 | fullPath: '/v1/subscription_items', 18 | methodType: 'list', 19 | }), 20 | del: stripeMethod({ 21 | method: 'DELETE', 22 | fullPath: '/v1/subscription_items/{item}', 23 | }), 24 | }); 25 | -------------------------------------------------------------------------------- /src/resources/SubscriptionSchedules.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const SubscriptionSchedules = StripeResource.extend({ 6 | create: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/subscription_schedules', 9 | }), 10 | retrieve: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/subscription_schedules/{schedule}', 13 | }), 14 | update: stripeMethod({ 15 | method: 'POST', 16 | fullPath: '/v1/subscription_schedules/{schedule}', 17 | }), 18 | list: stripeMethod({ 19 | method: 'GET', 20 | fullPath: '/v1/subscription_schedules', 21 | methodType: 'list', 22 | }), 23 | cancel: stripeMethod({ 24 | method: 'POST', 25 | fullPath: '/v1/subscription_schedules/{schedule}/cancel', 26 | }), 27 | release: stripeMethod({ 28 | method: 'POST', 29 | fullPath: '/v1/subscription_schedules/{schedule}/release', 30 | }), 31 | }); 32 | -------------------------------------------------------------------------------- /src/resources/Subscriptions.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Subscriptions = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/subscriptions'}), 7 | retrieve: stripeMethod({ 8 | method: 'GET', 9 | fullPath: '/v1/subscriptions/{subscription_exposed_id}', 10 | }), 11 | update: stripeMethod({ 12 | method: 'POST', 13 | fullPath: '/v1/subscriptions/{subscription_exposed_id}', 14 | }), 15 | list: stripeMethod({ 16 | method: 'GET', 17 | fullPath: '/v1/subscriptions', 18 | methodType: 'list', 19 | }), 20 | cancel: stripeMethod({ 21 | method: 'DELETE', 22 | fullPath: '/v1/subscriptions/{subscription_exposed_id}', 23 | }), 24 | deleteDiscount: stripeMethod({ 25 | method: 'DELETE', 26 | fullPath: '/v1/subscriptions/{subscription_exposed_id}/discount', 27 | }), 28 | resume: stripeMethod({ 29 | method: 'POST', 30 | fullPath: '/v1/subscriptions/{subscription}/resume', 31 | }), 32 | search: stripeMethod({ 33 | method: 'GET', 34 | fullPath: '/v1/subscriptions/search', 35 | methodType: 'search', 36 | }), 37 | }); 38 | -------------------------------------------------------------------------------- /src/resources/Tax/Calculations.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Calculations = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/tax/calculations'}), 7 | retrieve: stripeMethod({ 8 | method: 'GET', 9 | fullPath: '/v1/tax/calculations/{calculation}', 10 | }), 11 | listLineItems: stripeMethod({ 12 | method: 'GET', 13 | fullPath: '/v1/tax/calculations/{calculation}/line_items', 14 | methodType: 'list', 15 | }), 16 | }); 17 | -------------------------------------------------------------------------------- /src/resources/Tax/Registrations.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Registrations = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/tax/registrations'}), 7 | retrieve: stripeMethod({ 8 | method: 'GET', 9 | fullPath: '/v1/tax/registrations/{id}', 10 | }), 11 | update: stripeMethod({ 12 | method: 'POST', 13 | fullPath: '/v1/tax/registrations/{id}', 14 | }), 15 | list: stripeMethod({ 16 | method: 'GET', 17 | fullPath: '/v1/tax/registrations', 18 | methodType: 'list', 19 | }), 20 | }); 21 | -------------------------------------------------------------------------------- /src/resources/Tax/Settings.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Settings = StripeResource.extend({ 6 | retrieve: stripeMethod({method: 'GET', fullPath: '/v1/tax/settings'}), 7 | update: stripeMethod({method: 'POST', fullPath: '/v1/tax/settings'}), 8 | }); 9 | -------------------------------------------------------------------------------- /src/resources/Tax/Transactions.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Transactions = StripeResource.extend({ 6 | retrieve: stripeMethod({ 7 | method: 'GET', 8 | fullPath: '/v1/tax/transactions/{transaction}', 9 | }), 10 | createFromCalculation: stripeMethod({ 11 | method: 'POST', 12 | fullPath: '/v1/tax/transactions/create_from_calculation', 13 | }), 14 | createReversal: stripeMethod({ 15 | method: 'POST', 16 | fullPath: '/v1/tax/transactions/create_reversal', 17 | }), 18 | listLineItems: stripeMethod({ 19 | method: 'GET', 20 | fullPath: '/v1/tax/transactions/{transaction}/line_items', 21 | methodType: 'list', 22 | }), 23 | }); 24 | -------------------------------------------------------------------------------- /src/resources/TaxCodes.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const TaxCodes = StripeResource.extend({ 6 | retrieve: stripeMethod({method: 'GET', fullPath: '/v1/tax_codes/{id}'}), 7 | list: stripeMethod({ 8 | method: 'GET', 9 | fullPath: '/v1/tax_codes', 10 | methodType: 'list', 11 | }), 12 | }); 13 | -------------------------------------------------------------------------------- /src/resources/TaxIds.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const TaxIds = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/tax_ids'}), 7 | retrieve: stripeMethod({method: 'GET', fullPath: '/v1/tax_ids/{id}'}), 8 | list: stripeMethod({ 9 | method: 'GET', 10 | fullPath: '/v1/tax_ids', 11 | methodType: 'list', 12 | }), 13 | del: stripeMethod({method: 'DELETE', fullPath: '/v1/tax_ids/{id}'}), 14 | }); 15 | -------------------------------------------------------------------------------- /src/resources/TaxRates.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const TaxRates = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/tax_rates'}), 7 | retrieve: stripeMethod({method: 'GET', fullPath: '/v1/tax_rates/{tax_rate}'}), 8 | update: stripeMethod({method: 'POST', fullPath: '/v1/tax_rates/{tax_rate}'}), 9 | list: stripeMethod({ 10 | method: 'GET', 11 | fullPath: '/v1/tax_rates', 12 | methodType: 'list', 13 | }), 14 | }); 15 | -------------------------------------------------------------------------------- /src/resources/Terminal/Configurations.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Configurations = StripeResource.extend({ 6 | create: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/terminal/configurations', 9 | }), 10 | retrieve: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/terminal/configurations/{configuration}', 13 | }), 14 | update: stripeMethod({ 15 | method: 'POST', 16 | fullPath: '/v1/terminal/configurations/{configuration}', 17 | }), 18 | list: stripeMethod({ 19 | method: 'GET', 20 | fullPath: '/v1/terminal/configurations', 21 | methodType: 'list', 22 | }), 23 | del: stripeMethod({ 24 | method: 'DELETE', 25 | fullPath: '/v1/terminal/configurations/{configuration}', 26 | }), 27 | }); 28 | -------------------------------------------------------------------------------- /src/resources/Terminal/ConnectionTokens.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const ConnectionTokens = StripeResource.extend({ 6 | create: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/terminal/connection_tokens', 9 | }), 10 | }); 11 | -------------------------------------------------------------------------------- /src/resources/Terminal/Locations.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Locations = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/terminal/locations'}), 7 | retrieve: stripeMethod({ 8 | method: 'GET', 9 | fullPath: '/v1/terminal/locations/{location}', 10 | }), 11 | update: stripeMethod({ 12 | method: 'POST', 13 | fullPath: '/v1/terminal/locations/{location}', 14 | }), 15 | list: stripeMethod({ 16 | method: 'GET', 17 | fullPath: '/v1/terminal/locations', 18 | methodType: 'list', 19 | }), 20 | del: stripeMethod({ 21 | method: 'DELETE', 22 | fullPath: '/v1/terminal/locations/{location}', 23 | }), 24 | }); 25 | -------------------------------------------------------------------------------- /src/resources/Terminal/Readers.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Readers = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/terminal/readers'}), 7 | retrieve: stripeMethod({ 8 | method: 'GET', 9 | fullPath: '/v1/terminal/readers/{reader}', 10 | }), 11 | update: stripeMethod({ 12 | method: 'POST', 13 | fullPath: '/v1/terminal/readers/{reader}', 14 | }), 15 | list: stripeMethod({ 16 | method: 'GET', 17 | fullPath: '/v1/terminal/readers', 18 | methodType: 'list', 19 | }), 20 | del: stripeMethod({ 21 | method: 'DELETE', 22 | fullPath: '/v1/terminal/readers/{reader}', 23 | }), 24 | cancelAction: stripeMethod({ 25 | method: 'POST', 26 | fullPath: '/v1/terminal/readers/{reader}/cancel_action', 27 | }), 28 | collectInputs: stripeMethod({ 29 | method: 'POST', 30 | fullPath: '/v1/terminal/readers/{reader}/collect_inputs', 31 | }), 32 | processPaymentIntent: stripeMethod({ 33 | method: 'POST', 34 | fullPath: '/v1/terminal/readers/{reader}/process_payment_intent', 35 | }), 36 | processSetupIntent: stripeMethod({ 37 | method: 'POST', 38 | fullPath: '/v1/terminal/readers/{reader}/process_setup_intent', 39 | }), 40 | refundPayment: stripeMethod({ 41 | method: 'POST', 42 | fullPath: '/v1/terminal/readers/{reader}/refund_payment', 43 | }), 44 | setReaderDisplay: stripeMethod({ 45 | method: 'POST', 46 | fullPath: '/v1/terminal/readers/{reader}/set_reader_display', 47 | }), 48 | }); 49 | -------------------------------------------------------------------------------- /src/resources/TestHelpers/ConfirmationTokens.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const ConfirmationTokens = StripeResource.extend({ 6 | create: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/test_helpers/confirmation_tokens', 9 | }), 10 | }); 11 | -------------------------------------------------------------------------------- /src/resources/TestHelpers/Customers.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Customers = StripeResource.extend({ 6 | fundCashBalance: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/test_helpers/customers/{customer}/fund_cash_balance', 9 | }), 10 | }); 11 | -------------------------------------------------------------------------------- /src/resources/TestHelpers/Issuing/Authorizations.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Authorizations = StripeResource.extend({ 6 | create: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/test_helpers/issuing/authorizations', 9 | }), 10 | capture: stripeMethod({ 11 | method: 'POST', 12 | fullPath: '/v1/test_helpers/issuing/authorizations/{authorization}/capture', 13 | }), 14 | expire: stripeMethod({ 15 | method: 'POST', 16 | fullPath: '/v1/test_helpers/issuing/authorizations/{authorization}/expire', 17 | }), 18 | finalizeAmount: stripeMethod({ 19 | method: 'POST', 20 | fullPath: 21 | '/v1/test_helpers/issuing/authorizations/{authorization}/finalize_amount', 22 | }), 23 | increment: stripeMethod({ 24 | method: 'POST', 25 | fullPath: 26 | '/v1/test_helpers/issuing/authorizations/{authorization}/increment', 27 | }), 28 | respond: stripeMethod({ 29 | method: 'POST', 30 | fullPath: 31 | '/v1/test_helpers/issuing/authorizations/{authorization}/fraud_challenges/respond', 32 | }), 33 | reverse: stripeMethod({ 34 | method: 'POST', 35 | fullPath: '/v1/test_helpers/issuing/authorizations/{authorization}/reverse', 36 | }), 37 | }); 38 | -------------------------------------------------------------------------------- /src/resources/TestHelpers/Issuing/Cards.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Cards = StripeResource.extend({ 6 | deliverCard: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/test_helpers/issuing/cards/{card}/shipping/deliver', 9 | }), 10 | failCard: stripeMethod({ 11 | method: 'POST', 12 | fullPath: '/v1/test_helpers/issuing/cards/{card}/shipping/fail', 13 | }), 14 | returnCard: stripeMethod({ 15 | method: 'POST', 16 | fullPath: '/v1/test_helpers/issuing/cards/{card}/shipping/return', 17 | }), 18 | shipCard: stripeMethod({ 19 | method: 'POST', 20 | fullPath: '/v1/test_helpers/issuing/cards/{card}/shipping/ship', 21 | }), 22 | submitCard: stripeMethod({ 23 | method: 'POST', 24 | fullPath: '/v1/test_helpers/issuing/cards/{card}/shipping/submit', 25 | }), 26 | }); 27 | -------------------------------------------------------------------------------- /src/resources/TestHelpers/Issuing/PersonalizationDesigns.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const PersonalizationDesigns = StripeResource.extend({ 6 | activate: stripeMethod({ 7 | method: 'POST', 8 | fullPath: 9 | '/v1/test_helpers/issuing/personalization_designs/{personalization_design}/activate', 10 | }), 11 | deactivate: stripeMethod({ 12 | method: 'POST', 13 | fullPath: 14 | '/v1/test_helpers/issuing/personalization_designs/{personalization_design}/deactivate', 15 | }), 16 | reject: stripeMethod({ 17 | method: 'POST', 18 | fullPath: 19 | '/v1/test_helpers/issuing/personalization_designs/{personalization_design}/reject', 20 | }), 21 | }); 22 | -------------------------------------------------------------------------------- /src/resources/TestHelpers/Issuing/Transactions.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Transactions = StripeResource.extend({ 6 | createForceCapture: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/test_helpers/issuing/transactions/create_force_capture', 9 | }), 10 | createUnlinkedRefund: stripeMethod({ 11 | method: 'POST', 12 | fullPath: '/v1/test_helpers/issuing/transactions/create_unlinked_refund', 13 | }), 14 | refund: stripeMethod({ 15 | method: 'POST', 16 | fullPath: '/v1/test_helpers/issuing/transactions/{transaction}/refund', 17 | }), 18 | }); 19 | -------------------------------------------------------------------------------- /src/resources/TestHelpers/Refunds.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Refunds = StripeResource.extend({ 6 | expire: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/test_helpers/refunds/{refund}/expire', 9 | }), 10 | }); 11 | -------------------------------------------------------------------------------- /src/resources/TestHelpers/Terminal/Readers.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Readers = StripeResource.extend({ 6 | presentPaymentMethod: stripeMethod({ 7 | method: 'POST', 8 | fullPath: 9 | '/v1/test_helpers/terminal/readers/{reader}/present_payment_method', 10 | }), 11 | succeedInputCollection: stripeMethod({ 12 | method: 'POST', 13 | fullPath: 14 | '/v1/test_helpers/terminal/readers/{reader}/succeed_input_collection', 15 | }), 16 | timeoutInputCollection: stripeMethod({ 17 | method: 'POST', 18 | fullPath: 19 | '/v1/test_helpers/terminal/readers/{reader}/timeout_input_collection', 20 | }), 21 | }); 22 | -------------------------------------------------------------------------------- /src/resources/TestHelpers/TestClocks.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const TestClocks = StripeResource.extend({ 6 | create: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/test_helpers/test_clocks', 9 | }), 10 | retrieve: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/test_helpers/test_clocks/{test_clock}', 13 | }), 14 | list: stripeMethod({ 15 | method: 'GET', 16 | fullPath: '/v1/test_helpers/test_clocks', 17 | methodType: 'list', 18 | }), 19 | del: stripeMethod({ 20 | method: 'DELETE', 21 | fullPath: '/v1/test_helpers/test_clocks/{test_clock}', 22 | }), 23 | advance: stripeMethod({ 24 | method: 'POST', 25 | fullPath: '/v1/test_helpers/test_clocks/{test_clock}/advance', 26 | }), 27 | }); 28 | -------------------------------------------------------------------------------- /src/resources/TestHelpers/Treasury/InboundTransfers.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const InboundTransfers = StripeResource.extend({ 6 | fail: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/test_helpers/treasury/inbound_transfers/{id}/fail', 9 | }), 10 | returnInboundTransfer: stripeMethod({ 11 | method: 'POST', 12 | fullPath: '/v1/test_helpers/treasury/inbound_transfers/{id}/return', 13 | }), 14 | succeed: stripeMethod({ 15 | method: 'POST', 16 | fullPath: '/v1/test_helpers/treasury/inbound_transfers/{id}/succeed', 17 | }), 18 | }); 19 | -------------------------------------------------------------------------------- /src/resources/TestHelpers/Treasury/OutboundPayments.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const OutboundPayments = StripeResource.extend({ 6 | update: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/test_helpers/treasury/outbound_payments/{id}', 9 | }), 10 | fail: stripeMethod({ 11 | method: 'POST', 12 | fullPath: '/v1/test_helpers/treasury/outbound_payments/{id}/fail', 13 | }), 14 | post: stripeMethod({ 15 | method: 'POST', 16 | fullPath: '/v1/test_helpers/treasury/outbound_payments/{id}/post', 17 | }), 18 | returnOutboundPayment: stripeMethod({ 19 | method: 'POST', 20 | fullPath: '/v1/test_helpers/treasury/outbound_payments/{id}/return', 21 | }), 22 | }); 23 | -------------------------------------------------------------------------------- /src/resources/TestHelpers/Treasury/OutboundTransfers.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const OutboundTransfers = StripeResource.extend({ 6 | update: stripeMethod({ 7 | method: 'POST', 8 | fullPath: 9 | '/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}', 10 | }), 11 | fail: stripeMethod({ 12 | method: 'POST', 13 | fullPath: 14 | '/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail', 15 | }), 16 | post: stripeMethod({ 17 | method: 'POST', 18 | fullPath: 19 | '/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post', 20 | }), 21 | returnOutboundTransfer: stripeMethod({ 22 | method: 'POST', 23 | fullPath: 24 | '/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return', 25 | }), 26 | }); 27 | -------------------------------------------------------------------------------- /src/resources/TestHelpers/Treasury/ReceivedCredits.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const ReceivedCredits = StripeResource.extend({ 6 | create: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/test_helpers/treasury/received_credits', 9 | }), 10 | }); 11 | -------------------------------------------------------------------------------- /src/resources/TestHelpers/Treasury/ReceivedDebits.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const ReceivedDebits = StripeResource.extend({ 6 | create: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/test_helpers/treasury/received_debits', 9 | }), 10 | }); 11 | -------------------------------------------------------------------------------- /src/resources/Tokens.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Tokens = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/tokens'}), 7 | retrieve: stripeMethod({method: 'GET', fullPath: '/v1/tokens/{token}'}), 8 | }); 9 | -------------------------------------------------------------------------------- /src/resources/Topups.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Topups = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/topups'}), 7 | retrieve: stripeMethod({method: 'GET', fullPath: '/v1/topups/{topup}'}), 8 | update: stripeMethod({method: 'POST', fullPath: '/v1/topups/{topup}'}), 9 | list: stripeMethod({ 10 | method: 'GET', 11 | fullPath: '/v1/topups', 12 | methodType: 'list', 13 | }), 14 | cancel: stripeMethod({method: 'POST', fullPath: '/v1/topups/{topup}/cancel'}), 15 | }); 16 | -------------------------------------------------------------------------------- /src/resources/Transfers.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Transfers = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/transfers'}), 7 | retrieve: stripeMethod({method: 'GET', fullPath: '/v1/transfers/{transfer}'}), 8 | update: stripeMethod({method: 'POST', fullPath: '/v1/transfers/{transfer}'}), 9 | list: stripeMethod({ 10 | method: 'GET', 11 | fullPath: '/v1/transfers', 12 | methodType: 'list', 13 | }), 14 | createReversal: stripeMethod({ 15 | method: 'POST', 16 | fullPath: '/v1/transfers/{id}/reversals', 17 | }), 18 | listReversals: stripeMethod({ 19 | method: 'GET', 20 | fullPath: '/v1/transfers/{id}/reversals', 21 | methodType: 'list', 22 | }), 23 | retrieveReversal: stripeMethod({ 24 | method: 'GET', 25 | fullPath: '/v1/transfers/{transfer}/reversals/{id}', 26 | }), 27 | updateReversal: stripeMethod({ 28 | method: 'POST', 29 | fullPath: '/v1/transfers/{transfer}/reversals/{id}', 30 | }), 31 | }); 32 | -------------------------------------------------------------------------------- /src/resources/Treasury/CreditReversals.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const CreditReversals = StripeResource.extend({ 6 | create: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/treasury/credit_reversals', 9 | }), 10 | retrieve: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/treasury/credit_reversals/{credit_reversal}', 13 | }), 14 | list: stripeMethod({ 15 | method: 'GET', 16 | fullPath: '/v1/treasury/credit_reversals', 17 | methodType: 'list', 18 | }), 19 | }); 20 | -------------------------------------------------------------------------------- /src/resources/Treasury/DebitReversals.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const DebitReversals = StripeResource.extend({ 6 | create: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/treasury/debit_reversals', 9 | }), 10 | retrieve: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/treasury/debit_reversals/{debit_reversal}', 13 | }), 14 | list: stripeMethod({ 15 | method: 'GET', 16 | fullPath: '/v1/treasury/debit_reversals', 17 | methodType: 'list', 18 | }), 19 | }); 20 | -------------------------------------------------------------------------------- /src/resources/Treasury/FinancialAccounts.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const FinancialAccounts = StripeResource.extend({ 6 | create: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/treasury/financial_accounts', 9 | }), 10 | retrieve: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/treasury/financial_accounts/{financial_account}', 13 | }), 14 | update: stripeMethod({ 15 | method: 'POST', 16 | fullPath: '/v1/treasury/financial_accounts/{financial_account}', 17 | }), 18 | list: stripeMethod({ 19 | method: 'GET', 20 | fullPath: '/v1/treasury/financial_accounts', 21 | methodType: 'list', 22 | }), 23 | close: stripeMethod({ 24 | method: 'POST', 25 | fullPath: '/v1/treasury/financial_accounts/{financial_account}/close', 26 | }), 27 | retrieveFeatures: stripeMethod({ 28 | method: 'GET', 29 | fullPath: '/v1/treasury/financial_accounts/{financial_account}/features', 30 | }), 31 | updateFeatures: stripeMethod({ 32 | method: 'POST', 33 | fullPath: '/v1/treasury/financial_accounts/{financial_account}/features', 34 | }), 35 | }); 36 | -------------------------------------------------------------------------------- /src/resources/Treasury/InboundTransfers.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const InboundTransfers = StripeResource.extend({ 6 | create: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/treasury/inbound_transfers', 9 | }), 10 | retrieve: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/treasury/inbound_transfers/{id}', 13 | }), 14 | list: stripeMethod({ 15 | method: 'GET', 16 | fullPath: '/v1/treasury/inbound_transfers', 17 | methodType: 'list', 18 | }), 19 | cancel: stripeMethod({ 20 | method: 'POST', 21 | fullPath: '/v1/treasury/inbound_transfers/{inbound_transfer}/cancel', 22 | }), 23 | }); 24 | -------------------------------------------------------------------------------- /src/resources/Treasury/OutboundPayments.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const OutboundPayments = StripeResource.extend({ 6 | create: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/treasury/outbound_payments', 9 | }), 10 | retrieve: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/treasury/outbound_payments/{id}', 13 | }), 14 | list: stripeMethod({ 15 | method: 'GET', 16 | fullPath: '/v1/treasury/outbound_payments', 17 | methodType: 'list', 18 | }), 19 | cancel: stripeMethod({ 20 | method: 'POST', 21 | fullPath: '/v1/treasury/outbound_payments/{id}/cancel', 22 | }), 23 | }); 24 | -------------------------------------------------------------------------------- /src/resources/Treasury/OutboundTransfers.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const OutboundTransfers = StripeResource.extend({ 6 | create: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v1/treasury/outbound_transfers', 9 | }), 10 | retrieve: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/treasury/outbound_transfers/{outbound_transfer}', 13 | }), 14 | list: stripeMethod({ 15 | method: 'GET', 16 | fullPath: '/v1/treasury/outbound_transfers', 17 | methodType: 'list', 18 | }), 19 | cancel: stripeMethod({ 20 | method: 'POST', 21 | fullPath: '/v1/treasury/outbound_transfers/{outbound_transfer}/cancel', 22 | }), 23 | }); 24 | -------------------------------------------------------------------------------- /src/resources/Treasury/ReceivedCredits.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const ReceivedCredits = StripeResource.extend({ 6 | retrieve: stripeMethod({ 7 | method: 'GET', 8 | fullPath: '/v1/treasury/received_credits/{id}', 9 | }), 10 | list: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/treasury/received_credits', 13 | methodType: 'list', 14 | }), 15 | }); 16 | -------------------------------------------------------------------------------- /src/resources/Treasury/ReceivedDebits.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const ReceivedDebits = StripeResource.extend({ 6 | retrieve: stripeMethod({ 7 | method: 'GET', 8 | fullPath: '/v1/treasury/received_debits/{id}', 9 | }), 10 | list: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/treasury/received_debits', 13 | methodType: 'list', 14 | }), 15 | }); 16 | -------------------------------------------------------------------------------- /src/resources/Treasury/TransactionEntries.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const TransactionEntries = StripeResource.extend({ 6 | retrieve: stripeMethod({ 7 | method: 'GET', 8 | fullPath: '/v1/treasury/transaction_entries/{id}', 9 | }), 10 | list: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/treasury/transaction_entries', 13 | methodType: 'list', 14 | }), 15 | }); 16 | -------------------------------------------------------------------------------- /src/resources/Treasury/Transactions.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const Transactions = StripeResource.extend({ 6 | retrieve: stripeMethod({ 7 | method: 'GET', 8 | fullPath: '/v1/treasury/transactions/{id}', 9 | }), 10 | list: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v1/treasury/transactions', 13 | methodType: 'list', 14 | }), 15 | }); 16 | -------------------------------------------------------------------------------- /src/resources/V2/Billing/MeterEventAdjustments.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const MeterEventAdjustments = StripeResource.extend({ 6 | create: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v2/billing/meter_event_adjustments', 9 | }), 10 | }); 11 | -------------------------------------------------------------------------------- /src/resources/V2/Billing/MeterEventSession.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const MeterEventSession = StripeResource.extend({ 6 | create: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v2/billing/meter_event_session', 9 | }), 10 | }); 11 | -------------------------------------------------------------------------------- /src/resources/V2/Billing/MeterEventStream.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const MeterEventStream = StripeResource.extend({ 6 | create: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v2/billing/meter_event_stream', 9 | host: 'meter-events.stripe.com', 10 | }), 11 | }); 12 | -------------------------------------------------------------------------------- /src/resources/V2/Billing/MeterEvents.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const MeterEvents = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v2/billing/meter_events'}), 7 | }); 8 | -------------------------------------------------------------------------------- /src/resources/V2/Core/EventDestinations.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../../../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const EventDestinations = StripeResource.extend({ 6 | create: stripeMethod({ 7 | method: 'POST', 8 | fullPath: '/v2/core/event_destinations', 9 | }), 10 | retrieve: stripeMethod({ 11 | method: 'GET', 12 | fullPath: '/v2/core/event_destinations/{id}', 13 | }), 14 | update: stripeMethod({ 15 | method: 'POST', 16 | fullPath: '/v2/core/event_destinations/{id}', 17 | }), 18 | list: stripeMethod({ 19 | method: 'GET', 20 | fullPath: '/v2/core/event_destinations', 21 | methodType: 'list', 22 | }), 23 | del: stripeMethod({ 24 | method: 'DELETE', 25 | fullPath: '/v2/core/event_destinations/{id}', 26 | }), 27 | disable: stripeMethod({ 28 | method: 'POST', 29 | fullPath: '/v2/core/event_destinations/{id}/disable', 30 | }), 31 | enable: stripeMethod({ 32 | method: 'POST', 33 | fullPath: '/v2/core/event_destinations/{id}/enable', 34 | }), 35 | ping: stripeMethod({ 36 | method: 'POST', 37 | fullPath: '/v2/core/event_destinations/{id}/ping', 38 | }), 39 | }); 40 | -------------------------------------------------------------------------------- /src/resources/WebhookEndpoints.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | import {StripeResource} from '../StripeResource.js'; 4 | const stripeMethod = StripeResource.method; 5 | export const WebhookEndpoints = StripeResource.extend({ 6 | create: stripeMethod({method: 'POST', fullPath: '/v1/webhook_endpoints'}), 7 | retrieve: stripeMethod({ 8 | method: 'GET', 9 | fullPath: '/v1/webhook_endpoints/{webhook_endpoint}', 10 | }), 11 | update: stripeMethod({ 12 | method: 'POST', 13 | fullPath: '/v1/webhook_endpoints/{webhook_endpoint}', 14 | }), 15 | list: stripeMethod({ 16 | method: 'GET', 17 | fullPath: '/v1/webhook_endpoints', 18 | methodType: 'list', 19 | }), 20 | del: stripeMethod({ 21 | method: 'DELETE', 22 | fullPath: '/v1/webhook_endpoints/{webhook_endpoint}', 23 | }), 24 | }); 25 | -------------------------------------------------------------------------------- /src/stripe.cjs.node.ts: -------------------------------------------------------------------------------- 1 | import {NodePlatformFunctions} from './platform/NodePlatformFunctions.js'; 2 | import {createStripe} from './stripe.core.js'; 3 | 4 | const Stripe = createStripe(new NodePlatformFunctions()); 5 | 6 | module.exports = Stripe; 7 | 8 | // expose constructor as a named property to enable mocking with Sinon.JS 9 | module.exports.Stripe = Stripe; 10 | 11 | // Allow use with the TypeScript compiler without `esModuleInterop`. 12 | // We may also want to add `Object.defineProperty(exports, "__esModule", {value: true});` in the future, so that Babel users will use the `default` version. 13 | module.exports.default = Stripe; 14 | -------------------------------------------------------------------------------- /src/stripe.cjs.worker.ts: -------------------------------------------------------------------------------- 1 | import {WebPlatformFunctions} from './platform/WebPlatformFunctions.js'; 2 | import {createStripe} from './stripe.core.js'; 3 | 4 | const Stripe = createStripe(new WebPlatformFunctions()); 5 | 6 | module.exports = Stripe; 7 | 8 | // expose constructor as a named property to enable mocking with Sinon.JS 9 | module.exports.Stripe = Stripe; 10 | 11 | // Allow use with the TypeScript compiler without `esModuleInterop`. 12 | // We may also want to add `Object.defineProperty(exports, "__esModule", {value: true});` in the future, so that Babel users will use the `default` version. 13 | module.exports.default = Stripe; 14 | -------------------------------------------------------------------------------- /src/stripe.esm.node.ts: -------------------------------------------------------------------------------- 1 | import {NodePlatformFunctions} from './platform/NodePlatformFunctions.js'; 2 | import {createStripe} from './stripe.core.js'; 3 | 4 | export const Stripe = createStripe(new NodePlatformFunctions()); 5 | export default Stripe; 6 | -------------------------------------------------------------------------------- /src/stripe.esm.worker.ts: -------------------------------------------------------------------------------- 1 | import {WebPlatformFunctions} from './platform/WebPlatformFunctions.js'; 2 | import {createStripe} from './stripe.core.js'; 3 | 4 | export const Stripe = createStripe(new WebPlatformFunctions()); 5 | export default Stripe; 6 | -------------------------------------------------------------------------------- /test/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | mocha: true, 4 | }, 5 | plugins: ['chai-friendly'], 6 | rules: { 7 | 'no-loop-func': 'off', 8 | 'no-sync': 'off', 9 | 'no-unused-expressions': 0, 10 | 'chai-friendly/no-unused-expressions': 2, 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /test/crypto/NodeCryptoProvider.spec.ts: -------------------------------------------------------------------------------- 1 | const {NodeCryptoProvider} = require('../../src/crypto/NodeCryptoProvider.js'); 2 | 3 | const {createCryptoProviderTestSuite} = require('./helpers.js'); 4 | 5 | describe('NodeCryptoProvider', () => { 6 | createCryptoProviderTestSuite(new NodeCryptoProvider()); 7 | }); 8 | -------------------------------------------------------------------------------- /test/crypto/SubtleCryptoProvider.spec.ts: -------------------------------------------------------------------------------- 1 | const { 2 | SubtleCryptoProvider, 3 | } = require('../../src/crypto/SubtleCryptoProvider.js'); 4 | const webcrypto = require('crypto').webcrypto; 5 | const expect = require('chai').expect; 6 | 7 | // webcrypto is only available on Node 15+. 8 | if (!webcrypto || !webcrypto.subtle) { 9 | console.log( 10 | `Skipping SubtleCryptoProvider tests. No 'webcrypto.subtle' available for ${process.version}.` 11 | ); 12 | } else { 13 | const {createCryptoProviderTestSuite} = require('./helpers.js'); 14 | 15 | describe('SubtleCryptoProvider', () => { 16 | const provider = new SubtleCryptoProvider(webcrypto.subtle); 17 | 18 | createCryptoProviderTestSuite(provider, true); 19 | 20 | it('does not support sync calls', () => { 21 | expect(() => { 22 | provider.computeHMACSignature('payload', 'secret'); 23 | }).to.throw( 24 | /SubtleCryptoProvider cannot be used in a synchronous context/ 25 | ); 26 | }); 27 | 28 | it('handles hex conversion properly (test boundaries + middle values)', async () => { 29 | const fakeCryptoInterface = { 30 | importKey: () => Promise.resolve({}), 31 | sign: () => { 32 | const buffer = new ArrayBuffer(3); 33 | const view = new Uint8Array(buffer); 34 | view[0] = 0; 35 | view[1] = 255; 36 | view[2] = 128; 37 | return Promise.resolve(buffer); 38 | }, 39 | }; 40 | 41 | const signature = await new SubtleCryptoProvider( 42 | fakeCryptoInterface 43 | ).computeHMACSignatureAsync('payload', 'secret'); 44 | 45 | expect(signature).to.equal('00ff80'); 46 | }); 47 | }); 48 | } 49 | 50 | export {}; 51 | -------------------------------------------------------------------------------- /test/resources/AccountLinks.spec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const stripe = require('../testUtils.js').getSpyableStripe(); 4 | const expect = require('chai').expect; 5 | 6 | describe('AccountLinks Resource', () => { 7 | describe('create', () => { 8 | it('Sends the correct request', () => { 9 | stripe.accountLinks.create({ 10 | account: 'acct_123', 11 | failure_url: 'https://stripe.com/failure', 12 | success_url: 'https://stripe.com/success', 13 | type: 'custom_account_verification', 14 | }); 15 | 16 | expect(stripe.LAST_REQUEST).to.deep.equal({ 17 | method: 'POST', 18 | url: '/v1/account_links', 19 | headers: {}, 20 | data: { 21 | account: 'acct_123', 22 | failure_url: 'https://stripe.com/failure', 23 | success_url: 'https://stripe.com/success', 24 | type: 'custom_account_verification', 25 | }, 26 | settings: {}, 27 | }); 28 | }); 29 | }); 30 | }); 31 | -------------------------------------------------------------------------------- /test/resources/Balance.spec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const stripe = require('../testUtils.js').getSpyableStripe(); 4 | const expect = require('chai').expect; 5 | 6 | describe('Balance Resource', () => { 7 | describe('retrieve', () => { 8 | it('Sends the correct request', () => { 9 | stripe.balance.retrieve(); 10 | expect(stripe.LAST_REQUEST).to.deep.equal({ 11 | method: 'GET', 12 | url: '/v1/balance', 13 | data: null, 14 | headers: {}, 15 | settings: {}, 16 | }); 17 | }); 18 | 19 | it('Sends the correct request [with specified auth]', () => { 20 | stripe.balance.retrieve('aGN0bIwXnHdw5645VABjPdSn8nWY7G11'); 21 | expect(stripe.LAST_REQUEST).to.deep.equal({ 22 | method: 'GET', 23 | url: '/v1/balance', 24 | data: null, 25 | auth: 'aGN0bIwXnHdw5645VABjPdSn8nWY7G11', 26 | headers: {}, 27 | settings: {}, 28 | }); 29 | }); 30 | }); 31 | }); 32 | -------------------------------------------------------------------------------- /test/resources/BalanceTransactions.spec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const stripe = require('../testUtils.js').getSpyableStripe(); 4 | const expect = require('chai').expect; 5 | 6 | describe('BalanceTransactions Resource', function() { 7 | describe('retrieve', function() { 8 | it('Sends the correct request', function() { 9 | stripe.balanceTransactions.retrieve('txn_123'); 10 | expect(stripe.LAST_REQUEST).to.deep.equal({ 11 | method: 'GET', 12 | url: '/v1/balance_transactions/txn_123', 13 | headers: {}, 14 | data: null, 15 | settings: {}, 16 | }); 17 | }); 18 | }); 19 | 20 | describe('list', function() { 21 | it('Sends the correct request', function() { 22 | stripe.balanceTransactions.list(); 23 | expect(stripe.LAST_REQUEST).to.deep.equal({ 24 | method: 'GET', 25 | url: '/v1/balance_transactions', 26 | headers: {}, 27 | data: null, 28 | settings: {}, 29 | }); 30 | }); 31 | }); 32 | }); 33 | -------------------------------------------------------------------------------- /test/resources/BillingPortal/Sessions.spec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const stripe = require('../../testUtils.js').getSpyableStripe(); 4 | 5 | const expect = require('chai').expect; 6 | 7 | describe('BillingPortal', () => { 8 | describe('Sessions Resource', () => { 9 | describe('create', () => { 10 | it('Sends the correct request', () => { 11 | const params = { 12 | customer: 'cus_123', 13 | return_url: 'https://stripe.com/return', 14 | }; 15 | stripe.billingPortal.sessions.create(params); 16 | 17 | expect(stripe.LAST_REQUEST).to.deep.equal({ 18 | method: 'POST', 19 | url: '/v1/billing_portal/sessions', 20 | headers: {}, 21 | data: params, 22 | settings: {}, 23 | }); 24 | }); 25 | }); 26 | }); 27 | }); 28 | -------------------------------------------------------------------------------- /test/resources/CountrySpecs.spec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const stripe = require('../testUtils.js').getSpyableStripe(); 4 | const expect = require('chai').expect; 5 | 6 | describe('CountrySpecs Resource', () => { 7 | describe('list', () => { 8 | it('Sends the correct request', () => { 9 | stripe.countrySpecs.list(); 10 | expect(stripe.LAST_REQUEST).to.deep.equal({ 11 | method: 'GET', 12 | url: '/v1/country_specs', 13 | data: null, 14 | headers: {}, 15 | settings: {}, 16 | }); 17 | }); 18 | }); 19 | 20 | describe('retrieve', () => { 21 | it('Sends the correct request', () => { 22 | const country = 'US'; 23 | stripe.countrySpecs.retrieve(country); 24 | expect(stripe.LAST_REQUEST).to.deep.equal({ 25 | method: 'GET', 26 | url: `/v1/country_specs/${country}`, 27 | data: null, 28 | headers: {}, 29 | settings: {}, 30 | }); 31 | }); 32 | }); 33 | }); 34 | -------------------------------------------------------------------------------- /test/resources/Disputes.spec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const stripe = require('../testUtils.js').getSpyableStripe(); 4 | const expect = require('chai').expect; 5 | 6 | describe('Dispute Resource', () => { 7 | describe('retrieve', () => { 8 | it('Sends the correct request', () => { 9 | stripe.disputes.retrieve('dp_123'); 10 | expect(stripe.LAST_REQUEST).to.deep.equal({ 11 | method: 'GET', 12 | url: '/v1/disputes/dp_123', 13 | data: null, 14 | headers: {}, 15 | settings: {}, 16 | }); 17 | }); 18 | }); 19 | 20 | describe('list', () => { 21 | it('Sends the correct request', () => { 22 | stripe.disputes.list(); 23 | expect(stripe.LAST_REQUEST).to.deep.equal({ 24 | method: 'GET', 25 | url: '/v1/disputes', 26 | data: null, 27 | headers: {}, 28 | settings: {}, 29 | }); 30 | }); 31 | }); 32 | 33 | describe('close', () => { 34 | it('Sends the correct request', () => { 35 | stripe.disputes.close('dp_123'); 36 | expect(stripe.LAST_REQUEST).to.deep.equal({ 37 | method: 'POST', 38 | url: '/v1/disputes/dp_123/close', 39 | headers: {}, 40 | data: {}, 41 | settings: {}, 42 | }); 43 | }); 44 | }); 45 | 46 | describe('update', () => { 47 | it('Sends the correct request', () => { 48 | stripe.disputes.update('dp_123', {evidence: {customer_name: 'Bob'}}); 49 | expect(stripe.LAST_REQUEST).to.deep.equal({ 50 | method: 'POST', 51 | url: '/v1/disputes/dp_123', 52 | headers: {}, 53 | data: {evidence: {customer_name: 'Bob'}}, 54 | settings: {}, 55 | }); 56 | }); 57 | }); 58 | }); 59 | -------------------------------------------------------------------------------- /test/resources/Events.spec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const stripe = require('../testUtils.js').getSpyableStripe(); 4 | const expect = require('chai').expect; 5 | 6 | describe('Events Resource', () => { 7 | describe('retrieve', () => { 8 | it('Sends the correct request', () => { 9 | stripe.events.retrieve('eventIdBaz'); 10 | expect(stripe.LAST_REQUEST).to.deep.equal({ 11 | method: 'GET', 12 | url: '/v1/events/eventIdBaz', 13 | headers: {}, 14 | data: null, 15 | settings: {}, 16 | }); 17 | }); 18 | }); 19 | 20 | describe('list', () => { 21 | it('Sends the correct request', () => { 22 | stripe.events.list({count: 25}); 23 | expect(stripe.LAST_REQUEST).to.deep.equal({ 24 | method: 'GET', 25 | url: '/v1/events?count=25', 26 | headers: {}, 27 | data: null, 28 | settings: {}, 29 | }); 30 | }); 31 | }); 32 | }); 33 | -------------------------------------------------------------------------------- /test/resources/ExchangeRates.spec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const stripe = require('../testUtils.js').getSpyableStripe(); 4 | const expect = require('chai').expect; 5 | 6 | describe('ExchangeRates Resource', () => { 7 | describe('list', () => { 8 | it('Sends the correct request', () => { 9 | stripe.exchangeRates.list(); 10 | expect(stripe.LAST_REQUEST).to.deep.equal({ 11 | method: 'GET', 12 | url: '/v1/exchange_rates', 13 | data: null, 14 | headers: {}, 15 | settings: {}, 16 | }); 17 | }); 18 | }); 19 | 20 | describe('retrieve', () => { 21 | it('Sends the correct request', () => { 22 | const currency = 'USD'; 23 | stripe.exchangeRates.retrieve(currency); 24 | expect(stripe.LAST_REQUEST).to.deep.equal({ 25 | method: 'GET', 26 | url: `/v1/exchange_rates/${currency}`, 27 | data: null, 28 | headers: {}, 29 | settings: {}, 30 | }); 31 | }); 32 | }); 33 | }); 34 | -------------------------------------------------------------------------------- /test/resources/FileLinks.spec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const stripe = require('../testUtils.js').getSpyableStripe(); 4 | const expect = require('chai').expect; 5 | 6 | describe('FileLinks Resource', () => { 7 | describe('retrieve', () => { 8 | it('Sends the correct request', () => { 9 | stripe.fileLinks.retrieve('link_123'); 10 | expect(stripe.LAST_REQUEST).to.deep.equal({ 11 | method: 'GET', 12 | url: '/v1/file_links/link_123', 13 | headers: {}, 14 | data: null, 15 | settings: {}, 16 | }); 17 | }); 18 | }); 19 | 20 | describe('create', () => { 21 | it('Sends the correct request', () => { 22 | stripe.fileLinks.create({file: 'file_123'}); 23 | expect(stripe.LAST_REQUEST).to.deep.equal({ 24 | method: 'POST', 25 | url: '/v1/file_links', 26 | headers: {}, 27 | data: {file: 'file_123'}, 28 | settings: {}, 29 | }); 30 | }); 31 | }); 32 | 33 | describe('update', () => { 34 | it('Sends the correct request', () => { 35 | stripe.fileLinks.update('link_123', {metadata: {key: 'value'}}); 36 | expect(stripe.LAST_REQUEST).to.deep.equal({ 37 | method: 'POST', 38 | url: '/v1/file_links/link_123', 39 | headers: {}, 40 | data: {metadata: {key: 'value'}}, 41 | settings: {}, 42 | }); 43 | }); 44 | }); 45 | 46 | describe('list', () => { 47 | it('Sends the correct request', () => { 48 | stripe.fileLinks.list(); 49 | expect(stripe.LAST_REQUEST).to.deep.equal({ 50 | method: 'GET', 51 | url: '/v1/file_links', 52 | headers: {}, 53 | data: null, 54 | settings: {}, 55 | }); 56 | }); 57 | }); 58 | }); 59 | -------------------------------------------------------------------------------- /test/resources/Identity/VerificationReport.spec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const stripe = require('../../testUtils.js').getSpyableStripe(); 4 | const expect = require('chai').expect; 5 | 6 | describe('Identity', () => { 7 | describe('VerificationReport Resource', () => { 8 | describe('retrieve', () => { 9 | it('Sends the correct request', () => { 10 | stripe.identity.verificationReports.retrieve('vr_123'); 11 | expect(stripe.LAST_REQUEST).to.deep.equal({ 12 | method: 'GET', 13 | url: '/v1/identity/verification_reports/vr_123', 14 | data: null, 15 | headers: {}, 16 | settings: {}, 17 | }); 18 | }); 19 | }); 20 | 21 | describe('list', () => { 22 | it('Sends the correct request', () => { 23 | stripe.identity.verificationReports.list(); 24 | expect(stripe.LAST_REQUEST).to.deep.equal({ 25 | method: 'GET', 26 | url: '/v1/identity/verification_reports', 27 | data: null, 28 | headers: {}, 29 | settings: {}, 30 | }); 31 | }); 32 | }); 33 | }); 34 | }); 35 | -------------------------------------------------------------------------------- /test/resources/Issuing/Transactions.spec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const stripe = require('../../testUtils.js').getSpyableStripe(); 4 | 5 | const expect = require('chai').expect; 6 | 7 | describe('Issuing', () => { 8 | describe('Transactions Resource', () => { 9 | describe('retrieve', () => { 10 | it('Sends the correct request', () => { 11 | stripe.issuing.transactions.retrieve('ipi_123'); 12 | 13 | expect(stripe.LAST_REQUEST).to.deep.equal({ 14 | method: 'GET', 15 | url: '/v1/issuing/transactions/ipi_123', 16 | headers: {}, 17 | data: null, 18 | settings: {}, 19 | }); 20 | }); 21 | }); 22 | 23 | describe('update', () => { 24 | it('Sends the correct request', () => { 25 | stripe.issuing.transactions.update('ipi_123', { 26 | metadata: { 27 | thing1: true, 28 | thing2: 'yes', 29 | }, 30 | }); 31 | expect(stripe.LAST_REQUEST).to.deep.equal({ 32 | method: 'POST', 33 | url: '/v1/issuing/transactions/ipi_123', 34 | headers: {}, 35 | data: { 36 | metadata: { 37 | thing1: true, 38 | thing2: 'yes', 39 | }, 40 | }, 41 | settings: {}, 42 | }); 43 | }); 44 | }); 45 | 46 | describe('list', () => { 47 | it('Sends the correct request', () => { 48 | stripe.issuing.transactions.list(); 49 | expect(stripe.LAST_REQUEST).to.deep.equal({ 50 | method: 'GET', 51 | url: '/v1/issuing/transactions', 52 | headers: {}, 53 | data: null, 54 | settings: {}, 55 | }); 56 | }); 57 | }); 58 | }); 59 | }); 60 | -------------------------------------------------------------------------------- /test/resources/Mandates.spec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const stripe = require('../testUtils.js').getSpyableStripe(); 4 | const expect = require('chai').expect; 5 | 6 | const MANDATE_TEST_ID = 'mandate_123'; 7 | 8 | describe('Mandate Resource', () => { 9 | describe('retrieve', () => { 10 | it('Sends the correct request', () => { 11 | stripe.mandates.retrieve(MANDATE_TEST_ID); 12 | expect(stripe.LAST_REQUEST).to.deep.equal({ 13 | method: 'GET', 14 | url: `/v1/mandates/${MANDATE_TEST_ID}`, 15 | data: null, 16 | headers: {}, 17 | settings: {}, 18 | }); 19 | }); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /test/resources/Radar/EarlyFraudWarnings.spec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const stripe = require('../../testUtils.js').getSpyableStripe(); 4 | const expect = require('chai').expect; 5 | 6 | describe('Radar', () => { 7 | describe('EarlyFraudWarnings Resource', () => { 8 | describe('retrieve', () => { 9 | it('Sends the correct request', () => { 10 | stripe.radar.earlyFraudWarnings.retrieve('issfr_123'); 11 | expect(stripe.LAST_REQUEST).to.deep.equal({ 12 | method: 'GET', 13 | url: '/v1/radar/early_fraud_warnings/issfr_123', 14 | data: null, 15 | headers: {}, 16 | settings: {}, 17 | }); 18 | }); 19 | }); 20 | 21 | describe('list', () => { 22 | it('Sends the correct request', () => { 23 | stripe.radar.earlyFraudWarnings.list(); 24 | expect(stripe.LAST_REQUEST).to.deep.equal({ 25 | method: 'GET', 26 | url: '/v1/radar/early_fraud_warnings', 27 | data: null, 28 | headers: {}, 29 | settings: {}, 30 | }); 31 | }); 32 | }); 33 | }); 34 | }); 35 | -------------------------------------------------------------------------------- /test/resources/Reporting/ReportTypes.spec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const stripe = require('../../testUtils.js').getSpyableStripe(); 4 | 5 | const expect = require('chai').expect; 6 | 7 | describe('Reporting', () => { 8 | describe('ReportTypes Resource', () => { 9 | describe('retrieve', () => { 10 | it('Sends the correct request', () => { 11 | stripe.reporting.reportTypes.retrieve('activity.summary.1'); 12 | 13 | expect(stripe.LAST_REQUEST).to.deep.equal({ 14 | method: 'GET', 15 | url: '/v1/reporting/report_types/activity.summary.1', 16 | headers: {}, 17 | data: null, 18 | settings: {}, 19 | }); 20 | }); 21 | }); 22 | 23 | describe('list', () => { 24 | it('Sends the correct request', () => { 25 | stripe.reporting.reportTypes.list(); 26 | expect(stripe.LAST_REQUEST).to.deep.equal({ 27 | method: 'GET', 28 | url: '/v1/reporting/report_types', 29 | headers: {}, 30 | data: null, 31 | settings: {}, 32 | }); 33 | }); 34 | }); 35 | }); 36 | }); 37 | -------------------------------------------------------------------------------- /test/resources/Reviews.spec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const stripe = require('../testUtils.js').getSpyableStripe(); 4 | const expect = require('chai').expect; 5 | 6 | describe('Review Resource', () => { 7 | describe('retrieve', () => { 8 | it('Sends the correct request', () => { 9 | stripe.reviews.retrieve('prv_123'); 10 | expect(stripe.LAST_REQUEST).to.deep.equal({ 11 | method: 'GET', 12 | url: '/v1/reviews/prv_123', 13 | data: null, 14 | headers: {}, 15 | settings: {}, 16 | }); 17 | }); 18 | }); 19 | 20 | describe('list', () => { 21 | it('Sends the correct request', () => { 22 | stripe.reviews.list(); 23 | expect(stripe.LAST_REQUEST).to.deep.equal({ 24 | method: 'GET', 25 | url: '/v1/reviews', 26 | data: null, 27 | headers: {}, 28 | settings: {}, 29 | }); 30 | }); 31 | }); 32 | 33 | describe('approve', () => { 34 | it('Sends the correct request', () => { 35 | stripe.reviews.approve('prv_123', {amount: 23}); 36 | expect(stripe.LAST_REQUEST).to.deep.equal({ 37 | method: 'POST', 38 | url: '/v1/reviews/prv_123/approve', 39 | headers: {}, 40 | data: {amount: 23}, 41 | settings: {}, 42 | }); 43 | }); 44 | }); 45 | }); 46 | -------------------------------------------------------------------------------- /test/resources/SetupAttempts.spec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const stripe = require('../testUtils.js').getSpyableStripe(); 4 | const expect = require('chai').expect; 5 | 6 | describe('Setup Attempts Resource', () => { 7 | describe('list', () => { 8 | it('Sends the correct request', () => { 9 | stripe.setupAttempts.list({setup_intent: 'si_123'}); 10 | expect(stripe.LAST_REQUEST).to.deep.equal({ 11 | method: 'GET', 12 | url: '/v1/setup_attempts?setup_intent=si_123', 13 | headers: {}, 14 | data: null, 15 | settings: {}, 16 | }); 17 | }); 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /test/resources/Sigma/ScheduledQueryRuns.spec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const stripe = require('../../testUtils.js').getSpyableStripe(); 4 | const expect = require('chai').expect; 5 | 6 | describe('Sigma', () => { 7 | describe('ScheduledQueryRun Resource', () => { 8 | describe('retrieve', () => { 9 | it('Sends the correct request', () => { 10 | stripe.sigma.scheduledQueryRuns.retrieve('sqr_123'); 11 | expect(stripe.LAST_REQUEST).to.deep.equal({ 12 | method: 'GET', 13 | url: '/v1/sigma/scheduled_query_runs/sqr_123', 14 | data: null, 15 | headers: {}, 16 | settings: {}, 17 | }); 18 | }); 19 | }); 20 | 21 | describe('list', () => { 22 | it('Sends the correct request', () => { 23 | stripe.sigma.scheduledQueryRuns.list(); 24 | expect(stripe.LAST_REQUEST).to.deep.equal({ 25 | method: 'GET', 26 | url: '/v1/sigma/scheduled_query_runs', 27 | data: null, 28 | headers: {}, 29 | settings: {}, 30 | }); 31 | }); 32 | }); 33 | }); 34 | }); 35 | -------------------------------------------------------------------------------- /test/resources/TaxCodes.spec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const stripe = require('../testUtils.js').getSpyableStripe(); 4 | const expect = require('chai').expect; 5 | 6 | describe('TaxCodes Resource', () => { 7 | describe('retrieve', () => { 8 | it('Sends the correct request', () => { 9 | stripe.taxCodes.retrieve('txcd_123'); 10 | expect(stripe.LAST_REQUEST).to.deep.equal({ 11 | method: 'GET', 12 | url: '/v1/tax_codes/txcd_123', 13 | headers: {}, 14 | data: null, 15 | settings: {}, 16 | }); 17 | }); 18 | }); 19 | 20 | describe('list', () => { 21 | it('Sends the correct request', () => { 22 | stripe.taxCodes.list(); 23 | expect(stripe.LAST_REQUEST).to.deep.equal({ 24 | method: 'GET', 25 | url: '/v1/tax_codes', 26 | headers: {}, 27 | data: null, 28 | settings: {}, 29 | }); 30 | }); 31 | }); 32 | }); 33 | -------------------------------------------------------------------------------- /test/resources/Terminal/ConnectionTokens.spec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const stripe = require('../../testUtils.js').getSpyableStripe(); 4 | 5 | const expect = require('chai').expect; 6 | 7 | describe('Terminal', () => { 8 | describe('ConnectionToken Resource', () => { 9 | describe('create', () => { 10 | it('Sends the correct request', () => { 11 | stripe.terminal.connectionTokens.create({}); 12 | expect(stripe.LAST_REQUEST).to.deep.equal({ 13 | method: 'POST', 14 | url: '/v1/terminal/connection_tokens', 15 | headers: {}, 16 | data: {}, 17 | settings: {}, 18 | }); 19 | }); 20 | }); 21 | }); 22 | }); 23 | -------------------------------------------------------------------------------- /test/resources/TestHelpers/Terminal/Readers.spec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const stripe = require('../../../testUtils.js').getSpyableStripe(); 4 | 5 | const expect = require('chai').expect; 6 | 7 | describe('Terminal', () => { 8 | describe('Readers Resource', () => { 9 | describe('update', () => { 10 | it('Sends the correct request', () => { 11 | stripe.testHelpers.terminal.readers.presentPaymentMethod('rdr_123'); 12 | expect(stripe.LAST_REQUEST).to.deep.equal({ 13 | method: 'POST', 14 | url: 15 | '/v1/test_helpers/terminal/readers/rdr_123/present_payment_method', 16 | headers: {}, 17 | data: {}, 18 | settings: {}, 19 | }); 20 | }); 21 | }); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /test/resources/Tokens.spec.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const stripe = require('../testUtils.js').getSpyableStripe(); 4 | const expect = require('chai').expect; 5 | 6 | describe('Tokens Resource', () => { 7 | describe('create', () => { 8 | it('Sends the correct request', () => { 9 | stripe.tokens.create({ 10 | card: {number: 123}, 11 | }); 12 | expect(stripe.LAST_REQUEST).to.deep.equal({ 13 | method: 'POST', 14 | url: '/v1/tokens', 15 | headers: {}, 16 | data: {card: {number: 123}}, 17 | settings: {}, 18 | }); 19 | }); 20 | }); 21 | 22 | describe('retrieve', () => { 23 | it('Sends the correct request', () => { 24 | stripe.tokens.retrieve('tokenId1'); 25 | expect(stripe.LAST_REQUEST).to.deep.equal({ 26 | method: 'GET', 27 | url: '/v1/tokens/tokenId1', 28 | headers: {}, 29 | data: null, 30 | settings: {}, 31 | }); 32 | }); 33 | }); 34 | }); 35 | -------------------------------------------------------------------------------- /test/resources/data/minimal.pdf: -------------------------------------------------------------------------------- 1 | %PDF-1.1 2 | %¥±ë 3 | 4 | 1 0 obj 5 | << /Type /Catalog 6 | /Pages 2 0 R 7 | >> 8 | endobj 9 | 10 | 2 0 obj 11 | << /Type /Pages 12 | /Kids [3 0 R] 13 | /Count 1 14 | /MediaBox [0 0 300 144] 15 | >> 16 | endobj 17 | 18 | 3 0 obj 19 | << /Type /Page 20 | /Parent 2 0 R 21 | /Resources 22 | << /Font 23 | << /F1 24 | << /Type /Font 25 | /Subtype /Type1 26 | /BaseFont /Times-Roman 27 | >> 28 | >> 29 | >> 30 | /Contents 4 0 R 31 | >> 32 | endobj 33 | 34 | 4 0 obj 35 | << /Length 55 >> 36 | stream 37 | BT 38 | /F1 18 Tf 39 | 0 0 Td 40 | (Hello World) Tj 41 | ET 42 | endstream 43 | endobj 44 | 45 | xref 46 | 0 5 47 | 0000000000 65535 f 48 | 0000000018 00000 n 49 | 0000000077 00000 n 50 | 0000000178 00000 n 51 | 0000000457 00000 n 52 | trailer 53 | << /Root 1 0 R 54 | /Size 5 55 | >> 56 | startxref 57 | 565 58 | %%EOF 59 | -------------------------------------------------------------------------------- /test/setup.js: -------------------------------------------------------------------------------- 1 | // This file is registered in .mocharc, and is run before any tests are run. 2 | // We need to globally register chai-as-promised here because this "extends" chai and 3 | // otherwise the promise functionality will not be available in chai. 4 | require('chai').use(require('chai-as-promised')); 5 | -------------------------------------------------------------------------------- /testProjects/cjs/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true, 5 | es6: true, 6 | }, 7 | extends: [ 8 | 'eslint:recommended', 9 | 'plugin:eslint-plugin-import/recommended' 10 | ], 11 | rules: { 12 | 'import/no-unresolved': [2, {commonjs: true}], 13 | } 14 | }; 15 | -------------------------------------------------------------------------------- /testProjects/cjs/index.js: -------------------------------------------------------------------------------- 1 | const stripe = require('stripe')(process.argv[2], { 2 | host: process.env.STRIPE_MOCK_HOST || 'localhost', 3 | port: process.env.STRIPE_MOCK_PORT || 12111, 4 | protocol: 'http', 5 | }); 6 | 7 | try { 8 | throw new stripe.errors.StripeError({ 9 | charge: 'foo', 10 | unknown_prop: 'bar', 11 | }); 12 | } catch (e) { 13 | if (e instanceof stripe.errors.StripeError) { 14 | console.log("Caught StripeError"); 15 | } else { 16 | throw e; 17 | } 18 | } 19 | 20 | async function exampleFunction(args) { 21 | try { 22 | await stripe.paymentIntents.create(args); 23 | } catch (e) { 24 | if (e instanceof stripe.errors.StripeInvalidRequestError) { 25 | console.log("Caught StripeInvalidRequestError"); 26 | } else { 27 | throw e; 28 | } 29 | } 30 | } 31 | 32 | exampleFunction({ 33 | // The required parameter currency is missing 34 | amount: 2000, 35 | confirm: true, 36 | payment_method: 'pm_card_visa', 37 | }); 38 | -------------------------------------------------------------------------------- /testProjects/cjs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cjs", 3 | "type": "commonjs", 4 | "version": "1.0.0", 5 | "description": "", 6 | "main": "index.js", 7 | "dependencies": { 8 | "stripe": "file:../../" 9 | }, 10 | "scripts": { 11 | "runtestproject": "node index.js", 12 | "lint": "eslint ." 13 | }, 14 | "devDependencies": { 15 | "eslint": "^8.33.0", 16 | "eslint-plugin-import": "^2.27.5" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /testProjects/cloudflare-pages/functions/index.js: -------------------------------------------------------------------------------- 1 | import Stripe from 'stripe'; 2 | 3 | export async function onRequestPost({env, request}) { 4 | const sig = request.headers.get('Stripe-Signature'); 5 | const body = await request.text(); 6 | 7 | const stripe = new Stripe(env.STRIPE_API_KEY, { 8 | httpClient: Stripe.createFetchHttpClient(), 9 | }); 10 | const webCrypto = Stripe.createSubtleCryptoProvider(); 11 | 12 | try { 13 | const event = await stripe.webhooks.constructEventAsync( 14 | body, // raw request body 15 | sig, // signature header 16 | env.STRIPE_SIGNING_SECRET, 17 | undefined, 18 | webCrypto 19 | ); 20 | } catch (err) { 21 | console.error(err); 22 | return new Response(`Error: ${err.message}`, { 23 | status: 400, 24 | }); 25 | } 26 | 27 | return new Response(JSON.stringify({ received: true }), { 28 | headers: { 29 | "Content-Type": "application/json;charset=utf-8", 30 | }, 31 | }); 32 | } 33 | -------------------------------------------------------------------------------- /testProjects/cloudflare-pages/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cloudflare-pages", 3 | "version": "1.0.0", 4 | "description": "", 5 | "scripts": { 6 | "build": "wrangler pages functions build" 7 | }, 8 | "keywords": [], 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "stripe": "file:../../" 13 | }, 14 | "devDependencies": { 15 | "wrangler": "^3.50.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /testProjects/cloudflare-worker/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cloudflare-worker", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "./src/index.js", 6 | "scripts": { 7 | "build": "wrangler deploy --dry-run" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "stripe": "file:../../" 14 | }, 15 | "devDependencies": { 16 | "wrangler": "^3.50.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /testProjects/cloudflare-worker/src/index.js: -------------------------------------------------------------------------------- 1 | import Stripe from "stripe"; 2 | 3 | async function handleRequest(request, env) { 4 | const stripe = Stripe(env.STRIPE_API_KEY, { 5 | // Cloudflare Workers use the Fetch API for their API requests. 6 | httpClient: Stripe.createFetchHttpClient() 7 | }); 8 | /* 9 | * Sample checkout integration which redirects a customer to a checkout page 10 | * for the specified line items. 11 | * 12 | * See https://stripe.com/docs/payments/accept-a-payment?integration=checkout. 13 | */ 14 | const session = await stripe.checkout.sessions.create({ 15 | payment_method_types: ['card'], 16 | line_items: [ 17 | { 18 | price_data: { 19 | currency: 'usd', 20 | product_data: { 21 | name: 'T-shirt', 22 | }, 23 | unit_amount: 2000, 24 | }, 25 | quantity: 1, 26 | }, 27 | ], 28 | mode: 'payment', 29 | success_url: 'https://example.com/success', 30 | cancel_url: 'https://example.com/cancel', 31 | }); 32 | 33 | return Response.redirect(session.url, 303); 34 | }; 35 | 36 | export default { 37 | fetch: handleRequest 38 | } 39 | -------------------------------------------------------------------------------- /testProjects/cloudflare-worker/wrangler.toml: -------------------------------------------------------------------------------- 1 | name = "my-stripe-worker" 2 | main = "src/index.js" 3 | compatibility_flags = [] 4 | compatibility_date = "2022-02-02" 5 | workers_dev = true 6 | -------------------------------------------------------------------------------- /testProjects/esbuild/index.js: -------------------------------------------------------------------------------- 1 | import {Stripe} from 'stripe'; 2 | import assert from 'assert'; 3 | 4 | // API key is null to trigger an authentication error 5 | const stripe = new Stripe("i'm not a real key", { 6 | host: process.env.STRIPE_MOCK_HOST || 'localhost', 7 | port: process.env.STRIPE_MOCK_PORT || 12111, 8 | protocol: 'http', 9 | }); 10 | 11 | try { 12 | throw new stripe.errors.StripeUnknownError({ 13 | charge: 'foo', 14 | unknown_prop: 'bar', 15 | }); 16 | } catch (e) { 17 | assert (e instanceof stripe.errors.StripeUnknownError); 18 | assert (e.type === 'StripeUnknownError'); 19 | } 20 | 21 | async function exampleFunction(args) { 22 | try { 23 | await stripe.paymentIntents.create(args); 24 | throw new Error('Expected an error'); 25 | } catch (e) { 26 | assert (e instanceof stripe.errors.StripeAuthenticationError); 27 | assert (e.type === 'StripeAuthenticationError'); 28 | } 29 | } 30 | 31 | exampleFunction({ 32 | // The required parameter currency is missing 33 | amount: 2000, 34 | confirm: true, 35 | payment_method: 'pm_card_visa', 36 | }); 37 | -------------------------------------------------------------------------------- /testProjects/esbuild/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mjs", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "dependencies": { 7 | "stripe": "file:../../" 8 | }, 9 | "scripts": { 10 | "clean": "rm -rf node_modules && rm -rf dist", 11 | "build": "esbuild index.js --bundle --platform=node --minify --target=es2020 --outdir=dist", 12 | "start": "node dist/index.js" 13 | }, 14 | "devDependencies": { 15 | "esbuild": "^0.20.2" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /testProjects/mjs-ts/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true, 5 | es6: true, 6 | }, 7 | parser: '@typescript-eslint/parser', 8 | "plugins": [ 9 | "@typescript-eslint" 10 | ], 11 | extends: [ 12 | 'eslint:recommended', 13 | 'plugin:@typescript-eslint/eslint-recommended', 14 | 'plugin:@typescript-eslint/recommended', 15 | 'plugin:eslint-plugin-import/recommended' 16 | ] 17 | }; 18 | -------------------------------------------------------------------------------- /testProjects/mjs-ts/index.ts: -------------------------------------------------------------------------------- 1 | import DefaultStripe, {Stripe} from 'stripe'; 2 | 3 | const stripe = new Stripe(process.argv[2], { 4 | // if we specify a version, then our smoke tests fail every time there's a new API version being prepped 5 | apiVersion: undefined, 6 | host: process.env.STRIPE_MOCK_HOST || 'localhost', 7 | port: process.env.STRIPE_MOCK_PORT || 12111, 8 | protocol: 'http', 9 | }); 10 | const defaultStripe = new DefaultStripe(process.argv[2], { 11 | // if we specify a version, then our smoke tests fail every time there's a new API version being prepped 12 | apiVersion: undefined, 13 | host: process.env.STRIPE_MOCK_HOST || 'localhost', 14 | port: process.env.STRIPE_MOCK_PORT || 12111, 15 | protocol: 'http', 16 | }); 17 | 18 | try { 19 | throw new stripe.errors.StripeError({ 20 | charge: 'foo', 21 | unknown_prop: 'bar', 22 | } as any); 23 | } catch (e) { 24 | if (e instanceof stripe.errors.StripeError) { 25 | console.log('Caught StripeError'); 26 | } else { 27 | throw e; 28 | } 29 | } 30 | 31 | async function exampleFunction(args: Stripe.PaymentIntentCreateParams) { 32 | try { 33 | const pi: Stripe.PaymentIntent = await stripe.paymentIntents.create(args); 34 | } catch (e) { 35 | if (e instanceof stripe.errors.StripeInvalidRequestError) { 36 | console.log('Caught StripeInvalidRequestError'); 37 | } else { 38 | throw e; 39 | } 40 | } 41 | } 42 | 43 | exampleFunction({ 44 | currency: 'usd', 45 | amount: 2000, 46 | confirm: true, 47 | payment_method: 'pm_card_visa', 48 | }); 49 | -------------------------------------------------------------------------------- /testProjects/mjs-ts/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mjs", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "dependencies": { 7 | "stripe": "file:../../", 8 | "ts-node": "^10.9.1" 9 | }, 10 | "scripts": { 11 | "runtestproject": "ts-node index.ts", 12 | "lint": "eslint . --ext .ts" 13 | }, 14 | "devDependencies": { 15 | "@typescript-eslint/eslint-plugin": "^5.50.0", 16 | "@typescript-eslint/parser": "^5.50.0", 17 | "eslint": "^8.33.0", 18 | "eslint-plugin-import": "^2.27.5" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /testProjects/mjs/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true, 5 | es6: true, 6 | }, 7 | extends: [ 8 | 'eslint:recommended', 9 | 'plugin:eslint-plugin-import/recommended' 10 | ], 11 | rules: { 12 | 'no-unused-vars': 'off' 13 | } 14 | }; 15 | -------------------------------------------------------------------------------- /testProjects/mjs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mjs", 3 | "type": "module", 4 | "version": "1.0.0", 5 | "description": "", 6 | "main": "index.js", 7 | "dependencies": { 8 | "stripe": "file:../../" 9 | }, 10 | "scripts": { 11 | "runtestproject": "node index.js", 12 | "lint": "eslint ." 13 | }, 14 | "devDependencies": { 15 | "eslint": "^8.33.0", 16 | "eslint-plugin-import": "^2.27.5" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tsconfig.cjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "./cjs", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "target": "es2017", 7 | "checkJs": false, 8 | "alwaysStrict": true, 9 | "noImplicitAny": true, 10 | "noImplicitThis": true, 11 | "strict": true, 12 | "strictFunctionTypes": true, 13 | "types": [ "node" ], 14 | "esModuleInterop": false // This is a viral option, do not enable https://www.semver-ts.org/#module-interop 15 | }, 16 | "include": ["./src/**/*"], 17 | "exclude": ["./src/stripe.esm.node.ts", "./src/stripe.esm.worker.ts"], 18 | } 19 | -------------------------------------------------------------------------------- /tsconfig.esm.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.cjs.json", 3 | "compilerOptions": { 4 | "outDir": "./esm", 5 | "module": "es2022", 6 | }, 7 | "exclude": ["./src/stripe.cjs.node.ts", "./src/stripe.cjs.worker.ts"], 8 | } 9 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.cjs.json", 3 | "compilerOptions": { 4 | "noEmit": true, 5 | "types": ["node", "mocha"] 6 | }, 7 | "ts-node": { 8 | "experimentalResolver": true 9 | }, 10 | "include": ["src/**/*.ts", "test/**/*.ts"] 11 | } 12 | -------------------------------------------------------------------------------- /types/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true, 5 | }, 6 | parser: '@typescript-eslint/parser', 7 | plugins: ['@typescript-eslint', 'prettier'], 8 | extends: [ 9 | 'eslint:recommended', 10 | 'plugin:@typescript-eslint/eslint-recommended', 11 | 'plugin:@typescript-eslint/recommended', 12 | 'plugin:prettier/recommended', 13 | ], 14 | rules: { 15 | '@typescript-eslint/no-use-before-define': 0, 16 | '@typescript-eslint/no-empty-interface': 0, 17 | '@typescript-eslint/no-unused-vars': 0, 18 | '@typescript-eslint/triple-slash-reference': 0, 19 | '@typescript-eslint/ban-ts-ignore': 0, 20 | '@typescript-eslint/ban-types': 0, 21 | }, 22 | }; 23 | -------------------------------------------------------------------------------- /types/AccountLinks.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | /** 6 | * Account Links are the means by which a Connect platform grants a connected account permission to access 7 | * Stripe-hosted applications, such as Connect Onboarding. 8 | * 9 | * Related guide: [Connect Onboarding](https://stripe.com/docs/connect/custom/hosted-onboarding) 10 | */ 11 | interface AccountLink { 12 | /** 13 | * String representing the object's type. Objects of the same type share the same value. 14 | */ 15 | object: 'account_link'; 16 | 17 | /** 18 | * Time at which the object was created. Measured in seconds since the Unix epoch. 19 | */ 20 | created: number; 21 | 22 | /** 23 | * The timestamp at which this account link will expire. 24 | */ 25 | expires_at: number; 26 | 27 | /** 28 | * The URL for the account link. 29 | */ 30 | url: string; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /types/ApplePayDomains.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | /** 6 | * The ApplePayDomain object. 7 | */ 8 | interface ApplePayDomain { 9 | /** 10 | * Unique identifier for the object. 11 | */ 12 | id: string; 13 | 14 | /** 15 | * String representing the object's type. Objects of the same type share the same value. 16 | */ 17 | object: 'apple_pay_domain'; 18 | 19 | /** 20 | * Time at which the object was created. Measured in seconds since the Unix epoch. 21 | */ 22 | created: number; 23 | 24 | /** 25 | * Always true for a deleted object 26 | */ 27 | deleted?: void; 28 | 29 | domain_name: string; 30 | 31 | /** 32 | * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. 33 | */ 34 | livemode: boolean; 35 | } 36 | 37 | /** 38 | * The DeletedApplePayDomain object. 39 | */ 40 | interface DeletedApplePayDomain { 41 | /** 42 | * Unique identifier for the object. 43 | */ 44 | id: string; 45 | 46 | /** 47 | * String representing the object's type. Objects of the same type share the same value. 48 | */ 49 | object: 'apple_pay_domain'; 50 | 51 | /** 52 | * Always true for a deleted object 53 | */ 54 | deleted: true; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /types/Applications.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | /** 6 | * The Application object. 7 | */ 8 | interface Application { 9 | /** 10 | * Unique identifier for the object. 11 | */ 12 | id: string; 13 | 14 | /** 15 | * String representing the object's type. Objects of the same type share the same value. 16 | */ 17 | object: 'application'; 18 | 19 | /** 20 | * Always true for a deleted object 21 | */ 22 | deleted?: void; 23 | 24 | /** 25 | * The name of the application. 26 | */ 27 | name: string | null; 28 | } 29 | 30 | /** 31 | * The DeletedApplication object. 32 | */ 33 | interface DeletedApplication { 34 | /** 35 | * Unique identifier for the object. 36 | */ 37 | id: string; 38 | 39 | /** 40 | * String representing the object's type. Objects of the same type share the same value. 41 | */ 42 | object: 'application'; 43 | 44 | /** 45 | * Always true for a deleted object 46 | */ 47 | deleted: true; 48 | 49 | /** 50 | * The name of the application. 51 | */ 52 | name: string | null; 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /types/BalanceResource.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | interface BalanceRetrieveParams { 6 | /** 7 | * Specifies which fields in the response should be expanded. 8 | */ 9 | expand?: Array; 10 | } 11 | 12 | class BalanceResource { 13 | /** 14 | * Retrieves the current account balance, based on the authentication that was used to make the request. 15 | * For a sample request, see [Accounting for negative balances](https://docs.stripe.com/docs/connect/account-balances#accounting-for-negative-balances). 16 | */ 17 | retrieve( 18 | params?: BalanceRetrieveParams, 19 | options?: RequestOptions 20 | ): Promise>; 21 | retrieve( 22 | options?: RequestOptions 23 | ): Promise>; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /types/BalanceTransactionSources.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | type BalanceTransactionSource = 6 | | ApplicationFee 7 | | Charge 8 | | ConnectCollectionTransfer 9 | | CustomerCashBalanceTransaction 10 | | Dispute 11 | | FeeRefund 12 | | Issuing.Authorization 13 | | Issuing.Dispute 14 | | Issuing.Transaction 15 | | Payout 16 | | Refund 17 | | ReserveTransaction 18 | | TaxDeductedAtSource 19 | | Topup 20 | | Transfer 21 | | TransferReversal; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /types/Billing/AlertTriggereds.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | namespace Billing { 6 | /** 7 | * The AlertTriggered object. 8 | */ 9 | interface AlertTriggered { 10 | /** 11 | * String representing the object's type. Objects of the same type share the same value. 12 | */ 13 | object: 'billing.alert_triggered'; 14 | 15 | /** 16 | * A billing alert is a resource that notifies you when a certain usage threshold on a meter is crossed. For example, you might create a billing alert to notify you when a certain user made 100 API requests. 17 | */ 18 | alert: Stripe.Billing.Alert; 19 | 20 | /** 21 | * Time at which the object was created. Measured in seconds since the Unix epoch. 22 | */ 23 | created: number; 24 | 25 | /** 26 | * ID of customer for which the alert triggered 27 | */ 28 | customer: string; 29 | 30 | /** 31 | * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. 32 | */ 33 | livemode: boolean; 34 | 35 | /** 36 | * The value triggering the alert 37 | */ 38 | value: number; 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /types/Billing/CreditBalanceTransactionsResource.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | namespace Billing { 6 | interface CreditBalanceTransactionRetrieveParams { 7 | /** 8 | * Specifies which fields in the response should be expanded. 9 | */ 10 | expand?: Array; 11 | } 12 | 13 | interface CreditBalanceTransactionListParams extends PaginationParams { 14 | /** 15 | * The customer for which to fetch credit balance transactions. 16 | */ 17 | customer: string; 18 | 19 | /** 20 | * The credit grant for which to fetch credit balance transactions. 21 | */ 22 | credit_grant?: string; 23 | 24 | /** 25 | * Specifies which fields in the response should be expanded. 26 | */ 27 | expand?: Array; 28 | } 29 | 30 | class CreditBalanceTransactionsResource { 31 | /** 32 | * Retrieves a credit balance transaction. 33 | */ 34 | retrieve( 35 | id: string, 36 | params?: CreditBalanceTransactionRetrieveParams, 37 | options?: RequestOptions 38 | ): Promise>; 39 | retrieve( 40 | id: string, 41 | options?: RequestOptions 42 | ): Promise>; 43 | 44 | /** 45 | * Retrieve a list of credit balance transactions. 46 | */ 47 | list( 48 | params: CreditBalanceTransactionListParams, 49 | options?: RequestOptions 50 | ): ApiListPromise; 51 | } 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /types/Billing/MeterEventAdjustmentsResource.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | namespace Billing { 6 | interface MeterEventAdjustmentCreateParams { 7 | /** 8 | * The name of the meter event. Corresponds with the `event_name` field on a meter. 9 | */ 10 | event_name: string; 11 | 12 | /** 13 | * Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet. 14 | */ 15 | type: 'cancel'; 16 | 17 | /** 18 | * Specifies which event to cancel. 19 | */ 20 | cancel?: MeterEventAdjustmentCreateParams.Cancel; 21 | 22 | /** 23 | * Specifies which fields in the response should be expanded. 24 | */ 25 | expand?: Array; 26 | } 27 | 28 | namespace MeterEventAdjustmentCreateParams { 29 | interface Cancel { 30 | /** 31 | * Unique identifier for the event. You can only cancel events within 24 hours of Stripe receiving them. 32 | */ 33 | identifier?: string; 34 | } 35 | } 36 | 37 | class MeterEventAdjustmentsResource { 38 | /** 39 | * Creates a billing meter event adjustment. 40 | */ 41 | create( 42 | params: MeterEventAdjustmentCreateParams, 43 | options?: RequestOptions 44 | ): Promise>; 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /types/Climate/ProductsResource.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | namespace Climate { 6 | interface ProductRetrieveParams { 7 | /** 8 | * Specifies which fields in the response should be expanded. 9 | */ 10 | expand?: Array; 11 | } 12 | 13 | interface ProductListParams extends PaginationParams { 14 | /** 15 | * Specifies which fields in the response should be expanded. 16 | */ 17 | expand?: Array; 18 | } 19 | 20 | class ProductsResource { 21 | /** 22 | * Retrieves the details of a Climate product with the given ID. 23 | */ 24 | retrieve( 25 | id: string, 26 | params?: ProductRetrieveParams, 27 | options?: RequestOptions 28 | ): Promise>; 29 | retrieve( 30 | id: string, 31 | options?: RequestOptions 32 | ): Promise>; 33 | 34 | /** 35 | * Lists all available Climate product objects. 36 | */ 37 | list( 38 | params?: ProductListParams, 39 | options?: RequestOptions 40 | ): ApiListPromise; 41 | list(options?: RequestOptions): ApiListPromise; 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /types/Climate/SuppliersResource.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | namespace Climate { 6 | interface SupplierRetrieveParams { 7 | /** 8 | * Specifies which fields in the response should be expanded. 9 | */ 10 | expand?: Array; 11 | } 12 | 13 | interface SupplierListParams extends PaginationParams { 14 | /** 15 | * Specifies which fields in the response should be expanded. 16 | */ 17 | expand?: Array; 18 | } 19 | 20 | class SuppliersResource { 21 | /** 22 | * Retrieves a Climate supplier object. 23 | */ 24 | retrieve( 25 | id: string, 26 | params?: SupplierRetrieveParams, 27 | options?: RequestOptions 28 | ): Promise>; 29 | retrieve( 30 | id: string, 31 | options?: RequestOptions 32 | ): Promise>; 33 | 34 | /** 35 | * Lists all available Climate supplier objects. 36 | */ 37 | list( 38 | params?: SupplierListParams, 39 | options?: RequestOptions 40 | ): ApiListPromise; 41 | list(options?: RequestOptions): ApiListPromise; 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /types/ConfirmationTokensResource.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | interface ConfirmationTokenRetrieveParams { 6 | /** 7 | * Specifies which fields in the response should be expanded. 8 | */ 9 | expand?: Array; 10 | } 11 | 12 | class ConfirmationTokensResource { 13 | /** 14 | * Retrieves an existing ConfirmationToken object 15 | */ 16 | retrieve( 17 | id: string, 18 | params?: ConfirmationTokenRetrieveParams, 19 | options?: RequestOptions 20 | ): Promise>; 21 | retrieve( 22 | id: string, 23 | options?: RequestOptions 24 | ): Promise>; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /types/ConnectCollectionTransfers.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | /** 6 | * The ConnectCollectionTransfer object. 7 | */ 8 | interface ConnectCollectionTransfer { 9 | /** 10 | * Unique identifier for the object. 11 | */ 12 | id: string; 13 | 14 | /** 15 | * String representing the object's type. Objects of the same type share the same value. 16 | */ 17 | object: 'connect_collection_transfer'; 18 | 19 | /** 20 | * Amount transferred, in cents (or local equivalent). 21 | */ 22 | amount: number; 23 | 24 | /** 25 | * 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). 26 | */ 27 | currency: string; 28 | 29 | /** 30 | * ID of the account that funds are being collected for. 31 | */ 32 | destination: string | Stripe.Account; 33 | 34 | /** 35 | * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. 36 | */ 37 | livemode: boolean; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /types/CountrySpecsResource.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | interface CountrySpecRetrieveParams { 6 | /** 7 | * Specifies which fields in the response should be expanded. 8 | */ 9 | expand?: Array; 10 | } 11 | 12 | interface CountrySpecListParams extends PaginationParams { 13 | /** 14 | * Specifies which fields in the response should be expanded. 15 | */ 16 | expand?: Array; 17 | } 18 | 19 | class CountrySpecsResource { 20 | /** 21 | * Returns a Country Spec for a given Country code. 22 | */ 23 | retrieve( 24 | id: string, 25 | params?: CountrySpecRetrieveParams, 26 | options?: RequestOptions 27 | ): Promise>; 28 | retrieve( 29 | id: string, 30 | options?: RequestOptions 31 | ): Promise>; 32 | 33 | /** 34 | * Lists all Country Spec objects available in the API. 35 | */ 36 | list( 37 | params?: CountrySpecListParams, 38 | options?: RequestOptions 39 | ): ApiListPromise; 40 | list(options?: RequestOptions): ApiListPromise; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /types/CustomerSources.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | type CustomerSource = Account | BankAccount | Card | Source; 6 | 7 | type DeletedCustomerSource = DeletedBankAccount | DeletedCard; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /types/Entitlements/ActiveEntitlementSummaries.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | namespace Entitlements { 6 | /** 7 | * A summary of a customer's active entitlements. 8 | */ 9 | interface ActiveEntitlementSummary { 10 | /** 11 | * String representing the object's type. Objects of the same type share the same value. 12 | */ 13 | object: 'entitlements.active_entitlement_summary'; 14 | 15 | /** 16 | * The customer that is entitled to this feature. 17 | */ 18 | customer: string; 19 | 20 | /** 21 | * The list of entitlements this customer has. 22 | */ 23 | entitlements: ApiList; 24 | 25 | /** 26 | * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. 27 | */ 28 | livemode: boolean; 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /types/Entitlements/ActiveEntitlements.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | namespace Entitlements { 6 | /** 7 | * An active entitlement describes access to a feature for a customer. 8 | */ 9 | interface ActiveEntitlement { 10 | /** 11 | * Unique identifier for the object. 12 | */ 13 | id: string; 14 | 15 | /** 16 | * String representing the object's type. Objects of the same type share the same value. 17 | */ 18 | object: 'entitlements.active_entitlement'; 19 | 20 | /** 21 | * The [Feature](https://stripe.com/docs/api/entitlements/feature) that the customer is entitled to. 22 | */ 23 | feature: string | Stripe.Entitlements.Feature; 24 | 25 | /** 26 | * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. 27 | */ 28 | livemode: boolean; 29 | 30 | /** 31 | * A unique key you provide as your own system identifier. This may be up to 80 characters. 32 | */ 33 | lookup_key: string; 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /types/Entitlements/ActiveEntitlementsResource.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | namespace Entitlements { 6 | interface ActiveEntitlementRetrieveParams { 7 | /** 8 | * Specifies which fields in the response should be expanded. 9 | */ 10 | expand?: Array; 11 | } 12 | 13 | interface ActiveEntitlementListParams extends PaginationParams { 14 | /** 15 | * The ID of the customer. 16 | */ 17 | customer: string; 18 | 19 | /** 20 | * Specifies which fields in the response should be expanded. 21 | */ 22 | expand?: Array; 23 | } 24 | 25 | class ActiveEntitlementsResource { 26 | /** 27 | * Retrieve an active entitlement 28 | */ 29 | retrieve( 30 | id: string, 31 | params?: ActiveEntitlementRetrieveParams, 32 | options?: RequestOptions 33 | ): Promise>; 34 | retrieve( 35 | id: string, 36 | options?: RequestOptions 37 | ): Promise>; 38 | 39 | /** 40 | * Retrieve a list of active entitlements for a customer 41 | */ 42 | list( 43 | params: ActiveEntitlementListParams, 44 | options?: RequestOptions 45 | ): ApiListPromise; 46 | } 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /types/Entitlements/Features.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | namespace Entitlements { 6 | /** 7 | * A feature represents a monetizable ability or functionality in your system. 8 | * Features can be assigned to products, and when those products are purchased, Stripe will create an entitlement to the feature for the purchasing customer. 9 | */ 10 | interface Feature { 11 | /** 12 | * Unique identifier for the object. 13 | */ 14 | id: string; 15 | 16 | /** 17 | * String representing the object's type. Objects of the same type share the same value. 18 | */ 19 | object: 'entitlements.feature'; 20 | 21 | /** 22 | * Inactive features cannot be attached to new products and will not be returned from the features list endpoint. 23 | */ 24 | active: boolean; 25 | 26 | /** 27 | * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. 28 | */ 29 | livemode: boolean; 30 | 31 | /** 32 | * A unique key you provide as your own system identifier. This may be up to 80 characters. 33 | */ 34 | lookup_key: string; 35 | 36 | /** 37 | * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. 38 | */ 39 | metadata: Stripe.Metadata; 40 | 41 | /** 42 | * The feature's name, for your own purpose, not meant to be displayable to the customer. 43 | */ 44 | name: string; 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /types/EphemeralKeys.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | /** 6 | * The EphemeralKey object. 7 | */ 8 | interface EphemeralKey { 9 | /** 10 | * Unique identifier for the object. 11 | */ 12 | id: string; 13 | 14 | /** 15 | * String representing the object's type. Objects of the same type share the same value. 16 | */ 17 | object: 'ephemeral_key'; 18 | 19 | /** 20 | * Time at which the object was created. Measured in seconds since the Unix epoch. 21 | */ 22 | created: number; 23 | 24 | /** 25 | * Time at which the key will expire. Measured in seconds since the Unix epoch. 26 | */ 27 | expires: number; 28 | 29 | /** 30 | * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. 31 | */ 32 | livemode: boolean; 33 | 34 | /** 35 | * The key's secret. You can use this value to make authorized requests to the Stripe API. 36 | */ 37 | secret?: string; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /types/ExchangeRatesResource.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | interface ExchangeRateRetrieveParams { 6 | /** 7 | * Specifies which fields in the response should be expanded. 8 | */ 9 | expand?: Array; 10 | } 11 | 12 | interface ExchangeRateListParams extends PaginationParams { 13 | /** 14 | * Specifies which fields in the response should be expanded. 15 | */ 16 | expand?: Array; 17 | } 18 | 19 | class ExchangeRatesResource { 20 | /** 21 | * Retrieves the exchange rates from the given currency to every supported currency. 22 | */ 23 | retrieve( 24 | id: string, 25 | params?: ExchangeRateRetrieveParams, 26 | options?: RequestOptions 27 | ): Promise>; 28 | retrieve( 29 | id: string, 30 | options?: RequestOptions 31 | ): Promise>; 32 | 33 | /** 34 | * Returns a list of objects that contain the rates at which foreign currencies are converted to one another. Only shows the currencies for which Stripe supports. 35 | */ 36 | list( 37 | params?: ExchangeRateListParams, 38 | options?: RequestOptions 39 | ): ApiListPromise; 40 | list(options?: RequestOptions): ApiListPromise; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /types/ExternalAccounts.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | type DeletedExternalAccount = DeletedBankAccount | DeletedCard; 6 | 7 | type ExternalAccount = BankAccount | Card; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /types/FileLinks.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | /** 6 | * To share the contents of a `File` object with non-Stripe users, you can 7 | * create a `FileLink`. `FileLink`s contain a URL that you can use to 8 | * retrieve the contents of the file without authentication. 9 | */ 10 | interface FileLink { 11 | /** 12 | * Unique identifier for the object. 13 | */ 14 | id: string; 15 | 16 | /** 17 | * String representing the object's type. Objects of the same type share the same value. 18 | */ 19 | object: 'file_link'; 20 | 21 | /** 22 | * Time at which the object was created. Measured in seconds since the Unix epoch. 23 | */ 24 | created: number; 25 | 26 | /** 27 | * Returns if the link is already expired. 28 | */ 29 | expired: boolean; 30 | 31 | /** 32 | * Time that the link expires. 33 | */ 34 | expires_at: number | null; 35 | 36 | /** 37 | * The file object this link points to. 38 | */ 39 | file: string | Stripe.File; 40 | 41 | /** 42 | * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. 43 | */ 44 | livemode: boolean; 45 | 46 | /** 47 | * 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. 48 | */ 49 | metadata: Stripe.Metadata; 50 | 51 | /** 52 | * The publicly accessible URL to download the file. 53 | */ 54 | url: string | null; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /types/FinancialConnections/AccountOwners.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | namespace FinancialConnections { 6 | /** 7 | * Describes an owner of an account. 8 | */ 9 | interface AccountOwner { 10 | /** 11 | * Unique identifier for the object. 12 | */ 13 | id: string; 14 | 15 | /** 16 | * String representing the object's type. Objects of the same type share the same value. 17 | */ 18 | object: 'financial_connections.account_owner'; 19 | 20 | /** 21 | * The email address of the owner. 22 | */ 23 | email: string | null; 24 | 25 | /** 26 | * The full name of the owner. 27 | */ 28 | name: string; 29 | 30 | /** 31 | * The ownership object that this owner belongs to. 32 | */ 33 | ownership: string; 34 | 35 | /** 36 | * The raw phone number of the owner. 37 | */ 38 | phone: string | null; 39 | 40 | /** 41 | * The raw physical address of the owner. 42 | */ 43 | raw_address: string | null; 44 | 45 | /** 46 | * The timestamp of the refresh that updated this owner. 47 | */ 48 | refreshed_at: number | null; 49 | } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /types/FinancialConnections/AccountOwnerships.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | namespace FinancialConnections { 6 | /** 7 | * Describes a snapshot of the owners of an account at a particular point in time. 8 | */ 9 | interface AccountOwnership { 10 | /** 11 | * Unique identifier for the object. 12 | */ 13 | id: string; 14 | 15 | /** 16 | * String representing the object's type. Objects of the same type share the same value. 17 | */ 18 | object: 'financial_connections.account_ownership'; 19 | 20 | /** 21 | * Time at which the object was created. Measured in seconds since the Unix epoch. 22 | */ 23 | created: number; 24 | 25 | /** 26 | * A paginated list of owners for this account. 27 | */ 28 | owners: ApiList; 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /types/LoginLinks.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | /** 6 | * Login Links are single-use URLs that takes an Express account to the login page for their Stripe dashboard. 7 | * A Login Link differs from an [Account Link](https://stripe.com/docs/api/account_links) in that it takes the user directly to their [Express dashboard for the specified account](https://stripe.com/docs/connect/integrate-express-dashboard#create-login-link) 8 | */ 9 | interface LoginLink { 10 | /** 11 | * String representing the object's type. Objects of the same type share the same value. 12 | */ 13 | object: 'login_link'; 14 | 15 | /** 16 | * Time at which the object was created. Measured in seconds since the Unix epoch. 17 | */ 18 | created: number; 19 | 20 | /** 21 | * The URL for the login link. 22 | */ 23 | url: string; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /types/MandatesResource.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | interface MandateRetrieveParams { 6 | /** 7 | * Specifies which fields in the response should be expanded. 8 | */ 9 | expand?: Array; 10 | } 11 | 12 | class MandatesResource { 13 | /** 14 | * Retrieves a Mandate object. 15 | */ 16 | retrieve( 17 | id: string, 18 | params?: MandateRetrieveParams, 19 | options?: RequestOptions 20 | ): Promise>; 21 | retrieve( 22 | id: string, 23 | options?: RequestOptions 24 | ): Promise>; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /types/Reporting/ReportTypesResource.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | namespace Reporting { 6 | interface ReportTypeRetrieveParams { 7 | /** 8 | * Specifies which fields in the response should be expanded. 9 | */ 10 | expand?: Array; 11 | } 12 | 13 | interface ReportTypeListParams { 14 | /** 15 | * Specifies which fields in the response should be expanded. 16 | */ 17 | expand?: Array; 18 | } 19 | 20 | class ReportTypesResource { 21 | /** 22 | * Retrieves the details of a Report Type. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).) 23 | */ 24 | retrieve( 25 | id: string, 26 | params?: ReportTypeRetrieveParams, 27 | options?: RequestOptions 28 | ): Promise>; 29 | retrieve( 30 | id: string, 31 | options?: RequestOptions 32 | ): Promise>; 33 | 34 | /** 35 | * Returns a full list of Report Types. 36 | */ 37 | list( 38 | params?: ReportTypeListParams, 39 | options?: RequestOptions 40 | ): ApiListPromise; 41 | list( 42 | options?: RequestOptions 43 | ): ApiListPromise; 44 | } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /types/ReserveTransactions.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | /** 6 | * The ReserveTransaction object. 7 | */ 8 | interface ReserveTransaction { 9 | /** 10 | * Unique identifier for the object. 11 | */ 12 | id: string; 13 | 14 | /** 15 | * String representing the object's type. Objects of the same type share the same value. 16 | */ 17 | object: 'reserve_transaction'; 18 | 19 | amount: number; 20 | 21 | /** 22 | * 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). 23 | */ 24 | currency: string; 25 | 26 | /** 27 | * An arbitrary string attached to the object. Often useful for displaying to users. 28 | */ 29 | description: string | null; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /types/SetupAttemptsResource.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | interface SetupAttemptListParams extends PaginationParams { 6 | /** 7 | * Only return SetupAttempts created by the SetupIntent specified by 8 | * this ID. 9 | */ 10 | setup_intent: string; 11 | 12 | /** 13 | * A filter on the list, based on the object `created` field. The value 14 | * can be a string with an integer Unix timestamp or a 15 | * dictionary with a number of different query options. 16 | */ 17 | created?: Stripe.RangeQueryParam | number; 18 | 19 | /** 20 | * Specifies which fields in the response should be expanded. 21 | */ 22 | expand?: Array; 23 | } 24 | 25 | class SetupAttemptsResource { 26 | /** 27 | * Returns a list of SetupAttempts that associate with a provided SetupIntent. 28 | */ 29 | list( 30 | params: SetupAttemptListParams, 31 | options?: RequestOptions 32 | ): ApiListPromise; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /types/Sigma/ScheduledQueryRunsResource.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | namespace Sigma { 6 | interface ScheduledQueryRunRetrieveParams { 7 | /** 8 | * Specifies which fields in the response should be expanded. 9 | */ 10 | expand?: Array; 11 | } 12 | 13 | interface ScheduledQueryRunListParams extends PaginationParams { 14 | /** 15 | * Specifies which fields in the response should be expanded. 16 | */ 17 | expand?: Array; 18 | } 19 | 20 | class ScheduledQueryRunsResource { 21 | /** 22 | * Retrieves the details of an scheduled query run. 23 | */ 24 | retrieve( 25 | id: string, 26 | params?: ScheduledQueryRunRetrieveParams, 27 | options?: RequestOptions 28 | ): Promise>; 29 | retrieve( 30 | id: string, 31 | options?: RequestOptions 32 | ): Promise>; 33 | 34 | /** 35 | * Returns a list of scheduled query runs. 36 | */ 37 | list( 38 | params?: ScheduledQueryRunListParams, 39 | options?: RequestOptions 40 | ): ApiListPromise; 41 | list( 42 | options?: RequestOptions 43 | ): ApiListPromise; 44 | } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /types/TaxCodes.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | /** 6 | * [Tax codes](https://stripe.com/docs/tax/tax-categories) classify goods and services for tax purposes. 7 | */ 8 | interface TaxCode { 9 | /** 10 | * Unique identifier for the object. 11 | */ 12 | id: string; 13 | 14 | /** 15 | * String representing the object's type. Objects of the same type share the same value. 16 | */ 17 | object: 'tax_code'; 18 | 19 | /** 20 | * A detailed description of which types of products the tax code represents. 21 | */ 22 | description: string; 23 | 24 | /** 25 | * A short name for the tax code. 26 | */ 27 | name: string; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /types/TaxCodesResource.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | interface TaxCodeRetrieveParams { 6 | /** 7 | * Specifies which fields in the response should be expanded. 8 | */ 9 | expand?: Array; 10 | } 11 | 12 | interface TaxCodeListParams extends PaginationParams { 13 | /** 14 | * Specifies which fields in the response should be expanded. 15 | */ 16 | expand?: Array; 17 | } 18 | 19 | class TaxCodesResource { 20 | /** 21 | * Retrieves the details of an existing tax code. Supply the unique tax code ID and Stripe will return the corresponding tax code information. 22 | */ 23 | retrieve( 24 | id: string, 25 | params?: TaxCodeRetrieveParams, 26 | options?: RequestOptions 27 | ): Promise>; 28 | retrieve( 29 | id: string, 30 | options?: RequestOptions 31 | ): Promise>; 32 | 33 | /** 34 | * A list of [all tax codes available](https://stripe.com/docs/tax/tax-categories) to add to Products in order to allow specific tax calculations. 35 | */ 36 | list( 37 | params?: TaxCodeListParams, 38 | options?: RequestOptions 39 | ): ApiListPromise; 40 | list(options?: RequestOptions): ApiListPromise; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /types/TaxDeductedAtSources.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | /** 6 | * The TaxDeductedAtSource object. 7 | */ 8 | interface TaxDeductedAtSource { 9 | /** 10 | * Unique identifier for the object. 11 | */ 12 | id: string; 13 | 14 | /** 15 | * String representing the object's type. Objects of the same type share the same value. 16 | */ 17 | object: 'tax_deducted_at_source'; 18 | 19 | /** 20 | * The end of the invoicing period. This TDS applies to Stripe fees collected during this invoicing period. 21 | */ 22 | period_end: number; 23 | 24 | /** 25 | * The start of the invoicing period. This TDS applies to Stripe fees collected during this invoicing period. 26 | */ 27 | period_start: number; 28 | 29 | /** 30 | * The TAN that was supplied to Stripe when TDS was assessed 31 | */ 32 | tax_deduction_account_number: string; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /types/Terminal/ConnectionTokens.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | namespace Terminal { 6 | /** 7 | * A Connection Token is used by the Stripe Terminal SDK to connect to a reader. 8 | * 9 | * Related guide: [Fleet management](https://stripe.com/docs/terminal/fleet/locations) 10 | */ 11 | interface ConnectionToken { 12 | /** 13 | * String representing the object's type. Objects of the same type share the same value. 14 | */ 15 | object: 'terminal.connection_token'; 16 | 17 | /** 18 | * The id of the location that this connection token is scoped to. Note that location scoping only applies to internet-connected readers. For more details, see [the docs on scoping connection tokens](https://docs.stripe.com/terminal/fleet/locations-and-zones?dashboard-or-api=api#connection-tokens). 19 | */ 20 | location?: string; 21 | 22 | /** 23 | * Your application should pass this token to the Stripe Terminal SDK. 24 | */ 25 | secret: string; 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /types/Terminal/ConnectionTokensResource.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | namespace Terminal { 6 | interface ConnectionTokenCreateParams { 7 | /** 8 | * Specifies which fields in the response should be expanded. 9 | */ 10 | expand?: Array; 11 | 12 | /** 13 | * The id of the location that this connection token is scoped to. If specified the connection token will only be usable with readers assigned to that location, otherwise the connection token will be usable with all readers. Note that location scoping only applies to internet-connected readers. For more details, see [the docs on scoping connection tokens](https://docs.stripe.com/terminal/fleet/locations-and-zones?dashboard-or-api=api#connection-tokens). 14 | */ 15 | location?: string; 16 | } 17 | 18 | class ConnectionTokensResource { 19 | /** 20 | * To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived connection token from Stripe, proxied through your server. On your backend, add an endpoint that creates and returns a connection token. 21 | */ 22 | create( 23 | params?: ConnectionTokenCreateParams, 24 | options?: RequestOptions 25 | ): Promise>; 26 | create( 27 | options?: RequestOptions 28 | ): Promise>; 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /types/TestHelpers/CustomersResource.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | namespace TestHelpers { 6 | interface CustomerFundCashBalanceParams { 7 | /** 8 | * Amount to be used for this test cash balance transaction. A positive integer representing how much to fund in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to fund $1.00 or 100 to fund ¥100, a zero-decimal currency). 9 | */ 10 | amount: number; 11 | 12 | /** 13 | * 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). 14 | */ 15 | currency: string; 16 | 17 | /** 18 | * Specifies which fields in the response should be expanded. 19 | */ 20 | expand?: Array; 21 | 22 | /** 23 | * A description of the test funding. This simulates free-text references supplied by customers when making bank transfers to their cash balance. You can use this to test how Stripe's [reconciliation algorithm](https://stripe.com/docs/payments/customer-balance/reconciliation) applies to different user inputs. 24 | */ 25 | reference?: string; 26 | } 27 | 28 | class CustomersResource { 29 | /** 30 | * Create an incoming testmode bank transfer 31 | */ 32 | fundCashBalance( 33 | id: string, 34 | params: CustomerFundCashBalanceParams, 35 | options?: RequestOptions 36 | ): Promise>; 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /types/TestHelpers/RefundsResource.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | namespace TestHelpers { 6 | interface RefundExpireParams { 7 | /** 8 | * Specifies which fields in the response should be expanded. 9 | */ 10 | expand?: Array; 11 | } 12 | 13 | class RefundsResource { 14 | /** 15 | * Expire a refund with a status of requires_action. 16 | */ 17 | expire( 18 | id: string, 19 | params?: RefundExpireParams, 20 | options?: RequestOptions 21 | ): Promise>; 22 | expire( 23 | id: string, 24 | options?: RequestOptions 25 | ): Promise>; 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /types/ThinEvent.d.ts: -------------------------------------------------------------------------------- 1 | // This is a manually maintained file 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | namespace Event { 6 | /** 7 | * Object containing the reference to API resource relevant to the event. 8 | */ 9 | interface RelatedObject { 10 | /** 11 | * Unique identifier for the object relevant to the event. 12 | */ 13 | id: string; 14 | 15 | /** 16 | * Type of the object relevant to the event. 17 | */ 18 | type: string; 19 | 20 | /** 21 | * URL to retrieve the resource. 22 | */ 23 | url: string; 24 | } 25 | } 26 | /** 27 | * The Event object as recieved from StripeClient.parseThinEvent. 28 | */ 29 | interface ThinEvent extends V2.EventBase { 30 | /** 31 | * Object containing the reference to API resource relevant to the event. 32 | */ 33 | related_object: Event.RelatedObject | null; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /types/UpcomingInvoices.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'stripe' { 2 | namespace Stripe { 3 | type UpcomingInvoice = Omit; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /types/V2/Billing/MeterEventAdjustmentsResource.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | namespace V2 { 6 | namespace Billing { 7 | interface MeterEventAdjustmentCreateParams { 8 | /** 9 | * Specifies which event to cancel. 10 | */ 11 | cancel: MeterEventAdjustmentCreateParams.Cancel; 12 | 13 | /** 14 | * The name of the meter event. Corresponds with the `event_name` field on a meter. 15 | */ 16 | event_name: string; 17 | 18 | /** 19 | * Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet. 20 | */ 21 | type: 'cancel'; 22 | } 23 | 24 | namespace MeterEventAdjustmentCreateParams { 25 | interface Cancel { 26 | /** 27 | * Unique identifier for the event. You can only cancel events within 24 hours of Stripe receiving them. 28 | */ 29 | identifier: string; 30 | } 31 | } 32 | } 33 | 34 | namespace Billing { 35 | class MeterEventAdjustmentsResource { 36 | /** 37 | * Creates a meter event adjustment to cancel a previously sent meter event. 38 | */ 39 | create( 40 | params: MeterEventAdjustmentCreateParams, 41 | options?: RequestOptions 42 | ): Promise>; 43 | } 44 | } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /types/V2/Billing/MeterEventSessionResource.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | namespace V2 { 6 | namespace Billing { 7 | interface MeterEventSessionCreateParams {} 8 | } 9 | 10 | namespace Billing { 11 | class MeterEventSessionResource { 12 | /** 13 | * Creates a meter event session to send usage on the high-throughput meter event stream. Authentication tokens are only valid for 15 minutes, so you will need to create a new meter event session when your token expires. 14 | */ 15 | create( 16 | params?: MeterEventSessionCreateParams, 17 | options?: RequestOptions 18 | ): Promise>; 19 | create( 20 | options?: RequestOptions 21 | ): Promise>; 22 | } 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /types/V2/Billing/MeterEventSessions.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | declare module 'stripe' { 4 | namespace Stripe { 5 | namespace V2 { 6 | namespace Billing { 7 | /** 8 | * The MeterEventSession object. 9 | */ 10 | interface MeterEventSession { 11 | /** 12 | * The unique id of this auth session. 13 | */ 14 | id: string; 15 | 16 | /** 17 | * String representing the object's type. Objects of the same type share the same value of the object field. 18 | */ 19 | object: 'v2.billing.meter_event_session'; 20 | 21 | /** 22 | * The authentication token for this session. Use this token when calling the 23 | * high-throughput meter event API. 24 | */ 25 | authentication_token: string; 26 | 27 | /** 28 | * The creation time of this session. 29 | */ 30 | created: string; 31 | 32 | /** 33 | * The time at which this session will expire. 34 | */ 35 | expires_at: string; 36 | 37 | /** 38 | * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. 39 | */ 40 | livemode: boolean; 41 | } 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /types/V2/Core/EventsResource.d.ts: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | 3 | /// 4 | 5 | declare module 'stripe' { 6 | namespace Stripe { 7 | namespace V2 { 8 | namespace Core { 9 | interface EventRetrieveParams {} 10 | } 11 | 12 | namespace Core { 13 | interface EventListParams { 14 | /** 15 | * Primary object ID used to retrieve related events. 16 | */ 17 | object_id: string; 18 | 19 | /** 20 | * The page size. 21 | */ 22 | limit?: number; 23 | } 24 | } 25 | 26 | namespace Core { 27 | class EventsResource { 28 | /** 29 | * Retrieves the details of an event. 30 | */ 31 | retrieve( 32 | id: string, 33 | params?: EventRetrieveParams, 34 | options?: RequestOptions 35 | ): Promise>; 36 | retrieve( 37 | id: string, 38 | options?: RequestOptions 39 | ): Promise>; 40 | 41 | /** 42 | * List events, going back up to 30 days. 43 | */ 44 | list( 45 | params: EventListParams, 46 | options?: RequestOptions 47 | ): ApiListPromise; 48 | } 49 | } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /types/test/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: '../.eslintrc.js', 3 | rules: { 4 | '@typescript-eslint/ban-ts-comment': 0, 5 | }, 6 | }; 7 | --------------------------------------------------------------------------------