feat(boc): Complete Business Operations Center v1.0

- Go backend API with full CRUD for all modules (CRM, Sales, Finance, HR, Legal, Marketing, Support, Purchase, Inventory, Projects, Automation, Analytics)
- Rust analytics service with parallel report generation
- C runtime with POSIX shared memory IPC
- PostgreSQL schema with 30+ tables, full migrations
- Redis cache, sessions, pub/sub
- Kafka event streaming with Zookeeper
- WebSocket hub for real-time updates
- Automation engine with cron jobs, workflows, event triggers
- JWT authentication, multi-tenant from start
- Docker Compose with all services
- Nginx reverse proxy with rate limiting
- Integration tests passing
- Feature gap analysis against Fortnox/Odoo/Visma

Refs: BOC-001
This commit is contained in:
Bernt
2026-07-12 12:41:35 +00:00
parent 4789a7fb48
commit 58ca4e68db
26666 changed files with 575891 additions and 2074516 deletions
+2845
View File
@@ -0,0 +1,2845 @@
# Changelog
## 12.18.0 - 2023-08-10
* [#1867](https://github.com/stripe/stripe-node/pull/1867) Update generated code
* Add support for new values `incorporated_partnership` and `unincorporated_partnership` on enums `Account.company.structure`, `AccountCreateParams.company.structure`, `AccountUpdateParams.company.structure`, and `TokenCreateParams.account.company.structure`
* Add support for new value `payment_reversal` on enum `BalanceTransaction.type`
* Change `Invoice.subscription_details.metadata` and `Invoice.subscription_details` to be required
## 12.17.0 - 2023-08-03
* [#1863](https://github.com/stripe/stripe-node/pull/1863) Update generated code
* Change many types from `string` to `emptyStringable(string)`
* Add support for `subscription_details` on `Invoice`
* Add support for `preferred_settlement_speed` on `PaymentIntent.payment_method_options.us_bank_account`, `PaymentIntentConfirmParams.payment_method_options.us_bank_account`, `PaymentIntentCreateParams.payment_method_options.us_bank_account`, and `PaymentIntentUpdateParams.payment_method_options.us_bank_account`
* Add support for new values `sepa_debit_fingerprint` and `us_bank_account_fingerprint` on enums `Radar.ValueList.item_type` and `Radar.ValueListCreateParams.item_type`
* [#1866](https://github.com/stripe/stripe-node/pull/1866) Allow monkey patching http / https
## 12.16.0 - 2023-07-27
* [#1853](https://github.com/stripe/stripe-node/pull/1853) Update generated code
* Add support for `monthly_estimated_revenue` on `Account.business_profile`, `AccountCreateParams.business_profile`, and `AccountUpdateParams.business_profile`
* [#1859](https://github.com/stripe/stripe-node/pull/1859) Revert "import * as http -> import http from 'http'"
## 12.15.0 - 2023-07-27 (DEPRECATED ⚠️ )
* This version included a breaking change [#1859](https://github.com/stripe/stripe-node/pull/1859) that we should not have released. It has been deprecated on npmjs.org. Please do not use this version.
## 12.14.0 - 2023-07-20
* [#1842](https://github.com/stripe/stripe-node/pull/1842) Update generated code
* Add support for new value `ro_tin` on enums `Checkout.Session.customer_details.tax_ids[].type`, `Invoice.customer_tax_ids[].type`, `Tax.Calculation.customer_details.tax_ids[].type`, and `Tax.Transaction.customer_details.tax_ids[].type`
* Remove support for values `excluded_territory`, `jurisdiction_unsupported`, and `vat_exempt` from enums `Checkout.Session.shipping_cost.taxes[].taxability_reason`, `Checkout.Session.total_details.breakdown.taxes[].taxability_reason`, `CreditNote.shipping_cost.taxes[].taxability_reason`, `Invoice.shipping_cost.taxes[].taxability_reason`, `LineItem.taxes[].taxability_reason`, `Quote.computed.recurring.total_details.breakdown.taxes[].taxability_reason`, `Quote.computed.upfront.total_details.breakdown.taxes[].taxability_reason`, and `Quote.total_details.breakdown.taxes[].taxability_reason`
* Add support for new value `ro_tin` on enums `CustomerCreateParams.tax_id_data[].type`, `InvoiceUpcomingLinesParams.customer_details.tax_ids[].type`, `InvoiceUpcomingParams.customer_details.tax_ids[].type`, and `Tax.CalculationCreateParams.customer_details.tax_ids[].type`
* Add support for `use_stripe_sdk` on `SetupIntentConfirmParams` and `SetupIntentCreateParams`
* Add support for new value `service_tax` on enums `TaxRate.tax_type`, `TaxRateCreateParams.tax_type`, and `TaxRateUpdateParams.tax_type`
* [#1849](https://github.com/stripe/stripe-node/pull/1849) Changelog: fix delimiterless namespaced param types
* [#1848](https://github.com/stripe/stripe-node/pull/1848) Changelog: `CheckoutSessionCreateParams` -> `Checkout.SessionCreateParams`
## 12.13.0 - 2023-07-13
* [#1838](https://github.com/stripe/stripe-node/pull/1838) Update generated code
* Add support for new resource `Tax.Settings`
* Add support for `retrieve` and `update` methods on resource `Settings`
* Add support for new value `invalid_tax_location` on enums `Invoice.last_finalization_error.code`, `PaymentIntent.last_payment_error.code`, `SetupAttempt.setup_error.code`, `SetupIntent.last_setup_error.code`, and `StripeError.code`
* Add support for `order_id` on `Charge.payment_method_details.afterpay_clearpay`
* Add support for `allow_redirects` on `PaymentIntent.automatic_payment_methods`, `PaymentIntentCreateParams.automatic_payment_methods`, `SetupIntent.automatic_payment_methods`, and `SetupIntentCreateParams.automatic_payment_methods`
* Add support for new values `amusement_tax` and `communications_tax` on enums `Tax.Calculation.shipping_cost.tax_breakdown[].tax_rate_details.tax_type`, `Tax.Calculation.tax_breakdown[].tax_rate_details.tax_type`, `Tax.CalculationLineItem.tax_breakdown[].tax_rate_details.tax_type`, and `Tax.Transaction.shipping_cost.tax_breakdown[].tax_rate_details.tax_type`
* Add support for `product` on `Tax.TransactionLineItem`
* Add support for new value `tax.settings.updated` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]`
## 12.12.0 - 2023-07-06
* [#1831](https://github.com/stripe/stripe-node/pull/1831) Update generated code
* Add support for `numeric` and `text` on `PaymentLink.custom_fields[]`
* Add support for `automatic_tax` on `SubscriptionListParams`
## 12.11.0 - 2023-06-29
* [#1823](https://github.com/stripe/stripe-node/pull/1823) Update generated code
* Add support for new value `application_fees_not_allowed` on enums `Invoice.last_finalization_error.code`, `PaymentIntent.last_payment_error.code`, `SetupAttempt.setup_error.code`, `SetupIntent.last_setup_error.code`, and `StripeError.code`
* Add support for new tax IDs `ad_nrt`, `ar_cuit`, `bo_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `pe_ruc`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, and `vn_tin`
* Add support for `effective_at` on `CreditNoteCreateParams`, `CreditNotePreviewLinesParams`, `CreditNotePreviewParams`, `CreditNote`, `InvoiceCreateParams`, `InvoiceUpdateParams`, and `Invoice`
* [#1828](https://github.com/stripe/stripe-node/pull/1828) Better CryptoProvider error
## 12.10.0 - 2023-06-22
* [#1820](https://github.com/stripe/stripe-node/pull/1820) Update generated code
* Add support for `on_behalf_of` on `Mandate`
* [#1817](https://github.com/stripe/stripe-node/pull/1817) Update README.md
* [#1819](https://github.com/stripe/stripe-node/pull/1819) Update generated code
* Release specs are identical.
* [#1813](https://github.com/stripe/stripe-node/pull/1813) Update generated code
* Change type of `Checkout.Session.success_url` from `string` to `string | null`
* Change type of `FileCreateParams.file` from `string` to `file`
* [#1815](https://github.com/stripe/stripe-node/pull/1815) Generate FileCreateParams
## 12.9.0 - 2023-06-08
* [#1809](https://github.com/stripe/stripe-node/pull/1809) Update generated code
* Change `Charge.payment_method_details.cashapp.buyer_id`, `Charge.payment_method_details.cashapp.cashtag`, `PaymentMethod.cashapp.buyer_id`, and `PaymentMethod.cashapp.cashtag` to be required
* Add support for `taxability_reason` on `Tax.Calculation.tax_breakdown[]`
* [#1812](https://github.com/stripe/stripe-node/pull/1812) More helpful error when signing secrets contain whitespace
## 12.8.0 - 2023-06-01
* [#1799](https://github.com/stripe/stripe-node/pull/1799) Update generated code
* Add support for `numeric` and `text` on `Checkout.SessionCreateParams.custom_fields[]`, `PaymentLinkCreateParams.custom_fields[]`, and `PaymentLinkUpdateParams.custom_fields[]`
* Add support for new values `aba` and `swift` on enums `Checkout.Session.payment_method_options.customer_balance.bank_transfer.requested_address_types[]`, `Checkout.SessionCreateParams.payment_method_options.customer_balance.bank_transfer.requested_address_types[]`, `PaymentIntent.payment_method_options.customer_balance.bank_transfer.requested_address_types[]`, `PaymentIntentConfirmParams.payment_method_options.customer_balance.bank_transfer.requested_address_types[]`, `PaymentIntentCreateParams.payment_method_options.customer_balance.bank_transfer.requested_address_types[]`, and `PaymentIntentUpdateParams.payment_method_options.customer_balance.bank_transfer.requested_address_types[]`
* Add support for new value `us_bank_transfer` on enums `Checkout.Session.payment_method_options.customer_balance.bank_transfer.type`, `Checkout.SessionCreateParams.payment_method_options.customer_balance.bank_transfer.type`, `CustomerCreateFundingInstructionsParams.bank_transfer.type`, `PaymentIntent.next_action.display_bank_transfer_instructions.type`, `PaymentIntent.payment_method_options.customer_balance.bank_transfer.type`, `PaymentIntentConfirmParams.payment_method_options.customer_balance.bank_transfer.type`, `PaymentIntentCreateParams.payment_method_options.customer_balance.bank_transfer.type`, and `PaymentIntentUpdateParams.payment_method_options.customer_balance.bank_transfer.type`
* Add support for `maximum_length` and `minimum_length` on `Checkout.Session.custom_fields[].numeric` and `Checkout.Session.custom_fields[].text`
* Add support for `preferred_locales` on `Issuing.Cardholder`, `Issuing.CardholderCreateParams`, and `Issuing.CardholderUpdateParams`
* Add support for `description`, `iin`, and `issuer` on `PaymentMethod.card_present` and `PaymentMethod.interac_present`
* Add support for `payer_email` on `PaymentMethod.paypal`
## 12.7.0 - 2023-05-25
* [#1797](https://github.com/stripe/stripe-node/pull/1797) Update generated code
* Add support for `zip_payments` on `Account.capabilities`, `AccountCreateParams.capabilities`, and `AccountUpdateParams.capabilities`
* Change type of `Invoice.last_finalization_error.code`, `PaymentIntent.last_payment_error.code`, `SetupAttempt.setup_error.code`, `SetupIntent.last_setup_error.code`, and `StripeError.code` from `string` to `enum`
* Add support for `zip` on `Charge.payment_method_details`, `PaymentIntent.payment_method_options`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentConfirmParams.payment_method_options`, `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentMethodCreateParams`, `PaymentMethodUpdateParams`, `PaymentMethod`, `SetupIntentConfirmParams.payment_method_data`, `SetupIntentCreateParams.payment_method_data`, and `SetupIntentUpdateParams.payment_method_data`
* Add support for new value `zip` on enums `Checkout.SessionCreateParams.payment_method_types[]` and `PaymentMethodCreateParams.type`
* Add support for new value `zip` on enums `CustomerListPaymentMethodsParams.type` and `PaymentMethodListParams.type`
* Add support for new value `zip` on enums `PaymentIntentConfirmParams.payment_method_data.type`, `PaymentIntentCreateParams.payment_method_data.type`, `PaymentIntentUpdateParams.payment_method_data.type`, `SetupIntentConfirmParams.payment_method_data.type`, `SetupIntentCreateParams.payment_method_data.type`, and `SetupIntentUpdateParams.payment_method_data.type`
* Add support for new value `zip` on enum `PaymentMethod.type`
## 12.6.0 - 2023-05-19
* [#1787](https://github.com/stripe/stripe-node/pull/1787) Update generated code
* Add support for `subscription_update_confirm` and `subscription_update` on `BillingPortal.Session.flow` and `BillingPortal.SessionCreateParams.flow_data`
* Add support for new values `subscription_update_confirm` and `subscription_update` on enums `BillingPortal.Session.flow.type` and `BillingPortal.SessionCreateParams.flow_data.type`
* Add support for `link` on `Charge.payment_method_details.card.wallet` and `PaymentMethod.card.wallet`
* Add support for `buyer_id` and `cashtag` on `Charge.payment_method_details.cashapp` and `PaymentMethod.cashapp`
* Add support for new values `amusement_tax` and `communications_tax` on enums `TaxRate.tax_type`, `TaxRateCreateParams.tax_type`, and `TaxRateUpdateParams.tax_type`
## 12.5.0 - 2023-05-11
* [#1785](https://github.com/stripe/stripe-node/pull/1785) Update generated code
* Add support for `paypal` on `Charge.payment_method_details`, `Checkout.SessionCreateParams.payment_method_options`, `Mandate.payment_method_details`, `PaymentIntent.payment_method_options`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentConfirmParams.payment_method_options`, `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentMethodCreateParams`, `PaymentMethod`, `SetupAttempt.payment_method_details`, `SetupIntent.payment_method_options`, `SetupIntentConfirmParams.payment_method_data`, `SetupIntentConfirmParams.payment_method_options`, `SetupIntentCreateParams.payment_method_data`, `SetupIntentCreateParams.payment_method_options`, `SetupIntentUpdateParams.payment_method_data`, and `SetupIntentUpdateParams.payment_method_options`
* Add support for `network_token` on `Charge.payment_method_details.card`
* Add support for new value `paypal` on enums `Checkout.SessionCreateParams.payment_method_types[]` and `PaymentMethodCreateParams.type`
* Add support for `taxability_reason` and `taxable_amount` on `Checkout.Session.shipping_cost.taxes[]`, `Checkout.Session.total_details.breakdown.taxes[]`, `CreditNote.shipping_cost.taxes[]`, `CreditNote.tax_amounts[]`, `Invoice.shipping_cost.taxes[]`, `Invoice.total_tax_amounts[]`, `LineItem.taxes[]`, `Quote.computed.recurring.total_details.breakdown.taxes[]`, `Quote.computed.upfront.total_details.breakdown.taxes[]`, and `Quote.total_details.breakdown.taxes[]`
* Add support for new value `paypal` on enums `CustomerListPaymentMethodsParams.type` and `PaymentMethodListParams.type`
* Add support for new value `paypal` on enums `Invoice.payment_settings.payment_method_types[]`, `InvoiceCreateParams.payment_settings.payment_method_types[]`, `InvoiceUpdateParams.payment_settings.payment_method_types[]`, `Subscription.payment_settings.payment_method_types[]`, `SubscriptionCreateParams.payment_settings.payment_method_types[]`, and `SubscriptionUpdateParams.payment_settings.payment_method_types[]`
* Add support for new value `paypal` on enums `PaymentIntentConfirmParams.payment_method_data.type`, `PaymentIntentCreateParams.payment_method_data.type`, `PaymentIntentUpdateParams.payment_method_data.type`, `SetupIntentConfirmParams.payment_method_data.type`, `SetupIntentCreateParams.payment_method_data.type`, and `SetupIntentUpdateParams.payment_method_data.type`
* Add support for new value `eftpos_au` on enums `PaymentIntent.payment_method_options.card.network`, `PaymentIntentConfirmParams.payment_method_options.card.network`, `PaymentIntentCreateParams.payment_method_options.card.network`, `PaymentIntentUpdateParams.payment_method_options.card.network`, `SetupIntent.payment_method_options.card.network`, `SetupIntentConfirmParams.payment_method_options.card.network`, `SetupIntentCreateParams.payment_method_options.card.network`, `SetupIntentUpdateParams.payment_method_options.card.network`, `Subscription.payment_settings.payment_method_options.card.network`, `SubscriptionCreateParams.payment_settings.payment_method_options.card.network`, and `SubscriptionUpdateParams.payment_settings.payment_method_options.card.network`
* Add support for new value `paypal` on enums `PaymentLink.payment_method_types[]`, `PaymentLinkCreateParams.payment_method_types[]`, and `PaymentLinkUpdateParams.payment_method_types[]`
* Add support for `brand`, `cardholder_name`, `country`, `exp_month`, `exp_year`, `fingerprint`, `funding`, `last4`, `networks`, and `read_method` on `PaymentMethod.card_present` and `PaymentMethod.interac_present`
* Add support for `preferred_locales` on `PaymentMethod.interac_present`
* Add support for new value `paypal` on enum `PaymentMethod.type`
* Add support for `effective_percentage` on `TaxRate`
* Add support for `gb_bank_transfer` and `jp_bank_transfer` on `CustomerCashBalanceTransaction.Funded.BankTransfer`
## 12.4.0 - 2023-05-04
* [#1774](https://github.com/stripe/stripe-node/pull/1774) Update generated code
* Add support for `link` on `Checkout.Session.payment_method_options` and `Checkout.SessionCreateParams.payment_method_options`
* Add support for `brand`, `country`, `description`, `exp_month`, `exp_year`, `fingerprint`, `funding`, `iin`, `issuer`, `last4`, `network`, and `wallet` on `SetupAttempt.payment_method_details.card`
* [#1782](https://github.com/stripe/stripe-node/pull/1782) Let user supply a timestamp when verifying webhooks
## 12.3.0 - 2023-04-27
* [#1770](https://github.com/stripe/stripe-node/pull/1770) Update generated code
* Add support for `billing_cycle_anchor` and `proration_behavior` on `Checkout.SessionCreateParams.subscription_data`
* Add support for `terminal_id` on `Issuing.Authorization.merchant_data` and `Issuing.Transaction.merchant_data`
* Add support for `metadata` on `PaymentIntentCaptureParams`
* Add support for `checks` on `SetupAttempt.payment_method_details.card`
* Add support for `tax_breakdown` on `Tax.Calculation.shipping_cost` and `Tax.Transaction.shipping_cost`
## 12.2.0 - 2023-04-20
* [#1759](https://github.com/stripe/stripe-node/pull/1759) Update generated code
* Change `Checkout.Session.currency_conversion` to be required
* Change `Identity.VerificationReport.options` and `Identity.VerificationReport.type` to be optional
* Change type of `Identity.VerificationSession.options` from `VerificationSessionOptions` to `VerificationSessionOptions | null`
* Change type of `Identity.VerificationSession.type` from `enum('document'|'id_number')` to `enum('document'|'id_number') | null`
* [#1762](https://github.com/stripe/stripe-node/pull/1762) Add Deno webhook signing example
* [#1761](https://github.com/stripe/stripe-node/pull/1761) Add Deno usage instructions in README
## 12.1.1 - 2023-04-13
No product changes.
## 12.1.0 - 2023-04-13
* [#1754](https://github.com/stripe/stripe-node/pull/1754) Update generated code
* Add support for new value `REVOIE23` on enums `Charge.payment_method_details.ideal.bic`, `PaymentMethod.ideal.bic`, and `SetupAttempt.payment_method_details.ideal.bic`
* [#1749](https://github.com/stripe/stripe-node/pull/1749) Type extend and ResourceNamespace better
## 12.0.0 - 2023-04-06
* [#1743](https://github.com/stripe/stripe-node/pull/1743) Remove `Stripe.default` and `Stripe.Stripe`
This was added to maintain backwards compatibility during the transition of stripe-node to a dual ES module / CommonJS package, and should not be functionally necessary.
* [#1742](https://github.com/stripe/stripe-node/pull/1743) Pin latest API version as the default
**⚠️ ACTION REQUIRED: the breaking change in this release likely affects you ⚠️**
In this release, Stripe API Version `2022-11-15` (the latest at time of release) will be sent by default on all requests.
The previous default was to use your [Stripe account's default API version](https://stripe.com/docs/development/dashboard/request-logs#view-your-default-api-version).
To successfully upgrade to stripe-node v12, you must either
1. **(Recommended) Upgrade your integration to be compatible with API Version `2022-11-15`.**
Please read the API Changelog carefully for each API Version from `2022-11-15` back to your [Stripe account's default API version](https://stripe.com/docs/development/dashboard/request-logs#view-your-default-api-version). Determine if you are using any of the APIs that have changed in a breaking way, and adjust your integration accordingly. Carefully test your changes with Stripe [Test Mode](https://stripe.com/docs/keys#test-live-modes) before deploying them to production.
You can read the [v12 migration guide](https://github.com/stripe/stripe-node/wiki/Migration-guide-for-v12) for more detailed instructions.
2. **(Alternative option) Specify a version other than `2022-11-15` when initializing `stripe-node`.**
If you were previously initializing stripe-node without an explicit API Version, you can postpone modifying your integration by specifying a version equal to your [Stripe account's default API version](https://stripe.com/docs/development/dashboard/request-logs#view-your-default-api-version). For example:
```diff
- const stripe = require('stripe')('sk_test_...');
+ const stripe = require('stripe')('sk_test_...', {
+ apiVersion: 'YYYY-MM-DD' // Determine your default version from https://dashboard.stripe.com/developers
+ })
```
If you were already initializing stripe-node with an explicit API Version, upgrading to v12 will not affect your integration.
Read the [v12 migration guide](https://github.com/stripe/stripe-node/wiki/Migration-guide-for-v12) for more details.
Going forward, each major release of this library will be *pinned* by default to the latest Stripe API Version at the time of release.
That is, instead of upgrading stripe-node and separately upgrading your Stripe API Version through the Stripe Dashboard. whenever you upgrade major versions of stripe-node, you should also upgrade your integration to be compatible with the latest Stripe API version.
## 11.18.0 - 2023-04-06
* [#1738](https://github.com/stripe/stripe-node/pull/1738) Update generated code
* Add support for new value `link` on enums `Charge.payment_method_details.card.wallet.type` and `PaymentMethod.card.wallet.type`
* Change `Issuing.CardholderCreateParams.type` to be optional
* Add support for `country` on `PaymentMethod.link`
* Add support for `status_details` on `PaymentMethod.us_bank_account`
* [#1747](https://github.com/stripe/stripe-node/pull/1747) (Typescript) remove deprecated properties
## 11.17.0 - 2023-03-30
* [#1734](https://github.com/stripe/stripe-node/pull/1734) Update generated code
* Remove support for `create` method on resource `Tax.Transaction`
* This is not a breaking change, as this method was deprecated before the Tax Transactions API was released in favor of the `createFromCalculation` method.
* Add support for `export_license_id` and `export_purpose_code` on `Account.company`, `AccountCreateParams.company`, `AccountUpdateParams.company`, and `TokenCreateParams.account.company`
* Remove support for value `deleted` from enum `Invoice.status`
* This is not a breaking change, as `deleted` was never returned or accepted as input.
* Add support for `amount_tip` on `Terminal.ReaderPresentPaymentMethodParams.testHelpers`
## 11.16.0 - 2023-03-23
* [#1730](https://github.com/stripe/stripe-node/pull/1730) Update generated code
* Add support for new resources `Tax.CalculationLineItem`, `Tax.Calculation`, `Tax.TransactionLineItem`, and `Tax.Transaction`
* Add support for `create` and `list_line_items` methods on resource `Calculation`
* Add support for `create_from_calculation`, `create_reversal`, `create`, `list_line_items`, and `retrieve` methods on resource `Transaction`
* Add support for new value `link` on enum `Checkout.SessionCreateParams.payment_method_types[]`
* Add support for `currency_conversion` on `Checkout.Session`
* Add support for new value `link` on enums `PaymentLink.payment_method_types[]`, `PaymentLinkCreateParams.payment_method_types[]`, and `PaymentLinkUpdateParams.payment_method_types[]`
* Add support for `automatic_payment_methods` on `SetupIntentCreateParams` and `SetupIntent`
* [#1726](https://github.com/stripe/stripe-node/pull/1726) Add Deno entry point
## 11.15.0 - 2023-03-16
* [#1714](https://github.com/stripe/stripe-node/pull/1714) API Updates
* Add support for `cashapp_payments` on `Account.capabilities`, `AccountCreateParams.capabilities`, and `AccountUpdateParams.capabilities`
* Add support for new value `cashapp` as a new `type` throughout the API.
* Add support for `future_requirements` and `requirements` on `BankAccount`
* Add support for `country` on `Charge.payment_method_details.link`
* Add support for new value `automatic_async` on enums `Checkout.SessionCreateParams.payment_intent_data.capture_method`, `PaymentIntent.capture_method`, `PaymentIntentConfirmParams.capture_method`, `PaymentIntentCreateParams.capture_method`, `PaymentIntentUpdateParams.capture_method`, `PaymentLink.payment_intent_data.capture_method`, and `PaymentLinkCreateParams.payment_intent_data.capture_method`
* Add support for `preferred_locale` on `PaymentIntent.payment_method_options.affirm`,
* Add support for `cashapp_handle_redirect_or_display_qr_code` on `PaymentIntent.next_action` and `SetupIntent.next_action`
* Add support for new value `payout.reconciliation_completed` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]`
* [#1709](https://github.com/stripe/stripe-node/pull/1709) Add ES module package entry point
* Add support for ES modules by defining a separate ESM entry point. This updates stripe-node to be a [dual CommonJS / ES module package](https://nodejs.org/api/packages.html#dual-commonjses-module-packages).
* [#1704](https://github.com/stripe/stripe-node/pull/1704) Configure 2 TypeScript compile targets for ESM and CJS
* [#1710](https://github.com/stripe/stripe-node/pull/1710) Update generated code (new)
* Add support for `cashapp_payments` on `Account.capabilities`, `AccountCreateParams.capabilities`, and `AccountUpdateParams.capabilities`
* Add support for `cashapp` on `Charge.payment_method_details`, `Checkout.Session.payment_method_options`, `Checkout.SessionCreateParams.payment_method_options`, `Mandate.payment_method_details`, `PaymentIntent.payment_method_options`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentConfirmParams.payment_method_options`, `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentMethodCreateParams`, `PaymentMethodUpdateParams`, `PaymentMethod`, `SetupAttempt.payment_method_details`, `SetupIntentConfirmParams.payment_method_data`, `SetupIntentCreateParams.payment_method_data`, and `SetupIntentUpdateParams.payment_method_data`
* Add support for new value `cashapp` on enum `Checkout.SessionCreateParams.payment_method_types[]`
* Add support for new value `cashapp` on enums `CustomerListPaymentMethodsParams.type` and `PaymentMethodListParams.type`
* Add support for new value `cashapp` on enums `Invoice.payment_settings.payment_method_types[]`, `InvoiceCreateParams.payment_settings.payment_method_types[]`, `InvoiceUpdateParams.payment_settings.payment_method_types[]`, `Subscription.payment_settings.payment_method_types[]`, `SubscriptionCreateParams.payment_settings.payment_method_types[]`, and `SubscriptionUpdateParams.payment_settings.payment_method_types[]`
* Add support for new value `cashapp` on enums `PaymentIntentConfirmParams.payment_method_data.type`, `PaymentIntentCreateParams.payment_method_data.type`, `PaymentIntentUpdateParams.payment_method_data.type`, `SetupIntentConfirmParams.payment_method_data.type`, `SetupIntentCreateParams.payment_method_data.type`, and `SetupIntentUpdateParams.payment_method_data.type`
* Add support for `preferred_locale` on `PaymentIntent.payment_method_options.affirm`, `PaymentIntentConfirmParams.payment_method_options.affirm`, `PaymentIntentCreateParams.payment_method_options.affirm`, and `PaymentIntentUpdateParams.payment_method_options.affirm`
* Add support for `cashapp_handle_redirect_or_display_qr_code` on `PaymentIntent.next_action` and `SetupIntent.next_action`
* Add support for new value `cashapp` on enums `PaymentLink.payment_method_types[]`, `PaymentLinkCreateParams.payment_method_types[]`, and `PaymentLinkUpdateParams.payment_method_types[]`
* Add support for new value `cashapp` on enum `PaymentMethodCreateParams.type`
* Add support for new value `cashapp` on enum `PaymentMethod.type`
* Add support for new value `payout.reconciliation_completed` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]`
## 11.14.0 - 2023-03-09
* [#1703](https://github.com/stripe/stripe-node/pull/1703) API Updates
* Add support for `card_issuing` on `Issuing.CardholderCreateParams.individual` and `Issuing.CardholderUpdateParams.individual`
* Add support for new value `requirements.past_due` on enum `Issuing.Cardholder.requirements.disabled_reason`
* Add support for new values `individual.card_issuing.user_terms_acceptance.date` and `individual.card_issuing.user_terms_acceptance.ip` on enum `Issuing.Cardholder.requirements.past_due[]`
* Add support for `cancellation_details` on `SubscriptionCancelParams`, `SubscriptionUpdateParams`, and `Subscription`
* [#1701](https://github.com/stripe/stripe-node/pull/1701) Change httpProxy to httpAgent in README example
* [#1695](https://github.com/stripe/stripe-node/pull/1695) Migrate generated files to ES module syntax
* [#1699](https://github.com/stripe/stripe-node/pull/1699) Remove extra test directory
## 11.13.0 - 2023-03-02
* [#1696](https://github.com/stripe/stripe-node/pull/1696) API Updates
* Add support for new values `electric_vehicle_charging`, `emergency_services_gcas_visa_use_only`, `government_licensed_horse_dog_racing_us_region_only`, `government_licensed_online_casions_online_gambling_us_region_only`, `government_owned_lotteries_non_us_region`, `government_owned_lotteries_us_region_only`, and `marketplaces` on spending control categories.
* Add support for `reconciliation_status` on `Payout`
* Add support for new value `lease_tax` on enums `TaxRate.tax_type`, `TaxRateCreateParams.tax_type`, and `TaxRateUpdateParams.tax_type`
* [#1689](https://github.com/stripe/stripe-node/pull/1689) Update v11.8.0 changelog with breaking change disclaimer
## 11.12.0 - 2023-02-23
* [#1688](https://github.com/stripe/stripe-node/pull/1688) API Updates
* Add support for new value `yoursafe` on enums `Charge.payment_method_details.ideal.bank`, `PaymentIntentConfirmParams.payment_method_data.ideal.bank`, `PaymentIntentCreateParams.payment_method_data.ideal.bank`, `PaymentIntentUpdateParams.payment_method_data.ideal.bank`, `PaymentMethod.ideal.bank`, `PaymentMethodCreateParams.ideal.bank`, `SetupAttempt.payment_method_details.ideal.bank`, `SetupIntentConfirmParams.payment_method_data.ideal.bank`, `SetupIntentCreateParams.payment_method_data.ideal.bank`, and `SetupIntentUpdateParams.payment_method_data.ideal.bank`
* Add support for new value `BITSNL2A` on enums `Charge.payment_method_details.ideal.bic`, `PaymentMethod.ideal.bic`, and `SetupAttempt.payment_method_details.ideal.bic`
* Add support for new value `igst` on enums `TaxRate.tax_type`, `TaxRateCreateParams.tax_type`, and `TaxRateUpdateParams.tax_type`
* [#1687](https://github.com/stripe/stripe-node/pull/1687) Convert TypeScript files to use ES modules
## 11.11.0 - 2023-02-16
* [#1681](https://github.com/stripe/stripe-node/pull/1681) API Updates
* Add support for `refund_payment` method on resource `Terminal.Reader`
* Add support for new value `name` on enums `BillingPortal.Configuration.features.customer_update.allowed_updates[]`, `BillingPortal.ConfigurationCreateParams.features.customer_update.allowed_updates[]`, and `BillingPortal.ConfigurationUpdateParams.features.customer_update.allowed_updates[]`
* Add support for `custom_fields` on `Checkout.Session`, `Checkout.SessionCreateParams`, `PaymentLinkCreateParams`, `PaymentLinkUpdateParams`, and `PaymentLink`
* Change `Subscription.trial_settings.end_behavior` and `Subscription.trial_settings` to be required
* Add support for `interac_present` on `Terminal.ReaderPresentPaymentMethodParams.testHelpers`
* Change type of `Terminal.ReaderPresentPaymentMethodParams.testHelpers.type` from `literal('card_present')` to `enum('card_present'|'interac_present')`
* Add support for `refund_payment` on `Terminal.Reader.action`
* Add support for new value `refund_payment` on enum `Terminal.Reader.action.type`
* [#1683](https://github.com/stripe/stripe-node/pull/1683) Add NextJS webhook sample
* [#1685](https://github.com/stripe/stripe-node/pull/1685) Add more webhook parsing checks
* [#1684](https://github.com/stripe/stripe-node/pull/1684) Add infrastructure for mocked tests
## 11.10.0 - 2023-02-09
* [#1679](https://github.com/stripe/stripe-node/pull/1679) Enable library to work in worker environments without extra configuration.
## 11.9.1 - 2023-02-03
* [#1672](https://github.com/stripe/stripe-node/pull/1672) Update main entrypoint on package.json
## 11.9.0 - 2023-02-02
* [#1669](https://github.com/stripe/stripe-node/pull/1669) API Updates
* Add support for `resume` method on resource `Subscription`
* Add support for `payment_link` on `Checkout.SessionListParams`
* Add support for `trial_settings` on `Checkout.SessionCreateParams.subscription_data`, `SubscriptionCreateParams`, `SubscriptionUpdateParams`, and `Subscription`
* Add support for `shipping_cost` on `CreditNoteCreateParams`, `CreditNotePreviewLinesParams`, `CreditNotePreviewParams`, `CreditNote`, `InvoiceCreateParams`, `InvoiceUpdateParams`, and `Invoice`
* Add support for `amount_shipping` on `CreditNote` and `Invoice`
* Add support for `shipping_details` on `InvoiceCreateParams`, `InvoiceUpdateParams`, and `Invoice`
* Add support for `subscription_resume_at` on `InvoiceUpcomingLinesParams` and `InvoiceUpcomingParams`
* Change `Issuing.CardholderCreateParams.individual.first_name`, `Issuing.CardholderCreateParams.individual.last_name`, `Issuing.CardholderUpdateParams.individual.first_name`, and `Issuing.CardholderUpdateParams.individual.last_name` to be optional
* Change type of `Issuing.Cardholder.individual.first_name` and `Issuing.Cardholder.individual.last_name` from `string` to `string | null`
* Add support for `invoice_creation` on `PaymentLinkCreateParams`, `PaymentLinkUpdateParams`, and `PaymentLink`
* Add support for new value `America/Ciudad_Juarez` on enum `Reporting.ReportRunCreateParams.parameters.timezone`
* Add support for new value `paused` on enum `SubscriptionListParams.status`
* Add support for new value `paused` on enum `Subscription.status`
* Add support for new values `customer.subscription.paused` and `customer.subscription.resumed` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]`
* Add support for new value `funding_reversed` on enum `CustomerCashBalanceTransaction.type`
* [#1670](https://github.com/stripe/stripe-node/pull/1670) Change default entrypoint to stripe.node
* [#1668](https://github.com/stripe/stripe-node/pull/1668) Use EventTarget in worker / browser runtimes
* [#1667](https://github.com/stripe/stripe-node/pull/1667) fix: added support for TypeScript "NodeNext" module resolution
## 11.8.0 - 2023-01-26
* [#1665](https://github.com/stripe/stripe-node/pull/1665) API Updates
* Add support for new value `BE` on enums `Checkout.Session.payment_method_options.customer_balance.bank_transfer.eu_bank_transfer.country`, `Invoice.payment_settings.payment_method_options.customer_balance.bank_transfer.eu_bank_transfer.country`, `PaymentIntent.payment_method_options.customer_balance.bank_transfer.eu_bank_transfer.country`, and `Subscription.payment_settings.payment_method_options.customer_balance.bank_transfer.eu_bank_transfer.country`
* Add support for new values `cs-CZ`, `el-GR`, `en-CZ`, and `en-GR` on enums `PaymentIntentConfirmParams.payment_method_options.klarna.preferred_locale`, `PaymentIntentCreateParams.payment_method_options.klarna.preferred_locale`, and `PaymentIntentUpdateParams.payment_method_options.klarna.preferred_locale`
* [#1660](https://github.com/stripe/stripe-node/pull/1660) Introduce separate entry point for worker environments
* This is technically a breaking change that explicitly defines package entry points and was mistakenly released in a minor version. If your application previously imported other internal files from stripe-node and this change breaks it, please open an issue detailing your use case.
## 11.7.0 - 2023-01-19
* [#1661](https://github.com/stripe/stripe-node/pull/1661) API Updates
* Add support for `verification_session` on `EphemeralKeyCreateParams`
* Add support for new values `refund.created` and `refund.updated` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]`
* [#1647](https://github.com/stripe/stripe-node/pull/1647) Bump json5 from 2.2.1 to 2.2.3
## 11.6.0 - 2023-01-05
* [#1646](https://github.com/stripe/stripe-node/pull/1646) API Updates
* Add support for `card_issuing` on `Issuing.Cardholder.individual`
## 11.5.0 - 2022-12-22
* [#1642](https://github.com/stripe/stripe-node/pull/1642) API Updates
* Add support for new value `merchant_default` on enums `CashBalanceUpdateParams.settings.reconciliation_mode`, `CustomerCreateParams.cash_balance.settings.reconciliation_mode`, and `CustomerUpdateParams.cash_balance.settings.reconciliation_mode`
* Add support for `using_merchant_default` on `CashBalance.settings`
* Change `Checkout.SessionCreateParams.cancel_url` to be optional
* Change type of `Checkout.Session.cancel_url` from `string` to `string | null`
## 11.4.0 - 2022-12-15
* [#1639](https://github.com/stripe/stripe-node/pull/1639) API Updates
* Add support for new value `invoice_overpaid` on enum `CustomerBalanceTransaction.type`
* [#1637](https://github.com/stripe/stripe-node/pull/1637) Update packages in examples/webhook-signing
## 11.3.0 - 2022-12-08
* [#1634](https://github.com/stripe/stripe-node/pull/1634) API Updates
* Change `CustomerListPaymentMethodsParams.type` and `PaymentMethodListParams.type` to be optional
## 11.2.0 - 2022-12-06
* [#1632](https://github.com/stripe/stripe-node/pull/1632) API Updates
* Add support for `flow_data` on `BillingPortal.SessionCreateParams`
* Add support for `flow` on `BillingPortal.Session`
* [#1631](https://github.com/stripe/stripe-node/pull/1631) API Updates
* Add support for `india_international_payments` on `Account.capabilities`, `AccountCreateParams.capabilities`, and `AccountUpdateParams.capabilities`
* Add support for `invoice_creation` on `Checkout.Session` and `Checkout.SessionCreateParams`
* Add support for `invoice` on `Checkout.Session`
* Add support for `metadata` on `SubscriptionSchedule.phases[].items[]`, `SubscriptionScheduleCreateParams.phases[].items[]`, and `SubscriptionScheduleUpdateParams.phases[].items[]`
* [#1630](https://github.com/stripe/stripe-node/pull/1630) Remove BASIC_METHODS from TS definitions
* [#1629](https://github.com/stripe/stripe-node/pull/1629) Narrower type for stripe.invoices.retrieveUpcoming()
* [#1627](https://github.com/stripe/stripe-node/pull/1627) remove unneeded IIFE
* [#1625](https://github.com/stripe/stripe-node/pull/1625) Remove API version from the path
* [#1626](https://github.com/stripe/stripe-node/pull/1626) Move child resource method params next to method declarations
* [#1624](https://github.com/stripe/stripe-node/pull/1624) Split resource and service types
## 11.1.0 - 2022-11-17
* [#1623](https://github.com/stripe/stripe-node/pull/1623) API Updates
* Add support for `hosted_instructions_url` on `PaymentIntent.next_action.wechat_pay_display_qr_code`
* [#1622](https://github.com/stripe/stripe-node/pull/1622) API Updates
* Add support for `custom_text` on `Checkout.Session`, `Checkout.SessionCreateParams`, `PaymentLinkCreateParams`, `PaymentLinkUpdateParams`, and `PaymentLink`
* Add support for `hosted_instructions_url` on `PaymentIntent.next_action.paynow_display_qr_code`
## 11.0.0 - 2022-11-16
This release includes breaking changes resulting from moving to use the new API version "2022-11-15". To learn more about these changes to Stripe products, see https://stripe.com/docs/upgrades#2022-11-15
"⚠️" symbol highlights breaking changes.
* [#1608](https://github.com/stripe/stripe-node/pull/1608) Next major release changes
* [#1619](https://github.com/stripe/stripe-node/pull/1619) Annotate prototypes with types
* [#1612](https://github.com/stripe/stripe-node/pull/1612) Add type information here and there
* [#1615](https://github.com/stripe/stripe-node/pull/1615) API Updates
* ⚠️ Remove support for `tos_shown_and_accepted` on `Checkout.SessionCreateParams.payment_method_options.paynow`. The property was mistakenly released and never worked.
### ⚠️ Changed
* Drop support for Node.js 8 and 10. We now support Node.js 12+. ((#1579)
* Change `StripeSignatureVerificationError` to have `header` and `payload` fields instead of `detail`. To access these properties, use `err.header` and `err.payload` instead of `err.detail.header` and `err.detail.payload`. (#1574)
### ⚠️ Removed
* Remove `Orders` resource. (#1580)
* Remove `SKU` resource (#1583)
* Remove deprecated `Checkout.SessionCreateParams.subscription_data.items`. (#1580)
* Remove deprecated configuration setter methods (`setHost`, `setProtocol`, `setPort`, `setApiVersion`, `setApiKey`, `setTimeout`, `setAppInfo`, `setHttpAgent`, `setMaxNetworkRetries`, and `setTelemetryEnabled`). (#1597)
Use the config object to set these options instead, for example:
```typescript
const stripe = Stripe('sk_test_...', {
apiVersion: '2019-08-08',
maxNetworkRetries: 1,
httpAgent: new ProxyAgent(process.env.http_proxy),
timeout: 1000,
host: 'api.example.com',
port: 123,
telemetry: true,
});
```
* Remove deprecated basic method definitions. (#1600)
Use basic methods defined on the resource instead.
```typescript
// Before
basicMethods: true
// After
create: stripeMethod({
method: 'POST',
fullPath: '/v1/resource',
}),
list: stripeMethod({
method: 'GET',
methodType: 'list',
fullPath: '/v1/resource',
}),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/resource/{id}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/resource/{id}',
}),
// Avoid 'delete' keyword in JS
del: stripeMethod({
method: 'DELETE',
fullPath: '/v1/resource/{id}',
}),
```
* Remove deprecated option names. Use the following option names instead (`OLD`->`NEW`): `api_key`->`apiKey`, `idempotency_key`->`idempotencyKey`, `stripe_account`->`stripeAccount`, `stripe_version`->`apiVersion`, `stripeVersion`->`apiVersion`. (#1600)
* Remove `charges` field on `PaymentIntent` and replace it with `latest_charge`. (#1614 )
* Remove deprecated `amount` field on `Checkout.Session.LineItem`. (#1614 )
* Remove support for `tos_shown_and_accepted` on `Checkout.Session.PaymentMethodOptions.Paynow`. (#1614 )
## 10.17.0 - 2022-11-08
* [#1610](https://github.com/stripe/stripe-node/pull/1610) API Updates
* Add support for new values `eg_tin`, `ph_tin`, and `tr_tin` on enums `Checkout.Session.customer_details.tax_ids[].type`, `Invoice.customer_tax_ids[].type`, `Order.tax_details.tax_ids[].type`, and `TaxId.type`
* Add support for new values `eg_tin`, `ph_tin`, and `tr_tin` on enums `CustomerCreateParams.tax_id_data[].type`, `InvoiceUpcomingLinesParams.customer_details.tax_ids[].type`, `InvoiceUpcomingParams.customer_details.tax_ids[].type`, `OrderCreateParams.tax_details.tax_ids[].type`, `OrderUpdateParams.tax_details.tax_ids[].type`, and `TaxIdCreateParams.type`
* Add support for `reason_message` on `Issuing.Authorization.request_history[]`
* Add support for new value `webhook_error` on enum `Issuing.Authorization.request_history[].reason`
## 10.16.0 - 2022-11-03
* [#1596](https://github.com/stripe/stripe-node/pull/1596) API Updates
* Add support for `on_behalf_of` on `Checkout.SessionCreateParams.subscription_data`, `SubscriptionCreateParams`, `SubscriptionSchedule.default_settings`, `SubscriptionSchedule.phases[]`, `SubscriptionScheduleCreateParams.default_settings`, `SubscriptionScheduleCreateParams.phases[]`, `SubscriptionScheduleUpdateParams.default_settings`, `SubscriptionScheduleUpdateParams.phases[]`, `SubscriptionUpdateParams`, and `Subscription`
* Add support for `tax_behavior` and `tax_code` on `InvoiceItemCreateParams`, `InvoiceItemUpdateParams`, `InvoiceUpcomingLinesParams.invoice_items[]`, and `InvoiceUpcomingParams.invoice_items[]`
## 10.15.0 - 2022-10-20
* [#1588](https://github.com/stripe/stripe-node/pull/1588) API Updates
* Add support for new values `jp_trn` and `ke_pin` on enums `Checkout.Session.customer_details.tax_ids[].type`, `Invoice.customer_tax_ids[].type`, `Order.tax_details.tax_ids[].type`, and `TaxId.type`
* Add support for new values `jp_trn` and `ke_pin` on enums `CustomerCreateParams.tax_id_data[].type`, `InvoiceUpcomingLinesParams.customer_details.tax_ids[].type`, `InvoiceUpcomingParams.customer_details.tax_ids[].type`, `OrderCreateParams.tax_details.tax_ids[].type`, `OrderUpdateParams.tax_details.tax_ids[].type`, and `TaxIdCreateParams.type`
* Add support for `tipping` on `Terminal.Reader.action.process_payment_intent.process_config` and `Terminal.ReaderProcessPaymentIntentParams.process_config`
* [#1585](https://github.com/stripe/stripe-node/pull/1585) use native UUID method if available
## 10.14.0 - 2022-10-13
* [#1582](https://github.com/stripe/stripe-node/pull/1582) API Updates
* Add support for new values `invalid_representative_country` and `verification_failed_residential_address` on enums `Account.future_requirements.errors[].code`, `Account.requirements.errors[].code`, `Capability.future_requirements.errors[].code`, `Capability.requirements.errors[].code`, `Person.future_requirements.errors[].code`, and `Person.requirements.errors[].code`
* Add support for `request_log_url` on `StripeError` objects
* Add support for `network_data` on `Issuing.Authorization`
* ⚠️ Remove `currency`, `description`, `images`, and `name` from `Checkout.SessionCreateParams`. These properties do not work on the latest API version. (fixes #1575)
## 10.13.0 - 2022-10-06
* [#1571](https://github.com/stripe/stripe-node/pull/1571) API Updates
* Add support for new value `invalid_dob_age_under_18` on enums `Account.future_requirements.errors[].code`, `Account.requirements.errors[].code`, `Capability.future_requirements.errors[].code`, `Capability.requirements.errors[].code`, `Person.future_requirements.errors[].code`, and `Person.requirements.errors[].code`
* Add support for new value `bank_of_china` on enums `Charge.payment_method_details.fpx.bank`, `PaymentIntentConfirmParams.payment_method_data.fpx.bank`, `PaymentIntentCreateParams.payment_method_data.fpx.bank`, `PaymentIntentUpdateParams.payment_method_data.fpx.bank`, `PaymentMethod.fpx.bank`, `PaymentMethodCreateParams.fpx.bank`, `SetupIntentConfirmParams.payment_method_data.fpx.bank`, `SetupIntentCreateParams.payment_method_data.fpx.bank`, and `SetupIntentUpdateParams.payment_method_data.fpx.bank`
* Add support for new values `America/Nuuk`, `Europe/Kyiv`, and `Pacific/Kanton` on enum `Reporting.ReportRunCreateParams.parameters.timezone`
* Add support for `klarna` on `SetupAttempt.payment_method_details`
* [#1570](https://github.com/stripe/stripe-node/pull/1570) Update node-fetch to 2.6.7
* [#1568](https://github.com/stripe/stripe-node/pull/1568) Upgrade dependencies
* [#1567](https://github.com/stripe/stripe-node/pull/1567) Fix release tag calculation
## 10.12.0 - 2022-09-29
* [#1564](https://github.com/stripe/stripe-node/pull/1564) API Updates
* Change type of `Charge.payment_method_details.card_present.incremental_authorization_supported` and `Charge.payment_method_details.card_present.overcapture_supported` from `boolean | null` to `boolean`
* Add support for `created` on `Checkout.Session`
* Add support for `setup_future_usage` on `PaymentIntent.payment_method_options.pix`, `PaymentIntentConfirmParams.payment_method_options.pix`, `PaymentIntentCreateParams.payment_method_options.pix`, and `PaymentIntentUpdateParams.payment_method_options.pix`
* Deprecate `Checkout.SessionCreateParams.subscription_data.items` (use the `line_items` param instead). This will be removed in the next major version.
* [#1563](https://github.com/stripe/stripe-node/pull/1563) Migrate other Stripe infrastructure to TS
* [#1562](https://github.com/stripe/stripe-node/pull/1562) Restore lib after generating
* [#1551](https://github.com/stripe/stripe-node/pull/1551) Re-introduce Typescript changes
## 10.11.0 - 2022-09-22
* [#1560](https://github.com/stripe/stripe-node/pull/1560) API Updates
* Add support for `terms_of_service` on `Checkout.Session.consent_collection`, `Checkout.Session.consent`, `Checkout.SessionCreateParams.consent_collection`, `PaymentLink.consent_collection`, and `PaymentLinkCreateParams.consent_collection`
* ⚠️ Remove support for `plan` on `Checkout.SessionCreateParams.payment_method_options.card.installments`. The property was mistakenly released and never worked.
* Add support for `statement_descriptor` on `PaymentIntentIncrementAuthorizationParams`
* Change `SubscriptionSchedule.phases[].currency` to be required
## 10.10.0 - 2022-09-15
* [#1552](https://github.com/stripe/stripe-node/pull/1552) API Updates
* Add support for `pix` on `Charge.payment_method_details`, `Checkout.Session.payment_method_options`, `Checkout.SessionCreateParams.payment_method_options`, `PaymentIntent.payment_method_options`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentConfirmParams.payment_method_options`, `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentMethodCreateParams`, `PaymentMethod`, `SetupIntentConfirmParams.payment_method_data`, `SetupIntentCreateParams.payment_method_data`, and `SetupIntentUpdateParams.payment_method_data`
* Add support for new value `pix` on enum `Checkout.SessionCreateParams.payment_method_types[]`
* Add support for new value `pix` on enums `CustomerListPaymentMethodsParams.type` and `PaymentMethodListParams.type`
* Add support for `from_invoice` on `InvoiceCreateParams` and `Invoice`
* Add support for `latest_revision` on `Invoice`
* Add support for `amount` on `Issuing.DisputeCreateParams` and `Issuing.DisputeUpdateParams`
* Add support for new value `pix` on enums `PaymentIntentConfirmParams.payment_method_data.type`, `PaymentIntentCreateParams.payment_method_data.type`, `PaymentIntentUpdateParams.payment_method_data.type`, `SetupIntentConfirmParams.payment_method_data.type`, `SetupIntentCreateParams.payment_method_data.type`, and `SetupIntentUpdateParams.payment_method_data.type`
* Add support for `pix_display_qr_code` on `PaymentIntent.next_action`
* Add support for new value `pix` on enums `PaymentLink.payment_method_types[]`, `PaymentLinkCreateParams.payment_method_types[]`, and `PaymentLinkUpdateParams.payment_method_types[]`
* Add support for new value `pix` on enum `PaymentMethodCreateParams.type`
* Add support for new value `pix` on enum `PaymentMethod.type`
* Add support for `created` on `Treasury.CreditReversal` and `Treasury.DebitReversal`
## 10.9.0 - 2022-09-09
* [#1549](https://github.com/stripe/stripe-node/pull/1549) API Updates
* Add support for new value `terminal_reader_splashscreen` on enums `File.purpose` and `FileListParams.purpose`
* Add support for `require_signature` on `Issuing.Card.shipping` and `Issuing.CardCreateParams.shipping`
## 10.8.0 - 2022-09-07
* [#1544](https://github.com/stripe/stripe-node/pull/1544) API Updates
* Add support for new value `terminal_reader_splashscreen` on enums `File.purpose` and `FileListParams.purpose`
## 10.7.0 - 2022-08-31
* [#1540](https://github.com/stripe/stripe-node/pull/1540) API Updates
* Add support for new values `de-CH`, `en-CH`, `en-PL`, `en-PT`, `fr-CH`, `it-CH`, `pl-PL`, and `pt-PT` on enums `OrderCreateParams.payment.settings.payment_method_options.klarna.preferred_locale`, `OrderUpdateParams.payment.settings.payment_method_options.klarna.preferred_locale`, `PaymentIntentConfirmParams.payment_method_options.klarna.preferred_locale`, `PaymentIntentCreateParams.payment_method_options.klarna.preferred_locale`, and `PaymentIntentUpdateParams.payment_method_options.klarna.preferred_locale`
* Add support for `description` on `PaymentLink.subscription_data` and `PaymentLinkCreateParams.subscription_data`
## 10.6.0 - 2022-08-26
* [#1534](https://github.com/stripe/stripe-node/pull/1534) API Updates
* Change `Account.company.name`, `Charge.refunds`, `PaymentIntent.charges`, `Product.caption`, `Product.statement_descriptor`, `Product.unit_label`, `Terminal.Configuration.tipping.aud.fixed_amounts`, `Terminal.Configuration.tipping.aud.percentages`, `Terminal.Configuration.tipping.cad.fixed_amounts`, `Terminal.Configuration.tipping.cad.percentages`, `Terminal.Configuration.tipping.chf.fixed_amounts`, `Terminal.Configuration.tipping.chf.percentages`, `Terminal.Configuration.tipping.czk.fixed_amounts`, `Terminal.Configuration.tipping.czk.percentages`, `Terminal.Configuration.tipping.dkk.fixed_amounts`, `Terminal.Configuration.tipping.dkk.percentages`, `Terminal.Configuration.tipping.eur.fixed_amounts`, `Terminal.Configuration.tipping.eur.percentages`, `Terminal.Configuration.tipping.gbp.fixed_amounts`, `Terminal.Configuration.tipping.gbp.percentages`, `Terminal.Configuration.tipping.hkd.fixed_amounts`, `Terminal.Configuration.tipping.hkd.percentages`, `Terminal.Configuration.tipping.myr.fixed_amounts`, `Terminal.Configuration.tipping.myr.percentages`, `Terminal.Configuration.tipping.nok.fixed_amounts`, `Terminal.Configuration.tipping.nok.percentages`, `Terminal.Configuration.tipping.nzd.fixed_amounts`, `Terminal.Configuration.tipping.nzd.percentages`, `Terminal.Configuration.tipping.sek.fixed_amounts`, `Terminal.Configuration.tipping.sek.percentages`, `Terminal.Configuration.tipping.sgd.fixed_amounts`, `Terminal.Configuration.tipping.sgd.percentages`, `Terminal.Configuration.tipping.usd.fixed_amounts`, `Terminal.Configuration.tipping.usd.percentages`, `Treasury.FinancialAccount.active_features`, `Treasury.FinancialAccount.pending_features`, `Treasury.FinancialAccount.platform_restrictions`, and `Treasury.FinancialAccount.restricted_features` to be optional
* This is a bug fix. These fields were all actually optional and not guaranteed to be returned by the Stripe API, however the type annotations did not correctly reflect this.
* Fixes https://github.com/stripe/stripe-node/issues/1518.
* Add support for `login_page` on `BillingPortal.Configuration`, `BillingPortal.ConfigurationCreateParams`, and `BillingPortal.ConfigurationUpdateParams`
* Add support for new value `deutsche_bank_ag` on enums `Charge.payment_method_details.eps.bank`, `PaymentIntentConfirmParams.payment_method_data.eps.bank`, `PaymentIntentCreateParams.payment_method_data.eps.bank`, `PaymentIntentUpdateParams.payment_method_data.eps.bank`, `PaymentMethod.eps.bank`, `PaymentMethodCreateParams.eps.bank`, `SetupIntentConfirmParams.payment_method_data.eps.bank`, `SetupIntentCreateParams.payment_method_data.eps.bank`, and `SetupIntentUpdateParams.payment_method_data.eps.bank`
* Add support for `customs` and `phone_number` on `Issuing.Card.shipping` and `Issuing.CardCreateParams.shipping`
* Add support for `description` on `Quote.subscription_data`, `QuoteCreateParams.subscription_data`, `QuoteUpdateParams.subscription_data`, `SubscriptionSchedule.default_settings`, `SubscriptionSchedule.phases[]`, `SubscriptionScheduleCreateParams.default_settings`, `SubscriptionScheduleCreateParams.phases[]`, `SubscriptionScheduleUpdateParams.default_settings`, and `SubscriptionScheduleUpdateParams.phases[]`
* [#1532](https://github.com/stripe/stripe-node/pull/1532) Update coveralls step to run for one node version, remove finish step
* [#1531](https://github.com/stripe/stripe-node/pull/1531) Regen yarn.lock.
## 10.5.0 - 2022-08-24
* [#1527](https://github.com/stripe/stripe-node/pull/1527) fix: Update FetchHttpClient to send empty string for empty POST/PUT/PATCH requests.
* [#1528](https://github.com/stripe/stripe-node/pull/1528) Update README.md to use a new NOTE notation
* [#1526](https://github.com/stripe/stripe-node/pull/1526) Add test coverage using Coveralls
## 10.4.0 - 2022-08-23
* [#1520](https://github.com/stripe/stripe-node/pull/1520) Add beta readme.md section
* [#1524](https://github.com/stripe/stripe-node/pull/1524) API Updates
* Change `Terminal.Reader.action` to be required
* Change `Treasury.OutboundTransferCreateParams.destination_payment_method` to be optional
* Change type of `Treasury.OutboundTransfer.destination_payment_method` from `string` to `string | null`
* Change the return type of `Customer.fundCashBalance` test helper from `CustomerBalanceTransaction` to `CustomerCashBalanceTransaction`.
* This would generally be considered a breaking change, but we've worked with all existing users to migrate and are comfortable releasing this as a minor as it is solely a test helper method. This was essentially broken prior to this change.
## 10.3.0 - 2022-08-19
* [#1516](https://github.com/stripe/stripe-node/pull/1516) API Updates
* Add support for new resource `CustomerCashBalanceTransaction`
* Remove support for value `paypal` from enums `Order.payment.settings.payment_method_types[]`, `OrderCreateParams.payment.settings.payment_method_types[]`, and `OrderUpdateParams.payment.settings.payment_method_types[]`
* Add support for `currency` on `PaymentLink`
* Add support for `network` on `SetupIntentConfirmParams.payment_method_options.card`, `SetupIntentCreateParams.payment_method_options.card`, `SetupIntentUpdateParams.payment_method_options.card`, `Subscription.payment_settings.payment_method_options.card`, `SubscriptionCreateParams.payment_settings.payment_method_options.card`, and `SubscriptionUpdateParams.payment_settings.payment_method_options.card`
* Change `Subscription.currency` to be required
* Change type of `Topup.source` from `Source` to `Source | null`
* Add support for new value `customer_cash_balance_transaction.created` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]`
* [#1515](https://github.com/stripe/stripe-node/pull/1515) Add a support section to the readme
## 10.2.0 - 2022-08-11
* [#1510](https://github.com/stripe/stripe-node/pull/1510) API Updates
* Add support for `payment_method_collection` on `Checkout.Session`, `Checkout.SessionCreateParams`, `PaymentLinkCreateParams`, `PaymentLinkUpdateParams`, and `PaymentLink`
## 10.1.0 - 2022-08-09
* [#1506](https://github.com/stripe/stripe-node/pull/1506) API Updates
* Add support for `process_config` on `Terminal.Reader.action.process_payment_intent`
* [#1505](https://github.com/stripe/stripe-node/pull/1505) Simplify AddressParam definitions
- Rename `AddressParam` to `ShippingAddressParam`, and change type of `Source.source_order.shipping.address`, `SourceUpdateParams.SourceOrder.Shipping.address`, and `SessionCreateParams.PaymentIntentData.Shipping.address` to `ShippingAddressParam`
- Rename `AccountAddressParam` go `AddressParam`, and change type of `AccountCreateParams.BusinessProfile.support_address`, `AccountCreateParams.Company.address`, `AccountCreateParams.Individual.address `, `AccountCreateParams.Individual.registered_address`, `AccountUpdateParams.BusinessProfile.support_address`, `AccountUpdateParams.Company.address`, `AccountUpdateParams.Individual.address`, `AccountUpdateParams.Individual.registered_address`, `ChargeCreateParams.Shipping.address`, `ChargeUpdateParams.Shipping.address`, `CustomerCreateParams.Shipping.address`, `CustomerUpdateParams.Shipping.address`, `CustomerSourceUpdateParams.Owner.address`, `InvoiceListUpcomingLinesParams.CustomerDetails.Shipping.address`, `InvoiceRetrieveUpcomingParams.CustomerDetails.Shipping.address`, `OrderCreateParams.BillingDetails.address`, `OrderCreateParams.ShippingDetails.address`, `OrderUpdateParams.BillingDetails.address`, `OrderUpdateParams.ShippingDetails.address`, `PaymentIntentCreateParams.Shipping.address`, `PaymentIntentUpdateParams.Shipping.address`, `PaymentIntentConfirmParams.Shipping.address`, `PersonCreateParams.address`, `PersonCreateParams.registered_address`, `PersonUpdateParams.address`, `PersonUpdateParams.registered_address`, `SourceCreateParams.Owner.address`, `SourceUpdateParams.Owner.address`, `TokenCreateParams.Account.Company.address`, `TokenCreateParams.Account.Individual.address`, `TokenCreateParams.Account.Individual.registered_address`, `TokenCreateParams.Person.address`, `TokenCreateParams.Person.registered_address`, and `Terminal.LocationUpdateParams.address` to `AddressParam`
* [#1503](https://github.com/stripe/stripe-node/pull/1503) API Updates
* Add support for `expires_at` on `Apps.Secret` and `Apps.SecretCreateParams`
## 10.0.0 - 2022-08-02
This release includes breaking changes resulting from:
* Moving to use the new API version "2022-08-01". To learn more about these changes to Stripe products, see https://stripe.com/docs/upgrades#2022-08-01
* Cleaning up the SDK to remove deprecated/unused APIs and rename classes/methods/properties to sync with product APIs. Read more detailed description at https://github.com/stripe/stripe-node/wiki/Migration-guide-for-v10.
"⚠️" symbol highlights breaking changes.
* [#1497](https://github.com/stripe/stripe-node/pull/1497) API Updates
* [#1493](https://github.com/stripe/stripe-node/pull/1493) Next major release changes
### Added
* Add support for new value `invalid_tos_acceptance` on enums `Account.future_requirements.errors[].code`, `Account.requirements.errors[].code`, `Capability.future_requirements.errors[].code`, `Capability.requirements.errors[].code`, `Person.future_requirements.errors[].code`, and `Person.requirements.errors[].code`
* Add support for `shipping_cost` and `shipping_details` on `Checkout.Session`
### ⚠️ Changed
* Change type of `business_profile`, `business_type`, `country`, `default_currency`, and `settings` properties on `Account` resource to be nullable.
* Change type of `currency` property on `Checkout.Session` resource from `string` to `'cad' | 'usd'`.
* Change location of TypeScript definitions for `CreditNoteLineItemListPreviewParams`, `CreditNoteLineItemListPreviewParams.Line`, `CreditNoteLineItemListPreviewParams.Line.Type`, and `CreditNoteLineItemListPreviewParams.Line.Reason` interfaces from `CreditNoteLineItems.d.ts` to `CreditNotes.d.ts`.
* Change type of `address`, `currency`, `delinquent`, `discount`, `invoice_prefix`, `name`, `phone`, and `preferred_locales` properties on `Customer` resource to be nullable.
* Rename `InvoiceRetrieveUpcomingParams` to `InvoiceListUpcomingLinesParams`.
### ⚠️ Removed
* Remove for `AlipayAccount`, `DeletedAlipayAccount`, `BitcoinReceiver`, `DeletedBitcoinReceiver`, `BitcoinTransaction`, and `BitcoinTransactionListParams` definitions.
* Remove `AlipayAccount` and `BitcoinReceiver` from `CustomerSource`.
* Remove `Stripe.DeletedAlipayAccount` and `Stripe.DeletedBitcoinReceiver` from possible values of `source` property in `PaymentIntent`.
* Remove `IssuerFraudRecord`, `IssuerFraudRecordRetrieveParams`, `IssuerFraudRecordListParams`, and `IssuerFraudRecordsResource`, definitions.
* Remove `treasury.received_credit.reversed` webhook event constant. Please use `treasury.received_credit.returned` instead.
* Remove `order.payment_failed`, `transfer.failed`, and `transfer.paid`. The events were deprecated.
* Remove `retrieveDetails` method from `Issuing.Card` resource. The method was unsupported. Read more at https://stripe.com/docs/issuing/cards/virtual.
* Remove `Issuing.CardDetails` and `CardRetrieveDetailsParams` definition.
* Remove `IssuerFraudRecords` resource.
* Remove `Recipient` resource and`recipient` property from `Card` resource.
* Remove `InvoiceMarkUncollectibleParams` definition.
* Remove deprecated `Stripe.Errors` and `StripeError` (and derived `StripeCardError`, `StripeInvalidRequestError`, `StripeAPIError`, `StripeAuthenticationError`, `StripePermissionError`, `StripeRateLimitError`, `StripeConnectionError`, `StripeSignatureVerificationError`, `StripeIdempotencyError`, and `StripeInvalidGrantError`) definitions.
* Remove `redirect_url` from `LoginLinks` definition. The property is no longer supported.
* Remove `LineItemListParams` definition. The interface was no longer in use.
### ⚠️ Renamed
* Rename `listUpcomingLineItems` method on `Invoice` resource to `listUpcomingLines`.
* Rename `InvoiceLineItemListUpcomingParams` to `InvoiceListUpcomingLinesParams`.
* Rename `InvoiceRetrieveUpcomingParams` to `InvoiceListUpcomingLinesParams`.
## 9.16.0 - 2022-07-26
* [#1492](https://github.com/stripe/stripe-node/pull/1492) API Updates
* Add support for new value `exempted` on enums `Charge.payment_method_details.card.three_d_secure.result` and `SetupAttempt.payment_method_details.card.three_d_secure.result`
* Add support for `customer_balance` on `Checkout.Session.payment_method_options` and `Checkout.SessionCreateParams.payment_method_options`
* Add support for new value `customer_balance` on enum `Checkout.SessionCreateParams.payment_method_types[]`
* Add support for new values `en-CA` and `fr-CA` on enums `OrderCreateParams.payment.settings.payment_method_options.klarna.preferred_locale`, `OrderUpdateParams.payment.settings.payment_method_options.klarna.preferred_locale`, `PaymentIntentConfirmParams.payment_method_options.klarna.preferred_locale`, `PaymentIntentCreateParams.payment_method_options.klarna.preferred_locale`, and `PaymentIntentUpdateParams.payment_method_options.klarna.preferred_locale`
## 9.15.0 - 2022-07-25
* [#1486](https://github.com/stripe/stripe-node/pull/1486) API Updates
* Add support for `installments` on `Checkout.Session.payment_method_options.card`, `Checkout.SessionCreateParams.payment_method_options.card`, `Invoice.payment_settings.payment_method_options.card`, `InvoiceCreateParams.payment_settings.payment_method_options.card`, and `InvoiceUpdateParams.payment_settings.payment_method_options.card`
* Add support for `default_currency` and `invoice_credit_balance` on `Customer`
* Add support for `currency` on `InvoiceCreateParams`
* Add support for `default_mandate` on `Invoice.payment_settings`, `InvoiceCreateParams.payment_settings`, and `InvoiceUpdateParams.payment_settings`
* Add support for `mandate` on `InvoicePayParams`
* Add support for `product_data` on `OrderCreateParams.line_items[]` and `OrderUpdateParams.line_items[]`
## 9.14.0 - 2022-07-18
* [#1477](https://github.com/stripe/stripe-node/pull/1477) API Updates
* Add support for `blik_payments` on `Account.capabilities`, `AccountCreateParams.capabilities`, and `AccountUpdateParams.capabilities`
* Add support for `blik` on `Charge.payment_method_details`, `Mandate.payment_method_details`, `PaymentIntent.payment_method_options`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentConfirmParams.payment_method_options`, `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentMethodCreateParams`, `PaymentMethodUpdateParams`, `PaymentMethod`, `SetupAttempt.payment_method_details`, `SetupIntent.payment_method_options`, `SetupIntentConfirmParams.payment_method_data`, `SetupIntentConfirmParams.payment_method_options`, `SetupIntentCreateParams.payment_method_data`, `SetupIntentCreateParams.payment_method_options`, `SetupIntentUpdateParams.payment_method_data`, and `SetupIntentUpdateParams.payment_method_options`
* Change type of `Checkout.Session.consent_collection.promotions`, `Checkout.SessionCreateParams.consent_collection.promotions`, `PaymentLink.consent_collection.promotions`, and `PaymentLinkCreateParams.consent_collection.promotions` from `literal('auto')` to `enum('auto'|'none')`
* Add support for new value `blik` on enum `Checkout.SessionCreateParams.payment_method_types[]`
* Add support for new value `blik` on enums `CustomerListPaymentMethodsParams.type` and `PaymentMethodListParams.type`
* Add support for new value `blik` on enums `PaymentIntentConfirmParams.payment_method_data.type`, `PaymentIntentCreateParams.payment_method_data.type`, `PaymentIntentUpdateParams.payment_method_data.type`, `SetupIntentConfirmParams.payment_method_data.type`, `SetupIntentCreateParams.payment_method_data.type`, and `SetupIntentUpdateParams.payment_method_data.type`
* Add support for new value `blik` on enums `PaymentLink.payment_method_types[]`, `PaymentLinkCreateParams.payment_method_types[]`, and `PaymentLinkUpdateParams.payment_method_types[]`
* Add support for new value `blik` on enum `PaymentMethodCreateParams.type`
* Add support for new value `blik` on enum `PaymentMethod.type`
* Add support for `cancel` method on `Subscriptions` resource. This has the same functionality as the `del` method - if you are on a version less than 9.14.0, please use `del`.
* [#1476](https://github.com/stripe/stripe-node/pull/1476) fix: Include trailing slash when passing empty query parameters.
* [#1475](https://github.com/stripe/stripe-node/pull/1475) Move @types/node to devDependencies
## 9.13.0 - 2022-07-12
* [#1473](https://github.com/stripe/stripe-node/pull/1473) API Updates
* Add support for `customer_details` on `Checkout.SessionListParams`
* Change `LineItem.amount_discount` and `LineItem.amount_tax` to be required
* Change `Transfer.source_type` to be optional and not nullable
* [#1471](https://github.com/stripe/stripe-node/pull/1471) Update readme to include a note on beta packages
## 9.12.0 - 2022-07-07
* [#1468](https://github.com/stripe/stripe-node/pull/1468) API Updates
* Add support for `currency` on `Checkout.SessionCreateParams`, `InvoiceUpcomingLinesParams`, `InvoiceUpcomingParams`, `PaymentLinkCreateParams`, `SubscriptionCreateParams`, `SubscriptionSchedule.phases[]`, `SubscriptionScheduleCreateParams.phases[]`, `SubscriptionScheduleUpdateParams.phases[]`, and `Subscription`
* Add support for `currency_options` on `Checkout.SessionCreateParams.shipping_options[].shipping_rate_data.fixed_amount`, `CouponCreateParams`, `CouponUpdateParams`, `Coupon`, `OrderCreateParams.shipping_cost.shipping_rate_data.fixed_amount`, `OrderUpdateParams.shipping_cost.shipping_rate_data.fixed_amount`, `PriceCreateParams`, `PriceUpdateParams`, `Price`, `ProductCreateParams.default_price_data`, `PromotionCode.restrictions`, `PromotionCodeCreateParams.restrictions`, `ShippingRate.fixed_amount`, and `ShippingRateCreateParams.fixed_amount`
* Add support for `restrictions` on `PromotionCodeUpdateParams`
* Add support for `fixed_amount` and `tax_behavior` on `ShippingRateUpdateParams`
* [#1467](https://github.com/stripe/stripe-node/pull/1467) API Updates
* Add support for `customer` on `Checkout.SessionListParams` and `RefundCreateParams`
* Add support for `currency` and `origin` on `RefundCreateParams`
* Add support for new values `financial_connections.account.created`, `financial_connections.account.deactivated`, `financial_connections.account.disconnected`, `financial_connections.account.reactivated`, and `financial_connections.account.refreshed_balance` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]`
## 9.11.0 - 2022-06-29
* [#1462](https://github.com/stripe/stripe-node/pull/1462) API Updates
* Add support for `deliver_card`, `fail_card`, `return_card`, and `ship_card` test helper methods on resource `Issuing.Card`
* Change type of `PaymentLink.payment_method_types[]`, `PaymentLinkCreateParams.payment_method_types[]`, and `PaymentLinkUpdateParams.payment_method_types[]` from `literal('card')` to `enum`
* Add support for `hosted_regulatory_receipt_url` on `Treasury.ReceivedCredit` and `Treasury.ReceivedDebit`
## 9.10.0 - 2022-06-23
* [#1459](https://github.com/stripe/stripe-node/pull/1459) API Updates
* Add support for `capture_method` on `PaymentIntentConfirmParams` and `PaymentIntentUpdateParams`
* [#1458](https://github.com/stripe/stripe-node/pull/1458) API Updates
* Add support for `promptpay_payments` on `Account.capabilities`, `AccountCreateParams.capabilities`, and `AccountUpdateParams.capabilities`
* Add support for `promptpay` on `Charge.payment_method_details`, `PaymentIntent.payment_method_options`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentConfirmParams.payment_method_options`, `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentMethodCreateParams`, `PaymentMethod`, `SetupIntentConfirmParams.payment_method_data`, `SetupIntentCreateParams.payment_method_data`, and `SetupIntentUpdateParams.payment_method_data`
* Add support for new value `promptpay` on enum `Checkout.SessionCreateParams.payment_method_types[]`
* Add support for `subtotal_excluding_tax` on `CreditNote` and `Invoice`
* Add support for `amount_excluding_tax` and `unit_amount_excluding_tax` on `CreditNoteLineItem` and `InvoiceLineItem`
* Add support for new value `promptpay` on enums `CustomerListPaymentMethodsParams.type` and `PaymentMethodListParams.type`
* Add support for `rendering_options` on `InvoiceCreateParams` and `InvoiceUpdateParams`
* Add support for new value `promptpay` on enums `Invoice.payment_settings.payment_method_types[]`, `InvoiceCreateParams.payment_settings.payment_method_types[]`, `InvoiceUpdateParams.payment_settings.payment_method_types[]`, `Subscription.payment_settings.payment_method_types[]`, `SubscriptionCreateParams.payment_settings.payment_method_types[]`, and `SubscriptionUpdateParams.payment_settings.payment_method_types[]`
* Add support for `total_excluding_tax` on `Invoice`
* Add support for `automatic_payment_methods` on `Order.payment.settings`
* Add support for new value `promptpay` on enums `PaymentIntentConfirmParams.payment_method_data.type`, `PaymentIntentCreateParams.payment_method_data.type`, `PaymentIntentUpdateParams.payment_method_data.type`, `SetupIntentConfirmParams.payment_method_data.type`, `SetupIntentCreateParams.payment_method_data.type`, and `SetupIntentUpdateParams.payment_method_data.type`
* Add support for `promptpay_display_qr_code` on `PaymentIntent.next_action`
* Add support for new value `promptpay` on enum `PaymentMethodCreateParams.type`
* Add support for new value `promptpay` on enum `PaymentMethod.type`
* [#1455](https://github.com/stripe/stripe-node/pull/1455) fix: Stop using path.join to create URLs.
## 9.9.0 - 2022-06-17
* [#1453](https://github.com/stripe/stripe-node/pull/1453) API Updates
* Add support for `fund_cash_balance` test helper method on resource `Customer`
* Add support for `statement_descriptor_prefix_kana` and `statement_descriptor_prefix_kanji` on `Account.settings.card_payments`, `Account.settings.payments`, `AccountCreateParams.settings.card_payments`, and `AccountUpdateParams.settings.card_payments`
* Add support for `statement_descriptor_suffix_kana` and `statement_descriptor_suffix_kanji` on `Checkout.Session.payment_method_options.card`, `Checkout.SessionCreateParams.payment_method_options.card`, `PaymentIntent.payment_method_options.card`, `PaymentIntentConfirmParams.payment_method_options.card`, `PaymentIntentCreateParams.payment_method_options.card`, and `PaymentIntentUpdateParams.payment_method_options.card`
* Add support for `total_excluding_tax` on `CreditNote`
* Change type of `CustomerCreateParams.invoice_settings.rendering_options` and `CustomerUpdateParams.invoice_settings.rendering_options` from `rendering_options_param` to `emptyStringable(rendering_options_param)`
* Add support for `rendering_options` on `Customer.invoice_settings` and `Invoice`
* [#1452](https://github.com/stripe/stripe-node/pull/1452) Fix non-conforming changelog entries and port the Makefile fix
* [#1450](https://github.com/stripe/stripe-node/pull/1450) Only publish stable version to the latest tag
## 9.8.0 - 2022-06-09
* [#1448](https://github.com/stripe/stripe-node/pull/1448) Add types for extra request options
* [#1446](https://github.com/stripe/stripe-node/pull/1446) API Updates
* Add support for `treasury` on `Account.settings`, `AccountCreateParams.settings`, and `AccountUpdateParams.settings`
* Add support for `rendering_options` on `CustomerCreateParams.invoice_settings` and `CustomerUpdateParams.invoice_settings`
* Add support for `eu_bank_transfer` on `CustomerCreateFundingInstructionsParams.bank_transfer`, `Invoice.payment_settings.payment_method_options.customer_balance.bank_transfer`, `InvoiceCreateParams.payment_settings.payment_method_options.customer_balance.bank_transfer`, `InvoiceUpdateParams.payment_settings.payment_method_options.customer_balance.bank_transfer`, `Order.payment.settings.payment_method_options.customer_balance.bank_transfer`, `OrderCreateParams.payment.settings.payment_method_options.customer_balance.bank_transfer`, `OrderUpdateParams.payment.settings.payment_method_options.customer_balance.bank_transfer`, `PaymentIntent.payment_method_options.customer_balance.bank_transfer`, `PaymentIntentConfirmParams.payment_method_options.customer_balance.bank_transfer`, `PaymentIntentCreateParams.payment_method_options.customer_balance.bank_transfer`, `PaymentIntentUpdateParams.payment_method_options.customer_balance.bank_transfer`, `Subscription.payment_settings.payment_method_options.customer_balance.bank_transfer`, `SubscriptionCreateParams.payment_settings.payment_method_options.customer_balance.bank_transfer`, and `SubscriptionUpdateParams.payment_settings.payment_method_options.customer_balance.bank_transfer`
* Change type of `CustomerCreateFundingInstructionsParams.bank_transfer.requested_address_types[]` from `literal('zengin')` to `enum('iban'|'sort_code'|'spei'|'zengin')`
* Change type of `CustomerCreateFundingInstructionsParams.bank_transfer.type`, `Order.payment.settings.payment_method_options.customer_balance.bank_transfer.type`, `OrderCreateParams.payment.settings.payment_method_options.customer_balance.bank_transfer.type`, `OrderUpdateParams.payment.settings.payment_method_options.customer_balance.bank_transfer.type`, `PaymentIntent.next_action.display_bank_transfer_instructions.type`, `PaymentIntent.payment_method_options.customer_balance.bank_transfer.type`, `PaymentIntentConfirmParams.payment_method_options.customer_balance.bank_transfer.type`, `PaymentIntentCreateParams.payment_method_options.customer_balance.bank_transfer.type`, and `PaymentIntentUpdateParams.payment_method_options.customer_balance.bank_transfer.type` from `literal('jp_bank_transfer')` to `enum('eu_bank_transfer'|'gb_bank_transfer'|'jp_bank_transfer'|'mx_bank_transfer')`
* Add support for `iban`, `sort_code`, and `spei` on `FundingInstructions.bank_transfer.financial_addresses[]` and `PaymentIntent.next_action.display_bank_transfer_instructions.financial_addresses[]`
* Add support for new values `bacs`, `fps`, and `spei` on enums `FundingInstructions.bank_transfer.financial_addresses[].supported_networks[]` and `PaymentIntent.next_action.display_bank_transfer_instructions.financial_addresses[].supported_networks[]`
* Add support for new values `sort_code` and `spei` on enums `FundingInstructions.bank_transfer.financial_addresses[].type` and `PaymentIntent.next_action.display_bank_transfer_instructions.financial_addresses[].type`
* Change type of `Order.payment.settings.payment_method_options.customer_balance.bank_transfer.requested_address_types[]`, `OrderCreateParams.payment.settings.payment_method_options.customer_balance.bank_transfer.requested_address_types[]`, `OrderUpdateParams.payment.settings.payment_method_options.customer_balance.bank_transfer.requested_address_types[]`, `PaymentIntent.payment_method_options.customer_balance.bank_transfer.requested_address_types[]`, `PaymentIntentConfirmParams.payment_method_options.customer_balance.bank_transfer.requested_address_types[]`, `PaymentIntentCreateParams.payment_method_options.customer_balance.bank_transfer.requested_address_types[]`, and `PaymentIntentUpdateParams.payment_method_options.customer_balance.bank_transfer.requested_address_types[]` from `literal('zengin')` to `enum`
* Add support for `custom_unit_amount` on `PriceCreateParams` and `Price`
## 9.7.0 - 2022-06-08
* [#1441](https://github.com/stripe/stripe-node/pull/1441) API Updates
* Add support for `affirm`, `bancontact`, `card`, `ideal`, `p24`, and `sofort` on `Checkout.Session.payment_method_options` and `Checkout.SessionCreateParams.payment_method_options`
* Add support for `afterpay_clearpay`, `au_becs_debit`, `bacs_debit`, `eps`, `fpx`, `giropay`, `grabpay`, `klarna`, `paynow`, and `sepa_debit` on `Checkout.SessionCreateParams.payment_method_options`
* Add support for `setup_future_usage` on `Checkout.Session.payment_method_options.*` and `Checkout.SessionCreateParams.payment_method_options.*`,
* Change `PaymentMethod.us_bank_account.networks` and `SetupIntent.flow_directions` to be required
* Add support for `attach_to_self` on `SetupAttempt`, `SetupIntentCreateParams`, `SetupIntentListParams`, and `SetupIntentUpdateParams`
* Add support for `flow_directions` on `SetupAttempt`, `SetupIntentCreateParams`, and `SetupIntentUpdateParams`
## 9.6.0 - 2022-06-01
* [#1439](https://github.com/stripe/stripe-node/pull/1439) API Updates
* Add support for `radar_options` on `ChargeCreateParams`, `Charge`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentConfirmParams`, `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentCreateParams`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentMethodCreateParams`, `PaymentMethod`, `SetupIntentConfirmParams.payment_method_data`, `SetupIntentCreateParams.payment_method_data`, and `SetupIntentUpdateParams.payment_method_data`
* Add support for `account_holder_name`, `account_number`, `account_type`, `bank_code`, `bank_name`, `branch_code`, and `branch_name` on `FundingInstructions.bank_transfer.financial_addresses[].zengin` and `PaymentIntent.next_action.display_bank_transfer_instructions.financial_addresses[].zengin`
* Add support for new values `en-AU` and `en-NZ` on enums `OrderCreateParams.payment.settings.payment_method_options.klarna.preferred_locale`, `OrderUpdateParams.payment.settings.payment_method_options.klarna.preferred_locale`, `PaymentIntentConfirmParams.payment_method_options.klarna.preferred_locale`, `PaymentIntentCreateParams.payment_method_options.klarna.preferred_locale`, and `PaymentIntentUpdateParams.payment_method_options.klarna.preferred_locale`
* Change type of `Order.payment.settings.payment_method_options.customer_balance.bank_transfer.type` and `PaymentIntent.payment_method_options.customer_balance.bank_transfer.type` from `enum` to `literal('jp_bank_transfer')`
* This is technically breaking in Typescript, but now accurately represents the behavior that was allowed by the server. We haven't historically treated breaking Typescript changes as requiring a major.
* Change `PaymentIntent.next_action.display_bank_transfer_instructions.hosted_instructions_url` to be required
* Add support for `network` on `SetupIntent.payment_method_options.card`
* Add support for new value `simulated_wisepos_e` on enums `Terminal.Reader.device_type` and `Terminal.ReaderListParams.device_type`
## 9.5.0 - 2022-05-26
* [#1434](https://github.com/stripe/stripe-node/pull/1434) API Updates
* Add support for `affirm_payments` and `link_payments` on `Account.capabilities`, `AccountCreateParams.capabilities`, and `AccountUpdateParams.capabilities`
* Add support for `id_number_secondary` on `AccountCreateParams.individual`, `AccountUpdateParams.individual`, `PersonCreateParams`, `PersonUpdateParams`, `TokenCreateParams.account.individual`, and `TokenCreateParams.person`
* Add support for new value `affirm` on enum `Checkout.SessionCreateParams.payment_method_types[]`
* Add support for `hosted_instructions_url` on `PaymentIntent.next_action.display_bank_transfer_instructions`
* Add support for `id_number_secondary_provided` on `Person`
* Add support for `card_issuing` on `Treasury.FinancialAccountCreateParams.features`, `Treasury.FinancialAccountUpdateFeaturesParams`, and `Treasury.FinancialAccountUpdateParams.features`
* [#1432](https://github.com/stripe/stripe-node/pull/1432) docs: Update HttpClient documentation to remove experimental status.
## 9.4.0 - 2022-05-23
* [#1431](https://github.com/stripe/stripe-node/pull/1431) API Updates
* Add support for `treasury` on `Account.capabilities`, `AccountCreateParams.capabilities`, and `AccountUpdateParams.capabilities`
## 9.3.0 - 2022-05-23
* [#1430](https://github.com/stripe/stripe-node/pull/1430) API Updates
* Add support for new resource `Apps.Secret`
* Add support for `affirm` on `Charge.payment_method_details`, `PaymentIntent.payment_method_options`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentConfirmParams.payment_method_options`, `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentMethodCreateParams`, `PaymentMethodUpdateParams`, `PaymentMethod`, `SetupIntentConfirmParams.payment_method_data`, `SetupIntentCreateParams.payment_method_data`, and `SetupIntentUpdateParams.payment_method_data`
* Add support for `link` on `Charge.payment_method_details`, `Mandate.payment_method_details`, `OrderCreateParams.payment.settings.payment_method_options`, `OrderUpdateParams.payment.settings.payment_method_options`, `PaymentIntent.payment_method_options`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentConfirmParams.payment_method_options`, `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentMethodCreateParams`, `PaymentMethodUpdateParams`, `PaymentMethod`, `SetupAttempt.payment_method_details`, `SetupIntent.payment_method_options`, `SetupIntentConfirmParams.payment_method_data`, `SetupIntentConfirmParams.payment_method_options`, `SetupIntentCreateParams.payment_method_data`, `SetupIntentCreateParams.payment_method_options`, `SetupIntentUpdateParams.payment_method_data`, and `SetupIntentUpdateParams.payment_method_options`
* Add support for new values `affirm` and `link` on enums `CustomerListPaymentMethodsParams.type` and `PaymentMethodListParams.type`
* Add support for new value `link` on enums `Invoice.payment_settings.payment_method_types[]`, `InvoiceCreateParams.payment_settings.payment_method_types[]`, `InvoiceUpdateParams.payment_settings.payment_method_types[]`, `Subscription.payment_settings.payment_method_types[]`, `SubscriptionCreateParams.payment_settings.payment_method_types[]`, and `SubscriptionUpdateParams.payment_settings.payment_method_types[]`
* Add support for new values `affirm` and `link` on enums `PaymentIntentConfirmParams.payment_method_data.type`, `PaymentIntentCreateParams.payment_method_data.type`, `PaymentIntentUpdateParams.payment_method_data.type`, `SetupIntentConfirmParams.payment_method_data.type`, `SetupIntentCreateParams.payment_method_data.type`, and `SetupIntentUpdateParams.payment_method_data.type`
* Add support for new values `affirm` and `link` on enum `PaymentMethodCreateParams.type`
* Add support for new values `affirm` and `link` on enum `PaymentMethod.type`
## 9.2.0 - 2022-05-19
* [#1422](https://github.com/stripe/stripe-node/pull/1422) API Updates
* Add support for new `Treasury` APIs: `CreditReversal`, `DebitReversal`, `FinancialAccountFeatures`, `FinancialAccount`, `FlowDetails`, `InboundTransfer`, `OutboundPayment`, `OutboundTransfer`, `ReceivedCredit`, `ReceivedDebit`, `TransactionEntry`, and `Transaction`
* Add support for `treasury` on `Issuing.Authorization`, `Issuing.Dispute`, `Issuing.Transaction`, and `Issuing.DisputeCreateParams`
* Add support for `retrieve_payment_method` method on resource `Customer`
* Add support for `list_owners` and `list` methods on resource `FinancialConnections.Account`
* Change `BillingPortal.ConfigurationCreateParams.features.customer_update.allowed_updates` to be optional
* Change type of `BillingPortal.Session.return_url` from `string` to `nullable(string)`
* Add support for `afterpay_clearpay`, `au_becs_debit`, `bacs_debit`, `eps`, `fpx`, `giropay`, `grabpay`, `klarna`, `paynow`, and `sepa_debit` on `Checkout.Session.payment_method_options`
* Add support for `financial_account` on `Issuing.Card` and `Issuing.CardCreateParams`
* Add support for `client_secret` on `Order`
* Add support for `networks` on `PaymentIntentConfirmParams.payment_method_options.us_bank_account`, `PaymentIntentCreateParams.payment_method_options.us_bank_account`, `PaymentIntentUpdateParams.payment_method_options.us_bank_account`, `PaymentMethod.us_bank_account`, `SetupIntentConfirmParams.payment_method_options.us_bank_account`, `SetupIntentCreateParams.payment_method_options.us_bank_account`, and `SetupIntentUpdateParams.payment_method_options.us_bank_account`
* Add support for `attach_to_self` and `flow_directions` on `SetupIntent`
* Add support for `save_default_payment_method` on `Subscription.payment_settings`, `SubscriptionCreateParams.payment_settings`, and `SubscriptionUpdateParams.payment_settings`
* Add support for `czk` on `Terminal.Configuration.tipping`, `Terminal.ConfigurationCreateParams.tipping`, and `Terminal.ConfigurationUpdateParams.tipping`
## 9.1.0 - 2022-05-11
* [#1420](https://github.com/stripe/stripe-node/pull/1420) API Updates
* Add support for `description` on `Checkout.SessionCreateParams.subscription_data`, `SubscriptionCreateParams`, `SubscriptionUpdateParams`, and `Subscription`
* Add support for `consent_collection`, `payment_intent_data`, `shipping_options`, `submit_type`, and `tax_id_collection` on `PaymentLinkCreateParams` and `PaymentLink`
* Add support for `customer_creation` on `PaymentLinkCreateParams`, `PaymentLinkUpdateParams`, and `PaymentLink`
* Add support for `metadata` on `SubscriptionSchedule.phases[]`, `SubscriptionScheduleCreateParams.phases[]`, and `SubscriptionScheduleUpdateParams.phases[]`
* Add support for new value `billing_portal.session.created` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]`
## 9.0.0 - 2022-05-09
Major version release - The [migration guide](https://github.com/stripe/stripe-node/wiki/Migration-Guide-for-v9) contains a detailed list of backwards-incompatible changes with upgrade instructions.
(⚠️ = breaking changes):
* ⚠️[#1336](https://github.com/stripe/stripe-node/pull/1336) feat(http-client): retry closed connection errors
* [#1415](https://github.com/stripe/stripe-node/pull/1415) [#1417](https://github.com/stripe/stripe-node/pull/1417) API Updates
* ⚠️ Replace the legacy `Order` API with the new `Order` API.
* Resource modified: `Order`.
* New methods: `cancel`, `list_line_items`, `reopen`, and `submit`
* Removed methods: `pay` and `return_order`
* Removed resources: `OrderItem` and `OrderReturn`
* Removed references from other resources: `Charge.order`
* Add support for `amount_discount`, `amount_tax`, and `product` on `LineItem`
* Change type of `Charge.shipping.name`, `Checkout.Session.shipping.name`, `Customer.shipping.name`, `Invoice.customer_shipping.name`, `PaymentIntent.shipping.name`, `ShippingDetails.name`, and `Source.source_order.shipping.name` from `nullable(string)` to `string`
## 8.222.0 - 2022-05-05
* [#1414](https://github.com/stripe/stripe-node/pull/1414) API Updates
* Add support for `default_price_data` on `ProductCreateParams`
* Add support for `default_price` on `ProductUpdateParams` and `Product`
* Add support for `instructions_email` on `RefundCreateParams` and `Refund`
## 8.221.0 - 2022-05-05
* [#1413](https://github.com/stripe/stripe-node/pull/1413) API Updates
* Add support for new resources `FinancialConnections.AccountOwner`, `FinancialConnections.AccountOwnership`, `FinancialConnections.Account`, and `FinancialConnections.Session`
* Add support for `financial_connections` on `Checkout.Session.payment_method_options.us_bank_account`, `Checkout.SessionCreateParams.payment_method_options.us_bank_account`, `Invoice.payment_settings.payment_method_options.us_bank_account`, `InvoiceCreateParams.payment_settings.payment_method_options.us_bank_account`, `InvoiceUpdateParams.payment_settings.payment_method_options.us_bank_account`, `PaymentIntent.payment_method_options.us_bank_account`, `PaymentIntentConfirmParams.payment_method_options.us_bank_account`, `PaymentIntentCreateParams.payment_method_options.us_bank_account`, `PaymentIntentUpdateParams.payment_method_options.us_bank_account`, `SetupIntent.payment_method_options.us_bank_account`, `SetupIntentConfirmParams.payment_method_options.us_bank_account`, `SetupIntentCreateParams.payment_method_options.us_bank_account`, `SetupIntentUpdateParams.payment_method_options.us_bank_account`, `Subscription.payment_settings.payment_method_options.us_bank_account`, `SubscriptionCreateParams.payment_settings.payment_method_options.us_bank_account`, and `SubscriptionUpdateParams.payment_settings.payment_method_options.us_bank_account`
* Add support for `financial_connections_account` on `PaymentIntentConfirmParams.payment_method_data.us_bank_account`, `PaymentIntentCreateParams.payment_method_data.us_bank_account`, `PaymentIntentUpdateParams.payment_method_data.us_bank_account`, `PaymentMethod.us_bank_account`, `PaymentMethodCreateParams.us_bank_account`, `SetupIntentConfirmParams.payment_method_data.us_bank_account`, `SetupIntentCreateParams.payment_method_data.us_bank_account`, and `SetupIntentUpdateParams.payment_method_data.us_bank_account`
* [#1410](https://github.com/stripe/stripe-node/pull/1410) API Updates
* Add support for `registered_address` on `AccountCreateParams.individual`, `AccountUpdateParams.individual`, `PersonCreateParams`, `PersonUpdateParams`, `Person`, `TokenCreateParams.account.individual`, and `TokenCreateParams.person`
* Change type of `PaymentIntent.amount_details.tip.amount` from `nullable(integer)` to `integer`
* Change `PaymentIntent.amount_details.tip.amount` to be optional
* Add support for `payment_method_data` on `SetupIntentConfirmParams`, `SetupIntentCreateParams`, and `SetupIntentUpdateParams`
* [#1409](https://github.com/stripe/stripe-node/pull/1409) Update autoPagination tests to be hermetic.
* [#1411](https://github.com/stripe/stripe-node/pull/1411) Enable CI on beta branch
## 8.220.0 - 2022-05-03
* [#1407](https://github.com/stripe/stripe-node/pull/1407) API Updates
* Add support for new resource `CashBalance`
* Change type of `BillingPortal.Configuration.application` from `$Application` to `deletable($Application)`
* Add support for `alipay` on `Checkout.Session.payment_method_options` and `Checkout.SessionCreateParams.payment_method_options`
* Change type of `Checkout.SessionCreateParams.payment_method_options.konbini.expires_after_days` from `emptyStringable(integer)` to `integer`
* Add support for new value `eu_oss_vat` on enums `Checkout.Session.customer_details.tax_ids[].type`, `Invoice.customer_tax_ids[].type`, and `TaxId.type`
* Add support for new value `eu_oss_vat` on enums `CustomerCreateParams.tax_id_data[].type`, `InvoiceUpcomingLinesParams.customer_details.tax_ids[].type`, `InvoiceUpcomingParams.customer_details.tax_ids[].type`, and `TaxIdCreateParams.type`
* Add support for `cash_balance` on `Customer`
* Add support for `application` on `Invoice`, `Quote`, `SubscriptionSchedule`, and `Subscription`
* [#1403](https://github.com/stripe/stripe-node/pull/1403) Add tests for specifying a custom host on StripeMethod.
## 8.219.0 - 2022-04-21
* [#1398](https://github.com/stripe/stripe-node/pull/1398) API Updates
* Add support for `expire` test helper method on resource `Refund`
* Change type of `BillingPortal.Configuration.application` from `string` to `expandable($Application)`
* Change `Issuing.DisputeCreateParams.transaction` to be optional
## 8.218.0 - 2022-04-18
* [#1396](https://github.com/stripe/stripe-node/pull/1396) API Updates
* Add support for new resources `FundingInstructions` and `Terminal.Configuration`
* Add support for `create_funding_instructions` method on resource `Customer`
* Add support for new value `customer_balance` as a payment method `type`.
* Add support for `customer_balance` on `Charge.payment_method_details`, `PaymentIntent.payment_method_options`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentConfirmParams.payment_method_options`, `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentMethodCreateParams`, and `PaymentMethod`
* Add support for `cash_balance` on `CustomerCreateParams` and `CustomerUpdateParams`
* Add support for `amount_details` on `PaymentIntent`
* Add support for `display_bank_transfer_instructions` on `PaymentIntent.next_action`
* Add support for `configuration_overrides` on `Terminal.Location`, `Terminal.LocationCreateParams`, and `Terminal.LocationUpdateParams`
## 8.217.0 - 2022-04-13
* [#1395](https://github.com/stripe/stripe-node/pull/1395) API Updates
* Add support for `increment_authorization` method on resource `PaymentIntent`
* Add support for `incremental_authorization_supported` on `Charge.payment_method_details.card_present`
* Add support for `request_incremental_authorization_support` on `PaymentIntent.payment_method_options.card_present`, `PaymentIntentConfirmParams.payment_method_options.card_present`, `PaymentIntentCreateParams.payment_method_options.card_present`, and `PaymentIntentUpdateParams.payment_method_options.card_present`
## 8.216.0 - 2022-04-08
* [#1391](https://github.com/stripe/stripe-node/pull/1391) API Updates
* Add support for `apply_customer_balance` method on resource `PaymentIntent`
* Add support for new value `cash_balance.funds_available` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]`
## 8.215.0 - 2022-04-01
* [#1389](https://github.com/stripe/stripe-node/pull/1389) API Updates
* Add support for `bank_transfer_payments` on `Account.capabilities`, `AccountCreateParams.capabilities`, and `AccountUpdateParams.capabilities`
* Add support for `capture_before` on `Charge.payment_method_details.card_present`
* Add support for `address` and `name` on `Checkout.Session.customer_details`
* Add support for `customer_balance` on `Invoice.payment_settings.payment_method_options`, `InvoiceCreateParams.payment_settings.payment_method_options`, `InvoiceUpdateParams.payment_settings.payment_method_options`, `Subscription.payment_settings.payment_method_options`, `SubscriptionCreateParams.payment_settings.payment_method_options`, and `SubscriptionUpdateParams.payment_settings.payment_method_options`
* Add support for new value `customer_balance` on enums `Invoice.payment_settings.payment_method_types[]`, `InvoiceCreateParams.payment_settings.payment_method_types[]`, `InvoiceUpdateParams.payment_settings.payment_method_types[]`, `Subscription.payment_settings.payment_method_types[]`, `SubscriptionCreateParams.payment_settings.payment_method_types[]`, and `SubscriptionUpdateParams.payment_settings.payment_method_types[]`
* Add support for `request_extended_authorization` on `PaymentIntent.payment_method_options.card_present`, `PaymentIntentConfirmParams.payment_method_options.card_present`, `PaymentIntentCreateParams.payment_method_options.card_present`, and `PaymentIntentUpdateParams.payment_method_options.card_present`
* Add support for new values `payment_intent.partially_funded`, `terminal.reader.action_failed`, and `terminal.reader.action_succeeded` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]`
* [#1388](https://github.com/stripe/stripe-node/pull/1388) Stop sending Content-Length header for verbs which don't have bodies.
* Fixes https://github.com/stripe/stripe-node/issues/1360.
## 8.214.0 - 2022-03-30
* [#1386](https://github.com/stripe/stripe-node/pull/1386) API Updates
* Add support for `cancel_action`, `process_payment_intent`, `process_setup_intent`, and `set_reader_display` methods on resource `Terminal.Reader`
* Change `Charge.failure_balance_transaction`, `Invoice.payment_settings.payment_method_options.us_bank_account`, `PaymentIntent.next_action.verify_with_microdeposits.microdeposit_type`, `SetupIntent.next_action.verify_with_microdeposits.microdeposit_type`, and `Subscription.payment_settings.payment_method_options.us_bank_account` to be required
* Add support for `action` on `Terminal.Reader`
## 8.213.0 - 2022-03-28
* [#1383](https://github.com/stripe/stripe-node/pull/1383) API Updates
* Add support for Search API
* Add support for `search` method on resources `Charge`, `Customer`, `Invoice`, `PaymentIntent`, `Price`, `Product`, and `Subscription`
* [#1384](https://github.com/stripe/stripe-node/pull/1384) Bump qs package to latest.
## 8.212.0 - 2022-03-25
* [#1381](https://github.com/stripe/stripe-node/pull/1381) API Updates
* Add support for PayNow and US Bank Accounts Debits payments
* **Charge** ([API ref](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details))
* Add support for `paynow` and `us_bank_account` on `Charge.payment_method_details`
* **Customer** ([API ref](https://stripe.com/docs/api/payment_methods/customer_list#list_customer_payment_methods-type))
* Add support for new values `paynow` and `us_bank_account` on enum `CustomerListPaymentMethodsParams.type`
* **Payment Intent** ([API ref](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method_options))
* Add support for `paynow` and `us_bank_account` on `payment_method_options` on `PaymentIntent`, `PaymentIntentCreateParams`, `PaymentIntentUpdateParams`, and `PaymentIntentConfirmParams`
* Add support for `paynow` and `us_bank_account` on `payment_method_data` on `PaymentIntentCreateParams`, `PaymentIntentUpdateParams`, and `PaymentIntentConfirmParams`
* Add support for `paynow_display_qr_code` on `PaymentIntent.next_action`
* Add support for new values `paynow` and `us_bank_account` on enums `payment_method_data.type` on `PaymentIntentCreateParams`, and `PaymentIntentUpdateParams`, and `PaymentIntentConfirmParams`
* **Setup Intent** ([API ref](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method_options))
* Add support for `us_bank_account` on `payment_method_options` on `SetupIntent`, `SetupIntentCreateParams`, `SetupIntentUpdateParams`, and `SetupIntentConfirmParams`
* **Setup Attempt** ([API ref](https://stripe.com/docs/api/setup_attempts/object#setup_attempt_object-payment_method_details))
* Add support for `us_bank_account` on `SetupAttempt.payment_method_details`
* **Payment Method** ([API ref](https://stripe.com/docs/api/payment_methods/object#payment_method_object-paynow))
* Add support for `paynow` and `us_bank_account` on `PaymentMethod` and `PaymentMethodCreateParams`
* Add support for `us_bank_account` on `PaymentMethodUpdateParams`
* Add support for new values `paynow` and `us_bank_account` on enums `PaymentMethod.type`, `PaymentMethodCreateParams.type`. and `PaymentMethodListParams.type`
* **Checkout Session** ([API ref](https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_method_types))
* Add support for `us_bank_account` on `payment_method_options` on `Checkout.Session` and `Checkout.SessionCreateParams`
* Add support for new values `paynow` and `us_bank_account` on enum `Checkout.SessionCreateParams.payment_method_types[]`
* **Invoice** ([API ref](https://stripe.com/docs/api/invoices/object#invoice_object-payment_settings-payment_method_types))
* Add support for `us_bank_account` on `payment_settings.payment_method_options` on `Invoice`, `InvoiceCreateParams`, and `InvoiceUpdateParams`
* Add support for new values `paynow` and `us_bank_account` on enums `payment_settings.payment_method_types[]` on `Invoice`, `InvoiceCreateParams`, and `InvoiceUpdateParams`
* **Subscription** ([API ref](https://stripe.com/docs/api/subscriptions/object#subscription_object-payment_settings-payment_method_types))
* Add support for `us_bank_account` on `Subscription.payment_settings.payment_method_options`, `SubscriptionCreateParams.payment_settings.payment_method_options`, and `SubscriptionUpdateParams.payment_settings.payment_method_options`
* Add support for new values `paynow` and `us_bank_account` on enums `payment_settings.payment_method_types[]` on `Subscription`, `SubscriptionCreateParams`, and `SubscriptionUpdateParams`
* **Account capabilities** ([API ref](https://stripe.com/docs/api/accounts/object#account_object-capabilities))
* Add support for `paynow_payments` on `capabilities` on `Account`, `AccountCreateParams`, and `AccountUpdateParams`
* Add support for `failure_balance_transaction` on `Charge`
* Add support for `capture_method` on `afterpay_clearpay`, `card`, and `klarna` on `payment_method_options` on
`PaymentIntent`, `PaymentIntentCreateParams`, `PaymentIntentUpdateParams`, and `PaymentIntentConfirmParams` ([API ref](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method_options-afterpay_clearpay-capture_method))
* Add additional support for verify microdeposits on Payment Intent and Setup Intent ([API ref](https://stripe.com/docs/api/payment_intents/verify_microdeposits))
* Add support for `microdeposit_type` on `next_action.verify_with_microdeposits` on `PaymentIntent` and `SetupIntent`
* Add support for `descriptor_code` on `PaymentIntentVerifyMicrodepositsParams` and `SetupIntentVerifyMicrodepositsParams`
* Add support for `test_clock` on `SubscriptionListParams` ([API ref](https://stripe.com/docs/api/subscriptions/list#list_subscriptions-test_clock))
* [#1375](https://github.com/stripe/stripe-node/pull/1375) Update error types to be namespaced under Stripe.error
* [#1380](https://github.com/stripe/stripe-node/pull/1380) Force update minimist dependency
## 8.211.0 - 2022-03-23
* [#1377](https://github.com/stripe/stripe-node/pull/1377) API Updates
* Add support for `cancel` method on resource `Refund`
* Add support for new values `bg_uic`, `hu_tin`, and `si_tin` on enums `Checkout.Session.customer_details.tax_ids[].type`, `Invoice.customer_tax_ids[].type`, and `TaxId.type`
* Add support for new values `bg_uic`, `hu_tin`, and `si_tin` on enums `CustomerCreateParams.tax_id_data[].type`, `InvoiceUpcomingLinesParams.customer_details.tax_ids[].type`, `InvoiceUpcomingParams.customer_details.tax_ids[].type`, and `TaxIdCreateParams.type`
* Change `InvoiceCreateParams.customer` to be optional
* Add support for `test_clock` on `QuoteListParams`
* Add support for new values `test_helpers.test_clock.advancing`, `test_helpers.test_clock.created`, `test_helpers.test_clock.deleted`, `test_helpers.test_clock.internal_failure`, and `test_helpers.test_clock.ready` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]`
## 8.210.0 - 2022-03-18
* [#1372](https://github.com/stripe/stripe-node/pull/1372) API Updates
* Add support for `status` on `Card`
## 8.209.0 - 2022-03-11
* [#1368](https://github.com/stripe/stripe-node/pull/1368) API Updates
* Add support for `mandate` on `Charge.payment_method_details.card`
* Add support for `mandate_options` on `PaymentIntentCreateParams.payment_method_options.card`, `PaymentIntentUpdateParams.payment_method_options.card`, `PaymentIntentConfirmParams.payment_method_options.card`, `PaymentIntent.payment_method_options.card`, `SetupIntentCreateParams.payment_method_options.card`, `SetupIntentUpdateParams.payment_method_options.card`, `SetupIntentConfirmParams.payment_method_options.card`, and `SetupIntent.payment_method_options.card`
* Add support for `card_await_notification` on `PaymentIntent.next_action`
* Add support for `customer_notification` on `PaymentIntent.processing.card`
* Change `PaymentLinkCreateParams.line_items` to be required, and change `PaymentLink.create` to require `PaymentLinkCreateParams`
* [#1364](https://github.com/stripe/stripe-node/pull/1364) Update search pagination to use page param instead of next_page.
## 8.208.0 - 2022-03-09
* [#1366](https://github.com/stripe/stripe-node/pull/1366) API Updates
* Add support for `test_clock` on `CustomerListParams`
* Change `Invoice.test_clock`, `InvoiceItem.test_clock`, `Quote.test_clock`, `Subscription.test_clock`, and `SubscriptionSchedule.test_clock` to be required
## 8.207.0 - 2022-03-02
* [#1363](https://github.com/stripe/stripe-node/pull/1363) API Updates
* Add support for new resources `CreditedItems` and `ProrationDetails`
* Add support for `proration_details` on `InvoiceLineItem`
## 8.206.0 - 2022-03-01
* [#1361](https://github.com/stripe/stripe-node/pull/1361) [#1362](https://github.com/stripe/stripe-node/pull/1362) API Updates
* Add support for new resource `TestHelpers.TestClock`
* Add support for `test_clock` on `CustomerCreateParams`, `Customer`, `Invoice`, `InvoiceItem`, `QuoteCreateParams`, `Quote`, `Subscription`, and `SubscriptionSchedule`
* Add support for `pending_invoice_items_behavior` on `InvoiceCreateParams`
* Change type of `ProductUpdateParams.url` from `string` to `emptyStringable(string)`
* Add support for `next_action` on `Refund`
## 8.205.0 - 2022-02-25
* [#1098](https://github.com/stripe/stripe-node/pull/1098) Typescript: add declaration for `onDone` on `autoPagingEach`
* [#1357](https://github.com/stripe/stripe-node/pull/1357) Properly handle API errors with unknown error types
* [#1359](https://github.com/stripe/stripe-node/pull/1359) API Updates
* Change `BillingPortal.Configuration` `.business_profile.privacy_policy_url` and `.business_profile.terms_of_service_url` to be optional on requests and responses
* Add support for `konbini_payments` on `AccountUpdateParams.capabilities`, `AccountCreateParams.capabilities`, and `Account.capabilities`
* Add support for `konbini` on `Charge.payment_method_details`,
* Add support for `.payment_method_options.konbini` and `.payment_method_data.konbini` on the `PaymentIntent` API.
* Add support for `.payment_settings.payment_method_options.konbini` on the `Invoice` API.
* Add support for `.payment_method_options.konbini` on the `Subscription` API
* Add support for `.payment_method_options.konbini` on the `Checkout.Session` API
* Add support for `konbini` on the `PaymentMethod` API.
* Add support for `konbini_display_details` on `PaymentIntent.next_action`
* [#1311](https://github.com/stripe/stripe-node/pull/1311) update documentation to use appInfo
## 8.204.0 - 2022-02-23
* [#1354](https://github.com/stripe/stripe-node/pull/1354) API Updates
* Add support for `setup_future_usage` on `PaymentIntentCreateParams.payment_method_options.*`
* Add support for new values `bbpos_wisepad3` and `stripe_m2` on enums `Terminal.ReaderListParams.device_type` and `Terminal.Reader.device_type`
* Add support for `object` on `ExternalAccountListParams` (fixes #1351)
## 8.203.0 - 2022-02-15
* [#1350](https://github.com/stripe/stripe-node/pull/1350) API Updates
* Add support for `verify_microdeposits` method on resources `PaymentIntent` and `SetupIntent`
* Add support for new value `grabpay` on enums `InvoiceCreateParams.payment_settings.payment_method_types[]`, `InvoiceUpdateParams.payment_settings.payment_method_types[]`, `Invoice.payment_settings.payment_method_types[]`, `SubscriptionCreateParams.payment_settings.payment_method_types[]`, `SubscriptionUpdateParams.payment_settings.payment_method_types[]`, and `Subscription.payment_settings.payment_method_types[]`
* [#1348](https://github.com/stripe/stripe-node/pull/1348) API Updates
* Add support for `pin` on `Issuing.CardUpdateParams`
## 8.202.0 - 2022-02-03
* [#1344](https://github.com/stripe/stripe-node/pull/1344) API Updates
* Add support for new value `au_becs_debit` on enum `Checkout.SessionCreateParams.payment_method_types[]`
* Change type of `Refund.reason` from `string` to `enum('duplicate'|'expired_uncaptured_charge'|'fraudulent'|'requested_by_customer')`
## 8.201.0 - 2022-01-28
* [#1342](https://github.com/stripe/stripe-node/pull/1342) Bump nanoid from 3.1.20 to 3.2.0.
* [#1335](https://github.com/stripe/stripe-node/pull/1335) Fix StripeResource to successfully import TIMEOUT_ERROR_CODE.
* [#1339](https://github.com/stripe/stripe-node/pull/1339) Bump node-fetch from 2.6.2 to 2.6.7
## 8.200.0 - 2022-01-25
* [#1338](https://github.com/stripe/stripe-node/pull/1338) API Updates
* Change `Checkout.Session.payment_link` to be required
* Add support for `phone_number_collection` on `PaymentLinkCreateParams` and `PaymentLink`
* Add support for new values `payment_link.created` and `payment_link.updated` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]`
* Add support for new value `is_vat` on enums `Checkout.Session.customer_details.tax_ids[].type`, `Invoice.customer_tax_ids[].type`, and `TaxId.type`
* Add support for new value `is_vat` on enums `CustomerCreateParams.tax_id_data[].type`, `InvoiceUpcomingParams.customer_details.tax_ids[].type`, `InvoiceUpcomingLinesParams.customer_details.tax_ids[].type`, and `TaxIdCreateParams.type`
* [#1333](https://github.com/stripe/stripe-node/pull/1333) Customer tax_ids is not included by default
## 8.199.0 - 2022-01-20
* [#1332](https://github.com/stripe/stripe-node/pull/1332) API Updates
* Add support for new resource `PaymentLink`
* Add support for `payment_link` on `Checkout.Session`
## 8.198.0 - 2022-01-19
* [#1331](https://github.com/stripe/stripe-node/pull/1331) API Updates
* Change type of `Charge.status` from `string` to `enum('failed'|'pending'|'succeeded')`
* Add support for `bacs_debit` and `eps` on `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentIntentConfirmParams.payment_method_options`, and `PaymentIntent.payment_method_options`
* Add support for `image_url_png` and `image_url_svg` on `PaymentIntent.next_action.wechat_pay_display_qr_code`
## 8.197.0 - 2022-01-13
* [#1329](https://github.com/stripe/stripe-node/pull/1329) API Updates
* Add support for `paid_out_of_band` on `Invoice`
## 8.196.0 - 2022-01-12
* [#1328](https://github.com/stripe/stripe-node/pull/1328) API Updates
* Add support for `customer_creation` on `Checkout.SessionCreateParams` and `Checkout.Session`
* Add support for `fpx` and `grabpay` on `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentIntentConfirmParams.payment_method_options`, and `PaymentIntent.payment_method_options`
* [#1315](https://github.com/stripe/stripe-node/pull/1315) API Updates
* Add support for `mandate_options` on `SubscriptionCreateParams.payment_settings.payment_method_options.card`, `SubscriptionUpdateParams.payment_settings.payment_method_options.card`, and `Subscription.payment_settings.payment_method_options.card`
* [#1327](https://github.com/stripe/stripe-node/pull/1327) Remove DOM type references.
* [#1325](https://github.com/stripe/stripe-node/pull/1325) Add comment documenting makeRequest#headers type.
## 8.195.0 - 2021-12-22
* [#1314](https://github.com/stripe/stripe-node/pull/1314) API Updates
* Add support for `au_becs_debit` on `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentIntentConfirmParams.payment_method_options`, and `PaymentIntent.payment_method_options`
* Change type of `PaymentIntent.processing.type` from `string` to `literal('card')`. This is not considered a breaking change as the field was added in the same release.
* [#1313](https://github.com/stripe/stripe-node/pull/1313) API Updates
* Add support for new values `en-FR`, `es-US`, and `fr-FR` on enums `PaymentIntentCreateParams.payment_method_options.klarna.preferred_locale`, `PaymentIntentUpdateParams.payment_method_options.klarna.preferred_locale`, and `PaymentIntentConfirmParams.payment_method_options.klarna.preferred_locale`
* Add support for `boleto` on `SetupAttempt.payment_method_details`
* [#1312](https://github.com/stripe/stripe-node/pull/1312) API Updates
* Add support for `processing` on `PaymentIntent`
## 8.194.0 - 2021-12-15
* [#1309](https://github.com/stripe/stripe-node/pull/1309) API Updates
* Add support for new resource `PaymentIntentTypeSpecificPaymentMethodOptionsClient`
* Add support for `setup_future_usage` on `PaymentIntentCreateParams.payment_method_options.card`, `PaymentIntentUpdateParams.payment_method_options.card`, `PaymentIntentConfirmParams.payment_method_options.card`, and `PaymentIntent.payment_method_options.card`
## 8.193.0 - 2021-12-09
* [#1308](https://github.com/stripe/stripe-node/pull/1308) API Updates
* Add support for `metadata` on `BillingPortal.ConfigurationCreateParams`, `BillingPortal.ConfigurationUpdateParams`, and `BillingPortal.Configuration`
## 8.192.0 - 2021-12-09
* [#1307](https://github.com/stripe/stripe-node/pull/1307) API Updates
* Add support for new values `ge_vat` and `ua_vat` on enums `Checkout.Session.customer_details.tax_ids[].type`, `Invoice.customer_tax_ids[].type`, and `TaxId.type`
* Add support for new values `ge_vat` and `ua_vat` on enums `CustomerCreateParams.tax_id_data[].type`, `InvoiceUpcomingParams.customer_details.tax_ids[].type`, `InvoiceUpcomingLinesParams.customer_details.tax_ids[].type`, and `TaxIdCreateParams.type`
* Change type of `PaymentIntentCreateParams.payment_method_data.billing_details.email`, `PaymentIntentUpdateParams.payment_method_data.billing_details.email`, `PaymentIntentConfirmParams.payment_method_data.billing_details.email`, `PaymentMethodCreateParams.billing_details.email`, and `PaymentMethodUpdateParams.billing_details.email` from `string` to `emptyStringable(string)`
* Add support for `giropay` on `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentIntentConfirmParams.payment_method_options`, and `PaymentIntent.payment_method_options`
* Add support for new value `en-IE` on enums `PaymentIntentCreateParams.payment_method_options.klarna.preferred_locale`, `PaymentIntentUpdateParams.payment_method_options.klarna.preferred_locale`, and `PaymentIntentConfirmParams.payment_method_options.klarna.preferred_locale`
* [#1301](https://github.com/stripe/stripe-node/pull/1301) Remove coveralls from package.json
* [#1300](https://github.com/stripe/stripe-node/pull/1300) Fix broken link in docstring
## 8.191.0 - 2021-11-19
* [#1299](https://github.com/stripe/stripe-node/pull/1299) API Updates
* Add support for `wallets` on `Issuing.Card`
* [#1298](https://github.com/stripe/stripe-node/pull/1298) API Updates
* Add support for `interac_present` on `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentIntentConfirmParams.payment_method_options`, and `PaymentIntent.payment_method_options`
* Add support for new value `jct` on enums `TaxRateCreateParams.tax_type`, `TaxRateUpdateParams.tax_type`, and `TaxRate.tax_type`
## 8.190.0 - 2021-11-17
* [#1297](https://github.com/stripe/stripe-node/pull/1297) API Updates
* Add support for `automatic_payment_methods` on `PaymentIntentCreateParams` and `PaymentIntent`
## 8.189.0 - 2021-11-16
* [#1295](https://github.com/stripe/stripe-node/pull/1295) API Updates
* Add support for new resource `ShippingRate`
* Add support for `shipping_options` on `Checkout.SessionCreateParams` and `Checkout.Session`
* Add support for `shipping_rate` on `Checkout.Session`
## 8.188.0 - 2021-11-12
* [#1293](https://github.com/stripe/stripe-node/pull/1293) API Updates
* Add support for new value `agrobank` on enums `Charge.payment_method_details.fpx.bank`, `PaymentIntentCreateParams.payment_method_data.fpx.bank`, `PaymentIntentUpdateParams.payment_method_data.fpx.bank`, `PaymentIntentConfirmParams.payment_method_data.fpx.bank`, `PaymentMethodCreateParams.fpx.bank`, and `PaymentMethod.fpx.bank`
## 8.187.0 - 2021-11-11
* [#1292](https://github.com/stripe/stripe-node/pull/1292) API Updates
* Add support for `expire` method on resource `Checkout.Session`
* Add support for `status` on `Checkout.Session`
* [#1288](https://github.com/stripe/stripe-node/pull/1288) Add SubtleCryptoProvider and update Webhooks to allow async crypto.
* [#1291](https://github.com/stripe/stripe-node/pull/1291) Better types in `lib.d.ts`
## 8.186.1 - 2021-11-04
* [#1284](https://github.com/stripe/stripe-node/pull/1284) API Updates
* Remove support for `ownership_declaration_shown_and_signed` on `TokenCreateParams.account`. This API was unused.
* Add support for `ownership_declaration_shown_and_signed` on `TokenCreateParams.account.company`
## 8.186.0 - 2021-11-01
* [#1283](https://github.com/stripe/stripe-node/pull/1283) API Updates
* Add support for `ownership_declaration` on `AccountUpdateParams.company`, `AccountCreateParams.company`, `Account.company`, and `TokenCreateParams.account.company`
* Add support for `proof_of_registration` on `AccountUpdateParams.documents` and `AccountCreateParams.documents`
* Add support for `ownership_declaration_shown_and_signed` on `TokenCreateParams.account`
## 8.185.0 - 2021-11-01
* [#1282](https://github.com/stripe/stripe-node/pull/1282) API Updates
* Change type of `AccountUpdateParams.individual.full_name_aliases`, `AccountCreateParams.individual.full_name_aliases`, `PersonCreateParams.full_name_aliases`, `PersonUpdateParams.full_name_aliases`, `TokenCreateParams.account.individual.full_name_aliases`, and `TokenCreateParams.person.full_name_aliases` from `array(string)` to `emptyStringable(array(string))`
* Add support for new values `en-BE`, `en-ES`, and `en-IT` on enums `PaymentIntentCreateParams.payment_method_options.klarna.preferred_locale`, `PaymentIntentUpdateParams.payment_method_options.klarna.preferred_locale`, and `PaymentIntentConfirmParams.payment_method_options.klarna.preferred_locale`
## 8.184.0 - 2021-10-20
* [#1276](https://github.com/stripe/stripe-node/pull/1276) API Updates
* Change `Account.controller.type` to be required
* Add support for `buyer_id` on `Charge.payment_method_details.alipay`
* [#1273](https://github.com/stripe/stripe-node/pull/1273) Add typed createFetchHttpClient function.
## 8.183.0 - 2021-10-15
* [#1272](https://github.com/stripe/stripe-node/pull/1272) API Updates
* Change type of `UsageRecordCreateParams.timestamp` from `integer` to `literal('now') | integer`
* Change `UsageRecordCreateParams.timestamp` to be optional
## 8.182.0 - 2021-10-14
* [#1271](https://github.com/stripe/stripe-node/pull/1271) API Updates
* Change `Charge.payment_method_details.klarna.payment_method_category`, `Charge.payment_method_details.klarna.preferred_locale`, `Checkout.Session.customer_details.phone`, and `PaymentMethod.klarna.dob` to be required
* Add support for new value `klarna` on enum `Checkout.SessionCreateParams.payment_method_types[]`
## 8.181.0 - 2021-10-11
* [#1269](https://github.com/stripe/stripe-node/pull/1269) API Updates
* Add support for `payment_method_category` and `preferred_locale` on `Charge.payment_method_details.klarna`
* Add support for new value `klarna` on enums `CustomerListPaymentMethodsParams.type` and `PaymentMethodListParams.type`
* Add support for `klarna` on `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentConfirmParams.payment_method_options`, `PaymentIntent.payment_method_options`, `PaymentMethodCreateParams`, and `PaymentMethod`
* Add support for new value `klarna` on enums `PaymentIntentCreateParams.payment_method_data.type`, `PaymentIntentUpdateParams.payment_method_data.type`, and `PaymentIntentConfirmParams.payment_method_data.type`
* Add support for new value `klarna` on enum `PaymentMethodCreateParams.type`
* Add support for new value `klarna` on enum `PaymentMethod.type`
## 8.180.0 - 2021-10-11
* [#1266](https://github.com/stripe/stripe-node/pull/1266) API Updates
* Add support for `list_payment_methods` method on resource `Customer`
## 8.179.0 - 2021-10-07
* [#1265](https://github.com/stripe/stripe-node/pull/1265) API Updates
* Add support for `phone_number_collection` on `Checkout.SessionCreateParams` and `Checkout.Session`
* Add support for `phone` on `Checkout.Session.customer_details`
* Change `PaymentMethodListParams.customer` to be optional
* Add support for new value `customer_id` on enums `Radar.ValueListCreateParams.item_type` and `Radar.ValueList.item_type`
* Add support for new value `bbpos_wisepos_e` on enums `Terminal.ReaderListParams.device_type` and `Terminal.Reader.device_type`
## 8.178.0 - 2021-09-29
* [#1261](https://github.com/stripe/stripe-node/pull/1261) API Updates
* Add support for `klarna_payments` on `AccountUpdateParams.capabilities`, `AccountCreateParams.capabilities`, and `Account.capabilities`
## 8.177.0 - 2021-09-28
* [#1257](https://github.com/stripe/stripe-node/pull/1257) API Updates
* Add support for `amount_authorized` and `overcapture_supported` on `Charge.payment_method_details.card_present`
* [#1256](https://github.com/stripe/stripe-node/pull/1256) Bump up ansi-regex version to 5.0.1.
* [#1253](https://github.com/stripe/stripe-node/pull/1253) Update FetchHttpClient to make fetch function optional.
## 8.176.0 - 2021-09-16
* [#1248](https://github.com/stripe/stripe-node/pull/1248) API Updates
* Add support for `full_name_aliases` on `AccountUpdateParams.individual`, `AccountCreateParams.individual`, `PersonCreateParams`, `PersonUpdateParams`, `Person`, `TokenCreateParams.account.individual`, and `TokenCreateParams.person`
* [#1247](https://github.com/stripe/stripe-node/pull/1247) Update README.md
* [#1245](https://github.com/stripe/stripe-node/pull/1245) Fix StripeResource.extend type
## 8.175.0 - 2021-09-15
* [#1242](https://github.com/stripe/stripe-node/pull/1242) API Updates
* Change `BillingPortal.Configuration.features.subscription_cancel.cancellation_reason` to be required
* Add support for `default_for` on `Checkout.SessionCreateParams.payment_method_options.acss_debit.mandate_options`, `Checkout.Session.payment_method_options.acss_debit.mandate_options`, `Mandate.payment_method_details.acss_debit`, `SetupIntentCreateParams.payment_method_options.acss_debit.mandate_options`, `SetupIntentUpdateParams.payment_method_options.acss_debit.mandate_options`, `SetupIntentConfirmParams.payment_method_options.acss_debit.mandate_options`, and `SetupIntent.payment_method_options.acss_debit.mandate_options`
* Add support for `acss_debit` on `InvoiceCreateParams.payment_settings.payment_method_options`, `InvoiceUpdateParams.payment_settings.payment_method_options`, `Invoice.payment_settings.payment_method_options`, `SubscriptionCreateParams.payment_settings.payment_method_options`, `SubscriptionUpdateParams.payment_settings.payment_method_options`, and `Subscription.payment_settings.payment_method_options`
* Add support for new value `acss_debit` on enums `InvoiceCreateParams.payment_settings.payment_method_types[]`, `InvoiceUpdateParams.payment_settings.payment_method_types[]`, `Invoice.payment_settings.payment_method_types[]`, `SubscriptionCreateParams.payment_settings.payment_method_types[]`, `SubscriptionUpdateParams.payment_settings.payment_method_types[]`, and `Subscription.payment_settings.payment_method_types[]`
* Add support for `livemode` on `Reporting.ReportType`
* [#1235](https://github.com/stripe/stripe-node/pull/1235) API Updates
* Change `Account.future_requirements.alternatives`, `Account.requirements.alternatives`, `Capability.future_requirements.alternatives`, `Capability.requirements.alternatives`, `Checkout.Session.after_expiration`, `Checkout.Session.consent`, `Checkout.Session.consent_collection`, `Checkout.Session.expires_at`, `Checkout.Session.recovered_from`, `Person.future_requirements.alternatives`, and `Person.requirements.alternatives` to be required
* Change type of `Capability.future_requirements.alternatives`, `Capability.requirements.alternatives`, `Person.future_requirements.alternatives`, and `Person.requirements.alternatives` from `array(AccountRequirementsAlternative)` to `nullable(array(AccountRequirementsAlternative))`
* Add support for new value `rst` on enums `TaxRateCreateParams.tax_type`, `TaxRateUpdateParams.tax_type`, and `TaxRate.tax_type`
* Add support for new value `checkout.session.expired` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]`
* [#1237](https://github.com/stripe/stripe-node/pull/1237) Add a CryptoProvider interface and NodeCryptoProvider implementation.
* [#1236](https://github.com/stripe/stripe-node/pull/1236) Add an HTTP client which uses fetch.
## 8.174.0 - 2021-09-01
* [#1231](https://github.com/stripe/stripe-node/pull/1231) API Updates
* Add support for `future_requirements` on `Account`, `Capability`, and `Person`
* Add support for `alternatives` on `Account.requirements`, `Capability.requirements`, and `Person.requirements`
## 8.173.0 - 2021-09-01
* [#1230](https://github.com/stripe/stripe-node/pull/1230) [#1228](https://github.com/stripe/stripe-node/pull/1228) API Updates
* Add support for `after_expiration`, `consent_collection`, and `expires_at` on `Checkout.SessionCreateParams` and `Checkout.Session`
* Add support for `consent` and `recovered_from` on `Checkout.Session`
## 8.172.0 - 2021-08-31
* [#1198](https://github.com/stripe/stripe-node/pull/1198) Add support for paginting SearchResult objects.
## 8.171.0 - 2021-08-27
* [#1226](https://github.com/stripe/stripe-node/pull/1226) API Updates
* Add support for `cancellation_reason` on `BillingPortal.ConfigurationCreateParams.features.subscription_cancel`, `BillingPortal.ConfigurationUpdateParams.features.subscription_cancel`, and `BillingPortal.Configuration.features.subscription_cancel`
## 8.170.0 - 2021-08-19
* [#1223](https://github.com/stripe/stripe-node/pull/1223) API Updates
* Add support for new value `fil` on enums `Checkout.SessionCreateParams.locale` and `Checkout.Session.locale`
* Add support for new value `au_arn` on enums `Checkout.Session.customer_details.tax_ids[].type`, `Invoice.customer_tax_ids[].type`, and `TaxId.type`
* Add support for new value `au_arn` on enums `CustomerCreateParams.tax_id_data[].type`, `InvoiceUpcomingParams.customer_details.tax_ids[].type`, `InvoiceUpcomingLinesParams.customer_details.tax_ids[].type`, and `TaxIdCreateParams.type`
* [#1221](https://github.com/stripe/stripe-node/pull/1221) Add client name property to HttpClient.
* [#1219](https://github.com/stripe/stripe-node/pull/1219) Update user agent computation to handle environments without process.
* [#1218](https://github.com/stripe/stripe-node/pull/1218) Add an HttpClient interface and NodeHttpClient implementation.
* [#1217](https://github.com/stripe/stripe-node/pull/1217) Update nock.
## 8.169.0 - 2021-08-11
* [#1215](https://github.com/stripe/stripe-node/pull/1215) API Updates
* Add support for `locale` on `BillingPortal.SessionCreateParams` and `BillingPortal.Session`
* Change type of `Invoice.collection_method` and `Subscription.collection_method` from `nullable(enum('charge_automatically'|'send_invoice'))` to `enum('charge_automatically'|'send_invoice')`
## 8.168.0 - 2021-08-04
* [#1211](https://github.com/stripe/stripe-node/pull/1211) API Updates
* Change type of `PaymentIntentCreateParams.payment_method_options.sofort.preferred_language`, `PaymentIntentUpdateParams.payment_method_options.sofort.preferred_language`, and `PaymentIntentConfirmParams.payment_method_options.sofort.preferred_language` from `enum` to `emptyStringable(enum)`
* Change `Price.tax_behavior`, `Product.tax_code`, `Quote.automatic_tax`, and `TaxRate.tax_type` to be required
## 8.167.0 - 2021-07-28
* [#1206](https://github.com/stripe/stripe-node/pull/1206) Fix Typescript definition for `StripeResource.LastResponse.headers`
* [#1205](https://github.com/stripe/stripe-node/pull/1205) Prevent concurrent initial `uname` invocations
* [#1199](https://github.com/stripe/stripe-node/pull/1199) Explicitly define basic method specs
* [#1200](https://github.com/stripe/stripe-node/pull/1200) Add support for `fullPath` on method specs
## 8.166.0 - 2021-07-28
* [#1203](https://github.com/stripe/stripe-node/pull/1203) API Updates
* Bugfix: add missing autopagination methods to `Quote.listLineItems` and `Quote.listComputedUpfrontLineItems`
* Add support for `account_type` on `BankAccount`, `ExternalAccountUpdateParams`, and `TokenCreateParams.bank_account`
* Add support for `category_code` on `Issuing.Authorization.merchant_data` and `Issuing.Transaction.merchant_data`
* Add support for new value `redacted` on enum `Review.closed_reason`
* Remove duplicate type definition for `Account.retrieve`.
* Fix some `attributes` fields mistakenly defined as `Stripe.Metadata`
* [#1097](https://github.com/stripe/stripe-node/pull/1097) fix error arguments
## 8.165.0 - 2021-07-22
* [#1197](https://github.com/stripe/stripe-node/pull/1197) API Updates
* Add support for new values `hr`, `ko`, and `vi` on enums `Checkout.SessionCreateParams.locale` and `Checkout.Session.locale`
* Add support for `payment_settings` on `SubscriptionCreateParams`, `SubscriptionUpdateParams`, and `Subscription`
## 8.164.0 - 2021-07-20
* [#1196](https://github.com/stripe/stripe-node/pull/1196) API Updates
* Remove support for values `api_connection_error`, `authentication_error`, and `rate_limit_error` from enums `StripeError.type`, `StripeErrorResponse.error.type`, `Invoice.last_finalization_error.type`, `PaymentIntent.last_payment_error.type`, `SetupAttempt.setup_error.type`, and `SetupIntent.last_setup_error.type`
* Add support for `wallet` on `Issuing.Transaction`
* Add support for `ideal` on `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentIntentConfirmParams.payment_method_options`, and `PaymentIntent.payment_method_options`
## 8.163.0 - 2021-07-15
* [#1102](https://github.com/stripe/stripe-node/pull/1102), [#1191](https://github.com/stripe/stripe-node/pull/1191) Add support for `stripeAccount` when initializing the client
## 8.162.0 - 2021-07-14
* [#1194](https://github.com/stripe/stripe-node/pull/1194) API Updates
* Add support for `quote.accepted`, `quote.canceled`, `quote.created`, and `quote.finalized` events.
* [#1190](https://github.com/stripe/stripe-node/pull/1190) API Updates
* Add support for `list_computed_upfront_line_items` method on resource `Quote`
* [#1192](https://github.com/stripe/stripe-node/pull/1192) Update links to Stripe.js docs
## 8.161.0 - 2021-07-09
* [#1188](https://github.com/stripe/stripe-node/pull/1188) API Updates
* Add support for new resource `Quote`
* Add support for `quote` on `Invoice`
* Add support for new value `quote_accept` on enum `Invoice.billing_reason`
* Changed type of `Charge.payment_method_details.card.three_d_secure.result`, `SetupAttempt.payment_method_details.card.three_d_secure.result`, `Charge.payment_method_details.card.three_d_secure.version`, and `SetupAttempt.payment_method_details.card.three_d_secure.version` to be nullable.
* [#1187](https://github.com/stripe/stripe-node/pull/1187) Bugfix in binary streaming support
## 8.160.0 - 2021-06-30
* [#1182](https://github.com/stripe/stripe-node/pull/1182) API Updates
* Add support for new value `boleto` on enums `InvoiceCreateParams.payment_settings.payment_method_types[]`, `InvoiceUpdateParams.payment_settings.payment_method_types[]`, and `Invoice.payment_settings.payment_method_types[]`.
## 8.159.0 - 2021-06-30
* [#1180](https://github.com/stripe/stripe-node/pull/1180) API Updates
* Add support for `wechat_pay` on `Charge.payment_method_details`, `Checkout.SessionCreateParams.payment_method_options`, `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentConfirmParams.payment_method_options`, `PaymentIntent.payment_method_options`, `PaymentMethodCreateParams`, and `PaymentMethod`
* Add support for new value `wechat_pay` on enums `Checkout.SessionCreateParams.payment_method_types[]`, `InvoiceCreateParams.payment_settings.payment_method_types[]`, `InvoiceUpdateParams.payment_settings.payment_method_types[]`, `Invoice.payment_settings.payment_method_types[]`, `PaymentIntentCreateParams.payment_method_data.type`, `PaymentIntentUpdateParams.payment_method_data.type`, `PaymentIntentConfirmParams.payment_method_data.type`, `PaymentMethodCreateParams.type`, `PaymentMethodListParams.type`, and `PaymentMethod.type`
* Add support for `wechat_pay_display_qr_code`, `wechat_pay_redirect_to_android_app`, and `wechat_pay_redirect_to_ios_app` on `PaymentIntent.next_action`
## 8.158.0 - 2021-06-29
* [#1179](https://github.com/stripe/stripe-node/pull/1179) API Updates
* Added support for `boleto_payments` on `Account.capabilities`
* Added support for `boleto` and `oxxo` on `Checkout.SessionCreateParams.payment_method_options` and `Checkout.Session.payment_method_options`
* Added support for `boleto` and `oxxo` as members of the `type` enum inside `Checkout.SessionCreateParams.payment_method_types[]`.
## 8.157.0 - 2021-06-25
* [#1177](https://github.com/stripe/stripe-node/pull/1177) API Updates
* Added support for `boleto` on `PaymentMethodCreateParams`, `PaymentIntent.payment_method_options`, `PaymentIntentConfirmParams.payment_method_options`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentCreateParams.payment_method_data`, `Charge.payment_method_details` and `PaymentMethod`
* `PaymentMethodListParams.type`, `PaymentMethodCreateParams.type`, `PaymentIntentConfirmParams.payment_method_data.type`, `PaymentIntentUpdateParams.payment_method_data.type`, `PaymentIntentCreataParams.payment_method_data.type` and `PaymentMethod.type` added new enum members: `boleto`
* Added support for `boleto_display_details` on `PaymentIntent.next_action`
* `TaxIdCreateParams.type`, `Invoice.customer_tax_ids[].type`, `InvoiceLineItemListUpcomingParams.customer_details.tax_ids[].type`, `InvoiceUpcomingParams.customer_details.tax_ids[].type`, `CustomerCreateParams.tax_id_data[].type`, `Checkout.Session.customer_details.tax_ids[].type` and `TaxId.type` added new enum members: `il_vat`.
* [#1157](https://github.com/stripe/stripe-node/pull/1157) Add support for streaming requests
## 8.156.0 - 2021-06-18
* [#1175](https://github.com/stripe/stripe-node/pull/1175) API Updates
* Add support for new TaxId types: `ca_pst_mb`, `ca_pst_bc`, `ca_gst_hst`, and `ca_pst_sk`.
## 8.155.0 - 2021-06-16
* [#1173](https://github.com/stripe/stripe-node/pull/1173) API Updates
* Add support for `url` on Checkout `Session`.
## 8.154.0 - 2021-06-07
* [#1170](https://github.com/stripe/stripe-node/pull/1170) API Updates
* Added support for `tax_id_collection` on Checkout `Session.tax_id_collection` and `SessionCreateParams`
* Update `Terminal.Reader.location` to be expandable (TypeScript breaking change)
## 8.153.0 - 2021-06-04
* [#1168](https://github.com/stripe/stripe-node/pull/1168) API Updates
* Add support for `controller` on `Account`.
## 8.152.0 - 2021-06-04
* [#1167](https://github.com/stripe/stripe-node/pull/1167) API Updates
* Add support for new resource `TaxCode`.
* Add support for `tax_code` on `Product`, `ProductCreateParams`, `ProductUpdateParams`, `PriceCreateParams.product_data`, `PlanCreateParams.product`, and Checkout `SessionCreateParams.line_items[].price_data.product_data`.
* Add support for `tax` to `Customer`, `CustomerCreateParams`, `CustomerUpdateParams`.
* Add support for `default_settings[automatic_tax]` and `phases[].automatic_tax` on `SubscriptionSchedule`, `SubscriptionScheduleCreateParams`, and `SubscriptionScheduleUpdateParams`.
* Add support for `automatic_tax` on `Subscription`, `SubscriptionCreateParams`, `SubscriptionUpdateParams`; `Invoice`, `InvoiceCreateParams`, `InvoiceRetrieveUpcomingParams` and `InvoiceLineItemListUpcomingParams`; Checkout `Session` and Checkout `SessionCreateParams`.
* Add support for `tax_behavior` to `Price`, `PriceCreateParams`, `PriceUpdateParams` and to the many Param objects that contain `price_data`:
- `SubscriptionScheduleCreateParams` and `SubscriptionScheduleUpdateParams`, beneath `phases[].add_invoice_items[]` and `phases[].items[]`
- `SubscriptionItemCreateParams` and `SubscriptionItemUpdateParams`, on the top-level
- `SubscriptionCreateParams` create and `UpdateCreateParams`, beneath `items[]` and `add_invoice_items[]`
- `InvoiceItemCreateParams` and `InvoiceItemUpdateParams`, on the top-level
- `InvoiceRetrieveUpcomingParams` and `InvoiceLineItemListUpcomingParams` beneath `subscription_items[]` and `invoice_items[]`.
- Checkout `SessionCreateParams`, beneath `line_items[]`.
* Add support for `customer_update` to Checkout `SessionCreateParams`.
* Add support for `customer_details` to `InvoiceRetrieveUpcomingParams` and `InvoiceLineItemListUpcomingParams`.
* Add support for `tax_type` to `TaxRate`, `TaxRateCreateParams`, and `TaxRateUpdateParams`.
## 8.151.0 - 2021-06-02
* [#1166](https://github.com/stripe/stripe-node/pull/1166) API Updates
* Added support for `llc`, `free_zone_llc`, `free_zone_establishment` and `sole_establishment` to the `structure` enum on `Account.company`, `AccountCreateParams.company`, `AccountUpdateParams.company` and `TokenCreateParams.account.company`.
## 8.150.0 - 2021-05-26
* [#1163](https://github.com/stripe/stripe-node/pull/1163) API Updates
* Added support for `documents` on `PersonUpdateParams`, `PersonCreateParams` and `TokenCreateParams.person`
## 8.149.0 - 2021-05-19
* [#1159](https://github.com/stripe/stripe-node/pull/1159) API Updates
* Add support for Identity VerificationSupport and VerificationReport APIs
* Update Typescript for `CouponCreateParams.duration` and `CouponCreateParams.products` to be optional.
* [#1158](https://github.com/stripe/stripe-node/pull/1158) API Updates
* `AccountUpdateParams.business_profile.support_url` and `AccountCreatParams.business_profile.support_url` changed from `string` to `Stripe.Emptyable<string>`
* `File.purpose` added new enum members: `finance_report_run`, `document_provider_identity_document`, and `sigma_scheduled_query`
## 8.148.0 - 2021-05-06
* [#1154](https://github.com/stripe/stripe-node/pull/1154) API Updates
* Added support for `reference` on `Charge.payment_method_details.afterpay_clearpay`
* Added support for `afterpay_clearpay` on `PaymentIntent.payment_method_options`.
## 8.147.0 - 2021-05-05
* [#1153](https://github.com/stripe/stripe-node/pull/1153) API Updates
* Add support for `payment_intent` on `Radar.EarlyFraudWarning`
## 8.146.0 - 2021-05-04
* Add support for `card_present` on `PaymentIntent#confirm.payment_method_options`, `PaymentIntent#update.payment_method_options`, `PaymentIntent#create.payment_method_options` and `PaymentIntent.payment_method_options`
* `SubscriptionItem#create.payment_behavior`, `Subscription#update.payment_behavior`, `Subscription#create.payment_behavior` and `SubscriptionItem#update.payment_behavior` added new enum members: `default_incomplete`
## 8.145.0 - 2021-04-21
* [#1143](https://github.com/stripe/stripe-node/pull/1143) API Updates
* Add support for `single_member_llc` as an enum member of `Account.company.structure` and `TokenCreateParams.account.company.structure` added new enum members:
* Add support for `dhl` and `royal_mail` as enum members of `Issuing.Card.shipping.carrier`.
* [#1142](https://github.com/stripe/stripe-node/pull/1142) Improve type definition for for `AccountCreateParams.external_account`
## 8.144.0 - 2021-04-16
* [#1140](https://github.com/stripe/stripe-node/pull/1140) API Updates
* Add support for `currency` on `Checkout.Session.PaymentMethodOptions.AcssDebit`
## 8.143.0 - 2021-04-12
* [#1139](https://github.com/stripe/stripe-node/pull/1139) API Updates
* Add support for `acss_debit_payments` on `Account.capabilities`
* Add support for `payment_method_options` on `Checkout.Session`
* Add support for `acss_debit` on `SetupIntent.payment_method_options`, `SetupAttempt.payment_method_details`, `PaymentMethod`, `PaymentIntent.payment_method_options`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentIntentCreateParams.payment_method_data`, `Mandate.payment_method_details` and `SetupIntent.payment_method_options`
* Add support for `verify_with_microdeposits` on `PaymentIntent.next_action` and `SetupIntent.next_action`
* Add support for `acss_debit` as member of the `type` enum on `PaymentMethod` and `PaymentIntent`, and inside `Checkout.SessionCreateParams.payment_method_types[]`.
## 8.142.0 - 2021-04-02
* [#1138](https://github.com/stripe/stripe-node/pull/1138) API Updates
* Add support for `subscription_pause` on `BillingPortal.ConfigurationUpdateParams.features`, `BillingPortal.ConfigurationCreateParams.features` and `BillingPortal.Configuration.features`
## 8.141.0 - 2021-03-31
* [#1137](https://github.com/stripe/stripe-node/pull/1137) API Updates
* Add support for `transfer_data` on `SessionCreateParams.subscription_data`
* [#1134](https://github.com/stripe/stripe-node/pull/1134) API Updates
* Added support for `card_issuing` on `AccountUpdateParams.settings` and `Account.settings`
## 8.140.0 - 2021-03-25
* [#1133](https://github.com/stripe/stripe-node/pull/1133) API Updates
* `Capability.requirements.errors[].code`, `Account.requirements.errors[].code` and `Person.requirements.errors[].code` added new enum members: `verification_missing_owners, verification_missing_executives and verification_requires_additional_memorandum_of_associations`
* `SessionCreateParams.locale` and `Checkout.Session.locale` added new enum members: `th`
## 8.139.0 - 2021-03-22
* [#1132](https://github.com/stripe/stripe-node/pull/1132) API Updates
* Added support for `shipping_rates` on `SessionCreateOptions`
* Added support for `amount_shipping` on `Checkout.SessionTotalDetails`
* [#1131](https://github.com/stripe/stripe-node/pull/1131) types: export StripeRawError type
## 8.138.0 - 2021-03-10
* [#1124](https://github.com/stripe/stripe-node/pull/1124) API Updates
* Added support for `BillingPortal.Configuration` API.
* `Terminal.LocationUpdateParams.country` is now optional.
## 8.137.0 - 2021-02-17
* [#1123](https://github.com/stripe/stripe-node/pull/1123) API Updates
* Add support for on_behalf_of to Invoice
* Add support for enum member revolut on PaymentIntent.payment_method_data.ideal.bank, PaymentMethod.ideal.bank, Charge.payment_method_details.ideal.bank and SetupAttempt.payment_method_details.ideal.bank
* Added support for enum member REVOLT21 on PaymentMethod.ideal.bic, Charge.payment_method_details.ideal.bic and SetupAttempt.payment_method_details.ideal.bic
## 8.136.0 - 2021-02-16
* [#1122](https://github.com/stripe/stripe-node/pull/1122) API Updates
* Add support for `afterpay_clearpay` on `PaymentMethod`, `PaymentIntent.payment_method_data`, and `Charge.payment_method_details`.
* Add support for `afterpay_clearpay` as a payment method type on `PaymentMethod`, `PaymentIntent` and `Checkout.Session`
* Add support for `adjustable_quantity` on `SessionCreateParams.LineItem`
* Add support for `bacs_debit`, `au_becs_debit` and `sepa_debit` on `SetupAttempt.payment_method_details`
## 8.135.0 - 2021-02-08
* [#1119](https://github.com/stripe/stripe-node/pull/1119) API Updates
* Add support for `afterpay_clearpay_payments` on `Account.capabilities`
* Add support for `payment_settings` on `Invoice`
## 8.134.0 - 2021-02-05
* [#1118](https://github.com/stripe/stripe-node/pull/1118) API Updates
* `LineItem.amount_subtotal` and `LineItem.amount_total` changed from `nullable(integer)` to `integer`
* Improve error message for `EphemeralKeys.create`
## 8.133.0 - 2021-02-03
* [#1115](https://github.com/stripe/stripe-node/pull/1115) API Updates
* Added support for `nationality` on `Person`, `PersonUpdateParams`, `PersonCreateParams` and `TokenCreateParams.person`
* Added `gb_vat` to `TaxId.type` enum.
## 8.132.0 - 2021-01-21
* [#1112](https://github.com/stripe/stripe-node/pull/1112) API Updates
* `Issuing.Transaction.type` dropped enum members: 'dispute'
* `LineItem.price` can now be null.
## 8.131.1 - 2021-01-15
* [#1104](https://github.com/stripe/stripe-node/pull/1104) Make request timeout errors eligible for retry
## 8.131.0 - 2021-01-14
* [#1108](https://github.com/stripe/stripe-node/pull/1108) Multiple API Changes
* Added support for `dynamic_tax_rates` on `Checkout.SessionCreateParams.line_items`
* Added support for `customer_details` on `Checkout.Session`
* Added support for `type` on `Issuing.TransactionListParams`
* Added support for `country` and `state` on `TaxRateUpdateParams`, `TaxRateCreateParams` and `TaxRate`
* [#1107](https://github.com/stripe/stripe-node/pull/1107) More consistent type definitions
## 8.130.0 - 2021-01-07
* [#1105](https://github.com/stripe/stripe-node/pull/1105) API Updates
* Added support for `company_registration_verification`, `company_ministerial_decree`, `company_memorandum_of_association`, `company_license` and `company_tax_id_verification` on AccountUpdateParams.documents and AccountCreateParams.documents
* [#1100](https://github.com/stripe/stripe-node/pull/1100) implement/fix reverse iteration when iterating with ending_before
* [#1096](https://github.com/stripe/stripe-node/pull/1096) typo receieved -> received
## 8.129.0 - 2020-12-15
* [#1093](https://github.com/stripe/stripe-node/pull/1093) API Updates
* Added support for card_present on SetupAttempt.payment_method_details
## 8.128.0 - 2020-12-10
* [#1088](https://github.com/stripe/stripe-node/pull/1088) Multiple API changes
* Add newlines for consistency.
* Prefix deleted references with `Stripe.` for consistency.
* Add support for `bank` on `PaymentMethod[eps]`.
* Add support for `tos_shown_and_accepted` to `payment_method_options[p24]` on `PaymentMethod`.
## 8.127.0 - 2020-12-03
* [#1084](https://github.com/stripe/stripe-node/pull/1084) Add support for `documents` on `Account` create and update
* [#1080](https://github.com/stripe/stripe-node/pull/1080) fixed promises example
## 8.126.0 - 2020-11-24
* [#1079](https://github.com/stripe/stripe-node/pull/1079) Multiple API changes
* Add support for `account_tax_ids` on `Invoice`
* Add support for `payment_method_options[sepa_debit]` on `PaymentIntent`
## 8.125.0 - 2020-11-20
* [#1075](https://github.com/stripe/stripe-node/pull/1075) Add support for `capabilities[grabpay_payments]` on `Account`
## 8.124.0 - 2020-11-19
* [#1074](https://github.com/stripe/stripe-node/pull/1074)
* Add support for mandate_options on SetupIntent.payment_method_options.sepa_debit.
* Add support for card_present and interact_present as values for PaymentMethod.type.
* [#1073](https://github.com/stripe/stripe-node/pull/1073) More consistent namespacing for shared types
## 8.123.0 - 2020-11-18
* [#1072](https://github.com/stripe/stripe-node/pull/1072) Add support for `grabpay` on `PaymentMethod`
## 8.122.1 - 2020-11-17
* Identical to 8.122.0. Published to resolve a release issue.
## 8.122.0 - 2020-11-17
* [#1070](https://github.com/stripe/stripe-node/pull/1070)
* Add support for `sepa_debit` on `SetupIntent.PaymentMethodOptions`
* `Invoice.tax_amounts` and `InvoiceLineItem.tax_rates` are no longer nullable
* `Invoice.default_tax_rates` and `InvoiceLineItem.tax_amounts` are no longer nullable
## 8.121.0 - 2020-11-09
* [#1064](https://github.com/stripe/stripe-node/pull/1064) Add `invoice.finalization_error` as a `type` on `Event`
* [#1063](https://github.com/stripe/stripe-node/pull/1063) Multiple API changes
* Add support for `last_finalization_error` on `Invoice`
* Add support for deserializing Issuing `Dispute` as a `source` on `BalanceTransaction`
* Add support for `payment_method_type` on `StripeError` used by other API resources
## 8.120.0 - 2020-11-04
* [#1061](https://github.com/stripe/stripe-node/pull/1061) Add support for `company[registration_number]` on `Account`
## 8.119.0 - 2020-10-27
* [#1056](https://github.com/stripe/stripe-node/pull/1056) Add `payment_method_details[interac_present][preferred_locales]` on `Charge`
* [#1057](https://github.com/stripe/stripe-node/pull/1057) Standardize on CRULD order for method definitions
* [#1055](https://github.com/stripe/stripe-node/pull/1055) Added requirements to README
## 8.118.0 - 2020-10-26
* [#1053](https://github.com/stripe/stripe-node/pull/1053) Multiple API changes
* Improving Typescript types for nullable parameters and introduced `Stripe.Emptyable` as a type
* Add support for `payment_method_options[card][cvc_token]` on `PaymentIntent`
* Add support for `cvc_update[cvc]` on `Token` creation
* [#1052](https://github.com/stripe/stripe-node/pull/1052) Add Stripe.Emptyable type definition
## 8.117.0 - 2020-10-23
* [#1050](https://github.com/stripe/stripe-node/pull/1050) Add support for passing `p24[bank]` for P24 on `PaymentIntent` or `PaymentMethod`
## 8.116.0 - 2020-10-22
* [#1049](https://github.com/stripe/stripe-node/pull/1049) Support passing `tax_rates` when creating invoice items through `Subscription` or `SubscriptionSchedule`
## 8.115.0 - 2020-10-20
* [#1048](https://github.com/stripe/stripe-node/pull/1048) Add support for `jp_rn` and `ru_kpp` as a `type` on `TaxId`
* [#1046](https://github.com/stripe/stripe-node/pull/1046) chore: replace recommended extension sublime babel with babel javascript
## 8.114.0 - 2020-10-15
* [#1045](https://github.com/stripe/stripe-node/pull/1045) Make `original_payout` and `reversed_by` not optional anymore
## 8.113.0 - 2020-10-14
* [#1044](https://github.com/stripe/stripe-node/pull/1044) Add support for `discounts` on `Session.create`
## 8.112.0 - 2020-10-14
* [#1042](https://github.com/stripe/stripe-node/pull/1042) Add support for the Payout Reverse API
* [#1041](https://github.com/stripe/stripe-node/pull/1041) Do not mutate user-supplied opts
## 8.111.0 - 2020-10-12
* [#1038](https://github.com/stripe/stripe-node/pull/1038) Add support for `description`, `iin` and `issuer` in `payment_method_details[card_present]` and `payment_method_details[interac_present]` on `Charge`
## 8.110.0 - 2020-10-12
* [#1035](https://github.com/stripe/stripe-node/pull/1035) Add support for `setup_intent.requires_action` on Event
## 8.109.0 - 2020-10-09
* [#1033](https://github.com/stripe/stripe-node/pull/1033) Add support for internal-only `description`, `iin`, and `issuer` for `card_present` and `interac_present` on `Charge.payment_method_details`
## 8.108.0 - 2020-10-08
* [#1028](https://github.com/stripe/stripe-node/pull/1028) Add support for `Bancontact/iDEAL/Sofort -> SEPA`
* Add support for `generated_sepa_debit` and `generated_sepa_debit_mandate` on `Charge.payment_method_details.ideal`, `Charge.payment_method_details.bancontact` and `Charge.payment_method_details.sofort`
* Add support for `generated_from` on `PaymentMethod.sepa_debit`
* Add support for `ideal`, `bancontact` and `sofort` on `SetupAttempt.payment_method_details`
## 8.107.0 - 2020-10-02
* [#1026](https://github.com/stripe/stripe-node/pull/1026) Add support for `tos_acceptance[service_agreement]` on `Account`
* [#1025](https://github.com/stripe/stripe-node/pull/1025) Add support for new payments capabilities on `Account`
## 8.106.0 - 2020-09-29
* [#1024](https://github.com/stripe/stripe-node/pull/1024) Add support for the `SetupAttempt` resource and List API
## 8.105.0 - 2020-09-29
* [#1023](https://github.com/stripe/stripe-node/pull/1023) Add support for `contribution` in `reporting_category` on `ReportRun`
## 8.104.0 - 2020-09-28
* [#1022](https://github.com/stripe/stripe-node/pull/1022) Add support for `oxxo_payments` capability on `Account`
## 8.103.0 - 2020-09-28
* [#1021](https://github.com/stripe/stripe-node/pull/1021) Add VERSION constant to instantiated Stripe client.
## 8.102.0 - 2020-09-25
* [#1019](https://github.com/stripe/stripe-node/pull/1019) Add support for `oxxo` as a valid `type` on the List PaymentMethod API
## 8.101.0 - 2020-09-25
* [#1018](https://github.com/stripe/stripe-node/pull/1018) More idiomatic types
## 8.100.0 - 2020-09-24
* [#1016](https://github.com/stripe/stripe-node/pull/1016) Multiple API changes
* Add support for OXXO on `PaymentMethod` and `PaymentIntent`
* Add support for `contribution` on `BalanceTransaction`
## 8.99.0 - 2020-09-24
* [#1011](https://github.com/stripe/stripe-node/pull/1011) Add type definition for Stripe.StripeResource
## 8.98.0 - 2020-09-23
* [#1014](https://github.com/stripe/stripe-node/pull/1014) Multiple API changes
* Add support for `issuing_dispute.closed` and `issuing_dispute.submitted` events
* Add support for `instant_available` on `Balance`
## 8.97.0 - 2020-09-21
* [#1012](https://github.com/stripe/stripe-node/pull/1012) Multiple API changes
* `metadata` is now always nullable on all resources
* Add support for `amount_captured` on `Charge`
* Add `checkout_session` on `Discount`
## 8.96.0 - 2020-09-13
* [#1003](https://github.com/stripe/stripe-node/pull/1003) Add support for `promotion_code.created` and `promotion_code.updated` on `Event`
## 8.95.0 - 2020-09-10
* [#999](https://github.com/stripe/stripe-node/pull/999) Add support for SEPA debit on Checkout
## 8.94.0 - 2020-09-09
* [#998](https://github.com/stripe/stripe-node/pull/998) Multiple API changes
* Add support for `sofort` as a `type` on the List PaymentMethods API
* Add back support for `invoice.payment_succeeded`
## 8.93.0 - 2020-09-08
* [#995](https://github.com/stripe/stripe-node/pull/995) Add support for Sofort on `PaymentMethod` and `PaymentIntent`
## 8.92.0 - 2020-09-02
* [#993](https://github.com/stripe/stripe-node/pull/993) Multiple API changes
* Add support for the Issuing `Dispute` submit API
* Add support for evidence details on Issuing `Dispute` creation, update and the resource.
* Add `available_payout_methods` on `BankAccount`
* Add `payment_status` on Checkout `Session`
## 8.91.0 - 2020-08-31
* [#992](https://github.com/stripe/stripe-node/pull/992) Add support for `payment_method.automatically_updated` on `WebhookEndpoint`
## 8.90.0 - 2020-08-28
* [#991](https://github.com/stripe/stripe-node/pull/991) Multiple API changes
* [#990](https://github.com/stripe/stripe-node/pull/990) Typescript: add 'lastResponse' to return types
## 8.89.0 - 2020-08-19
* [#988](https://github.com/stripe/stripe-node/pull/988) Multiple API changes
* `tax_ids` on `Customer` can now be nullable
* Added support for `expires_at` on `File`
## 8.88.0 - 2020-08-17
* [#987](https://github.com/stripe/stripe-node/pull/987) Add support for `amount_details` on Issuing `Authorization` and `Transaction`
## 8.87.0 - 2020-08-17
* [#984](https://github.com/stripe/stripe-node/pull/984) Multiple API changes
* Add `alipay` on `type` for the List PaymentMethods API
* Add `payment_intent.requires_action` as a new `type` on `Event`
## 8.86.0 - 2020-08-13
* [#981](https://github.com/stripe/stripe-node/pull/981) Add support for Alipay on Checkout `Session`
## 8.85.0 - 2020-08-13
* [#980](https://github.com/stripe/stripe-node/pull/980) [codegen] Multiple API Changes
* Added support for bank_name on `Charge.payment_method_details.acss_debit`
* `Issuing.dispute.balance_transactions` is now nullable.
## 8.84.0 - 2020-08-07
* [#975](https://github.com/stripe/stripe-node/pull/975) Add support for Alipay on `PaymentMethod` and `PaymentIntent`
## 8.83.0 - 2020-08-05
* [#973](https://github.com/stripe/stripe-node/pull/973) Multiple API changes
* Add support for the `PromotionCode` resource and APIs
* Add support for `allow_promotion_codes` on Checkout `Session`
* Add support for `applies_to[products]` on `Coupon`
* Add support for `promotion_code` on `Customer` and `Subscription`
* Add support for `promotion_code` on `Discount`
## 8.82.0 - 2020-08-04
* [#972](https://github.com/stripe/stripe-node/pull/972) Multiple API changes
* Add `zh-HK` and `zh-TW` as `locale` on Checkout `Session`
* Add `payment_method_details[card_present][receipt][account_type]` on `Charge`
## 8.81.0 - 2020-07-30
* [#970](https://github.com/stripe/stripe-node/pull/970) Improve types for `customer` on `CreditNote` to support `DeletedCustomer`
## 8.80.0 - 2020-07-29
* [#969](https://github.com/stripe/stripe-node/pull/969) Multiple API changes
* Add support for `id`, `invoice` and `invoice_item` on `Discount` and `DeletedDiscount`
* Add support for `discount_amounts` on `CreditNote`, `CreditNoteLineItem`, `InvoiceLineItem`
* Add support for `discounts` on `InvoiceItem`, `InvoiceLineItem` and `Invoice`
* Add support for `total_discount_amounts` on `Invoice`
* Make `customer` and `verification` on `TaxId` optional as the resource will be re-used for `Account` in the future.
## 8.79.0 - 2020-07-24
* [#967](https://github.com/stripe/stripe-node/pull/967) Multiple API changes
* Make all properties from `Discount` available on `DeletedDiscount`
* Add `capabilities[fpx_payments]` on `Account` create and update
## 8.78.0 - 2020-07-22
* [#965](https://github.com/stripe/stripe-node/pull/965) Add support for `cartes_bancaires_payments` as a `Capability`
## 8.77.0 - 2020-07-20
* [#963](https://github.com/stripe/stripe-node/pull/963) Add support for `capabilities` as a parameter on `Account` create and update
## 8.76.0 - 2020-07-17
* [#962](https://github.com/stripe/stripe-node/pull/962) Add support for `political_exposure` on `Person`
## 8.75.0 - 2020-07-16
* [#961](https://github.com/stripe/stripe-node/pull/961) Add support for `account_onboarding` and `account_update` as `type` on `AccountLink`
## 8.74.0 - 2020-07-16
* [#959](https://github.com/stripe/stripe-node/pull/959) Refactor remaining 'var' to 'let/const' usages
* [#960](https://github.com/stripe/stripe-node/pull/960) Use strict equality check for 'protocol' field for consistency
* [#952](https://github.com/stripe/stripe-node/pull/952) Add new fields to lastResponse: apiVersion, stripeAccount, idempotencyKey
## 8.73.0 - 2020-07-15
* [#958](https://github.com/stripe/stripe-node/pull/958) Multiple API changes
* Add support for `en-GB`, `fr-CA` and `id` as `locale` on Checkout `Session`
* Move `purpose` to an enum on `File`
* [#957](https://github.com/stripe/stripe-node/pull/957) Bump lodash from 4.17.15 to 4.17.19
## 8.72.0 - 2020-07-15
* [#956](https://github.com/stripe/stripe-node/pull/956) Add support for `amount_total`, `amount_subtotal`, `currency` and `total_details` on Checkout `Session`
## 8.71.0 - 2020-07-14
* [#955](https://github.com/stripe/stripe-node/pull/955) Change from string to enum value for `billing_address_collection` on Checkout `Session`
## 8.70.0 - 2020-07-13
* [#953](https://github.com/stripe/stripe-node/pull/953) Multiple API changes
* Adds `es-419` as a `locale` to Checkout `Session`
* Adds `billing_cycle_anchor` to `default_settings` and `phases` for `SubscriptionSchedule`
## 8.69.0 - 2020-07-06
* [#946](https://github.com/stripe/stripe-node/pull/946) Fix `assert_capabilities` type definition
* [#920](https://github.com/stripe/stripe-node/pull/920) Expose StripeResource on instance
## 8.68.0 - 2020-07-01
* [#940](https://github.com/stripe/stripe-node/pull/940) Document but discourage `protocol` config option
* [#933](https://github.com/stripe/stripe-node/pull/933) Fix tests for `Plan` and `Price` to not appear as amount can be updated.
## 8.67.0 - 2020-06-24
* [#929](https://github.com/stripe/stripe-node/pull/929) Add support for `invoice.paid` event
## 8.66.0 - 2020-06-23
* [#927](https://github.com/stripe/stripe-node/pull/927) Add support for `payment_method_data` on `PaymentIntent`
## 8.65.0 - 2020-06-23
* [#926](https://github.com/stripe/stripe-node/pull/926) Multiple API changes
* Add `discounts` on `LineItem`
* Add `document_provider_identity_document` as a `purpose` on `File`
* Support nullable `metadata` on Issuing `Dispute`
* Add `klarna[shipping_delay]` on `Source`
## 8.64.0 - 2020-06-18
* [#924](https://github.com/stripe/stripe-node/pull/924) Multiple API changes
* Add support for `refresh_url` and `return_url` on `AccountLink`
* Add support for `issuing_dispute.*` events
## 8.63.0 - 2020-06-11
* [#919](https://github.com/stripe/stripe-node/pull/919) Multiple API changes
* Add `transaction` on Issuing `Dispute`
* Add `payment_method_details[acss_debit][mandate]` on `Charge`
## 8.62.0 - 2020-06-10
* [#918](https://github.com/stripe/stripe-node/pull/918) Add support for Cartes Bancaires payments on `PaymentIntent` and `Pay…
## 8.61.0 - 2020-06-09
* [#917](https://github.com/stripe/stripe-node/pull/917) Add support for `id_npwp` and `my_frp` as `type` on `TaxId`
## 8.60.0 - 2020-06-03
* [#911](https://github.com/stripe/stripe-node/pull/911) Add support for `payment_intent_data[transfer_group]` on Checkout `Session`
## 8.59.0 - 2020-06-03
* [#910](https://github.com/stripe/stripe-node/pull/910) Add support for Bancontact, EPS, Giropay and P24 on Checkout `Session`
## 8.58.0 - 2020-06-03
* [#909](https://github.com/stripe/stripe-node/pull/909) Multiple API changes
* Add `bacs_debit_payments` as a `Capability`
* Add support for BACS Debit on Checkout `Session`
* Add support for `checkout.session.async_payment_failed` and `checkout.session.async_payment_succeeded` as `type` on `Event`
## 8.57.0 - 2020-06-03
* [#908](https://github.com/stripe/stripe-node/pull/908) Multiple API changes
* Add support for bg, cs, el, et, hu, lt, lv, mt, ro, ru, sk, sl and tr as new locale on Checkout `Session`
* Add `settings[sepa_debit_payments][creditor_id]` on `Account`
* Add support for Bancontact, EPS, Giropay and P24 on `PaymentMethod`, `PaymentIntent` and `SetupIntent`
* Add support for `order_item[parent]` on `Source` for Klarna
* [#905](https://github.com/stripe/stripe-node/pull/905) Add support for BACS Debit as a `PaymentMethod`
## 8.56.0 - 2020-05-28
* [#904](https://github.com/stripe/stripe-node/pull/904) Multiple API changes
* Add `payment_method_details[card][three_d_secure][authentication_flow]` on `Charge`
* Add `line_items[][price_data][product_data]` on Checkout `Session` creation
## 8.55.0 - 2020-05-22
* [#899](https://github.com/stripe/stripe-node/pull/899) Multiple API changes
* Add support for `ae_trn`, `cl_tin` and `sa_vat` as `type` on `TaxId`
* Add `result` and `result_reason` inside `payment_method_details[card][three_d_secure]` on `Charge`
## 8.54.0 - 2020-05-20
* [#897](https://github.com/stripe/stripe-node/pull/897) Multiple API changes
* Add `anticipation_repayment` as a `type` on `BalanceTransaction`
* Add `interac_present` as a `type` on `PaymentMethod`
* Add `payment_method_details[interac_present]` on `Charge`
* Add `transfer_data` on `SubscriptionSchedule`
## 8.53.0 - 2020-05-18
* [#895](https://github.com/stripe/stripe-node/pull/895) Multiple API changes
* Add support for `issuing_dispute` as a `type` on `BalanceTransaction`
* Add `balance_transactions` as an array of `BalanceTransaction` on Issuing `Dispute`
* Add `fingerprint` and `transaction_id` in `payment_method_details[alipay]` on `Charge`
* Add `transfer_data[amount]` on `Invoice`
* Add `transfer_data[amount_percent]` on `Subscription`
* Add `price.created`, `price.deleted` and `price.updated` on `Event`
## 8.52.0 - 2020-05-13
* [#891](https://github.com/stripe/stripe-node/pull/891) Add support for `purchase_details` on Issuing `Transaction`
## 8.51.0 - 2020-05-11
* [#890](https://github.com/stripe/stripe-node/pull/890) Add support for the `LineItem` resource and APIs
## 8.50.0 - 2020-05-07
* [#888](https://github.com/stripe/stripe-node/pull/888) Multiple API changes
* Remove parameters in `price_data[recurring]` across APIs as they were never supported
* Move `payment_method_details[card][three_d_secure]` to a list of enum values on `Charge`
* Add support for for `business_profile[support_adress]` on `Account` create and update
## 8.49.0 - 2020-05-01
* [#883](https://github.com/stripe/stripe-node/pull/883) Multiple API changes
* Add `issuing` on `Balance`
* Add `br_cnpj` and `br_cpf` as `type` on `TaxId`
* Add `price` support in phases on `SubscriptionSchedule`
* Make `quantity` nullable on `SubscriptionSchedule` for upcoming API version change
## 8.48.0 - 2020-04-29
* [#881](https://github.com/stripe/stripe-node/pull/881) Add support for the `Price` resource and APIs
## 8.47.1 - 2020-04-28
* [#880](https://github.com/stripe/stripe-node/pull/880) Make `display_items` on Checkout `Session` optional
## 8.47.0 - 2020-04-24
* [#876](https://github.com/stripe/stripe-node/pull/876) Add support for `jcb_payments` as a `Capability`
## 8.46.0 - 2020-04-22
* [#875](https://github.com/stripe/stripe-node/pull/875) Add support for `coupon` when for subscriptions on Checkout
## 8.45.0 - 2020-04-22
* [#874](https://github.com/stripe/stripe-node/pull/874) Add support for `billingPortal` namespace and `session` resource and APIs
## 8.44.0 - 2020-04-17
* [#873](https://github.com/stripe/stripe-node/pull/873) Multiple API changes
* Add support for `cardholder_name` in `payment_method_details[card_present]` on `Charge`
* Add new enum values for `company.structure` on `Account`
## 8.43.0 - 2020-04-16
* [#868](https://github.com/stripe/stripe-node/pull/868) Multiple API changes
## 8.42.0 - 2020-04-15
* [#867](https://github.com/stripe/stripe-node/pull/867) Clean up deprecated features in our Typescript definitions for Issuing and other resources
## 8.41.0 - 2020-04-14
* [#866](https://github.com/stripe/stripe-node/pull/866) Add support for `settings[branding][secondary_color]` on `Account`
## 8.40.0 - 2020-04-13
* [#865](https://github.com/stripe/stripe-node/pull/865) Add support for `description` on `WebhookEndpoint`
## 8.39.2 - 2020-04-10
* [#864](https://github.com/stripe/stripe-node/pull/864) Multiple API changes
* Make `payment_intent` expandable on `Charge`
* Add support for `sg_gst` as a value for `type` on `TaxId` and related APIs
* Add `cancellation_reason` and new enum values for `replacement_reason` on Issuing `Card`
## 8.39.1 - 2020-04-08
* [#848](https://github.com/stripe/stripe-node/pull/848) Fix TS return type for autoPagingEach
## 8.39.0 - 2020-04-03
* [#859](https://github.com/stripe/stripe-node/pull/859) Add support for `calculatedStatementDescriptor` on `Charge`
## 8.38.0 - 2020-03-27
- [#853](https://github.com/stripe/stripe-node/pull/853) Improve StripeError.generate()
- Add `doc_url` field to StripeError.
- Expose `Stripe.errors.generate()` as a convenience for `Stripe.errors.StripeError.generate()`.
- Fix several TS types related to StripeErrors.
- Add types for `StripeInvalidGrantError`.
- Add support for `authentication_error` and `rate_limit_error` in `.generate()`.
## 8.37.0 - 2020-03-26
- [#851](https://github.com/stripe/stripe-node/pull/851) Add support for `spending_controls` on Issuing `Card` and `Cardholder`
## 8.36.0 - 2020-03-25
- [#850](https://github.com/stripe/stripe-node/pull/850) Multiple API changes
- Add support for `pt-BR` as a `locale` on Checkout `Session`
- Add support for `company` as a `type` on Issuing `Cardholder`
## 8.35.0 - 2020-03-24
- [#849](https://github.com/stripe/stripe-node/pull/849) Add support for `pause_collection` on `Subscription`
## 8.34.0 - 2020-03-24
- [#847](https://github.com/stripe/stripe-node/pull/847) Add new capabilities for AU Becs Debit and tax reporting
## 8.33.0 - 2020-03-20
- [#842](https://github.com/stripe/stripe-node/pull/842) Multiple API changes for Issuing:
- Add `amount`, `currency`, `merchant_amount` and `merchant_currency` on `Authorization`
- Add `amount`, `currency`, `merchant_amount` and `merchant_currency` inside `request_history` on `Authorization`
- Add `pending_request` on `Authorization`
- Add `amount` when approving an `Authorization`
- Add `replaced_by` on `Card`
## 8.32.0 - 2020-03-13
- [#836](https://github.com/stripe/stripe-node/pull/836) Multiple API changes for Issuing:
- Rename `speed` to `service` on Issuing `Card`
- Rename `wallet_provider` to `wallet` and `address_zip_check` to `address_postal_code_check` on Issuing `Authorization`
- Mark `is_default` as deprecated on Issuing `Cardholder`
## 8.31.0 - 2020-03-12
- [#835](https://github.com/stripe/stripe-node/pull/835) Add support for `shipping` and `shipping_address_collection` on Checkout `Session`
## 8.30.0 - 2020-03-12
- [#834](https://github.com/stripe/stripe-node/pull/834) Add support for `ThreeDSecure` on Issuing `Authorization`
## 8.29.0 - 2020-03-05
- [#833](https://github.com/stripe/stripe-node/pull/833) Make metadata nullable in many endpoints
## 8.28.1 - 2020-03-05
- [#827](https://github.com/stripe/stripe-node/pull/827) Allow `null`/`undefined` to be passed for `options` arg.
## 8.28.0 - 2020-03-04
- [#830](https://github.com/stripe/stripe-node/pull/830) Add support for `metadata` on `WebhookEndpoint`
## 8.27.0 - 2020-03-04
- [#829](https://github.com/stripe/stripe-node/pull/829) Multiple API changes
- Add support for `account` as a parameter on `Token` to create Account tokens
- Add support for `verification_data.expiry_check` on Issuing `Authorization`
- Add support for `incorrect_cvc` and `incorrect_expiry` as a value for `request_history.reason` on Issuing `Authorization`
## 8.26.0 - 2020-03-04
- [#828](https://github.com/stripe/stripe-node/pull/828) Multiple API changes
- Add support for `errors` in `requirements` on `Account`, `Capability` and `Person`
- Add support for `payment_intent.processing` as a new `type` on `Event`.
## 8.25.0 - 2020-03-03
⚠️ This is a breaking change for TypeScript users.
- [#826](https://github.com/stripe/stripe-node/pull/826) Multiple API changes:
- ⚠️ Types are now for the API version `2020-03-02`. This is a breaking change for TypeScript users
- Remove `uob_regional` as a value on `bank` for FPX as this is deprecated and was never used
- Add support for `next_invoice_sequence` on `Customer`
- Add support for `proration_behavior` on `SubscriptionItem` delete
## 8.24.1 - 2020-03-02
- [#824](https://github.com/stripe/stripe-node/pull/824) Update type for StripeError to extend Error
## 8.24.0 - 2020-02-28
- [#822](https://github.com/stripe/stripe-node/pull/822) Add `my_sst` as a valid value for `type` on `TaxId`
## 8.23.0 - 2020-02-27
- [#821](https://github.com/stripe/stripe-node/pull/821) Make `type` on `AccountLink` an enum
## 8.22.0 - 2020-02-24
- [#820](https://github.com/stripe/stripe-node/pull/820) Add new enum values in `reason` for Issuing `Dispute` creation
## 8.21.0 - 2020-02-24
- [#819](https://github.com/stripe/stripe-node/pull/819) Add support for listing Checkout `Session` and passing tax rate information
## 8.20.0 - 2020-02-21
- [#813](https://github.com/stripe/stripe-node/pull/813) Multiple API changes
- Add support for `timezone` on `ReportRun`
- Add support for `proration_behavior` on `SubscriptionSchedule`
## 8.19.0 - 2020-02-18
- [#807](https://github.com/stripe/stripe-node/pull/807) Change timeout default to constant 80000 instead Node default
## 8.18.0 - 2020-02-14
- [#802](https://github.com/stripe/stripe-node/pull/802) TS Fixes
- Correctly type `Array<CustomField>`
- More consistently describe nullable fields as `| null`, vs `| ''`.
## 8.17.0 - 2020-02-12
- [#804](https://github.com/stripe/stripe-node/pull/804) Add support for `payment_intent_data[transfer_data][amount]` on Checkout `Session`
## 8.16.0 - 2020-02-12
- [#803](https://github.com/stripe/stripe-node/pull/803) Multiple API changes reflect in Typescript definitions
- Add `fpx` as a valid `source_type` on `Balance`, `Payout` and `Transfer`
- Add `fpx` support on Checkout `Session`
- Fields inside `verification_data` on Issuing `Authorization` are now enums
- Support updating `payment_method_options` on `PaymentIntent` and `SetupIntent`
## 8.15.0 - 2020-02-10
- [#801](https://github.com/stripe/stripe-node/pull/801) Multiple API changes
- Add support for new `type` values for `TaxId`.
- Add support for `payment_intent_data[statement_descriptor_suffix]` on Checkout `Session`.
## 8.14.0 - 2020-02-04
- [#793](https://github.com/stripe/stripe-node/pull/793) Rename `sort_code` to `sender_sort_code` on `SourceTransaction` for BACS debit.
## 8.13.0 - 2020-02-03
- [#792](https://github.com/stripe/stripe-node/pull/792) Multiple API changes
- Add new `purpose` for `File`: `additional_verification`
- Add `error_on_requires_action` as a parameter for `PaymentIntent` creation and confirmation
## 8.12.0 - 2020-01-31
- [#790](https://github.com/stripe/stripe-node/pull/790) Add new type of `TaxId`
## 8.11.0 - 2020-01-30
- [#789](https://github.com/stripe/stripe-node/pull/789) Add support for `company.structure` on `Account` and other docs changes
## 8.10.0 - 2020-01-30
- [#788](https://github.com/stripe/stripe-node/pull/788) Make typescript param optional
## 8.9.0 - 2020-01-30
- [#787](https://github.com/stripe/stripe-node/pull/787) Add support for FPX as a `PaymentMethod`
- [#769](https://github.com/stripe/stripe-node/pull/769) Fix Typescript definition on `Token` creation for bank accounts
## 8.8.2 - 2020-01-30
- [#785](https://github.com/stripe/stripe-node/pull/785) Fix file uploads with nested params
## 8.8.1 - 2020-01-29
- [#784](https://github.com/stripe/stripe-node/pull/784) Allow @types/node 8.1
## 8.8.0 - 2020-01-28
- [#780](https://github.com/stripe/stripe-node/pull/780) Add new type for `TaxId` and `sender_account_name` on `SourceTransaction`
## 8.7.0 - 2020-01-24
- [#777](https://github.com/stripe/stripe-node/pull/777) Add support for `shipping[speed]` on Issuing `Card`
## 8.6.0 - 2020-01-23
- [#775](https://github.com/stripe/stripe-node/pull/775) Gracefully handle a missing `subprocess` module
## 8.5.0 - 2020-01-23
- [#776](https://github.com/stripe/stripe-node/pull/776) Add support for new `type` on `CustomerTaxId`
## 8.4.1 - 2020-01-21
- [#774](https://github.com/stripe/stripe-node/pull/774) Improve docstrings for many properties and parameters
## 8.4.0 - 2020-01-17
- [#771](https://github.com/stripe/stripe-node/pull/771) Add `metadata` on Checkout `Session` and remove deprecated features
- [#764](https://github.com/stripe/stripe-node/pull/764) Added typescript webhook example
## 8.3.0 - 2020-01-15
- [#767](https://github.com/stripe/stripe-node/pull/767) Adding missing events for pending updates on `Subscription`
## 8.2.0 - 2020-01-15
- [#765](https://github.com/stripe/stripe-node/pull/765) Add support for `pending_update` on `Subscription` to the Typescript definitions
## 8.1.0 - 2020-01-14
- [#763](https://github.com/stripe/stripe-node/pull/763) Add support for listing line items on a `CreditNote`
- [#762](https://github.com/stripe/stripe-node/pull/762) Improve docs for core fields such as `metadata` on Typescript definitions
## 8.0.1 - 2020-01-09
- [#757](https://github.com/stripe/stripe-node/pull/757) [bugfix] Add types dir to npmignore whitelist and stop warning when instantiating stripe with no args
## 8.0.0 - 2020-01-09
Major version release, adding TypeScript definitions and dropping support for Node 6. [The migration guide](https://github.com/stripe/stripe-node/wiki/Migration-guide-for-v8) contains a detailed list of backwards-incompatible changes with upgrade instructions.
Major pull requests included in this release (cf. [#742](https://github.com/stripe/stripe-node/pull/742)) (⚠️ = breaking changes):
- [#736](https://github.com/stripe/stripe-node/pull/736) Add TypeScript definitions
- [#744](https://github.com/stripe/stripe-node/pull/744) Remove deprecated resources and methods
- [#752](https://github.com/stripe/stripe-node/pull/752) Deprecate many library api's, unify others
## 7.63.1 - 2020-11-17
- Identical to 7.15.0.
## 7.63.0 - 2020-11-17
- Published in error. Do not use. This is identical to 8.122.0.
## 7.15.0 - 2019-12-30
- [#745](https://github.com/stripe/stripe-node/pull/745) Bump handlebars from 4.1.2 to 4.5.3
- [#737](https://github.com/stripe/stripe-node/pull/737) Fix flows test
## 7.14.0 - 2019-11-26
- [#732](https://github.com/stripe/stripe-node/pull/732) Add support for CreditNote preview
## 7.13.1 - 2019-11-22
- [#728](https://github.com/stripe/stripe-node/pull/728) Remove duplicate export
## 7.13.0 - 2019-11-06
- [#703](https://github.com/stripe/stripe-node/pull/703) New config object
## 7.12.0 - 2019-11-05
- [#724](https://github.com/stripe/stripe-node/pull/724) Add support for `Mandate`
## 7.11.0 - 2019-10-31
- [#719](https://github.com/stripe/stripe-node/pull/719) Define 'type' as a property on errors rather than a getter
- [#709](https://github.com/stripe/stripe-node/pull/709) README: imply context of stripe-node
- [#717](https://github.com/stripe/stripe-node/pull/717) Contributor Convenant
## 7.10.0 - 2019-10-08
- [#699](https://github.com/stripe/stripe-node/pull/699) Add request-specific fields from raw error to top level error
## 7.9.1 - 2019-09-17
- [#692](https://github.com/stripe/stripe-node/pull/692) Retry based on `Stripe-Should-Retry` and `Retry-After` headers
## 7.9.0 - 2019-09-09
- [#691](https://github.com/stripe/stripe-node/pull/691) GET and DELETE requests data: body->queryParams
- [#684](https://github.com/stripe/stripe-node/pull/684) Bump eslint-utils from 1.3.1 to 1.4.2
## 7.8.0 - 2019-08-12
- [#678](https://github.com/stripe/stripe-node/pull/678) Add `subscriptionItems.createUsageRecord()` method
## 7.7.0 - 2019-08-09
- [#675](https://github.com/stripe/stripe-node/pull/675) Remove subscription schedule revisions
- This is technically a breaking change. We've chosen to release it as a minor vesion bump because the associated API is unused.
## 7.6.2 - 2019-08-09
- [#674](https://github.com/stripe/stripe-node/pull/674) Refactor requestDataProcessor for File out into its own file
## 7.6.1 - 2019-08-08
- [#673](https://github.com/stripe/stripe-node/pull/673) Add request start and end time to request and response events
## 7.6.0 - 2019-08-02
- [#661](https://github.com/stripe/stripe-node/pull/661) Refactor errors to ES6 classes.
- [#672](https://github.com/stripe/stripe-node/pull/672) Refinements to error ES6 classes.
## 7.5.5 - 2019-08-02
- [#665](https://github.com/stripe/stripe-node/pull/665) Remove `lodash.isplainobject`.
## 7.5.4 - 2019-08-01
- [#671](https://github.com/stripe/stripe-node/pull/671) Include a prefix in generated idempotency keys and remove uuid dependency.
## 7.5.3 - 2019-07-31
- [#667](https://github.com/stripe/stripe-node/pull/667) Refactor request headers, allowing any header to be overridden.
## 7.5.2 - 2019-07-30
- [#664](https://github.com/stripe/stripe-node/pull/664) Expose and use `once`
## 7.5.1 - 2019-07-30
- [#662](https://github.com/stripe/stripe-node/pull/662) Remove `safe-buffer` dependency
- [#666](https://github.com/stripe/stripe-node/pull/666) Bump lodash from 4.17.11 to 4.17.15
- [#668](https://github.com/stripe/stripe-node/pull/668) Move Balance History to /v1/balance_transactions
## 7.5.0 - 2019-07-24
- [#660](https://github.com/stripe/stripe-node/pull/660) Interpret any string in args as API Key instead of a regex
- ⚠️ Careful: passing strings which are not API Keys as as the final argument to a request previously would have ignored those strings, and would now result in the request failing with an authentication error.
- ⚠️ Careful: The private api `utils.isAuthKey` was removed.
- [#658](https://github.com/stripe/stripe-node/pull/658) Update README retry code sample to use two retries
- [#653](https://github.com/stripe/stripe-node/pull/653) Reorder customer methods
## 7.4.0 - 2019-06-27
- [#652](https://github.com/stripe/stripe-node/pull/652) Add support for the `SetupIntent` resource and APIs
## 7.3.0 - 2019-06-24
- [#649](https://github.com/stripe/stripe-node/pull/649) Enable request latency telemetry by default
## 7.2.0 - 2019-06-17
- [#608](https://github.com/stripe/stripe-node/pull/608) Add support for `CustomerBalanceTransaction` resource and APIs
## 7.1.0 - 2019-05-23
- [#632](https://github.com/stripe/stripe-node/pull/632) Add support for `radar.early_fraud_warning` resource
## 7.0.1 - 2019-05-22
- [#631](https://github.com/stripe/stripe-node/pull/631) Make autopagination functions work for `listLineItems` and `listUpcomingLineItems`
## 7.0.0 - 2019-05-14
Major version release. [The migration guide](https://github.com/stripe/stripe-node/wiki/Migration-guide-for-v7) contains a detailed list of backwards-incompatible changes with upgrade instructions.
Pull requests included in this release (cf. [#606](https://github.com/stripe/stripe-node/pull/606)) (⚠️ = breaking changes):
- ⚠️ Drop support for Node 4, 5 and 7 ([#606](https://github.com/stripe/stripe-node/pull/606))
- Prettier formatting ([#604](https://github.com/stripe/stripe-node/pull/604))
- Alphabetize “basic” methods ([#610](https://github.com/stripe/stripe-node/pull/610))
- Use `id` for single positional arguments ([#611](https://github.com/stripe/stripe-node/pull/611))
- Modernize ES5 to ES6 with lebab ([#607](https://github.com/stripe/stripe-node/pull/607))
- ⚠️ Remove deprecated methods ([#613](https://github.com/stripe/stripe-node/pull/613))
- Add VSCode and EditorConfig files ([#620](https://github.com/stripe/stripe-node/pull/620))
- ⚠️ Drop support for Node 9 and bump dependencies to latest versions ([#614](https://github.com/stripe/stripe-node/pull/614))
- Misc. manual formatting ([#623](https://github.com/stripe/stripe-node/pull/623))
- ⚠️ Remove legacy parameter support in `invoices.retrieveUpcoming()` ([#621](https://github.com/stripe/stripe-node/pull/621))
- ⚠️ Remove curried urlData and manually specified urlParams ([#625](https://github.com/stripe/stripe-node/pull/625))
- Extract resources file ([#626](https://github.com/stripe/stripe-node/pull/626))
## 6.36.0 - 2019-05-14
- [#622](https://github.com/stripe/stripe-node/pull/622) Add support for the `Capability` resource and APIs
## 6.35.0 - 2019-05-14
- [#627](https://github.com/stripe/stripe-node/pull/627) Add `listLineItems` and `listUpcomingLineItems` methods to `Invoice`
## 6.34.0 - 2019-05-08
- [#619](https://github.com/stripe/stripe-node/pull/619) Move `generateTestHeaderString` to stripe.webhooks (fixes a bug in 6.33.0)
## 6.33.0 - 2019-05-08
**Important**: This version is non-functional and has been yanked in favor of 6.32.0.
- [#609](https://github.com/stripe/stripe-node/pull/609) Add `generateWebhookHeaderString` to make it easier to mock webhook events
## 6.32.0 - 2019-05-07
- [#612](https://github.com/stripe/stripe-node/pull/612) Add `balanceTransactions` resource
## 6.31.2 - 2019-05-03
- [#602](https://github.com/stripe/stripe-node/pull/602) Handle errors from the oauth/token endpoint
## 6.31.1 - 2019-04-26
- [#600](https://github.com/stripe/stripe-node/pull/600) Fix encoding of nested parameters in multipart requests
## 6.31.0 - 2019-04-24
- [#588](https://github.com/stripe/stripe-node/pull/588) Add support for the `TaxRate` resource and APIs
## 6.30.0 - 2019-04-22
- [#589](https://github.com/stripe/stripe-node/pull/589) Add support for the `TaxId` resource and APIs
- [#593](https://github.com/stripe/stripe-node/pull/593) `retrieveUpcoming` on `Invoice` can now take one hash as parameter instead of requiring a customer id.
## 6.29.0 - 2019-04-18
- [#585](https://github.com/stripe/stripe-node/pull/585) Add support for the `CreditNote` resource and APIs
## 6.28.0 - 2019-03-18
- [#570](https://github.com/stripe/stripe-node/pull/570) Add support for the `PaymentMethod` resource and APIs
- [#578](https://github.com/stripe/stripe-node/pull/578) Add support for retrieving a Checkout `Session`
## 6.27.0 - 2019-03-15
- [#581](https://github.com/stripe/stripe-node/pull/581) Add support for deleting Terminal `Location` and `Reader`
## 6.26.1 - 2019-03-14
- [#580](https://github.com/stripe/stripe-node/pull/580) Fix support for HTTPS proxies
## 6.26.0 - 2019-03-11
- [#574](https://github.com/stripe/stripe-node/pull/574) Encode `Date`s as Unix timestamps
## 6.25.1 - 2019-02-14
- [#565](https://github.com/stripe/stripe-node/pull/565) Always encode arrays as integer-indexed hashes
## 6.25.0 - 2019-02-13
- [#559](https://github.com/stripe/stripe-node/pull/559) Add `stripe.setMaxNetworkRetries(n)` for automatic network retries
## 6.24.0 - 2019-02-12
- [#562](https://github.com/stripe/stripe-node/pull/562) Add support for `SubscriptionSchedule` and `SubscriptionScheduleRevision`
## 6.23.1 - 2019-02-04
- [#560](https://github.com/stripe/stripe-node/pull/560) Enable persistent connections by default
## 6.23.0 - 2019-01-30
- [#557](https://github.com/stripe/stripe-node/pull/557) Add configurable telemetry to gather information on client-side request latency
## 6.22.0 - 2019-01-25
- [#555](https://github.com/stripe/stripe-node/pull/555) Add support for OAuth methods
## 6.21.0 - 2019-01-23
- [#551](https://github.com/stripe/stripe-node/pull/551) Rename `CheckoutSession` to `Session` and move it under the `checkout` namespace. This is a breaking change, but we've reached out to affected merchants and all new merchants would use the new approach.
## 6.20.1 - 2019-01-17
- [#552](https://github.com/stripe/stripe-node/pull/552) Fix `Buffer` deprecation warnings
## 6.20.0 - 2018-12-21
- [#539](https://github.com/stripe/stripe-node/pull/539) Add support for the `CheckoutSession` resource
## 6.19.0 - 2018-12-10
- [#535](https://github.com/stripe/stripe-node/pull/535) Add support for account links
## 6.18.1 - 2018-12-07
- [#534](https://github.com/stripe/stripe-node/pull/534) Fix iterating on `files.list` method
## 6.18.0 - 2018-12-06
- [#530](https://github.com/stripe/stripe-node/pull/530) Export errors on root Stripe object
## 6.17.0 - 2018-11-28
- [#527](https://github.com/stripe/stripe-node/pull/527) Add support for the `Review` APIs
## 6.16.0 - 2018-11-27
- [#515](https://github.com/stripe/stripe-node/pull/515) Add support for `ValueLists` and `ValueListItems` for Radar
## 6.15.2 - 2018-11-26
- [#526](https://github.com/stripe/stripe-node/pull/526) Fixes an accidental mutation of input in rare cases
## 6.15.1 - 2018-11-23
- [#523](https://github.com/stripe/stripe-node/pull/523) Handle `Buffer` instances in `Webhook.constructEvent`
## 6.15.0 - 2018-11-12
- [#474](https://github.com/stripe/stripe-node/pull/474) Add support for `partner_id` in `setAppInfo`
## 6.14.0 - 2018-11-09
- [#509](https://github.com/stripe/stripe-node/pull/509) Add support for new `Invoice` methods
## 6.13.0 - 2018-10-30
- [#507](https://github.com/stripe/stripe-node/pull/507) Add support for persons
- [#510](https://github.com/stripe/stripe-node/pull/510) Add support for webhook endpoints
## 6.12.1 - 2018-09-24
- [#502](https://github.com/stripe/stripe-node/pull/502) Fix test suite
## 6.12.0 - 2018-09-24
- [#498](https://github.com/stripe/stripe-node/pull/498) Add support for Stripe Terminal
- [#500](https://github.com/stripe/stripe-node/pull/500) Rename `FileUploads` to `Files`. For backwards compatibility, `Files` is aliased to `FileUploads`. `FileUploads` is deprecated and will be removed from the next major version.
## 6.11.0 - 2018-09-18
- [#496](https://github.com/stripe/stripe-node/pull/496) Add auto-pagination
## 6.10.0 - 2018-09-05
- [#491](https://github.com/stripe/stripe-node/pull/491) Add support for usage record summaries
## 6.9.0 - 2018-09-05
- [#493](https://github.com/stripe/stripe-node/pull/493) Add support for reporting resources
## 6.8.0 - 2018-08-27
- [#488](https://github.com/stripe/stripe-node/pull/488) Remove support for `BitcoinReceivers` write-actions
## 6.7.0 - 2018-08-03
- [#485](https://github.com/stripe/stripe-node/pull/485) Add support for `cancel` on topups
## 6.6.0 - 2018-08-02
- [#483](https://github.com/stripe/stripe-node/pull/483) Add support for file links
## 6.5.0 - 2018-07-28
- [#482](https://github.com/stripe/stripe-node/pull/482) Add support for Sigma scheduled query runs
## 6.4.0 - 2018-07-26
- [#481](https://github.com/stripe/stripe-node/pull/481) Add support for Stripe Issuing
## 6.3.0 - 2018-07-18
- [#471](https://github.com/stripe/stripe-node/pull/471) Add support for streams in file uploads
## 6.2.1 - 2018-07-03
- [#475](https://github.com/stripe/stripe-node/pull/475) Fixes array encoding of subscription items for the upcoming invoices endpoint.
## 6.2.0 - 2018-06-28
- [#473](https://github.com/stripe/stripe-node/pull/473) Add support for payment intents
## 6.1.1 - 2018-06-07
- [#469](https://github.com/stripe/stripe-node/pull/469) Add `.npmignore` to create a lighter package (minus examples and tests)
## 6.1.0 - 2018-06-01
- [#465](https://github.com/stripe/stripe-node/pull/465) Warn when unknown options are passed to functions
## 6.0.0 - 2018-05-14
- [#453](https://github.com/stripe/stripe-node/pull/453) Re-implement usage record's `create` so that it correctly passes all arguments (this is a very minor breaking change)
## 5.10.0 - 2018-05-14
- [#459](https://github.com/stripe/stripe-node/pull/459) Export error types on `stripe.errors` so that errors can be matched with `instanceof` instead of comparing the strings generated by `type`
## 5.9.0 - 2018-05-09
- [#456](https://github.com/stripe/stripe-node/pull/456) Add support for issuer fraud records
## 5.8.0 - 2018-04-04
- [#444](https://github.com/stripe/stripe-node/pull/444) Introduce flexible billing primitives for subscriptions
## 5.7.0 - 2018-04-02
- [#441](https://github.com/stripe/stripe-node/pull/441) Write directly to a connection that's known to be still open
## 5.6.1 - 2018-03-25
- [#437](https://github.com/stripe/stripe-node/pull/437) Fix error message when passing invalid parameters to some API methods
## 5.6.0 - 2018-03-24
- [#439](https://github.com/stripe/stripe-node/pull/439) Drop Bluebird dependency and use native ES6 promises
## 5.5.0 - 2018-02-21
- [#425](https://github.com/stripe/stripe-node/pull/425) Add support for topups
## 5.4.0 - 2017-12-05
- [#412](https://github.com/stripe/stripe-node/pull/412) Add `StripeIdempotencyError` type for new kind of stripe error
## 5.3.0 - 2017-10-31
- [#405](https://github.com/stripe/stripe-node/pull/405) Support for exchange rates APIs
## 5.2.0 - 2017-10-26
- [#404](https://github.com/stripe/stripe-node/pull/404) Support for listing source transactions
## 5.1.1 - 2017-10-04
- [#394](https://github.com/stripe/stripe-node/pull/394) Fix improper warning for requests that have options but no parameters
## 5.1.0 - 2017-09-25
- Add check for when options are accidentally included in an arguments object
- Use safe-buffer package instead of building our own code
- Remove dependency on object-assign package
- Bump required versions of bluebird and qs
## 5.0.0 - 2017-09-12
- Drop support for Node 0.x (minimum required version is now >= 4)
## 4.25.0 - 2017-09-05
- Switch to Bearer token authentication on API requests
## 4.24.1 - 2017-08-25
- Specify UTF-8 encoding when verifying HMAC-SHA256 payloads
## 4.24.0 - 2017-08-10
- Support informational events with `Stripe.on` (see README for details)
## 4.23.2 - 2017-08-03
- Handle `Buffer.from` incompatibility for Node versions prior to 4.5.x
## 4.23.1 - 2017-06-24
- Properly encode subscription items when retrieving upcoming invoice
## 4.23.0 - 2017-06-20
- Add support for ephemeral keys
## 4.22.1 - 2017-06-20
- Fix usage of hasOwnProperty in utils
## 4.22.0 - 2017-05-25
- Make response headers accessible on error objects
## 4.21.0 - 2017-05-25
- Add support for account login links
## 4.20.0 - 2017-05-24
- Add `stripe.setAppInfo` for plugin authors to register app information
## 4.19.1 - 2017-05-18
- Tweak class initialization for compatibility with divergent JS engines
## 4.19.0 - 2017-05-11
- Support for checking webhook signatures
## 4.18.0 - 2017-04-12
- Reject ID parameters that don't look like strings
## 4.17.1 - 2017-04-05
- Fix paths in error messages on bad arguments
## 4.17.0 - 2017-03-31
- Add support for payouts
## 4.16.1 - 2017-03-30
- Fix bad reference to `requestId` when initializing errors
## 4.16.0 - 2017-03-22
- Make `requestId` available on resource `lastResponse` objects
## 4.15.1 - 2017-03-08
- Update required version of "qs" dependency to 6.0.4+
## 4.15.0 - 2017-01-18
- Add support for updating sources
## 4.14.0 - 2016-12-01
- Add support for verifying sources
## 4.13.0 - 2016-11-21
- Add retrieve method for 3-D Secure resources
## 4.12.0 - 2016-10-18
- Support for 403 status codes (permission denied)
## 4.11.0 - 2016-09-16
- Add support for Apple Pay domains
## 4.10.0 - 2016-08-29
- Refactor deprecated uses of Bluebird's `Promise.defer`
## 4.9.1 - 2016-08-22
- URI-encode unames for Stripe user agents so we don't fail on special characters
## 4.9.0 - 2016-07-19
- Add `Source` model for generic payment sources support (experimental)
## 4.8.0 - 2016-07-14
- Add `ThreeDSecure` model for 3-D secure payments
## 4.7.0 - 2016-05-25
- Add support for returning Relay orders
## 4.6.0 - 2016-05-04
- Add `update`, `create`, `retrieve`, `list` and `del` methods to `stripe.subscriptions`
## 4.5.0 - 2016-03-15
- Add `reject` on `Account` to support the new API feature
## 4.4.0 - 2016-02-08
- Add `CountrySpec` model for looking up country payment information
## 4.3.0 - 2016-01-26
- Add support for deleting Relay SKUs and products
## 4.2.0 - 2016-01-13
- Add `lastResponse` property on `StripeResource` objects
- Return usage errors of `stripeMethod` through callback instead of raising
- Use latest year for expiry years in tests to avoid new year problems
## 4.1.0 - 2015-12-02
- Add a verification routine for external accounts
## 4.0.0 - 2015-09-17
- Remove ability for API keys to be passed as 1st param to acct.retrieve
- Rename StripeInvalidRequest to StripeInvalidRequestError
## 3.9.0 - 2015-09-14
- Add Relay resources: Products, SKUs, and Orders
## 3.8.0 - 2015-09-11
- Added rate limiting responses
## 3.7.1 - 2015-08-17
- Added refund object with listing, retrieval, updating, and creation.
## 3.7.0 - 2015-08-03
- Added managed account deletion
- Added dispute listing and retrieval
## 3.6.0 - 2015-07-07
- Added request IDs to all Stripe errors
## 3.5.2 - 2015-06-30
- [BUGFIX] Fixed issue with uploading binary files (Gabriel Chagas Marques)
## 3.5.1 - 2015-06-30
- [BUGFIX] Fixed issue with passing arrays of objects
## 3.5.0 - 2015-06-11
- Added support for optional parameters when retrieving an upcoming invoice
(Matthew Arkin)
## 3.4.0 - 2015-06-10
- Added support for bank accounts and debit cards in managed accounts
## 3.3.4 - 2015-04-02
- Remove SSL revocation tests and check
## 3.3.3 - 2015-03-31
- [BUGFIX] Fix support for both stripe.account and stripe.accounts
## 3.3.2 - 2015-02-24
- Support transfer reversals.
## 3.3.1 - 2015-02-21
- [BUGFIX] Fix passing in only a callback to the Account resource. (Matthew Arkin)
## 3.3.0 - 2015-02-19
- Support BitcoinReceiver update & delete actions
- Add methods for manipulating customer sources as per 2015-02-18 API version
- The Account resource will now take an account ID. However, legacy use of the resource (without an account ID) will still work.
## 3.2.0 - 2015-02-05
- [BUGFIX] Fix incorrect failing tests for headers support
- Update all dependencies (remove mocha-as-promised)
- Switch to bluebird for promises
## 3.1.0 - 2015-01-21
- Support making bitcoin charges through BitcoinReceiver source object
## 3.0.3 - 2014-12-23
- Adding file uploads as a resource.
## 3.0.2 - 2014-11-26
- [BUGFIX] Fix issue where multiple expand params were not getting passed through (#130)
## 3.0.1 - 2014-11-26
- (Version skipped due to npm mishap)
## 3.0.0 - 2014-11-18
- [BUGFIX] Fix `stringifyRequestData` to deal with nested objs correctly
- Bump MAJOR as we're no longer supporting Node 0.8
## 2.9.0 - 2014-11-12
- Allow setting of HTTP agent (proxy) (issue #124)
- Add stack traces to all Stripe Errors
## 2.8.0 - 2014-07-26
- Make application fee refunds a list instead of array
## 2.7.4 - 2014-07-17
- [BUGFIX] Fix lack of subscription param in `invoices#retrieveUpcoming` method
- Add support for an `optional!` annotation on `urlParams`
## 2.7.3 - 2014-06-17
- Add metadata to disputes and refunds
## 2.6.3 - 2014-05-21
- Support cards for recipients.
## 2.5.3 - 2014-05-16
- Allow the `update` method on coupons for metadata changes
## 2.5.2 - 2014-04-28
- [BUGFIX] Fix when.js version string in package.json to support older npm versions
## 2.5.1 - 2014-04-25
- [BUGFIX] Fix revoked-ssl check
- Upgrade when.js to 3.1.0
## 2.5.0 - 2014-04-09
- Ensure we prevent requests using revoked SSL certs
## 2.4.5 - 2014-04-08
- Add better checks for incorrect arguments (throw exceptions accordingly).
- Validate the Connect Auth key, if passed
## 2.4.4 - 2014-03-27
- [BUGFIX] Fix URL encoding issue (not encoding interpolated URL params, see issue #93)
## 2.4.3 - 2014-03-27
- Add more debug information to the case of a failed `JSON.parse()`
## 2.4.2 - 2014-02-20
- Add binding for `transfers/{tr_id}/transactions` endpoint
## 2.4.1 - 2014-02-07
- Ensure raw error object is accessible on the generated StripeError
## 2.4.0 - 2014-01-29
- Support multiple subscriptions per customer
## 2.3.4 - 2014-01-11
- [BUGFIX] Fix #76, pass latest as version to api & fix constructor arg signature
## 2.3.3 - 2014-01-10
- Document cancelSubscription method params and add specs for `at_period_end`
## 2.3.2 - 2013-12-02
- Add application fees API
## 2.2.2 - 2013-11-20
- [BUGFIX] Fix incorrect deleteDiscount method & related spec(s)
### 2.2.1 - 2013-12-01
- [BUGFIX] Fix user-agent header issue (see issue #75)
## 2.2.0 - 2013-11-09
- Add support for setTimeout
- Add specs for invoice-item listing/querying via timestamp
## 2.1.0 - 2013-11-07
- Support single key/value setting on setMetadata method
- [BUGFIX] Fix Windows url-path issue
- Add missing stripe.charges.update method
- Support setting auth_token per request (useful in Connect)
- Remove global 'resources' variable
## 2.0.0 - 2013-10-18
- API overhaul and refactor, including addition of promises.
- Release of version 2.0.0
## 1.3.0 - 2013-01-30
- Requests return Javascript Errors (Guillaume Flandre)
## 1.2.0 - 2012-08-03
- Added events API (Jonathan Hollinger)
- Added plans update API (Pavan Kumar Sunkara)
- Various test fixes, node 0.8.x tweaks (Jan Lehnardt)
## 1.1.0 - 2012-02-01
- Add Coupons API (Ryan)
- Pass a more robust error object to the callback (Ryan)
- Fix duplicate callbacks from some functions when called incorrectly (bug #24, reported by Kishore Nallan)
## 1.0.0 - 2011-12-06
- Add APIs and tests for Plans and "Invoice Items"
(both changes by Ryan Ettipio)
## 0.0.5 - 2011-11-26
- Add Subscription API (John Ku, #3)
- Add Invoices API (Chris Winn, #6)
- [BUGFIX] Fix a bug where callback could be called twice, if the callback() threw an error itself (Peteris Krumins)
- [BUGFIX] Fix bug in tokens.retrieve API (Xavi)
- Change documentation links (Stripe changed their URL structure)
- Make tests pass again (error in callback is null instead of 0 if all is well)
- Amount in stripe.charges.refund is optional (Branko Vukelic)
- Various documentation fixes (Xavi)
- Only require node 0.4.0
## 0.0.3 - 2011-10-05
- Add Charges API (issue #1, brackishlake)
- Add customers.list API
## 0.0.2 - 2011-09-28
- Initial release with customers and tokens APIs
+20
View File
@@ -0,0 +1,20 @@
Copyright (C) 2011 Ask Bjørn Hansen
Copyright (C) 2013 Stripe, Inc. (https://stripe.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
+579
View File
@@ -0,0 +1,579 @@
# Stripe Node.js Library
[![Version](https://img.shields.io/npm/v/stripe.svg)](https://www.npmjs.org/package/stripe)
[![Build Status](https://github.com/stripe/stripe-node/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/stripe/stripe-node/actions?query=branch%3Amaster)
[![Coverage Status](https://coveralls.io/repos/github/stripe/stripe-node/badge.svg?branch=master)](https://coveralls.io/github/stripe/stripe-node?branch=master)
[![Downloads](https://img.shields.io/npm/dm/stripe.svg)](https://www.npmjs.com/package/stripe)
[![Try on RunKit](https://badge.runkitcdn.com/stripe.svg)](https://runkit.com/npm/stripe)
The Stripe Node library provides convenient access to the Stripe API from
applications written in server-side JavaScript.
For collecting customer and payment information in the browser, use [Stripe.js][stripe-js].
## Documentation
See the [`stripe-node` API docs](https://stripe.com/docs/api?lang=node) for Node.js.
See [video demonstrations][youtube-playlist] covering how to use the library.
## Requirements
Node 12 or higher.
## Installation
Install the package with:
```sh
npm install stripe
# or
yarn add stripe
```
## Usage
The package needs to be configured with your account's secret key, which is
available in the [Stripe Dashboard][api-keys]. Require it with the key's
value:
<!-- prettier-ignore -->
```js
const stripe = require('stripe')('sk_test_...');
stripe.customers.create({
email: 'customer@example.com',
})
.then(customer => console.log(customer.id))
.catch(error => console.error(error));
```
Or using ES modules and `async`/`await`:
```js
import Stripe from 'stripe';
const stripe = new Stripe('sk_test_...');
const customer = await stripe.customers.create({
email: 'customer@example.com',
});
console.log(customer.id);
```
### Usage with TypeScript
As of 8.0.1, Stripe maintains types for the latest [API version][api-versions].
Import Stripe as a default import (not `* as Stripe`, unlike the DefinitelyTyped version)
and instantiate it as `new Stripe()` with the latest API version.
```ts
import Stripe from 'stripe';
const stripe = new Stripe('sk_test_...', {
apiVersion: '2022-11-15',
});
const createCustomer = async () => {
const params: Stripe.CustomerCreateParams = {
description: 'test customer',
};
const customer: Stripe.Customer = await stripe.customers.create(params);
console.log(customer.id);
};
createCustomer();
```
You can find a full TS server example in [stripe-samples](https://github.com/stripe-samples/accept-a-payment/tree/main/custom-payment-flow/server/node-typescript).
#### Using old API versions with TypeScript
Types can change between API versions (e.g., Stripe may have changed a field from a string to a hash),
so our types only reflect the latest API version.
We therefore encourage [upgrading your API version][api-version-upgrading]
if you would like to take advantage of Stripe's TypeScript definitions.
If you are on an older API version (e.g., `2019-10-17`) and not able to upgrade,
you may pass another version and use a comment like `// @ts-ignore stripe-version-2019-10-17` to silence type errors here
and anywhere the types differ between your API version and the latest.
When you upgrade, you should remove these comments.
We also recommend using `// @ts-ignore` if you have access to a beta feature and need to send parameters beyond the type definitions.
#### Using `expand` with TypeScript
[Expandable][expanding_objects] fields are typed as `string | Foo`,
so you must cast them appropriately, e.g.,
```ts
const paymentIntent: Stripe.PaymentIntent = await stripe.paymentIntents.retrieve(
'pi_123456789',
{
expand: ['customer'],
}
);
const customerEmail: string = (paymentIntent.customer as Stripe.Customer).email;
```
### Using Promises
Every method returns a chainable promise which can be used instead of a regular
callback:
```js
// Create a new customer and then create an invoice item then invoice it:
stripe.customers
.create({
email: 'customer@example.com',
})
.then((customer) => {
// have access to the customer object
return stripe.invoiceItems
.create({
customer: customer.id, // set the customer id
amount: 2500, // 25
currency: 'usd',
description: 'One-time setup fee',
})
.then((invoiceItem) => {
return stripe.invoices.create({
collection_method: 'send_invoice',
customer: invoiceItem.customer,
});
})
.then((invoice) => {
// New invoice created on a new customer
})
.catch((err) => {
// Deal with an error
});
});
```
### Usage with Deno
As of 11.16.0, stripe-node provides a `deno` export target. In your Deno project, import stripe-node using an npm specifier:
Import using npm specifiers:
```js
import Stripe from 'npm:stripe';
```
Please see https://github.com/stripe-samples/stripe-node-deno-samples for more detailed examples and instructions on how to use stripe-node in Deno.
## Configuration
### Initialize with config object
The package can be initialized with several options:
```js
import ProxyAgent from 'https-proxy-agent';
const stripe = Stripe('sk_test_...', {
apiVersion: '2019-08-08',
maxNetworkRetries: 1,
httpAgent: new ProxyAgent(process.env.http_proxy),
timeout: 1000,
host: 'api.example.com',
port: 123,
telemetry: true,
});
```
| Option | Default | Description |
| ------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `apiVersion` | `null` | Stripe API version to be used. If not set, stripe-node will use the latest version at the time of release. |
| `maxNetworkRetries` | 0 | The amount of times a request should be [retried](#network-retries). |
| `httpAgent` | `null` | [Proxy](#configuring-a-proxy) agent to be used by the library. |
| `timeout` | 80000 | [Maximum time each request can take in ms.](#configuring-timeout) |
| `host` | `'api.stripe.com'` | Host that requests are made to. |
| `port` | 443 | Port that requests are made to. |
| `protocol` | `'https'` | `'https'` or `'http'`. `http` is never appropriate for sending requests to Stripe servers, and we strongly discourage `http`, even in local testing scenarios, as this can result in your credentials being transmitted over an insecure channel. |
| `telemetry` | `true` | Allow Stripe to send latency [telemetry](#request-latency-telemetry). |
> **Note**
> Both `maxNetworkRetries` and `timeout` can be overridden on a per-request basis.
### Configuring Timeout
Timeout can be set globally via the config object:
```js
const stripe = Stripe('sk_test_...', {
timeout: 20 * 1000, // 20 seconds
});
```
And overridden on a per-request basis:
```js
stripe.customers.create(
{
email: 'customer@example.com',
},
{
timeout: 1000, // 1 second
}
);
```
### Configuring For Connect
A per-request `Stripe-Account` header for use with [Stripe Connect][connect]
can be added to any method:
```js
// List the balance transactions for a connected account:
stripe.balanceTransactions.list(
{
limit: 10,
},
{
stripeAccount: 'acct_foo',
}
);
```
### Configuring a Proxy
To use stripe behind a proxy you can pass an [https-proxy-agent][https-proxy-agent] on initialization:
```js
if (process.env.http_proxy) {
const ProxyAgent = require('https-proxy-agent');
const stripe = Stripe('sk_test_...', {
httpAgent: new ProxyAgent(process.env.http_proxy),
});
}
```
### Network retries
Automatic network retries can be enabled with the `maxNetworkRetries` config option.
This will retry requests `n` times with exponential backoff if they fail due to an intermittent network problem.
[Idempotency keys](https://stripe.com/docs/api/idempotent_requests) are added where appropriate to prevent duplication.
```js
const stripe = Stripe('sk_test_...', {
maxNetworkRetries: 2, // Retry a request twice before giving up
});
```
Network retries can also be set on a per-request basis:
```js
stripe.customers.create(
{
email: 'customer@example.com',
},
{
maxNetworkRetries: 2, // Retry this specific request twice before giving up
}
);
```
### Examining Responses
Some information about the response which generated a resource is available
with the `lastResponse` property:
```js
customer.lastResponse.requestId; // see: https://stripe.com/docs/api/request_ids?lang=node
customer.lastResponse.statusCode;
```
### `request` and `response` events
The Stripe object emits `request` and `response` events. You can use them like this:
```js
const stripe = require('stripe')('sk_test_...');
const onRequest = (request) => {
// Do something.
};
// Add the event handler function:
stripe.on('request', onRequest);
// Remove the event handler function:
stripe.off('request', onRequest);
```
#### `request` object
```js
{
api_version: 'latest',
account: 'acct_TEST', // Only present if provided
idempotency_key: 'abc123', // Only present if provided
method: 'POST',
path: '/v1/customers',
request_start_time: 1565125303932 // Unix timestamp in milliseconds
}
```
#### `response` object
```js
{
api_version: 'latest',
account: 'acct_TEST', // Only present if provided
idempotency_key: 'abc123', // Only present if provided
method: 'POST',
path: '/v1/customers',
status: 402,
request_id: 'req_Ghc9r26ts73DRf',
elapsed: 445, // Elapsed time in milliseconds
request_start_time: 1565125303932, // Unix timestamp in milliseconds
request_end_time: 1565125304377 // Unix timestamp in milliseconds
}
```
### Webhook signing
Stripe can optionally sign the webhook events it sends to your endpoint, allowing you to validate that they were not sent by a third-party. You can read more about it [here](https://stripe.com/docs/webhooks/signatures).
Please note that you must pass the _raw_ request body, exactly as received from Stripe, to the `constructEvent()` function; this will not work with a parsed (i.e., JSON) request body.
You can find an example of how to use this with various JavaScript frameworks in [`examples/webhook-signing`](examples/webhook-signing) folder, but here's what it looks like:
```js
const event = stripe.webhooks.constructEvent(
webhookRawBody,
webhookStripeSignatureHeader,
webhookSecret
);
```
#### Testing Webhook signing
You can use `stripe.webhooks.generateTestHeaderString` to mock webhook events that come from Stripe:
```js
const payload = {
id: 'evt_test_webhook',
object: 'event',
};
const payloadString = JSON.stringify(payload, null, 2);
const secret = 'whsec_test_secret';
const header = stripe.webhooks.generateTestHeaderString({
payload: payloadString,
secret,
});
const event = stripe.webhooks.constructEvent(payloadString, header, secret);
// Do something with mocked signed event
expect(event.id).to.equal(payload.id);
```
### Writing a Plugin
If you're writing a plugin that uses the library, we'd appreciate it if you instantiated your stripe client with `appInfo`, eg;
```js
const stripe = require('stripe')('sk_test_...', {
appInfo: {
name: 'MyAwesomePlugin',
version: '1.2.34', // Optional
url: 'https://myawesomeplugin.info', // Optional
}
});
```
Or using ES modules or TypeScript:
```js
const stripe = new Stripe(apiKey, {
appInfo: {
name: 'MyAwesomePlugin',
version: '1.2.34', // Optional
url: 'https://myawesomeplugin.info', // Optional
}
});
```
This information is passed along when the library makes calls to the Stripe API.
### Auto-pagination
We provide a few different APIs for this to aid with a variety of node versions and styles.
#### Async iterators (`for-await-of`)
If you are in a Node environment that has support for [async iteration](https://github.com/tc39/proposal-async-iteration#the-async-iteration-statement-for-await-of),
such as Node 10+ or [babel](https://babeljs.io/docs/en/babel-plugin-transform-async-generator-functions),
the following will auto-paginate:
```js
for await (const customer of stripe.customers.list()) {
doSomething(customer);
if (shouldStop()) {
break;
}
}
```
#### `autoPagingEach`
If you are in a Node environment that has support for `await`, such as Node 7.9 and greater,
you may pass an async function to `.autoPagingEach`:
```js
await stripe.customers.list().autoPagingEach(async (customer) => {
await doSomething(customer);
if (shouldBreak()) {
return false;
}
});
console.log('Done iterating.');
```
Equivalently, without `await`, you may return a Promise, which can resolve to `false` to break:
```js
stripe.customers
.list()
.autoPagingEach((customer) => {
return doSomething(customer).then(() => {
if (shouldBreak()) {
return false;
}
});
})
.then(() => {
console.log('Done iterating.');
})
.catch(handleError);
```
#### `autoPagingToArray`
This is a convenience for cases where you expect the number of items
to be relatively small; accordingly, you must pass a `limit` option
to prevent runaway list growth from consuming too much memory.
Returns a promise of an array of all items across pages for a list request.
```js
const allNewCustomers = await stripe.customers
.list({created: {gt: lastMonth}})
.autoPagingToArray({limit: 10000});
```
### Request latency telemetry
By default, the library sends request latency telemetry to Stripe. These
numbers help Stripe improve the overall latency of its API for all users.
You can disable this behavior if you prefer:
```js
const stripe = new Stripe('sk_test_...', {
telemetry: false,
});
```
### Beta SDKs
Stripe has features in the beta phase that can be accessed via the beta version of this package.
We would love for you to try these and share feedback with us before these features reach the stable phase.
The beta versions can be installed in one of two ways
- To install the latest beta version, run the command `npm install stripe@beta --save`
- To install a specific beta version, replace the term "beta" in the above command with the version number like `npm install stripe@1.2.3-beta.1 --save`
> **Note**
> There can be breaking changes between beta versions. Therefore we recommend pinning the package version to a specific beta version in your package.json file. This way you can install the same version each time without breaking changes unless you are intentionally looking for the latest beta version.
We highly recommend keeping an eye on when the beta feature you are interested in goes from beta to stable so that you can move from using a beta version of the SDK to the stable version.
The versions tab on the [stripe page on npm](https://www.npmjs.com/package/stripe) lists the current tags in use. The `beta` tag here corresponds to the the latest beta version of the package.
If your beta feature requires a `Stripe-Version` header to be sent, use the `apiVersion` property of `config` object to set it:
```js
const stripe = new Stripe('sk_test_...', {
apiVersion: '2022-08-01; feature_beta=v3',
});
```
## Support
New features and bug fixes are released on the latest major version of the `stripe` package. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates.
## More Information
- [REST API Version](https://github.com/stripe/stripe-node/wiki/REST-API-Version)
- [Error Handling](https://github.com/stripe/stripe-node/wiki/Error-Handling)
- [Passing Options](https://github.com/stripe/stripe-node/wiki/Passing-Options)
- [Using Stripe Connect](https://github.com/stripe/stripe-node/wiki/Using-Stripe-Connect-with-node.js)
## Development
Run all tests:
```bash
$ yarn install
$ yarn test
```
If you do not have `yarn` installed, you can get it with `npm install --global yarn`.
The tests also depends on [stripe-mock][stripe-mock], so make sure to fetch and
run it from a background terminal ([stripe-mock's README][stripe-mock-usage]
also contains instructions for installing via Homebrew and other methods):
```bash
go get -u github.com/stripe/stripe-mock
stripe-mock
```
Run a single test suite without a coverage report:
```bash
$ yarn mocha-only test/Error.spec.ts
```
Run a single test (case sensitive) in watch mode:
```bash
$ yarn mocha-only test/Error.spec.ts --grep 'Populates with type' --watch
```
If you wish, you may run tests using your Stripe _Test_ API key by setting the
environment variable `STRIPE_TEST_API_KEY` before running the tests:
```bash
$ export STRIPE_TEST_API_KEY='sk_test....'
$ yarn test
```
Run prettier:
Add an [editor integration](https://prettier.io/docs/en/editors.html) or:
```bash
$ yarn fix
```
[api-keys]: https://dashboard.stripe.com/account/apikeys
[api-versions]: https://stripe.com/docs/api/versioning
[api-version-upgrading]: https://stripe.com/docs/upgrades#how-can-i-upgrade-my-api
[connect]: https://stripe.com/connect
[expanding_objects]: https://stripe.com/docs/api/expanding_objects
[https-proxy-agent]: https://github.com/TooTallNate/node-https-proxy-agent
[stripe-js]: https://stripe.com/docs/js
[stripe-mock]: https://github.com/stripe/stripe-mock
[stripe-mock-usage]: https://github.com/stripe/stripe-mock#usage
[youtube-playlist]: https://www.youtube.com/playlist?list=PLy1nL-pvL2M5xNIuNapwmABwEy2uifAlY
<!--
# vim: set tw=79:
-->
+1
View File
@@ -0,0 +1 @@
12.18.0
+146
View File
@@ -0,0 +1,146 @@
"use strict";
/* eslint-disable camelcase */
Object.defineProperty(exports, "__esModule", { value: true });
exports.StripeUnknownError = exports.StripeInvalidGrantError = exports.StripeIdempotencyError = exports.StripeSignatureVerificationError = exports.StripeConnectionError = exports.StripeRateLimitError = exports.StripePermissionError = exports.StripeAuthenticationError = exports.StripeAPIError = exports.StripeInvalidRequestError = exports.StripeCardError = exports.StripeError = exports.generate = void 0;
const generate = (rawStripeError) => {
switch (rawStripeError.type) {
case 'card_error':
return new StripeCardError(rawStripeError);
case 'invalid_request_error':
return new StripeInvalidRequestError(rawStripeError);
case 'api_error':
return new StripeAPIError(rawStripeError);
case 'authentication_error':
return new StripeAuthenticationError(rawStripeError);
case 'rate_limit_error':
return new StripeRateLimitError(rawStripeError);
case 'idempotency_error':
return new StripeIdempotencyError(rawStripeError);
case 'invalid_grant':
return new StripeInvalidGrantError(rawStripeError);
default:
return new StripeUnknownError(rawStripeError);
}
};
exports.generate = generate;
/**
* StripeError is the base error from which all other more specific Stripe errors derive.
* Specifically for errors returned from Stripe's REST API.
*/
class StripeError extends Error {
constructor(raw = {}) {
super(raw.message);
this.type = this.constructor.name;
this.raw = raw;
this.rawType = raw.type;
this.code = raw.code;
this.doc_url = raw.doc_url;
this.param = raw.param;
this.detail = raw.detail;
this.headers = raw.headers;
this.requestId = raw.requestId;
this.statusCode = raw.statusCode;
// @ts-ignore
this.message = raw.message;
this.charge = raw.charge;
this.decline_code = raw.decline_code;
this.payment_intent = raw.payment_intent;
this.payment_method = raw.payment_method;
this.payment_method_type = raw.payment_method_type;
this.setup_intent = raw.setup_intent;
this.source = raw.source;
}
}
exports.StripeError = StripeError;
/**
* Helper factory which takes raw stripe errors and outputs wrapping instances
*/
StripeError.generate = exports.generate;
// Specific Stripe Error types:
/**
* CardError is raised when a user enters a card that can't be charged for
* some reason.
*/
class StripeCardError extends StripeError {
}
exports.StripeCardError = StripeCardError;
/**
* InvalidRequestError is raised when a request is initiated with invalid
* parameters.
*/
class StripeInvalidRequestError extends StripeError {
}
exports.StripeInvalidRequestError = StripeInvalidRequestError;
/**
* APIError is a generic error that may be raised in cases where none of the
* other named errors cover the problem. It could also be raised in the case
* that a new error has been introduced in the API, but this version of the
* Node.JS SDK doesn't know how to handle it.
*/
class StripeAPIError extends StripeError {
}
exports.StripeAPIError = StripeAPIError;
/**
* AuthenticationError is raised when invalid credentials are used to connect
* to Stripe's servers.
*/
class StripeAuthenticationError extends StripeError {
}
exports.StripeAuthenticationError = StripeAuthenticationError;
/**
* PermissionError is raised in cases where access was attempted on a resource
* that wasn't allowed.
*/
class StripePermissionError extends StripeError {
}
exports.StripePermissionError = StripePermissionError;
/**
* RateLimitError is raised in cases where an account is putting too much load
* on Stripe's API servers (usually by performing too many requests). Please
* back off on request rate.
*/
class StripeRateLimitError extends StripeError {
}
exports.StripeRateLimitError = StripeRateLimitError;
/**
* StripeConnectionError is raised in the event that the SDK can't connect to
* Stripe's servers. That can be for a variety of different reasons from a
* downed network to a bad TLS certificate.
*/
class StripeConnectionError extends StripeError {
}
exports.StripeConnectionError = StripeConnectionError;
/**
* SignatureVerificationError is raised when the signature verification for a
* webhook fails
*/
class StripeSignatureVerificationError extends StripeError {
constructor(header, payload, raw = {}) {
super(raw);
this.header = header;
this.payload = payload;
}
}
exports.StripeSignatureVerificationError = StripeSignatureVerificationError;
/**
* IdempotencyError is raised in cases where an idempotency key was used
* improperly.
*/
class StripeIdempotencyError extends StripeError {
}
exports.StripeIdempotencyError = StripeIdempotencyError;
/**
* InvalidGrantError is raised when a specified code doesn't exist, is
* expired, has been used, or doesn't belong to you; a refresh token doesn't
* exist, or doesn't belong to you; or if an API key's mode (live or test)
* doesn't match the mode of a code or refresh token.
*/
class StripeInvalidGrantError extends StripeError {
}
exports.StripeInvalidGrantError = StripeInvalidGrantError;
/**
* Any other error from Stripe not specifically captured above
*/
class StripeUnknownError extends StripeError {
}
exports.StripeUnknownError = StripeUnknownError;
+352
View File
@@ -0,0 +1,352 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RequestSender = void 0;
const Error_js_1 = require("./Error.js");
const utils_js_1 = require("./utils.js");
const HttpClient_js_1 = require("./net/HttpClient.js");
const MAX_RETRY_AFTER_WAIT = 60;
class RequestSender {
constructor(stripe, maxBufferedRequestMetric) {
this._stripe = stripe;
this._maxBufferedRequestMetric = maxBufferedRequestMetric;
}
_addHeadersDirectlyToObject(obj, headers) {
// For convenience, make some headers easily accessible on
// lastResponse.
// NOTE: Stripe responds with lowercase header names/keys.
obj.requestId = headers['request-id'];
obj.stripeAccount = obj.stripeAccount || headers['stripe-account'];
obj.apiVersion = obj.apiVersion || headers['stripe-version'];
obj.idempotencyKey = obj.idempotencyKey || headers['idempotency-key'];
}
_makeResponseEvent(requestEvent, statusCode, headers) {
const requestEndTime = Date.now();
const requestDurationMs = requestEndTime - requestEvent.request_start_time;
return (0, utils_js_1.removeNullish)({
api_version: headers['stripe-version'],
account: headers['stripe-account'],
idempotency_key: headers['idempotency-key'],
method: requestEvent.method,
path: requestEvent.path,
status: statusCode,
request_id: this._getRequestId(headers),
elapsed: requestDurationMs,
request_start_time: requestEvent.request_start_time,
request_end_time: requestEndTime,
});
}
_getRequestId(headers) {
return headers['request-id'];
}
/**
* Used by methods with spec.streaming === true. For these methods, we do not
* buffer successful responses into memory or do parse them into stripe
* objects, we delegate that all of that to the user and pass back the raw
* http.Response object to the callback.
*
* (Unsuccessful responses shouldn't make it here, they should
* still be buffered/parsed and handled by _jsonResponseHandler -- see
* makeRequest)
*/
_streamingResponseHandler(requestEvent, callback) {
return (res) => {
const headers = res.getHeaders();
const streamCompleteCallback = () => {
const responseEvent = this._makeResponseEvent(requestEvent, res.getStatusCode(), headers);
this._stripe._emitter.emit('response', responseEvent);
this._recordRequestMetrics(this._getRequestId(headers), responseEvent.elapsed);
};
const stream = res.toStream(streamCompleteCallback);
// This is here for backwards compatibility, as the stream is a raw
// HTTP response in Node and the legacy behavior was to mutate this
// response.
this._addHeadersDirectlyToObject(stream, headers);
return callback(null, stream);
};
}
/**
* Default handler for Stripe responses. Buffers the response into memory,
* parses the JSON and returns it (i.e. passes it to the callback) if there
* is no "error" field. Otherwise constructs/passes an appropriate Error.
*/
_jsonResponseHandler(requestEvent, callback) {
return (res) => {
const headers = res.getHeaders();
const requestId = this._getRequestId(headers);
const statusCode = res.getStatusCode();
const responseEvent = this._makeResponseEvent(requestEvent, statusCode, headers);
this._stripe._emitter.emit('response', responseEvent);
res
.toJSON()
.then((jsonResponse) => {
if (jsonResponse.error) {
let err;
// Convert OAuth error responses into a standard format
// so that the rest of the error logic can be shared
if (typeof jsonResponse.error === 'string') {
jsonResponse.error = {
type: jsonResponse.error,
message: jsonResponse.error_description,
};
}
jsonResponse.error.headers = headers;
jsonResponse.error.statusCode = statusCode;
jsonResponse.error.requestId = requestId;
if (statusCode === 401) {
err = new Error_js_1.StripeAuthenticationError(jsonResponse.error);
}
else if (statusCode === 403) {
err = new Error_js_1.StripePermissionError(jsonResponse.error);
}
else if (statusCode === 429) {
err = new Error_js_1.StripeRateLimitError(jsonResponse.error);
}
else {
err = Error_js_1.StripeError.generate(jsonResponse.error);
}
throw err;
}
return jsonResponse;
}, (e) => {
throw new Error_js_1.StripeAPIError({
message: 'Invalid JSON received from the Stripe API',
exception: e,
requestId: headers['request-id'],
});
})
.then((jsonResponse) => {
this._recordRequestMetrics(requestId, responseEvent.elapsed);
// Expose raw response object.
const rawResponse = res.getRawResponse();
this._addHeadersDirectlyToObject(rawResponse, headers);
Object.defineProperty(jsonResponse, 'lastResponse', {
enumerable: false,
writable: false,
value: rawResponse,
});
callback(null, jsonResponse);
}, (e) => callback(e, null));
};
}
static _generateConnectionErrorMessage(requestRetries) {
return `An error occurred with our connection to Stripe.${requestRetries > 0 ? ` Request was retried ${requestRetries} times.` : ''}`;
}
// For more on when and how to retry API requests, see https://stripe.com/docs/error-handling#safely-retrying-requests-with-idempotency
static _shouldRetry(res, numRetries, maxRetries, error) {
if (error &&
numRetries === 0 &&
HttpClient_js_1.HttpClient.CONNECTION_CLOSED_ERROR_CODES.includes(error.code)) {
return true;
}
// Do not retry if we are out of retries.
if (numRetries >= maxRetries) {
return false;
}
// Retry on connection error.
if (!res) {
return true;
}
// The API may ask us not to retry (e.g., if doing so would be a no-op)
// or advise us to retry (e.g., in cases of lock timeouts); we defer to that.
if (res.getHeaders()['stripe-should-retry'] === 'false') {
return false;
}
if (res.getHeaders()['stripe-should-retry'] === 'true') {
return true;
}
// Retry on conflict errors.
if (res.getStatusCode() === 409) {
return true;
}
// Retry on 500, 503, and other internal errors.
//
// Note that we expect the stripe-should-retry header to be false
// in most cases when a 500 is returned, since our idempotency framework
// would typically replay it anyway.
if (res.getStatusCode() >= 500) {
return true;
}
return false;
}
_getSleepTimeInMS(numRetries, retryAfter = null) {
const initialNetworkRetryDelay = this._stripe.getInitialNetworkRetryDelay();
const maxNetworkRetryDelay = this._stripe.getMaxNetworkRetryDelay();
// Apply exponential backoff with initialNetworkRetryDelay on the
// number of numRetries so far as inputs. Do not allow the number to exceed
// maxNetworkRetryDelay.
let sleepSeconds = Math.min(initialNetworkRetryDelay * Math.pow(numRetries - 1, 2), maxNetworkRetryDelay);
// Apply some jitter by randomizing the value in the range of
// (sleepSeconds / 2) to (sleepSeconds).
sleepSeconds *= 0.5 * (1 + Math.random());
// But never sleep less than the base sleep seconds.
sleepSeconds = Math.max(initialNetworkRetryDelay, sleepSeconds);
// And never sleep less than the time the API asks us to wait, assuming it's a reasonable ask.
if (Number.isInteger(retryAfter) && retryAfter <= MAX_RETRY_AFTER_WAIT) {
sleepSeconds = Math.max(sleepSeconds, retryAfter);
}
return sleepSeconds * 1000;
}
// Max retries can be set on a per request basis. Favor those over the global setting
_getMaxNetworkRetries(settings = {}) {
return settings.maxNetworkRetries &&
Number.isInteger(settings.maxNetworkRetries)
? settings.maxNetworkRetries
: this._stripe.getMaxNetworkRetries();
}
_defaultIdempotencyKey(method, settings) {
// If this is a POST and we allow multiple retries, ensure an idempotency key.
const maxRetries = this._getMaxNetworkRetries(settings);
if (method === 'POST' && maxRetries > 0) {
return `stripe-node-retry-${this._stripe._platformFunctions.uuid4()}`;
}
return null;
}
_makeHeaders(auth, contentLength, apiVersion, clientUserAgent, method, userSuppliedHeaders, userSuppliedSettings) {
const defaultHeaders = {
// Use specified auth token or use default from this stripe instance:
Authorization: auth ? `Bearer ${auth}` : this._stripe.getApiField('auth'),
Accept: 'application/json',
'Content-Type': 'application/x-www-form-urlencoded',
'User-Agent': this._getUserAgentString(),
'X-Stripe-Client-User-Agent': clientUserAgent,
'X-Stripe-Client-Telemetry': this._getTelemetryHeader(),
'Stripe-Version': apiVersion,
'Stripe-Account': this._stripe.getApiField('stripeAccount'),
'Idempotency-Key': this._defaultIdempotencyKey(method, userSuppliedSettings),
};
// As per https://datatracker.ietf.org/doc/html/rfc7230#section-3.3.2:
// A user agent SHOULD send a Content-Length in a request message when
// no Transfer-Encoding is sent and the request method defines a meaning
// for an enclosed payload body. For example, a Content-Length header
// field is normally sent in a POST request even when the value is 0
// (indicating an empty payload body). A user agent SHOULD NOT send a
// Content-Length header field when the request message does not contain
// a payload body and the method semantics do not anticipate such a
// body.
//
// These method types are expected to have bodies and so we should always
// include a Content-Length.
const methodHasPayload = method == 'POST' || method == 'PUT' || method == 'PATCH';
// If a content length was specified, we always include it regardless of
// whether the method semantics anticipate such a body. This keeps us
// consistent with historical behavior. We do however want to warn on this
// and fix these cases as they are semantically incorrect.
if (methodHasPayload || contentLength) {
if (!methodHasPayload) {
(0, utils_js_1.emitWarning)(`${method} method had non-zero contentLength but no payload is expected for this verb`);
}
defaultHeaders['Content-Length'] = contentLength;
}
return Object.assign((0, utils_js_1.removeNullish)(defaultHeaders),
// If the user supplied, say 'idempotency-key', override instead of appending by ensuring caps are the same.
(0, utils_js_1.normalizeHeaders)(userSuppliedHeaders));
}
_getUserAgentString() {
const packageVersion = this._stripe.getConstant('PACKAGE_VERSION');
const appInfo = this._stripe._appInfo
? this._stripe.getAppInfoAsString()
: '';
return `Stripe/v1 NodeBindings/${packageVersion} ${appInfo}`.trim();
}
_getTelemetryHeader() {
if (this._stripe.getTelemetryEnabled() &&
this._stripe._prevRequestMetrics.length > 0) {
const metrics = this._stripe._prevRequestMetrics.shift();
return JSON.stringify({
last_request_metrics: metrics,
});
}
}
_recordRequestMetrics(requestId, requestDurationMs) {
if (this._stripe.getTelemetryEnabled() && requestId) {
if (this._stripe._prevRequestMetrics.length > this._maxBufferedRequestMetric) {
(0, utils_js_1.emitWarning)('Request metrics buffer is full, dropping telemetry message.');
}
else {
this._stripe._prevRequestMetrics.push({
request_id: requestId,
request_duration_ms: requestDurationMs,
});
}
}
}
_request(method, host, path, data, auth, options = {}, callback, requestDataProcessor = null) {
let requestData;
const retryRequest = (requestFn, apiVersion, headers, requestRetries, retryAfter) => {
return setTimeout(requestFn, this._getSleepTimeInMS(requestRetries, retryAfter), apiVersion, headers, requestRetries + 1);
};
const makeRequest = (apiVersion, headers, numRetries) => {
// timeout can be set on a per-request basis. Favor that over the global setting
const timeout = options.settings &&
options.settings.timeout &&
Number.isInteger(options.settings.timeout) &&
options.settings.timeout >= 0
? options.settings.timeout
: this._stripe.getApiField('timeout');
const req = this._stripe
.getApiField('httpClient')
.makeRequest(host || this._stripe.getApiField('host'), this._stripe.getApiField('port'), path, method, headers, requestData, this._stripe.getApiField('protocol'), timeout);
const requestStartTime = Date.now();
// @ts-ignore
const requestEvent = (0, utils_js_1.removeNullish)({
api_version: apiVersion,
account: headers['Stripe-Account'],
idempotency_key: headers['Idempotency-Key'],
method,
path,
request_start_time: requestStartTime,
});
const requestRetries = numRetries || 0;
const maxRetries = this._getMaxNetworkRetries(options.settings || {});
this._stripe._emitter.emit('request', requestEvent);
req
.then((res) => {
if (RequestSender._shouldRetry(res, requestRetries, maxRetries)) {
return retryRequest(makeRequest, apiVersion, headers, requestRetries,
// @ts-ignore
res.getHeaders()['retry-after']);
}
else if (options.streaming && res.getStatusCode() < 400) {
return this._streamingResponseHandler(requestEvent, callback)(res);
}
else {
return this._jsonResponseHandler(requestEvent, callback)(res);
}
})
.catch((error) => {
if (RequestSender._shouldRetry(null, requestRetries, maxRetries, error)) {
return retryRequest(makeRequest, apiVersion, headers, requestRetries, null);
}
else {
const isTimeoutError = error.code && error.code === HttpClient_js_1.HttpClient.TIMEOUT_ERROR_CODE;
return callback(new Error_js_1.StripeConnectionError({
message: isTimeoutError
? `Request aborted due to timeout being reached (${timeout}ms)`
: RequestSender._generateConnectionErrorMessage(requestRetries),
// @ts-ignore
detail: error,
}));
}
});
};
const prepareAndMakeRequest = (error, data) => {
if (error) {
return callback(error);
}
requestData = data;
this._stripe.getClientUserAgent((clientUserAgent) => {
var _a, _b;
const apiVersion = this._stripe.getApiField('version');
const headers = this._makeHeaders(auth, requestData.length, apiVersion, clientUserAgent, method, (_a = options.headers) !== null && _a !== void 0 ? _a : null, (_b = options.settings) !== null && _b !== void 0 ? _b : {});
makeRequest(apiVersion, headers, 0);
});
};
if (requestDataProcessor) {
requestDataProcessor(method, data, options.headers, prepareAndMakeRequest);
}
else {
prepareAndMakeRequest(null, (0, utils_js_1.stringifyRequestData)(data || {}));
}
}
}
exports.RequestSender = RequestSender;
+18
View File
@@ -0,0 +1,18 @@
"use strict";
// ResourceNamespace allows you to create nested resources, i.e. `stripe.issuing.cards`.
Object.defineProperty(exports, "__esModule", { value: true });
exports.resourceNamespace = void 0;
// It also works recursively, so you could do i.e. `stripe.billing.invoicing.pay`.
function ResourceNamespace(stripe, resources) {
for (const name in resources) {
const camelCaseName = name[0].toLowerCase() + name.substring(1);
const resource = new resources[name](stripe);
this[camelCaseName] = resource;
}
}
function resourceNamespace(namespace, resources) {
return function (stripe) {
return new ResourceNamespace(stripe, resources);
};
}
exports.resourceNamespace = resourceNamespace;
+46
View File
@@ -0,0 +1,46 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StripeEmitter = void 0;
/**
* @private
* (For internal use in stripe-node.)
* Wrapper around the Event Web API.
*/
class _StripeEvent extends Event {
constructor(eventName, data) {
super(eventName);
this.data = data;
}
}
/** Minimal EventEmitter wrapper around EventTarget. */
class StripeEmitter {
constructor() {
this.eventTarget = new EventTarget();
this.listenerMapping = new Map();
}
on(eventName, listener) {
const listenerWrapper = (event) => {
listener(event.data);
};
this.listenerMapping.set(listener, listenerWrapper);
return this.eventTarget.addEventListener(eventName, listenerWrapper);
}
removeListener(eventName, listener) {
const listenerWrapper = this.listenerMapping.get(listener);
this.listenerMapping.delete(listener);
return this.eventTarget.removeEventListener(eventName, listenerWrapper);
}
once(eventName, listener) {
const listenerWrapper = (event) => {
listener(event.data);
};
this.listenerMapping.set(listener, listenerWrapper);
return this.eventTarget.addEventListener(eventName, listenerWrapper, {
once: true,
});
}
emit(eventName, data) {
return this.eventTarget.dispatchEvent(new _StripeEvent(eventName, data));
}
}
exports.StripeEmitter = StripeEmitter;
+36
View File
@@ -0,0 +1,36 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.stripeMethod = void 0;
const utils_js_1 = require("./utils.js");
const autoPagination_js_1 = require("./autoPagination.js");
/**
* Create an API method from the declared spec.
*
* @param [spec.method='GET'] Request Method (POST, GET, DELETE, PUT)
* @param [spec.path=''] Path to be appended to the API BASE_PATH, joined with
* the instance's path (e.g. 'charges' or 'customers')
* @param [spec.fullPath=''] Fully qualified path to the method (eg. /v1/a/b/c).
* If this is specified, path should not be specified.
* @param [spec.urlParams=[]] Array of required arguments in the order that they
* must be passed by the consumer of the API. Subsequent optional arguments are
* optionally passed through a hash (Object) as the penultimate argument
* (preceding the also-optional callback argument
* @param [spec.encode] Function for mutating input parameters to a method.
* Usefully for applying transforms to data on a per-method basis.
* @param [spec.host] Hostname for the request.
*
* <!-- Public API accessible via Stripe.StripeResource.method -->
*/
function stripeMethod(spec) {
if (spec.path !== undefined && spec.fullPath !== undefined) {
throw new Error(`Method spec specified both a 'path' (${spec.path}) and a 'fullPath' (${spec.fullPath}).`);
}
return function (...args) {
const callback = typeof args[args.length - 1] == 'function' && args.pop();
spec.urlParams = (0, utils_js_1.extractUrlParams)(spec.fullPath || this.createResourcePathWithSymbols(spec.path || ''));
const requestPromise = (0, utils_js_1.callbackifyPromiseWithTimeout)(this._makeRequest(args, spec, {}), callback);
Object.assign(requestPromise, (0, autoPagination_js_1.makeAutoPaginationMethods)(this, args, spec, requestPromise));
return requestPromise;
};
}
exports.stripeMethod = stripeMethod;
+169
View File
@@ -0,0 +1,169 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StripeResource = void 0;
const utils_js_1 = require("./utils.js");
const StripeMethod_js_1 = require("./StripeMethod.js");
// Provide extension mechanism for Stripe Resource Sub-Classes
StripeResource.extend = utils_js_1.protoExtend;
// Expose method-creator
StripeResource.method = StripeMethod_js_1.stripeMethod;
StripeResource.MAX_BUFFERED_REQUEST_METRICS = 100;
/**
* Encapsulates request logic for a Stripe Resource
*/
function StripeResource(stripe, deprecatedUrlData) {
this._stripe = stripe;
if (deprecatedUrlData) {
throw new Error('Support for curried url params was dropped in stripe-node v7.0.0. Instead, pass two ids.');
}
this.basePath = (0, utils_js_1.makeURLInterpolator)(
// @ts-ignore changing type of basePath
this.basePath || stripe.getApiField('basePath'));
// @ts-ignore changing type of path
this.resourcePath = this.path;
// @ts-ignore changing type of path
this.path = (0, utils_js_1.makeURLInterpolator)(this.path);
this.initialize(...arguments);
}
exports.StripeResource = StripeResource;
StripeResource.prototype = {
_stripe: null,
// @ts-ignore the type of path changes in ctor
path: '',
resourcePath: '',
// Methods that don't use the API's default '/v1' path can override it with this setting.
basePath: null,
initialize() { },
// Function to override the default data processor. This allows full control
// over how a StripeResource's request data will get converted into an HTTP
// body. This is useful for non-standard HTTP requests. The function should
// take method name, data, and headers as arguments.
requestDataProcessor: null,
// Function to add a validation checks before sending the request, errors should
// be thrown, and they will be passed to the callback/promise.
validateRequest: null,
createFullPath(commandPath, urlData) {
const urlParts = [this.basePath(urlData), this.path(urlData)];
if (typeof commandPath === 'function') {
const computedCommandPath = commandPath(urlData);
// If we have no actual command path, we just omit it to avoid adding a
// trailing slash. This is important for top-level listing requests, which
// do not have a command path.
if (computedCommandPath) {
urlParts.push(computedCommandPath);
}
}
else {
urlParts.push(commandPath);
}
return this._joinUrlParts(urlParts);
},
// Creates a relative resource path with symbols left in (unlike
// createFullPath which takes some data to replace them with). For example it
// might produce: /invoices/{id}
createResourcePathWithSymbols(pathWithSymbols) {
// If there is no path beyond the resource path, we want to produce just
// /<resource path> rather than /<resource path>/.
if (pathWithSymbols) {
return `/${this._joinUrlParts([this.resourcePath, pathWithSymbols])}`;
}
else {
return `/${this.resourcePath}`;
}
},
_joinUrlParts(parts) {
// Replace any accidentally doubled up slashes. This previously used
// path.join, which would do this as well. Unfortunately we need to do this
// as the functions for creating paths are technically part of the public
// interface and so we need to preserve backwards compatibility.
return parts.join('/').replace(/\/{2,}/g, '/');
},
_getRequestOpts(requestArgs, spec, overrideData) {
// Extract spec values with defaults.
const requestMethod = (spec.method || 'GET').toUpperCase();
const urlParams = spec.urlParams || [];
const encode = spec.encode || ((data) => data);
const isUsingFullPath = !!spec.fullPath;
const commandPath = (0, utils_js_1.makeURLInterpolator)(isUsingFullPath ? spec.fullPath : spec.path || '');
// When using fullPath, we ignore the resource path as it should already be
// fully qualified.
const path = isUsingFullPath
? spec.fullPath
: this.createResourcePathWithSymbols(spec.path);
// Don't mutate args externally.
const args = [].slice.call(requestArgs);
// Generate and validate url params.
const urlData = urlParams.reduce((urlData, param) => {
const arg = args.shift();
if (typeof arg !== 'string') {
throw new Error(`Stripe: Argument "${param}" must be a string, but got: ${arg} (on API request to \`${requestMethod} ${path}\`)`);
}
urlData[param] = arg;
return urlData;
}, {});
// Pull request data and options (headers, auth) from args.
const dataFromArgs = (0, utils_js_1.getDataFromArgs)(args);
const data = encode(Object.assign({}, dataFromArgs, overrideData));
const options = (0, utils_js_1.getOptionsFromArgs)(args);
const host = options.host || spec.host;
const streaming = !!spec.streaming;
// Validate that there are no more args.
if (args.filter((x) => x != null).length) {
throw new Error(`Stripe: Unknown arguments (${args}). Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options. (on API request to ${requestMethod} \`${path}\`)`);
}
// When using full path, we can just invoke the URL interpolator directly
// as we don't need to use the resource to create a full path.
const requestPath = isUsingFullPath
? commandPath(urlData)
: this.createFullPath(commandPath, urlData);
const headers = Object.assign(options.headers, spec.headers);
if (spec.validator) {
spec.validator(data, { headers });
}
const dataInQuery = spec.method === 'GET' || spec.method === 'DELETE';
const bodyData = dataInQuery ? {} : data;
const queryData = dataInQuery ? data : {};
return {
requestMethod,
requestPath,
bodyData,
queryData,
auth: options.auth,
headers,
host: host !== null && host !== void 0 ? host : null,
streaming,
settings: options.settings,
};
},
_makeRequest(requestArgs, spec, overrideData) {
return new Promise((resolve, reject) => {
var _a;
let opts;
try {
opts = this._getRequestOpts(requestArgs, spec, overrideData);
}
catch (err) {
reject(err);
return;
}
function requestCallback(err, response) {
if (err) {
reject(err);
}
else {
resolve(spec.transformResponseData
? spec.transformResponseData(response)
: response);
}
}
const emptyQuery = Object.keys(opts.queryData).length === 0;
const path = [
opts.requestPath,
emptyQuery ? '' : '?',
(0, utils_js_1.stringifyRequestData)(opts.queryData),
].join('');
const { headers, settings } = opts;
this._stripe._requestSender._request(opts.requestMethod, opts.host, path, opts.bodyData, opts.auth, { headers, settings, streaming: opts.streaming }, requestCallback, (_a = this.requestDataProcessor) === null || _a === void 0 ? void 0 : _a.bind(this));
});
},
};
+198
View File
@@ -0,0 +1,198 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createWebhooks = void 0;
const Error_js_1 = require("./Error.js");
const CryptoProvider_js_1 = require("./crypto/CryptoProvider.js");
function createWebhooks(platformFunctions) {
const Webhook = {
DEFAULT_TOLERANCE: 300,
// @ts-ignore
signature: null,
constructEvent(payload, header, secret, tolerance, cryptoProvider, receivedAt) {
try {
this.signature.verifyHeader(payload, header, secret, tolerance || Webhook.DEFAULT_TOLERANCE, cryptoProvider, receivedAt);
}
catch (e) {
if (e instanceof CryptoProvider_js_1.CryptoProviderOnlySupportsAsyncError) {
e.message +=
'\nUse `await constructEventAsync(...)` instead of `constructEvent(...)`';
}
throw e;
}
const jsonPayload = payload instanceof Uint8Array
? JSON.parse(new TextDecoder('utf8').decode(payload))
: JSON.parse(payload);
return jsonPayload;
},
async constructEventAsync(payload, header, secret, tolerance, cryptoProvider, receivedAt) {
await this.signature.verifyHeaderAsync(payload, header, secret, tolerance || Webhook.DEFAULT_TOLERANCE, cryptoProvider, receivedAt);
const jsonPayload = payload instanceof Uint8Array
? JSON.parse(new TextDecoder('utf8').decode(payload))
: JSON.parse(payload);
return jsonPayload;
},
/**
* Generates a header to be used for webhook mocking
*
* @typedef {object} opts
* @property {number} timestamp - Timestamp of the header. Defaults to Date.now()
* @property {string} payload - JSON stringified payload object, containing the 'id' and 'object' parameters
* @property {string} secret - Stripe webhook secret 'whsec_...'
* @property {string} scheme - Version of API to hit. Defaults to 'v1'.
* @property {string} signature - Computed webhook signature
* @property {CryptoProvider} cryptoProvider - Crypto provider to use for computing the signature if none was provided. Defaults to NodeCryptoProvider.
*/
generateTestHeaderString: function (opts) {
if (!opts) {
throw new Error_js_1.StripeError({
message: 'Options are required',
});
}
opts.timestamp =
Math.floor(opts.timestamp) || Math.floor(Date.now() / 1000);
opts.scheme = opts.scheme || signature.EXPECTED_SCHEME;
opts.cryptoProvider = opts.cryptoProvider || getCryptoProvider();
opts.signature =
opts.signature ||
opts.cryptoProvider.computeHMACSignature(opts.timestamp + '.' + opts.payload, opts.secret);
const generatedHeader = [
't=' + opts.timestamp,
opts.scheme + '=' + opts.signature,
].join(',');
return generatedHeader;
},
};
const signature = {
EXPECTED_SCHEME: 'v1',
verifyHeader(encodedPayload, encodedHeader, secret, tolerance, cryptoProvider, receivedAt) {
const { decodedHeader: header, decodedPayload: payload, details, suspectPayloadType, } = parseEventDetails(encodedPayload, encodedHeader, this.EXPECTED_SCHEME);
const secretContainsWhitespace = /\s/.test(secret);
cryptoProvider = cryptoProvider || getCryptoProvider();
const expectedSignature = cryptoProvider.computeHMACSignature(makeHMACContent(payload, details), secret);
validateComputedSignature(payload, header, details, expectedSignature, tolerance, suspectPayloadType, secretContainsWhitespace, receivedAt);
return true;
},
async verifyHeaderAsync(encodedPayload, encodedHeader, secret, tolerance, cryptoProvider, receivedAt) {
const { decodedHeader: header, decodedPayload: payload, details, suspectPayloadType, } = parseEventDetails(encodedPayload, encodedHeader, this.EXPECTED_SCHEME);
const secretContainsWhitespace = /\s/.test(secret);
cryptoProvider = cryptoProvider || getCryptoProvider();
const expectedSignature = await cryptoProvider.computeHMACSignatureAsync(makeHMACContent(payload, details), secret);
return validateComputedSignature(payload, header, details, expectedSignature, tolerance, suspectPayloadType, secretContainsWhitespace, receivedAt);
},
};
function makeHMACContent(payload, details) {
return `${details.timestamp}.${payload}`;
}
function parseEventDetails(encodedPayload, encodedHeader, expectedScheme) {
if (!encodedPayload) {
throw new Error_js_1.StripeSignatureVerificationError(encodedHeader, encodedPayload, {
message: 'No webhook payload was provided.',
});
}
const suspectPayloadType = typeof encodedPayload != 'string' &&
!(encodedPayload instanceof Uint8Array);
const textDecoder = new TextDecoder('utf8');
const decodedPayload = encodedPayload instanceof Uint8Array
? textDecoder.decode(encodedPayload)
: encodedPayload;
// Express's type for `Request#headers` is `string | []string`
// which is because the `set-cookie` header is an array,
// but no other headers are an array (docs: https://nodejs.org/api/http.html#http_message_headers)
// (Express's Request class is an extension of http.IncomingMessage, and doesn't appear to be relevantly modified: https://github.com/expressjs/express/blob/master/lib/request.js#L31)
if (Array.isArray(encodedHeader)) {
throw new Error('Unexpected: An array was passed as a header, which should not be possible for the stripe-signature header.');
}
if (encodedHeader == null || encodedHeader == '') {
throw new Error_js_1.StripeSignatureVerificationError(encodedHeader, encodedPayload, {
message: 'No stripe-signature header value was provided.',
});
}
const decodedHeader = encodedHeader instanceof Uint8Array
? textDecoder.decode(encodedHeader)
: encodedHeader;
const details = parseHeader(decodedHeader, expectedScheme);
if (!details || details.timestamp === -1) {
throw new Error_js_1.StripeSignatureVerificationError(decodedHeader, decodedPayload, {
message: 'Unable to extract timestamp and signatures from header',
});
}
if (!details.signatures.length) {
throw new Error_js_1.StripeSignatureVerificationError(decodedHeader, decodedPayload, {
message: 'No signatures found with expected scheme',
});
}
return {
decodedPayload,
decodedHeader,
details,
suspectPayloadType,
};
}
function validateComputedSignature(payload, header, details, expectedSignature, tolerance, suspectPayloadType, secretContainsWhitespace, receivedAt) {
const signatureFound = !!details.signatures.filter(platformFunctions.secureCompare.bind(platformFunctions, expectedSignature)).length;
const docsLocation = '\nLearn more about webhook signing and explore webhook integration examples for various frameworks at ' +
'https://github.com/stripe/stripe-node#webhook-signing';
const whitespaceMessage = secretContainsWhitespace
? '\n\nNote: The provided signing secret contains whitespace. This often indicates an extra newline or space is in the value'
: '';
if (!signatureFound) {
if (suspectPayloadType) {
throw new Error_js_1.StripeSignatureVerificationError(header, payload, {
message: 'Webhook payload must be provided as a string or a Buffer (https://nodejs.org/api/buffer.html) instance representing the _raw_ request body.' +
'Payload was provided as a parsed JavaScript object instead. \n' +
'Signature verification is impossible without access to the original signed material. \n' +
docsLocation +
'\n' +
whitespaceMessage,
});
}
throw new Error_js_1.StripeSignatureVerificationError(header, payload, {
message: 'No signatures found matching the expected signature for payload.' +
' Are you passing the raw request body you received from Stripe? \n' +
docsLocation +
'\n' +
whitespaceMessage,
});
}
const timestampAge = Math.floor((typeof receivedAt === 'number' ? receivedAt : Date.now()) / 1000) - details.timestamp;
if (tolerance > 0 && timestampAge > tolerance) {
// @ts-ignore
throw new Error_js_1.StripeSignatureVerificationError(header, payload, {
message: 'Timestamp outside the tolerance zone',
});
}
return true;
}
function parseHeader(header, scheme) {
if (typeof header !== 'string') {
return null;
}
return header.split(',').reduce((accum, item) => {
const kv = item.split('=');
if (kv[0] === 't') {
accum.timestamp = parseInt(kv[1], 10);
}
if (kv[0] === scheme) {
accum.signatures.push(kv[1]);
}
return accum;
}, {
timestamp: -1,
signatures: [],
});
}
let webhooksCryptoProviderInstance = null;
/**
* Lazily instantiate a CryptoProvider instance. This is a stateless object
* so a singleton can be used here.
*/
function getCryptoProvider() {
if (!webhooksCryptoProviderInstance) {
webhooksCryptoProviderInstance = platformFunctions.createDefaultCryptoProvider();
}
return webhooksCryptoProviderInstance;
}
Webhook.signature = signature;
return Webhook;
}
exports.createWebhooks = createWebhooks;
+5
View File
@@ -0,0 +1,5 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApiVersion = void 0;
exports.ApiVersion = '2022-11-15';
+247
View File
@@ -0,0 +1,247 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.makeAutoPaginationMethods = void 0;
const utils_js_1 = require("./utils.js");
class StripeIterator {
constructor(firstPagePromise, requestArgs, spec, stripeResource) {
this.index = 0;
this.pagePromise = firstPagePromise;
this.promiseCache = { currentPromise: null };
this.requestArgs = requestArgs;
this.spec = spec;
this.stripeResource = stripeResource;
}
async iterate(pageResult) {
if (!(pageResult &&
pageResult.data &&
typeof pageResult.data.length === 'number')) {
throw Error('Unexpected: Stripe API response does not have a well-formed `data` array.');
}
const reverseIteration = isReverseIteration(this.requestArgs);
if (this.index < pageResult.data.length) {
const idx = reverseIteration
? pageResult.data.length - 1 - this.index
: this.index;
const value = pageResult.data[idx];
this.index += 1;
return { value, done: false };
}
else if (pageResult.has_more) {
// Reset counter, request next page, and recurse.
this.index = 0;
this.pagePromise = this.getNextPage(pageResult);
const nextPageResult = await this.pagePromise;
return this.iterate(nextPageResult);
}
return { done: true, value: undefined };
}
/** @abstract */
getNextPage(_pageResult) {
throw new Error('Unimplemented');
}
async _next() {
return this.iterate(await this.pagePromise);
}
next() {
/**
* If a user calls `.next()` multiple times in parallel,
* return the same result until something has resolved
* to prevent page-turning race conditions.
*/
if (this.promiseCache.currentPromise) {
return this.promiseCache.currentPromise;
}
const nextPromise = (async () => {
const ret = await this._next();
this.promiseCache.currentPromise = null;
return ret;
})();
this.promiseCache.currentPromise = nextPromise;
return nextPromise;
}
}
class ListIterator extends StripeIterator {
getNextPage(pageResult) {
const reverseIteration = isReverseIteration(this.requestArgs);
const lastId = getLastId(pageResult, reverseIteration);
return this.stripeResource._makeRequest(this.requestArgs, this.spec, {
[reverseIteration ? 'ending_before' : 'starting_after']: lastId,
});
}
}
class SearchIterator extends StripeIterator {
getNextPage(pageResult) {
if (!pageResult.next_page) {
throw Error('Unexpected: Stripe API response does not have a well-formed `next_page` field, but `has_more` was true.');
}
return this.stripeResource._makeRequest(this.requestArgs, this.spec, {
page: pageResult.next_page,
});
}
}
const makeAutoPaginationMethods = (stripeResource, requestArgs, spec, firstPagePromise) => {
if (spec.methodType === 'search') {
return makeAutoPaginationMethodsFromIterator(new SearchIterator(firstPagePromise, requestArgs, spec, stripeResource));
}
if (spec.methodType === 'list') {
return makeAutoPaginationMethodsFromIterator(new ListIterator(firstPagePromise, requestArgs, spec, stripeResource));
}
return null;
};
exports.makeAutoPaginationMethods = makeAutoPaginationMethods;
const makeAutoPaginationMethodsFromIterator = (iterator) => {
const autoPagingEach = makeAutoPagingEach((...args) => iterator.next(...args));
const autoPagingToArray = makeAutoPagingToArray(autoPagingEach);
const autoPaginationMethods = {
autoPagingEach,
autoPagingToArray,
// Async iterator functions:
next: () => iterator.next(),
return: () => {
// This is required for `break`.
return {};
},
[getAsyncIteratorSymbol()]: () => {
return autoPaginationMethods;
},
};
return autoPaginationMethods;
};
/**
* ----------------
* Private Helpers:
* ----------------
*/
function getAsyncIteratorSymbol() {
if (typeof Symbol !== 'undefined' && Symbol.asyncIterator) {
return Symbol.asyncIterator;
}
// Follow the convention from libraries like iterall: https://github.com/leebyron/iterall#asynciterator-1
return '@@asyncIterator';
}
function getDoneCallback(args) {
if (args.length < 2) {
return null;
}
const onDone = args[1];
if (typeof onDone !== 'function') {
throw Error(`The second argument to autoPagingEach, if present, must be a callback function; received ${typeof onDone}`);
}
return onDone;
}
/**
* We allow four forms of the `onItem` callback (the middle two being equivalent),
*
* 1. `.autoPagingEach((item) => { doSomething(item); return false; });`
* 2. `.autoPagingEach(async (item) => { await doSomething(item); return false; });`
* 3. `.autoPagingEach((item) => doSomething(item).then(() => false));`
* 4. `.autoPagingEach((item, next) => { doSomething(item); next(false); });`
*
* In addition to standard validation, this helper
* coalesces the former forms into the latter form.
*/
function getItemCallback(args) {
if (args.length === 0) {
return undefined;
}
const onItem = args[0];
if (typeof onItem !== 'function') {
throw Error(`The first argument to autoPagingEach, if present, must be a callback function; received ${typeof onItem}`);
}
// 4. `.autoPagingEach((item, next) => { doSomething(item); next(false); });`
if (onItem.length === 2) {
return onItem;
}
if (onItem.length > 2) {
throw Error(`The \`onItem\` callback function passed to autoPagingEach must accept at most two arguments; got ${onItem}`);
}
// This magically handles all three of these usecases (the latter two being functionally identical):
// 1. `.autoPagingEach((item) => { doSomething(item); return false; });`
// 2. `.autoPagingEach(async (item) => { await doSomething(item); return false; });`
// 3. `.autoPagingEach((item) => doSomething(item).then(() => false));`
return function _onItem(item, next) {
const shouldContinue = onItem(item);
next(shouldContinue);
};
}
function getLastId(listResult, reverseIteration) {
const lastIdx = reverseIteration ? 0 : listResult.data.length - 1;
const lastItem = listResult.data[lastIdx];
const lastId = lastItem && lastItem.id;
if (!lastId) {
throw Error('Unexpected: No `id` found on the last item while auto-paging a list.');
}
return lastId;
}
function makeAutoPagingEach(asyncIteratorNext) {
return function autoPagingEach( /* onItem?, onDone? */) {
const args = [].slice.call(arguments);
const onItem = getItemCallback(args);
const onDone = getDoneCallback(args);
if (args.length > 2) {
throw Error(`autoPagingEach takes up to two arguments; received ${args}`);
}
const autoPagePromise = wrapAsyncIteratorWithCallback(asyncIteratorNext,
// @ts-ignore we might need a null check
onItem);
return (0, utils_js_1.callbackifyPromiseWithTimeout)(autoPagePromise, onDone);
};
}
function makeAutoPagingToArray(autoPagingEach) {
return function autoPagingToArray(opts, onDone) {
const limit = opts && opts.limit;
if (!limit) {
throw Error('You must pass a `limit` option to autoPagingToArray, e.g., `autoPagingToArray({limit: 1000});`.');
}
if (limit > 10000) {
throw Error('You cannot specify a limit of more than 10,000 items to fetch in `autoPagingToArray`; use `autoPagingEach` to iterate through longer lists.');
}
const promise = new Promise((resolve, reject) => {
const items = [];
autoPagingEach((item) => {
items.push(item);
if (items.length >= limit) {
return false;
}
})
.then(() => {
resolve(items);
})
.catch(reject);
});
// @ts-ignore
return (0, utils_js_1.callbackifyPromiseWithTimeout)(promise, onDone);
};
}
function wrapAsyncIteratorWithCallback(asyncIteratorNext, onItem) {
return new Promise((resolve, reject) => {
function handleIteration(iterResult) {
if (iterResult.done) {
resolve();
return;
}
const item = iterResult.value;
return new Promise((next) => {
// Bit confusing, perhaps; we pass a `resolve` fn
// to the user, so they can decide when and if to continue.
// They can return false, or a promise which resolves to false, to break.
onItem(item, next);
}).then((shouldContinue) => {
if (shouldContinue === false) {
return handleIteration({ done: true, value: undefined });
}
else {
return asyncIteratorNext().then(handleIteration);
}
});
}
asyncIteratorNext()
.then(handleIteration)
.catch(reject);
});
}
function isReverseIteration(requestArgs) {
const args = [].slice.call(requestArgs);
const dataFromArgs = (0, utils_js_1.getDataFromArgs)(args);
return !!dataFromArgs.ending_before;
}
@@ -0,0 +1,45 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CryptoProviderOnlySupportsAsyncError = exports.CryptoProvider = void 0;
/**
* Interface encapsulating the various crypto computations used by the library,
* allowing pluggable underlying crypto implementations.
*/
class CryptoProvider {
/**
* Computes a SHA-256 HMAC given a secret and a payload (encoded in UTF-8).
* The output HMAC should be encoded in hexadecimal.
*
* Sample values for implementations:
* - computeHMACSignature('', 'test_secret') => 'f7f9bd47fb987337b5796fdc1fdb9ba221d0d5396814bfcaf9521f43fd8927fd'
* - computeHMACSignature('\ud83d\ude00', 'test_secret') => '837da296d05c4fe31f61d5d7ead035099d9585a5bcde87de952012a78f0b0c43
*/
computeHMACSignature(payload, secret) {
throw new Error('computeHMACSignature not implemented.');
}
/**
* Asynchronous version of `computeHMACSignature`. Some implementations may
* only allow support async signature computation.
*
* Computes a SHA-256 HMAC given a secret and a payload (encoded in UTF-8).
* The output HMAC should be encoded in hexadecimal.
*
* Sample values for implementations:
* - computeHMACSignature('', 'test_secret') => 'f7f9bd47fb987337b5796fdc1fdb9ba221d0d5396814bfcaf9521f43fd8927fd'
* - computeHMACSignature('\ud83d\ude00', 'test_secret') => '837da296d05c4fe31f61d5d7ead035099d9585a5bcde87de952012a78f0b0c43
*/
computeHMACSignatureAsync(payload, secret) {
throw new Error('computeHMACSignatureAsync not implemented.');
}
}
exports.CryptoProvider = CryptoProvider;
/**
* If the crypto provider only supports asynchronous operations,
* throw CryptoProviderOnlySupportsAsyncError instead of
* a generic error so that the caller can choose to provide
* a more helpful error message to direct the user to use
* an asynchronous pathway.
*/
class CryptoProviderOnlySupportsAsyncError extends Error {
}
exports.CryptoProviderOnlySupportsAsyncError = CryptoProviderOnlySupportsAsyncError;
@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NodeCryptoProvider = void 0;
const crypto = require("crypto");
const CryptoProvider_js_1 = require("./CryptoProvider.js");
/**
* `CryptoProvider which uses the Node `crypto` package for its computations.
*/
class NodeCryptoProvider extends CryptoProvider_js_1.CryptoProvider {
/** @override */
computeHMACSignature(payload, secret) {
return crypto
.createHmac('sha256', secret)
.update(payload, 'utf8')
.digest('hex');
}
/** @override */
async computeHMACSignatureAsync(payload, secret) {
const signature = await this.computeHMACSignature(payload, secret);
return signature;
}
}
exports.NodeCryptoProvider = NodeCryptoProvider;
@@ -0,0 +1,47 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SubtleCryptoProvider = void 0;
const CryptoProvider_js_1 = require("./CryptoProvider.js");
/**
* `CryptoProvider which uses the SubtleCrypto interface of the Web Crypto API.
*
* This only supports asynchronous operations.
*/
class SubtleCryptoProvider extends CryptoProvider_js_1.CryptoProvider {
constructor(subtleCrypto) {
super();
// If no subtle crypto is interface, default to the global namespace. This
// is to allow custom interfaces (eg. using the Node webcrypto interface in
// tests).
this.subtleCrypto = subtleCrypto || crypto.subtle;
}
/** @override */
computeHMACSignature(payload, secret) {
throw new CryptoProvider_js_1.CryptoProviderOnlySupportsAsyncError('SubtleCryptoProvider cannot be used in a synchronous context.');
}
/** @override */
async computeHMACSignatureAsync(payload, secret) {
const encoder = new TextEncoder();
const key = await this.subtleCrypto.importKey('raw', encoder.encode(secret), {
name: 'HMAC',
hash: { name: 'SHA-256' },
}, false, ['sign']);
const signatureBuffer = await this.subtleCrypto.sign('hmac', key, encoder.encode(payload));
// crypto.subtle returns the signature in base64 format. This must be
// encoded in hex to match the CryptoProvider contract. We map each byte in
// the buffer to its corresponding hex octet and then combine into a string.
const signatureBytes = new Uint8Array(signatureBuffer);
const signatureHexCodes = new Array(signatureBytes.length);
for (let i = 0; i < signatureBytes.length; i++) {
signatureHexCodes[i] = byteHexMapping[signatureBytes[i]];
}
return signatureHexCodes.join('');
}
}
exports.SubtleCryptoProvider = SubtleCryptoProvider;
// Cached mapping of byte to hex representation. We do this once to avoid re-
// computing every time we need to convert the result of a signature to hex.
const byteHexMapping = new Array(256);
for (let i = 0; i < byteHexMapping.length; i++) {
byteHexMapping[i] = i.toString(16).padStart(2, '0');
}
+58
View File
@@ -0,0 +1,58 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.multipartRequestDataProcessor = void 0;
const utils_js_1 = require("./utils.js");
// Method for formatting HTTP body for the multipart/form-data specification
// Mostly taken from Fermata.js
// https://github.com/natevw/fermata/blob/5d9732a33d776ce925013a265935facd1626cc88/fermata.js#L315-L343
const multipartDataGenerator = (method, data, headers) => {
const segno = (Math.round(Math.random() * 1e16) + Math.round(Math.random() * 1e16)).toString();
headers['Content-Type'] = `multipart/form-data; boundary=${segno}`;
const textEncoder = new TextEncoder();
let buffer = new Uint8Array(0);
const endBuffer = textEncoder.encode('\r\n');
function push(l) {
const prevBuffer = buffer;
const newBuffer = l instanceof Uint8Array ? l : new Uint8Array(textEncoder.encode(l));
buffer = new Uint8Array(prevBuffer.length + newBuffer.length + 2);
buffer.set(prevBuffer);
buffer.set(newBuffer, prevBuffer.length);
buffer.set(endBuffer, buffer.length - 2);
}
function q(s) {
return `"${s.replace(/"|"/g, '%22').replace(/\r\n|\r|\n/g, ' ')}"`;
}
const flattenedData = (0, utils_js_1.flattenAndStringify)(data);
for (const k in flattenedData) {
const v = flattenedData[k];
push(`--${segno}`);
if (Object.prototype.hasOwnProperty.call(v, 'data')) {
const typedEntry = v;
push(`Content-Disposition: form-data; name=${q(k)}; filename=${q(typedEntry.name || 'blob')}`);
push(`Content-Type: ${typedEntry.type || 'application/octet-stream'}`);
push('');
push(typedEntry.data);
}
else {
push(`Content-Disposition: form-data; name=${q(k)}`);
push('');
push(v);
}
}
push(`--${segno}--`);
return buffer;
};
function multipartRequestDataProcessor(method, data, headers, callback) {
data = data || {};
if (method !== 'POST') {
return callback(null, (0, utils_js_1.stringifyRequestData)(data));
}
this._stripe._platformFunctions
.tryBufferData(data)
.then((bufferedData) => {
const buffer = multipartDataGenerator(method, bufferedData, headers);
return callback(null, buffer);
})
.catch((err) => callback(err, null));
}
exports.multipartRequestDataProcessor = multipartRequestDataProcessor;
@@ -0,0 +1,106 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FetchHttpClientResponse = exports.FetchHttpClient = void 0;
const HttpClient_js_1 = require("./HttpClient.js");
/**
* HTTP client which uses a `fetch` function to issue requests.
*
* By default relies on the global `fetch` function, but an optional function
* can be passed in. If passing in a function, it is expected to match the Web
* Fetch API. As an example, this could be the function provided by the
* node-fetch package (https://github.com/node-fetch/node-fetch).
*/
class FetchHttpClient extends HttpClient_js_1.HttpClient {
constructor(fetchFn) {
super();
this._fetchFn = fetchFn;
}
/** @override. */
getClientName() {
return 'fetch';
}
makeRequest(host, port, path, method, headers, requestData, protocol, timeout) {
const isInsecureConnection = protocol === 'http';
const url = new URL(path, `${isInsecureConnection ? 'http' : 'https'}://${host}`);
url.port = port;
// For methods which expect payloads, we should always pass a body value
// even when it is empty. Without this, some JS runtimes (eg. Deno) will
// inject a second Content-Length header. See https://github.com/stripe/stripe-node/issues/1519
// for more details.
const methodHasPayload = method == 'POST' || method == 'PUT' || method == 'PATCH';
const body = requestData || (methodHasPayload ? '' : undefined);
const fetchFn = this._fetchFn || fetch;
const fetchPromise = fetchFn(url.toString(), {
method,
// @ts-ignore
headers,
// @ts-ignore
body,
});
// The Fetch API does not support passing in a timeout natively, so a
// timeout promise is constructed to race against the fetch and preempt the
// request, simulating a timeout.
//
// This timeout behavior differs from Node:
// - Fetch uses a single timeout for the entire length of the request.
// - Node is more fine-grained and resets the timeout after each stage of
// the request.
//
// As an example, if the timeout is set to 30s and the connection takes 20s
// to be established followed by 20s for the body, Fetch would timeout but
// Node would not. The more fine-grained timeout cannot be implemented with
// fetch.
let pendingTimeoutId;
const timeoutPromise = new Promise((_, reject) => {
pendingTimeoutId = setTimeout(() => {
pendingTimeoutId = null;
reject(HttpClient_js_1.HttpClient.makeTimeoutError());
}, timeout);
});
return Promise.race([fetchPromise, timeoutPromise])
.then((res) => {
return new FetchHttpClientResponse(res);
})
.finally(() => {
if (pendingTimeoutId) {
clearTimeout(pendingTimeoutId);
}
});
}
}
exports.FetchHttpClient = FetchHttpClient;
class FetchHttpClientResponse extends HttpClient_js_1.HttpClientResponse {
constructor(res) {
super(res.status, FetchHttpClientResponse._transformHeadersToObject(res.headers));
this._res = res;
}
getRawResponse() {
return this._res;
}
toStream(streamCompleteCallback) {
// Unfortunately `fetch` does not have event handlers for when the stream is
// completely read. We therefore invoke the streamCompleteCallback right
// away. This callback emits a response event with metadata and completes
// metrics, so it's ok to do this without waiting for the stream to be
// completely read.
streamCompleteCallback();
// Fetch's `body` property is expected to be a readable stream of the body.
return this._res.body;
}
toJSON() {
return this._res.json();
}
static _transformHeadersToObject(headers) {
// Fetch uses a Headers instance so this must be converted to a barebones
// JS object to meet the HttpClient interface.
const headersObj = {};
for (const entry of headers) {
if (!Array.isArray(entry) || entry.length != 2) {
throw new Error('Response objects produced by the fetch function given to FetchHttpClient do not have an iterable headers map. Response#headers should be an iterable object.');
}
headersObj[entry[0]] = entry[1];
}
return headersObj;
}
}
exports.FetchHttpClientResponse = FetchHttpClientResponse;
+53
View File
@@ -0,0 +1,53 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HttpClientResponse = exports.HttpClient = void 0;
/**
* Encapsulates the logic for issuing a request to the Stripe API.
*
* A custom HTTP client should should implement:
* 1. A response class which extends HttpClientResponse and wraps around their
* own internal representation of a response.
* 2. A client class which extends HttpClient and implements all methods,
* returning their own response class when making requests.
*/
class HttpClient {
/** The client name used for diagnostics. */
getClientName() {
throw new Error('getClientName not implemented.');
}
makeRequest(host, port, path, method, headers, requestData, protocol, timeout) {
throw new Error('makeRequest not implemented.');
}
/** Helper to make a consistent timeout error across implementations. */
static makeTimeoutError() {
const timeoutErr = new TypeError(HttpClient.TIMEOUT_ERROR_CODE);
timeoutErr.code = HttpClient.TIMEOUT_ERROR_CODE;
return timeoutErr;
}
}
exports.HttpClient = HttpClient;
// Public API accessible via Stripe.HttpClient
HttpClient.CONNECTION_CLOSED_ERROR_CODES = ['ECONNRESET', 'EPIPE'];
HttpClient.TIMEOUT_ERROR_CODE = 'ETIMEDOUT';
class HttpClientResponse {
constructor(statusCode, headers) {
this._statusCode = statusCode;
this._headers = headers;
}
getStatusCode() {
return this._statusCode;
}
getHeaders() {
return this._headers;
}
getRawResponse() {
throw new Error('getRawResponse not implemented.');
}
toStream(streamCompleteCallback) {
throw new Error('toStream not implemented.');
}
toJSON() {
throw new Error('toJSON not implemented.');
}
}
exports.HttpClientResponse = HttpClientResponse;
+108
View File
@@ -0,0 +1,108 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NodeHttpClientResponse = exports.NodeHttpClient = void 0;
const http_ = require("http");
const https_ = require("https");
const HttpClient_js_1 = require("./HttpClient.js");
// `import * as http_ from 'http'` creates a "Module Namespace Exotic Object"
// which is immune to monkey-patching, whereas http_.default (in an ES Module context)
// will resolve to the same thing as require('http'), which is
// monkey-patchable. We care about this because users in their test
// suites might be using a library like "nock" which relies on the ability
// to monkey-patch and intercept calls to http.request.
const http = http_.default || http_;
const https = https_.default || https_;
const defaultHttpAgent = new http.Agent({ keepAlive: true });
const defaultHttpsAgent = new https.Agent({ keepAlive: true });
/**
* HTTP client which uses the Node `http` and `https` packages to issue
* requests.`
*/
class NodeHttpClient extends HttpClient_js_1.HttpClient {
constructor(agent) {
super();
this._agent = agent;
}
/** @override. */
getClientName() {
return 'node';
}
makeRequest(host, port, path, method, headers, requestData, protocol, timeout) {
const isInsecureConnection = protocol === 'http';
let agent = this._agent;
if (!agent) {
agent = isInsecureConnection ? defaultHttpAgent : defaultHttpsAgent;
}
const requestPromise = new Promise((resolve, reject) => {
const req = (isInsecureConnection ? http : https).request({
host: host,
port: port,
path,
method,
agent,
headers,
ciphers: 'DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2:!MD5',
});
req.setTimeout(timeout, () => {
req.destroy(HttpClient_js_1.HttpClient.makeTimeoutError());
});
req.on('response', (res) => {
resolve(new NodeHttpClientResponse(res));
});
req.on('error', (error) => {
reject(error);
});
req.once('socket', (socket) => {
if (socket.connecting) {
socket.once(isInsecureConnection ? 'connect' : 'secureConnect', () => {
// Send payload; we're safe:
req.write(requestData);
req.end();
});
}
else {
// we're already connected
req.write(requestData);
req.end();
}
});
});
return requestPromise;
}
}
exports.NodeHttpClient = NodeHttpClient;
class NodeHttpClientResponse extends HttpClient_js_1.HttpClientResponse {
constructor(res) {
// @ts-ignore
super(res.statusCode, res.headers || {});
this._res = res;
}
getRawResponse() {
return this._res;
}
toStream(streamCompleteCallback) {
// The raw response is itself the stream, so we just return that. To be
// backwards compatible, we should invoke the streamCompleteCallback only
// once the stream has been fully consumed.
this._res.once('end', () => streamCompleteCallback());
return this._res;
}
toJSON() {
return new Promise((resolve, reject) => {
let response = '';
this._res.setEncoding('utf8');
this._res.on('data', (chunk) => {
response += chunk;
});
this._res.once('end', () => {
try {
resolve(JSON.parse(response));
}
catch (e) {
reject(e);
}
});
});
}
}
exports.NodeHttpClientResponse = NodeHttpClientResponse;
+1
View File
@@ -0,0 +1 @@
{"type":"commonjs"}
@@ -0,0 +1,126 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NodePlatformFunctions = void 0;
const crypto = require("crypto");
const events_1 = require("events");
const NodeCryptoProvider_js_1 = require("../crypto/NodeCryptoProvider.js");
const NodeHttpClient_js_1 = require("../net/NodeHttpClient.js");
const PlatformFunctions_js_1 = require("./PlatformFunctions.js");
const Error_js_1 = require("../Error.js");
const utils_js_1 = require("../utils.js");
const child_process_1 = require("child_process");
class StreamProcessingError extends Error_js_1.StripeError {
}
/**
* Specializes WebPlatformFunctions using APIs available in Node.js.
*/
class NodePlatformFunctions extends PlatformFunctions_js_1.PlatformFunctions {
constructor() {
super();
this._exec = child_process_1.exec;
this._UNAME_CACHE = null;
}
/** @override */
uuid4() {
// available in: v14.17.x+
if (crypto.randomUUID) {
return crypto.randomUUID();
}
return super.uuid4();
}
/**
* @override
* Node's built in `exec` function sometimes throws outright,
* and sometimes has a callback with an error,
* depending on the type of error.
*
* This unifies that interface by resolving with a null uname
* if an error is encountered.
*/
getUname() {
if (!this._UNAME_CACHE) {
this._UNAME_CACHE = new Promise((resolve, reject) => {
try {
this._exec('uname -a', (err, uname) => {
if (err) {
return resolve(null);
}
resolve(uname);
});
}
catch (e) {
resolve(null);
}
});
}
return this._UNAME_CACHE;
}
/**
* @override
* Secure compare, from https://github.com/freewil/scmp
*/
secureCompare(a, b) {
if (!a || !b) {
throw new Error('secureCompare must receive two arguments');
}
// return early here if buffer lengths are not equal since timingSafeEqual
// will throw if buffer lengths are not equal
if (a.length !== b.length) {
return false;
}
// use crypto.timingSafeEqual if available (since Node.js v6.6.0),
// otherwise use our own scmp-internal function.
if (crypto.timingSafeEqual) {
const textEncoder = new TextEncoder();
const aEncoded = textEncoder.encode(a);
const bEncoded = textEncoder.encode(b);
return crypto.timingSafeEqual(aEncoded, bEncoded);
}
return super.secureCompare(a, b);
}
createEmitter() {
return new events_1.EventEmitter();
}
/** @override */
tryBufferData(data) {
if (!(data.file.data instanceof events_1.EventEmitter)) {
return Promise.resolve(data);
}
const bufferArray = [];
return new Promise((resolve, reject) => {
data.file.data
.on('data', (line) => {
bufferArray.push(line);
})
.once('end', () => {
// @ts-ignore
const bufferData = Object.assign({}, data);
bufferData.file.data = (0, utils_js_1.concat)(bufferArray);
resolve(bufferData);
})
.on('error', (err) => {
reject(new StreamProcessingError({
message: 'An error occurred while attempting to process the file for upload.',
detail: err,
}));
});
});
}
/** @override */
createNodeHttpClient(agent) {
return new NodeHttpClient_js_1.NodeHttpClient(agent);
}
/** @override */
createDefaultHttpClient() {
return new NodeHttpClient_js_1.NodeHttpClient();
}
/** @override */
createNodeCryptoProvider() {
return new NodeCryptoProvider_js_1.NodeCryptoProvider();
}
/** @override */
createDefaultCryptoProvider() {
return this.createNodeCryptoProvider();
}
}
exports.NodePlatformFunctions = NodePlatformFunctions;
@@ -0,0 +1,98 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PlatformFunctions = void 0;
const FetchHttpClient_js_1 = require("../net/FetchHttpClient.js");
const SubtleCryptoProvider_js_1 = require("../crypto/SubtleCryptoProvider.js");
/**
* Interface encapsulating various utility functions whose
* implementations depend on the platform / JS runtime.
*/
class PlatformFunctions {
constructor() {
this._fetchFn = null;
this._agent = null;
}
/**
* Gets uname with Node's built-in `exec` function, if available.
*/
getUname() {
throw new Error('getUname not implemented.');
}
/**
* Generates a v4 UUID. See https://stackoverflow.com/a/2117523
*/
uuid4() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
const r = (Math.random() * 16) | 0;
const v = c === 'x' ? r : (r & 0x3) | 0x8;
return v.toString(16);
});
}
/**
* Compares strings in constant time.
*/
secureCompare(a, b) {
// return early here if buffer lengths are not equal
if (a.length !== b.length) {
return false;
}
const len = a.length;
let result = 0;
for (let i = 0; i < len; ++i) {
result |= a.charCodeAt(i) ^ b.charCodeAt(i);
}
return result === 0;
}
/**
* Creates an event emitter.
*/
createEmitter() {
throw new Error('createEmitter not implemented.');
}
/**
* Checks if the request data is a stream. If so, read the entire stream
* to a buffer and return the buffer.
*/
tryBufferData(data) {
throw new Error('tryBufferData not implemented.');
}
/**
* Creates an HTTP client which uses the Node `http` and `https` packages
* to issue requests.
*/
createNodeHttpClient(agent) {
throw new Error('createNodeHttpClient not implemented.');
}
/**
* Creates an HTTP client for issuing Stripe API requests which uses the Web
* Fetch API.
*
* A fetch function can optionally be passed in as a parameter. If none is
* passed, will default to the default `fetch` function in the global scope.
*/
createFetchHttpClient(fetchFn) {
return new FetchHttpClient_js_1.FetchHttpClient(fetchFn);
}
/**
* Creates an HTTP client using runtime-specific APIs.
*/
createDefaultHttpClient() {
throw new Error('createDefaultHttpClient not implemented.');
}
/**
* Creates a CryptoProvider which uses the Node `crypto` package for its computations.
*/
createNodeCryptoProvider() {
throw new Error('createNodeCryptoProvider not implemented.');
}
/**
* Creates a CryptoProvider which uses the SubtleCrypto interface of the Web Crypto API.
*/
createSubtleCryptoProvider(subtleCrypto) {
return new SubtleCryptoProvider_js_1.SubtleCryptoProvider(subtleCrypto);
}
createDefaultCryptoProvider() {
throw new Error('createDefaultCryptoProvider not implemented.');
}
}
exports.PlatformFunctions = PlatformFunctions;
@@ -0,0 +1,42 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WebPlatformFunctions = void 0;
const PlatformFunctions_js_1 = require("./PlatformFunctions.js");
const StripeEmitter_js_1 = require("../StripeEmitter.js");
/**
* Specializes WebPlatformFunctions using APIs available in Web workers.
*/
class WebPlatformFunctions extends PlatformFunctions_js_1.PlatformFunctions {
/** @override */
getUname() {
return Promise.resolve(null);
}
/** @override */
createEmitter() {
return new StripeEmitter_js_1.StripeEmitter();
}
/** @override */
tryBufferData(data) {
if (data.file.data instanceof ReadableStream) {
throw new Error('Uploading a file as a stream is not supported in non-Node environments. Please open or upvote an issue at github.com/stripe/stripe-node if you use this, detailing your use-case.');
}
return Promise.resolve(data);
}
/** @override */
createNodeHttpClient() {
throw new Error('Stripe: `createNodeHttpClient()` is not available in non-Node environments. Please use `createFetchHttpClient()` instead.');
}
/** @override */
createDefaultHttpClient() {
return super.createFetchHttpClient();
}
/** @override */
createNodeCryptoProvider() {
throw new Error('Stripe: `createNodeCryptoProvider()` is not available in non-Node environments. Please use `createSubtleCryptoProvider()` instead.');
}
/** @override */
createDefaultCryptoProvider() {
return this.createSubtleCryptoProvider();
}
}
exports.WebPlatformFunctions = WebPlatformFunctions;
+218
View File
@@ -0,0 +1,218 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.FinancialConnections = exports.Checkout = exports.BillingPortal = exports.Apps = exports.WebhookEndpoints = exports.Transfers = exports.Topups = exports.Tokens = exports.TaxRates = exports.TaxCodes = exports.Subscriptions = exports.SubscriptionSchedules = exports.SubscriptionItems = exports.Sources = exports.ShippingRates = exports.SetupIntents = exports.SetupAttempts = exports.Reviews = exports.Refunds = exports.Quotes = exports.PromotionCodes = exports.Products = exports.Prices = exports.Plans = exports.Payouts = exports.PaymentMethods = exports.PaymentLinks = exports.PaymentIntents = exports.OAuth = exports.Mandates = exports.Invoices = exports.InvoiceItems = exports.Files = exports.FileLinks = exports.ExchangeRates = exports.Events = exports.EphemeralKeys = exports.Disputes = exports.Customers = exports.CreditNotes = exports.Coupons = exports.CountrySpecs = exports.Charges = exports.BalanceTransactions = exports.Balance = exports.ApplicationFees = exports.ApplePayDomains = exports.Accounts = exports.AccountLinks = exports.Account = void 0;
exports.Treasury = exports.TestHelpers = exports.Terminal = exports.Tax = exports.Sigma = exports.Reporting = exports.Radar = exports.Issuing = exports.Identity = void 0;
const ResourceNamespace_js_1 = require("./ResourceNamespace.js");
const Accounts_js_1 = require("./resources/FinancialConnections/Accounts.js");
const Authorizations_js_1 = require("./resources/Issuing/Authorizations.js");
const Calculations_js_1 = require("./resources/Tax/Calculations.js");
const Cardholders_js_1 = require("./resources/Issuing/Cardholders.js");
const Cards_js_1 = require("./resources/TestHelpers/Issuing/Cards.js");
const Cards_js_2 = require("./resources/Issuing/Cards.js");
const Configurations_js_1 = require("./resources/BillingPortal/Configurations.js");
const Configurations_js_2 = require("./resources/Terminal/Configurations.js");
const ConnectionTokens_js_1 = require("./resources/Terminal/ConnectionTokens.js");
const CreditReversals_js_1 = require("./resources/Treasury/CreditReversals.js");
const Customers_js_1 = require("./resources/TestHelpers/Customers.js");
const DebitReversals_js_1 = require("./resources/Treasury/DebitReversals.js");
const Disputes_js_1 = require("./resources/Issuing/Disputes.js");
const EarlyFraudWarnings_js_1 = require("./resources/Radar/EarlyFraudWarnings.js");
const FinancialAccounts_js_1 = require("./resources/Treasury/FinancialAccounts.js");
const InboundTransfers_js_1 = require("./resources/TestHelpers/Treasury/InboundTransfers.js");
const InboundTransfers_js_2 = require("./resources/Treasury/InboundTransfers.js");
const Locations_js_1 = require("./resources/Terminal/Locations.js");
const OutboundPayments_js_1 = require("./resources/TestHelpers/Treasury/OutboundPayments.js");
const OutboundPayments_js_2 = require("./resources/Treasury/OutboundPayments.js");
const OutboundTransfers_js_1 = require("./resources/TestHelpers/Treasury/OutboundTransfers.js");
const OutboundTransfers_js_2 = require("./resources/Treasury/OutboundTransfers.js");
const Readers_js_1 = require("./resources/TestHelpers/Terminal/Readers.js");
const Readers_js_2 = require("./resources/Terminal/Readers.js");
const ReceivedCredits_js_1 = require("./resources/TestHelpers/Treasury/ReceivedCredits.js");
const ReceivedCredits_js_2 = require("./resources/Treasury/ReceivedCredits.js");
const ReceivedDebits_js_1 = require("./resources/TestHelpers/Treasury/ReceivedDebits.js");
const ReceivedDebits_js_2 = require("./resources/Treasury/ReceivedDebits.js");
const Refunds_js_1 = require("./resources/TestHelpers/Refunds.js");
const ReportRuns_js_1 = require("./resources/Reporting/ReportRuns.js");
const ReportTypes_js_1 = require("./resources/Reporting/ReportTypes.js");
const ScheduledQueryRuns_js_1 = require("./resources/Sigma/ScheduledQueryRuns.js");
const Secrets_js_1 = require("./resources/Apps/Secrets.js");
const Sessions_js_1 = require("./resources/BillingPortal/Sessions.js");
const Sessions_js_2 = require("./resources/Checkout/Sessions.js");
const Sessions_js_3 = require("./resources/FinancialConnections/Sessions.js");
const Settings_js_1 = require("./resources/Tax/Settings.js");
const TestClocks_js_1 = require("./resources/TestHelpers/TestClocks.js");
const TransactionEntries_js_1 = require("./resources/Treasury/TransactionEntries.js");
const Transactions_js_1 = require("./resources/Issuing/Transactions.js");
const Transactions_js_2 = require("./resources/Tax/Transactions.js");
const Transactions_js_3 = require("./resources/Treasury/Transactions.js");
const ValueListItems_js_1 = require("./resources/Radar/ValueListItems.js");
const ValueLists_js_1 = require("./resources/Radar/ValueLists.js");
const VerificationReports_js_1 = require("./resources/Identity/VerificationReports.js");
const VerificationSessions_js_1 = require("./resources/Identity/VerificationSessions.js");
var Accounts_js_2 = require("./resources/Accounts.js");
Object.defineProperty(exports, "Account", { enumerable: true, get: function () { return Accounts_js_2.Accounts; } });
var AccountLinks_js_1 = require("./resources/AccountLinks.js");
Object.defineProperty(exports, "AccountLinks", { enumerable: true, get: function () { return AccountLinks_js_1.AccountLinks; } });
var Accounts_js_3 = require("./resources/Accounts.js");
Object.defineProperty(exports, "Accounts", { enumerable: true, get: function () { return Accounts_js_3.Accounts; } });
var ApplePayDomains_js_1 = require("./resources/ApplePayDomains.js");
Object.defineProperty(exports, "ApplePayDomains", { enumerable: true, get: function () { return ApplePayDomains_js_1.ApplePayDomains; } });
var ApplicationFees_js_1 = require("./resources/ApplicationFees.js");
Object.defineProperty(exports, "ApplicationFees", { enumerable: true, get: function () { return ApplicationFees_js_1.ApplicationFees; } });
var Balance_js_1 = require("./resources/Balance.js");
Object.defineProperty(exports, "Balance", { enumerable: true, get: function () { return Balance_js_1.Balance; } });
var BalanceTransactions_js_1 = require("./resources/BalanceTransactions.js");
Object.defineProperty(exports, "BalanceTransactions", { enumerable: true, get: function () { return BalanceTransactions_js_1.BalanceTransactions; } });
var Charges_js_1 = require("./resources/Charges.js");
Object.defineProperty(exports, "Charges", { enumerable: true, get: function () { return Charges_js_1.Charges; } });
var CountrySpecs_js_1 = require("./resources/CountrySpecs.js");
Object.defineProperty(exports, "CountrySpecs", { enumerable: true, get: function () { return CountrySpecs_js_1.CountrySpecs; } });
var Coupons_js_1 = require("./resources/Coupons.js");
Object.defineProperty(exports, "Coupons", { enumerable: true, get: function () { return Coupons_js_1.Coupons; } });
var CreditNotes_js_1 = require("./resources/CreditNotes.js");
Object.defineProperty(exports, "CreditNotes", { enumerable: true, get: function () { return CreditNotes_js_1.CreditNotes; } });
var Customers_js_2 = require("./resources/Customers.js");
Object.defineProperty(exports, "Customers", { enumerable: true, get: function () { return Customers_js_2.Customers; } });
var Disputes_js_2 = require("./resources/Disputes.js");
Object.defineProperty(exports, "Disputes", { enumerable: true, get: function () { return Disputes_js_2.Disputes; } });
var EphemeralKeys_js_1 = require("./resources/EphemeralKeys.js");
Object.defineProperty(exports, "EphemeralKeys", { enumerable: true, get: function () { return EphemeralKeys_js_1.EphemeralKeys; } });
var Events_js_1 = require("./resources/Events.js");
Object.defineProperty(exports, "Events", { enumerable: true, get: function () { return Events_js_1.Events; } });
var ExchangeRates_js_1 = require("./resources/ExchangeRates.js");
Object.defineProperty(exports, "ExchangeRates", { enumerable: true, get: function () { return ExchangeRates_js_1.ExchangeRates; } });
var FileLinks_js_1 = require("./resources/FileLinks.js");
Object.defineProperty(exports, "FileLinks", { enumerable: true, get: function () { return FileLinks_js_1.FileLinks; } });
var Files_js_1 = require("./resources/Files.js");
Object.defineProperty(exports, "Files", { enumerable: true, get: function () { return Files_js_1.Files; } });
var InvoiceItems_js_1 = require("./resources/InvoiceItems.js");
Object.defineProperty(exports, "InvoiceItems", { enumerable: true, get: function () { return InvoiceItems_js_1.InvoiceItems; } });
var Invoices_js_1 = require("./resources/Invoices.js");
Object.defineProperty(exports, "Invoices", { enumerable: true, get: function () { return Invoices_js_1.Invoices; } });
var Mandates_js_1 = require("./resources/Mandates.js");
Object.defineProperty(exports, "Mandates", { enumerable: true, get: function () { return Mandates_js_1.Mandates; } });
var OAuth_js_1 = require("./resources/OAuth.js");
Object.defineProperty(exports, "OAuth", { enumerable: true, get: function () { return OAuth_js_1.OAuth; } });
var PaymentIntents_js_1 = require("./resources/PaymentIntents.js");
Object.defineProperty(exports, "PaymentIntents", { enumerable: true, get: function () { return PaymentIntents_js_1.PaymentIntents; } });
var PaymentLinks_js_1 = require("./resources/PaymentLinks.js");
Object.defineProperty(exports, "PaymentLinks", { enumerable: true, get: function () { return PaymentLinks_js_1.PaymentLinks; } });
var PaymentMethods_js_1 = require("./resources/PaymentMethods.js");
Object.defineProperty(exports, "PaymentMethods", { enumerable: true, get: function () { return PaymentMethods_js_1.PaymentMethods; } });
var Payouts_js_1 = require("./resources/Payouts.js");
Object.defineProperty(exports, "Payouts", { enumerable: true, get: function () { return Payouts_js_1.Payouts; } });
var Plans_js_1 = require("./resources/Plans.js");
Object.defineProperty(exports, "Plans", { enumerable: true, get: function () { return Plans_js_1.Plans; } });
var Prices_js_1 = require("./resources/Prices.js");
Object.defineProperty(exports, "Prices", { enumerable: true, get: function () { return Prices_js_1.Prices; } });
var Products_js_1 = require("./resources/Products.js");
Object.defineProperty(exports, "Products", { enumerable: true, get: function () { return Products_js_1.Products; } });
var PromotionCodes_js_1 = require("./resources/PromotionCodes.js");
Object.defineProperty(exports, "PromotionCodes", { enumerable: true, get: function () { return PromotionCodes_js_1.PromotionCodes; } });
var Quotes_js_1 = require("./resources/Quotes.js");
Object.defineProperty(exports, "Quotes", { enumerable: true, get: function () { return Quotes_js_1.Quotes; } });
var Refunds_js_2 = require("./resources/Refunds.js");
Object.defineProperty(exports, "Refunds", { enumerable: true, get: function () { return Refunds_js_2.Refunds; } });
var Reviews_js_1 = require("./resources/Reviews.js");
Object.defineProperty(exports, "Reviews", { enumerable: true, get: function () { return Reviews_js_1.Reviews; } });
var SetupAttempts_js_1 = require("./resources/SetupAttempts.js");
Object.defineProperty(exports, "SetupAttempts", { enumerable: true, get: function () { return SetupAttempts_js_1.SetupAttempts; } });
var SetupIntents_js_1 = require("./resources/SetupIntents.js");
Object.defineProperty(exports, "SetupIntents", { enumerable: true, get: function () { return SetupIntents_js_1.SetupIntents; } });
var ShippingRates_js_1 = require("./resources/ShippingRates.js");
Object.defineProperty(exports, "ShippingRates", { enumerable: true, get: function () { return ShippingRates_js_1.ShippingRates; } });
var Sources_js_1 = require("./resources/Sources.js");
Object.defineProperty(exports, "Sources", { enumerable: true, get: function () { return Sources_js_1.Sources; } });
var SubscriptionItems_js_1 = require("./resources/SubscriptionItems.js");
Object.defineProperty(exports, "SubscriptionItems", { enumerable: true, get: function () { return SubscriptionItems_js_1.SubscriptionItems; } });
var SubscriptionSchedules_js_1 = require("./resources/SubscriptionSchedules.js");
Object.defineProperty(exports, "SubscriptionSchedules", { enumerable: true, get: function () { return SubscriptionSchedules_js_1.SubscriptionSchedules; } });
var Subscriptions_js_1 = require("./resources/Subscriptions.js");
Object.defineProperty(exports, "Subscriptions", { enumerable: true, get: function () { return Subscriptions_js_1.Subscriptions; } });
var TaxCodes_js_1 = require("./resources/TaxCodes.js");
Object.defineProperty(exports, "TaxCodes", { enumerable: true, get: function () { return TaxCodes_js_1.TaxCodes; } });
var TaxRates_js_1 = require("./resources/TaxRates.js");
Object.defineProperty(exports, "TaxRates", { enumerable: true, get: function () { return TaxRates_js_1.TaxRates; } });
var Tokens_js_1 = require("./resources/Tokens.js");
Object.defineProperty(exports, "Tokens", { enumerable: true, get: function () { return Tokens_js_1.Tokens; } });
var Topups_js_1 = require("./resources/Topups.js");
Object.defineProperty(exports, "Topups", { enumerable: true, get: function () { return Topups_js_1.Topups; } });
var Transfers_js_1 = require("./resources/Transfers.js");
Object.defineProperty(exports, "Transfers", { enumerable: true, get: function () { return Transfers_js_1.Transfers; } });
var WebhookEndpoints_js_1 = require("./resources/WebhookEndpoints.js");
Object.defineProperty(exports, "WebhookEndpoints", { enumerable: true, get: function () { return WebhookEndpoints_js_1.WebhookEndpoints; } });
exports.Apps = (0, ResourceNamespace_js_1.resourceNamespace)('apps', { Secrets: Secrets_js_1.Secrets });
exports.BillingPortal = (0, ResourceNamespace_js_1.resourceNamespace)('billingPortal', {
Configurations: Configurations_js_1.Configurations,
Sessions: Sessions_js_1.Sessions,
});
exports.Checkout = (0, ResourceNamespace_js_1.resourceNamespace)('checkout', {
Sessions: Sessions_js_2.Sessions,
});
exports.FinancialConnections = (0, ResourceNamespace_js_1.resourceNamespace)('financialConnections', {
Accounts: Accounts_js_1.Accounts,
Sessions: Sessions_js_3.Sessions,
});
exports.Identity = (0, ResourceNamespace_js_1.resourceNamespace)('identity', {
VerificationReports: VerificationReports_js_1.VerificationReports,
VerificationSessions: VerificationSessions_js_1.VerificationSessions,
});
exports.Issuing = (0, ResourceNamespace_js_1.resourceNamespace)('issuing', {
Authorizations: Authorizations_js_1.Authorizations,
Cardholders: Cardholders_js_1.Cardholders,
Cards: Cards_js_2.Cards,
Disputes: Disputes_js_1.Disputes,
Transactions: Transactions_js_1.Transactions,
});
exports.Radar = (0, ResourceNamespace_js_1.resourceNamespace)('radar', {
EarlyFraudWarnings: EarlyFraudWarnings_js_1.EarlyFraudWarnings,
ValueListItems: ValueListItems_js_1.ValueListItems,
ValueLists: ValueLists_js_1.ValueLists,
});
exports.Reporting = (0, ResourceNamespace_js_1.resourceNamespace)('reporting', {
ReportRuns: ReportRuns_js_1.ReportRuns,
ReportTypes: ReportTypes_js_1.ReportTypes,
});
exports.Sigma = (0, ResourceNamespace_js_1.resourceNamespace)('sigma', {
ScheduledQueryRuns: ScheduledQueryRuns_js_1.ScheduledQueryRuns,
});
exports.Tax = (0, ResourceNamespace_js_1.resourceNamespace)('tax', {
Calculations: Calculations_js_1.Calculations,
Settings: Settings_js_1.Settings,
Transactions: Transactions_js_2.Transactions,
});
exports.Terminal = (0, ResourceNamespace_js_1.resourceNamespace)('terminal', {
Configurations: Configurations_js_2.Configurations,
ConnectionTokens: ConnectionTokens_js_1.ConnectionTokens,
Locations: Locations_js_1.Locations,
Readers: Readers_js_2.Readers,
});
exports.TestHelpers = (0, ResourceNamespace_js_1.resourceNamespace)('testHelpers', {
Customers: Customers_js_1.Customers,
Refunds: Refunds_js_1.Refunds,
TestClocks: TestClocks_js_1.TestClocks,
Issuing: (0, ResourceNamespace_js_1.resourceNamespace)('issuing', { Cards: Cards_js_1.Cards }),
Terminal: (0, ResourceNamespace_js_1.resourceNamespace)('terminal', {
Readers: Readers_js_1.Readers,
}),
Treasury: (0, ResourceNamespace_js_1.resourceNamespace)('treasury', {
InboundTransfers: InboundTransfers_js_1.InboundTransfers,
OutboundPayments: OutboundPayments_js_1.OutboundPayments,
OutboundTransfers: OutboundTransfers_js_1.OutboundTransfers,
ReceivedCredits: ReceivedCredits_js_1.ReceivedCredits,
ReceivedDebits: ReceivedDebits_js_1.ReceivedDebits,
}),
});
exports.Treasury = (0, ResourceNamespace_js_1.resourceNamespace)('treasury', {
CreditReversals: CreditReversals_js_1.CreditReversals,
DebitReversals: DebitReversals_js_1.DebitReversals,
FinancialAccounts: FinancialAccounts_js_1.FinancialAccounts,
InboundTransfers: InboundTransfers_js_2.InboundTransfers,
OutboundPayments: OutboundPayments_js_2.OutboundPayments,
OutboundTransfers: OutboundTransfers_js_2.OutboundTransfers,
ReceivedCredits: ReceivedCredits_js_2.ReceivedCredits,
ReceivedDebits: ReceivedDebits_js_2.ReceivedDebits,
TransactionEntries: TransactionEntries_js_1.TransactionEntries,
Transactions: Transactions_js_3.Transactions,
});
@@ -0,0 +1,9 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.AccountLinks = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.AccountLinks = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/account_links' }),
});
+100
View File
@@ -0,0 +1,100 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Accounts = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
// Since path can either be `account` or `accounts`, support both through stripeMethod path
exports.Accounts = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/accounts' }),
retrieve(id, ...args) {
// No longer allow an api key to be passed as the first string to this function due to ambiguity between
// old account ids and api keys. To request the account for an api key, send null as the id
if (typeof id === 'string') {
return stripeMethod({
method: 'GET',
fullPath: '/v1/accounts/{id}',
}).apply(this, [id, ...args]);
}
else {
if (id === null || id === undefined) {
// Remove id as stripeMethod would complain of unexpected argument
[].shift.apply([id, ...args]);
}
return stripeMethod({
method: 'GET',
fullPath: '/v1/account',
}).apply(this, [id, ...args]);
}
},
update: stripeMethod({ method: 'POST', fullPath: '/v1/accounts/{account}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/accounts',
methodType: 'list',
}),
del: stripeMethod({ method: 'DELETE', fullPath: '/v1/accounts/{account}' }),
createExternalAccount: stripeMethod({
method: 'POST',
fullPath: '/v1/accounts/{account}/external_accounts',
}),
createLoginLink: stripeMethod({
method: 'POST',
fullPath: '/v1/accounts/{account}/login_links',
}),
createPerson: stripeMethod({
method: 'POST',
fullPath: '/v1/accounts/{account}/persons',
}),
deleteExternalAccount: stripeMethod({
method: 'DELETE',
fullPath: '/v1/accounts/{account}/external_accounts/{id}',
}),
deletePerson: stripeMethod({
method: 'DELETE',
fullPath: '/v1/accounts/{account}/persons/{person}',
}),
listCapabilities: stripeMethod({
method: 'GET',
fullPath: '/v1/accounts/{account}/capabilities',
methodType: 'list',
}),
listExternalAccounts: stripeMethod({
method: 'GET',
fullPath: '/v1/accounts/{account}/external_accounts',
methodType: 'list',
}),
listPersons: stripeMethod({
method: 'GET',
fullPath: '/v1/accounts/{account}/persons',
methodType: 'list',
}),
reject: stripeMethod({
method: 'POST',
fullPath: '/v1/accounts/{account}/reject',
}),
retrieveCapability: stripeMethod({
method: 'GET',
fullPath: '/v1/accounts/{account}/capabilities/{capability}',
}),
retrieveExternalAccount: stripeMethod({
method: 'GET',
fullPath: '/v1/accounts/{account}/external_accounts/{id}',
}),
retrievePerson: stripeMethod({
method: 'GET',
fullPath: '/v1/accounts/{account}/persons/{person}',
}),
updateCapability: stripeMethod({
method: 'POST',
fullPath: '/v1/accounts/{account}/capabilities/{capability}',
}),
updateExternalAccount: stripeMethod({
method: 'POST',
fullPath: '/v1/accounts/{account}/external_accounts/{id}',
}),
updatePerson: stripeMethod({
method: 'POST',
fullPath: '/v1/accounts/{account}/persons/{person}',
}),
});
@@ -0,0 +1,22 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApplePayDomains = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.ApplePayDomains = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/apple_pay/domains' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/apple_pay/domains/{domain}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/apple_pay/domains',
methodType: 'list',
}),
del: stripeMethod({
method: 'DELETE',
fullPath: '/v1/apple_pay/domains/{domain}',
}),
});
@@ -0,0 +1,34 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApplicationFees = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.ApplicationFees = StripeResource_js_1.StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/application_fees/{id}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/application_fees',
methodType: 'list',
}),
createRefund: stripeMethod({
method: 'POST',
fullPath: '/v1/application_fees/{id}/refunds',
}),
listRefunds: stripeMethod({
method: 'GET',
fullPath: '/v1/application_fees/{id}/refunds',
methodType: 'list',
}),
retrieveRefund: stripeMethod({
method: 'GET',
fullPath: '/v1/application_fees/{fee}/refunds/{id}',
}),
updateRefund: stripeMethod({
method: 'POST',
fullPath: '/v1/application_fees/{fee}/refunds/{id}',
}),
});
@@ -0,0 +1,19 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Secrets = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Secrets = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/apps/secrets' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/apps/secrets',
methodType: 'list',
}),
deleteWhere: stripeMethod({
method: 'POST',
fullPath: '/v1/apps/secrets/delete',
}),
find: stripeMethod({ method: 'GET', fullPath: '/v1/apps/secrets/find' }),
});
@@ -0,0 +1,9 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Balance = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Balance = StripeResource_js_1.StripeResource.extend({
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/balance' }),
});
@@ -0,0 +1,17 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.BalanceTransactions = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.BalanceTransactions = StripeResource_js_1.StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/balance_transactions/{id}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/balance_transactions',
methodType: 'list',
}),
});
@@ -0,0 +1,25 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Configurations = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Configurations = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/billing_portal/configurations',
}),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/billing_portal/configurations/{configuration}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/billing_portal/configurations/{configuration}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/billing_portal/configurations',
methodType: 'list',
}),
});
@@ -0,0 +1,12 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Sessions = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Sessions = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/billing_portal/sessions',
}),
});
+25
View File
@@ -0,0 +1,25 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Charges = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Charges = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/charges' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/charges/{charge}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/charges/{charge}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/charges',
methodType: 'list',
}),
capture: stripeMethod({
method: 'POST',
fullPath: '/v1/charges/{charge}/capture',
}),
search: stripeMethod({
method: 'GET',
fullPath: '/v1/charges/search',
methodType: 'search',
}),
});
@@ -0,0 +1,27 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Sessions = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Sessions = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/checkout/sessions' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/checkout/sessions/{session}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/checkout/sessions',
methodType: 'list',
}),
expire: stripeMethod({
method: 'POST',
fullPath: '/v1/checkout/sessions/{session}/expire',
}),
listLineItems: stripeMethod({
method: 'GET',
fullPath: '/v1/checkout/sessions/{session}/line_items',
methodType: 'list',
}),
});
@@ -0,0 +1,17 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.CountrySpecs = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.CountrySpecs = StripeResource_js_1.StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/country_specs/{country}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/country_specs',
methodType: 'list',
}),
});
+17
View File
@@ -0,0 +1,17 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Coupons = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Coupons = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/coupons' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/coupons/{coupon}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/coupons/{coupon}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/coupons',
methodType: 'list',
}),
del: stripeMethod({ method: 'DELETE', fullPath: '/v1/coupons/{coupon}' }),
});
@@ -0,0 +1,31 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.CreditNotes = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.CreditNotes = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/credit_notes' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/credit_notes/{id}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/credit_notes/{id}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/credit_notes',
methodType: 'list',
}),
listLineItems: stripeMethod({
method: 'GET',
fullPath: '/v1/credit_notes/{credit_note}/lines',
methodType: 'list',
}),
listPreviewLineItems: stripeMethod({
method: 'GET',
fullPath: '/v1/credit_notes/preview/lines',
methodType: 'list',
}),
preview: stripeMethod({ method: 'GET', fullPath: '/v1/credit_notes/preview' }),
voidCreditNote: stripeMethod({
method: 'POST',
fullPath: '/v1/credit_notes/{id}/void',
}),
});
@@ -0,0 +1,115 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Customers = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Customers = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/customers' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/customers/{customer}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/customers/{customer}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/customers',
methodType: 'list',
}),
del: stripeMethod({ method: 'DELETE', fullPath: '/v1/customers/{customer}' }),
createFundingInstructions: stripeMethod({
method: 'POST',
fullPath: '/v1/customers/{customer}/funding_instructions',
}),
createBalanceTransaction: stripeMethod({
method: 'POST',
fullPath: '/v1/customers/{customer}/balance_transactions',
}),
createSource: stripeMethod({
method: 'POST',
fullPath: '/v1/customers/{customer}/sources',
}),
createTaxId: stripeMethod({
method: 'POST',
fullPath: '/v1/customers/{customer}/tax_ids',
}),
deleteDiscount: stripeMethod({
method: 'DELETE',
fullPath: '/v1/customers/{customer}/discount',
}),
deleteSource: stripeMethod({
method: 'DELETE',
fullPath: '/v1/customers/{customer}/sources/{id}',
}),
deleteTaxId: stripeMethod({
method: 'DELETE',
fullPath: '/v1/customers/{customer}/tax_ids/{id}',
}),
listPaymentMethods: stripeMethod({
method: 'GET',
fullPath: '/v1/customers/{customer}/payment_methods',
methodType: 'list',
}),
listBalanceTransactions: stripeMethod({
method: 'GET',
fullPath: '/v1/customers/{customer}/balance_transactions',
methodType: 'list',
}),
listCashBalanceTransactions: stripeMethod({
method: 'GET',
fullPath: '/v1/customers/{customer}/cash_balance_transactions',
methodType: 'list',
}),
listSources: stripeMethod({
method: 'GET',
fullPath: '/v1/customers/{customer}/sources',
methodType: 'list',
}),
listTaxIds: stripeMethod({
method: 'GET',
fullPath: '/v1/customers/{customer}/tax_ids',
methodType: 'list',
}),
retrievePaymentMethod: stripeMethod({
method: 'GET',
fullPath: '/v1/customers/{customer}/payment_methods/{payment_method}',
}),
retrieveBalanceTransaction: stripeMethod({
method: 'GET',
fullPath: '/v1/customers/{customer}/balance_transactions/{transaction}',
}),
retrieveCashBalance: stripeMethod({
method: 'GET',
fullPath: '/v1/customers/{customer}/cash_balance',
}),
retrieveCashBalanceTransaction: stripeMethod({
method: 'GET',
fullPath: '/v1/customers/{customer}/cash_balance_transactions/{transaction}',
}),
retrieveSource: stripeMethod({
method: 'GET',
fullPath: '/v1/customers/{customer}/sources/{id}',
}),
retrieveTaxId: stripeMethod({
method: 'GET',
fullPath: '/v1/customers/{customer}/tax_ids/{id}',
}),
search: stripeMethod({
method: 'GET',
fullPath: '/v1/customers/search',
methodType: 'search',
}),
updateBalanceTransaction: stripeMethod({
method: 'POST',
fullPath: '/v1/customers/{customer}/balance_transactions/{transaction}',
}),
updateCashBalance: stripeMethod({
method: 'POST',
fullPath: '/v1/customers/{customer}/cash_balance',
}),
updateSource: stripeMethod({
method: 'POST',
fullPath: '/v1/customers/{customer}/sources/{id}',
}),
verifySource: stripeMethod({
method: 'POST',
fullPath: '/v1/customers/{customer}/sources/{id}/verify',
}),
});
@@ -0,0 +1,19 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Disputes = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Disputes = StripeResource_js_1.StripeResource.extend({
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/disputes/{dispute}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/disputes/{dispute}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/disputes',
methodType: 'list',
}),
close: stripeMethod({
method: 'POST',
fullPath: '/v1/disputes/{dispute}/close',
}),
});
@@ -0,0 +1,18 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.EphemeralKeys = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.EphemeralKeys = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/ephemeral_keys',
validator: (data, options) => {
if (!options.headers || !options.headers['Stripe-Version']) {
throw new Error('Passing apiVersion in a separate options hash is required to create an ephemeral key. See https://stripe.com/docs/api/versioning?lang=node');
}
},
}),
del: stripeMethod({ method: 'DELETE', fullPath: '/v1/ephemeral_keys/{key}' }),
});
+14
View File
@@ -0,0 +1,14 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Events = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Events = StripeResource_js_1.StripeResource.extend({
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/events/{id}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/events',
methodType: 'list',
}),
});
@@ -0,0 +1,17 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExchangeRates = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.ExchangeRates = StripeResource_js_1.StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/exchange_rates/{rate_id}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/exchange_rates',
methodType: 'list',
}),
});
@@ -0,0 +1,16 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.FileLinks = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.FileLinks = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/file_links' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/file_links/{link}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/file_links/{link}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/file_links',
methodType: 'list',
}),
});
+24
View File
@@ -0,0 +1,24 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Files = void 0;
const multipart_js_1 = require("../multipart.js");
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Files = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/files',
headers: {
'Content-Type': 'multipart/form-data',
},
host: 'files.stripe.com',
}),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/files/{file}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/files',
methodType: 'list',
}),
requestDataProcessor: multipart_js_1.multipartRequestDataProcessor,
});
@@ -0,0 +1,30 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Accounts = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Accounts = StripeResource_js_1.StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/financial_connections/accounts/{account}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/financial_connections/accounts',
methodType: 'list',
}),
disconnect: stripeMethod({
method: 'POST',
fullPath: '/v1/financial_connections/accounts/{account}/disconnect',
}),
listOwners: stripeMethod({
method: 'GET',
fullPath: '/v1/financial_connections/accounts/{account}/owners',
methodType: 'list',
}),
refresh: stripeMethod({
method: 'POST',
fullPath: '/v1/financial_connections/accounts/{account}/refresh',
}),
});
@@ -0,0 +1,16 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Sessions = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Sessions = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/financial_connections/sessions',
}),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/financial_connections/sessions/{session}',
}),
});
@@ -0,0 +1,17 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.VerificationReports = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.VerificationReports = StripeResource_js_1.StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/identity/verification_reports/{report}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/identity/verification_reports',
methodType: 'list',
}),
});
@@ -0,0 +1,33 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.VerificationSessions = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.VerificationSessions = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/identity/verification_sessions',
}),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/identity/verification_sessions/{session}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/identity/verification_sessions/{session}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/identity/verification_sessions',
methodType: 'list',
}),
cancel: stripeMethod({
method: 'POST',
fullPath: '/v1/identity/verification_sessions/{session}/cancel',
}),
redact: stripeMethod({
method: 'POST',
fullPath: '/v1/identity/verification_sessions/{session}/redact',
}),
});
@@ -0,0 +1,26 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.InvoiceItems = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.InvoiceItems = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/invoiceitems' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/invoiceitems/{invoiceitem}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/invoiceitems/{invoiceitem}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/invoiceitems',
methodType: 'list',
}),
del: stripeMethod({
method: 'DELETE',
fullPath: '/v1/invoiceitems/{invoiceitem}',
}),
});
@@ -0,0 +1,53 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Invoices = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Invoices = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/invoices' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/invoices/{invoice}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/invoices/{invoice}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/invoices',
methodType: 'list',
}),
del: stripeMethod({ method: 'DELETE', fullPath: '/v1/invoices/{invoice}' }),
finalizeInvoice: stripeMethod({
method: 'POST',
fullPath: '/v1/invoices/{invoice}/finalize',
}),
listLineItems: stripeMethod({
method: 'GET',
fullPath: '/v1/invoices/{invoice}/lines',
methodType: 'list',
}),
listUpcomingLines: stripeMethod({
method: 'GET',
fullPath: '/v1/invoices/upcoming/lines',
methodType: 'list',
}),
markUncollectible: stripeMethod({
method: 'POST',
fullPath: '/v1/invoices/{invoice}/mark_uncollectible',
}),
pay: stripeMethod({ method: 'POST', fullPath: '/v1/invoices/{invoice}/pay' }),
retrieveUpcoming: stripeMethod({
method: 'GET',
fullPath: '/v1/invoices/upcoming',
}),
search: stripeMethod({
method: 'GET',
fullPath: '/v1/invoices/search',
methodType: 'search',
}),
sendInvoice: stripeMethod({
method: 'POST',
fullPath: '/v1/invoices/{invoice}/send',
}),
voidInvoice: stripeMethod({
method: 'POST',
fullPath: '/v1/invoices/{invoice}/void',
}),
});
@@ -0,0 +1,29 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Authorizations = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Authorizations = StripeResource_js_1.StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/issuing/authorizations/{authorization}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/issuing/authorizations/{authorization}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/issuing/authorizations',
methodType: 'list',
}),
approve: stripeMethod({
method: 'POST',
fullPath: '/v1/issuing/authorizations/{authorization}/approve',
}),
decline: stripeMethod({
method: 'POST',
fullPath: '/v1/issuing/authorizations/{authorization}/decline',
}),
});
@@ -0,0 +1,22 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Cardholders = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Cardholders = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/issuing/cardholders' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/issuing/cardholders/{cardholder}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/issuing/cardholders/{cardholder}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/issuing/cardholders',
methodType: 'list',
}),
});
@@ -0,0 +1,16 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Cards = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Cards = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/issuing/cards' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/issuing/cards/{card}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/issuing/cards/{card}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/issuing/cards',
methodType: 'list',
}),
});
@@ -0,0 +1,26 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Disputes = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Disputes = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/issuing/disputes' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/issuing/disputes/{dispute}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/issuing/disputes/{dispute}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/issuing/disputes',
methodType: 'list',
}),
submit: stripeMethod({
method: 'POST',
fullPath: '/v1/issuing/disputes/{dispute}/submit',
}),
});
@@ -0,0 +1,21 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Transactions = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Transactions = StripeResource_js_1.StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/issuing/transactions/{transaction}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/issuing/transactions/{transaction}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/issuing/transactions',
methodType: 'list',
}),
});
@@ -0,0 +1,9 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Mandates = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Mandates = StripeResource_js_1.StripeResource.extend({
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/mandates/{mandate}' }),
});
+44
View File
@@ -0,0 +1,44 @@
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
exports.OAuth = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const utils_js_1 = require("../utils.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
const oAuthHost = 'connect.stripe.com';
exports.OAuth = StripeResource_js_1.StripeResource.extend({
basePath: '/',
authorizeUrl(params, options) {
params = params || {};
options = options || {};
let path = 'oauth/authorize';
// For Express accounts, the path changes
if (options.express) {
path = `express/${path}`;
}
if (!params.response_type) {
params.response_type = 'code';
}
if (!params.client_id) {
params.client_id = this._stripe.getClientId();
}
if (!params.scope) {
params.scope = 'read_write';
}
return `https://${oAuthHost}/${path}?${(0, utils_js_1.stringifyRequestData)(params)}`;
},
token: stripeMethod({
method: 'POST',
path: 'oauth/token',
host: oAuthHost,
}),
deauthorize(spec, ...args) {
if (!spec.client_id) {
spec.client_id = this._stripe.getClientId();
}
return stripeMethod({
method: 'POST',
path: 'oauth/deauthorize',
host: oAuthHost,
}).apply(this, [spec, ...args]);
},
});
@@ -0,0 +1,51 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.PaymentIntents = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.PaymentIntents = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/payment_intents' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/payment_intents/{intent}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/payment_intents/{intent}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/payment_intents',
methodType: 'list',
}),
applyCustomerBalance: stripeMethod({
method: 'POST',
fullPath: '/v1/payment_intents/{intent}/apply_customer_balance',
}),
cancel: stripeMethod({
method: 'POST',
fullPath: '/v1/payment_intents/{intent}/cancel',
}),
capture: stripeMethod({
method: 'POST',
fullPath: '/v1/payment_intents/{intent}/capture',
}),
confirm: stripeMethod({
method: 'POST',
fullPath: '/v1/payment_intents/{intent}/confirm',
}),
incrementAuthorization: stripeMethod({
method: 'POST',
fullPath: '/v1/payment_intents/{intent}/increment_authorization',
}),
search: stripeMethod({
method: 'GET',
fullPath: '/v1/payment_intents/search',
methodType: 'search',
}),
verifyMicrodeposits: stripeMethod({
method: 'POST',
fullPath: '/v1/payment_intents/{intent}/verify_microdeposits',
}),
});
@@ -0,0 +1,27 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.PaymentLinks = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.PaymentLinks = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/payment_links' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/payment_links/{payment_link}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/payment_links/{payment_link}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/payment_links',
methodType: 'list',
}),
listLineItems: stripeMethod({
method: 'GET',
fullPath: '/v1/payment_links/{payment_link}/line_items',
methodType: 'list',
}),
});
@@ -0,0 +1,30 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.PaymentMethods = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.PaymentMethods = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/payment_methods' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/payment_methods/{payment_method}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/payment_methods/{payment_method}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/payment_methods',
methodType: 'list',
}),
attach: stripeMethod({
method: 'POST',
fullPath: '/v1/payment_methods/{payment_method}/attach',
}),
detach: stripeMethod({
method: 'POST',
fullPath: '/v1/payment_methods/{payment_method}/detach',
}),
});
+24
View File
@@ -0,0 +1,24 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Payouts = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Payouts = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/payouts' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/payouts/{payout}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/payouts/{payout}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/payouts',
methodType: 'list',
}),
cancel: stripeMethod({
method: 'POST',
fullPath: '/v1/payouts/{payout}/cancel',
}),
reverse: stripeMethod({
method: 'POST',
fullPath: '/v1/payouts/{payout}/reverse',
}),
});
+17
View File
@@ -0,0 +1,17 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Plans = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Plans = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/plans' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/plans/{plan}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/plans/{plan}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/plans',
methodType: 'list',
}),
del: stripeMethod({ method: 'DELETE', fullPath: '/v1/plans/{plan}' }),
});
+21
View File
@@ -0,0 +1,21 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Prices = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Prices = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/prices' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/prices/{price}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/prices/{price}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/prices',
methodType: 'list',
}),
search: stripeMethod({
method: 'GET',
fullPath: '/v1/prices/search',
methodType: 'search',
}),
});
@@ -0,0 +1,22 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Products = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Products = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/products' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/products/{id}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/products/{id}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/products',
methodType: 'list',
}),
del: stripeMethod({ method: 'DELETE', fullPath: '/v1/products/{id}' }),
search: stripeMethod({
method: 'GET',
fullPath: '/v1/products/search',
methodType: 'search',
}),
});
@@ -0,0 +1,22 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.PromotionCodes = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.PromotionCodes = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/promotion_codes' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/promotion_codes/{promotion_code}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/promotion_codes/{promotion_code}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/promotion_codes',
methodType: 'list',
}),
});
+38
View File
@@ -0,0 +1,38 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Quotes = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Quotes = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/quotes' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/quotes/{quote}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/quotes/{quote}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/quotes',
methodType: 'list',
}),
accept: stripeMethod({ method: 'POST', fullPath: '/v1/quotes/{quote}/accept' }),
cancel: stripeMethod({ method: 'POST', fullPath: '/v1/quotes/{quote}/cancel' }),
finalizeQuote: stripeMethod({
method: 'POST',
fullPath: '/v1/quotes/{quote}/finalize',
}),
listComputedUpfrontLineItems: stripeMethod({
method: 'GET',
fullPath: '/v1/quotes/{quote}/computed_upfront_line_items',
methodType: 'list',
}),
listLineItems: stripeMethod({
method: 'GET',
fullPath: '/v1/quotes/{quote}/line_items',
methodType: 'list',
}),
pdf: stripeMethod({
method: 'GET',
fullPath: '/v1/quotes/{quote}/pdf',
host: 'files.stripe.com',
streaming: true,
}),
});
@@ -0,0 +1,17 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.EarlyFraudWarnings = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.EarlyFraudWarnings = StripeResource_js_1.StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/radar/early_fraud_warnings/{early_fraud_warning}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/radar/early_fraud_warnings',
methodType: 'list',
}),
});
@@ -0,0 +1,25 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.ValueListItems = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.ValueListItems = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/radar/value_list_items',
}),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/radar/value_list_items/{item}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/radar/value_list_items',
methodType: 'list',
}),
del: stripeMethod({
method: 'DELETE',
fullPath: '/v1/radar/value_list_items/{item}',
}),
});
@@ -0,0 +1,26 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.ValueLists = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.ValueLists = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/radar/value_lists' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/radar/value_lists/{value_list}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/radar/value_lists/{value_list}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/radar/value_lists',
methodType: 'list',
}),
del: stripeMethod({
method: 'DELETE',
fullPath: '/v1/radar/value_lists/{value_list}',
}),
});
+20
View File
@@ -0,0 +1,20 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Refunds = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Refunds = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/refunds' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/refunds/{refund}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/refunds/{refund}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/refunds',
methodType: 'list',
}),
cancel: stripeMethod({
method: 'POST',
fullPath: '/v1/refunds/{refund}/cancel',
}),
});
@@ -0,0 +1,18 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReportRuns = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.ReportRuns = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/reporting/report_runs' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/reporting/report_runs/{report_run}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/reporting/report_runs',
methodType: 'list',
}),
});
@@ -0,0 +1,17 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReportTypes = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.ReportTypes = StripeResource_js_1.StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/reporting/report_types/{report_type}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/reporting/report_types',
methodType: 'list',
}),
});
+18
View File
@@ -0,0 +1,18 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Reviews = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Reviews = StripeResource_js_1.StripeResource.extend({
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/reviews/{review}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/reviews',
methodType: 'list',
}),
approve: stripeMethod({
method: 'POST',
fullPath: '/v1/reviews/{review}/approve',
}),
});
@@ -0,0 +1,13 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.SetupAttempts = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.SetupAttempts = StripeResource_js_1.StripeResource.extend({
list: stripeMethod({
method: 'GET',
fullPath: '/v1/setup_attempts',
methodType: 'list',
}),
});
@@ -0,0 +1,34 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.SetupIntents = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.SetupIntents = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/setup_intents' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/setup_intents/{intent}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/setup_intents/{intent}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/setup_intents',
methodType: 'list',
}),
cancel: stripeMethod({
method: 'POST',
fullPath: '/v1/setup_intents/{intent}/cancel',
}),
confirm: stripeMethod({
method: 'POST',
fullPath: '/v1/setup_intents/{intent}/confirm',
}),
verifyMicrodeposits: stripeMethod({
method: 'POST',
fullPath: '/v1/setup_intents/{intent}/verify_microdeposits',
}),
});
@@ -0,0 +1,22 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.ShippingRates = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.ShippingRates = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/shipping_rates' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/shipping_rates/{shipping_rate_token}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/shipping_rates/{shipping_rate_token}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/shipping_rates',
methodType: 'list',
}),
});
@@ -0,0 +1,17 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.ScheduledQueryRuns = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.ScheduledQueryRuns = StripeResource_js_1.StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/sigma/scheduled_query_runs/{scheduled_query_run}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/sigma/scheduled_query_runs',
methodType: 'list',
}),
});
+20
View File
@@ -0,0 +1,20 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Sources = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Sources = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/sources' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/sources/{source}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/sources/{source}' }),
listSourceTransactions: stripeMethod({
method: 'GET',
fullPath: '/v1/sources/{source}/source_transactions',
methodType: 'list',
}),
verify: stripeMethod({
method: 'POST',
fullPath: '/v1/sources/{source}/verify',
}),
});
@@ -0,0 +1,35 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.SubscriptionItems = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.SubscriptionItems = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/subscription_items' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/subscription_items/{item}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/subscription_items/{item}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/subscription_items',
methodType: 'list',
}),
del: stripeMethod({
method: 'DELETE',
fullPath: '/v1/subscription_items/{item}',
}),
createUsageRecord: stripeMethod({
method: 'POST',
fullPath: '/v1/subscription_items/{subscription_item}/usage_records',
}),
listUsageRecordSummaries: stripeMethod({
method: 'GET',
fullPath: '/v1/subscription_items/{subscription_item}/usage_record_summaries',
methodType: 'list',
}),
});
@@ -0,0 +1,33 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.SubscriptionSchedules = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.SubscriptionSchedules = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/subscription_schedules',
}),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/subscription_schedules/{schedule}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/subscription_schedules/{schedule}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/subscription_schedules',
methodType: 'list',
}),
cancel: stripeMethod({
method: 'POST',
fullPath: '/v1/subscription_schedules/{schedule}/cancel',
}),
release: stripeMethod({
method: 'POST',
fullPath: '/v1/subscription_schedules/{schedule}/release',
}),
});
@@ -0,0 +1,43 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Subscriptions = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Subscriptions = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/subscriptions' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/subscriptions/{subscription_exposed_id}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/subscriptions/{subscription_exposed_id}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/subscriptions',
methodType: 'list',
}),
cancel: stripeMethod({
method: 'DELETE',
fullPath: '/v1/subscriptions/{subscription_exposed_id}',
}),
del: stripeMethod({
method: 'DELETE',
fullPath: '/v1/subscriptions/{subscription_exposed_id}',
}),
deleteDiscount: stripeMethod({
method: 'DELETE',
fullPath: '/v1/subscriptions/{subscription_exposed_id}/discount',
}),
resume: stripeMethod({
method: 'POST',
fullPath: '/v1/subscriptions/{subscription}/resume',
}),
search: stripeMethod({
method: 'GET',
fullPath: '/v1/subscriptions/search',
methodType: 'search',
}),
});
@@ -0,0 +1,14 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Calculations = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Calculations = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/tax/calculations' }),
listLineItems: stripeMethod({
method: 'GET',
fullPath: '/v1/tax/calculations/{calculation}/line_items',
methodType: 'list',
}),
});
@@ -0,0 +1,10 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Settings = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Settings = StripeResource_js_1.StripeResource.extend({
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/tax/settings' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/tax/settings' }),
});
@@ -0,0 +1,25 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Transactions = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Transactions = StripeResource_js_1.StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/tax/transactions/{transaction}',
}),
createFromCalculation: stripeMethod({
method: 'POST',
fullPath: '/v1/tax/transactions/create_from_calculation',
}),
createReversal: stripeMethod({
method: 'POST',
fullPath: '/v1/tax/transactions/create_reversal',
}),
listLineItems: stripeMethod({
method: 'GET',
fullPath: '/v1/tax/transactions/{transaction}/line_items',
methodType: 'list',
}),
});
@@ -0,0 +1,14 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.TaxCodes = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.TaxCodes = StripeResource_js_1.StripeResource.extend({
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/tax_codes/{id}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/tax_codes',
methodType: 'list',
}),
});
@@ -0,0 +1,16 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.TaxRates = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.TaxRates = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/tax_rates' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/tax_rates/{tax_rate}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/tax_rates/{tax_rate}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/tax_rates',
methodType: 'list',
}),
});
@@ -0,0 +1,29 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Configurations = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Configurations = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/terminal/configurations',
}),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/terminal/configurations/{configuration}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/terminal/configurations/{configuration}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/terminal/configurations',
methodType: 'list',
}),
del: stripeMethod({
method: 'DELETE',
fullPath: '/v1/terminal/configurations/{configuration}',
}),
});
@@ -0,0 +1,12 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConnectionTokens = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.ConnectionTokens = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/terminal/connection_tokens',
}),
});
@@ -0,0 +1,26 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Locations = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Locations = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/terminal/locations' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/terminal/locations/{location}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/terminal/locations/{location}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/terminal/locations',
methodType: 'list',
}),
del: stripeMethod({
method: 'DELETE',
fullPath: '/v1/terminal/locations/{location}',
}),
});
@@ -0,0 +1,46 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Readers = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Readers = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/terminal/readers' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/terminal/readers/{reader}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/terminal/readers/{reader}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/terminal/readers',
methodType: 'list',
}),
del: stripeMethod({
method: 'DELETE',
fullPath: '/v1/terminal/readers/{reader}',
}),
cancelAction: stripeMethod({
method: 'POST',
fullPath: '/v1/terminal/readers/{reader}/cancel_action',
}),
processPaymentIntent: stripeMethod({
method: 'POST',
fullPath: '/v1/terminal/readers/{reader}/process_payment_intent',
}),
processSetupIntent: stripeMethod({
method: 'POST',
fullPath: '/v1/terminal/readers/{reader}/process_setup_intent',
}),
refundPayment: stripeMethod({
method: 'POST',
fullPath: '/v1/terminal/readers/{reader}/refund_payment',
}),
setReaderDisplay: stripeMethod({
method: 'POST',
fullPath: '/v1/terminal/readers/{reader}/set_reader_display',
}),
});
@@ -0,0 +1,12 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Customers = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Customers = StripeResource_js_1.StripeResource.extend({
fundCashBalance: stripeMethod({
method: 'POST',
fullPath: '/v1/test_helpers/customers/{customer}/fund_cash_balance',
}),
});
@@ -0,0 +1,24 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Cards = void 0;
const StripeResource_js_1 = require("../../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Cards = StripeResource_js_1.StripeResource.extend({
deliverCard: stripeMethod({
method: 'POST',
fullPath: '/v1/test_helpers/issuing/cards/{card}/shipping/deliver',
}),
failCard: stripeMethod({
method: 'POST',
fullPath: '/v1/test_helpers/issuing/cards/{card}/shipping/fail',
}),
returnCard: stripeMethod({
method: 'POST',
fullPath: '/v1/test_helpers/issuing/cards/{card}/shipping/return',
}),
shipCard: stripeMethod({
method: 'POST',
fullPath: '/v1/test_helpers/issuing/cards/{card}/shipping/ship',
}),
});
@@ -0,0 +1,12 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Refunds = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Refunds = StripeResource_js_1.StripeResource.extend({
expire: stripeMethod({
method: 'POST',
fullPath: '/v1/test_helpers/refunds/{refund}/expire',
}),
});
@@ -0,0 +1,12 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Readers = void 0;
const StripeResource_js_1 = require("../../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Readers = StripeResource_js_1.StripeResource.extend({
presentPaymentMethod: stripeMethod({
method: 'POST',
fullPath: '/v1/test_helpers/terminal/readers/{reader}/present_payment_method',
}),
});
@@ -0,0 +1,29 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.TestClocks = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.TestClocks = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/test_helpers/test_clocks',
}),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/test_helpers/test_clocks/{test_clock}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/test_helpers/test_clocks',
methodType: 'list',
}),
del: stripeMethod({
method: 'DELETE',
fullPath: '/v1/test_helpers/test_clocks/{test_clock}',
}),
advance: stripeMethod({
method: 'POST',
fullPath: '/v1/test_helpers/test_clocks/{test_clock}/advance',
}),
});
@@ -0,0 +1,20 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.InboundTransfers = void 0;
const StripeResource_js_1 = require("../../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.InboundTransfers = StripeResource_js_1.StripeResource.extend({
fail: stripeMethod({
method: 'POST',
fullPath: '/v1/test_helpers/treasury/inbound_transfers/{id}/fail',
}),
returnInboundTransfer: stripeMethod({
method: 'POST',
fullPath: '/v1/test_helpers/treasury/inbound_transfers/{id}/return',
}),
succeed: stripeMethod({
method: 'POST',
fullPath: '/v1/test_helpers/treasury/inbound_transfers/{id}/succeed',
}),
});
@@ -0,0 +1,20 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.OutboundPayments = void 0;
const StripeResource_js_1 = require("../../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.OutboundPayments = StripeResource_js_1.StripeResource.extend({
fail: stripeMethod({
method: 'POST',
fullPath: '/v1/test_helpers/treasury/outbound_payments/{id}/fail',
}),
post: stripeMethod({
method: 'POST',
fullPath: '/v1/test_helpers/treasury/outbound_payments/{id}/post',
}),
returnOutboundPayment: stripeMethod({
method: 'POST',
fullPath: '/v1/test_helpers/treasury/outbound_payments/{id}/return',
}),
});
@@ -0,0 +1,20 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.OutboundTransfers = void 0;
const StripeResource_js_1 = require("../../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.OutboundTransfers = StripeResource_js_1.StripeResource.extend({
fail: stripeMethod({
method: 'POST',
fullPath: '/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail',
}),
post: stripeMethod({
method: 'POST',
fullPath: '/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post',
}),
returnOutboundTransfer: stripeMethod({
method: 'POST',
fullPath: '/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return',
}),
});
@@ -0,0 +1,12 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReceivedCredits = void 0;
const StripeResource_js_1 = require("../../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.ReceivedCredits = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/test_helpers/treasury/received_credits',
}),
});
@@ -0,0 +1,12 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReceivedDebits = void 0;
const StripeResource_js_1 = require("../../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.ReceivedDebits = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/test_helpers/treasury/received_debits',
}),
});
+10
View File
@@ -0,0 +1,10 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Tokens = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Tokens = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/tokens' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/tokens/{token}' }),
});
+17
View File
@@ -0,0 +1,17 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Topups = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Topups = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/topups' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/topups/{topup}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/topups/{topup}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/topups',
methodType: 'list',
}),
cancel: stripeMethod({ method: 'POST', fullPath: '/v1/topups/{topup}/cancel' }),
});
@@ -0,0 +1,33 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Transfers = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Transfers = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/transfers' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/transfers/{transfer}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/transfers/{transfer}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/transfers',
methodType: 'list',
}),
createReversal: stripeMethod({
method: 'POST',
fullPath: '/v1/transfers/{id}/reversals',
}),
listReversals: stripeMethod({
method: 'GET',
fullPath: '/v1/transfers/{id}/reversals',
methodType: 'list',
}),
retrieveReversal: stripeMethod({
method: 'GET',
fullPath: '/v1/transfers/{transfer}/reversals/{id}',
}),
updateReversal: stripeMethod({
method: 'POST',
fullPath: '/v1/transfers/{transfer}/reversals/{id}',
}),
});
@@ -0,0 +1,21 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.CreditReversals = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.CreditReversals = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/treasury/credit_reversals',
}),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/treasury/credit_reversals/{credit_reversal}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/treasury/credit_reversals',
methodType: 'list',
}),
});
@@ -0,0 +1,21 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.DebitReversals = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.DebitReversals = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/treasury/debit_reversals',
}),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/treasury/debit_reversals/{debit_reversal}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/treasury/debit_reversals',
methodType: 'list',
}),
});
@@ -0,0 +1,33 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.FinancialAccounts = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.FinancialAccounts = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/treasury/financial_accounts',
}),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/treasury/financial_accounts/{financial_account}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/treasury/financial_accounts/{financial_account}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/treasury/financial_accounts',
methodType: 'list',
}),
retrieveFeatures: stripeMethod({
method: 'GET',
fullPath: '/v1/treasury/financial_accounts/{financial_account}/features',
}),
updateFeatures: stripeMethod({
method: 'POST',
fullPath: '/v1/treasury/financial_accounts/{financial_account}/features',
}),
});
@@ -0,0 +1,25 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.InboundTransfers = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.InboundTransfers = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/treasury/inbound_transfers',
}),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/treasury/inbound_transfers/{id}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/treasury/inbound_transfers',
methodType: 'list',
}),
cancel: stripeMethod({
method: 'POST',
fullPath: '/v1/treasury/inbound_transfers/{inbound_transfer}/cancel',
}),
});
@@ -0,0 +1,25 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.OutboundPayments = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.OutboundPayments = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/treasury/outbound_payments',
}),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/treasury/outbound_payments/{id}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/treasury/outbound_payments',
methodType: 'list',
}),
cancel: stripeMethod({
method: 'POST',
fullPath: '/v1/treasury/outbound_payments/{id}/cancel',
}),
});
@@ -0,0 +1,25 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.OutboundTransfers = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.OutboundTransfers = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/treasury/outbound_transfers',
}),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/treasury/outbound_transfers/{outbound_transfer}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/treasury/outbound_transfers',
methodType: 'list',
}),
cancel: stripeMethod({
method: 'POST',
fullPath: '/v1/treasury/outbound_transfers/{outbound_transfer}/cancel',
}),
});
@@ -0,0 +1,17 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReceivedCredits = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.ReceivedCredits = StripeResource_js_1.StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/treasury/received_credits/{id}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/treasury/received_credits',
methodType: 'list',
}),
});
@@ -0,0 +1,17 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReceivedDebits = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.ReceivedDebits = StripeResource_js_1.StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/treasury/received_debits/{id}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/treasury/received_debits',
methodType: 'list',
}),
});
@@ -0,0 +1,17 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.TransactionEntries = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.TransactionEntries = StripeResource_js_1.StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/treasury/transaction_entries/{id}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/treasury/transaction_entries',
methodType: 'list',
}),
});
@@ -0,0 +1,17 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.Transactions = void 0;
const StripeResource_js_1 = require("../../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.Transactions = StripeResource_js_1.StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/treasury/transactions/{id}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/treasury/transactions',
methodType: 'list',
}),
});
@@ -0,0 +1,26 @@
"use strict";
// File generated from our OpenAPI spec
Object.defineProperty(exports, "__esModule", { value: true });
exports.WebhookEndpoints = void 0;
const StripeResource_js_1 = require("../StripeResource.js");
const stripeMethod = StripeResource_js_1.StripeResource.method;
exports.WebhookEndpoints = StripeResource_js_1.StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/webhook_endpoints' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/webhook_endpoints/{webhook_endpoint}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/webhook_endpoints/{webhook_endpoint}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/webhook_endpoints',
methodType: 'list',
}),
del: stripeMethod({
method: 'DELETE',
fullPath: '/v1/webhook_endpoints/{webhook_endpoint}',
}),
});
+11
View File
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const NodePlatformFunctions_js_1 = require("./platform/NodePlatformFunctions.js");
const stripe_core_js_1 = require("./stripe.core.js");
const Stripe = (0, stripe_core_js_1.createStripe)(new NodePlatformFunctions_js_1.NodePlatformFunctions());
module.exports = Stripe;
// expose constructor as a named property to enable mocking with Sinon.JS
module.exports.Stripe = Stripe;
// Allow use with the TypeScript compiler without `esModuleInterop`.
// We may also want to add `Object.defineProperty(exports, "__esModule", {value: true});` in the future, so that Babel users will use the `default` version.
module.exports.default = Stripe;
+11
View File
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const WebPlatformFunctions_js_1 = require("./platform/WebPlatformFunctions.js");
const stripe_core_js_1 = require("./stripe.core.js");
const Stripe = (0, stripe_core_js_1.createStripe)(new WebPlatformFunctions_js_1.WebPlatformFunctions());
module.exports = Stripe;
// expose constructor as a named property to enable mocking with Sinon.JS
module.exports.Stripe = Stripe;
// Allow use with the TypeScript compiler without `esModuleInterop`.
// We may also want to add `Object.defineProperty(exports, "__esModule", {value: true});` in the future, so that Babel users will use the `default` version.
module.exports.default = Stripe;
+349
View File
@@ -0,0 +1,349 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createStripe = void 0;
const _Error = require("./Error.js");
const apiVersion = require("./apiVersion.js");
const resources = require("./resources.js");
const HttpClient_js_1 = require("./net/HttpClient.js");
const utils_js_1 = require("./utils.js");
const CryptoProvider_js_1 = require("./crypto/CryptoProvider.js");
const RequestSender_js_1 = require("./RequestSender.js");
const StripeResource_js_1 = require("./StripeResource.js");
const Webhooks_js_1 = require("./Webhooks.js");
const DEFAULT_HOST = 'api.stripe.com';
const DEFAULT_PORT = '443';
const DEFAULT_BASE_PATH = '/v1/';
const DEFAULT_API_VERSION = apiVersion.ApiVersion;
const DEFAULT_TIMEOUT = 80000;
const MAX_NETWORK_RETRY_DELAY_SEC = 2;
const INITIAL_NETWORK_RETRY_DELAY_SEC = 0.5;
const APP_INFO_PROPERTIES = ['name', 'version', 'url', 'partner_id'];
const ALLOWED_CONFIG_PROPERTIES = [
'apiVersion',
'typescript',
'maxNetworkRetries',
'httpAgent',
'httpClient',
'timeout',
'host',
'port',
'protocol',
'telemetry',
'appInfo',
'stripeAccount',
];
const defaultRequestSenderFactory = (stripe) => new RequestSender_js_1.RequestSender(stripe, StripeResource_js_1.StripeResource.MAX_BUFFERED_REQUEST_METRICS);
function createStripe(platformFunctions, requestSender = defaultRequestSenderFactory) {
Stripe.PACKAGE_VERSION = '12.18.0';
Stripe.USER_AGENT = Object.assign({ bindings_version: Stripe.PACKAGE_VERSION, lang: 'node', publisher: 'stripe', uname: null, typescript: false }, (0, utils_js_1.determineProcessUserAgentProperties)());
Stripe.StripeResource = StripeResource_js_1.StripeResource;
Stripe.resources = resources;
Stripe.HttpClient = HttpClient_js_1.HttpClient;
Stripe.HttpClientResponse = HttpClient_js_1.HttpClientResponse;
Stripe.CryptoProvider = CryptoProvider_js_1.CryptoProvider;
function Stripe(key, config = {}) {
if (!(this instanceof Stripe)) {
return new Stripe(key, config);
}
const props = this._getPropsFromConfig(config);
this._platformFunctions = platformFunctions;
Object.defineProperty(this, '_emitter', {
value: this._platformFunctions.createEmitter(),
enumerable: false,
configurable: false,
writable: false,
});
this.VERSION = Stripe.PACKAGE_VERSION;
this.on = this._emitter.on.bind(this._emitter);
this.once = this._emitter.once.bind(this._emitter);
this.off = this._emitter.removeListener.bind(this._emitter);
if (props.protocol &&
props.protocol !== 'https' &&
(!props.host || /\.stripe\.com$/.test(props.host))) {
throw new Error('The `https` protocol must be used when sending requests to `*.stripe.com`');
}
const agent = props.httpAgent || null;
this._api = {
auth: null,
host: props.host || DEFAULT_HOST,
port: props.port || DEFAULT_PORT,
protocol: props.protocol || 'https',
basePath: DEFAULT_BASE_PATH,
version: props.apiVersion || DEFAULT_API_VERSION,
timeout: (0, utils_js_1.validateInteger)('timeout', props.timeout, DEFAULT_TIMEOUT),
maxNetworkRetries: (0, utils_js_1.validateInteger)('maxNetworkRetries', props.maxNetworkRetries, 0),
agent: agent,
httpClient: props.httpClient ||
(agent
? this._platformFunctions.createNodeHttpClient(agent)
: this._platformFunctions.createDefaultHttpClient()),
dev: false,
stripeAccount: props.stripeAccount || null,
};
const typescript = props.typescript || false;
if (typescript !== Stripe.USER_AGENT.typescript) {
// The mutation here is uncomfortable, but likely fastest;
// serializing the user agent involves shelling out to the system,
// and given some users may instantiate the library many times without switching between TS and non-TS,
// we only want to incur the performance hit when that actually happens.
Stripe.USER_AGENT.typescript = typescript;
}
if (props.appInfo) {
this._setAppInfo(props.appInfo);
}
this._prepResources();
this._setApiKey(key);
this.errors = _Error;
this.webhooks = (0, Webhooks_js_1.createWebhooks)(platformFunctions);
this._prevRequestMetrics = [];
this._enableTelemetry = props.telemetry !== false;
this._requestSender = requestSender(this);
// Expose StripeResource on the instance too
// @ts-ignore
this.StripeResource = Stripe.StripeResource;
}
Stripe.errors = _Error;
Stripe.webhooks = Webhooks_js_1.createWebhooks;
Stripe.createNodeHttpClient = platformFunctions.createNodeHttpClient;
/**
* Creates an HTTP client for issuing Stripe API requests which uses the Web
* Fetch API.
*
* A fetch function can optionally be passed in as a parameter. If none is
* passed, will default to the default `fetch` function in the global scope.
*/
Stripe.createFetchHttpClient = platformFunctions.createFetchHttpClient;
/**
* Create a CryptoProvider which uses the built-in Node crypto libraries for
* its crypto operations.
*/
Stripe.createNodeCryptoProvider = platformFunctions.createNodeCryptoProvider;
/**
* Creates a CryptoProvider which uses the Subtle Crypto API from the Web
* Crypto API spec for its crypto operations.
*
* A SubtleCrypto interface can optionally be passed in as a parameter. If none
* is passed, will default to the default `crypto.subtle` object in the global
* scope.
*/
Stripe.createSubtleCryptoProvider =
platformFunctions.createSubtleCryptoProvider;
Stripe.prototype = {
// Properties are set in the constructor above
_appInfo: undefined,
on: null,
off: null,
once: null,
VERSION: null,
StripeResource: null,
webhooks: null,
errors: null,
_api: null,
_prevRequestMetrics: null,
_emitter: null,
_enableTelemetry: null,
_requestSender: null,
_platformFunctions: null,
/**
* @private
*/
_setApiKey(key) {
if (key) {
this._setApiField('auth', `Bearer ${key}`);
}
},
/**
* @private
* This may be removed in the future.
*/
_setAppInfo(info) {
if (info && typeof info !== 'object') {
throw new Error('AppInfo must be an object.');
}
if (info && !info.name) {
throw new Error('AppInfo.name is required');
}
info = info || {};
this._appInfo = APP_INFO_PROPERTIES.reduce((accum, prop) => {
if (typeof info[prop] == 'string') {
accum = accum || {};
accum[prop] = info[prop];
}
return accum;
},
// @ts-ignore
undefined);
},
/**
* @private
* This may be removed in the future.
*/
_setApiField(key, value) {
this._api[key] = value;
},
/**
* @private
* Please open or upvote an issue at github.com/stripe/stripe-node
* if you use this, detailing your use-case.
*
* It may be deprecated and removed in the future.
*/
getApiField(key) {
return this._api[key];
},
setClientId(clientId) {
this._clientId = clientId;
},
getClientId() {
return this._clientId;
},
/**
* @private
* Please open or upvote an issue at github.com/stripe/stripe-node
* if you use this, detailing your use-case.
*
* It may be deprecated and removed in the future.
*/
getConstant: (c) => {
switch (c) {
case 'DEFAULT_HOST':
return DEFAULT_HOST;
case 'DEFAULT_PORT':
return DEFAULT_PORT;
case 'DEFAULT_BASE_PATH':
return DEFAULT_BASE_PATH;
case 'DEFAULT_API_VERSION':
return DEFAULT_API_VERSION;
case 'DEFAULT_TIMEOUT':
return DEFAULT_TIMEOUT;
case 'MAX_NETWORK_RETRY_DELAY_SEC':
return MAX_NETWORK_RETRY_DELAY_SEC;
case 'INITIAL_NETWORK_RETRY_DELAY_SEC':
return INITIAL_NETWORK_RETRY_DELAY_SEC;
}
return Stripe[c];
},
getMaxNetworkRetries() {
return this.getApiField('maxNetworkRetries');
},
/**
* @private
* This may be removed in the future.
*/
_setApiNumberField(prop, n, defaultVal) {
const val = (0, utils_js_1.validateInteger)(prop, n, defaultVal);
this._setApiField(prop, val);
},
getMaxNetworkRetryDelay() {
return MAX_NETWORK_RETRY_DELAY_SEC;
},
getInitialNetworkRetryDelay() {
return INITIAL_NETWORK_RETRY_DELAY_SEC;
},
/**
* @private
* Please open or upvote an issue at github.com/stripe/stripe-node
* if you use this, detailing your use-case.
*
* It may be deprecated and removed in the future.
*
* Gets a JSON version of a User-Agent and uses a cached version for a slight
* speed advantage.
*/
getClientUserAgent(cb) {
return this.getClientUserAgentSeeded(Stripe.USER_AGENT, cb);
},
/**
* @private
* Please open or upvote an issue at github.com/stripe/stripe-node
* if you use this, detailing your use-case.
*
* It may be deprecated and removed in the future.
*
* Gets a JSON version of a User-Agent by encoding a seeded object and
* fetching a uname from the system.
*/
getClientUserAgentSeeded(seed, cb) {
this._platformFunctions.getUname().then((uname) => {
var _a;
const userAgent = {};
for (const field in seed) {
userAgent[field] = encodeURIComponent((_a = seed[field]) !== null && _a !== void 0 ? _a : 'null');
}
// URI-encode in case there are unusual characters in the system's uname.
userAgent.uname = encodeURIComponent(uname || 'UNKNOWN');
const client = this.getApiField('httpClient');
if (client) {
userAgent.httplib = encodeURIComponent(client.getClientName());
}
if (this._appInfo) {
userAgent.application = this._appInfo;
}
cb(JSON.stringify(userAgent));
});
},
/**
* @private
* Please open or upvote an issue at github.com/stripe/stripe-node
* if you use this, detailing your use-case.
*
* It may be deprecated and removed in the future.
*/
getAppInfoAsString() {
if (!this._appInfo) {
return '';
}
let formatted = this._appInfo.name;
if (this._appInfo.version) {
formatted += `/${this._appInfo.version}`;
}
if (this._appInfo.url) {
formatted += ` (${this._appInfo.url})`;
}
return formatted;
},
getTelemetryEnabled() {
return this._enableTelemetry;
},
/**
* @private
* This may be removed in the future.
*/
_prepResources() {
for (const name in resources) {
// @ts-ignore
this[(0, utils_js_1.pascalToCamelCase)(name)] = new resources[name](this);
}
},
/**
* @private
* This may be removed in the future.
*/
_getPropsFromConfig(config) {
// If config is null or undefined, just bail early with no props
if (!config) {
return {};
}
// config can be an object or a string
const isString = typeof config === 'string';
const isObject = config === Object(config) && !Array.isArray(config);
if (!isObject && !isString) {
throw new Error('Config must either be an object or a string');
}
// If config is a string, we assume the old behavior of passing in a string representation of the api version
if (isString) {
return {
apiVersion: config,
};
}
// If config is an object, we assume the new behavior and make sure it doesn't contain any unexpected values
const values = Object.keys(config).filter((value) => !ALLOWED_CONFIG_PROPERTIES.includes(value));
if (values.length > 0) {
throw new Error(`Config object may only contain the following: ${ALLOWED_CONFIG_PROPERTIES.join(', ')}`);
}
return config;
},
};
return Stripe;
}
exports.createStripe = createStripe;
+307
View File
@@ -0,0 +1,307 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.concat = exports.determineProcessUserAgentProperties = exports.validateInteger = exports.flattenAndStringify = exports.isObject = exports.emitWarning = exports.pascalToCamelCase = exports.callbackifyPromiseWithTimeout = exports.normalizeHeader = exports.normalizeHeaders = exports.removeNullish = exports.protoExtend = exports.getOptionsFromArgs = exports.getDataFromArgs = exports.extractUrlParams = exports.makeURLInterpolator = exports.stringifyRequestData = exports.isOptionsHash = void 0;
const qs = require("qs");
const OPTIONS_KEYS = [
'apiKey',
'idempotencyKey',
'stripeAccount',
'apiVersion',
'maxNetworkRetries',
'timeout',
'host',
];
function isOptionsHash(o) {
return (o &&
typeof o === 'object' &&
OPTIONS_KEYS.some((prop) => Object.prototype.hasOwnProperty.call(o, prop)));
}
exports.isOptionsHash = isOptionsHash;
/**
* Stringifies an Object, accommodating nested objects
* (forming the conventional key 'parent[child]=value')
*/
function stringifyRequestData(data) {
return (qs
.stringify(data, {
serializeDate: (d) => Math.floor(d.getTime() / 1000).toString(),
})
// Don't use strict form encoding by changing the square bracket control
// characters back to their literals. This is fine by the server, and
// makes these parameter strings easier to read.
.replace(/%5B/g, '[')
.replace(/%5D/g, ']'));
}
exports.stringifyRequestData = stringifyRequestData;
/**
* Outputs a new function with interpolated object property values.
* Use like so:
* const fn = makeURLInterpolator('some/url/{param1}/{param2}');
* fn({ param1: 123, param2: 456 }); // => 'some/url/123/456'
*/
exports.makeURLInterpolator = (() => {
const rc = {
'\n': '\\n',
'"': '\\"',
'\u2028': '\\u2028',
'\u2029': '\\u2029',
};
return (str) => {
const cleanString = str.replace(/["\n\r\u2028\u2029]/g, ($0) => rc[$0]);
return (outputs) => {
return cleanString.replace(/\{([\s\S]+?)\}/g, ($0, $1) =>
// @ts-ignore
encodeURIComponent(outputs[$1] || ''));
};
};
})();
function extractUrlParams(path) {
const params = path.match(/\{\w+\}/g);
if (!params) {
return [];
}
return params.map((param) => param.replace(/[{}]/g, ''));
}
exports.extractUrlParams = extractUrlParams;
/**
* Return the data argument from a list of arguments
*
* @param {object[]} args
* @returns {object}
*/
function getDataFromArgs(args) {
if (!Array.isArray(args) || !args[0] || typeof args[0] !== 'object') {
return {};
}
if (!isOptionsHash(args[0])) {
return args.shift();
}
const argKeys = Object.keys(args[0]);
const optionKeysInArgs = argKeys.filter((key) => OPTIONS_KEYS.includes(key));
// In some cases options may be the provided as the first argument.
// Here we're detecting a case where there are two distinct arguments
// (the first being args and the second options) and with known
// option keys in the first so that we can warn the user about it.
if (optionKeysInArgs.length > 0 &&
optionKeysInArgs.length !== argKeys.length) {
emitWarning(`Options found in arguments (${optionKeysInArgs.join(', ')}). Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options.`);
}
return {};
}
exports.getDataFromArgs = getDataFromArgs;
/**
* Return the options hash from a list of arguments
*/
function getOptionsFromArgs(args) {
const opts = {
auth: null,
host: null,
headers: {},
settings: {},
};
if (args.length > 0) {
const arg = args[args.length - 1];
if (typeof arg === 'string') {
opts.auth = args.pop();
}
else if (isOptionsHash(arg)) {
const params = Object.assign({}, args.pop());
const extraKeys = Object.keys(params).filter((key) => !OPTIONS_KEYS.includes(key));
if (extraKeys.length) {
emitWarning(`Invalid options found (${extraKeys.join(', ')}); ignoring.`);
}
if (params.apiKey) {
opts.auth = params.apiKey;
}
if (params.idempotencyKey) {
opts.headers['Idempotency-Key'] = params.idempotencyKey;
}
if (params.stripeAccount) {
opts.headers['Stripe-Account'] = params.stripeAccount;
}
if (params.apiVersion) {
opts.headers['Stripe-Version'] = params.apiVersion;
}
if (Number.isInteger(params.maxNetworkRetries)) {
opts.settings.maxNetworkRetries = params.maxNetworkRetries;
}
if (Number.isInteger(params.timeout)) {
opts.settings.timeout = params.timeout;
}
if (params.host) {
opts.host = params.host;
}
}
}
return opts;
}
exports.getOptionsFromArgs = getOptionsFromArgs;
/**
* Provide simple "Class" extension mechanism.
* <!-- Public API accessible via Stripe.StripeResource.extend -->
*/
function protoExtend(sub) {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const Super = this;
const Constructor = Object.prototype.hasOwnProperty.call(sub, 'constructor')
? sub.constructor
: function (...args) {
Super.apply(this, args);
};
// This initialization logic is somewhat sensitive to be compatible with
// divergent JS implementations like the one found in Qt. See here for more
// context:
//
// https://github.com/stripe/stripe-node/pull/334
Object.assign(Constructor, Super);
Constructor.prototype = Object.create(Super.prototype);
Object.assign(Constructor.prototype, sub);
return Constructor;
}
exports.protoExtend = protoExtend;
/**
* Remove empty values from an object
*/
function removeNullish(obj) {
if (typeof obj !== 'object') {
throw new Error('Argument must be an object');
}
return Object.keys(obj).reduce((result, key) => {
if (obj[key] != null) {
result[key] = obj[key];
}
return result;
}, {});
}
exports.removeNullish = removeNullish;
/**
* Normalize standard HTTP Headers:
* {'foo-bar': 'hi'}
* becomes
* {'Foo-Bar': 'hi'}
*/
function normalizeHeaders(obj) {
if (!(obj && typeof obj === 'object')) {
return obj;
}
return Object.keys(obj).reduce((result, header) => {
result[normalizeHeader(header)] = obj[header];
return result;
}, {});
}
exports.normalizeHeaders = normalizeHeaders;
/**
* Stolen from https://github.com/marten-de-vries/header-case-normalizer/blob/master/index.js#L36-L41
* without the exceptions which are irrelevant to us.
*/
function normalizeHeader(header) {
return header
.split('-')
.map((text) => text.charAt(0).toUpperCase() + text.substr(1).toLowerCase())
.join('-');
}
exports.normalizeHeader = normalizeHeader;
function callbackifyPromiseWithTimeout(promise, callback) {
if (callback) {
// Ensure callback is called outside of promise stack.
return promise.then((res) => {
setTimeout(() => {
callback(null, res);
}, 0);
}, (err) => {
setTimeout(() => {
callback(err, null);
}, 0);
});
}
return promise;
}
exports.callbackifyPromiseWithTimeout = callbackifyPromiseWithTimeout;
/**
* Allow for special capitalization cases (such as OAuth)
*/
function pascalToCamelCase(name) {
if (name === 'OAuth') {
return 'oauth';
}
else {
return name[0].toLowerCase() + name.substring(1);
}
}
exports.pascalToCamelCase = pascalToCamelCase;
function emitWarning(warning) {
if (typeof process.emitWarning !== 'function') {
return console.warn(`Stripe: ${warning}`); /* eslint-disable-line no-console */
}
return process.emitWarning(warning, 'Stripe');
}
exports.emitWarning = emitWarning;
function isObject(obj) {
const type = typeof obj;
return (type === 'function' || type === 'object') && !!obj;
}
exports.isObject = isObject;
// For use in multipart requests
function flattenAndStringify(data) {
const result = {};
const step = (obj, prevKey) => {
Object.keys(obj).forEach((key) => {
// @ts-ignore
const value = obj[key];
const newKey = prevKey ? `${prevKey}[${key}]` : key;
if (isObject(value)) {
if (!(value instanceof Uint8Array) &&
!Object.prototype.hasOwnProperty.call(value, 'data')) {
// Non-buffer non-file Objects are recursively flattened
return step(value, newKey);
}
else {
// Buffers and file objects are stored without modification
result[newKey] = value;
}
}
else {
// Primitives are converted to strings
result[newKey] = String(value);
}
});
};
step(data, null);
return result;
}
exports.flattenAndStringify = flattenAndStringify;
function validateInteger(name, n, defaultVal) {
if (!Number.isInteger(n)) {
if (defaultVal !== undefined) {
return defaultVal;
}
else {
throw new Error(`${name} must be an integer`);
}
}
return n;
}
exports.validateInteger = validateInteger;
function determineProcessUserAgentProperties() {
return typeof process === 'undefined'
? {}
: {
lang_version: process.version,
platform: process.platform,
};
}
exports.determineProcessUserAgentProperties = determineProcessUserAgentProperties;
/**
* Joins an array of Uint8Arrays into a single Uint8Array
*/
function concat(arrays) {
const totalLength = arrays.reduce((len, array) => len + array.length, 0);
const merged = new Uint8Array(totalLength);
let offset = 0;
arrays.forEach((array) => {
merged.set(array, offset);
offset += array.length;
});
return merged;
}
exports.concat = concat;
+130
View File
@@ -0,0 +1,130 @@
/* eslint-disable camelcase */
export const generate = (rawStripeError) => {
switch (rawStripeError.type) {
case 'card_error':
return new StripeCardError(rawStripeError);
case 'invalid_request_error':
return new StripeInvalidRequestError(rawStripeError);
case 'api_error':
return new StripeAPIError(rawStripeError);
case 'authentication_error':
return new StripeAuthenticationError(rawStripeError);
case 'rate_limit_error':
return new StripeRateLimitError(rawStripeError);
case 'idempotency_error':
return new StripeIdempotencyError(rawStripeError);
case 'invalid_grant':
return new StripeInvalidGrantError(rawStripeError);
default:
return new StripeUnknownError(rawStripeError);
}
};
/**
* StripeError is the base error from which all other more specific Stripe errors derive.
* Specifically for errors returned from Stripe's REST API.
*/
export class StripeError extends Error {
constructor(raw = {}) {
super(raw.message);
this.type = this.constructor.name;
this.raw = raw;
this.rawType = raw.type;
this.code = raw.code;
this.doc_url = raw.doc_url;
this.param = raw.param;
this.detail = raw.detail;
this.headers = raw.headers;
this.requestId = raw.requestId;
this.statusCode = raw.statusCode;
// @ts-ignore
this.message = raw.message;
this.charge = raw.charge;
this.decline_code = raw.decline_code;
this.payment_intent = raw.payment_intent;
this.payment_method = raw.payment_method;
this.payment_method_type = raw.payment_method_type;
this.setup_intent = raw.setup_intent;
this.source = raw.source;
}
}
/**
* Helper factory which takes raw stripe errors and outputs wrapping instances
*/
StripeError.generate = generate;
// Specific Stripe Error types:
/**
* CardError is raised when a user enters a card that can't be charged for
* some reason.
*/
export class StripeCardError extends StripeError {
}
/**
* InvalidRequestError is raised when a request is initiated with invalid
* parameters.
*/
export class StripeInvalidRequestError extends StripeError {
}
/**
* APIError is a generic error that may be raised in cases where none of the
* other named errors cover the problem. It could also be raised in the case
* that a new error has been introduced in the API, but this version of the
* Node.JS SDK doesn't know how to handle it.
*/
export class StripeAPIError extends StripeError {
}
/**
* AuthenticationError is raised when invalid credentials are used to connect
* to Stripe's servers.
*/
export class StripeAuthenticationError extends StripeError {
}
/**
* PermissionError is raised in cases where access was attempted on a resource
* that wasn't allowed.
*/
export class StripePermissionError extends StripeError {
}
/**
* RateLimitError is raised in cases where an account is putting too much load
* on Stripe's API servers (usually by performing too many requests). Please
* back off on request rate.
*/
export class StripeRateLimitError extends StripeError {
}
/**
* StripeConnectionError is raised in the event that the SDK can't connect to
* Stripe's servers. That can be for a variety of different reasons from a
* downed network to a bad TLS certificate.
*/
export class StripeConnectionError extends StripeError {
}
/**
* SignatureVerificationError is raised when the signature verification for a
* webhook fails
*/
export class StripeSignatureVerificationError extends StripeError {
constructor(header, payload, raw = {}) {
super(raw);
this.header = header;
this.payload = payload;
}
}
/**
* IdempotencyError is raised in cases where an idempotency key was used
* improperly.
*/
export class StripeIdempotencyError extends StripeError {
}
/**
* InvalidGrantError is raised when a specified code doesn't exist, is
* expired, has been used, or doesn't belong to you; a refresh token doesn't
* exist, or doesn't belong to you; or if an API key's mode (live or test)
* doesn't match the mode of a code or refresh token.
*/
export class StripeInvalidGrantError extends StripeError {
}
/**
* Any other error from Stripe not specifically captured above
*/
export class StripeUnknownError extends StripeError {
}
+348
View File
@@ -0,0 +1,348 @@
import { StripeAPIError, StripeAuthenticationError, StripeConnectionError, StripeError, StripePermissionError, StripeRateLimitError, } from './Error.js';
import { emitWarning, normalizeHeaders, removeNullish, stringifyRequestData, } from './utils.js';
import { HttpClient } from './net/HttpClient.js';
const MAX_RETRY_AFTER_WAIT = 60;
export class RequestSender {
constructor(stripe, maxBufferedRequestMetric) {
this._stripe = stripe;
this._maxBufferedRequestMetric = maxBufferedRequestMetric;
}
_addHeadersDirectlyToObject(obj, headers) {
// For convenience, make some headers easily accessible on
// lastResponse.
// NOTE: Stripe responds with lowercase header names/keys.
obj.requestId = headers['request-id'];
obj.stripeAccount = obj.stripeAccount || headers['stripe-account'];
obj.apiVersion = obj.apiVersion || headers['stripe-version'];
obj.idempotencyKey = obj.idempotencyKey || headers['idempotency-key'];
}
_makeResponseEvent(requestEvent, statusCode, headers) {
const requestEndTime = Date.now();
const requestDurationMs = requestEndTime - requestEvent.request_start_time;
return removeNullish({
api_version: headers['stripe-version'],
account: headers['stripe-account'],
idempotency_key: headers['idempotency-key'],
method: requestEvent.method,
path: requestEvent.path,
status: statusCode,
request_id: this._getRequestId(headers),
elapsed: requestDurationMs,
request_start_time: requestEvent.request_start_time,
request_end_time: requestEndTime,
});
}
_getRequestId(headers) {
return headers['request-id'];
}
/**
* Used by methods with spec.streaming === true. For these methods, we do not
* buffer successful responses into memory or do parse them into stripe
* objects, we delegate that all of that to the user and pass back the raw
* http.Response object to the callback.
*
* (Unsuccessful responses shouldn't make it here, they should
* still be buffered/parsed and handled by _jsonResponseHandler -- see
* makeRequest)
*/
_streamingResponseHandler(requestEvent, callback) {
return (res) => {
const headers = res.getHeaders();
const streamCompleteCallback = () => {
const responseEvent = this._makeResponseEvent(requestEvent, res.getStatusCode(), headers);
this._stripe._emitter.emit('response', responseEvent);
this._recordRequestMetrics(this._getRequestId(headers), responseEvent.elapsed);
};
const stream = res.toStream(streamCompleteCallback);
// This is here for backwards compatibility, as the stream is a raw
// HTTP response in Node and the legacy behavior was to mutate this
// response.
this._addHeadersDirectlyToObject(stream, headers);
return callback(null, stream);
};
}
/**
* Default handler for Stripe responses. Buffers the response into memory,
* parses the JSON and returns it (i.e. passes it to the callback) if there
* is no "error" field. Otherwise constructs/passes an appropriate Error.
*/
_jsonResponseHandler(requestEvent, callback) {
return (res) => {
const headers = res.getHeaders();
const requestId = this._getRequestId(headers);
const statusCode = res.getStatusCode();
const responseEvent = this._makeResponseEvent(requestEvent, statusCode, headers);
this._stripe._emitter.emit('response', responseEvent);
res
.toJSON()
.then((jsonResponse) => {
if (jsonResponse.error) {
let err;
// Convert OAuth error responses into a standard format
// so that the rest of the error logic can be shared
if (typeof jsonResponse.error === 'string') {
jsonResponse.error = {
type: jsonResponse.error,
message: jsonResponse.error_description,
};
}
jsonResponse.error.headers = headers;
jsonResponse.error.statusCode = statusCode;
jsonResponse.error.requestId = requestId;
if (statusCode === 401) {
err = new StripeAuthenticationError(jsonResponse.error);
}
else if (statusCode === 403) {
err = new StripePermissionError(jsonResponse.error);
}
else if (statusCode === 429) {
err = new StripeRateLimitError(jsonResponse.error);
}
else {
err = StripeError.generate(jsonResponse.error);
}
throw err;
}
return jsonResponse;
}, (e) => {
throw new StripeAPIError({
message: 'Invalid JSON received from the Stripe API',
exception: e,
requestId: headers['request-id'],
});
})
.then((jsonResponse) => {
this._recordRequestMetrics(requestId, responseEvent.elapsed);
// Expose raw response object.
const rawResponse = res.getRawResponse();
this._addHeadersDirectlyToObject(rawResponse, headers);
Object.defineProperty(jsonResponse, 'lastResponse', {
enumerable: false,
writable: false,
value: rawResponse,
});
callback(null, jsonResponse);
}, (e) => callback(e, null));
};
}
static _generateConnectionErrorMessage(requestRetries) {
return `An error occurred with our connection to Stripe.${requestRetries > 0 ? ` Request was retried ${requestRetries} times.` : ''}`;
}
// For more on when and how to retry API requests, see https://stripe.com/docs/error-handling#safely-retrying-requests-with-idempotency
static _shouldRetry(res, numRetries, maxRetries, error) {
if (error &&
numRetries === 0 &&
HttpClient.CONNECTION_CLOSED_ERROR_CODES.includes(error.code)) {
return true;
}
// Do not retry if we are out of retries.
if (numRetries >= maxRetries) {
return false;
}
// Retry on connection error.
if (!res) {
return true;
}
// The API may ask us not to retry (e.g., if doing so would be a no-op)
// or advise us to retry (e.g., in cases of lock timeouts); we defer to that.
if (res.getHeaders()['stripe-should-retry'] === 'false') {
return false;
}
if (res.getHeaders()['stripe-should-retry'] === 'true') {
return true;
}
// Retry on conflict errors.
if (res.getStatusCode() === 409) {
return true;
}
// Retry on 500, 503, and other internal errors.
//
// Note that we expect the stripe-should-retry header to be false
// in most cases when a 500 is returned, since our idempotency framework
// would typically replay it anyway.
if (res.getStatusCode() >= 500) {
return true;
}
return false;
}
_getSleepTimeInMS(numRetries, retryAfter = null) {
const initialNetworkRetryDelay = this._stripe.getInitialNetworkRetryDelay();
const maxNetworkRetryDelay = this._stripe.getMaxNetworkRetryDelay();
// Apply exponential backoff with initialNetworkRetryDelay on the
// number of numRetries so far as inputs. Do not allow the number to exceed
// maxNetworkRetryDelay.
let sleepSeconds = Math.min(initialNetworkRetryDelay * Math.pow(numRetries - 1, 2), maxNetworkRetryDelay);
// Apply some jitter by randomizing the value in the range of
// (sleepSeconds / 2) to (sleepSeconds).
sleepSeconds *= 0.5 * (1 + Math.random());
// But never sleep less than the base sleep seconds.
sleepSeconds = Math.max(initialNetworkRetryDelay, sleepSeconds);
// And never sleep less than the time the API asks us to wait, assuming it's a reasonable ask.
if (Number.isInteger(retryAfter) && retryAfter <= MAX_RETRY_AFTER_WAIT) {
sleepSeconds = Math.max(sleepSeconds, retryAfter);
}
return sleepSeconds * 1000;
}
// Max retries can be set on a per request basis. Favor those over the global setting
_getMaxNetworkRetries(settings = {}) {
return settings.maxNetworkRetries &&
Number.isInteger(settings.maxNetworkRetries)
? settings.maxNetworkRetries
: this._stripe.getMaxNetworkRetries();
}
_defaultIdempotencyKey(method, settings) {
// If this is a POST and we allow multiple retries, ensure an idempotency key.
const maxRetries = this._getMaxNetworkRetries(settings);
if (method === 'POST' && maxRetries > 0) {
return `stripe-node-retry-${this._stripe._platformFunctions.uuid4()}`;
}
return null;
}
_makeHeaders(auth, contentLength, apiVersion, clientUserAgent, method, userSuppliedHeaders, userSuppliedSettings) {
const defaultHeaders = {
// Use specified auth token or use default from this stripe instance:
Authorization: auth ? `Bearer ${auth}` : this._stripe.getApiField('auth'),
Accept: 'application/json',
'Content-Type': 'application/x-www-form-urlencoded',
'User-Agent': this._getUserAgentString(),
'X-Stripe-Client-User-Agent': clientUserAgent,
'X-Stripe-Client-Telemetry': this._getTelemetryHeader(),
'Stripe-Version': apiVersion,
'Stripe-Account': this._stripe.getApiField('stripeAccount'),
'Idempotency-Key': this._defaultIdempotencyKey(method, userSuppliedSettings),
};
// As per https://datatracker.ietf.org/doc/html/rfc7230#section-3.3.2:
// A user agent SHOULD send a Content-Length in a request message when
// no Transfer-Encoding is sent and the request method defines a meaning
// for an enclosed payload body. For example, a Content-Length header
// field is normally sent in a POST request even when the value is 0
// (indicating an empty payload body). A user agent SHOULD NOT send a
// Content-Length header field when the request message does not contain
// a payload body and the method semantics do not anticipate such a
// body.
//
// These method types are expected to have bodies and so we should always
// include a Content-Length.
const methodHasPayload = method == 'POST' || method == 'PUT' || method == 'PATCH';
// If a content length was specified, we always include it regardless of
// whether the method semantics anticipate such a body. This keeps us
// consistent with historical behavior. We do however want to warn on this
// and fix these cases as they are semantically incorrect.
if (methodHasPayload || contentLength) {
if (!methodHasPayload) {
emitWarning(`${method} method had non-zero contentLength but no payload is expected for this verb`);
}
defaultHeaders['Content-Length'] = contentLength;
}
return Object.assign(removeNullish(defaultHeaders),
// If the user supplied, say 'idempotency-key', override instead of appending by ensuring caps are the same.
normalizeHeaders(userSuppliedHeaders));
}
_getUserAgentString() {
const packageVersion = this._stripe.getConstant('PACKAGE_VERSION');
const appInfo = this._stripe._appInfo
? this._stripe.getAppInfoAsString()
: '';
return `Stripe/v1 NodeBindings/${packageVersion} ${appInfo}`.trim();
}
_getTelemetryHeader() {
if (this._stripe.getTelemetryEnabled() &&
this._stripe._prevRequestMetrics.length > 0) {
const metrics = this._stripe._prevRequestMetrics.shift();
return JSON.stringify({
last_request_metrics: metrics,
});
}
}
_recordRequestMetrics(requestId, requestDurationMs) {
if (this._stripe.getTelemetryEnabled() && requestId) {
if (this._stripe._prevRequestMetrics.length > this._maxBufferedRequestMetric) {
emitWarning('Request metrics buffer is full, dropping telemetry message.');
}
else {
this._stripe._prevRequestMetrics.push({
request_id: requestId,
request_duration_ms: requestDurationMs,
});
}
}
}
_request(method, host, path, data, auth, options = {}, callback, requestDataProcessor = null) {
let requestData;
const retryRequest = (requestFn, apiVersion, headers, requestRetries, retryAfter) => {
return setTimeout(requestFn, this._getSleepTimeInMS(requestRetries, retryAfter), apiVersion, headers, requestRetries + 1);
};
const makeRequest = (apiVersion, headers, numRetries) => {
// timeout can be set on a per-request basis. Favor that over the global setting
const timeout = options.settings &&
options.settings.timeout &&
Number.isInteger(options.settings.timeout) &&
options.settings.timeout >= 0
? options.settings.timeout
: this._stripe.getApiField('timeout');
const req = this._stripe
.getApiField('httpClient')
.makeRequest(host || this._stripe.getApiField('host'), this._stripe.getApiField('port'), path, method, headers, requestData, this._stripe.getApiField('protocol'), timeout);
const requestStartTime = Date.now();
// @ts-ignore
const requestEvent = removeNullish({
api_version: apiVersion,
account: headers['Stripe-Account'],
idempotency_key: headers['Idempotency-Key'],
method,
path,
request_start_time: requestStartTime,
});
const requestRetries = numRetries || 0;
const maxRetries = this._getMaxNetworkRetries(options.settings || {});
this._stripe._emitter.emit('request', requestEvent);
req
.then((res) => {
if (RequestSender._shouldRetry(res, requestRetries, maxRetries)) {
return retryRequest(makeRequest, apiVersion, headers, requestRetries,
// @ts-ignore
res.getHeaders()['retry-after']);
}
else if (options.streaming && res.getStatusCode() < 400) {
return this._streamingResponseHandler(requestEvent, callback)(res);
}
else {
return this._jsonResponseHandler(requestEvent, callback)(res);
}
})
.catch((error) => {
if (RequestSender._shouldRetry(null, requestRetries, maxRetries, error)) {
return retryRequest(makeRequest, apiVersion, headers, requestRetries, null);
}
else {
const isTimeoutError = error.code && error.code === HttpClient.TIMEOUT_ERROR_CODE;
return callback(new StripeConnectionError({
message: isTimeoutError
? `Request aborted due to timeout being reached (${timeout}ms)`
: RequestSender._generateConnectionErrorMessage(requestRetries),
// @ts-ignore
detail: error,
}));
}
});
};
const prepareAndMakeRequest = (error, data) => {
if (error) {
return callback(error);
}
requestData = data;
this._stripe.getClientUserAgent((clientUserAgent) => {
var _a, _b;
const apiVersion = this._stripe.getApiField('version');
const headers = this._makeHeaders(auth, requestData.length, apiVersion, clientUserAgent, method, (_a = options.headers) !== null && _a !== void 0 ? _a : null, (_b = options.settings) !== null && _b !== void 0 ? _b : {});
makeRequest(apiVersion, headers, 0);
});
};
if (requestDataProcessor) {
requestDataProcessor(method, data, options.headers, prepareAndMakeRequest);
}
else {
prepareAndMakeRequest(null, stringifyRequestData(data || {}));
}
}
}
+14
View File
@@ -0,0 +1,14 @@
// ResourceNamespace allows you to create nested resources, i.e. `stripe.issuing.cards`.
// It also works recursively, so you could do i.e. `stripe.billing.invoicing.pay`.
function ResourceNamespace(stripe, resources) {
for (const name in resources) {
const camelCaseName = name[0].toLowerCase() + name.substring(1);
const resource = new resources[name](stripe);
this[camelCaseName] = resource;
}
}
export function resourceNamespace(namespace, resources) {
return function (stripe) {
return new ResourceNamespace(stripe, resources);
};
}
+42
View File
@@ -0,0 +1,42 @@
/**
* @private
* (For internal use in stripe-node.)
* Wrapper around the Event Web API.
*/
class _StripeEvent extends Event {
constructor(eventName, data) {
super(eventName);
this.data = data;
}
}
/** Minimal EventEmitter wrapper around EventTarget. */
export class StripeEmitter {
constructor() {
this.eventTarget = new EventTarget();
this.listenerMapping = new Map();
}
on(eventName, listener) {
const listenerWrapper = (event) => {
listener(event.data);
};
this.listenerMapping.set(listener, listenerWrapper);
return this.eventTarget.addEventListener(eventName, listenerWrapper);
}
removeListener(eventName, listener) {
const listenerWrapper = this.listenerMapping.get(listener);
this.listenerMapping.delete(listener);
return this.eventTarget.removeEventListener(eventName, listenerWrapper);
}
once(eventName, listener) {
const listenerWrapper = (event) => {
listener(event.data);
};
this.listenerMapping.set(listener, listenerWrapper);
return this.eventTarget.addEventListener(eventName, listenerWrapper, {
once: true,
});
}
emit(eventName, data) {
return this.eventTarget.dispatchEvent(new _StripeEvent(eventName, data));
}
}
+32
View File
@@ -0,0 +1,32 @@
import { callbackifyPromiseWithTimeout, extractUrlParams } from './utils.js';
import { makeAutoPaginationMethods } from './autoPagination.js';
/**
* Create an API method from the declared spec.
*
* @param [spec.method='GET'] Request Method (POST, GET, DELETE, PUT)
* @param [spec.path=''] Path to be appended to the API BASE_PATH, joined with
* the instance's path (e.g. 'charges' or 'customers')
* @param [spec.fullPath=''] Fully qualified path to the method (eg. /v1/a/b/c).
* If this is specified, path should not be specified.
* @param [spec.urlParams=[]] Array of required arguments in the order that they
* must be passed by the consumer of the API. Subsequent optional arguments are
* optionally passed through a hash (Object) as the penultimate argument
* (preceding the also-optional callback argument
* @param [spec.encode] Function for mutating input parameters to a method.
* Usefully for applying transforms to data on a per-method basis.
* @param [spec.host] Hostname for the request.
*
* <!-- Public API accessible via Stripe.StripeResource.method -->
*/
export function stripeMethod(spec) {
if (spec.path !== undefined && spec.fullPath !== undefined) {
throw new Error(`Method spec specified both a 'path' (${spec.path}) and a 'fullPath' (${spec.fullPath}).`);
}
return function (...args) {
const callback = typeof args[args.length - 1] == 'function' && args.pop();
spec.urlParams = extractUrlParams(spec.fullPath || this.createResourcePathWithSymbols(spec.path || ''));
const requestPromise = callbackifyPromiseWithTimeout(this._makeRequest(args, spec, {}), callback);
Object.assign(requestPromise, makeAutoPaginationMethods(this, args, spec, requestPromise));
return requestPromise;
};
}
+166
View File
@@ -0,0 +1,166 @@
import { getDataFromArgs, getOptionsFromArgs, makeURLInterpolator, protoExtend, stringifyRequestData, } from './utils.js';
import { stripeMethod } from './StripeMethod.js';
// Provide extension mechanism for Stripe Resource Sub-Classes
StripeResource.extend = protoExtend;
// Expose method-creator
StripeResource.method = stripeMethod;
StripeResource.MAX_BUFFERED_REQUEST_METRICS = 100;
/**
* Encapsulates request logic for a Stripe Resource
*/
function StripeResource(stripe, deprecatedUrlData) {
this._stripe = stripe;
if (deprecatedUrlData) {
throw new Error('Support for curried url params was dropped in stripe-node v7.0.0. Instead, pass two ids.');
}
this.basePath = makeURLInterpolator(
// @ts-ignore changing type of basePath
this.basePath || stripe.getApiField('basePath'));
// @ts-ignore changing type of path
this.resourcePath = this.path;
// @ts-ignore changing type of path
this.path = makeURLInterpolator(this.path);
this.initialize(...arguments);
}
StripeResource.prototype = {
_stripe: null,
// @ts-ignore the type of path changes in ctor
path: '',
resourcePath: '',
// Methods that don't use the API's default '/v1' path can override it with this setting.
basePath: null,
initialize() { },
// Function to override the default data processor. This allows full control
// over how a StripeResource's request data will get converted into an HTTP
// body. This is useful for non-standard HTTP requests. The function should
// take method name, data, and headers as arguments.
requestDataProcessor: null,
// Function to add a validation checks before sending the request, errors should
// be thrown, and they will be passed to the callback/promise.
validateRequest: null,
createFullPath(commandPath, urlData) {
const urlParts = [this.basePath(urlData), this.path(urlData)];
if (typeof commandPath === 'function') {
const computedCommandPath = commandPath(urlData);
// If we have no actual command path, we just omit it to avoid adding a
// trailing slash. This is important for top-level listing requests, which
// do not have a command path.
if (computedCommandPath) {
urlParts.push(computedCommandPath);
}
}
else {
urlParts.push(commandPath);
}
return this._joinUrlParts(urlParts);
},
// Creates a relative resource path with symbols left in (unlike
// createFullPath which takes some data to replace them with). For example it
// might produce: /invoices/{id}
createResourcePathWithSymbols(pathWithSymbols) {
// If there is no path beyond the resource path, we want to produce just
// /<resource path> rather than /<resource path>/.
if (pathWithSymbols) {
return `/${this._joinUrlParts([this.resourcePath, pathWithSymbols])}`;
}
else {
return `/${this.resourcePath}`;
}
},
_joinUrlParts(parts) {
// Replace any accidentally doubled up slashes. This previously used
// path.join, which would do this as well. Unfortunately we need to do this
// as the functions for creating paths are technically part of the public
// interface and so we need to preserve backwards compatibility.
return parts.join('/').replace(/\/{2,}/g, '/');
},
_getRequestOpts(requestArgs, spec, overrideData) {
// Extract spec values with defaults.
const requestMethod = (spec.method || 'GET').toUpperCase();
const urlParams = spec.urlParams || [];
const encode = spec.encode || ((data) => data);
const isUsingFullPath = !!spec.fullPath;
const commandPath = makeURLInterpolator(isUsingFullPath ? spec.fullPath : spec.path || '');
// When using fullPath, we ignore the resource path as it should already be
// fully qualified.
const path = isUsingFullPath
? spec.fullPath
: this.createResourcePathWithSymbols(spec.path);
// Don't mutate args externally.
const args = [].slice.call(requestArgs);
// Generate and validate url params.
const urlData = urlParams.reduce((urlData, param) => {
const arg = args.shift();
if (typeof arg !== 'string') {
throw new Error(`Stripe: Argument "${param}" must be a string, but got: ${arg} (on API request to \`${requestMethod} ${path}\`)`);
}
urlData[param] = arg;
return urlData;
}, {});
// Pull request data and options (headers, auth) from args.
const dataFromArgs = getDataFromArgs(args);
const data = encode(Object.assign({}, dataFromArgs, overrideData));
const options = getOptionsFromArgs(args);
const host = options.host || spec.host;
const streaming = !!spec.streaming;
// Validate that there are no more args.
if (args.filter((x) => x != null).length) {
throw new Error(`Stripe: Unknown arguments (${args}). Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options. (on API request to ${requestMethod} \`${path}\`)`);
}
// When using full path, we can just invoke the URL interpolator directly
// as we don't need to use the resource to create a full path.
const requestPath = isUsingFullPath
? commandPath(urlData)
: this.createFullPath(commandPath, urlData);
const headers = Object.assign(options.headers, spec.headers);
if (spec.validator) {
spec.validator(data, { headers });
}
const dataInQuery = spec.method === 'GET' || spec.method === 'DELETE';
const bodyData = dataInQuery ? {} : data;
const queryData = dataInQuery ? data : {};
return {
requestMethod,
requestPath,
bodyData,
queryData,
auth: options.auth,
headers,
host: host !== null && host !== void 0 ? host : null,
streaming,
settings: options.settings,
};
},
_makeRequest(requestArgs, spec, overrideData) {
return new Promise((resolve, reject) => {
var _a;
let opts;
try {
opts = this._getRequestOpts(requestArgs, spec, overrideData);
}
catch (err) {
reject(err);
return;
}
function requestCallback(err, response) {
if (err) {
reject(err);
}
else {
resolve(spec.transformResponseData
? spec.transformResponseData(response)
: response);
}
}
const emptyQuery = Object.keys(opts.queryData).length === 0;
const path = [
opts.requestPath,
emptyQuery ? '' : '?',
stringifyRequestData(opts.queryData),
].join('');
const { headers, settings } = opts;
this._stripe._requestSender._request(opts.requestMethod, opts.host, path, opts.bodyData, opts.auth, { headers, settings, streaming: opts.streaming }, requestCallback, (_a = this.requestDataProcessor) === null || _a === void 0 ? void 0 : _a.bind(this));
});
},
};
export { StripeResource };
+194
View File
@@ -0,0 +1,194 @@
import { StripeError, StripeSignatureVerificationError } from './Error.js';
import { CryptoProviderOnlySupportsAsyncError, } from './crypto/CryptoProvider.js';
export function createWebhooks(platformFunctions) {
const Webhook = {
DEFAULT_TOLERANCE: 300,
// @ts-ignore
signature: null,
constructEvent(payload, header, secret, tolerance, cryptoProvider, receivedAt) {
try {
this.signature.verifyHeader(payload, header, secret, tolerance || Webhook.DEFAULT_TOLERANCE, cryptoProvider, receivedAt);
}
catch (e) {
if (e instanceof CryptoProviderOnlySupportsAsyncError) {
e.message +=
'\nUse `await constructEventAsync(...)` instead of `constructEvent(...)`';
}
throw e;
}
const jsonPayload = payload instanceof Uint8Array
? JSON.parse(new TextDecoder('utf8').decode(payload))
: JSON.parse(payload);
return jsonPayload;
},
async constructEventAsync(payload, header, secret, tolerance, cryptoProvider, receivedAt) {
await this.signature.verifyHeaderAsync(payload, header, secret, tolerance || Webhook.DEFAULT_TOLERANCE, cryptoProvider, receivedAt);
const jsonPayload = payload instanceof Uint8Array
? JSON.parse(new TextDecoder('utf8').decode(payload))
: JSON.parse(payload);
return jsonPayload;
},
/**
* Generates a header to be used for webhook mocking
*
* @typedef {object} opts
* @property {number} timestamp - Timestamp of the header. Defaults to Date.now()
* @property {string} payload - JSON stringified payload object, containing the 'id' and 'object' parameters
* @property {string} secret - Stripe webhook secret 'whsec_...'
* @property {string} scheme - Version of API to hit. Defaults to 'v1'.
* @property {string} signature - Computed webhook signature
* @property {CryptoProvider} cryptoProvider - Crypto provider to use for computing the signature if none was provided. Defaults to NodeCryptoProvider.
*/
generateTestHeaderString: function (opts) {
if (!opts) {
throw new StripeError({
message: 'Options are required',
});
}
opts.timestamp =
Math.floor(opts.timestamp) || Math.floor(Date.now() / 1000);
opts.scheme = opts.scheme || signature.EXPECTED_SCHEME;
opts.cryptoProvider = opts.cryptoProvider || getCryptoProvider();
opts.signature =
opts.signature ||
opts.cryptoProvider.computeHMACSignature(opts.timestamp + '.' + opts.payload, opts.secret);
const generatedHeader = [
't=' + opts.timestamp,
opts.scheme + '=' + opts.signature,
].join(',');
return generatedHeader;
},
};
const signature = {
EXPECTED_SCHEME: 'v1',
verifyHeader(encodedPayload, encodedHeader, secret, tolerance, cryptoProvider, receivedAt) {
const { decodedHeader: header, decodedPayload: payload, details, suspectPayloadType, } = parseEventDetails(encodedPayload, encodedHeader, this.EXPECTED_SCHEME);
const secretContainsWhitespace = /\s/.test(secret);
cryptoProvider = cryptoProvider || getCryptoProvider();
const expectedSignature = cryptoProvider.computeHMACSignature(makeHMACContent(payload, details), secret);
validateComputedSignature(payload, header, details, expectedSignature, tolerance, suspectPayloadType, secretContainsWhitespace, receivedAt);
return true;
},
async verifyHeaderAsync(encodedPayload, encodedHeader, secret, tolerance, cryptoProvider, receivedAt) {
const { decodedHeader: header, decodedPayload: payload, details, suspectPayloadType, } = parseEventDetails(encodedPayload, encodedHeader, this.EXPECTED_SCHEME);
const secretContainsWhitespace = /\s/.test(secret);
cryptoProvider = cryptoProvider || getCryptoProvider();
const expectedSignature = await cryptoProvider.computeHMACSignatureAsync(makeHMACContent(payload, details), secret);
return validateComputedSignature(payload, header, details, expectedSignature, tolerance, suspectPayloadType, secretContainsWhitespace, receivedAt);
},
};
function makeHMACContent(payload, details) {
return `${details.timestamp}.${payload}`;
}
function parseEventDetails(encodedPayload, encodedHeader, expectedScheme) {
if (!encodedPayload) {
throw new StripeSignatureVerificationError(encodedHeader, encodedPayload, {
message: 'No webhook payload was provided.',
});
}
const suspectPayloadType = typeof encodedPayload != 'string' &&
!(encodedPayload instanceof Uint8Array);
const textDecoder = new TextDecoder('utf8');
const decodedPayload = encodedPayload instanceof Uint8Array
? textDecoder.decode(encodedPayload)
: encodedPayload;
// Express's type for `Request#headers` is `string | []string`
// which is because the `set-cookie` header is an array,
// but no other headers are an array (docs: https://nodejs.org/api/http.html#http_message_headers)
// (Express's Request class is an extension of http.IncomingMessage, and doesn't appear to be relevantly modified: https://github.com/expressjs/express/blob/master/lib/request.js#L31)
if (Array.isArray(encodedHeader)) {
throw new Error('Unexpected: An array was passed as a header, which should not be possible for the stripe-signature header.');
}
if (encodedHeader == null || encodedHeader == '') {
throw new StripeSignatureVerificationError(encodedHeader, encodedPayload, {
message: 'No stripe-signature header value was provided.',
});
}
const decodedHeader = encodedHeader instanceof Uint8Array
? textDecoder.decode(encodedHeader)
: encodedHeader;
const details = parseHeader(decodedHeader, expectedScheme);
if (!details || details.timestamp === -1) {
throw new StripeSignatureVerificationError(decodedHeader, decodedPayload, {
message: 'Unable to extract timestamp and signatures from header',
});
}
if (!details.signatures.length) {
throw new StripeSignatureVerificationError(decodedHeader, decodedPayload, {
message: 'No signatures found with expected scheme',
});
}
return {
decodedPayload,
decodedHeader,
details,
suspectPayloadType,
};
}
function validateComputedSignature(payload, header, details, expectedSignature, tolerance, suspectPayloadType, secretContainsWhitespace, receivedAt) {
const signatureFound = !!details.signatures.filter(platformFunctions.secureCompare.bind(platformFunctions, expectedSignature)).length;
const docsLocation = '\nLearn more about webhook signing and explore webhook integration examples for various frameworks at ' +
'https://github.com/stripe/stripe-node#webhook-signing';
const whitespaceMessage = secretContainsWhitespace
? '\n\nNote: The provided signing secret contains whitespace. This often indicates an extra newline or space is in the value'
: '';
if (!signatureFound) {
if (suspectPayloadType) {
throw new StripeSignatureVerificationError(header, payload, {
message: 'Webhook payload must be provided as a string or a Buffer (https://nodejs.org/api/buffer.html) instance representing the _raw_ request body.' +
'Payload was provided as a parsed JavaScript object instead. \n' +
'Signature verification is impossible without access to the original signed material. \n' +
docsLocation +
'\n' +
whitespaceMessage,
});
}
throw new StripeSignatureVerificationError(header, payload, {
message: 'No signatures found matching the expected signature for payload.' +
' Are you passing the raw request body you received from Stripe? \n' +
docsLocation +
'\n' +
whitespaceMessage,
});
}
const timestampAge = Math.floor((typeof receivedAt === 'number' ? receivedAt : Date.now()) / 1000) - details.timestamp;
if (tolerance > 0 && timestampAge > tolerance) {
// @ts-ignore
throw new StripeSignatureVerificationError(header, payload, {
message: 'Timestamp outside the tolerance zone',
});
}
return true;
}
function parseHeader(header, scheme) {
if (typeof header !== 'string') {
return null;
}
return header.split(',').reduce((accum, item) => {
const kv = item.split('=');
if (kv[0] === 't') {
accum.timestamp = parseInt(kv[1], 10);
}
if (kv[0] === scheme) {
accum.signatures.push(kv[1]);
}
return accum;
}, {
timestamp: -1,
signatures: [],
});
}
let webhooksCryptoProviderInstance = null;
/**
* Lazily instantiate a CryptoProvider instance. This is a stateless object
* so a singleton can be used here.
*/
function getCryptoProvider() {
if (!webhooksCryptoProviderInstance) {
webhooksCryptoProviderInstance = platformFunctions.createDefaultCryptoProvider();
}
return webhooksCryptoProviderInstance;
}
Webhook.signature = signature;
return Webhook;
}
+2
View File
@@ -0,0 +1,2 @@
// File generated from our OpenAPI spec
export const ApiVersion = '2022-11-15';
+243
View File
@@ -0,0 +1,243 @@
import { callbackifyPromiseWithTimeout, getDataFromArgs } from './utils.js';
class StripeIterator {
constructor(firstPagePromise, requestArgs, spec, stripeResource) {
this.index = 0;
this.pagePromise = firstPagePromise;
this.promiseCache = { currentPromise: null };
this.requestArgs = requestArgs;
this.spec = spec;
this.stripeResource = stripeResource;
}
async iterate(pageResult) {
if (!(pageResult &&
pageResult.data &&
typeof pageResult.data.length === 'number')) {
throw Error('Unexpected: Stripe API response does not have a well-formed `data` array.');
}
const reverseIteration = isReverseIteration(this.requestArgs);
if (this.index < pageResult.data.length) {
const idx = reverseIteration
? pageResult.data.length - 1 - this.index
: this.index;
const value = pageResult.data[idx];
this.index += 1;
return { value, done: false };
}
else if (pageResult.has_more) {
// Reset counter, request next page, and recurse.
this.index = 0;
this.pagePromise = this.getNextPage(pageResult);
const nextPageResult = await this.pagePromise;
return this.iterate(nextPageResult);
}
return { done: true, value: undefined };
}
/** @abstract */
getNextPage(_pageResult) {
throw new Error('Unimplemented');
}
async _next() {
return this.iterate(await this.pagePromise);
}
next() {
/**
* If a user calls `.next()` multiple times in parallel,
* return the same result until something has resolved
* to prevent page-turning race conditions.
*/
if (this.promiseCache.currentPromise) {
return this.promiseCache.currentPromise;
}
const nextPromise = (async () => {
const ret = await this._next();
this.promiseCache.currentPromise = null;
return ret;
})();
this.promiseCache.currentPromise = nextPromise;
return nextPromise;
}
}
class ListIterator extends StripeIterator {
getNextPage(pageResult) {
const reverseIteration = isReverseIteration(this.requestArgs);
const lastId = getLastId(pageResult, reverseIteration);
return this.stripeResource._makeRequest(this.requestArgs, this.spec, {
[reverseIteration ? 'ending_before' : 'starting_after']: lastId,
});
}
}
class SearchIterator extends StripeIterator {
getNextPage(pageResult) {
if (!pageResult.next_page) {
throw Error('Unexpected: Stripe API response does not have a well-formed `next_page` field, but `has_more` was true.');
}
return this.stripeResource._makeRequest(this.requestArgs, this.spec, {
page: pageResult.next_page,
});
}
}
export const makeAutoPaginationMethods = (stripeResource, requestArgs, spec, firstPagePromise) => {
if (spec.methodType === 'search') {
return makeAutoPaginationMethodsFromIterator(new SearchIterator(firstPagePromise, requestArgs, spec, stripeResource));
}
if (spec.methodType === 'list') {
return makeAutoPaginationMethodsFromIterator(new ListIterator(firstPagePromise, requestArgs, spec, stripeResource));
}
return null;
};
const makeAutoPaginationMethodsFromIterator = (iterator) => {
const autoPagingEach = makeAutoPagingEach((...args) => iterator.next(...args));
const autoPagingToArray = makeAutoPagingToArray(autoPagingEach);
const autoPaginationMethods = {
autoPagingEach,
autoPagingToArray,
// Async iterator functions:
next: () => iterator.next(),
return: () => {
// This is required for `break`.
return {};
},
[getAsyncIteratorSymbol()]: () => {
return autoPaginationMethods;
},
};
return autoPaginationMethods;
};
/**
* ----------------
* Private Helpers:
* ----------------
*/
function getAsyncIteratorSymbol() {
if (typeof Symbol !== 'undefined' && Symbol.asyncIterator) {
return Symbol.asyncIterator;
}
// Follow the convention from libraries like iterall: https://github.com/leebyron/iterall#asynciterator-1
return '@@asyncIterator';
}
function getDoneCallback(args) {
if (args.length < 2) {
return null;
}
const onDone = args[1];
if (typeof onDone !== 'function') {
throw Error(`The second argument to autoPagingEach, if present, must be a callback function; received ${typeof onDone}`);
}
return onDone;
}
/**
* We allow four forms of the `onItem` callback (the middle two being equivalent),
*
* 1. `.autoPagingEach((item) => { doSomething(item); return false; });`
* 2. `.autoPagingEach(async (item) => { await doSomething(item); return false; });`
* 3. `.autoPagingEach((item) => doSomething(item).then(() => false));`
* 4. `.autoPagingEach((item, next) => { doSomething(item); next(false); });`
*
* In addition to standard validation, this helper
* coalesces the former forms into the latter form.
*/
function getItemCallback(args) {
if (args.length === 0) {
return undefined;
}
const onItem = args[0];
if (typeof onItem !== 'function') {
throw Error(`The first argument to autoPagingEach, if present, must be a callback function; received ${typeof onItem}`);
}
// 4. `.autoPagingEach((item, next) => { doSomething(item); next(false); });`
if (onItem.length === 2) {
return onItem;
}
if (onItem.length > 2) {
throw Error(`The \`onItem\` callback function passed to autoPagingEach must accept at most two arguments; got ${onItem}`);
}
// This magically handles all three of these usecases (the latter two being functionally identical):
// 1. `.autoPagingEach((item) => { doSomething(item); return false; });`
// 2. `.autoPagingEach(async (item) => { await doSomething(item); return false; });`
// 3. `.autoPagingEach((item) => doSomething(item).then(() => false));`
return function _onItem(item, next) {
const shouldContinue = onItem(item);
next(shouldContinue);
};
}
function getLastId(listResult, reverseIteration) {
const lastIdx = reverseIteration ? 0 : listResult.data.length - 1;
const lastItem = listResult.data[lastIdx];
const lastId = lastItem && lastItem.id;
if (!lastId) {
throw Error('Unexpected: No `id` found on the last item while auto-paging a list.');
}
return lastId;
}
function makeAutoPagingEach(asyncIteratorNext) {
return function autoPagingEach( /* onItem?, onDone? */) {
const args = [].slice.call(arguments);
const onItem = getItemCallback(args);
const onDone = getDoneCallback(args);
if (args.length > 2) {
throw Error(`autoPagingEach takes up to two arguments; received ${args}`);
}
const autoPagePromise = wrapAsyncIteratorWithCallback(asyncIteratorNext,
// @ts-ignore we might need a null check
onItem);
return callbackifyPromiseWithTimeout(autoPagePromise, onDone);
};
}
function makeAutoPagingToArray(autoPagingEach) {
return function autoPagingToArray(opts, onDone) {
const limit = opts && opts.limit;
if (!limit) {
throw Error('You must pass a `limit` option to autoPagingToArray, e.g., `autoPagingToArray({limit: 1000});`.');
}
if (limit > 10000) {
throw Error('You cannot specify a limit of more than 10,000 items to fetch in `autoPagingToArray`; use `autoPagingEach` to iterate through longer lists.');
}
const promise = new Promise((resolve, reject) => {
const items = [];
autoPagingEach((item) => {
items.push(item);
if (items.length >= limit) {
return false;
}
})
.then(() => {
resolve(items);
})
.catch(reject);
});
// @ts-ignore
return callbackifyPromiseWithTimeout(promise, onDone);
};
}
function wrapAsyncIteratorWithCallback(asyncIteratorNext, onItem) {
return new Promise((resolve, reject) => {
function handleIteration(iterResult) {
if (iterResult.done) {
resolve();
return;
}
const item = iterResult.value;
return new Promise((next) => {
// Bit confusing, perhaps; we pass a `resolve` fn
// to the user, so they can decide when and if to continue.
// They can return false, or a promise which resolves to false, to break.
onItem(item, next);
}).then((shouldContinue) => {
if (shouldContinue === false) {
return handleIteration({ done: true, value: undefined });
}
else {
return asyncIteratorNext().then(handleIteration);
}
});
}
asyncIteratorNext()
.then(handleIteration)
.catch(reject);
});
}
function isReverseIteration(requestArgs) {
const args = [].slice.call(requestArgs);
const dataFromArgs = getDataFromArgs(args);
return !!dataFromArgs.ending_before;
}
@@ -0,0 +1,40 @@
/**
* Interface encapsulating the various crypto computations used by the library,
* allowing pluggable underlying crypto implementations.
*/
export class CryptoProvider {
/**
* Computes a SHA-256 HMAC given a secret and a payload (encoded in UTF-8).
* The output HMAC should be encoded in hexadecimal.
*
* Sample values for implementations:
* - computeHMACSignature('', 'test_secret') => 'f7f9bd47fb987337b5796fdc1fdb9ba221d0d5396814bfcaf9521f43fd8927fd'
* - computeHMACSignature('\ud83d\ude00', 'test_secret') => '837da296d05c4fe31f61d5d7ead035099d9585a5bcde87de952012a78f0b0c43
*/
computeHMACSignature(payload, secret) {
throw new Error('computeHMACSignature not implemented.');
}
/**
* Asynchronous version of `computeHMACSignature`. Some implementations may
* only allow support async signature computation.
*
* Computes a SHA-256 HMAC given a secret and a payload (encoded in UTF-8).
* The output HMAC should be encoded in hexadecimal.
*
* Sample values for implementations:
* - computeHMACSignature('', 'test_secret') => 'f7f9bd47fb987337b5796fdc1fdb9ba221d0d5396814bfcaf9521f43fd8927fd'
* - computeHMACSignature('\ud83d\ude00', 'test_secret') => '837da296d05c4fe31f61d5d7ead035099d9585a5bcde87de952012a78f0b0c43
*/
computeHMACSignatureAsync(payload, secret) {
throw new Error('computeHMACSignatureAsync not implemented.');
}
}
/**
* If the crypto provider only supports asynchronous operations,
* throw CryptoProviderOnlySupportsAsyncError instead of
* a generic error so that the caller can choose to provide
* a more helpful error message to direct the user to use
* an asynchronous pathway.
*/
export class CryptoProviderOnlySupportsAsyncError extends Error {
}
@@ -0,0 +1,19 @@
import * as crypto from 'crypto';
import { CryptoProvider } from './CryptoProvider.js';
/**
* `CryptoProvider which uses the Node `crypto` package for its computations.
*/
export class NodeCryptoProvider extends CryptoProvider {
/** @override */
computeHMACSignature(payload, secret) {
return crypto
.createHmac('sha256', secret)
.update(payload, 'utf8')
.digest('hex');
}
/** @override */
async computeHMACSignatureAsync(payload, secret) {
const signature = await this.computeHMACSignature(payload, secret);
return signature;
}
}
@@ -0,0 +1,43 @@
import { CryptoProvider, CryptoProviderOnlySupportsAsyncError, } from './CryptoProvider.js';
/**
* `CryptoProvider which uses the SubtleCrypto interface of the Web Crypto API.
*
* This only supports asynchronous operations.
*/
export class SubtleCryptoProvider extends CryptoProvider {
constructor(subtleCrypto) {
super();
// If no subtle crypto is interface, default to the global namespace. This
// is to allow custom interfaces (eg. using the Node webcrypto interface in
// tests).
this.subtleCrypto = subtleCrypto || crypto.subtle;
}
/** @override */
computeHMACSignature(payload, secret) {
throw new CryptoProviderOnlySupportsAsyncError('SubtleCryptoProvider cannot be used in a synchronous context.');
}
/** @override */
async computeHMACSignatureAsync(payload, secret) {
const encoder = new TextEncoder();
const key = await this.subtleCrypto.importKey('raw', encoder.encode(secret), {
name: 'HMAC',
hash: { name: 'SHA-256' },
}, false, ['sign']);
const signatureBuffer = await this.subtleCrypto.sign('hmac', key, encoder.encode(payload));
// crypto.subtle returns the signature in base64 format. This must be
// encoded in hex to match the CryptoProvider contract. We map each byte in
// the buffer to its corresponding hex octet and then combine into a string.
const signatureBytes = new Uint8Array(signatureBuffer);
const signatureHexCodes = new Array(signatureBytes.length);
for (let i = 0; i < signatureBytes.length; i++) {
signatureHexCodes[i] = byteHexMapping[signatureBytes[i]];
}
return signatureHexCodes.join('');
}
}
// Cached mapping of byte to hex representation. We do this once to avoid re-
// computing every time we need to convert the result of a signature to hex.
const byteHexMapping = new Array(256);
for (let i = 0; i < byteHexMapping.length; i++) {
byteHexMapping[i] = i.toString(16).padStart(2, '0');
}
+54
View File
@@ -0,0 +1,54 @@
import { flattenAndStringify, stringifyRequestData } from './utils.js';
// Method for formatting HTTP body for the multipart/form-data specification
// Mostly taken from Fermata.js
// https://github.com/natevw/fermata/blob/5d9732a33d776ce925013a265935facd1626cc88/fermata.js#L315-L343
const multipartDataGenerator = (method, data, headers) => {
const segno = (Math.round(Math.random() * 1e16) + Math.round(Math.random() * 1e16)).toString();
headers['Content-Type'] = `multipart/form-data; boundary=${segno}`;
const textEncoder = new TextEncoder();
let buffer = new Uint8Array(0);
const endBuffer = textEncoder.encode('\r\n');
function push(l) {
const prevBuffer = buffer;
const newBuffer = l instanceof Uint8Array ? l : new Uint8Array(textEncoder.encode(l));
buffer = new Uint8Array(prevBuffer.length + newBuffer.length + 2);
buffer.set(prevBuffer);
buffer.set(newBuffer, prevBuffer.length);
buffer.set(endBuffer, buffer.length - 2);
}
function q(s) {
return `"${s.replace(/"|"/g, '%22').replace(/\r\n|\r|\n/g, ' ')}"`;
}
const flattenedData = flattenAndStringify(data);
for (const k in flattenedData) {
const v = flattenedData[k];
push(`--${segno}`);
if (Object.prototype.hasOwnProperty.call(v, 'data')) {
const typedEntry = v;
push(`Content-Disposition: form-data; name=${q(k)}; filename=${q(typedEntry.name || 'blob')}`);
push(`Content-Type: ${typedEntry.type || 'application/octet-stream'}`);
push('');
push(typedEntry.data);
}
else {
push(`Content-Disposition: form-data; name=${q(k)}`);
push('');
push(v);
}
}
push(`--${segno}--`);
return buffer;
};
export function multipartRequestDataProcessor(method, data, headers, callback) {
data = data || {};
if (method !== 'POST') {
return callback(null, stringifyRequestData(data));
}
this._stripe._platformFunctions
.tryBufferData(data)
.then((bufferedData) => {
const buffer = multipartDataGenerator(method, bufferedData, headers);
return callback(null, buffer);
})
.catch((err) => callback(err, null));
}
@@ -0,0 +1,101 @@
import { HttpClient, HttpClientResponse, } from './HttpClient.js';
/**
* HTTP client which uses a `fetch` function to issue requests.
*
* By default relies on the global `fetch` function, but an optional function
* can be passed in. If passing in a function, it is expected to match the Web
* Fetch API. As an example, this could be the function provided by the
* node-fetch package (https://github.com/node-fetch/node-fetch).
*/
export class FetchHttpClient extends HttpClient {
constructor(fetchFn) {
super();
this._fetchFn = fetchFn;
}
/** @override. */
getClientName() {
return 'fetch';
}
makeRequest(host, port, path, method, headers, requestData, protocol, timeout) {
const isInsecureConnection = protocol === 'http';
const url = new URL(path, `${isInsecureConnection ? 'http' : 'https'}://${host}`);
url.port = port;
// For methods which expect payloads, we should always pass a body value
// even when it is empty. Without this, some JS runtimes (eg. Deno) will
// inject a second Content-Length header. See https://github.com/stripe/stripe-node/issues/1519
// for more details.
const methodHasPayload = method == 'POST' || method == 'PUT' || method == 'PATCH';
const body = requestData || (methodHasPayload ? '' : undefined);
const fetchFn = this._fetchFn || fetch;
const fetchPromise = fetchFn(url.toString(), {
method,
// @ts-ignore
headers,
// @ts-ignore
body,
});
// The Fetch API does not support passing in a timeout natively, so a
// timeout promise is constructed to race against the fetch and preempt the
// request, simulating a timeout.
//
// This timeout behavior differs from Node:
// - Fetch uses a single timeout for the entire length of the request.
// - Node is more fine-grained and resets the timeout after each stage of
// the request.
//
// As an example, if the timeout is set to 30s and the connection takes 20s
// to be established followed by 20s for the body, Fetch would timeout but
// Node would not. The more fine-grained timeout cannot be implemented with
// fetch.
let pendingTimeoutId;
const timeoutPromise = new Promise((_, reject) => {
pendingTimeoutId = setTimeout(() => {
pendingTimeoutId = null;
reject(HttpClient.makeTimeoutError());
}, timeout);
});
return Promise.race([fetchPromise, timeoutPromise])
.then((res) => {
return new FetchHttpClientResponse(res);
})
.finally(() => {
if (pendingTimeoutId) {
clearTimeout(pendingTimeoutId);
}
});
}
}
export class FetchHttpClientResponse extends HttpClientResponse {
constructor(res) {
super(res.status, FetchHttpClientResponse._transformHeadersToObject(res.headers));
this._res = res;
}
getRawResponse() {
return this._res;
}
toStream(streamCompleteCallback) {
// Unfortunately `fetch` does not have event handlers for when the stream is
// completely read. We therefore invoke the streamCompleteCallback right
// away. This callback emits a response event with metadata and completes
// metrics, so it's ok to do this without waiting for the stream to be
// completely read.
streamCompleteCallback();
// Fetch's `body` property is expected to be a readable stream of the body.
return this._res.body;
}
toJSON() {
return this._res.json();
}
static _transformHeadersToObject(headers) {
// Fetch uses a Headers instance so this must be converted to a barebones
// JS object to meet the HttpClient interface.
const headersObj = {};
for (const entry of headers) {
if (!Array.isArray(entry) || entry.length != 2) {
throw new Error('Response objects produced by the fetch function given to FetchHttpClient do not have an iterable headers map. Response#headers should be an iterable object.');
}
headersObj[entry[0]] = entry[1];
}
return headersObj;
}
}
+48
View File
@@ -0,0 +1,48 @@
/**
* Encapsulates the logic for issuing a request to the Stripe API.
*
* A custom HTTP client should should implement:
* 1. A response class which extends HttpClientResponse and wraps around their
* own internal representation of a response.
* 2. A client class which extends HttpClient and implements all methods,
* returning their own response class when making requests.
*/
export class HttpClient {
/** The client name used for diagnostics. */
getClientName() {
throw new Error('getClientName not implemented.');
}
makeRequest(host, port, path, method, headers, requestData, protocol, timeout) {
throw new Error('makeRequest not implemented.');
}
/** Helper to make a consistent timeout error across implementations. */
static makeTimeoutError() {
const timeoutErr = new TypeError(HttpClient.TIMEOUT_ERROR_CODE);
timeoutErr.code = HttpClient.TIMEOUT_ERROR_CODE;
return timeoutErr;
}
}
// Public API accessible via Stripe.HttpClient
HttpClient.CONNECTION_CLOSED_ERROR_CODES = ['ECONNRESET', 'EPIPE'];
HttpClient.TIMEOUT_ERROR_CODE = 'ETIMEDOUT';
export class HttpClientResponse {
constructor(statusCode, headers) {
this._statusCode = statusCode;
this._headers = headers;
}
getStatusCode() {
return this._statusCode;
}
getHeaders() {
return this._headers;
}
getRawResponse() {
throw new Error('getRawResponse not implemented.');
}
toStream(streamCompleteCallback) {
throw new Error('toStream not implemented.');
}
toJSON() {
throw new Error('toJSON not implemented.');
}
}
+103
View File
@@ -0,0 +1,103 @@
import * as http_ from 'http';
import * as https_ from 'https';
import { HttpClient, HttpClientResponse, } from './HttpClient.js';
// `import * as http_ from 'http'` creates a "Module Namespace Exotic Object"
// which is immune to monkey-patching, whereas http_.default (in an ES Module context)
// will resolve to the same thing as require('http'), which is
// monkey-patchable. We care about this because users in their test
// suites might be using a library like "nock" which relies on the ability
// to monkey-patch and intercept calls to http.request.
const http = http_.default || http_;
const https = https_.default || https_;
const defaultHttpAgent = new http.Agent({ keepAlive: true });
const defaultHttpsAgent = new https.Agent({ keepAlive: true });
/**
* HTTP client which uses the Node `http` and `https` packages to issue
* requests.`
*/
export class NodeHttpClient extends HttpClient {
constructor(agent) {
super();
this._agent = agent;
}
/** @override. */
getClientName() {
return 'node';
}
makeRequest(host, port, path, method, headers, requestData, protocol, timeout) {
const isInsecureConnection = protocol === 'http';
let agent = this._agent;
if (!agent) {
agent = isInsecureConnection ? defaultHttpAgent : defaultHttpsAgent;
}
const requestPromise = new Promise((resolve, reject) => {
const req = (isInsecureConnection ? http : https).request({
host: host,
port: port,
path,
method,
agent,
headers,
ciphers: 'DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2:!MD5',
});
req.setTimeout(timeout, () => {
req.destroy(HttpClient.makeTimeoutError());
});
req.on('response', (res) => {
resolve(new NodeHttpClientResponse(res));
});
req.on('error', (error) => {
reject(error);
});
req.once('socket', (socket) => {
if (socket.connecting) {
socket.once(isInsecureConnection ? 'connect' : 'secureConnect', () => {
// Send payload; we're safe:
req.write(requestData);
req.end();
});
}
else {
// we're already connected
req.write(requestData);
req.end();
}
});
});
return requestPromise;
}
}
export class NodeHttpClientResponse extends HttpClientResponse {
constructor(res) {
// @ts-ignore
super(res.statusCode, res.headers || {});
this._res = res;
}
getRawResponse() {
return this._res;
}
toStream(streamCompleteCallback) {
// The raw response is itself the stream, so we just return that. To be
// backwards compatible, we should invoke the streamCompleteCallback only
// once the stream has been fully consumed.
this._res.once('end', () => streamCompleteCallback());
return this._res;
}
toJSON() {
return new Promise((resolve, reject) => {
let response = '';
this._res.setEncoding('utf8');
this._res.on('data', (chunk) => {
response += chunk;
});
this._res.once('end', () => {
try {
resolve(JSON.parse(response));
}
catch (e) {
reject(e);
}
});
});
}
}
+1
View File
@@ -0,0 +1 @@
{"type":"module"}
@@ -0,0 +1,122 @@
import * as crypto from 'crypto';
import { EventEmitter } from 'events';
import { NodeCryptoProvider } from '../crypto/NodeCryptoProvider.js';
import { NodeHttpClient } from '../net/NodeHttpClient.js';
import { PlatformFunctions } from './PlatformFunctions.js';
import { StripeError } from '../Error.js';
import { concat } from '../utils.js';
import { exec } from 'child_process';
class StreamProcessingError extends StripeError {
}
/**
* Specializes WebPlatformFunctions using APIs available in Node.js.
*/
export class NodePlatformFunctions extends PlatformFunctions {
constructor() {
super();
this._exec = exec;
this._UNAME_CACHE = null;
}
/** @override */
uuid4() {
// available in: v14.17.x+
if (crypto.randomUUID) {
return crypto.randomUUID();
}
return super.uuid4();
}
/**
* @override
* Node's built in `exec` function sometimes throws outright,
* and sometimes has a callback with an error,
* depending on the type of error.
*
* This unifies that interface by resolving with a null uname
* if an error is encountered.
*/
getUname() {
if (!this._UNAME_CACHE) {
this._UNAME_CACHE = new Promise((resolve, reject) => {
try {
this._exec('uname -a', (err, uname) => {
if (err) {
return resolve(null);
}
resolve(uname);
});
}
catch (e) {
resolve(null);
}
});
}
return this._UNAME_CACHE;
}
/**
* @override
* Secure compare, from https://github.com/freewil/scmp
*/
secureCompare(a, b) {
if (!a || !b) {
throw new Error('secureCompare must receive two arguments');
}
// return early here if buffer lengths are not equal since timingSafeEqual
// will throw if buffer lengths are not equal
if (a.length !== b.length) {
return false;
}
// use crypto.timingSafeEqual if available (since Node.js v6.6.0),
// otherwise use our own scmp-internal function.
if (crypto.timingSafeEqual) {
const textEncoder = new TextEncoder();
const aEncoded = textEncoder.encode(a);
const bEncoded = textEncoder.encode(b);
return crypto.timingSafeEqual(aEncoded, bEncoded);
}
return super.secureCompare(a, b);
}
createEmitter() {
return new EventEmitter();
}
/** @override */
tryBufferData(data) {
if (!(data.file.data instanceof EventEmitter)) {
return Promise.resolve(data);
}
const bufferArray = [];
return new Promise((resolve, reject) => {
data.file.data
.on('data', (line) => {
bufferArray.push(line);
})
.once('end', () => {
// @ts-ignore
const bufferData = Object.assign({}, data);
bufferData.file.data = concat(bufferArray);
resolve(bufferData);
})
.on('error', (err) => {
reject(new StreamProcessingError({
message: 'An error occurred while attempting to process the file for upload.',
detail: err,
}));
});
});
}
/** @override */
createNodeHttpClient(agent) {
return new NodeHttpClient(agent);
}
/** @override */
createDefaultHttpClient() {
return new NodeHttpClient();
}
/** @override */
createNodeCryptoProvider() {
return new NodeCryptoProvider();
}
/** @override */
createDefaultCryptoProvider() {
return this.createNodeCryptoProvider();
}
}
@@ -0,0 +1,94 @@
import { FetchHttpClient } from '../net/FetchHttpClient.js';
import { SubtleCryptoProvider } from '../crypto/SubtleCryptoProvider.js';
/**
* Interface encapsulating various utility functions whose
* implementations depend on the platform / JS runtime.
*/
export class PlatformFunctions {
constructor() {
this._fetchFn = null;
this._agent = null;
}
/**
* Gets uname with Node's built-in `exec` function, if available.
*/
getUname() {
throw new Error('getUname not implemented.');
}
/**
* Generates a v4 UUID. See https://stackoverflow.com/a/2117523
*/
uuid4() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
const r = (Math.random() * 16) | 0;
const v = c === 'x' ? r : (r & 0x3) | 0x8;
return v.toString(16);
});
}
/**
* Compares strings in constant time.
*/
secureCompare(a, b) {
// return early here if buffer lengths are not equal
if (a.length !== b.length) {
return false;
}
const len = a.length;
let result = 0;
for (let i = 0; i < len; ++i) {
result |= a.charCodeAt(i) ^ b.charCodeAt(i);
}
return result === 0;
}
/**
* Creates an event emitter.
*/
createEmitter() {
throw new Error('createEmitter not implemented.');
}
/**
* Checks if the request data is a stream. If so, read the entire stream
* to a buffer and return the buffer.
*/
tryBufferData(data) {
throw new Error('tryBufferData not implemented.');
}
/**
* Creates an HTTP client which uses the Node `http` and `https` packages
* to issue requests.
*/
createNodeHttpClient(agent) {
throw new Error('createNodeHttpClient not implemented.');
}
/**
* Creates an HTTP client for issuing Stripe API requests which uses the Web
* Fetch API.
*
* A fetch function can optionally be passed in as a parameter. If none is
* passed, will default to the default `fetch` function in the global scope.
*/
createFetchHttpClient(fetchFn) {
return new FetchHttpClient(fetchFn);
}
/**
* Creates an HTTP client using runtime-specific APIs.
*/
createDefaultHttpClient() {
throw new Error('createDefaultHttpClient not implemented.');
}
/**
* Creates a CryptoProvider which uses the Node `crypto` package for its computations.
*/
createNodeCryptoProvider() {
throw new Error('createNodeCryptoProvider not implemented.');
}
/**
* Creates a CryptoProvider which uses the SubtleCrypto interface of the Web Crypto API.
*/
createSubtleCryptoProvider(subtleCrypto) {
return new SubtleCryptoProvider(subtleCrypto);
}
createDefaultCryptoProvider() {
throw new Error('createDefaultCryptoProvider not implemented.');
}
}
@@ -0,0 +1,38 @@
import { PlatformFunctions } from './PlatformFunctions.js';
import { StripeEmitter } from '../StripeEmitter.js';
/**
* Specializes WebPlatformFunctions using APIs available in Web workers.
*/
export class WebPlatformFunctions extends PlatformFunctions {
/** @override */
getUname() {
return Promise.resolve(null);
}
/** @override */
createEmitter() {
return new StripeEmitter();
}
/** @override */
tryBufferData(data) {
if (data.file.data instanceof ReadableStream) {
throw new Error('Uploading a file as a stream is not supported in non-Node environments. Please open or upvote an issue at github.com/stripe/stripe-node if you use this, detailing your use-case.');
}
return Promise.resolve(data);
}
/** @override */
createNodeHttpClient() {
throw new Error('Stripe: `createNodeHttpClient()` is not available in non-Node environments. Please use `createFetchHttpClient()` instead.');
}
/** @override */
createDefaultHttpClient() {
return super.createFetchHttpClient();
}
/** @override */
createNodeCryptoProvider() {
throw new Error('Stripe: `createNodeCryptoProvider()` is not available in non-Node environments. Please use `createSubtleCryptoProvider()` instead.');
}
/** @override */
createDefaultCryptoProvider() {
return this.createSubtleCryptoProvider();
}
}
+168
View File
@@ -0,0 +1,168 @@
// File generated from our OpenAPI spec
import { resourceNamespace } from './ResourceNamespace.js';
import { Accounts as FinancialConnectionsAccounts } from './resources/FinancialConnections/Accounts.js';
import { Authorizations as IssuingAuthorizations } from './resources/Issuing/Authorizations.js';
import { Calculations as TaxCalculations } from './resources/Tax/Calculations.js';
import { Cardholders as IssuingCardholders } from './resources/Issuing/Cardholders.js';
import { Cards as TestHelpersIssuingCards } from './resources/TestHelpers/Issuing/Cards.js';
import { Cards as IssuingCards } from './resources/Issuing/Cards.js';
import { Configurations as BillingPortalConfigurations } from './resources/BillingPortal/Configurations.js';
import { Configurations as TerminalConfigurations } from './resources/Terminal/Configurations.js';
import { ConnectionTokens as TerminalConnectionTokens } from './resources/Terminal/ConnectionTokens.js';
import { CreditReversals as TreasuryCreditReversals } from './resources/Treasury/CreditReversals.js';
import { Customers as TestHelpersCustomers } from './resources/TestHelpers/Customers.js';
import { DebitReversals as TreasuryDebitReversals } from './resources/Treasury/DebitReversals.js';
import { Disputes as IssuingDisputes } from './resources/Issuing/Disputes.js';
import { EarlyFraudWarnings as RadarEarlyFraudWarnings } from './resources/Radar/EarlyFraudWarnings.js';
import { FinancialAccounts as TreasuryFinancialAccounts } from './resources/Treasury/FinancialAccounts.js';
import { InboundTransfers as TestHelpersTreasuryInboundTransfers } from './resources/TestHelpers/Treasury/InboundTransfers.js';
import { InboundTransfers as TreasuryInboundTransfers } from './resources/Treasury/InboundTransfers.js';
import { Locations as TerminalLocations } from './resources/Terminal/Locations.js';
import { OutboundPayments as TestHelpersTreasuryOutboundPayments } from './resources/TestHelpers/Treasury/OutboundPayments.js';
import { OutboundPayments as TreasuryOutboundPayments } from './resources/Treasury/OutboundPayments.js';
import { OutboundTransfers as TestHelpersTreasuryOutboundTransfers } from './resources/TestHelpers/Treasury/OutboundTransfers.js';
import { OutboundTransfers as TreasuryOutboundTransfers } from './resources/Treasury/OutboundTransfers.js';
import { Readers as TestHelpersTerminalReaders } from './resources/TestHelpers/Terminal/Readers.js';
import { Readers as TerminalReaders } from './resources/Terminal/Readers.js';
import { ReceivedCredits as TestHelpersTreasuryReceivedCredits } from './resources/TestHelpers/Treasury/ReceivedCredits.js';
import { ReceivedCredits as TreasuryReceivedCredits } from './resources/Treasury/ReceivedCredits.js';
import { ReceivedDebits as TestHelpersTreasuryReceivedDebits } from './resources/TestHelpers/Treasury/ReceivedDebits.js';
import { ReceivedDebits as TreasuryReceivedDebits } from './resources/Treasury/ReceivedDebits.js';
import { Refunds as TestHelpersRefunds } from './resources/TestHelpers/Refunds.js';
import { ReportRuns as ReportingReportRuns } from './resources/Reporting/ReportRuns.js';
import { ReportTypes as ReportingReportTypes } from './resources/Reporting/ReportTypes.js';
import { ScheduledQueryRuns as SigmaScheduledQueryRuns } from './resources/Sigma/ScheduledQueryRuns.js';
import { Secrets as AppsSecrets } from './resources/Apps/Secrets.js';
import { Sessions as BillingPortalSessions } from './resources/BillingPortal/Sessions.js';
import { Sessions as CheckoutSessions } from './resources/Checkout/Sessions.js';
import { Sessions as FinancialConnectionsSessions } from './resources/FinancialConnections/Sessions.js';
import { Settings as TaxSettings } from './resources/Tax/Settings.js';
import { TestClocks as TestHelpersTestClocks } from './resources/TestHelpers/TestClocks.js';
import { TransactionEntries as TreasuryTransactionEntries } from './resources/Treasury/TransactionEntries.js';
import { Transactions as IssuingTransactions } from './resources/Issuing/Transactions.js';
import { Transactions as TaxTransactions } from './resources/Tax/Transactions.js';
import { Transactions as TreasuryTransactions } from './resources/Treasury/Transactions.js';
import { ValueListItems as RadarValueListItems } from './resources/Radar/ValueListItems.js';
import { ValueLists as RadarValueLists } from './resources/Radar/ValueLists.js';
import { VerificationReports as IdentityVerificationReports } from './resources/Identity/VerificationReports.js';
import { VerificationSessions as IdentityVerificationSessions } from './resources/Identity/VerificationSessions.js';
export { Accounts as Account } from './resources/Accounts.js';
export { AccountLinks } from './resources/AccountLinks.js';
export { Accounts } from './resources/Accounts.js';
export { ApplePayDomains } from './resources/ApplePayDomains.js';
export { ApplicationFees } from './resources/ApplicationFees.js';
export { Balance } from './resources/Balance.js';
export { BalanceTransactions } from './resources/BalanceTransactions.js';
export { Charges } from './resources/Charges.js';
export { CountrySpecs } from './resources/CountrySpecs.js';
export { Coupons } from './resources/Coupons.js';
export { CreditNotes } from './resources/CreditNotes.js';
export { Customers } from './resources/Customers.js';
export { Disputes } from './resources/Disputes.js';
export { EphemeralKeys } from './resources/EphemeralKeys.js';
export { Events } from './resources/Events.js';
export { ExchangeRates } from './resources/ExchangeRates.js';
export { FileLinks } from './resources/FileLinks.js';
export { Files } from './resources/Files.js';
export { InvoiceItems } from './resources/InvoiceItems.js';
export { Invoices } from './resources/Invoices.js';
export { Mandates } from './resources/Mandates.js';
export { OAuth } from './resources/OAuth.js';
export { PaymentIntents } from './resources/PaymentIntents.js';
export { PaymentLinks } from './resources/PaymentLinks.js';
export { PaymentMethods } from './resources/PaymentMethods.js';
export { Payouts } from './resources/Payouts.js';
export { Plans } from './resources/Plans.js';
export { Prices } from './resources/Prices.js';
export { Products } from './resources/Products.js';
export { PromotionCodes } from './resources/PromotionCodes.js';
export { Quotes } from './resources/Quotes.js';
export { Refunds } from './resources/Refunds.js';
export { Reviews } from './resources/Reviews.js';
export { SetupAttempts } from './resources/SetupAttempts.js';
export { SetupIntents } from './resources/SetupIntents.js';
export { ShippingRates } from './resources/ShippingRates.js';
export { Sources } from './resources/Sources.js';
export { SubscriptionItems } from './resources/SubscriptionItems.js';
export { SubscriptionSchedules } from './resources/SubscriptionSchedules.js';
export { Subscriptions } from './resources/Subscriptions.js';
export { TaxCodes } from './resources/TaxCodes.js';
export { TaxRates } from './resources/TaxRates.js';
export { Tokens } from './resources/Tokens.js';
export { Topups } from './resources/Topups.js';
export { Transfers } from './resources/Transfers.js';
export { WebhookEndpoints } from './resources/WebhookEndpoints.js';
export const Apps = resourceNamespace('apps', { Secrets: AppsSecrets });
export const BillingPortal = resourceNamespace('billingPortal', {
Configurations: BillingPortalConfigurations,
Sessions: BillingPortalSessions,
});
export const Checkout = resourceNamespace('checkout', {
Sessions: CheckoutSessions,
});
export const FinancialConnections = resourceNamespace('financialConnections', {
Accounts: FinancialConnectionsAccounts,
Sessions: FinancialConnectionsSessions,
});
export const Identity = resourceNamespace('identity', {
VerificationReports: IdentityVerificationReports,
VerificationSessions: IdentityVerificationSessions,
});
export const Issuing = resourceNamespace('issuing', {
Authorizations: IssuingAuthorizations,
Cardholders: IssuingCardholders,
Cards: IssuingCards,
Disputes: IssuingDisputes,
Transactions: IssuingTransactions,
});
export const Radar = resourceNamespace('radar', {
EarlyFraudWarnings: RadarEarlyFraudWarnings,
ValueListItems: RadarValueListItems,
ValueLists: RadarValueLists,
});
export const Reporting = resourceNamespace('reporting', {
ReportRuns: ReportingReportRuns,
ReportTypes: ReportingReportTypes,
});
export const Sigma = resourceNamespace('sigma', {
ScheduledQueryRuns: SigmaScheduledQueryRuns,
});
export const Tax = resourceNamespace('tax', {
Calculations: TaxCalculations,
Settings: TaxSettings,
Transactions: TaxTransactions,
});
export const Terminal = resourceNamespace('terminal', {
Configurations: TerminalConfigurations,
ConnectionTokens: TerminalConnectionTokens,
Locations: TerminalLocations,
Readers: TerminalReaders,
});
export const TestHelpers = resourceNamespace('testHelpers', {
Customers: TestHelpersCustomers,
Refunds: TestHelpersRefunds,
TestClocks: TestHelpersTestClocks,
Issuing: resourceNamespace('issuing', { Cards: TestHelpersIssuingCards }),
Terminal: resourceNamespace('terminal', {
Readers: TestHelpersTerminalReaders,
}),
Treasury: resourceNamespace('treasury', {
InboundTransfers: TestHelpersTreasuryInboundTransfers,
OutboundPayments: TestHelpersTreasuryOutboundPayments,
OutboundTransfers: TestHelpersTreasuryOutboundTransfers,
ReceivedCredits: TestHelpersTreasuryReceivedCredits,
ReceivedDebits: TestHelpersTreasuryReceivedDebits,
}),
});
export const Treasury = resourceNamespace('treasury', {
CreditReversals: TreasuryCreditReversals,
DebitReversals: TreasuryDebitReversals,
FinancialAccounts: TreasuryFinancialAccounts,
InboundTransfers: TreasuryInboundTransfers,
OutboundPayments: TreasuryOutboundPayments,
OutboundTransfers: TreasuryOutboundTransfers,
ReceivedCredits: TreasuryReceivedCredits,
ReceivedDebits: TreasuryReceivedDebits,
TransactionEntries: TreasuryTransactionEntries,
Transactions: TreasuryTransactions,
});
@@ -0,0 +1,6 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const AccountLinks = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/account_links' }),
});
@@ -0,0 +1,97 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
// Since path can either be `account` or `accounts`, support both through stripeMethod path
export const Accounts = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/accounts' }),
retrieve(id, ...args) {
// No longer allow an api key to be passed as the first string to this function due to ambiguity between
// old account ids and api keys. To request the account for an api key, send null as the id
if (typeof id === 'string') {
return stripeMethod({
method: 'GET',
fullPath: '/v1/accounts/{id}',
}).apply(this, [id, ...args]);
}
else {
if (id === null || id === undefined) {
// Remove id as stripeMethod would complain of unexpected argument
[].shift.apply([id, ...args]);
}
return stripeMethod({
method: 'GET',
fullPath: '/v1/account',
}).apply(this, [id, ...args]);
}
},
update: stripeMethod({ method: 'POST', fullPath: '/v1/accounts/{account}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/accounts',
methodType: 'list',
}),
del: stripeMethod({ method: 'DELETE', fullPath: '/v1/accounts/{account}' }),
createExternalAccount: stripeMethod({
method: 'POST',
fullPath: '/v1/accounts/{account}/external_accounts',
}),
createLoginLink: stripeMethod({
method: 'POST',
fullPath: '/v1/accounts/{account}/login_links',
}),
createPerson: stripeMethod({
method: 'POST',
fullPath: '/v1/accounts/{account}/persons',
}),
deleteExternalAccount: stripeMethod({
method: 'DELETE',
fullPath: '/v1/accounts/{account}/external_accounts/{id}',
}),
deletePerson: stripeMethod({
method: 'DELETE',
fullPath: '/v1/accounts/{account}/persons/{person}',
}),
listCapabilities: stripeMethod({
method: 'GET',
fullPath: '/v1/accounts/{account}/capabilities',
methodType: 'list',
}),
listExternalAccounts: stripeMethod({
method: 'GET',
fullPath: '/v1/accounts/{account}/external_accounts',
methodType: 'list',
}),
listPersons: stripeMethod({
method: 'GET',
fullPath: '/v1/accounts/{account}/persons',
methodType: 'list',
}),
reject: stripeMethod({
method: 'POST',
fullPath: '/v1/accounts/{account}/reject',
}),
retrieveCapability: stripeMethod({
method: 'GET',
fullPath: '/v1/accounts/{account}/capabilities/{capability}',
}),
retrieveExternalAccount: stripeMethod({
method: 'GET',
fullPath: '/v1/accounts/{account}/external_accounts/{id}',
}),
retrievePerson: stripeMethod({
method: 'GET',
fullPath: '/v1/accounts/{account}/persons/{person}',
}),
updateCapability: stripeMethod({
method: 'POST',
fullPath: '/v1/accounts/{account}/capabilities/{capability}',
}),
updateExternalAccount: stripeMethod({
method: 'POST',
fullPath: '/v1/accounts/{account}/external_accounts/{id}',
}),
updatePerson: stripeMethod({
method: 'POST',
fullPath: '/v1/accounts/{account}/persons/{person}',
}),
});
@@ -0,0 +1,19 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const ApplePayDomains = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/apple_pay/domains' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/apple_pay/domains/{domain}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/apple_pay/domains',
methodType: 'list',
}),
del: stripeMethod({
method: 'DELETE',
fullPath: '/v1/apple_pay/domains/{domain}',
}),
});
@@ -0,0 +1,31 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const ApplicationFees = StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/application_fees/{id}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/application_fees',
methodType: 'list',
}),
createRefund: stripeMethod({
method: 'POST',
fullPath: '/v1/application_fees/{id}/refunds',
}),
listRefunds: stripeMethod({
method: 'GET',
fullPath: '/v1/application_fees/{id}/refunds',
methodType: 'list',
}),
retrieveRefund: stripeMethod({
method: 'GET',
fullPath: '/v1/application_fees/{fee}/refunds/{id}',
}),
updateRefund: stripeMethod({
method: 'POST',
fullPath: '/v1/application_fees/{fee}/refunds/{id}',
}),
});
@@ -0,0 +1,16 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Secrets = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/apps/secrets' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/apps/secrets',
methodType: 'list',
}),
deleteWhere: stripeMethod({
method: 'POST',
fullPath: '/v1/apps/secrets/delete',
}),
find: stripeMethod({ method: 'GET', fullPath: '/v1/apps/secrets/find' }),
});
@@ -0,0 +1,6 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Balance = StripeResource.extend({
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/balance' }),
});
@@ -0,0 +1,14 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const BalanceTransactions = StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/balance_transactions/{id}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/balance_transactions',
methodType: 'list',
}),
});
@@ -0,0 +1,22 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Configurations = StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/billing_portal/configurations',
}),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/billing_portal/configurations/{configuration}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/billing_portal/configurations/{configuration}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/billing_portal/configurations',
methodType: 'list',
}),
});
@@ -0,0 +1,9 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Sessions = StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/billing_portal/sessions',
}),
});
+22
View File
@@ -0,0 +1,22 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Charges = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/charges' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/charges/{charge}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/charges/{charge}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/charges',
methodType: 'list',
}),
capture: stripeMethod({
method: 'POST',
fullPath: '/v1/charges/{charge}/capture',
}),
search: stripeMethod({
method: 'GET',
fullPath: '/v1/charges/search',
methodType: 'search',
}),
});
@@ -0,0 +1,24 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Sessions = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/checkout/sessions' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/checkout/sessions/{session}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/checkout/sessions',
methodType: 'list',
}),
expire: stripeMethod({
method: 'POST',
fullPath: '/v1/checkout/sessions/{session}/expire',
}),
listLineItems: stripeMethod({
method: 'GET',
fullPath: '/v1/checkout/sessions/{session}/line_items',
methodType: 'list',
}),
});
@@ -0,0 +1,14 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const CountrySpecs = StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/country_specs/{country}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/country_specs',
methodType: 'list',
}),
});
+14
View File
@@ -0,0 +1,14 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Coupons = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/coupons' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/coupons/{coupon}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/coupons/{coupon}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/coupons',
methodType: 'list',
}),
del: stripeMethod({ method: 'DELETE', fullPath: '/v1/coupons/{coupon}' }),
});
@@ -0,0 +1,28 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const CreditNotes = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/credit_notes' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/credit_notes/{id}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/credit_notes/{id}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/credit_notes',
methodType: 'list',
}),
listLineItems: stripeMethod({
method: 'GET',
fullPath: '/v1/credit_notes/{credit_note}/lines',
methodType: 'list',
}),
listPreviewLineItems: stripeMethod({
method: 'GET',
fullPath: '/v1/credit_notes/preview/lines',
methodType: 'list',
}),
preview: stripeMethod({ method: 'GET', fullPath: '/v1/credit_notes/preview' }),
voidCreditNote: stripeMethod({
method: 'POST',
fullPath: '/v1/credit_notes/{id}/void',
}),
});
@@ -0,0 +1,112 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Customers = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/customers' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/customers/{customer}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/customers/{customer}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/customers',
methodType: 'list',
}),
del: stripeMethod({ method: 'DELETE', fullPath: '/v1/customers/{customer}' }),
createFundingInstructions: stripeMethod({
method: 'POST',
fullPath: '/v1/customers/{customer}/funding_instructions',
}),
createBalanceTransaction: stripeMethod({
method: 'POST',
fullPath: '/v1/customers/{customer}/balance_transactions',
}),
createSource: stripeMethod({
method: 'POST',
fullPath: '/v1/customers/{customer}/sources',
}),
createTaxId: stripeMethod({
method: 'POST',
fullPath: '/v1/customers/{customer}/tax_ids',
}),
deleteDiscount: stripeMethod({
method: 'DELETE',
fullPath: '/v1/customers/{customer}/discount',
}),
deleteSource: stripeMethod({
method: 'DELETE',
fullPath: '/v1/customers/{customer}/sources/{id}',
}),
deleteTaxId: stripeMethod({
method: 'DELETE',
fullPath: '/v1/customers/{customer}/tax_ids/{id}',
}),
listPaymentMethods: stripeMethod({
method: 'GET',
fullPath: '/v1/customers/{customer}/payment_methods',
methodType: 'list',
}),
listBalanceTransactions: stripeMethod({
method: 'GET',
fullPath: '/v1/customers/{customer}/balance_transactions',
methodType: 'list',
}),
listCashBalanceTransactions: stripeMethod({
method: 'GET',
fullPath: '/v1/customers/{customer}/cash_balance_transactions',
methodType: 'list',
}),
listSources: stripeMethod({
method: 'GET',
fullPath: '/v1/customers/{customer}/sources',
methodType: 'list',
}),
listTaxIds: stripeMethod({
method: 'GET',
fullPath: '/v1/customers/{customer}/tax_ids',
methodType: 'list',
}),
retrievePaymentMethod: stripeMethod({
method: 'GET',
fullPath: '/v1/customers/{customer}/payment_methods/{payment_method}',
}),
retrieveBalanceTransaction: stripeMethod({
method: 'GET',
fullPath: '/v1/customers/{customer}/balance_transactions/{transaction}',
}),
retrieveCashBalance: stripeMethod({
method: 'GET',
fullPath: '/v1/customers/{customer}/cash_balance',
}),
retrieveCashBalanceTransaction: stripeMethod({
method: 'GET',
fullPath: '/v1/customers/{customer}/cash_balance_transactions/{transaction}',
}),
retrieveSource: stripeMethod({
method: 'GET',
fullPath: '/v1/customers/{customer}/sources/{id}',
}),
retrieveTaxId: stripeMethod({
method: 'GET',
fullPath: '/v1/customers/{customer}/tax_ids/{id}',
}),
search: stripeMethod({
method: 'GET',
fullPath: '/v1/customers/search',
methodType: 'search',
}),
updateBalanceTransaction: stripeMethod({
method: 'POST',
fullPath: '/v1/customers/{customer}/balance_transactions/{transaction}',
}),
updateCashBalance: stripeMethod({
method: 'POST',
fullPath: '/v1/customers/{customer}/cash_balance',
}),
updateSource: stripeMethod({
method: 'POST',
fullPath: '/v1/customers/{customer}/sources/{id}',
}),
verifySource: stripeMethod({
method: 'POST',
fullPath: '/v1/customers/{customer}/sources/{id}/verify',
}),
});
@@ -0,0 +1,16 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Disputes = StripeResource.extend({
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/disputes/{dispute}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/disputes/{dispute}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/disputes',
methodType: 'list',
}),
close: stripeMethod({
method: 'POST',
fullPath: '/v1/disputes/{dispute}/close',
}),
});
@@ -0,0 +1,15 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const EphemeralKeys = StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/ephemeral_keys',
validator: (data, options) => {
if (!options.headers || !options.headers['Stripe-Version']) {
throw new Error('Passing apiVersion in a separate options hash is required to create an ephemeral key. See https://stripe.com/docs/api/versioning?lang=node');
}
},
}),
del: stripeMethod({ method: 'DELETE', fullPath: '/v1/ephemeral_keys/{key}' }),
});
+11
View File
@@ -0,0 +1,11 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Events = StripeResource.extend({
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/events/{id}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/events',
methodType: 'list',
}),
});
@@ -0,0 +1,14 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const ExchangeRates = StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/exchange_rates/{rate_id}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/exchange_rates',
methodType: 'list',
}),
});
@@ -0,0 +1,13 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const FileLinks = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/file_links' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/file_links/{link}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/file_links/{link}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/file_links',
methodType: 'list',
}),
});
+21
View File
@@ -0,0 +1,21 @@
// File generated from our OpenAPI spec
import { multipartRequestDataProcessor } from '../multipart.js';
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Files = StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/files',
headers: {
'Content-Type': 'multipart/form-data',
},
host: 'files.stripe.com',
}),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/files/{file}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/files',
methodType: 'list',
}),
requestDataProcessor: multipartRequestDataProcessor,
});
@@ -0,0 +1,27 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Accounts = StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/financial_connections/accounts/{account}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/financial_connections/accounts',
methodType: 'list',
}),
disconnect: stripeMethod({
method: 'POST',
fullPath: '/v1/financial_connections/accounts/{account}/disconnect',
}),
listOwners: stripeMethod({
method: 'GET',
fullPath: '/v1/financial_connections/accounts/{account}/owners',
methodType: 'list',
}),
refresh: stripeMethod({
method: 'POST',
fullPath: '/v1/financial_connections/accounts/{account}/refresh',
}),
});
@@ -0,0 +1,13 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Sessions = StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/financial_connections/sessions',
}),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/financial_connections/sessions/{session}',
}),
});
@@ -0,0 +1,14 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const VerificationReports = StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/identity/verification_reports/{report}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/identity/verification_reports',
methodType: 'list',
}),
});
@@ -0,0 +1,30 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const VerificationSessions = StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/identity/verification_sessions',
}),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/identity/verification_sessions/{session}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/identity/verification_sessions/{session}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/identity/verification_sessions',
methodType: 'list',
}),
cancel: stripeMethod({
method: 'POST',
fullPath: '/v1/identity/verification_sessions/{session}/cancel',
}),
redact: stripeMethod({
method: 'POST',
fullPath: '/v1/identity/verification_sessions/{session}/redact',
}),
});
@@ -0,0 +1,23 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const InvoiceItems = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/invoiceitems' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/invoiceitems/{invoiceitem}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/invoiceitems/{invoiceitem}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/invoiceitems',
methodType: 'list',
}),
del: stripeMethod({
method: 'DELETE',
fullPath: '/v1/invoiceitems/{invoiceitem}',
}),
});
@@ -0,0 +1,50 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Invoices = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/invoices' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/invoices/{invoice}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/invoices/{invoice}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/invoices',
methodType: 'list',
}),
del: stripeMethod({ method: 'DELETE', fullPath: '/v1/invoices/{invoice}' }),
finalizeInvoice: stripeMethod({
method: 'POST',
fullPath: '/v1/invoices/{invoice}/finalize',
}),
listLineItems: stripeMethod({
method: 'GET',
fullPath: '/v1/invoices/{invoice}/lines',
methodType: 'list',
}),
listUpcomingLines: stripeMethod({
method: 'GET',
fullPath: '/v1/invoices/upcoming/lines',
methodType: 'list',
}),
markUncollectible: stripeMethod({
method: 'POST',
fullPath: '/v1/invoices/{invoice}/mark_uncollectible',
}),
pay: stripeMethod({ method: 'POST', fullPath: '/v1/invoices/{invoice}/pay' }),
retrieveUpcoming: stripeMethod({
method: 'GET',
fullPath: '/v1/invoices/upcoming',
}),
search: stripeMethod({
method: 'GET',
fullPath: '/v1/invoices/search',
methodType: 'search',
}),
sendInvoice: stripeMethod({
method: 'POST',
fullPath: '/v1/invoices/{invoice}/send',
}),
voidInvoice: stripeMethod({
method: 'POST',
fullPath: '/v1/invoices/{invoice}/void',
}),
});
@@ -0,0 +1,26 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Authorizations = StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/issuing/authorizations/{authorization}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/issuing/authorizations/{authorization}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/issuing/authorizations',
methodType: 'list',
}),
approve: stripeMethod({
method: 'POST',
fullPath: '/v1/issuing/authorizations/{authorization}/approve',
}),
decline: stripeMethod({
method: 'POST',
fullPath: '/v1/issuing/authorizations/{authorization}/decline',
}),
});
@@ -0,0 +1,19 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Cardholders = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/issuing/cardholders' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/issuing/cardholders/{cardholder}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/issuing/cardholders/{cardholder}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/issuing/cardholders',
methodType: 'list',
}),
});
@@ -0,0 +1,13 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Cards = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/issuing/cards' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/issuing/cards/{card}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/issuing/cards/{card}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/issuing/cards',
methodType: 'list',
}),
});
@@ -0,0 +1,23 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Disputes = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/issuing/disputes' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/issuing/disputes/{dispute}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/issuing/disputes/{dispute}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/issuing/disputes',
methodType: 'list',
}),
submit: stripeMethod({
method: 'POST',
fullPath: '/v1/issuing/disputes/{dispute}/submit',
}),
});
@@ -0,0 +1,18 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Transactions = StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/issuing/transactions/{transaction}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/issuing/transactions/{transaction}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/issuing/transactions',
methodType: 'list',
}),
});
@@ -0,0 +1,6 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Mandates = StripeResource.extend({
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/mandates/{mandate}' }),
});
+42
View File
@@ -0,0 +1,42 @@
'use strict';
import { StripeResource } from '../StripeResource.js';
import { stringifyRequestData } from '../utils.js';
const stripeMethod = StripeResource.method;
const oAuthHost = 'connect.stripe.com';
export const OAuth = StripeResource.extend({
basePath: '/',
authorizeUrl(params, options) {
params = params || {};
options = options || {};
let path = 'oauth/authorize';
// For Express accounts, the path changes
if (options.express) {
path = `express/${path}`;
}
if (!params.response_type) {
params.response_type = 'code';
}
if (!params.client_id) {
params.client_id = this._stripe.getClientId();
}
if (!params.scope) {
params.scope = 'read_write';
}
return `https://${oAuthHost}/${path}?${stringifyRequestData(params)}`;
},
token: stripeMethod({
method: 'POST',
path: 'oauth/token',
host: oAuthHost,
}),
deauthorize(spec, ...args) {
if (!spec.client_id) {
spec.client_id = this._stripe.getClientId();
}
return stripeMethod({
method: 'POST',
path: 'oauth/deauthorize',
host: oAuthHost,
}).apply(this, [spec, ...args]);
},
});
@@ -0,0 +1,48 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const PaymentIntents = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/payment_intents' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/payment_intents/{intent}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/payment_intents/{intent}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/payment_intents',
methodType: 'list',
}),
applyCustomerBalance: stripeMethod({
method: 'POST',
fullPath: '/v1/payment_intents/{intent}/apply_customer_balance',
}),
cancel: stripeMethod({
method: 'POST',
fullPath: '/v1/payment_intents/{intent}/cancel',
}),
capture: stripeMethod({
method: 'POST',
fullPath: '/v1/payment_intents/{intent}/capture',
}),
confirm: stripeMethod({
method: 'POST',
fullPath: '/v1/payment_intents/{intent}/confirm',
}),
incrementAuthorization: stripeMethod({
method: 'POST',
fullPath: '/v1/payment_intents/{intent}/increment_authorization',
}),
search: stripeMethod({
method: 'GET',
fullPath: '/v1/payment_intents/search',
methodType: 'search',
}),
verifyMicrodeposits: stripeMethod({
method: 'POST',
fullPath: '/v1/payment_intents/{intent}/verify_microdeposits',
}),
});
@@ -0,0 +1,24 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const PaymentLinks = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/payment_links' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/payment_links/{payment_link}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/payment_links/{payment_link}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/payment_links',
methodType: 'list',
}),
listLineItems: stripeMethod({
method: 'GET',
fullPath: '/v1/payment_links/{payment_link}/line_items',
methodType: 'list',
}),
});
@@ -0,0 +1,27 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const PaymentMethods = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/payment_methods' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/payment_methods/{payment_method}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/payment_methods/{payment_method}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/payment_methods',
methodType: 'list',
}),
attach: stripeMethod({
method: 'POST',
fullPath: '/v1/payment_methods/{payment_method}/attach',
}),
detach: stripeMethod({
method: 'POST',
fullPath: '/v1/payment_methods/{payment_method}/detach',
}),
});
+21
View File
@@ -0,0 +1,21 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Payouts = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/payouts' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/payouts/{payout}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/payouts/{payout}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/payouts',
methodType: 'list',
}),
cancel: stripeMethod({
method: 'POST',
fullPath: '/v1/payouts/{payout}/cancel',
}),
reverse: stripeMethod({
method: 'POST',
fullPath: '/v1/payouts/{payout}/reverse',
}),
});
+14
View File
@@ -0,0 +1,14 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Plans = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/plans' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/plans/{plan}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/plans/{plan}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/plans',
methodType: 'list',
}),
del: stripeMethod({ method: 'DELETE', fullPath: '/v1/plans/{plan}' }),
});
+18
View File
@@ -0,0 +1,18 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Prices = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/prices' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/prices/{price}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/prices/{price}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/prices',
methodType: 'list',
}),
search: stripeMethod({
method: 'GET',
fullPath: '/v1/prices/search',
methodType: 'search',
}),
});
@@ -0,0 +1,19 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Products = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/products' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/products/{id}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/products/{id}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/products',
methodType: 'list',
}),
del: stripeMethod({ method: 'DELETE', fullPath: '/v1/products/{id}' }),
search: stripeMethod({
method: 'GET',
fullPath: '/v1/products/search',
methodType: 'search',
}),
});
@@ -0,0 +1,19 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const PromotionCodes = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/promotion_codes' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/promotion_codes/{promotion_code}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/promotion_codes/{promotion_code}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/promotion_codes',
methodType: 'list',
}),
});
+35
View File
@@ -0,0 +1,35 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Quotes = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/quotes' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/quotes/{quote}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/quotes/{quote}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/quotes',
methodType: 'list',
}),
accept: stripeMethod({ method: 'POST', fullPath: '/v1/quotes/{quote}/accept' }),
cancel: stripeMethod({ method: 'POST', fullPath: '/v1/quotes/{quote}/cancel' }),
finalizeQuote: stripeMethod({
method: 'POST',
fullPath: '/v1/quotes/{quote}/finalize',
}),
listComputedUpfrontLineItems: stripeMethod({
method: 'GET',
fullPath: '/v1/quotes/{quote}/computed_upfront_line_items',
methodType: 'list',
}),
listLineItems: stripeMethod({
method: 'GET',
fullPath: '/v1/quotes/{quote}/line_items',
methodType: 'list',
}),
pdf: stripeMethod({
method: 'GET',
fullPath: '/v1/quotes/{quote}/pdf',
host: 'files.stripe.com',
streaming: true,
}),
});
@@ -0,0 +1,14 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const EarlyFraudWarnings = StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/radar/early_fraud_warnings/{early_fraud_warning}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/radar/early_fraud_warnings',
methodType: 'list',
}),
});
@@ -0,0 +1,22 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const ValueListItems = StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/radar/value_list_items',
}),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/radar/value_list_items/{item}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/radar/value_list_items',
methodType: 'list',
}),
del: stripeMethod({
method: 'DELETE',
fullPath: '/v1/radar/value_list_items/{item}',
}),
});
@@ -0,0 +1,23 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const ValueLists = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/radar/value_lists' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/radar/value_lists/{value_list}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/radar/value_lists/{value_list}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/radar/value_lists',
methodType: 'list',
}),
del: stripeMethod({
method: 'DELETE',
fullPath: '/v1/radar/value_lists/{value_list}',
}),
});
+17
View File
@@ -0,0 +1,17 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Refunds = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/refunds' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/refunds/{refund}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/refunds/{refund}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/refunds',
methodType: 'list',
}),
cancel: stripeMethod({
method: 'POST',
fullPath: '/v1/refunds/{refund}/cancel',
}),
});
@@ -0,0 +1,15 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const ReportRuns = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/reporting/report_runs' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/reporting/report_runs/{report_run}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/reporting/report_runs',
methodType: 'list',
}),
});
@@ -0,0 +1,14 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const ReportTypes = StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/reporting/report_types/{report_type}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/reporting/report_types',
methodType: 'list',
}),
});
+15
View File
@@ -0,0 +1,15 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Reviews = StripeResource.extend({
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/reviews/{review}' }),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/reviews',
methodType: 'list',
}),
approve: stripeMethod({
method: 'POST',
fullPath: '/v1/reviews/{review}/approve',
}),
});
@@ -0,0 +1,10 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const SetupAttempts = StripeResource.extend({
list: stripeMethod({
method: 'GET',
fullPath: '/v1/setup_attempts',
methodType: 'list',
}),
});
@@ -0,0 +1,31 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const SetupIntents = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/setup_intents' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/setup_intents/{intent}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/setup_intents/{intent}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/setup_intents',
methodType: 'list',
}),
cancel: stripeMethod({
method: 'POST',
fullPath: '/v1/setup_intents/{intent}/cancel',
}),
confirm: stripeMethod({
method: 'POST',
fullPath: '/v1/setup_intents/{intent}/confirm',
}),
verifyMicrodeposits: stripeMethod({
method: 'POST',
fullPath: '/v1/setup_intents/{intent}/verify_microdeposits',
}),
});
@@ -0,0 +1,19 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const ShippingRates = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/shipping_rates' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/shipping_rates/{shipping_rate_token}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/shipping_rates/{shipping_rate_token}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/shipping_rates',
methodType: 'list',
}),
});
@@ -0,0 +1,14 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const ScheduledQueryRuns = StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/sigma/scheduled_query_runs/{scheduled_query_run}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/sigma/scheduled_query_runs',
methodType: 'list',
}),
});
+17
View File
@@ -0,0 +1,17 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Sources = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/sources' }),
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/sources/{source}' }),
update: stripeMethod({ method: 'POST', fullPath: '/v1/sources/{source}' }),
listSourceTransactions: stripeMethod({
method: 'GET',
fullPath: '/v1/sources/{source}/source_transactions',
methodType: 'list',
}),
verify: stripeMethod({
method: 'POST',
fullPath: '/v1/sources/{source}/verify',
}),
});
@@ -0,0 +1,32 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const SubscriptionItems = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/subscription_items' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/subscription_items/{item}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/subscription_items/{item}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/subscription_items',
methodType: 'list',
}),
del: stripeMethod({
method: 'DELETE',
fullPath: '/v1/subscription_items/{item}',
}),
createUsageRecord: stripeMethod({
method: 'POST',
fullPath: '/v1/subscription_items/{subscription_item}/usage_records',
}),
listUsageRecordSummaries: stripeMethod({
method: 'GET',
fullPath: '/v1/subscription_items/{subscription_item}/usage_record_summaries',
methodType: 'list',
}),
});
@@ -0,0 +1,30 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const SubscriptionSchedules = StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/subscription_schedules',
}),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/subscription_schedules/{schedule}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/subscription_schedules/{schedule}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/subscription_schedules',
methodType: 'list',
}),
cancel: stripeMethod({
method: 'POST',
fullPath: '/v1/subscription_schedules/{schedule}/cancel',
}),
release: stripeMethod({
method: 'POST',
fullPath: '/v1/subscription_schedules/{schedule}/release',
}),
});
@@ -0,0 +1,40 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Subscriptions = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/subscriptions' }),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/subscriptions/{subscription_exposed_id}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/subscriptions/{subscription_exposed_id}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/subscriptions',
methodType: 'list',
}),
cancel: stripeMethod({
method: 'DELETE',
fullPath: '/v1/subscriptions/{subscription_exposed_id}',
}),
del: stripeMethod({
method: 'DELETE',
fullPath: '/v1/subscriptions/{subscription_exposed_id}',
}),
deleteDiscount: stripeMethod({
method: 'DELETE',
fullPath: '/v1/subscriptions/{subscription_exposed_id}/discount',
}),
resume: stripeMethod({
method: 'POST',
fullPath: '/v1/subscriptions/{subscription}/resume',
}),
search: stripeMethod({
method: 'GET',
fullPath: '/v1/subscriptions/search',
methodType: 'search',
}),
});
@@ -0,0 +1,11 @@
// File generated from our OpenAPI spec
import { StripeResource } from '../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Calculations = StripeResource.extend({
create: stripeMethod({ method: 'POST', fullPath: '/v1/tax/calculations' }),
listLineItems: stripeMethod({
method: 'GET',
fullPath: '/v1/tax/calculations/{calculation}/line_items',
methodType: 'list',
}),
});

Some files were not shown because too many files have changed in this diff Show More