stripe 16.4.0-beta.1 → 16.5.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 (159) hide show
  1. package/CHANGELOG.md +145 -767
  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/Checkout/Sessions.js +4 -0
  9. package/cjs/resources/FinancialConnections/Accounts.js +0 -5
  10. package/cjs/resources/Invoices.js +0 -13
  11. package/cjs/resources/OAuth.js +1 -1
  12. package/cjs/resources/PaymentIntents.js +0 -4
  13. package/cjs/resources/Quotes.js +0 -32
  14. package/cjs/resources/SubscriptionSchedules.js +0 -4
  15. package/cjs/resources/Terminal/Readers.js +0 -12
  16. package/cjs/resources.js +10 -38
  17. package/cjs/stripe.core.js +3 -6
  18. package/cjs/utils.js +3 -30
  19. package/esm/RequestSender.js +6 -67
  20. package/esm/StripeResource.js +2 -2
  21. package/esm/apiVersion.js +0 -1
  22. package/esm/multipart.js +2 -2
  23. package/esm/resources/Checkout/Sessions.js +4 -0
  24. package/esm/resources/FinancialConnections/Accounts.js +0 -5
  25. package/esm/resources/Invoices.js +0 -13
  26. package/esm/resources/OAuth.js +2 -2
  27. package/esm/resources/PaymentIntents.js +0 -4
  28. package/esm/resources/Quotes.js +0 -32
  29. package/esm/resources/SubscriptionSchedules.js +0 -4
  30. package/esm/resources/Terminal/Readers.js +0 -12
  31. package/esm/resources.js +0 -24
  32. package/esm/stripe.core.js +3 -6
  33. package/esm/utils.js +1 -27
  34. package/package.json +1 -1
  35. package/types/AccountLinksResource.d.ts +1 -5
  36. package/types/AccountSessions.d.ts +30 -15
  37. package/types/AccountSessionsResource.d.ts +0 -163
  38. package/types/Accounts.d.ts +4 -91
  39. package/types/AccountsResource.d.ts +26 -230
  40. package/types/Charges.d.ts +38 -69
  41. package/types/ChargesResource.d.ts +0 -1294
  42. package/types/Checkout/Sessions.d.ts +1 -28
  43. package/types/Checkout/SessionsResource.d.ts +22 -15
  44. package/types/ConfirmationTokens.d.ts +23 -62
  45. package/types/Coupons.d.ts +1 -1
  46. package/types/CouponsResource.d.ts +1 -1
  47. package/types/CreditNotes.d.ts +0 -21
  48. package/types/CreditNotesResource.d.ts +0 -51
  49. package/types/CustomersResource.d.ts +0 -2
  50. package/types/Disputes.d.ts +9 -168
  51. package/types/DisputesResource.d.ts +3 -120
  52. package/types/EventTypes.d.ts +47 -422
  53. package/types/Events.d.ts +3 -83
  54. package/types/EventsResource.d.ts +1 -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/Identity/VerificationReports.d.ts +1 -1
  60. package/types/InvoiceItems.d.ts +0 -5
  61. package/types/InvoiceItemsResource.d.ts +0 -98
  62. package/types/InvoiceLineItems.d.ts +0 -22
  63. package/types/Invoices.d.ts +2 -116
  64. package/types/InvoicesResource.d.ts +1784 -5359
  65. package/types/Issuing/CardholdersResource.d.ts +1 -2
  66. package/types/LineItems.d.ts +0 -7
  67. package/types/Mandates.d.ts +0 -77
  68. package/types/PaymentIntents.d.ts +2 -470
  69. package/types/PaymentIntentsResource.d.ts +3377 -6725
  70. package/types/PaymentMethodConfigurations.d.ts +36 -0
  71. package/types/PaymentMethodConfigurationsResource.d.ts +50 -0
  72. package/types/PaymentMethodDomains.d.ts +1 -1
  73. package/types/PaymentMethods.d.ts +18 -62
  74. package/types/PaymentMethodsResource.d.ts +0 -110
  75. package/types/Prices.d.ts +0 -22
  76. package/types/PricesResource.d.ts +0 -22
  77. package/types/Products.d.ts +0 -39
  78. package/types/ProductsResource.d.ts +0 -36
  79. package/types/Quotes.d.ts +1 -578
  80. package/types/QuotesResource.d.ts +266 -3175
  81. package/types/RefundsResource.d.ts +1 -1
  82. package/types/SetupAttempts.d.ts +0 -9
  83. package/types/SetupIntents.d.ts +1 -110
  84. package/types/SetupIntentsResource.d.ts +3 -498
  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 -164
  89. package/types/SubscriptionSchedulesResource.d.ts +13 -1231
  90. package/types/Subscriptions.d.ts +3 -47
  91. package/types/SubscriptionsResource.d.ts +6 -349
  92. package/types/Tax/Calculations.d.ts +1 -1
  93. package/types/Tax/CalculationsResource.d.ts +1 -3
  94. package/types/Terminal/Readers.d.ts +2 -279
  95. package/types/Terminal/ReadersResource.d.ts +1 -208
  96. package/types/TestHelpers/ConfirmationTokensResource.d.ts +0 -55
  97. package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +0 -26
  98. package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +0 -26
  99. package/types/TokensResource.d.ts +7 -7
  100. package/types/Treasury/OutboundTransfers.d.ts +0 -26
  101. package/types/Treasury/OutboundTransfersResource.d.ts +0 -26
  102. package/types/Treasury/ReceivedCredits.d.ts +0 -26
  103. package/types/Treasury/ReceivedDebits.d.ts +0 -31
  104. package/types/WebhookEndpointsResource.d.ts +6 -50
  105. package/types/index.d.ts +0 -64
  106. package/types/lib.d.ts +0 -12
  107. package/cjs/resources/AccountNotices.js +0 -21
  108. package/cjs/resources/Capital/FinancingOffers.js +0 -21
  109. package/cjs/resources/Capital/FinancingSummary.js +0 -12
  110. package/cjs/resources/Capital/FinancingTransactions.js +0 -17
  111. package/cjs/resources/FinancialConnections/Institutions.js +0 -17
  112. package/cjs/resources/GiftCards/Cards.js +0 -23
  113. package/cjs/resources/GiftCards/Transactions.js +0 -33
  114. package/cjs/resources/Issuing/CreditUnderwritingRecords.js +0 -33
  115. package/cjs/resources/Margins.js +0 -22
  116. package/cjs/resources/Orders.js +0 -24
  117. package/cjs/resources/QuotePhases.js +0 -22
  118. package/cjs/resources/Tax/Forms.js +0 -20
  119. package/esm/resources/AccountNotices.js +0 -18
  120. package/esm/resources/Capital/FinancingOffers.js +0 -18
  121. package/esm/resources/Capital/FinancingSummary.js +0 -9
  122. package/esm/resources/Capital/FinancingTransactions.js +0 -14
  123. package/esm/resources/FinancialConnections/Institutions.js +0 -14
  124. package/esm/resources/GiftCards/Cards.js +0 -20
  125. package/esm/resources/GiftCards/Transactions.js +0 -30
  126. package/esm/resources/Issuing/CreditUnderwritingRecords.js +0 -30
  127. package/esm/resources/Margins.js +0 -19
  128. package/esm/resources/Orders.js +0 -21
  129. package/esm/resources/QuotePhases.js +0 -19
  130. package/esm/resources/Tax/Forms.js +0 -17
  131. package/types/AccountNotices.d.ts +0 -110
  132. package/types/AccountNoticesResource.d.ts +0 -98
  133. package/types/Capital/FinancingOffers.d.ts +0 -188
  134. package/types/Capital/FinancingOffersResource.d.ts +0 -97
  135. package/types/Capital/FinancingSummary.d.ts +0 -106
  136. package/types/Capital/FinancingSummaryResource.d.ts +0 -27
  137. package/types/Capital/FinancingTransactions.d.ts +0 -135
  138. package/types/Capital/FinancingTransactionsResource.d.ts +0 -68
  139. package/types/FinancialConnections/AccountInferredBalances.d.ts +0 -38
  140. package/types/FinancialConnections/Institutions.d.ts +0 -93
  141. package/types/FinancialConnections/InstitutionsResource.d.ts +0 -47
  142. package/types/GiftCards/Cards.d.ts +0 -118
  143. package/types/GiftCards/CardsResource.d.ts +0 -159
  144. package/types/GiftCards/Transactions.d.ts +0 -129
  145. package/types/GiftCards/TransactionsResource.d.ts +0 -201
  146. package/types/InvoicePayments.d.ts +0 -91
  147. package/types/Issuing/CreditUnderwritingRecords.d.ts +0 -446
  148. package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +0 -1017
  149. package/types/Margins.d.ts +0 -56
  150. package/types/MarginsResource.d.ts +0 -114
  151. package/types/Orders.d.ts +0 -1057
  152. package/types/OrdersResource.d.ts +0 -2711
  153. package/types/QuoteLines.d.ts +0 -634
  154. package/types/QuotePhases.d.ts +0 -198
  155. package/types/QuotePhasesResource.d.ts +0 -67
  156. package/types/QuotePreviewInvoices.d.ts +0 -1530
  157. package/types/QuotePreviewSubscriptionSchedules.d.ts +0 -778
  158. package/types/Tax/Forms.d.ts +0 -133
  159. 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.4.0-beta.1
1
+ 16.5.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-05-23.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)
@@ -10,6 +10,10 @@ exports.Sessions = StripeResource_js_1.StripeResource.extend({
10
10
  method: 'GET',
11
11
  fullPath: '/v1/checkout/sessions/{session}',
12
12
  }),
13
+ update: stripeMethod({
14
+ method: 'POST',
15
+ fullPath: '/v1/checkout/sessions/{session}',
16
+ }),
13
17
  list: stripeMethod({
14
18
  method: 'GET',
15
19
  fullPath: '/v1/checkout/sessions',
@@ -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,10 +18,6 @@ exports.Invoices = StripeResource_js_1.StripeResource.extend({
18
18
  method: 'POST',
19
19
  fullPath: '/v1/invoices/{invoice}/add_lines',
20
20
  }),
21
- attachPaymentIntent: stripeMethod({
22
- method: 'POST',
23
- fullPath: '/v1/invoices/{invoice}/attach_payment_intent',
24
- }),
25
21
  createPreview: stripeMethod({
26
22
  method: 'POST',
27
23
  fullPath: '/v1/invoices/create_preview',
@@ -35,11 +31,6 @@ exports.Invoices = StripeResource_js_1.StripeResource.extend({
35
31
  fullPath: '/v1/invoices/{invoice}/lines',
36
32
  methodType: 'list',
37
33
  }),
38
- listPayments: stripeMethod({
39
- method: 'GET',
40
- fullPath: '/v1/invoices/{invoice}/payments',
41
- methodType: 'list',
42
- }),
43
34
  listUpcomingLines: stripeMethod({
44
35
  method: 'GET',
45
36
  fullPath: '/v1/invoices/upcoming/lines',
@@ -54,10 +45,6 @@ exports.Invoices = StripeResource_js_1.StripeResource.extend({
54
45
  method: 'POST',
55
46
  fullPath: '/v1/invoices/{invoice}/remove_lines',
56
47
  }),
57
- retrievePayment: stripeMethod({
58
- method: 'GET',
59
- fullPath: '/v1/invoices/{invoice}/payments/{invoice_payment}',
60
- }),
61
48
  retrieveUpcoming: stripeMethod({
62
49
  method: 'GET',
63
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,8 +1,8 @@
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");
@@ -11,27 +11,20 @@ const Authorizations_js_2 = require("./resources/Issuing/Authorizations.js");
11
11
  const Calculations_js_1 = require("./resources/Tax/Calculations.js");
12
12
  const Cardholders_js_1 = require("./resources/Issuing/Cardholders.js");
13
13
  const Cards_js_1 = require("./resources/TestHelpers/Issuing/Cards.js");
14
- const Cards_js_2 = require("./resources/GiftCards/Cards.js");
15
- const Cards_js_3 = require("./resources/Issuing/Cards.js");
14
+ const Cards_js_2 = require("./resources/Issuing/Cards.js");
16
15
  const Configurations_js_1 = require("./resources/BillingPortal/Configurations.js");
17
16
  const Configurations_js_2 = require("./resources/Terminal/Configurations.js");
18
17
  const ConfirmationTokens_js_1 = require("./resources/TestHelpers/ConfirmationTokens.js");
19
18
  const ConnectionTokens_js_1 = require("./resources/Terminal/ConnectionTokens.js");
20
19
  const CreditReversals_js_1 = require("./resources/Treasury/CreditReversals.js");
21
- const CreditUnderwritingRecords_js_1 = require("./resources/Issuing/CreditUnderwritingRecords.js");
22
20
  const Customers_js_1 = require("./resources/TestHelpers/Customers.js");
23
21
  const DebitReversals_js_1 = require("./resources/Treasury/DebitReversals.js");
24
22
  const Disputes_js_1 = require("./resources/Issuing/Disputes.js");
25
23
  const EarlyFraudWarnings_js_1 = require("./resources/Radar/EarlyFraudWarnings.js");
26
24
  const Features_js_1 = require("./resources/Entitlements/Features.js");
27
25
  const FinancialAccounts_js_1 = require("./resources/Treasury/FinancialAccounts.js");
28
- const FinancingOffers_js_1 = require("./resources/Capital/FinancingOffers.js");
29
- const FinancingSummary_js_1 = require("./resources/Capital/FinancingSummary.js");
30
- const FinancingTransactions_js_1 = require("./resources/Capital/FinancingTransactions.js");
31
- const Forms_js_1 = require("./resources/Tax/Forms.js");
32
26
  const InboundTransfers_js_1 = require("./resources/TestHelpers/Treasury/InboundTransfers.js");
33
27
  const InboundTransfers_js_2 = require("./resources/Treasury/InboundTransfers.js");
34
- const Institutions_js_1 = require("./resources/FinancialConnections/Institutions.js");
35
28
  const Locations_js_1 = require("./resources/Terminal/Locations.js");
36
29
  const MeterEventAdjustments_js_1 = require("./resources/Billing/MeterEventAdjustments.js");
37
30
  const MeterEvents_js_1 = require("./resources/Billing/MeterEvents.js");
@@ -68,10 +61,9 @@ const Tokens_js_1 = require("./resources/Issuing/Tokens.js");
68
61
  const TransactionEntries_js_1 = require("./resources/Treasury/TransactionEntries.js");
69
62
  const Transactions_js_1 = require("./resources/TestHelpers/Issuing/Transactions.js");
70
63
  const Transactions_js_2 = require("./resources/FinancialConnections/Transactions.js");
71
- const Transactions_js_3 = require("./resources/GiftCards/Transactions.js");
72
- const Transactions_js_4 = require("./resources/Issuing/Transactions.js");
73
- const Transactions_js_5 = require("./resources/Tax/Transactions.js");
74
- const Transactions_js_6 = require("./resources/Treasury/Transactions.js");
64
+ const Transactions_js_3 = require("./resources/Issuing/Transactions.js");
65
+ const Transactions_js_4 = require("./resources/Tax/Transactions.js");
66
+ const Transactions_js_5 = require("./resources/Treasury/Transactions.js");
75
67
  const ValueListItems_js_1 = require("./resources/Radar/ValueListItems.js");
76
68
  const ValueLists_js_1 = require("./resources/Radar/ValueLists.js");
77
69
  const VerificationReports_js_1 = require("./resources/Identity/VerificationReports.js");
@@ -80,8 +72,6 @@ var Accounts_js_2 = require("./resources/Accounts.js");
80
72
  Object.defineProperty(exports, "Account", { enumerable: true, get: function () { return Accounts_js_2.Accounts; } });
81
73
  var AccountLinks_js_1 = require("./resources/AccountLinks.js");
82
74
  Object.defineProperty(exports, "AccountLinks", { enumerable: true, get: function () { return AccountLinks_js_1.AccountLinks; } });
83
- var AccountNotices_js_1 = require("./resources/AccountNotices.js");
84
- Object.defineProperty(exports, "AccountNotices", { enumerable: true, get: function () { return AccountNotices_js_1.AccountNotices; } });
85
75
  var AccountSessions_js_1 = require("./resources/AccountSessions.js");
86
76
  Object.defineProperty(exports, "AccountSessions", { enumerable: true, get: function () { return AccountSessions_js_1.AccountSessions; } });
87
77
  var Accounts_js_3 = require("./resources/Accounts.js");
@@ -126,12 +116,8 @@ var Invoices_js_1 = require("./resources/Invoices.js");
126
116
  Object.defineProperty(exports, "Invoices", { enumerable: true, get: function () { return Invoices_js_1.Invoices; } });
127
117
  var Mandates_js_1 = require("./resources/Mandates.js");
128
118
  Object.defineProperty(exports, "Mandates", { enumerable: true, get: function () { return Mandates_js_1.Mandates; } });
129
- var Margins_js_1 = require("./resources/Margins.js");
130
- Object.defineProperty(exports, "Margins", { enumerable: true, get: function () { return Margins_js_1.Margins; } });
131
119
  var OAuth_js_1 = require("./resources/OAuth.js");
132
120
  Object.defineProperty(exports, "OAuth", { enumerable: true, get: function () { return OAuth_js_1.OAuth; } });
133
- var Orders_js_2 = require("./resources/Orders.js");
134
- Object.defineProperty(exports, "Orders", { enumerable: true, get: function () { return Orders_js_2.Orders; } });
135
121
  var PaymentIntents_js_1 = require("./resources/PaymentIntents.js");
136
122
  Object.defineProperty(exports, "PaymentIntents", { enumerable: true, get: function () { return PaymentIntents_js_1.PaymentIntents; } });
137
123
  var PaymentLinks_js_1 = require("./resources/PaymentLinks.js");
@@ -152,8 +138,6 @@ var Products_js_2 = require("./resources/Products.js");
152
138
  Object.defineProperty(exports, "Products", { enumerable: true, get: function () { return Products_js_2.Products; } });
153
139
  var PromotionCodes_js_1 = require("./resources/PromotionCodes.js");
154
140
  Object.defineProperty(exports, "PromotionCodes", { enumerable: true, get: function () { return PromotionCodes_js_1.PromotionCodes; } });
155
- var QuotePhases_js_1 = require("./resources/QuotePhases.js");
156
- Object.defineProperty(exports, "QuotePhases", { enumerable: true, get: function () { return QuotePhases_js_1.QuotePhases; } });
157
141
  var Quotes_js_1 = require("./resources/Quotes.js");
158
142
  Object.defineProperty(exports, "Quotes", { enumerable: true, get: function () { return Quotes_js_1.Quotes; } });
159
143
  var Refunds_js_2 = require("./resources/Refunds.js");
@@ -198,11 +182,6 @@ exports.BillingPortal = (0, ResourceNamespace_js_1.resourceNamespace)('billingPo
198
182
  Configurations: Configurations_js_1.Configurations,
199
183
  Sessions: Sessions_js_1.Sessions,
200
184
  });
201
- exports.Capital = (0, ResourceNamespace_js_1.resourceNamespace)('capital', {
202
- FinancingOffers: FinancingOffers_js_1.FinancingOffers,
203
- FinancingSummary: FinancingSummary_js_1.FinancingSummary,
204
- FinancingTransactions: FinancingTransactions_js_1.FinancingTransactions,
205
- });
206
185
  exports.Checkout = (0, ResourceNamespace_js_1.resourceNamespace)('checkout', {
207
186
  Sessions: Sessions_js_2.Sessions,
208
187
  });
@@ -217,17 +196,12 @@ exports.Entitlements = (0, ResourceNamespace_js_1.resourceNamespace)('entitlemen
217
196
  });
218
197
  exports.FinancialConnections = (0, ResourceNamespace_js_1.resourceNamespace)('financialConnections', {
219
198
  Accounts: Accounts_js_1.Accounts,
220
- Institutions: Institutions_js_1.Institutions,
221
199
  Sessions: Sessions_js_3.Sessions,
222
200
  Transactions: Transactions_js_2.Transactions,
223
201
  });
224
202
  exports.Forwarding = (0, ResourceNamespace_js_1.resourceNamespace)('forwarding', {
225
203
  Requests: Requests_js_1.Requests,
226
204
  });
227
- exports.GiftCards = (0, ResourceNamespace_js_1.resourceNamespace)('giftCards', {
228
- Cards: Cards_js_2.Cards,
229
- Transactions: Transactions_js_3.Transactions,
230
- });
231
205
  exports.Identity = (0, ResourceNamespace_js_1.resourceNamespace)('identity', {
232
206
  VerificationReports: VerificationReports_js_1.VerificationReports,
233
207
  VerificationSessions: VerificationSessions_js_1.VerificationSessions,
@@ -235,13 +209,12 @@ exports.Identity = (0, ResourceNamespace_js_1.resourceNamespace)('identity', {
235
209
  exports.Issuing = (0, ResourceNamespace_js_1.resourceNamespace)('issuing', {
236
210
  Authorizations: Authorizations_js_2.Authorizations,
237
211
  Cardholders: Cardholders_js_1.Cardholders,
238
- Cards: Cards_js_3.Cards,
239
- CreditUnderwritingRecords: CreditUnderwritingRecords_js_1.CreditUnderwritingRecords,
212
+ Cards: Cards_js_2.Cards,
240
213
  Disputes: Disputes_js_1.Disputes,
241
214
  PersonalizationDesigns: PersonalizationDesigns_js_2.PersonalizationDesigns,
242
215
  PhysicalBundles: PhysicalBundles_js_1.PhysicalBundles,
243
216
  Tokens: Tokens_js_1.Tokens,
244
- Transactions: Transactions_js_4.Transactions,
217
+ Transactions: Transactions_js_3.Transactions,
245
218
  });
246
219
  exports.Radar = (0, ResourceNamespace_js_1.resourceNamespace)('radar', {
247
220
  EarlyFraudWarnings: EarlyFraudWarnings_js_1.EarlyFraudWarnings,
@@ -257,10 +230,9 @@ exports.Sigma = (0, ResourceNamespace_js_1.resourceNamespace)('sigma', {
257
230
  });
258
231
  exports.Tax = (0, ResourceNamespace_js_1.resourceNamespace)('tax', {
259
232
  Calculations: Calculations_js_1.Calculations,
260
- Forms: Forms_js_1.Forms,
261
233
  Registrations: Registrations_js_1.Registrations,
262
234
  Settings: Settings_js_1.Settings,
263
- Transactions: Transactions_js_5.Transactions,
235
+ Transactions: Transactions_js_4.Transactions,
264
236
  });
265
237
  exports.Terminal = (0, ResourceNamespace_js_1.resourceNamespace)('terminal', {
266
238
  Configurations: Configurations_js_2.Configurations,
@@ -300,5 +272,5 @@ exports.Treasury = (0, ResourceNamespace_js_1.resourceNamespace)('treasury', {
300
272
  ReceivedCredits: ReceivedCredits_js_2.ReceivedCredits,
301
273
  ReceivedDebits: ReceivedDebits_js_2.ReceivedDebits,
302
274
  TransactionEntries: TransactionEntries_js_1.TransactionEntries,
303
- Transactions: Transactions_js_6.Transactions,
275
+ Transactions: Transactions_js_5.Transactions,
304
276
  });
@@ -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.4.0-beta.1';
37
+ Stripe.PACKAGE_VERSION = '16.5.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;
@@ -316,19 +305,3 @@ function concat(arrays) {
316
305
  return merged;
317
306
  }
318
307
  exports.concat = concat;
319
- /**
320
- * Replaces Date objects with Unix timestamps
321
- */
322
- function dateTimeReplacer(key, value) {
323
- if (this[key] instanceof Date) {
324
- return Math.floor(this[key].getTime() / 1000).toString();
325
- }
326
- return value;
327
- }
328
- /**
329
- * JSON stringifies an Object, replacing Date objects with Unix timestamps
330
- */
331
- function jsonStringifyRequestData(data) {
332
- return JSON.stringify(data, dateTimeReplacer);
333
- }
334
- exports.jsonStringifyRequestData = jsonStringifyRequestData;