stripe 16.9.0-beta.2 → 16.9.0

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 (164) hide show
  1. package/CHANGELOG.md +123 -822
  2. package/README.md +0 -33
  3. package/VERSION +1 -1
  4. package/cjs/RequestSender.js +5 -66
  5. package/cjs/StripeResource.js +1 -1
  6. package/cjs/apiVersion.js +1 -2
  7. package/cjs/multipart.js +1 -1
  8. package/cjs/resources/FinancialConnections/Accounts.js +0 -5
  9. package/cjs/resources/Invoices.js +0 -17
  10. package/cjs/resources/OAuth.js +1 -1
  11. package/cjs/resources/PaymentIntents.js +0 -4
  12. package/cjs/resources/Quotes.js +0 -32
  13. package/cjs/resources/SubscriptionSchedules.js +0 -4
  14. package/cjs/resources/Terminal/Readers.js +0 -12
  15. package/cjs/resources.js +10 -40
  16. package/cjs/stripe.core.js +3 -6
  17. package/cjs/utils.js +3 -30
  18. package/esm/RequestSender.js +6 -67
  19. package/esm/StripeResource.js +2 -2
  20. package/esm/apiVersion.js +0 -1
  21. package/esm/multipart.js +2 -2
  22. package/esm/resources/FinancialConnections/Accounts.js +0 -5
  23. package/esm/resources/Invoices.js +0 -17
  24. package/esm/resources/OAuth.js +2 -2
  25. package/esm/resources/PaymentIntents.js +0 -4
  26. package/esm/resources/Quotes.js +0 -32
  27. package/esm/resources/SubscriptionSchedules.js +0 -4
  28. package/esm/resources/Terminal/Readers.js +0 -12
  29. package/esm/resources.js +0 -26
  30. package/esm/stripe.core.js +3 -6
  31. package/esm/utils.js +1 -27
  32. package/package.json +1 -1
  33. package/types/AccountLinksResource.d.ts +2 -6
  34. package/types/AccountSessions.d.ts +0 -45
  35. package/types/AccountSessionsResource.d.ts +0 -260
  36. package/types/Accounts.d.ts +1 -113
  37. package/types/AccountsResource.d.ts +0 -270
  38. package/types/Charges.d.ts +0 -71
  39. package/types/ChargesResource.d.ts +0 -1294
  40. package/types/Checkout/Sessions.d.ts +4 -185
  41. package/types/Checkout/SessionsResource.d.ts +5 -349
  42. package/types/ConfirmationTokens.d.ts +0 -67
  43. package/types/Coupons.d.ts +1 -1
  44. package/types/CouponsResource.d.ts +1 -1
  45. package/types/CreditNotes.d.ts +0 -21
  46. package/types/CreditNotesResource.d.ts +0 -51
  47. package/types/CustomersResource.d.ts +0 -3
  48. package/types/Disputes.d.ts +0 -152
  49. package/types/DisputesResource.d.ts +0 -120
  50. package/types/EventTypes.d.ts +0 -460
  51. package/types/Events.d.ts +0 -85
  52. package/types/FileLinksResource.d.ts +1 -1
  53. package/types/Files.d.ts +1 -0
  54. package/types/FilesResource.d.ts +3 -1
  55. package/types/FinancialConnections/Accounts.d.ts +1 -29
  56. package/types/FinancialConnections/AccountsResource.d.ts +3 -35
  57. package/types/FinancialConnections/Sessions.d.ts +1 -49
  58. package/types/FinancialConnections/SessionsResource.d.ts +1 -38
  59. package/types/InvoiceItems.d.ts +0 -5
  60. package/types/InvoiceItemsResource.d.ts +0 -98
  61. package/types/InvoiceLineItems.d.ts +3 -23
  62. package/types/Invoices.d.ts +1 -116
  63. package/types/InvoicesResource.d.ts +1835 -5493
  64. package/types/Issuing/CardholdersResource.d.ts +1 -2
  65. package/types/Issuing/Cards.d.ts +1 -1
  66. package/types/LineItems.d.ts +1 -8
  67. package/types/Mandates.d.ts +0 -77
  68. package/types/PaymentIntents.d.ts +1 -502
  69. package/types/PaymentIntentsResource.d.ts +3464 -7064
  70. package/types/PaymentLinks.d.ts +0 -1
  71. package/types/PaymentLinksResource.d.ts +0 -2
  72. package/types/PaymentMethodConfigurations.d.ts +0 -36
  73. package/types/PaymentMethodConfigurationsResource.d.ts +0 -50
  74. package/types/PaymentMethods.d.ts +0 -67
  75. package/types/PaymentMethodsResource.d.ts +0 -119
  76. package/types/Prices.d.ts +0 -22
  77. package/types/PricesResource.d.ts +0 -22
  78. package/types/Products.d.ts +0 -39
  79. package/types/ProductsResource.d.ts +0 -36
  80. package/types/Quotes.d.ts +1 -596
  81. package/types/QuotesResource.d.ts +199 -2531
  82. package/types/SetupAttempts.d.ts +0 -9
  83. package/types/SetupIntents.d.ts +1 -110
  84. package/types/SetupIntentsResource.d.ts +3 -522
  85. package/types/Sources.d.ts +0 -23
  86. package/types/SubscriptionItems.d.ts +0 -21
  87. package/types/SubscriptionItemsResource.d.ts +0 -109
  88. package/types/SubscriptionSchedules.d.ts +0 -200
  89. package/types/SubscriptionSchedulesResource.d.ts +13 -1231
  90. package/types/Subscriptions.d.ts +1 -82
  91. package/types/SubscriptionsResource.d.ts +2 -347
  92. package/types/Tax/CalculationsResource.d.ts +1 -1
  93. package/types/Terminal/Readers.d.ts +0 -278
  94. package/types/Terminal/ReadersResource.d.ts +0 -208
  95. package/types/TestHelpers/ConfirmationTokensResource.d.ts +0 -63
  96. package/types/TestHelpers/TestClocks.d.ts +15 -0
  97. package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +0 -26
  98. package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +0 -26
  99. package/types/Treasury/FinancialAccounts.d.ts +0 -5
  100. package/types/Treasury/FinancialAccountsResource.d.ts +0 -10
  101. package/types/Treasury/OutboundTransfers.d.ts +0 -26
  102. package/types/Treasury/OutboundTransfersResource.d.ts +0 -26
  103. package/types/Treasury/ReceivedCredits.d.ts +0 -26
  104. package/types/Treasury/ReceivedDebits.d.ts +0 -31
  105. package/types/WebhookEndpointsResource.d.ts +0 -54
  106. package/types/index.d.ts +0 -67
  107. package/types/lib.d.ts +0 -12
  108. package/cjs/resources/AccountNotices.js +0 -21
  109. package/cjs/resources/Capital/FinancingOffers.js +0 -21
  110. package/cjs/resources/Capital/FinancingSummary.js +0 -12
  111. package/cjs/resources/Capital/FinancingTransactions.js +0 -17
  112. package/cjs/resources/FinancialConnections/Institutions.js +0 -17
  113. package/cjs/resources/GiftCards/Cards.js +0 -23
  114. package/cjs/resources/GiftCards/Transactions.js +0 -33
  115. package/cjs/resources/Issuing/CreditUnderwritingRecords.js +0 -33
  116. package/cjs/resources/Margins.js +0 -22
  117. package/cjs/resources/Orders.js +0 -24
  118. package/cjs/resources/QuotePhases.js +0 -22
  119. package/cjs/resources/Tax/Associations.js +0 -9
  120. package/cjs/resources/Tax/Forms.js +0 -20
  121. package/esm/resources/AccountNotices.js +0 -18
  122. package/esm/resources/Capital/FinancingOffers.js +0 -18
  123. package/esm/resources/Capital/FinancingSummary.js +0 -9
  124. package/esm/resources/Capital/FinancingTransactions.js +0 -14
  125. package/esm/resources/FinancialConnections/Institutions.js +0 -14
  126. package/esm/resources/GiftCards/Cards.js +0 -20
  127. package/esm/resources/GiftCards/Transactions.js +0 -30
  128. package/esm/resources/Issuing/CreditUnderwritingRecords.js +0 -30
  129. package/esm/resources/Margins.js +0 -19
  130. package/esm/resources/Orders.js +0 -21
  131. package/esm/resources/QuotePhases.js +0 -19
  132. package/esm/resources/Tax/Associations.js +0 -6
  133. package/esm/resources/Tax/Forms.js +0 -17
  134. package/types/AccountNotices.d.ts +0 -113
  135. package/types/AccountNoticesResource.d.ts +0 -98
  136. package/types/Capital/FinancingOffers.d.ts +0 -188
  137. package/types/Capital/FinancingOffersResource.d.ts +0 -97
  138. package/types/Capital/FinancingSummary.d.ts +0 -106
  139. package/types/Capital/FinancingSummaryResource.d.ts +0 -27
  140. package/types/Capital/FinancingTransactions.d.ts +0 -135
  141. package/types/Capital/FinancingTransactionsResource.d.ts +0 -68
  142. package/types/FinancialConnections/AccountInferredBalances.d.ts +0 -38
  143. package/types/FinancialConnections/Institutions.d.ts +0 -93
  144. package/types/FinancialConnections/InstitutionsResource.d.ts +0 -47
  145. package/types/GiftCards/Cards.d.ts +0 -118
  146. package/types/GiftCards/CardsResource.d.ts +0 -159
  147. package/types/GiftCards/Transactions.d.ts +0 -129
  148. package/types/GiftCards/TransactionsResource.d.ts +0 -201
  149. package/types/InvoicePayments.d.ts +0 -138
  150. package/types/Issuing/CreditUnderwritingRecords.d.ts +0 -446
  151. package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +0 -1017
  152. package/types/Margins.d.ts +0 -56
  153. package/types/MarginsResource.d.ts +0 -114
  154. package/types/Orders.d.ts +0 -1084
  155. package/types/OrdersResource.d.ts +0 -2765
  156. package/types/QuoteLines.d.ts +0 -634
  157. package/types/QuotePhases.d.ts +0 -198
  158. package/types/QuotePhasesResource.d.ts +0 -67
  159. package/types/QuotePreviewInvoices.d.ts +0 -1531
  160. package/types/QuotePreviewSubscriptionSchedules.d.ts +0 -814
  161. package/types/Tax/Associations.d.ts +0 -126
  162. package/types/Tax/AssociationsResource.d.ts +0 -29
  163. package/types/Tax/Forms.d.ts +0 -133
  164. package/types/Tax/FormsResource.d.ts +0 -90
package/README.md CHANGED
@@ -517,39 +517,6 @@ const stripe = new Stripe('sk_test_...', {
517
517
  });
518
518
  ```
519
519
 
520
- ### Custom requests
521
-
522
- If you would like to send a request to an undocumented API (for example you are in a private beta), or if you prefer to bypass the method definitions in the library and specify your request details directly, you can use the `rawRequest` method on the Stripe object.
523
-
524
- ```javascript
525
- const stripe = require('stripe')('sk_test_...');
526
-
527
- stripe.rawRequest(
528
- 'POST',
529
- '/v1/beta_endpoint',
530
- { param: 123 },
531
- { apiVersion: '2022-11-15; feature_beta=v3' }
532
- )
533
- .then((response) => /* handle response */ )
534
- .catch((error) => console.error(error));
535
- ```
536
-
537
- Or using ES modules and `async`/`await`:
538
-
539
- ```javascript
540
- import Stripe from 'stripe';
541
- const stripe = new Stripe('sk_test_...');
542
-
543
- const response = await stripe.rawRequest(
544
- 'POST',
545
- '/v1/beta_endpoint',
546
- { param: 123 },
547
- { apiVersion: '2022-11-15; feature_beta=v3' }
548
- );
549
-
550
- // handle response
551
- ```
552
-
553
520
  ## Support
554
521
 
555
522
  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.
package/VERSION CHANGED
@@ -1 +1 @@
1
- 16.9.0-beta.2
1
+ 16.9.0
@@ -4,7 +4,6 @@ exports.RequestSender = void 0;
4
4
  const Error_js_1 = require("./Error.js");
5
5
  const utils_js_1 = require("./utils.js");
6
6
  const HttpClient_js_1 = require("./net/HttpClient.js");
7
- const apiVersion_js_1 = require("./apiVersion.js");
8
7
  const MAX_RETRY_AFTER_WAIT = 60;
9
8
  class RequestSender {
10
9
  constructor(stripe, maxBufferedRequestMetric) {
@@ -202,12 +201,12 @@ class RequestSender {
202
201
  }
203
202
  return null;
204
203
  }
205
- _makeHeaders(auth, contentType, contentLength, apiVersion, clientUserAgent, method, userSuppliedHeaders, userSuppliedSettings) {
204
+ _makeHeaders(auth, contentLength, apiVersion, clientUserAgent, method, userSuppliedHeaders, userSuppliedSettings) {
206
205
  const defaultHeaders = {
207
206
  // Use specified auth token or use default from this stripe instance:
208
207
  Authorization: auth ? `Bearer ${auth}` : this._stripe.getApiField('auth'),
209
208
  Accept: 'application/json',
210
- 'Content-Type': contentType,
209
+ 'Content-Type': 'application/x-www-form-urlencoded',
211
210
  'User-Agent': this._getUserAgentString(),
212
211
  'X-Stripe-Client-User-Agent': clientUserAgent,
213
212
  'X-Stripe-Client-Telemetry': this._getTelemetryHeader(),
@@ -275,54 +274,6 @@ class RequestSender {
275
274
  }
276
275
  }
277
276
  }
278
- _rawRequest(method, path, params, options) {
279
- const requestPromise = new Promise((resolve, reject) => {
280
- let opts;
281
- try {
282
- const requestMethod = method.toUpperCase();
283
- if (requestMethod !== 'POST' &&
284
- params &&
285
- Object.keys(params).length !== 0) {
286
- throw new Error('rawRequest only supports params on POST requests. Please pass null and add your parameters to path.');
287
- }
288
- const args = [].slice.call([params, options]);
289
- // Pull request data and options (headers, auth) from args.
290
- const dataFromArgs = (0, utils_js_1.getDataFromArgs)(args);
291
- const data = Object.assign({}, dataFromArgs);
292
- const calculatedOptions = (0, utils_js_1.getOptionsFromArgs)(args);
293
- const apiMode = calculatedOptions.apiMode || 'standard';
294
- const headers = calculatedOptions.headers;
295
- opts = {
296
- requestMethod,
297
- requestPath: path,
298
- bodyData: data,
299
- queryData: {},
300
- auth: calculatedOptions.auth,
301
- headers,
302
- host: null,
303
- streaming: false,
304
- settings: {},
305
- apiMode: apiMode,
306
- usage: ['raw_request'],
307
- };
308
- }
309
- catch (err) {
310
- reject(err);
311
- return;
312
- }
313
- function requestCallback(err, response) {
314
- if (err) {
315
- reject(err);
316
- }
317
- else {
318
- resolve(response);
319
- }
320
- }
321
- const { headers, settings } = opts;
322
- this._request(opts.requestMethod, opts.host, path, opts.bodyData, opts.auth, { headers, settings, streaming: opts.streaming, apiMode: opts.apiMode }, opts.usage, requestCallback);
323
- });
324
- return requestPromise;
325
- }
326
277
  _request(method, host, path, data, auth, options = {}, usage = [], callback, requestDataProcessor = null) {
327
278
  let requestData;
328
279
  const retryRequest = (requestFn, apiVersion, headers, requestRetries, retryAfter) => {
@@ -387,15 +338,10 @@ class RequestSender {
387
338
  return callback(error);
388
339
  }
389
340
  requestData = data;
390
- let contentType = 'application/x-www-form-urlencoded';
391
- let apiVersion = this._stripe.getApiField('version');
392
- if (options.apiMode === 'preview') {
393
- contentType = 'application/json';
394
- apiVersion = apiVersion_js_1.PreviewVersion;
395
- }
396
341
  this._stripe.getClientUserAgent((clientUserAgent) => {
397
342
  var _a, _b;
398
- const headers = this._makeHeaders(auth, contentType, requestData.length, apiVersion, clientUserAgent, method, (_a = options.headers) !== null && _a !== void 0 ? _a : null, (_b = options.settings) !== null && _b !== void 0 ? _b : {});
343
+ const apiVersion = this._stripe.getApiField('version');
344
+ 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 : {});
399
345
  makeRequest(apiVersion, headers, 0);
400
346
  });
401
347
  };
@@ -403,14 +349,7 @@ class RequestSender {
403
349
  requestDataProcessor(method, data, options.headers, prepareAndMakeRequest);
404
350
  }
405
351
  else {
406
- let stringifiedData;
407
- if (options.apiMode === 'preview') {
408
- stringifiedData = data ? (0, utils_js_1.jsonStringifyRequestData)(data) : '';
409
- }
410
- else {
411
- stringifiedData = (0, utils_js_1.queryStringifyRequestData)(data || {});
412
- }
413
- prepareAndMakeRequest(null, stringifiedData);
352
+ prepareAndMakeRequest(null, (0, utils_js_1.stringifyRequestData)(data || {}));
414
353
  }
415
354
  }
416
355
  }
@@ -162,7 +162,7 @@ StripeResource.prototype = {
162
162
  const path = [
163
163
  opts.requestPath,
164
164
  emptyQuery ? '' : '?',
165
- (0, utils_js_1.queryStringifyRequestData)(opts.queryData),
165
+ (0, utils_js_1.stringifyRequestData)(opts.queryData),
166
166
  ].join('');
167
167
  const { headers, settings } = opts;
168
168
  this._stripe._requestSender._request(opts.requestMethod, opts.host, path, opts.bodyData, opts.auth, { headers, settings, streaming: opts.streaming }, opts.usage, requestCallback, (_a = this.requestDataProcessor) === null || _a === void 0 ? void 0 : _a.bind(this));
package/cjs/apiVersion.js CHANGED
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.PreviewVersion = exports.ApiVersion = void 0;
4
+ exports.ApiVersion = void 0;
5
5
  exports.ApiVersion = '2024-06-20';
6
- exports.PreviewVersion = '2024-08-21.preview-v2';
package/cjs/multipart.js CHANGED
@@ -48,7 +48,7 @@ const multipartDataGenerator = (method, data, headers) => {
48
48
  function multipartRequestDataProcessor(method, data, headers, callback) {
49
49
  data = data || {};
50
50
  if (method !== 'POST') {
51
- return callback(null, (0, utils_js_1.queryStringifyRequestData)(data));
51
+ return callback(null, (0, utils_js_1.stringifyRequestData)(data));
52
52
  }
53
53
  this._stripe._platformFunctions
54
54
  .tryBufferData(data)
@@ -18,11 +18,6 @@ exports.Accounts = StripeResource_js_1.StripeResource.extend({
18
18
  method: 'POST',
19
19
  fullPath: '/v1/financial_connections/accounts/{account}/disconnect',
20
20
  }),
21
- listInferredBalances: stripeMethod({
22
- method: 'GET',
23
- fullPath: '/v1/financial_connections/accounts/{account}/inferred_balances',
24
- methodType: 'list',
25
- }),
26
21
  listOwners: stripeMethod({
27
22
  method: 'GET',
28
23
  fullPath: '/v1/financial_connections/accounts/{account}/owners',
@@ -18,14 +18,6 @@ exports.Invoices = StripeResource_js_1.StripeResource.extend({
18
18
  method: 'POST',
19
19
  fullPath: '/v1/invoices/{invoice}/add_lines',
20
20
  }),
21
- attachPayment: stripeMethod({
22
- method: 'POST',
23
- fullPath: '/v1/invoices/{invoice}/attach_payment',
24
- }),
25
- attachPaymentIntent: stripeMethod({
26
- method: 'POST',
27
- fullPath: '/v1/invoices/{invoice}/attach_payment_intent',
28
- }),
29
21
  createPreview: stripeMethod({
30
22
  method: 'POST',
31
23
  fullPath: '/v1/invoices/create_preview',
@@ -39,11 +31,6 @@ exports.Invoices = StripeResource_js_1.StripeResource.extend({
39
31
  fullPath: '/v1/invoices/{invoice}/lines',
40
32
  methodType: 'list',
41
33
  }),
42
- listPayments: stripeMethod({
43
- method: 'GET',
44
- fullPath: '/v1/invoices/{invoice}/payments',
45
- methodType: 'list',
46
- }),
47
34
  listUpcomingLines: stripeMethod({
48
35
  method: 'GET',
49
36
  fullPath: '/v1/invoices/upcoming/lines',
@@ -58,10 +45,6 @@ exports.Invoices = StripeResource_js_1.StripeResource.extend({
58
45
  method: 'POST',
59
46
  fullPath: '/v1/invoices/{invoice}/remove_lines',
60
47
  }),
61
- retrievePayment: stripeMethod({
62
- method: 'GET',
63
- fullPath: '/v1/invoices/{invoice}/payments/{invoice_payment}',
64
- }),
65
48
  retrieveUpcoming: stripeMethod({
66
49
  method: 'GET',
67
50
  fullPath: '/v1/invoices/upcoming',
@@ -24,7 +24,7 @@ exports.OAuth = StripeResource_js_1.StripeResource.extend({
24
24
  if (!params.scope) {
25
25
  params.scope = 'read_write';
26
26
  }
27
- return `https://${oAuthHost}/${path}?${(0, utils_js_1.queryStringifyRequestData)(params)}`;
27
+ return `https://${oAuthHost}/${path}?${(0, utils_js_1.stringifyRequestData)(params)}`;
28
28
  },
29
29
  token: stripeMethod({
30
30
  method: 'POST',
@@ -35,10 +35,6 @@ exports.PaymentIntents = StripeResource_js_1.StripeResource.extend({
35
35
  method: 'POST',
36
36
  fullPath: '/v1/payment_intents/{intent}/confirm',
37
37
  }),
38
- decrementAuthorization: stripeMethod({
39
- method: 'POST',
40
- fullPath: '/v1/payment_intents/{intent}/decrement_authorization',
41
- }),
42
38
  incrementAuthorization: stripeMethod({
43
39
  method: 'POST',
44
40
  fullPath: '/v1/payment_intents/{intent}/increment_authorization',
@@ -19,11 +19,6 @@ exports.Quotes = StripeResource_js_1.StripeResource.extend({
19
19
  method: 'POST',
20
20
  fullPath: '/v1/quotes/{quote}/finalize',
21
21
  }),
22
- listPreviewInvoiceLines: stripeMethod({
23
- method: 'GET',
24
- fullPath: '/v1/quotes/{quote}/preview_invoices/{preview_invoice}/lines',
25
- methodType: 'list',
26
- }),
27
22
  listComputedUpfrontLineItems: stripeMethod({
28
23
  method: 'GET',
29
24
  fullPath: '/v1/quotes/{quote}/computed_upfront_line_items',
@@ -34,37 +29,10 @@ exports.Quotes = StripeResource_js_1.StripeResource.extend({
34
29
  fullPath: '/v1/quotes/{quote}/line_items',
35
30
  methodType: 'list',
36
31
  }),
37
- listLines: stripeMethod({
38
- method: 'GET',
39
- fullPath: '/v1/quotes/{quote}/lines',
40
- methodType: 'list',
41
- }),
42
- listPreviewInvoices: stripeMethod({
43
- method: 'GET',
44
- fullPath: '/v1/quotes/{quote}/preview_invoices',
45
- methodType: 'list',
46
- }),
47
- listPreviewSubscriptionSchedules: stripeMethod({
48
- method: 'GET',
49
- fullPath: '/v1/quotes/{quote}/preview_subscription_schedules',
50
- methodType: 'list',
51
- }),
52
- markDraft: stripeMethod({
53
- method: 'POST',
54
- fullPath: '/v1/quotes/{quote}/mark_draft',
55
- }),
56
- markStale: stripeMethod({
57
- method: 'POST',
58
- fullPath: '/v1/quotes/{quote}/mark_stale',
59
- }),
60
32
  pdf: stripeMethod({
61
33
  method: 'GET',
62
34
  fullPath: '/v1/quotes/{quote}/pdf',
63
35
  host: 'files.stripe.com',
64
36
  streaming: true,
65
37
  }),
66
- reestimate: stripeMethod({
67
- method: 'POST',
68
- fullPath: '/v1/quotes/{quote}/reestimate',
69
- }),
70
38
  });
@@ -22,10 +22,6 @@ exports.SubscriptionSchedules = StripeResource_js_1.StripeResource.extend({
22
22
  fullPath: '/v1/subscription_schedules',
23
23
  methodType: 'list',
24
24
  }),
25
- amend: stripeMethod({
26
- method: 'POST',
27
- fullPath: '/v1/subscription_schedules/{schedule}/amend',
28
- }),
29
25
  cancel: stripeMethod({
30
26
  method: 'POST',
31
27
  fullPath: '/v1/subscription_schedules/{schedule}/cancel',
@@ -27,18 +27,6 @@ exports.Readers = StripeResource_js_1.StripeResource.extend({
27
27
  method: 'POST',
28
28
  fullPath: '/v1/terminal/readers/{reader}/cancel_action',
29
29
  }),
30
- collectInputs: stripeMethod({
31
- method: 'POST',
32
- fullPath: '/v1/terminal/readers/{reader}/collect_inputs',
33
- }),
34
- collectPaymentMethod: stripeMethod({
35
- method: 'POST',
36
- fullPath: '/v1/terminal/readers/{reader}/collect_payment_method',
37
- }),
38
- confirmPaymentIntent: stripeMethod({
39
- method: 'POST',
40
- fullPath: '/v1/terminal/readers/{reader}/confirm_payment_intent',
41
- }),
42
30
  processPaymentIntent: stripeMethod({
43
31
  method: 'POST',
44
32
  fullPath: '/v1/terminal/readers/{reader}/process_payment_intent',
package/cjs/resources.js CHANGED
@@ -1,39 +1,31 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.TaxCodes = exports.Subscriptions = exports.SubscriptionSchedules = exports.SubscriptionItems = exports.Sources = exports.ShippingRates = exports.SetupIntents = exports.SetupAttempts = exports.Reviews = exports.Refunds = exports.Quotes = exports.QuotePhases = exports.PromotionCodes = exports.Products = exports.Prices = exports.Plans = exports.Payouts = exports.PaymentMethods = exports.PaymentMethodDomains = exports.PaymentMethodConfigurations = exports.PaymentLinks = exports.PaymentIntents = exports.Orders = exports.OAuth = exports.Margins = exports.Mandates = exports.Invoices = exports.InvoiceItems = exports.Files = exports.FileLinks = 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.Balance = exports.ApplicationFees = exports.ApplePayDomains = exports.Accounts = exports.AccountSessions = exports.AccountNotices = exports.AccountLinks = exports.Account = void 0;
5
- exports.Treasury = exports.TestHelpers = exports.Terminal = exports.Tax = exports.Sigma = exports.Reporting = exports.Radar = exports.Issuing = exports.Identity = exports.GiftCards = 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 = void 0;
4
+ exports.Topups = exports.Tokens = exports.TaxRates = exports.TaxIds = 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.PaymentMethodDomains = exports.PaymentMethodConfigurations = 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.CustomerSessions = exports.CreditNotes = exports.Coupons = exports.CountrySpecs = exports.ConfirmationTokens = exports.Charges = exports.BalanceTransactions = exports.Balance = exports.ApplicationFees = exports.ApplePayDomains = exports.Accounts = exports.AccountSessions = exports.AccountLinks = exports.Account = void 0;
5
+ exports.Treasury = exports.TestHelpers = exports.Terminal = exports.Tax = exports.Sigma = exports.Reporting = exports.Radar = exports.Issuing = exports.Identity = exports.Forwarding = exports.FinancialConnections = exports.Entitlements = exports.Climate = exports.Checkout = exports.BillingPortal = exports.Billing = exports.Apps = exports.WebhookEndpoints = exports.Transfers = void 0;
6
6
  const ResourceNamespace_js_1 = require("./ResourceNamespace.js");
7
7
  const Accounts_js_1 = require("./resources/FinancialConnections/Accounts.js");
8
8
  const ActiveEntitlements_js_1 = require("./resources/Entitlements/ActiveEntitlements.js");
9
9
  const Alerts_js_1 = require("./resources/Billing/Alerts.js");
10
- const Associations_js_1 = require("./resources/Tax/Associations.js");
11
10
  const Authorizations_js_1 = require("./resources/TestHelpers/Issuing/Authorizations.js");
12
11
  const Authorizations_js_2 = require("./resources/Issuing/Authorizations.js");
13
12
  const Calculations_js_1 = require("./resources/Tax/Calculations.js");
14
13
  const Cardholders_js_1 = require("./resources/Issuing/Cardholders.js");
15
14
  const Cards_js_1 = require("./resources/TestHelpers/Issuing/Cards.js");
16
- const Cards_js_2 = require("./resources/GiftCards/Cards.js");
17
- const Cards_js_3 = require("./resources/Issuing/Cards.js");
15
+ const Cards_js_2 = require("./resources/Issuing/Cards.js");
18
16
  const Configurations_js_1 = require("./resources/BillingPortal/Configurations.js");
19
17
  const Configurations_js_2 = require("./resources/Terminal/Configurations.js");
20
18
  const ConfirmationTokens_js_1 = require("./resources/TestHelpers/ConfirmationTokens.js");
21
19
  const ConnectionTokens_js_1 = require("./resources/Terminal/ConnectionTokens.js");
22
20
  const CreditReversals_js_1 = require("./resources/Treasury/CreditReversals.js");
23
- const CreditUnderwritingRecords_js_1 = require("./resources/Issuing/CreditUnderwritingRecords.js");
24
21
  const Customers_js_1 = require("./resources/TestHelpers/Customers.js");
25
22
  const DebitReversals_js_1 = require("./resources/Treasury/DebitReversals.js");
26
23
  const Disputes_js_1 = require("./resources/Issuing/Disputes.js");
27
24
  const EarlyFraudWarnings_js_1 = require("./resources/Radar/EarlyFraudWarnings.js");
28
25
  const Features_js_1 = require("./resources/Entitlements/Features.js");
29
26
  const FinancialAccounts_js_1 = require("./resources/Treasury/FinancialAccounts.js");
30
- const FinancingOffers_js_1 = require("./resources/Capital/FinancingOffers.js");
31
- const FinancingSummary_js_1 = require("./resources/Capital/FinancingSummary.js");
32
- const FinancingTransactions_js_1 = require("./resources/Capital/FinancingTransactions.js");
33
- const Forms_js_1 = require("./resources/Tax/Forms.js");
34
27
  const InboundTransfers_js_1 = require("./resources/TestHelpers/Treasury/InboundTransfers.js");
35
28
  const InboundTransfers_js_2 = require("./resources/Treasury/InboundTransfers.js");
36
- const Institutions_js_1 = require("./resources/FinancialConnections/Institutions.js");
37
29
  const Locations_js_1 = require("./resources/Terminal/Locations.js");
38
30
  const MeterEventAdjustments_js_1 = require("./resources/Billing/MeterEventAdjustments.js");
39
31
  const MeterEvents_js_1 = require("./resources/Billing/MeterEvents.js");
@@ -70,10 +62,9 @@ const Tokens_js_1 = require("./resources/Issuing/Tokens.js");
70
62
  const TransactionEntries_js_1 = require("./resources/Treasury/TransactionEntries.js");
71
63
  const Transactions_js_1 = require("./resources/TestHelpers/Issuing/Transactions.js");
72
64
  const Transactions_js_2 = require("./resources/FinancialConnections/Transactions.js");
73
- const Transactions_js_3 = require("./resources/GiftCards/Transactions.js");
74
- const Transactions_js_4 = require("./resources/Issuing/Transactions.js");
75
- const Transactions_js_5 = require("./resources/Tax/Transactions.js");
76
- const Transactions_js_6 = require("./resources/Treasury/Transactions.js");
65
+ const Transactions_js_3 = require("./resources/Issuing/Transactions.js");
66
+ const Transactions_js_4 = require("./resources/Tax/Transactions.js");
67
+ const Transactions_js_5 = require("./resources/Treasury/Transactions.js");
77
68
  const ValueListItems_js_1 = require("./resources/Radar/ValueListItems.js");
78
69
  const ValueLists_js_1 = require("./resources/Radar/ValueLists.js");
79
70
  const VerificationReports_js_1 = require("./resources/Identity/VerificationReports.js");
@@ -82,8 +73,6 @@ var Accounts_js_2 = require("./resources/Accounts.js");
82
73
  Object.defineProperty(exports, "Account", { enumerable: true, get: function () { return Accounts_js_2.Accounts; } });
83
74
  var AccountLinks_js_1 = require("./resources/AccountLinks.js");
84
75
  Object.defineProperty(exports, "AccountLinks", { enumerable: true, get: function () { return AccountLinks_js_1.AccountLinks; } });
85
- var AccountNotices_js_1 = require("./resources/AccountNotices.js");
86
- Object.defineProperty(exports, "AccountNotices", { enumerable: true, get: function () { return AccountNotices_js_1.AccountNotices; } });
87
76
  var AccountSessions_js_1 = require("./resources/AccountSessions.js");
88
77
  Object.defineProperty(exports, "AccountSessions", { enumerable: true, get: function () { return AccountSessions_js_1.AccountSessions; } });
89
78
  var Accounts_js_3 = require("./resources/Accounts.js");
@@ -128,12 +117,8 @@ var Invoices_js_1 = require("./resources/Invoices.js");
128
117
  Object.defineProperty(exports, "Invoices", { enumerable: true, get: function () { return Invoices_js_1.Invoices; } });
129
118
  var Mandates_js_1 = require("./resources/Mandates.js");
130
119
  Object.defineProperty(exports, "Mandates", { enumerable: true, get: function () { return Mandates_js_1.Mandates; } });
131
- var Margins_js_1 = require("./resources/Margins.js");
132
- Object.defineProperty(exports, "Margins", { enumerable: true, get: function () { return Margins_js_1.Margins; } });
133
120
  var OAuth_js_1 = require("./resources/OAuth.js");
134
121
  Object.defineProperty(exports, "OAuth", { enumerable: true, get: function () { return OAuth_js_1.OAuth; } });
135
- var Orders_js_2 = require("./resources/Orders.js");
136
- Object.defineProperty(exports, "Orders", { enumerable: true, get: function () { return Orders_js_2.Orders; } });
137
122
  var PaymentIntents_js_1 = require("./resources/PaymentIntents.js");
138
123
  Object.defineProperty(exports, "PaymentIntents", { enumerable: true, get: function () { return PaymentIntents_js_1.PaymentIntents; } });
139
124
  var PaymentLinks_js_1 = require("./resources/PaymentLinks.js");
@@ -154,8 +139,6 @@ var Products_js_2 = require("./resources/Products.js");
154
139
  Object.defineProperty(exports, "Products", { enumerable: true, get: function () { return Products_js_2.Products; } });
155
140
  var PromotionCodes_js_1 = require("./resources/PromotionCodes.js");
156
141
  Object.defineProperty(exports, "PromotionCodes", { enumerable: true, get: function () { return PromotionCodes_js_1.PromotionCodes; } });
157
- var QuotePhases_js_1 = require("./resources/QuotePhases.js");
158
- Object.defineProperty(exports, "QuotePhases", { enumerable: true, get: function () { return QuotePhases_js_1.QuotePhases; } });
159
142
  var Quotes_js_1 = require("./resources/Quotes.js");
160
143
  Object.defineProperty(exports, "Quotes", { enumerable: true, get: function () { return Quotes_js_1.Quotes; } });
161
144
  var Refunds_js_2 = require("./resources/Refunds.js");
@@ -201,11 +184,6 @@ exports.BillingPortal = (0, ResourceNamespace_js_1.resourceNamespace)('billingPo
201
184
  Configurations: Configurations_js_1.Configurations,
202
185
  Sessions: Sessions_js_1.Sessions,
203
186
  });
204
- exports.Capital = (0, ResourceNamespace_js_1.resourceNamespace)('capital', {
205
- FinancingOffers: FinancingOffers_js_1.FinancingOffers,
206
- FinancingSummary: FinancingSummary_js_1.FinancingSummary,
207
- FinancingTransactions: FinancingTransactions_js_1.FinancingTransactions,
208
- });
209
187
  exports.Checkout = (0, ResourceNamespace_js_1.resourceNamespace)('checkout', {
210
188
  Sessions: Sessions_js_2.Sessions,
211
189
  });
@@ -220,17 +198,12 @@ exports.Entitlements = (0, ResourceNamespace_js_1.resourceNamespace)('entitlemen
220
198
  });
221
199
  exports.FinancialConnections = (0, ResourceNamespace_js_1.resourceNamespace)('financialConnections', {
222
200
  Accounts: Accounts_js_1.Accounts,
223
- Institutions: Institutions_js_1.Institutions,
224
201
  Sessions: Sessions_js_3.Sessions,
225
202
  Transactions: Transactions_js_2.Transactions,
226
203
  });
227
204
  exports.Forwarding = (0, ResourceNamespace_js_1.resourceNamespace)('forwarding', {
228
205
  Requests: Requests_js_1.Requests,
229
206
  });
230
- exports.GiftCards = (0, ResourceNamespace_js_1.resourceNamespace)('giftCards', {
231
- Cards: Cards_js_2.Cards,
232
- Transactions: Transactions_js_3.Transactions,
233
- });
234
207
  exports.Identity = (0, ResourceNamespace_js_1.resourceNamespace)('identity', {
235
208
  VerificationReports: VerificationReports_js_1.VerificationReports,
236
209
  VerificationSessions: VerificationSessions_js_1.VerificationSessions,
@@ -238,13 +211,12 @@ exports.Identity = (0, ResourceNamespace_js_1.resourceNamespace)('identity', {
238
211
  exports.Issuing = (0, ResourceNamespace_js_1.resourceNamespace)('issuing', {
239
212
  Authorizations: Authorizations_js_2.Authorizations,
240
213
  Cardholders: Cardholders_js_1.Cardholders,
241
- Cards: Cards_js_3.Cards,
242
- CreditUnderwritingRecords: CreditUnderwritingRecords_js_1.CreditUnderwritingRecords,
214
+ Cards: Cards_js_2.Cards,
243
215
  Disputes: Disputes_js_1.Disputes,
244
216
  PersonalizationDesigns: PersonalizationDesigns_js_2.PersonalizationDesigns,
245
217
  PhysicalBundles: PhysicalBundles_js_1.PhysicalBundles,
246
218
  Tokens: Tokens_js_1.Tokens,
247
- Transactions: Transactions_js_4.Transactions,
219
+ Transactions: Transactions_js_3.Transactions,
248
220
  });
249
221
  exports.Radar = (0, ResourceNamespace_js_1.resourceNamespace)('radar', {
250
222
  EarlyFraudWarnings: EarlyFraudWarnings_js_1.EarlyFraudWarnings,
@@ -259,12 +231,10 @@ exports.Sigma = (0, ResourceNamespace_js_1.resourceNamespace)('sigma', {
259
231
  ScheduledQueryRuns: ScheduledQueryRuns_js_1.ScheduledQueryRuns,
260
232
  });
261
233
  exports.Tax = (0, ResourceNamespace_js_1.resourceNamespace)('tax', {
262
- Associations: Associations_js_1.Associations,
263
234
  Calculations: Calculations_js_1.Calculations,
264
- Forms: Forms_js_1.Forms,
265
235
  Registrations: Registrations_js_1.Registrations,
266
236
  Settings: Settings_js_1.Settings,
267
- Transactions: Transactions_js_5.Transactions,
237
+ Transactions: Transactions_js_4.Transactions,
268
238
  });
269
239
  exports.Terminal = (0, ResourceNamespace_js_1.resourceNamespace)('terminal', {
270
240
  Configurations: Configurations_js_2.Configurations,
@@ -304,5 +274,5 @@ exports.Treasury = (0, ResourceNamespace_js_1.resourceNamespace)('treasury', {
304
274
  ReceivedCredits: ReceivedCredits_js_2.ReceivedCredits,
305
275
  ReceivedDebits: ReceivedDebits_js_2.ReceivedDebits,
306
276
  TransactionEntries: TransactionEntries_js_1.TransactionEntries,
307
- Transactions: Transactions_js_6.Transactions,
277
+ Transactions: Transactions_js_5.Transactions,
308
278
  });
@@ -5,7 +5,7 @@ const _Error = require("./Error.js");
5
5
  const RequestSender_js_1 = require("./RequestSender.js");
6
6
  const StripeResource_js_1 = require("./StripeResource.js");
7
7
  const Webhooks_js_1 = require("./Webhooks.js");
8
- const apiVersion_js_1 = require("./apiVersion.js");
8
+ const apiVersion = require("./apiVersion.js");
9
9
  const CryptoProvider_js_1 = require("./crypto/CryptoProvider.js");
10
10
  const HttpClient_js_1 = require("./net/HttpClient.js");
11
11
  const resources = require("./resources.js");
@@ -13,7 +13,7 @@ const utils_js_1 = require("./utils.js");
13
13
  const DEFAULT_HOST = 'api.stripe.com';
14
14
  const DEFAULT_PORT = '443';
15
15
  const DEFAULT_BASE_PATH = '/v1/';
16
- const DEFAULT_API_VERSION = apiVersion_js_1.ApiVersion;
16
+ const DEFAULT_API_VERSION = apiVersion.ApiVersion;
17
17
  const DEFAULT_TIMEOUT = 80000;
18
18
  const MAX_NETWORK_RETRY_DELAY_SEC = 2;
19
19
  const INITIAL_NETWORK_RETRY_DELAY_SEC = 0.5;
@@ -34,7 +34,7 @@ const ALLOWED_CONFIG_PROPERTIES = [
34
34
  ];
35
35
  const defaultRequestSenderFactory = (stripe) => new RequestSender_js_1.RequestSender(stripe, StripeResource_js_1.StripeResource.MAX_BUFFERED_REQUEST_METRICS);
36
36
  function createStripe(platformFunctions, requestSender = defaultRequestSenderFactory) {
37
- Stripe.PACKAGE_VERSION = '16.9.0-beta.2';
37
+ Stripe.PACKAGE_VERSION = '16.9.0';
38
38
  Stripe.USER_AGENT = Object.assign({ bindings_version: Stripe.PACKAGE_VERSION, lang: 'node', publisher: 'stripe', uname: null, typescript: false }, (0, utils_js_1.determineProcessUserAgentProperties)());
39
39
  Stripe.StripeResource = StripeResource_js_1.StripeResource;
40
40
  Stripe.resources = resources;
@@ -150,9 +150,6 @@ function createStripe(platformFunctions, requestSender = defaultRequestSenderFac
150
150
  _enableTelemetry: null,
151
151
  _requestSender: null,
152
152
  _platformFunctions: null,
153
- rawRequest(method, path, params, options) {
154
- return this._requestSender._rawRequest(method, path, params, options);
155
- },
156
153
  /**
157
154
  * @private
158
155
  */
package/cjs/utils.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.jsonStringifyRequestData = 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.queryStringifyRequestData = exports.isOptionsHash = void 0;
3
+ 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;
4
4
  const qs = require("qs");
5
5
  const OPTIONS_KEYS = [
6
6
  'apiKey',
@@ -10,8 +10,6 @@ const OPTIONS_KEYS = [
10
10
  'maxNetworkRetries',
11
11
  'timeout',
12
12
  'host',
13
- 'apiMode',
14
- 'additionalHeaders',
15
13
  ];
16
14
  function isOptionsHash(o) {
17
15
  return (o &&
@@ -23,7 +21,7 @@ exports.isOptionsHash = isOptionsHash;
23
21
  * Stringifies an Object, accommodating nested objects
24
22
  * (forming the conventional key 'parent[child]=value')
25
23
  */
26
- function queryStringifyRequestData(data) {
24
+ function stringifyRequestData(data) {
27
25
  return (qs
28
26
  .stringify(data, {
29
27
  serializeDate: (d) => Math.floor(d.getTime() / 1000).toString(),
@@ -34,7 +32,7 @@ function queryStringifyRequestData(data) {
34
32
  .replace(/%5B/g, '[')
35
33
  .replace(/%5D/g, ']'));
36
34
  }
37
- exports.queryStringifyRequestData = queryStringifyRequestData;
35
+ exports.stringifyRequestData = stringifyRequestData;
38
36
  /**
39
37
  * Outputs a new function with interpolated object property values.
40
38
  * Use like so:
@@ -133,15 +131,6 @@ function getOptionsFromArgs(args) {
133
131
  if (params.host) {
134
132
  opts.host = params.host;
135
133
  }
136
- if (params.apiMode) {
137
- if (params.apiMode !== 'standard' && params.apiMode !== 'preview') {
138
- throw new Error(`Invalid apiMode: ${params.apiMode}. Must be one of 'standard' or 'preview'`);
139
- }
140
- opts.apiMode = params.apiMode;
141
- }
142
- if (params.additionalHeaders) {
143
- opts.headers = params.additionalHeaders;
144
- }
145
134
  }
146
135
  }
147
136
  return opts;
@@ -314,19 +303,3 @@ function concat(arrays) {
314
303
  return merged;
315
304
  }
316
305
  exports.concat = concat;
317
- /**
318
- * Replaces Date objects with Unix timestamps
319
- */
320
- function dateTimeReplacer(key, value) {
321
- if (this[key] instanceof Date) {
322
- return Math.floor(this[key].getTime() / 1000).toString();
323
- }
324
- return value;
325
- }
326
- /**
327
- * JSON stringifies an Object, replacing Date objects with Unix timestamps
328
- */
329
- function jsonStringifyRequestData(data) {
330
- return JSON.stringify(data, dateTimeReplacer);
331
- }
332
- exports.jsonStringifyRequestData = jsonStringifyRequestData;