stripe 20.2.0-alpha.1 → 20.2.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (261) hide show
  1. package/CHANGELOG.md +45 -460
  2. package/OPENAPI_VERSION +1 -1
  3. package/VERSION +1 -1
  4. package/cjs/Error.js +1 -9
  5. package/cjs/StripeEventNotificationHandler.js +118 -0
  6. package/cjs/resources/PaymentMethods.js +0 -4
  7. package/cjs/resources/Reserve/Holds.js +14 -0
  8. package/cjs/resources/{ProductCatalog/TrialOffers.js → Reserve/Plans.js} +3 -6
  9. package/cjs/resources/{SharedPayment/GrantedTokens.js → Reserve/Releases.js} +8 -3
  10. package/cjs/resources.js +11 -77
  11. package/cjs/stripe.core.js +5 -1
  12. package/esm/Error.js +0 -7
  13. package/esm/StripeEventNotificationHandler.js +114 -0
  14. package/esm/resources/PaymentMethods.js +0 -4
  15. package/esm/resources/Reserve/Holds.js +11 -0
  16. package/esm/resources/Reserve/Plans.js +6 -0
  17. package/esm/resources/Reserve/Releases.js +14 -0
  18. package/esm/resources.js +7 -72
  19. package/esm/stripe.core.js +5 -1
  20. package/package.json +1 -1
  21. package/types/AccountSessions.d.ts +0 -18
  22. package/types/AccountSessionsResource.d.ts +0 -21
  23. package/types/AccountsResource.d.ts +12 -136
  24. package/types/ApplicationFees.d.ts +1 -6
  25. package/types/Balance.d.ts +0 -82
  26. package/types/BalanceTransactions.d.ts +1 -2
  27. package/types/Billing/AlertTriggereds.d.ts +0 -15
  28. package/types/Billing/Alerts.d.ts +1 -116
  29. package/types/Billing/AlertsResource.d.ts +2 -149
  30. package/types/Billing/Analytics/MeterUsageResource.d.ts +0 -5
  31. package/types/Billing/Analytics/MeterUsageRows.d.ts +0 -7
  32. package/types/Billing/CreditBalanceSummary.d.ts +2 -118
  33. package/types/Billing/CreditBalanceSummaryResource.d.ts +0 -12
  34. package/types/Billing/CreditBalanceTransactions.d.ts +2 -118
  35. package/types/Billing/CreditGrants.d.ts +1 -71
  36. package/types/Billing/CreditGrantsResource.d.ts +1 -32
  37. package/types/Billing/MeterEventSummaries.d.ts +0 -7
  38. package/types/Billing/Meters.d.ts +0 -5
  39. package/types/Billing/MetersResource.d.ts +0 -17
  40. package/types/Cards.d.ts +0 -14
  41. package/types/Charges.d.ts +0 -14
  42. package/types/Checkout/Sessions.d.ts +0 -58
  43. package/types/Checkout/SessionsResource.d.ts +0 -78
  44. package/types/ConfirmationTokens.d.ts +0 -14
  45. package/types/Discounts.d.ts +0 -10
  46. package/types/Errors.d.ts +0 -6
  47. package/types/Identity/VerificationReports.d.ts +0 -10
  48. package/types/Identity/VerificationReportsResource.d.ts +0 -5
  49. package/types/InvoiceItems.d.ts +3 -118
  50. package/types/InvoiceLineItems.d.ts +8 -127
  51. package/types/Invoices.d.ts +0 -13
  52. package/types/InvoicesResource.d.ts +0 -201
  53. package/types/Issuing/Cards.d.ts +0 -10
  54. package/types/Issuing/CardsResource.d.ts +0 -33
  55. package/types/PaymentIntents.d.ts +1 -45
  56. package/types/PaymentIntentsResource.d.ts +5 -126
  57. package/types/PaymentLinksResource.d.ts +0 -14
  58. package/types/PaymentMethods.d.ts +0 -14
  59. package/types/PaymentMethodsResource.d.ts +0 -20
  60. package/types/Persons.d.ts +0 -28
  61. package/types/ProductsResource.d.ts +0 -24
  62. package/types/QuoteLines.d.ts +0 -17
  63. package/types/QuotePreviewInvoices.d.ts +0 -13
  64. package/types/QuotePreviewSubscriptionSchedules.d.ts +0 -126
  65. package/types/Quotes.d.ts +0 -282
  66. package/types/QuotesResource.d.ts +44 -662
  67. package/types/Reserve/Holds.d.ts +104 -0
  68. package/types/Reserve/HoldsResource.d.ts +76 -0
  69. package/types/Reserve/Plans.d.ts +103 -0
  70. package/types/{SharedPayment/GrantedTokensResource.d.ts → Reserve/PlansResource.d.ts} +7 -7
  71. package/types/Reserve/Releases.d.ts +105 -0
  72. package/types/Reserve/ReleasesResource.d.ts +60 -0
  73. package/types/SetupIntents.d.ts +0 -21
  74. package/types/SetupIntentsResource.d.ts +0 -90
  75. package/types/SubscriptionItems.d.ts +0 -13
  76. package/types/SubscriptionItemsResource.d.ts +0 -34
  77. package/types/SubscriptionSchedules.d.ts +0 -124
  78. package/types/SubscriptionSchedulesResource.d.ts +0 -238
  79. package/types/Subscriptions.d.ts +0 -22
  80. package/types/SubscriptionsResource.d.ts +0 -34
  81. package/types/TokensResource.d.ts +0 -68
  82. package/types/Transfers.d.ts +0 -4
  83. package/types/TransfersResource.d.ts +0 -2
  84. package/types/V2/Billing/Cadences.d.ts +0 -45
  85. package/types/V2/Billing/CadencesResource.d.ts +3 -32
  86. package/types/V2/Core/AccountTokensResource.d.ts +0 -245
  87. package/types/V2/Core/Accounts.d.ts +1 -1473
  88. package/types/V2/Core/AccountsResource.d.ts +0 -1644
  89. package/types/V2/Core/EventTypes.d.ts +702 -4551
  90. package/types/V2/Core/Events.d.ts +0 -61
  91. package/types/V2/Core/EventsResource.d.ts +1 -11
  92. package/types/V2/Core/Vault/GbBankAccounts.d.ts +0 -21
  93. package/types/V2/Core/Vault/UsBankAccounts.d.ts +0 -21
  94. package/types/V2/EventMisc.d.ts +37 -0
  95. package/types/V2/MoneyManagement/FinancialAccounts.d.ts +1 -31
  96. package/types/V2/MoneyManagement/FinancialAccountsResource.d.ts +0 -7
  97. package/types/V2/MoneyManagement/FinancialAddresses.d.ts +1 -4
  98. package/types/V2/MoneyManagement/FinancialAddressesResource.d.ts +1 -18
  99. package/types/V2/MoneyManagement/OutboundPaymentQuotes.d.ts +0 -8
  100. package/types/V2/MoneyManagement/OutboundPaymentQuotesResource.d.ts +0 -7
  101. package/types/V2/MoneyManagement/OutboundPayments.d.ts +0 -12
  102. package/types/V2/MoneyManagement/OutboundPaymentsResource.d.ts +0 -12
  103. package/types/V2/MoneyManagement/OutboundSetupIntentsResource.d.ts +0 -34
  104. package/types/V2/MoneyManagement/OutboundTransfers.d.ts +0 -5
  105. package/types/V2/MoneyManagement/OutboundTransfersResource.d.ts +0 -5
  106. package/types/V2/MoneyManagement/PayoutMethods.d.ts +0 -62
  107. package/types/V2/MoneyManagement/ReceivedCredits.d.ts +1 -34
  108. package/types/V2/MoneyManagement/ReceivedDebits.d.ts +1 -61
  109. package/types/V2/TestHelpers/FinancialAddressesResource.d.ts +1 -6
  110. package/types/WebhookEndpointsResource.d.ts +2 -1
  111. package/types/Webhooks.d.ts +0 -2
  112. package/types/index.d.ts +25 -122
  113. package/types/test/typescriptTest.ts +27 -0
  114. package/cjs/resources/BalanceTransfers.js +0 -9
  115. package/cjs/resources/DelegatedCheckout/RequestedSessions.js +0 -28
  116. package/cjs/resources/Identity/BlocklistEntries.js +0 -25
  117. package/cjs/resources/Issuing/Programs.js +0 -22
  118. package/cjs/resources/Radar/AccountEvaluations.js +0 -20
  119. package/cjs/resources/TestHelpers/Capital/FinancingOffers.js +0 -16
  120. package/cjs/resources/TestHelpers/SharedPayment/GrantedTokens.js +0 -16
  121. package/cjs/resources/V2/Billing/CustomPricingUnits.js +0 -25
  122. package/cjs/resources/V2/Billing/Intents/Actions.js +0 -17
  123. package/cjs/resources/V2/Billing/Intents.js +0 -36
  124. package/cjs/resources/V2/Billing/LicenseFeeSubscriptions.js +0 -12
  125. package/cjs/resources/V2/Billing/LicenseFees/Versions.js +0 -17
  126. package/cjs/resources/V2/Billing/LicenseFees.js +0 -27
  127. package/cjs/resources/V2/Billing/LicensedItems.js +0 -25
  128. package/cjs/resources/V2/Billing/MeteredItems.js +0 -22
  129. package/cjs/resources/V2/Billing/PricingPlanSubscriptions/Components.js +0 -12
  130. package/cjs/resources/V2/Billing/PricingPlanSubscriptions.js +0 -26
  131. package/cjs/resources/V2/Billing/PricingPlans/Components.js +0 -29
  132. package/cjs/resources/V2/Billing/PricingPlans/Versions.js +0 -17
  133. package/cjs/resources/V2/Billing/PricingPlans.js +0 -29
  134. package/cjs/resources/V2/Billing/RateCardSubscriptions.js +0 -29
  135. package/cjs/resources/V2/Billing/RateCards/Rates.js +0 -25
  136. package/cjs/resources/V2/Billing/RateCards/Versions.js +0 -17
  137. package/cjs/resources/V2/Billing/RateCards.js +0 -29
  138. package/cjs/resources/V2/Billing/ServiceActions.js +0 -20
  139. package/cjs/resources/V2/Core/ClaimableSandboxes.js +0 -16
  140. package/cjs/resources/V2/Iam/ApiKeys.js +0 -24
  141. package/cjs/resources/V2/MoneyManagement/CurrencyConversions.js +0 -21
  142. package/cjs/resources/V2/MoneyManagement/RecipientVerifications.js +0 -20
  143. package/cjs/resources/V2/Payments/OffSessionPayments.js +0 -29
  144. package/cjs/resources/V2/Payments/SettlementAllocationIntents/Splits.js +0 -20
  145. package/cjs/resources/V2/Payments/SettlementAllocationIntents.js +0 -33
  146. package/cjs/resources/V2/Reporting/ReportRuns.js +0 -13
  147. package/cjs/resources/V2/Reporting/Reports.js +0 -12
  148. package/cjs/resources/V2/Tax/ManualRules.js +0 -23
  149. package/cjs/resources/V2/TestHelpers/MoneyManagement.js +0 -12
  150. package/esm/resources/BalanceTransfers.js +0 -6
  151. package/esm/resources/DelegatedCheckout/RequestedSessions.js +0 -25
  152. package/esm/resources/Identity/BlocklistEntries.js +0 -22
  153. package/esm/resources/Issuing/Programs.js +0 -19
  154. package/esm/resources/ProductCatalog/TrialOffers.js +0 -9
  155. package/esm/resources/Radar/AccountEvaluations.js +0 -17
  156. package/esm/resources/SharedPayment/GrantedTokens.js +0 -9
  157. package/esm/resources/TestHelpers/Capital/FinancingOffers.js +0 -13
  158. package/esm/resources/TestHelpers/SharedPayment/GrantedTokens.js +0 -13
  159. package/esm/resources/V2/Billing/CustomPricingUnits.js +0 -22
  160. package/esm/resources/V2/Billing/Intents/Actions.js +0 -14
  161. package/esm/resources/V2/Billing/Intents.js +0 -33
  162. package/esm/resources/V2/Billing/LicenseFeeSubscriptions.js +0 -9
  163. package/esm/resources/V2/Billing/LicenseFees/Versions.js +0 -14
  164. package/esm/resources/V2/Billing/LicenseFees.js +0 -24
  165. package/esm/resources/V2/Billing/LicensedItems.js +0 -22
  166. package/esm/resources/V2/Billing/MeteredItems.js +0 -19
  167. package/esm/resources/V2/Billing/PricingPlanSubscriptions/Components.js +0 -9
  168. package/esm/resources/V2/Billing/PricingPlanSubscriptions.js +0 -23
  169. package/esm/resources/V2/Billing/PricingPlans/Components.js +0 -26
  170. package/esm/resources/V2/Billing/PricingPlans/Versions.js +0 -14
  171. package/esm/resources/V2/Billing/PricingPlans.js +0 -26
  172. package/esm/resources/V2/Billing/RateCardSubscriptions.js +0 -26
  173. package/esm/resources/V2/Billing/RateCards/Rates.js +0 -22
  174. package/esm/resources/V2/Billing/RateCards/Versions.js +0 -14
  175. package/esm/resources/V2/Billing/RateCards.js +0 -26
  176. package/esm/resources/V2/Billing/ServiceActions.js +0 -17
  177. package/esm/resources/V2/Core/ClaimableSandboxes.js +0 -13
  178. package/esm/resources/V2/Iam/ApiKeys.js +0 -21
  179. package/esm/resources/V2/MoneyManagement/CurrencyConversions.js +0 -18
  180. package/esm/resources/V2/MoneyManagement/RecipientVerifications.js +0 -17
  181. package/esm/resources/V2/Payments/OffSessionPayments.js +0 -26
  182. package/esm/resources/V2/Payments/SettlementAllocationIntents/Splits.js +0 -17
  183. package/esm/resources/V2/Payments/SettlementAllocationIntents.js +0 -30
  184. package/esm/resources/V2/Reporting/ReportRuns.js +0 -10
  185. package/esm/resources/V2/Reporting/Reports.js +0 -9
  186. package/esm/resources/V2/Tax/ManualRules.js +0 -20
  187. package/esm/resources/V2/TestHelpers/MoneyManagement.js +0 -9
  188. package/types/BalanceTransfers.d.ts +0 -122
  189. package/types/BalanceTransfersResource.d.ts +0 -87
  190. package/types/DelegatedCheckout/RequestedSessions.d.ts +0 -465
  191. package/types/DelegatedCheckout/RequestedSessionsResource.d.ts +0 -701
  192. package/types/Identity/BlocklistEntries.d.ts +0 -78
  193. package/types/Identity/BlocklistEntriesResource.d.ts +0 -146
  194. package/types/Issuing/Programs.d.ts +0 -42
  195. package/types/Issuing/ProgramsResource.d.ts +0 -96
  196. package/types/PaymentMethodBalances.d.ts +0 -63
  197. package/types/ProductCatalog/TrialOffers.d.ts +0 -77
  198. package/types/ProductCatalog/TrialOffersResource.d.ts +0 -80
  199. package/types/Radar/AccountEvaluations.d.ts +0 -88
  200. package/types/Radar/AccountEvaluationsResource.d.ts +0 -148
  201. package/types/SharedPayment/GrantedTokens.d.ts +0 -102
  202. package/types/TestHelpers/Capital/FinancingOffersResource.d.ts +0 -130
  203. package/types/TestHelpers/SharedPayment/GrantedTokensResource.d.ts +0 -87
  204. package/types/TransitBalances.d.ts +0 -40
  205. package/types/V2/Billing/CustomPricingUnits.d.ts +0 -56
  206. package/types/V2/Billing/CustomPricingUnitsResource.d.ts +0 -122
  207. package/types/V2/Billing/IntentActions.d.ts +0 -564
  208. package/types/V2/Billing/Intents/ActionsResource.d.ts +0 -58
  209. package/types/V2/Billing/Intents.d.ts +0 -117
  210. package/types/V2/Billing/IntentsResource.d.ts +0 -674
  211. package/types/V2/Billing/LicenseFeeSubscriptions.d.ts +0 -64
  212. package/types/V2/Billing/LicenseFeeSubscriptionsResource.d.ts +0 -28
  213. package/types/V2/Billing/LicenseFeeVersions.d.ts +0 -106
  214. package/types/V2/Billing/LicenseFees/VersionsResource.d.ts +0 -58
  215. package/types/V2/Billing/LicenseFees.d.ts +0 -164
  216. package/types/V2/Billing/LicenseFeesResource.d.ts +0 -290
  217. package/types/V2/Billing/LicensedItems.d.ts +0 -73
  218. package/types/V2/Billing/LicensedItemsResource.d.ts +0 -157
  219. package/types/V2/Billing/MeteredItems.d.ts +0 -101
  220. package/types/V2/Billing/MeteredItemsResource.d.ts +0 -189
  221. package/types/V2/Billing/PricingPlanComponents.d.ts +0 -109
  222. package/types/V2/Billing/PricingPlanSubscriptionComponents.d.ts +0 -57
  223. package/types/V2/Billing/PricingPlanSubscriptions/ComponentsResource.d.ts +0 -40
  224. package/types/V2/Billing/PricingPlanSubscriptions.d.ts +0 -144
  225. package/types/V2/Billing/PricingPlanSubscriptionsResource.d.ts +0 -120
  226. package/types/V2/Billing/PricingPlanVersions.d.ts +0 -49
  227. package/types/V2/Billing/PricingPlans/ComponentsResource.d.ts +0 -197
  228. package/types/V2/Billing/PricingPlans/VersionsResource.d.ts +0 -58
  229. package/types/V2/Billing/PricingPlans.d.ts +0 -84
  230. package/types/V2/Billing/PricingPlansResource.d.ts +0 -151
  231. package/types/V2/Billing/RateCardRates.d.ts +0 -144
  232. package/types/V2/Billing/RateCardSubscriptions.d.ts +0 -144
  233. package/types/V2/Billing/RateCardSubscriptionsResource.d.ts +0 -157
  234. package/types/V2/Billing/RateCardVersions.d.ts +0 -39
  235. package/types/V2/Billing/RateCards/RatesResource.d.ts +0 -203
  236. package/types/V2/Billing/RateCards/VersionsResource.d.ts +0 -58
  237. package/types/V2/Billing/RateCards.d.ts +0 -98
  238. package/types/V2/Billing/RateCardsResource.d.ts +0 -162
  239. package/types/V2/Billing/ServiceActions.d.ts +0 -298
  240. package/types/V2/Billing/ServiceActionsResource.d.ts +0 -394
  241. package/types/V2/Core/ClaimableSandboxes.d.ts +0 -132
  242. package/types/V2/Core/ClaimableSandboxesResource.d.ts +0 -74
  243. package/types/V2/Iam/ApiKeys.d.ts +0 -154
  244. package/types/V2/Iam/ApiKeysResource.d.ts +0 -215
  245. package/types/V2/MoneyManagement/CurrencyConversions.d.ts +0 -98
  246. package/types/V2/MoneyManagement/CurrencyConversionsResource.d.ts +0 -141
  247. package/types/V2/MoneyManagement/RecipientVerifications.d.ts +0 -112
  248. package/types/V2/MoneyManagement/RecipientVerificationsResource.d.ts +0 -77
  249. package/types/V2/Payments/OffSessionPayments.d.ts +0 -249
  250. package/types/V2/Payments/OffSessionPaymentsResource.d.ts +0 -306
  251. package/types/V2/Payments/SettlementAllocationIntentSplits.d.ts +0 -111
  252. package/types/V2/Payments/SettlementAllocationIntents/SplitsResource.d.ts +0 -126
  253. package/types/V2/Payments/SettlementAllocationIntents.d.ts +0 -122
  254. package/types/V2/Payments/SettlementAllocationIntentsResource.d.ts +0 -168
  255. package/types/V2/Reporting/ReportRuns.d.ts +0 -154
  256. package/types/V2/Reporting/ReportRunsResource.d.ts +0 -75
  257. package/types/V2/Reporting/Reports.d.ts +0 -120
  258. package/types/V2/Reporting/ReportsResource.d.ts +0 -30
  259. package/types/V2/Tax/ManualRules.d.ts +0 -142
  260. package/types/V2/Tax/ManualRulesResource.d.ts +0 -292
  261. package/types/V2/TestHelpers/MoneyManagementResource.d.ts +0 -49
package/OPENAPI_VERSION CHANGED
@@ -1 +1 @@
1
- v2141
1
+ v2143
package/VERSION CHANGED
@@ -1 +1 @@
1
- 20.2.0-alpha.1
1
+ 20.2.0-beta.1
package/cjs/Error.js CHANGED
@@ -2,7 +2,7 @@
2
2
  /* eslint-disable camelcase */
3
3
  /* eslint-disable no-warning-comments */
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.TemporarySessionExpiredError = exports.RecipientNotNotifiableError = exports.RateLimitError = exports.QuotaExceededError = exports.NotCancelableError = exports.NonZeroBalanceError = exports.InvalidPayoutMethodError = exports.InvalidPaymentMethodError = exports.InsufficientFundsError = exports.FinancialAccountNotOpenError = exports.FeatureNotEnabledError = exports.ControlledByDashboardError = exports.ControlledByAlternateResourceError = exports.BlockedByStripeError = exports.AlreadyExistsError = exports.AlreadyCanceledError = 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.generateV2Error = exports.generateV1Error = void 0;
5
+ exports.TemporarySessionExpiredError = exports.RecipientNotNotifiableError = exports.QuotaExceededError = exports.NotCancelableError = exports.NonZeroBalanceError = exports.InvalidPayoutMethodError = exports.InvalidPaymentMethodError = exports.InsufficientFundsError = exports.FinancialAccountNotOpenError = exports.FeatureNotEnabledError = exports.ControlledByDashboardError = exports.ControlledByAlternateResourceError = exports.BlockedByStripeError = exports.AlreadyExistsError = exports.AlreadyCanceledError = 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.generateV2Error = exports.generateV1Error = void 0;
6
6
  const generateV1Error = (rawStripeError) => {
7
7
  switch (rawStripeError.type) {
8
8
  case 'card_error':
@@ -54,8 +54,6 @@ const generateV2Error = (rawStripeError) => {
54
54
  return new NotCancelableError(rawStripeError);
55
55
  case 'quota_exceeded':
56
56
  return new QuotaExceededError(rawStripeError);
57
- case 'rate_limit':
58
- return new RateLimitError(rawStripeError);
59
57
  case 'recipient_not_notifiable':
60
58
  return new RecipientNotNotifiableError(rawStripeError);
61
59
  case 'temporary_session_expired':
@@ -304,12 +302,6 @@ class QuotaExceededError extends StripeError {
304
302
  }
305
303
  }
306
304
  exports.QuotaExceededError = QuotaExceededError;
307
- class RateLimitError extends StripeError {
308
- constructor(rawStripeError = {}) {
309
- super(rawStripeError, 'RateLimitError');
310
- }
311
- }
312
- exports.RateLimitError = RateLimitError;
313
305
  class RecipientNotNotifiableError extends StripeError {
314
306
  constructor(rawStripeError = {}) {
315
307
  super(rawStripeError, 'RecipientNotNotifiableError');
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StripeEventNotificationHandler = void 0;
4
+ // most languages can check if we have an UnknownEventNotification at runtime
5
+ // but JS only has interfaces so we fall back to a string match to determine known events
6
+ const KNOWN_EVENT_TYPES = new Set([
7
+ // event-types: The beginning of the section generated from our OpenAPI spec
8
+ 'v1.billing.meter.error_report_triggered',
9
+ 'v1.billing.meter.no_meter_found',
10
+ 'v2.core.account.closed',
11
+ 'v2.core.account.created',
12
+ 'v2.core.account.updated',
13
+ 'v2.core.account[configuration.customer].capability_status_updated',
14
+ 'v2.core.account[configuration.customer].updated',
15
+ 'v2.core.account[configuration.merchant].capability_status_updated',
16
+ 'v2.core.account[configuration.merchant].updated',
17
+ 'v2.core.account[configuration.recipient].capability_status_updated',
18
+ 'v2.core.account[configuration.recipient].updated',
19
+ 'v2.core.account[configuration.storer].capability_status_updated',
20
+ 'v2.core.account[configuration.storer].updated',
21
+ 'v2.core.account[defaults].updated',
22
+ 'v2.core.account[identity].updated',
23
+ 'v2.core.account[requirements].updated',
24
+ 'v2.core.account_link.returned',
25
+ 'v2.core.account_person.created',
26
+ 'v2.core.account_person.deleted',
27
+ 'v2.core.account_person.updated',
28
+ 'v2.core.event_destination.ping',
29
+ 'v2.core.health.event_generation_failure.resolved',
30
+ 'v2.money_management.adjustment.created',
31
+ 'v2.money_management.financial_account.created',
32
+ 'v2.money_management.financial_account.updated',
33
+ 'v2.money_management.financial_address.activated',
34
+ 'v2.money_management.financial_address.failed',
35
+ 'v2.money_management.inbound_transfer.available',
36
+ 'v2.money_management.inbound_transfer.bank_debit_failed',
37
+ 'v2.money_management.inbound_transfer.bank_debit_processing',
38
+ 'v2.money_management.inbound_transfer.bank_debit_queued',
39
+ 'v2.money_management.inbound_transfer.bank_debit_returned',
40
+ 'v2.money_management.inbound_transfer.bank_debit_succeeded',
41
+ 'v2.money_management.outbound_payment.canceled',
42
+ 'v2.money_management.outbound_payment.created',
43
+ 'v2.money_management.outbound_payment.failed',
44
+ 'v2.money_management.outbound_payment.posted',
45
+ 'v2.money_management.outbound_payment.returned',
46
+ 'v2.money_management.outbound_payment.updated',
47
+ 'v2.money_management.outbound_transfer.canceled',
48
+ 'v2.money_management.outbound_transfer.created',
49
+ 'v2.money_management.outbound_transfer.failed',
50
+ 'v2.money_management.outbound_transfer.posted',
51
+ 'v2.money_management.outbound_transfer.returned',
52
+ 'v2.money_management.outbound_transfer.updated',
53
+ 'v2.money_management.payout_method.created',
54
+ 'v2.money_management.payout_method.updated',
55
+ 'v2.money_management.received_credit.available',
56
+ 'v2.money_management.received_credit.failed',
57
+ 'v2.money_management.received_credit.returned',
58
+ 'v2.money_management.received_credit.succeeded',
59
+ 'v2.money_management.received_debit.canceled',
60
+ 'v2.money_management.received_debit.failed',
61
+ 'v2.money_management.received_debit.pending',
62
+ 'v2.money_management.received_debit.succeeded',
63
+ 'v2.money_management.received_debit.updated',
64
+ 'v2.money_management.transaction.created',
65
+ 'v2.money_management.transaction.updated',
66
+ // event-types: The end of the section generated from our OpenAPI spec
67
+ ]);
68
+ class StripeEventNotificationHandler {
69
+ // eslint-disable-next-line no-useless-constructor
70
+ constructor(client, webhookSecret, fallbackCallback) {
71
+ this.client = client;
72
+ this.webhookSecret = webhookSecret;
73
+ this.fallbackCallback = fallbackCallback;
74
+ this.registeredHandlers = {};
75
+ this.hasHandledEvent = false;
76
+ }
77
+ // these types are duplicated in the manual types
78
+ on(type, callback) {
79
+ if (this.hasHandledEvent) {
80
+ throw new Error('Cannot register new handlers after an event has been handled. This is indicative of a bug.');
81
+ }
82
+ // the matched types are validated by the type system
83
+ if (this.registeredHandlers[type]) {
84
+ throw new Error(`Handler already registered for event type: ${type}`);
85
+ }
86
+ this.registeredHandlers[type] = callback;
87
+ return this;
88
+ }
89
+ registeredEventTypes() {
90
+ const keys = Object.keys(this.registeredHandlers);
91
+ keys.sort();
92
+ return keys;
93
+ }
94
+ async handle(
95
+ // these types are duplicated in the manual types, so they're just here for internal use
96
+ rawBody, signature) {
97
+ // we're not worried about thread safety here because we expect callbacks will be registered synchronously on app startup
98
+ this.hasHandledEvent = true;
99
+ const event = this.client.parseEventNotification(rawBody, signature, this.webhookSecret);
100
+ // Create a new client with the event's context instead of modifying the shared client
101
+ // This ensures thread-safety when processing webhooks in parallel
102
+ // We create a shallow copy and override _api with a new object containing the event context
103
+ // This reuses expensive resources like httpClient (Flyweight pattern)
104
+ const eventClient = Object.create(Object.getPrototypeOf(this.client));
105
+ Object.assign(eventClient, this.client);
106
+ eventClient._api = Object.assign(Object.assign({}, this.client._api), { stripeContext: event.context });
107
+ const handler = this.registeredHandlers[event.type];
108
+ if (handler) {
109
+ return await handler(event, eventClient);
110
+ }
111
+ else {
112
+ return await this.fallbackCallback(event, eventClient, {
113
+ isKnownEventType: KNOWN_EVENT_TYPES.has(event.type),
114
+ });
115
+ }
116
+ }
117
+ }
118
+ exports.StripeEventNotificationHandler = StripeEventNotificationHandler;
@@ -23,10 +23,6 @@ exports.PaymentMethods = StripeResource_js_1.StripeResource.extend({
23
23
  method: 'POST',
24
24
  fullPath: '/v1/payment_methods/{payment_method}/attach',
25
25
  }),
26
- checkBalance: stripeMethod({
27
- method: 'POST',
28
- fullPath: '/v1/payment_methods/{payment_method}/check_balance',
29
- }),
30
26
  detach: stripeMethod({
31
27
  method: 'POST',
32
28
  fullPath: '/v1/payment_methods/{payment_method}/detach',
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Holds = void 0;
5
+ const StripeResource_js_1 = require("../../StripeResource.js");
6
+ const stripeMethod = StripeResource_js_1.StripeResource.method;
7
+ exports.Holds = StripeResource_js_1.StripeResource.extend({
8
+ retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/reserve/holds/{id}' }),
9
+ list: stripeMethod({
10
+ method: 'GET',
11
+ fullPath: '/v1/reserve/holds',
12
+ methodType: 'list',
13
+ }),
14
+ });
@@ -1,12 +1,9 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.TrialOffers = void 0;
4
+ exports.Plans = void 0;
5
5
  const StripeResource_js_1 = require("../../StripeResource.js");
6
6
  const stripeMethod = StripeResource_js_1.StripeResource.method;
7
- exports.TrialOffers = StripeResource_js_1.StripeResource.extend({
8
- create: stripeMethod({
9
- method: 'POST',
10
- fullPath: '/v1/product_catalog/trial_offers',
11
- }),
7
+ exports.Plans = StripeResource_js_1.StripeResource.extend({
8
+ retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/reserve/plans/{id}' }),
12
9
  });
@@ -1,12 +1,17 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.GrantedTokens = void 0;
4
+ exports.Releases = void 0;
5
5
  const StripeResource_js_1 = require("../../StripeResource.js");
6
6
  const stripeMethod = StripeResource_js_1.StripeResource.method;
7
- exports.GrantedTokens = StripeResource_js_1.StripeResource.extend({
7
+ exports.Releases = StripeResource_js_1.StripeResource.extend({
8
8
  retrieve: stripeMethod({
9
9
  method: 'GET',
10
- fullPath: '/v1/shared_payment/granted_tokens/{shared_payment_granted_token}',
10
+ fullPath: '/v1/reserve/releases/{id}',
11
+ }),
12
+ list: stripeMethod({
13
+ method: 'GET',
14
+ fullPath: '/v1/reserve/releases',
15
+ methodType: 'list',
11
16
  }),
12
17
  });
package/cjs/resources.js CHANGED
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.SetupAttempts = exports.Reviews = exports.Refunds = exports.Quotes = exports.PromotionCodes = exports.Products = exports.Prices = exports.Plans = exports.Payouts = exports.PaymentRecords = exports.PaymentMethods = exports.PaymentMethodDomains = exports.PaymentMethodConfigurations = exports.PaymentLinks = exports.PaymentIntents = exports.PaymentAttemptRecords = exports.Orders = exports.OAuth = exports.Margins = exports.Mandates = exports.Invoices = exports.InvoiceRenderingTemplates = exports.InvoicePayments = exports.InvoiceItems = exports.FxQuotes = exports.Files = exports.FileLinks = exports.ExternalAccounts = exports.ExchangeRates = exports.Events = exports.EphemeralKeys = exports.Disputes = exports.Customers = exports.CustomerSessions = exports.CreditNotes = exports.Coupons = exports.CountrySpecs = exports.ConfirmationTokens = exports.Charges = exports.BalanceTransfers = exports.BalanceTransactions = exports.BalanceSettings = exports.Balance = exports.ApplicationFees = exports.ApplePayDomains = exports.Accounts = exports.AccountSessions = exports.AccountNotices = exports.AccountLinks = exports.Account = void 0;
5
- exports.V2 = exports.Treasury = exports.TestHelpers = exports.Terminal = exports.Tax = exports.Sigma = exports.SharedPayment = exports.Reporting = exports.Radar = exports.ProductCatalog = exports.Privacy = exports.Issuing = exports.Identity = exports.Forwarding = exports.FinancialConnections = exports.Entitlements = exports.DelegatedCheckout = exports.Climate = exports.Checkout = exports.Capital = exports.BillingPortal = exports.Billing = exports.Apps = exports.WebhookEndpoints = exports.Transfers = exports.Topups = exports.Tokens = exports.TaxRates = exports.TaxIds = exports.TaxCodes = exports.Subscriptions = exports.SubscriptionSchedules = exports.SubscriptionItems = exports.Sources = exports.ShippingRates = exports.SetupIntents = void 0;
4
+ exports.SetupIntents = exports.SetupAttempts = exports.Reviews = exports.Refunds = exports.Quotes = exports.PromotionCodes = exports.Products = exports.Prices = exports.Plans = exports.Payouts = exports.PaymentRecords = exports.PaymentMethods = exports.PaymentMethodDomains = exports.PaymentMethodConfigurations = exports.PaymentLinks = exports.PaymentIntents = exports.PaymentAttemptRecords = exports.Orders = exports.OAuth = exports.Margins = exports.Mandates = exports.Invoices = exports.InvoiceRenderingTemplates = exports.InvoicePayments = exports.InvoiceItems = exports.FxQuotes = exports.Files = exports.FileLinks = exports.ExternalAccounts = exports.ExchangeRates = exports.Events = exports.EphemeralKeys = exports.Disputes = exports.Customers = exports.CustomerSessions = exports.CreditNotes = exports.Coupons = exports.CountrySpecs = exports.ConfirmationTokens = exports.Charges = exports.BalanceTransactions = exports.BalanceSettings = exports.Balance = exports.ApplicationFees = exports.ApplePayDomains = exports.Accounts = exports.AccountSessions = exports.AccountNotices = exports.AccountLinks = exports.Account = void 0;
5
+ exports.V2 = exports.Treasury = exports.TestHelpers = exports.Terminal = exports.Tax = exports.Sigma = exports.Reserve = exports.Reporting = exports.Radar = exports.Privacy = exports.Issuing = exports.Identity = exports.Forwarding = exports.FinancialConnections = exports.Entitlements = exports.Climate = exports.Checkout = exports.Capital = exports.BillingPortal = exports.Billing = exports.Apps = exports.WebhookEndpoints = exports.Transfers = exports.Topups = exports.Tokens = exports.TaxRates = exports.TaxIds = exports.TaxCodes = exports.Subscriptions = exports.SubscriptionSchedules = exports.SubscriptionItems = exports.Sources = exports.ShippingRates = void 0;
6
6
  const ResourceNamespace_js_1 = require("./ResourceNamespace.js");
7
- const AccountEvaluations_js_1 = require("./resources/Radar/AccountEvaluations.js");
8
7
  const AccountLinks_js_1 = require("./resources/V2/Core/AccountLinks.js");
9
8
  const AccountTokens_js_1 = require("./resources/V2/Core/AccountTokens.js");
10
9
  const Accounts_js_1 = require("./resources/FinancialConnections/Accounts.js");
@@ -12,18 +11,15 @@ const Accounts_js_2 = require("./resources/V2/Core/Accounts.js");
12
11
  const ActiveEntitlements_js_1 = require("./resources/Entitlements/ActiveEntitlements.js");
13
12
  const Adjustments_js_1 = require("./resources/V2/MoneyManagement/Adjustments.js");
14
13
  const Alerts_js_1 = require("./resources/Billing/Alerts.js");
15
- const ApiKeys_js_1 = require("./resources/V2/Iam/ApiKeys.js");
16
14
  const Associations_js_1 = require("./resources/Tax/Associations.js");
17
15
  const Authorizations_js_1 = require("./resources/Issuing/Authorizations.js");
18
16
  const Authorizations_js_2 = require("./resources/TestHelpers/Issuing/Authorizations.js");
19
17
  const BillSettings_js_1 = require("./resources/V2/Billing/BillSettings.js");
20
- const BlocklistEntries_js_1 = require("./resources/Identity/BlocklistEntries.js");
21
18
  const Cadences_js_1 = require("./resources/V2/Billing/Cadences.js");
22
19
  const Calculations_js_1 = require("./resources/Tax/Calculations.js");
23
20
  const Cardholders_js_1 = require("./resources/Issuing/Cardholders.js");
24
21
  const Cards_js_1 = require("./resources/Issuing/Cards.js");
25
22
  const Cards_js_2 = require("./resources/TestHelpers/Issuing/Cards.js");
26
- const ClaimableSandboxes_js_1 = require("./resources/V2/Core/ClaimableSandboxes.js");
27
23
  const CollectionSettings_js_1 = require("./resources/V2/Billing/CollectionSettings.js");
28
24
  const Configurations_js_1 = require("./resources/BillingPortal/Configurations.js");
29
25
  const Configurations_js_2 = require("./resources/Terminal/Configurations.js");
@@ -34,8 +30,6 @@ const CreditBalanceTransactions_js_1 = require("./resources/Billing/CreditBalanc
34
30
  const CreditGrants_js_1 = require("./resources/Billing/CreditGrants.js");
35
31
  const CreditReversals_js_1 = require("./resources/Treasury/CreditReversals.js");
36
32
  const CreditUnderwritingRecords_js_1 = require("./resources/Issuing/CreditUnderwritingRecords.js");
37
- const CurrencyConversions_js_1 = require("./resources/V2/MoneyManagement/CurrencyConversions.js");
38
- const CustomPricingUnits_js_1 = require("./resources/V2/Billing/CustomPricingUnits.js");
39
33
  const Customers_js_1 = require("./resources/TestHelpers/Customers.js");
40
34
  const DebitReversals_js_1 = require("./resources/Treasury/DebitReversals.js");
41
35
  const DisputeSettlementDetails_js_1 = require("./resources/Issuing/DisputeSettlementDetails.js");
@@ -49,24 +43,17 @@ const FinancialAccounts_js_2 = require("./resources/V2/MoneyManagement/Financial
49
43
  const FinancialAddresses_js_1 = require("./resources/V2/MoneyManagement/FinancialAddresses.js");
50
44
  const FinancialAddresses_js_2 = require("./resources/V2/TestHelpers/FinancialAddresses.js");
51
45
  const FinancingOffers_js_1 = require("./resources/Capital/FinancingOffers.js");
52
- const FinancingOffers_js_2 = require("./resources/TestHelpers/Capital/FinancingOffers.js");
53
46
  const FinancingSummary_js_1 = require("./resources/Capital/FinancingSummary.js");
54
47
  const FinancingTransactions_js_1 = require("./resources/Capital/FinancingTransactions.js");
55
48
  const Forms_js_1 = require("./resources/Tax/Forms.js");
56
49
  const FraudLiabilityDebits_js_1 = require("./resources/Issuing/FraudLiabilityDebits.js");
57
50
  const GbBankAccounts_js_1 = require("./resources/V2/Core/Vault/GbBankAccounts.js");
58
- const GrantedTokens_js_1 = require("./resources/SharedPayment/GrantedTokens.js");
59
- const GrantedTokens_js_2 = require("./resources/TestHelpers/SharedPayment/GrantedTokens.js");
51
+ const Holds_js_1 = require("./resources/Reserve/Holds.js");
60
52
  const InboundTransfers_js_1 = require("./resources/TestHelpers/Treasury/InboundTransfers.js");
61
53
  const InboundTransfers_js_2 = require("./resources/Treasury/InboundTransfers.js");
62
54
  const InboundTransfers_js_3 = require("./resources/V2/MoneyManagement/InboundTransfers.js");
63
55
  const Institutions_js_1 = require("./resources/FinancialConnections/Institutions.js");
64
- const Intents_js_1 = require("./resources/V2/Billing/Intents.js");
65
- const LicenseFeeSubscriptions_js_1 = require("./resources/V2/Billing/LicenseFeeSubscriptions.js");
66
- const LicenseFees_js_1 = require("./resources/V2/Billing/LicenseFees.js");
67
- const LicensedItems_js_1 = require("./resources/V2/Billing/LicensedItems.js");
68
56
  const Locations_js_1 = require("./resources/Terminal/Locations.js");
69
- const ManualRules_js_1 = require("./resources/V2/Tax/ManualRules.js");
70
57
  const MeterEventAdjustments_js_1 = require("./resources/Billing/MeterEventAdjustments.js");
71
58
  const MeterEventAdjustments_js_2 = require("./resources/V2/Billing/MeterEventAdjustments.js");
72
59
  const MeterEventSession_js_1 = require("./resources/V2/Billing/MeterEventSession.js");
@@ -74,10 +61,7 @@ const MeterEventStream_js_1 = require("./resources/V2/Billing/MeterEventStream.j
74
61
  const MeterEvents_js_1 = require("./resources/Billing/MeterEvents.js");
75
62
  const MeterEvents_js_2 = require("./resources/V2/Billing/MeterEvents.js");
76
63
  const MeterUsage_js_1 = require("./resources/Billing/Analytics/MeterUsage.js");
77
- const MeteredItems_js_1 = require("./resources/V2/Billing/MeteredItems.js");
78
64
  const Meters_js_1 = require("./resources/Billing/Meters.js");
79
- const MoneyManagement_js_1 = require("./resources/V2/TestHelpers/MoneyManagement.js");
80
- const OffSessionPayments_js_1 = require("./resources/V2/Payments/OffSessionPayments.js");
81
65
  const OnboardingLinks_js_1 = require("./resources/Terminal/OnboardingLinks.js");
82
66
  const Orders_js_1 = require("./resources/Climate/Orders.js");
83
67
  const OutboundPaymentQuotes_js_1 = require("./resources/V2/MoneyManagement/OutboundPaymentQuotes.js");
@@ -93,13 +77,9 @@ const PayoutMethodsBankAccountSpec_js_1 = require("./resources/V2/MoneyManagemen
93
77
  const PersonalizationDesigns_js_1 = require("./resources/Issuing/PersonalizationDesigns.js");
94
78
  const PersonalizationDesigns_js_2 = require("./resources/TestHelpers/Issuing/PersonalizationDesigns.js");
95
79
  const PhysicalBundles_js_1 = require("./resources/Issuing/PhysicalBundles.js");
96
- const PricingPlanSubscriptions_js_1 = require("./resources/V2/Billing/PricingPlanSubscriptions.js");
97
- const PricingPlans_js_1 = require("./resources/V2/Billing/PricingPlans.js");
80
+ const Plans_js_1 = require("./resources/Reserve/Plans.js");
98
81
  const Products_js_1 = require("./resources/Climate/Products.js");
99
82
  const Profiles_js_1 = require("./resources/V2/Billing/Profiles.js");
100
- const Programs_js_1 = require("./resources/Issuing/Programs.js");
101
- const RateCardSubscriptions_js_1 = require("./resources/V2/Billing/RateCardSubscriptions.js");
102
- const RateCards_js_1 = require("./resources/V2/Billing/RateCards.js");
103
83
  const ReaderCollectedData_js_1 = require("./resources/Terminal/ReaderCollectedData.js");
104
84
  const Readers_js_1 = require("./resources/Terminal/Readers.js");
105
85
  const Readers_js_2 = require("./resources/TestHelpers/Terminal/Readers.js");
@@ -109,24 +89,19 @@ const ReceivedCredits_js_3 = require("./resources/V2/MoneyManagement/ReceivedCre
109
89
  const ReceivedDebits_js_1 = require("./resources/TestHelpers/Treasury/ReceivedDebits.js");
110
90
  const ReceivedDebits_js_2 = require("./resources/Treasury/ReceivedDebits.js");
111
91
  const ReceivedDebits_js_3 = require("./resources/V2/MoneyManagement/ReceivedDebits.js");
112
- const RecipientVerifications_js_1 = require("./resources/V2/MoneyManagement/RecipientVerifications.js");
113
92
  const RedactionJobs_js_1 = require("./resources/Privacy/RedactionJobs.js");
114
93
  const Refunds_js_1 = require("./resources/TestHelpers/Refunds.js");
115
94
  const Registrations_js_1 = require("./resources/Tax/Registrations.js");
95
+ const Releases_js_1 = require("./resources/Reserve/Releases.js");
116
96
  const ReportRuns_js_1 = require("./resources/Reporting/ReportRuns.js");
117
- const ReportRuns_js_2 = require("./resources/V2/Reporting/ReportRuns.js");
118
97
  const ReportTypes_js_1 = require("./resources/Reporting/ReportTypes.js");
119
- const Reports_js_1 = require("./resources/V2/Reporting/Reports.js");
120
- const RequestedSessions_js_1 = require("./resources/DelegatedCheckout/RequestedSessions.js");
121
98
  const Requests_js_1 = require("./resources/Forwarding/Requests.js");
122
99
  const ScheduledQueryRuns_js_1 = require("./resources/Sigma/ScheduledQueryRuns.js");
123
100
  const Secrets_js_1 = require("./resources/Apps/Secrets.js");
124
- const ServiceActions_js_1 = require("./resources/V2/Billing/ServiceActions.js");
125
101
  const Sessions_js_1 = require("./resources/BillingPortal/Sessions.js");
126
102
  const Sessions_js_2 = require("./resources/Checkout/Sessions.js");
127
103
  const Sessions_js_3 = require("./resources/FinancialConnections/Sessions.js");
128
104
  const Settings_js_1 = require("./resources/Tax/Settings.js");
129
- const SettlementAllocationIntents_js_1 = require("./resources/V2/Payments/SettlementAllocationIntents.js");
130
105
  const Suppliers_js_1 = require("./resources/Climate/Suppliers.js");
131
106
  const TestClocks_js_1 = require("./resources/TestHelpers/TestClocks.js");
132
107
  const Tokens_js_1 = require("./resources/Issuing/Tokens.js");
@@ -138,7 +113,6 @@ const Transactions_js_3 = require("./resources/Tax/Transactions.js");
138
113
  const Transactions_js_4 = require("./resources/TestHelpers/Issuing/Transactions.js");
139
114
  const Transactions_js_5 = require("./resources/Treasury/Transactions.js");
140
115
  const Transactions_js_6 = require("./resources/V2/MoneyManagement/Transactions.js");
141
- const TrialOffers_js_1 = require("./resources/ProductCatalog/TrialOffers.js");
142
116
  const UsBankAccounts_js_1 = require("./resources/V2/Core/Vault/UsBankAccounts.js");
143
117
  const ValueListItems_js_1 = require("./resources/Radar/ValueListItems.js");
144
118
  const ValueLists_js_1 = require("./resources/Radar/ValueLists.js");
@@ -164,8 +138,6 @@ var BalanceSettings_js_1 = require("./resources/BalanceSettings.js");
164
138
  Object.defineProperty(exports, "BalanceSettings", { enumerable: true, get: function () { return BalanceSettings_js_1.BalanceSettings; } });
165
139
  var BalanceTransactions_js_1 = require("./resources/BalanceTransactions.js");
166
140
  Object.defineProperty(exports, "BalanceTransactions", { enumerable: true, get: function () { return BalanceTransactions_js_1.BalanceTransactions; } });
167
- var BalanceTransfers_js_1 = require("./resources/BalanceTransfers.js");
168
- Object.defineProperty(exports, "BalanceTransfers", { enumerable: true, get: function () { return BalanceTransfers_js_1.BalanceTransfers; } });
169
141
  var Charges_js_1 = require("./resources/Charges.js");
170
142
  Object.defineProperty(exports, "Charges", { enumerable: true, get: function () { return Charges_js_1.Charges; } });
171
143
  var ConfirmationTokens_js_2 = require("./resources/ConfirmationTokens.js");
@@ -228,8 +200,8 @@ var PaymentRecords_js_1 = require("./resources/PaymentRecords.js");
228
200
  Object.defineProperty(exports, "PaymentRecords", { enumerable: true, get: function () { return PaymentRecords_js_1.PaymentRecords; } });
229
201
  var Payouts_js_1 = require("./resources/Payouts.js");
230
202
  Object.defineProperty(exports, "Payouts", { enumerable: true, get: function () { return Payouts_js_1.Payouts; } });
231
- var Plans_js_1 = require("./resources/Plans.js");
232
- Object.defineProperty(exports, "Plans", { enumerable: true, get: function () { return Plans_js_1.Plans; } });
203
+ var Plans_js_2 = require("./resources/Plans.js");
204
+ Object.defineProperty(exports, "Plans", { enumerable: true, get: function () { return Plans_js_2.Plans; } });
233
205
  var Prices_js_1 = require("./resources/Prices.js");
234
206
  Object.defineProperty(exports, "Prices", { enumerable: true, get: function () { return Prices_js_1.Prices; } });
235
207
  var Products_js_2 = require("./resources/Products.js");
@@ -300,9 +272,6 @@ exports.Climate = (0, ResourceNamespace_js_1.resourceNamespace)('climate', {
300
272
  Products: Products_js_1.Products,
301
273
  Suppliers: Suppliers_js_1.Suppliers,
302
274
  });
303
- exports.DelegatedCheckout = (0, ResourceNamespace_js_1.resourceNamespace)('delegatedCheckout', {
304
- RequestedSessions: RequestedSessions_js_1.RequestedSessions,
305
- });
306
275
  exports.Entitlements = (0, ResourceNamespace_js_1.resourceNamespace)('entitlements', {
307
276
  ActiveEntitlements: ActiveEntitlements_js_1.ActiveEntitlements,
308
277
  Features: Features_js_1.Features,
@@ -317,7 +286,6 @@ exports.Forwarding = (0, ResourceNamespace_js_1.resourceNamespace)('forwarding',
317
286
  Requests: Requests_js_1.Requests,
318
287
  });
319
288
  exports.Identity = (0, ResourceNamespace_js_1.resourceNamespace)('identity', {
320
- BlocklistEntries: BlocklistEntries_js_1.BlocklistEntries,
321
289
  VerificationReports: VerificationReports_js_1.VerificationReports,
322
290
  VerificationSessions: VerificationSessions_js_1.VerificationSessions,
323
291
  });
@@ -331,18 +299,13 @@ exports.Issuing = (0, ResourceNamespace_js_1.resourceNamespace)('issuing', {
331
299
  FraudLiabilityDebits: FraudLiabilityDebits_js_1.FraudLiabilityDebits,
332
300
  PersonalizationDesigns: PersonalizationDesigns_js_1.PersonalizationDesigns,
333
301
  PhysicalBundles: PhysicalBundles_js_1.PhysicalBundles,
334
- Programs: Programs_js_1.Programs,
335
302
  Tokens: Tokens_js_1.Tokens,
336
303
  Transactions: Transactions_js_2.Transactions,
337
304
  });
338
305
  exports.Privacy = (0, ResourceNamespace_js_1.resourceNamespace)('privacy', {
339
306
  RedactionJobs: RedactionJobs_js_1.RedactionJobs,
340
307
  });
341
- exports.ProductCatalog = (0, ResourceNamespace_js_1.resourceNamespace)('productCatalog', {
342
- TrialOffers: TrialOffers_js_1.TrialOffers,
343
- });
344
308
  exports.Radar = (0, ResourceNamespace_js_1.resourceNamespace)('radar', {
345
- AccountEvaluations: AccountEvaluations_js_1.AccountEvaluations,
346
309
  EarlyFraudWarnings: EarlyFraudWarnings_js_1.EarlyFraudWarnings,
347
310
  ValueListItems: ValueListItems_js_1.ValueListItems,
348
311
  ValueLists: ValueLists_js_1.ValueLists,
@@ -351,8 +314,10 @@ exports.Reporting = (0, ResourceNamespace_js_1.resourceNamespace)('reporting', {
351
314
  ReportRuns: ReportRuns_js_1.ReportRuns,
352
315
  ReportTypes: ReportTypes_js_1.ReportTypes,
353
316
  });
354
- exports.SharedPayment = (0, ResourceNamespace_js_1.resourceNamespace)('sharedPayment', {
355
- GrantedTokens: GrantedTokens_js_1.GrantedTokens,
317
+ exports.Reserve = (0, ResourceNamespace_js_1.resourceNamespace)('reserve', {
318
+ Holds: Holds_js_1.Holds,
319
+ Plans: Plans_js_1.Plans,
320
+ Releases: Releases_js_1.Releases,
356
321
  });
357
322
  exports.Sigma = (0, ResourceNamespace_js_1.resourceNamespace)('sigma', {
358
323
  ScheduledQueryRuns: ScheduledQueryRuns_js_1.ScheduledQueryRuns,
@@ -378,18 +343,12 @@ exports.TestHelpers = (0, ResourceNamespace_js_1.resourceNamespace)('testHelpers
378
343
  Customers: Customers_js_1.Customers,
379
344
  Refunds: Refunds_js_1.Refunds,
380
345
  TestClocks: TestClocks_js_1.TestClocks,
381
- Capital: (0, ResourceNamespace_js_1.resourceNamespace)('capital', {
382
- FinancingOffers: FinancingOffers_js_2.FinancingOffers,
383
- }),
384
346
  Issuing: (0, ResourceNamespace_js_1.resourceNamespace)('issuing', {
385
347
  Authorizations: Authorizations_js_2.Authorizations,
386
348
  Cards: Cards_js_2.Cards,
387
349
  PersonalizationDesigns: PersonalizationDesigns_js_2.PersonalizationDesigns,
388
350
  Transactions: Transactions_js_4.Transactions,
389
351
  }),
390
- SharedPayment: (0, ResourceNamespace_js_1.resourceNamespace)('sharedPayment', {
391
- GrantedTokens: GrantedTokens_js_2.GrantedTokens,
392
- }),
393
352
  Terminal: (0, ResourceNamespace_js_1.resourceNamespace)('terminal', {
394
353
  Readers: Readers_js_2.Readers,
395
354
  }),
@@ -418,28 +377,16 @@ exports.V2 = (0, ResourceNamespace_js_1.resourceNamespace)('v2', {
418
377
  BillSettings: BillSettings_js_1.BillSettings,
419
378
  Cadences: Cadences_js_1.Cadences,
420
379
  CollectionSettings: CollectionSettings_js_1.CollectionSettings,
421
- CustomPricingUnits: CustomPricingUnits_js_1.CustomPricingUnits,
422
- Intents: Intents_js_1.Intents,
423
- LicenseFeeSubscriptions: LicenseFeeSubscriptions_js_1.LicenseFeeSubscriptions,
424
- LicenseFees: LicenseFees_js_1.LicenseFees,
425
- LicensedItems: LicensedItems_js_1.LicensedItems,
426
380
  MeterEventAdjustments: MeterEventAdjustments_js_2.MeterEventAdjustments,
427
381
  MeterEventSession: MeterEventSession_js_1.MeterEventSession,
428
382
  MeterEventStream: MeterEventStream_js_1.MeterEventStream,
429
383
  MeterEvents: MeterEvents_js_2.MeterEvents,
430
- MeteredItems: MeteredItems_js_1.MeteredItems,
431
- PricingPlanSubscriptions: PricingPlanSubscriptions_js_1.PricingPlanSubscriptions,
432
- PricingPlans: PricingPlans_js_1.PricingPlans,
433
384
  Profiles: Profiles_js_1.Profiles,
434
- RateCardSubscriptions: RateCardSubscriptions_js_1.RateCardSubscriptions,
435
- RateCards: RateCards_js_1.RateCards,
436
- ServiceActions: ServiceActions_js_1.ServiceActions,
437
385
  }),
438
386
  Core: (0, ResourceNamespace_js_1.resourceNamespace)('core', {
439
387
  AccountLinks: AccountLinks_js_1.AccountLinks,
440
388
  AccountTokens: AccountTokens_js_1.AccountTokens,
441
389
  Accounts: Accounts_js_2.Accounts,
442
- ClaimableSandboxes: ClaimableSandboxes_js_1.ClaimableSandboxes,
443
390
  EventDestinations: EventDestinations_js_1.EventDestinations,
444
391
  Events: Events_js_1.Events,
445
392
  Vault: (0, ResourceNamespace_js_1.resourceNamespace)('vault', {
@@ -447,10 +394,8 @@ exports.V2 = (0, ResourceNamespace_js_1.resourceNamespace)('v2', {
447
394
  UsBankAccounts: UsBankAccounts_js_1.UsBankAccounts,
448
395
  }),
449
396
  }),
450
- Iam: (0, ResourceNamespace_js_1.resourceNamespace)('iam', { ApiKeys: ApiKeys_js_1.ApiKeys }),
451
397
  MoneyManagement: (0, ResourceNamespace_js_1.resourceNamespace)('moneyManagement', {
452
398
  Adjustments: Adjustments_js_1.Adjustments,
453
- CurrencyConversions: CurrencyConversions_js_1.CurrencyConversions,
454
399
  FinancialAccounts: FinancialAccounts_js_2.FinancialAccounts,
455
400
  FinancialAddresses: FinancialAddresses_js_1.FinancialAddresses,
456
401
  InboundTransfers: InboundTransfers_js_3.InboundTransfers,
@@ -462,21 +407,10 @@ exports.V2 = (0, ResourceNamespace_js_1.resourceNamespace)('v2', {
462
407
  PayoutMethodsBankAccountSpec: PayoutMethodsBankAccountSpec_js_1.PayoutMethodsBankAccountSpec,
463
408
  ReceivedCredits: ReceivedCredits_js_3.ReceivedCredits,
464
409
  ReceivedDebits: ReceivedDebits_js_3.ReceivedDebits,
465
- RecipientVerifications: RecipientVerifications_js_1.RecipientVerifications,
466
410
  TransactionEntries: TransactionEntries_js_2.TransactionEntries,
467
411
  Transactions: Transactions_js_6.Transactions,
468
412
  }),
469
- Payment: (0, ResourceNamespace_js_1.resourceNamespace)('payment', {
470
- OffSessionPayments: OffSessionPayments_js_1.OffSessionPayments,
471
- SettlementAllocationIntents: SettlementAllocationIntents_js_1.SettlementAllocationIntents,
472
- }),
473
- Reporting: (0, ResourceNamespace_js_1.resourceNamespace)('reporting', {
474
- ReportRuns: ReportRuns_js_2.ReportRuns,
475
- Reports: Reports_js_1.Reports,
476
- }),
477
- Tax: (0, ResourceNamespace_js_1.resourceNamespace)('tax', { ManualRules: ManualRules_js_1.ManualRules }),
478
413
  TestHelper: (0, ResourceNamespace_js_1.resourceNamespace)('testHelper', {
479
414
  FinancialAddresses: FinancialAddresses_js_2.FinancialAddresses,
480
- MoneyManagement: MoneyManagement_js_1.MoneyManagement,
481
415
  }),
482
416
  });
@@ -11,6 +11,7 @@ const CryptoProvider_js_1 = require("./crypto/CryptoProvider.js");
11
11
  const HttpClient_js_1 = require("./net/HttpClient.js");
12
12
  const resources = require("./resources.js");
13
13
  const utils_js_1 = require("./utils.js");
14
+ const StripeEventNotificationHandler_js_1 = require("./StripeEventNotificationHandler.js");
14
15
  const DEFAULT_HOST = 'api.stripe.com';
15
16
  const DEFAULT_PORT = '443';
16
17
  const DEFAULT_BASE_PATH = '/v1/';
@@ -37,7 +38,7 @@ const ALLOWED_CONFIG_PROPERTIES = [
37
38
  ];
38
39
  const defaultRequestSenderFactory = (stripe) => new RequestSender_js_1.RequestSender(stripe, StripeResource_js_1.StripeResource.MAX_BUFFERED_REQUEST_METRICS);
39
40
  function createStripe(platformFunctions, requestSender = defaultRequestSenderFactory) {
40
- Stripe.PACKAGE_VERSION = '20.2.0-alpha.1';
41
+ Stripe.PACKAGE_VERSION = '20.2.0-beta.1';
41
42
  Stripe.API_VERSION = apiVersion_js_1.ApiVersion;
42
43
  Stripe.USER_AGENT = Object.assign({ bindings_version: Stripe.PACKAGE_VERSION, lang: 'node', publisher: 'stripe', uname: null, typescript: false }, (0, utils_js_1.determineProcessUserAgentProperties)());
43
44
  Stripe.StripeResource = StripeResource_js_1.StripeResource;
@@ -380,6 +381,9 @@ function createStripe(platformFunctions, requestSender = defaultRequestSenderFac
380
381
  };
381
382
  return eventNotification;
382
383
  },
384
+ notificationHandler(webhookSecret, fallbackCallback) {
385
+ return new StripeEventNotificationHandler_js_1.StripeEventNotificationHandler(this, webhookSecret, fallbackCallback);
386
+ },
383
387
  };
384
388
  return Stripe;
385
389
  }
package/esm/Error.js CHANGED
@@ -50,8 +50,6 @@ export const generateV2Error = (rawStripeError) => {
50
50
  return new NotCancelableError(rawStripeError);
51
51
  case 'quota_exceeded':
52
52
  return new QuotaExceededError(rawStripeError);
53
- case 'rate_limit':
54
- return new RateLimitError(rawStripeError);
55
53
  case 'recipient_not_notifiable':
56
54
  return new RecipientNotNotifiableError(rawStripeError);
57
55
  case 'temporary_session_expired':
@@ -274,11 +272,6 @@ export class QuotaExceededError extends StripeError {
274
272
  super(rawStripeError, 'QuotaExceededError');
275
273
  }
276
274
  }
277
- export class RateLimitError extends StripeError {
278
- constructor(rawStripeError = {}) {
279
- super(rawStripeError, 'RateLimitError');
280
- }
281
- }
282
275
  export class RecipientNotNotifiableError extends StripeError {
283
276
  constructor(rawStripeError = {}) {
284
277
  super(rawStripeError, 'RecipientNotNotifiableError');