stripe 16.6.0-beta.1 → 16.6.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 +116 -778
  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 -13
  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 -42
  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 -13
  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 -28
  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 +1 -5
  34. package/types/AccountSessions.d.ts +0 -15
  35. package/types/AccountSessionsResource.d.ts +0 -163
  36. package/types/Accounts.d.ts +1 -106
  37. package/types/AccountsResource.d.ts +0 -246
  38. package/types/Charges.d.ts +0 -72
  39. package/types/ChargesResource.d.ts +0 -1294
  40. package/types/Checkout/Sessions.d.ts +62 -29
  41. package/types/Checkout/SessionsResource.d.ts +64 -16
  42. package/types/ConfirmationTokens.d.ts +0 -62
  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 -2
  48. package/types/Disputes.d.ts +0 -168
  49. package/types/DisputesResource.d.ts +0 -120
  50. package/types/EventTypes.d.ts +0 -426
  51. package/types/Events.d.ts +0 -83
  52. package/types/FinancialConnections/Accounts.d.ts +3 -31
  53. package/types/FinancialConnections/AccountsResource.d.ts +3 -35
  54. package/types/FinancialConnections/Sessions.d.ts +1 -49
  55. package/types/FinancialConnections/SessionsResource.d.ts +1 -38
  56. package/types/InvoiceItems.d.ts +0 -5
  57. package/types/InvoiceItemsResource.d.ts +0 -98
  58. package/types/InvoiceLineItems.d.ts +0 -22
  59. package/types/Invoices.d.ts +2 -116
  60. package/types/InvoicesResource.d.ts +1782 -5359
  61. package/types/Issuing/CardholdersResource.d.ts +1 -2
  62. package/types/LineItems.d.ts +0 -7
  63. package/types/Mandates.d.ts +0 -77
  64. package/types/PaymentIntents.d.ts +79 -491
  65. package/types/PaymentIntentsResource.d.ts +3625 -6925
  66. package/types/PaymentMethodConfigurations.d.ts +0 -36
  67. package/types/PaymentMethodConfigurationsResource.d.ts +0 -50
  68. package/types/PaymentMethods.d.ts +0 -62
  69. package/types/PaymentMethodsResource.d.ts +0 -110
  70. package/types/Prices.d.ts +0 -22
  71. package/types/PricesResource.d.ts +0 -22
  72. package/types/Products.d.ts +0 -39
  73. package/types/ProductsResource.d.ts +0 -36
  74. package/types/Quotes.d.ts +1 -578
  75. package/types/QuotesResource.d.ts +266 -3175
  76. package/types/SetupAttempts.d.ts +1 -9
  77. package/types/SetupIntents.d.ts +3 -111
  78. package/types/SetupIntentsResource.d.ts +4 -499
  79. package/types/Sources.d.ts +0 -23
  80. package/types/SubscriptionItems.d.ts +0 -21
  81. package/types/SubscriptionItemsResource.d.ts +1 -110
  82. package/types/SubscriptionSchedules.d.ts +0 -164
  83. package/types/SubscriptionSchedulesResource.d.ts +13 -1231
  84. package/types/Subscriptions.d.ts +1 -46
  85. package/types/SubscriptionsResource.d.ts +4 -349
  86. package/types/Terminal/Readers.d.ts +0 -278
  87. package/types/Terminal/ReadersResource.d.ts +0 -208
  88. package/types/TestHelpers/ConfirmationTokensResource.d.ts +0 -55
  89. package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +0 -26
  90. package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +0 -26
  91. package/types/Treasury/FinancialAccounts.d.ts +0 -5
  92. package/types/Treasury/FinancialAccountsResource.d.ts +0 -10
  93. package/types/Treasury/OutboundTransfers.d.ts +0 -26
  94. package/types/Treasury/OutboundTransfersResource.d.ts +0 -26
  95. package/types/Treasury/ReceivedCredits.d.ts +0 -26
  96. package/types/Treasury/ReceivedDebits.d.ts +0 -31
  97. package/types/WebhookEndpointsResource.d.ts +0 -50
  98. package/types/index.d.ts +0 -69
  99. package/types/lib.d.ts +0 -12
  100. package/cjs/resources/AccountNotices.js +0 -21
  101. package/cjs/resources/Billing/Alerts.js +0 -27
  102. package/cjs/resources/Capital/FinancingOffers.js +0 -21
  103. package/cjs/resources/Capital/FinancingSummary.js +0 -12
  104. package/cjs/resources/Capital/FinancingTransactions.js +0 -17
  105. package/cjs/resources/FinancialConnections/Institutions.js +0 -17
  106. package/cjs/resources/GiftCards/Cards.js +0 -23
  107. package/cjs/resources/GiftCards/Transactions.js +0 -33
  108. package/cjs/resources/Issuing/CreditUnderwritingRecords.js +0 -33
  109. package/cjs/resources/Margins.js +0 -22
  110. package/cjs/resources/Orders.js +0 -24
  111. package/cjs/resources/QuotePhases.js +0 -22
  112. package/cjs/resources/Tax/Associations.js +0 -9
  113. package/cjs/resources/Tax/Forms.js +0 -20
  114. package/esm/resources/AccountNotices.js +0 -18
  115. package/esm/resources/Billing/Alerts.js +0 -24
  116. package/esm/resources/Capital/FinancingOffers.js +0 -18
  117. package/esm/resources/Capital/FinancingSummary.js +0 -9
  118. package/esm/resources/Capital/FinancingTransactions.js +0 -14
  119. package/esm/resources/FinancialConnections/Institutions.js +0 -14
  120. package/esm/resources/GiftCards/Cards.js +0 -20
  121. package/esm/resources/GiftCards/Transactions.js +0 -30
  122. package/esm/resources/Issuing/CreditUnderwritingRecords.js +0 -30
  123. package/esm/resources/Margins.js +0 -19
  124. package/esm/resources/Orders.js +0 -21
  125. package/esm/resources/QuotePhases.js +0 -19
  126. package/esm/resources/Tax/Associations.js +0 -6
  127. package/esm/resources/Tax/Forms.js +0 -17
  128. package/types/AccountNotices.d.ts +0 -113
  129. package/types/AccountNoticesResource.d.ts +0 -98
  130. package/types/Billing/AlertsResource.d.ts +0 -176
  131. package/types/Capital/FinancingOffers.d.ts +0 -188
  132. package/types/Capital/FinancingOffersResource.d.ts +0 -97
  133. package/types/Capital/FinancingSummary.d.ts +0 -106
  134. package/types/Capital/FinancingSummaryResource.d.ts +0 -27
  135. package/types/Capital/FinancingTransactions.d.ts +0 -135
  136. package/types/Capital/FinancingTransactionsResource.d.ts +0 -68
  137. package/types/FinancialConnections/AccountInferredBalances.d.ts +0 -38
  138. package/types/FinancialConnections/Institutions.d.ts +0 -93
  139. package/types/FinancialConnections/InstitutionsResource.d.ts +0 -47
  140. package/types/GiftCards/Cards.d.ts +0 -118
  141. package/types/GiftCards/CardsResource.d.ts +0 -159
  142. package/types/GiftCards/Transactions.d.ts +0 -129
  143. package/types/GiftCards/TransactionsResource.d.ts +0 -201
  144. package/types/InvoicePayments.d.ts +0 -138
  145. package/types/Issuing/CreditUnderwritingRecords.d.ts +0 -446
  146. package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +0 -1017
  147. package/types/Margins.d.ts +0 -56
  148. package/types/MarginsResource.d.ts +0 -114
  149. package/types/Orders.d.ts +0 -1057
  150. package/types/OrdersResource.d.ts +0 -2711
  151. package/types/QuoteLines.d.ts +0 -634
  152. package/types/QuotePhases.d.ts +0 -198
  153. package/types/QuotePhasesResource.d.ts +0 -67
  154. package/types/QuotePreviewInvoices.d.ts +0 -1528
  155. package/types/QuotePreviewSubscriptionSchedules.d.ts +0 -778
  156. package/types/Tax/Associations.d.ts +0 -126
  157. package/types/Tax/AssociationsResource.d.ts +0 -29
  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.6.0-beta.1
1
+ 16.6.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-07-16.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,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,39 +1,30 @@
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
- const Alerts_js_1 = require("./resources/Billing/Alerts.js");
10
- const Associations_js_1 = require("./resources/Tax/Associations.js");
11
9
  const Authorizations_js_1 = require("./resources/TestHelpers/Issuing/Authorizations.js");
12
10
  const Authorizations_js_2 = require("./resources/Issuing/Authorizations.js");
13
11
  const Calculations_js_1 = require("./resources/Tax/Calculations.js");
14
12
  const Cardholders_js_1 = require("./resources/Issuing/Cardholders.js");
15
13
  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");
14
+ const Cards_js_2 = require("./resources/Issuing/Cards.js");
18
15
  const Configurations_js_1 = require("./resources/BillingPortal/Configurations.js");
19
16
  const Configurations_js_2 = require("./resources/Terminal/Configurations.js");
20
17
  const ConfirmationTokens_js_1 = require("./resources/TestHelpers/ConfirmationTokens.js");
21
18
  const ConnectionTokens_js_1 = require("./resources/Terminal/ConnectionTokens.js");
22
19
  const CreditReversals_js_1 = require("./resources/Treasury/CreditReversals.js");
23
- const CreditUnderwritingRecords_js_1 = require("./resources/Issuing/CreditUnderwritingRecords.js");
24
20
  const Customers_js_1 = require("./resources/TestHelpers/Customers.js");
25
21
  const DebitReversals_js_1 = require("./resources/Treasury/DebitReversals.js");
26
22
  const Disputes_js_1 = require("./resources/Issuing/Disputes.js");
27
23
  const EarlyFraudWarnings_js_1 = require("./resources/Radar/EarlyFraudWarnings.js");
28
24
  const Features_js_1 = require("./resources/Entitlements/Features.js");
29
25
  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
26
  const InboundTransfers_js_1 = require("./resources/TestHelpers/Treasury/InboundTransfers.js");
35
27
  const InboundTransfers_js_2 = require("./resources/Treasury/InboundTransfers.js");
36
- const Institutions_js_1 = require("./resources/FinancialConnections/Institutions.js");
37
28
  const Locations_js_1 = require("./resources/Terminal/Locations.js");
38
29
  const MeterEventAdjustments_js_1 = require("./resources/Billing/MeterEventAdjustments.js");
39
30
  const MeterEvents_js_1 = require("./resources/Billing/MeterEvents.js");
@@ -70,10 +61,9 @@ const Tokens_js_1 = require("./resources/Issuing/Tokens.js");
70
61
  const TransactionEntries_js_1 = require("./resources/Treasury/TransactionEntries.js");
71
62
  const Transactions_js_1 = require("./resources/TestHelpers/Issuing/Transactions.js");
72
63
  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");
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");
77
67
  const ValueListItems_js_1 = require("./resources/Radar/ValueListItems.js");
78
68
  const ValueLists_js_1 = require("./resources/Radar/ValueLists.js");
79
69
  const VerificationReports_js_1 = require("./resources/Identity/VerificationReports.js");
@@ -82,8 +72,6 @@ var Accounts_js_2 = require("./resources/Accounts.js");
82
72
  Object.defineProperty(exports, "Account", { enumerable: true, get: function () { return Accounts_js_2.Accounts; } });
83
73
  var AccountLinks_js_1 = require("./resources/AccountLinks.js");
84
74
  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
75
  var AccountSessions_js_1 = require("./resources/AccountSessions.js");
88
76
  Object.defineProperty(exports, "AccountSessions", { enumerable: true, get: function () { return AccountSessions_js_1.AccountSessions; } });
89
77
  var Accounts_js_3 = require("./resources/Accounts.js");
@@ -128,12 +116,8 @@ var Invoices_js_1 = require("./resources/Invoices.js");
128
116
  Object.defineProperty(exports, "Invoices", { enumerable: true, get: function () { return Invoices_js_1.Invoices; } });
129
117
  var Mandates_js_1 = require("./resources/Mandates.js");
130
118
  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
119
  var OAuth_js_1 = require("./resources/OAuth.js");
134
120
  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
121
  var PaymentIntents_js_1 = require("./resources/PaymentIntents.js");
138
122
  Object.defineProperty(exports, "PaymentIntents", { enumerable: true, get: function () { return PaymentIntents_js_1.PaymentIntents; } });
139
123
  var PaymentLinks_js_1 = require("./resources/PaymentLinks.js");
@@ -154,8 +138,6 @@ var Products_js_2 = require("./resources/Products.js");
154
138
  Object.defineProperty(exports, "Products", { enumerable: true, get: function () { return Products_js_2.Products; } });
155
139
  var PromotionCodes_js_1 = require("./resources/PromotionCodes.js");
156
140
  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
141
  var Quotes_js_1 = require("./resources/Quotes.js");
160
142
  Object.defineProperty(exports, "Quotes", { enumerable: true, get: function () { return Quotes_js_1.Quotes; } });
161
143
  var Refunds_js_2 = require("./resources/Refunds.js");
@@ -192,7 +174,6 @@ var WebhookEndpoints_js_1 = require("./resources/WebhookEndpoints.js");
192
174
  Object.defineProperty(exports, "WebhookEndpoints", { enumerable: true, get: function () { return WebhookEndpoints_js_1.WebhookEndpoints; } });
193
175
  exports.Apps = (0, ResourceNamespace_js_1.resourceNamespace)('apps', { Secrets: Secrets_js_1.Secrets });
194
176
  exports.Billing = (0, ResourceNamespace_js_1.resourceNamespace)('billing', {
195
- Alerts: Alerts_js_1.Alerts,
196
177
  MeterEventAdjustments: MeterEventAdjustments_js_1.MeterEventAdjustments,
197
178
  MeterEvents: MeterEvents_js_1.MeterEvents,
198
179
  Meters: Meters_js_1.Meters,
@@ -201,11 +182,6 @@ exports.BillingPortal = (0, ResourceNamespace_js_1.resourceNamespace)('billingPo
201
182
  Configurations: Configurations_js_1.Configurations,
202
183
  Sessions: Sessions_js_1.Sessions,
203
184
  });
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
185
  exports.Checkout = (0, ResourceNamespace_js_1.resourceNamespace)('checkout', {
210
186
  Sessions: Sessions_js_2.Sessions,
211
187
  });
@@ -220,17 +196,12 @@ exports.Entitlements = (0, ResourceNamespace_js_1.resourceNamespace)('entitlemen
220
196
  });
221
197
  exports.FinancialConnections = (0, ResourceNamespace_js_1.resourceNamespace)('financialConnections', {
222
198
  Accounts: Accounts_js_1.Accounts,
223
- Institutions: Institutions_js_1.Institutions,
224
199
  Sessions: Sessions_js_3.Sessions,
225
200
  Transactions: Transactions_js_2.Transactions,
226
201
  });
227
202
  exports.Forwarding = (0, ResourceNamespace_js_1.resourceNamespace)('forwarding', {
228
203
  Requests: Requests_js_1.Requests,
229
204
  });
230
- exports.GiftCards = (0, ResourceNamespace_js_1.resourceNamespace)('giftCards', {
231
- Cards: Cards_js_2.Cards,
232
- Transactions: Transactions_js_3.Transactions,
233
- });
234
205
  exports.Identity = (0, ResourceNamespace_js_1.resourceNamespace)('identity', {
235
206
  VerificationReports: VerificationReports_js_1.VerificationReports,
236
207
  VerificationSessions: VerificationSessions_js_1.VerificationSessions,
@@ -238,13 +209,12 @@ exports.Identity = (0, ResourceNamespace_js_1.resourceNamespace)('identity', {
238
209
  exports.Issuing = (0, ResourceNamespace_js_1.resourceNamespace)('issuing', {
239
210
  Authorizations: Authorizations_js_2.Authorizations,
240
211
  Cardholders: Cardholders_js_1.Cardholders,
241
- Cards: Cards_js_3.Cards,
242
- CreditUnderwritingRecords: CreditUnderwritingRecords_js_1.CreditUnderwritingRecords,
212
+ Cards: Cards_js_2.Cards,
243
213
  Disputes: Disputes_js_1.Disputes,
244
214
  PersonalizationDesigns: PersonalizationDesigns_js_2.PersonalizationDesigns,
245
215
  PhysicalBundles: PhysicalBundles_js_1.PhysicalBundles,
246
216
  Tokens: Tokens_js_1.Tokens,
247
- Transactions: Transactions_js_4.Transactions,
217
+ Transactions: Transactions_js_3.Transactions,
248
218
  });
249
219
  exports.Radar = (0, ResourceNamespace_js_1.resourceNamespace)('radar', {
250
220
  EarlyFraudWarnings: EarlyFraudWarnings_js_1.EarlyFraudWarnings,
@@ -259,12 +229,10 @@ exports.Sigma = (0, ResourceNamespace_js_1.resourceNamespace)('sigma', {
259
229
  ScheduledQueryRuns: ScheduledQueryRuns_js_1.ScheduledQueryRuns,
260
230
  });
261
231
  exports.Tax = (0, ResourceNamespace_js_1.resourceNamespace)('tax', {
262
- Associations: Associations_js_1.Associations,
263
232
  Calculations: Calculations_js_1.Calculations,
264
- Forms: Forms_js_1.Forms,
265
233
  Registrations: Registrations_js_1.Registrations,
266
234
  Settings: Settings_js_1.Settings,
267
- Transactions: Transactions_js_5.Transactions,
235
+ Transactions: Transactions_js_4.Transactions,
268
236
  });
269
237
  exports.Terminal = (0, ResourceNamespace_js_1.resourceNamespace)('terminal', {
270
238
  Configurations: Configurations_js_2.Configurations,
@@ -304,5 +272,5 @@ exports.Treasury = (0, ResourceNamespace_js_1.resourceNamespace)('treasury', {
304
272
  ReceivedCredits: ReceivedCredits_js_2.ReceivedCredits,
305
273
  ReceivedDebits: ReceivedDebits_js_2.ReceivedDebits,
306
274
  TransactionEntries: TransactionEntries_js_1.TransactionEntries,
307
- Transactions: Transactions_js_6.Transactions,
275
+ Transactions: Transactions_js_5.Transactions,
308
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.6.0-beta.1';
37
+ Stripe.PACKAGE_VERSION = '16.6.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;