stripe 16.9.0-beta.1 → 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 (174) hide show
  1. package/CHANGELOG.md +132 -809
  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 +4 -33
  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 +2 -30
  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 -106
  37. package/types/AccountsResource.d.ts +0 -246
  38. package/types/Charges.d.ts +3 -68
  39. package/types/ChargesResource.d.ts +6 -1296
  40. package/types/Checkout/Sessions.d.ts +6 -186
  41. package/types/Checkout/SessionsResource.d.ts +9 -351
  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/CustomerSessions.d.ts +4 -0
  48. package/types/CustomersResource.d.ts +4 -4
  49. package/types/Disputes.d.ts +0 -158
  50. package/types/DisputesResource.d.ts +0 -120
  51. package/types/EventTypes.d.ts +0 -460
  52. package/types/Events.d.ts +0 -85
  53. package/types/FileLinksResource.d.ts +1 -1
  54. package/types/Files.d.ts +1 -0
  55. package/types/FilesResource.d.ts +3 -1
  56. package/types/FinancialConnections/Accounts.d.ts +1 -29
  57. package/types/FinancialConnections/AccountsResource.d.ts +3 -35
  58. package/types/FinancialConnections/Sessions.d.ts +1 -49
  59. package/types/FinancialConnections/SessionsResource.d.ts +1 -38
  60. package/types/InvoiceItems.d.ts +0 -5
  61. package/types/InvoiceItemsResource.d.ts +0 -98
  62. package/types/InvoiceLineItems.d.ts +3 -23
  63. package/types/Invoices.d.ts +3 -117
  64. package/types/InvoicesResource.d.ts +1759 -5414
  65. package/types/Issuing/CardholdersResource.d.ts +1 -2
  66. package/types/Issuing/Cards.d.ts +1 -1
  67. package/types/LineItems.d.ts +1 -8
  68. package/types/Mandates.d.ts +0 -77
  69. package/types/PaymentIntents.d.ts +4 -488
  70. package/types/PaymentIntentsResource.d.ts +3460 -6970
  71. package/types/PaymentLinks.d.ts +0 -1
  72. package/types/PaymentLinksResource.d.ts +8 -6
  73. package/types/PaymentMethodConfigurations.d.ts +0 -36
  74. package/types/PaymentMethodConfigurationsResource.d.ts +0 -50
  75. package/types/PaymentMethods.d.ts +0 -62
  76. package/types/PaymentMethodsResource.d.ts +0 -110
  77. package/types/Prices.d.ts +0 -22
  78. package/types/PricesResource.d.ts +0 -22
  79. package/types/Products.d.ts +0 -39
  80. package/types/ProductsResource.d.ts +0 -36
  81. package/types/Quotes.d.ts +1 -596
  82. package/types/QuotesResource.d.ts +266 -3175
  83. package/types/SetupAttempts.d.ts +0 -9
  84. package/types/SetupIntents.d.ts +1 -110
  85. package/types/SetupIntentsResource.d.ts +3 -498
  86. package/types/Sources.d.ts +0 -23
  87. package/types/SubscriptionItems.d.ts +0 -21
  88. package/types/SubscriptionItemsResource.d.ts +0 -109
  89. package/types/SubscriptionSchedules.d.ts +0 -200
  90. package/types/SubscriptionSchedulesResource.d.ts +15 -1233
  91. package/types/Subscriptions.d.ts +1 -82
  92. package/types/SubscriptionsResource.d.ts +4 -349
  93. package/types/Tax/Calculations.d.ts +2 -1
  94. package/types/Tax/CalculationsResource.d.ts +3 -2
  95. package/types/Tax/Transactions.d.ts +2 -1
  96. package/types/TaxIds.d.ts +2 -1
  97. package/types/TaxIdsResource.d.ts +2 -1
  98. package/types/Terminal/Readers.d.ts +0 -278
  99. package/types/Terminal/ReadersResource.d.ts +0 -208
  100. package/types/TestHelpers/ConfirmationTokensResource.d.ts +0 -55
  101. package/types/TestHelpers/TestClocks.d.ts +15 -0
  102. package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +0 -26
  103. package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +0 -26
  104. package/types/Treasury/FinancialAccounts.d.ts +0 -5
  105. package/types/Treasury/FinancialAccountsResource.d.ts +0 -10
  106. package/types/Treasury/InboundTransfers.d.ts +3 -1
  107. package/types/Treasury/OutboundPayments.d.ts +3 -1
  108. package/types/Treasury/OutboundTransfers.d.ts +3 -27
  109. package/types/Treasury/OutboundTransfersResource.d.ts +0 -26
  110. package/types/Treasury/ReceivedCredits.d.ts +3 -27
  111. package/types/Treasury/ReceivedDebits.d.ts +0 -31
  112. package/types/Treasury/TransactionEntries.d.ts +9 -3
  113. package/types/Treasury/Transactions.d.ts +9 -3
  114. package/types/WebhookEndpointsResource.d.ts +0 -54
  115. package/types/Webhooks.d.ts +37 -28
  116. package/types/index.d.ts +0 -67
  117. package/types/lib.d.ts +0 -12
  118. package/cjs/resources/AccountNotices.js +0 -21
  119. package/cjs/resources/Capital/FinancingOffers.js +0 -21
  120. package/cjs/resources/Capital/FinancingSummary.js +0 -12
  121. package/cjs/resources/Capital/FinancingTransactions.js +0 -17
  122. package/cjs/resources/FinancialConnections/Institutions.js +0 -17
  123. package/cjs/resources/GiftCards/Cards.js +0 -23
  124. package/cjs/resources/GiftCards/Transactions.js +0 -33
  125. package/cjs/resources/Issuing/CreditUnderwritingRecords.js +0 -33
  126. package/cjs/resources/Margins.js +0 -22
  127. package/cjs/resources/Orders.js +0 -24
  128. package/cjs/resources/QuotePhases.js +0 -22
  129. package/cjs/resources/Tax/Associations.js +0 -9
  130. package/cjs/resources/Tax/Forms.js +0 -20
  131. package/esm/resources/AccountNotices.js +0 -18
  132. package/esm/resources/Capital/FinancingOffers.js +0 -18
  133. package/esm/resources/Capital/FinancingSummary.js +0 -9
  134. package/esm/resources/Capital/FinancingTransactions.js +0 -14
  135. package/esm/resources/FinancialConnections/Institutions.js +0 -14
  136. package/esm/resources/GiftCards/Cards.js +0 -20
  137. package/esm/resources/GiftCards/Transactions.js +0 -30
  138. package/esm/resources/Issuing/CreditUnderwritingRecords.js +0 -30
  139. package/esm/resources/Margins.js +0 -19
  140. package/esm/resources/Orders.js +0 -21
  141. package/esm/resources/QuotePhases.js +0 -19
  142. package/esm/resources/Tax/Associations.js +0 -6
  143. package/esm/resources/Tax/Forms.js +0 -17
  144. package/types/AccountNotices.d.ts +0 -113
  145. package/types/AccountNoticesResource.d.ts +0 -98
  146. package/types/Capital/FinancingOffers.d.ts +0 -188
  147. package/types/Capital/FinancingOffersResource.d.ts +0 -97
  148. package/types/Capital/FinancingSummary.d.ts +0 -106
  149. package/types/Capital/FinancingSummaryResource.d.ts +0 -27
  150. package/types/Capital/FinancingTransactions.d.ts +0 -135
  151. package/types/Capital/FinancingTransactionsResource.d.ts +0 -68
  152. package/types/FinancialConnections/AccountInferredBalances.d.ts +0 -38
  153. package/types/FinancialConnections/Institutions.d.ts +0 -93
  154. package/types/FinancialConnections/InstitutionsResource.d.ts +0 -47
  155. package/types/GiftCards/Cards.d.ts +0 -118
  156. package/types/GiftCards/CardsResource.d.ts +0 -159
  157. package/types/GiftCards/Transactions.d.ts +0 -129
  158. package/types/GiftCards/TransactionsResource.d.ts +0 -201
  159. package/types/InvoicePayments.d.ts +0 -138
  160. package/types/Issuing/CreditUnderwritingRecords.d.ts +0 -446
  161. package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +0 -1017
  162. package/types/Margins.d.ts +0 -56
  163. package/types/MarginsResource.d.ts +0 -114
  164. package/types/Orders.d.ts +0 -1083
  165. package/types/OrdersResource.d.ts +0 -2763
  166. package/types/QuoteLines.d.ts +0 -634
  167. package/types/QuotePhases.d.ts +0 -198
  168. package/types/QuotePhasesResource.d.ts +0 -67
  169. package/types/QuotePreviewInvoices.d.ts +0 -1530
  170. package/types/QuotePreviewSubscriptionSchedules.d.ts +0 -814
  171. package/types/Tax/Associations.d.ts +0 -126
  172. package/types/Tax/AssociationsResource.d.ts +0 -29
  173. package/types/Tax/Forms.d.ts +0 -133
  174. package/types/Tax/FormsResource.d.ts +0 -90
@@ -1,7 +1,6 @@
1
1
  import { StripeAPIError, StripeAuthenticationError, StripeConnectionError, StripeError, StripePermissionError, StripeRateLimitError, } from './Error.js';
2
- import { emitWarning, jsonStringifyRequestData, normalizeHeaders, removeNullish, queryStringifyRequestData, getDataFromArgs, getOptionsFromArgs, } from './utils.js';
2
+ import { emitWarning, normalizeHeaders, removeNullish, stringifyRequestData, } from './utils.js';
3
3
  import { HttpClient } from './net/HttpClient.js';
4
- import { PreviewVersion } from './apiVersion.js';
5
4
  const MAX_RETRY_AFTER_WAIT = 60;
6
5
  export class RequestSender {
7
6
  constructor(stripe, maxBufferedRequestMetric) {
@@ -199,12 +198,12 @@ export class RequestSender {
199
198
  }
200
199
  return null;
201
200
  }
202
- _makeHeaders(auth, contentType, contentLength, apiVersion, clientUserAgent, method, userSuppliedHeaders, userSuppliedSettings) {
201
+ _makeHeaders(auth, contentLength, apiVersion, clientUserAgent, method, userSuppliedHeaders, userSuppliedSettings) {
203
202
  const defaultHeaders = {
204
203
  // Use specified auth token or use default from this stripe instance:
205
204
  Authorization: auth ? `Bearer ${auth}` : this._stripe.getApiField('auth'),
206
205
  Accept: 'application/json',
207
- 'Content-Type': contentType,
206
+ 'Content-Type': 'application/x-www-form-urlencoded',
208
207
  'User-Agent': this._getUserAgentString(),
209
208
  'X-Stripe-Client-User-Agent': clientUserAgent,
210
209
  'X-Stripe-Client-Telemetry': this._getTelemetryHeader(),
@@ -272,54 +271,6 @@ export class RequestSender {
272
271
  }
273
272
  }
274
273
  }
275
- _rawRequest(method, path, params, options) {
276
- const requestPromise = new Promise((resolve, reject) => {
277
- let opts;
278
- try {
279
- const requestMethod = method.toUpperCase();
280
- if (requestMethod !== 'POST' &&
281
- params &&
282
- Object.keys(params).length !== 0) {
283
- throw new Error('rawRequest only supports params on POST requests. Please pass null and add your parameters to path.');
284
- }
285
- const args = [].slice.call([params, options]);
286
- // Pull request data and options (headers, auth) from args.
287
- const dataFromArgs = getDataFromArgs(args);
288
- const data = Object.assign({}, dataFromArgs);
289
- const calculatedOptions = getOptionsFromArgs(args);
290
- const apiMode = calculatedOptions.apiMode || 'standard';
291
- const headers = calculatedOptions.headers;
292
- opts = {
293
- requestMethod,
294
- requestPath: path,
295
- bodyData: data,
296
- queryData: {},
297
- auth: calculatedOptions.auth,
298
- headers,
299
- host: null,
300
- streaming: false,
301
- settings: {},
302
- apiMode: apiMode,
303
- usage: ['raw_request'],
304
- };
305
- }
306
- catch (err) {
307
- reject(err);
308
- return;
309
- }
310
- function requestCallback(err, response) {
311
- if (err) {
312
- reject(err);
313
- }
314
- else {
315
- resolve(response);
316
- }
317
- }
318
- const { headers, settings } = opts;
319
- this._request(opts.requestMethod, opts.host, path, opts.bodyData, opts.auth, { headers, settings, streaming: opts.streaming, apiMode: opts.apiMode }, opts.usage, requestCallback);
320
- });
321
- return requestPromise;
322
- }
323
274
  _request(method, host, path, data, auth, options = {}, usage = [], callback, requestDataProcessor = null) {
324
275
  let requestData;
325
276
  const retryRequest = (requestFn, apiVersion, headers, requestRetries, retryAfter) => {
@@ -384,15 +335,10 @@ export class RequestSender {
384
335
  return callback(error);
385
336
  }
386
337
  requestData = data;
387
- let contentType = 'application/x-www-form-urlencoded';
388
- let apiVersion = this._stripe.getApiField('version');
389
- if (options.apiMode === 'preview') {
390
- contentType = 'application/json';
391
- apiVersion = PreviewVersion;
392
- }
393
338
  this._stripe.getClientUserAgent((clientUserAgent) => {
394
339
  var _a, _b;
395
- 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 : {});
340
+ const apiVersion = this._stripe.getApiField('version');
341
+ 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 : {});
396
342
  makeRequest(apiVersion, headers, 0);
397
343
  });
398
344
  };
@@ -400,14 +346,7 @@ export class RequestSender {
400
346
  requestDataProcessor(method, data, options.headers, prepareAndMakeRequest);
401
347
  }
402
348
  else {
403
- let stringifiedData;
404
- if (options.apiMode === 'preview') {
405
- stringifiedData = data ? jsonStringifyRequestData(data) : '';
406
- }
407
- else {
408
- stringifiedData = queryStringifyRequestData(data || {});
409
- }
410
- prepareAndMakeRequest(null, stringifiedData);
349
+ prepareAndMakeRequest(null, stringifyRequestData(data || {}));
411
350
  }
412
351
  }
413
352
  }
@@ -1,4 +1,4 @@
1
- import { getDataFromArgs, getOptionsFromArgs, makeURLInterpolator, protoExtend, queryStringifyRequestData, } from './utils.js';
1
+ import { getDataFromArgs, getOptionsFromArgs, makeURLInterpolator, protoExtend, stringifyRequestData, } from './utils.js';
2
2
  import { stripeMethod } from './StripeMethod.js';
3
3
  // Provide extension mechanism for Stripe Resource Sub-Classes
4
4
  StripeResource.extend = protoExtend;
@@ -158,7 +158,7 @@ StripeResource.prototype = {
158
158
  const path = [
159
159
  opts.requestPath,
160
160
  emptyQuery ? '' : '?',
161
- queryStringifyRequestData(opts.queryData),
161
+ stringifyRequestData(opts.queryData),
162
162
  ].join('');
163
163
  const { headers, settings } = opts;
164
164
  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/esm/apiVersion.js CHANGED
@@ -1,3 +1,2 @@
1
1
  // File generated from our OpenAPI spec
2
2
  export const ApiVersion = '2024-06-20';
3
- export const PreviewVersion = '2024-07-16.preview-v2';
package/esm/multipart.js CHANGED
@@ -1,4 +1,4 @@
1
- import { flattenAndStringify, queryStringifyRequestData } from './utils.js';
1
+ import { flattenAndStringify, stringifyRequestData } from './utils.js';
2
2
  // Method for formatting HTTP body for the multipart/form-data specification
3
3
  // Mostly taken from Fermata.js
4
4
  // https://github.com/natevw/fermata/blob/5d9732a33d776ce925013a265935facd1626cc88/fermata.js#L315-L343
@@ -45,7 +45,7 @@ const multipartDataGenerator = (method, data, headers) => {
45
45
  export function multipartRequestDataProcessor(method, data, headers, callback) {
46
46
  data = data || {};
47
47
  if (method !== 'POST') {
48
- return callback(null, queryStringifyRequestData(data));
48
+ return callback(null, stringifyRequestData(data));
49
49
  }
50
50
  this._stripe._platformFunctions
51
51
  .tryBufferData(data)
@@ -15,11 +15,6 @@ export const Accounts = StripeResource.extend({
15
15
  method: 'POST',
16
16
  fullPath: '/v1/financial_connections/accounts/{account}/disconnect',
17
17
  }),
18
- listInferredBalances: stripeMethod({
19
- method: 'GET',
20
- fullPath: '/v1/financial_connections/accounts/{account}/inferred_balances',
21
- methodType: 'list',
22
- }),
23
18
  listOwners: stripeMethod({
24
19
  method: 'GET',
25
20
  fullPath: '/v1/financial_connections/accounts/{account}/owners',
@@ -15,14 +15,6 @@ export const Invoices = StripeResource.extend({
15
15
  method: 'POST',
16
16
  fullPath: '/v1/invoices/{invoice}/add_lines',
17
17
  }),
18
- attachPayment: stripeMethod({
19
- method: 'POST',
20
- fullPath: '/v1/invoices/{invoice}/attach_payment',
21
- }),
22
- attachPaymentIntent: stripeMethod({
23
- method: 'POST',
24
- fullPath: '/v1/invoices/{invoice}/attach_payment_intent',
25
- }),
26
18
  createPreview: stripeMethod({
27
19
  method: 'POST',
28
20
  fullPath: '/v1/invoices/create_preview',
@@ -36,11 +28,6 @@ export const Invoices = StripeResource.extend({
36
28
  fullPath: '/v1/invoices/{invoice}/lines',
37
29
  methodType: 'list',
38
30
  }),
39
- listPayments: stripeMethod({
40
- method: 'GET',
41
- fullPath: '/v1/invoices/{invoice}/payments',
42
- methodType: 'list',
43
- }),
44
31
  listUpcomingLines: stripeMethod({
45
32
  method: 'GET',
46
33
  fullPath: '/v1/invoices/upcoming/lines',
@@ -55,10 +42,6 @@ export const Invoices = StripeResource.extend({
55
42
  method: 'POST',
56
43
  fullPath: '/v1/invoices/{invoice}/remove_lines',
57
44
  }),
58
- retrievePayment: stripeMethod({
59
- method: 'GET',
60
- fullPath: '/v1/invoices/{invoice}/payments/{invoice_payment}',
61
- }),
62
45
  retrieveUpcoming: stripeMethod({
63
46
  method: 'GET',
64
47
  fullPath: '/v1/invoices/upcoming',
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  import { StripeResource } from '../StripeResource.js';
3
- import { queryStringifyRequestData } from '../utils.js';
3
+ import { stringifyRequestData } from '../utils.js';
4
4
  const stripeMethod = StripeResource.method;
5
5
  const oAuthHost = 'connect.stripe.com';
6
6
  export const OAuth = StripeResource.extend({
@@ -22,7 +22,7 @@ export const OAuth = StripeResource.extend({
22
22
  if (!params.scope) {
23
23
  params.scope = 'read_write';
24
24
  }
25
- return `https://${oAuthHost}/${path}?${queryStringifyRequestData(params)}`;
25
+ return `https://${oAuthHost}/${path}?${stringifyRequestData(params)}`;
26
26
  },
27
27
  token: stripeMethod({
28
28
  method: 'POST',
@@ -32,10 +32,6 @@ export const PaymentIntents = StripeResource.extend({
32
32
  method: 'POST',
33
33
  fullPath: '/v1/payment_intents/{intent}/confirm',
34
34
  }),
35
- decrementAuthorization: stripeMethod({
36
- method: 'POST',
37
- fullPath: '/v1/payment_intents/{intent}/decrement_authorization',
38
- }),
39
35
  incrementAuthorization: stripeMethod({
40
36
  method: 'POST',
41
37
  fullPath: '/v1/payment_intents/{intent}/increment_authorization',
@@ -16,11 +16,6 @@ export const Quotes = StripeResource.extend({
16
16
  method: 'POST',
17
17
  fullPath: '/v1/quotes/{quote}/finalize',
18
18
  }),
19
- listPreviewInvoiceLines: stripeMethod({
20
- method: 'GET',
21
- fullPath: '/v1/quotes/{quote}/preview_invoices/{preview_invoice}/lines',
22
- methodType: 'list',
23
- }),
24
19
  listComputedUpfrontLineItems: stripeMethod({
25
20
  method: 'GET',
26
21
  fullPath: '/v1/quotes/{quote}/computed_upfront_line_items',
@@ -31,37 +26,10 @@ export const Quotes = StripeResource.extend({
31
26
  fullPath: '/v1/quotes/{quote}/line_items',
32
27
  methodType: 'list',
33
28
  }),
34
- listLines: stripeMethod({
35
- method: 'GET',
36
- fullPath: '/v1/quotes/{quote}/lines',
37
- methodType: 'list',
38
- }),
39
- listPreviewInvoices: stripeMethod({
40
- method: 'GET',
41
- fullPath: '/v1/quotes/{quote}/preview_invoices',
42
- methodType: 'list',
43
- }),
44
- listPreviewSubscriptionSchedules: stripeMethod({
45
- method: 'GET',
46
- fullPath: '/v1/quotes/{quote}/preview_subscription_schedules',
47
- methodType: 'list',
48
- }),
49
- markDraft: stripeMethod({
50
- method: 'POST',
51
- fullPath: '/v1/quotes/{quote}/mark_draft',
52
- }),
53
- markStale: stripeMethod({
54
- method: 'POST',
55
- fullPath: '/v1/quotes/{quote}/mark_stale',
56
- }),
57
29
  pdf: stripeMethod({
58
30
  method: 'GET',
59
31
  fullPath: '/v1/quotes/{quote}/pdf',
60
32
  host: 'files.stripe.com',
61
33
  streaming: true,
62
34
  }),
63
- reestimate: stripeMethod({
64
- method: 'POST',
65
- fullPath: '/v1/quotes/{quote}/reestimate',
66
- }),
67
35
  });
@@ -19,10 +19,6 @@ export const SubscriptionSchedules = StripeResource.extend({
19
19
  fullPath: '/v1/subscription_schedules',
20
20
  methodType: 'list',
21
21
  }),
22
- amend: stripeMethod({
23
- method: 'POST',
24
- fullPath: '/v1/subscription_schedules/{schedule}/amend',
25
- }),
26
22
  cancel: stripeMethod({
27
23
  method: 'POST',
28
24
  fullPath: '/v1/subscription_schedules/{schedule}/cancel',
@@ -24,18 +24,6 @@ export const Readers = StripeResource.extend({
24
24
  method: 'POST',
25
25
  fullPath: '/v1/terminal/readers/{reader}/cancel_action',
26
26
  }),
27
- collectInputs: stripeMethod({
28
- method: 'POST',
29
- fullPath: '/v1/terminal/readers/{reader}/collect_inputs',
30
- }),
31
- collectPaymentMethod: stripeMethod({
32
- method: 'POST',
33
- fullPath: '/v1/terminal/readers/{reader}/collect_payment_method',
34
- }),
35
- confirmPaymentIntent: stripeMethod({
36
- method: 'POST',
37
- fullPath: '/v1/terminal/readers/{reader}/confirm_payment_intent',
38
- }),
39
27
  processPaymentIntent: stripeMethod({
40
28
  method: 'POST',
41
29
  fullPath: '/v1/terminal/readers/{reader}/process_payment_intent',
package/esm/resources.js CHANGED
@@ -3,33 +3,25 @@ import { resourceNamespace } from './ResourceNamespace.js';
3
3
  import { Accounts as FinancialConnectionsAccounts } from './resources/FinancialConnections/Accounts.js';
4
4
  import { ActiveEntitlements as EntitlementsActiveEntitlements } from './resources/Entitlements/ActiveEntitlements.js';
5
5
  import { Alerts as BillingAlerts } from './resources/Billing/Alerts.js';
6
- import { Associations as TaxAssociations } from './resources/Tax/Associations.js';
7
6
  import { Authorizations as TestHelpersIssuingAuthorizations } from './resources/TestHelpers/Issuing/Authorizations.js';
8
7
  import { Authorizations as IssuingAuthorizations } from './resources/Issuing/Authorizations.js';
9
8
  import { Calculations as TaxCalculations } from './resources/Tax/Calculations.js';
10
9
  import { Cardholders as IssuingCardholders } from './resources/Issuing/Cardholders.js';
11
10
  import { Cards as TestHelpersIssuingCards } from './resources/TestHelpers/Issuing/Cards.js';
12
- import { Cards as GiftCardsCards } from './resources/GiftCards/Cards.js';
13
11
  import { Cards as IssuingCards } from './resources/Issuing/Cards.js';
14
12
  import { Configurations as BillingPortalConfigurations } from './resources/BillingPortal/Configurations.js';
15
13
  import { Configurations as TerminalConfigurations } from './resources/Terminal/Configurations.js';
16
14
  import { ConfirmationTokens as TestHelpersConfirmationTokens } from './resources/TestHelpers/ConfirmationTokens.js';
17
15
  import { ConnectionTokens as TerminalConnectionTokens } from './resources/Terminal/ConnectionTokens.js';
18
16
  import { CreditReversals as TreasuryCreditReversals } from './resources/Treasury/CreditReversals.js';
19
- import { CreditUnderwritingRecords as IssuingCreditUnderwritingRecords } from './resources/Issuing/CreditUnderwritingRecords.js';
20
17
  import { Customers as TestHelpersCustomers } from './resources/TestHelpers/Customers.js';
21
18
  import { DebitReversals as TreasuryDebitReversals } from './resources/Treasury/DebitReversals.js';
22
19
  import { Disputes as IssuingDisputes } from './resources/Issuing/Disputes.js';
23
20
  import { EarlyFraudWarnings as RadarEarlyFraudWarnings } from './resources/Radar/EarlyFraudWarnings.js';
24
21
  import { Features as EntitlementsFeatures } from './resources/Entitlements/Features.js';
25
22
  import { FinancialAccounts as TreasuryFinancialAccounts } from './resources/Treasury/FinancialAccounts.js';
26
- import { FinancingOffers as CapitalFinancingOffers } from './resources/Capital/FinancingOffers.js';
27
- import { FinancingSummary as CapitalFinancingSummary } from './resources/Capital/FinancingSummary.js';
28
- import { FinancingTransactions as CapitalFinancingTransactions } from './resources/Capital/FinancingTransactions.js';
29
- import { Forms as TaxForms } from './resources/Tax/Forms.js';
30
23
  import { InboundTransfers as TestHelpersTreasuryInboundTransfers } from './resources/TestHelpers/Treasury/InboundTransfers.js';
31
24
  import { InboundTransfers as TreasuryInboundTransfers } from './resources/Treasury/InboundTransfers.js';
32
- import { Institutions as FinancialConnectionsInstitutions } from './resources/FinancialConnections/Institutions.js';
33
25
  import { Locations as TerminalLocations } from './resources/Terminal/Locations.js';
34
26
  import { MeterEventAdjustments as BillingMeterEventAdjustments } from './resources/Billing/MeterEventAdjustments.js';
35
27
  import { MeterEvents as BillingMeterEvents } from './resources/Billing/MeterEvents.js';
@@ -66,7 +58,6 @@ import { Tokens as IssuingTokens } from './resources/Issuing/Tokens.js';
66
58
  import { TransactionEntries as TreasuryTransactionEntries } from './resources/Treasury/TransactionEntries.js';
67
59
  import { Transactions as TestHelpersIssuingTransactions } from './resources/TestHelpers/Issuing/Transactions.js';
68
60
  import { Transactions as FinancialConnectionsTransactions } from './resources/FinancialConnections/Transactions.js';
69
- import { Transactions as GiftCardsTransactions } from './resources/GiftCards/Transactions.js';
70
61
  import { Transactions as IssuingTransactions } from './resources/Issuing/Transactions.js';
71
62
  import { Transactions as TaxTransactions } from './resources/Tax/Transactions.js';
72
63
  import { Transactions as TreasuryTransactions } from './resources/Treasury/Transactions.js';
@@ -76,7 +67,6 @@ import { VerificationReports as IdentityVerificationReports } from './resources/
76
67
  import { VerificationSessions as IdentityVerificationSessions } from './resources/Identity/VerificationSessions.js';
77
68
  export { Accounts as Account } from './resources/Accounts.js';
78
69
  export { AccountLinks } from './resources/AccountLinks.js';
79
- export { AccountNotices } from './resources/AccountNotices.js';
80
70
  export { AccountSessions } from './resources/AccountSessions.js';
81
71
  export { Accounts } from './resources/Accounts.js';
82
72
  export { ApplePayDomains } from './resources/ApplePayDomains.js';
@@ -99,9 +89,7 @@ export { Files } from './resources/Files.js';
99
89
  export { InvoiceItems } from './resources/InvoiceItems.js';
100
90
  export { Invoices } from './resources/Invoices.js';
101
91
  export { Mandates } from './resources/Mandates.js';
102
- export { Margins } from './resources/Margins.js';
103
92
  export { OAuth } from './resources/OAuth.js';
104
- export { Orders } from './resources/Orders.js';
105
93
  export { PaymentIntents } from './resources/PaymentIntents.js';
106
94
  export { PaymentLinks } from './resources/PaymentLinks.js';
107
95
  export { PaymentMethodConfigurations } from './resources/PaymentMethodConfigurations.js';
@@ -112,7 +100,6 @@ export { Plans } from './resources/Plans.js';
112
100
  export { Prices } from './resources/Prices.js';
113
101
  export { Products } from './resources/Products.js';
114
102
  export { PromotionCodes } from './resources/PromotionCodes.js';
115
- export { QuotePhases } from './resources/QuotePhases.js';
116
103
  export { Quotes } from './resources/Quotes.js';
117
104
  export { Refunds } from './resources/Refunds.js';
118
105
  export { Reviews } from './resources/Reviews.js';
@@ -141,11 +128,6 @@ export const BillingPortal = resourceNamespace('billingPortal', {
141
128
  Configurations: BillingPortalConfigurations,
142
129
  Sessions: BillingPortalSessions,
143
130
  });
144
- export const Capital = resourceNamespace('capital', {
145
- FinancingOffers: CapitalFinancingOffers,
146
- FinancingSummary: CapitalFinancingSummary,
147
- FinancingTransactions: CapitalFinancingTransactions,
148
- });
149
131
  export const Checkout = resourceNamespace('checkout', {
150
132
  Sessions: CheckoutSessions,
151
133
  });
@@ -160,17 +142,12 @@ export const Entitlements = resourceNamespace('entitlements', {
160
142
  });
161
143
  export const FinancialConnections = resourceNamespace('financialConnections', {
162
144
  Accounts: FinancialConnectionsAccounts,
163
- Institutions: FinancialConnectionsInstitutions,
164
145
  Sessions: FinancialConnectionsSessions,
165
146
  Transactions: FinancialConnectionsTransactions,
166
147
  });
167
148
  export const Forwarding = resourceNamespace('forwarding', {
168
149
  Requests: ForwardingRequests,
169
150
  });
170
- export const GiftCards = resourceNamespace('giftCards', {
171
- Cards: GiftCardsCards,
172
- Transactions: GiftCardsTransactions,
173
- });
174
151
  export const Identity = resourceNamespace('identity', {
175
152
  VerificationReports: IdentityVerificationReports,
176
153
  VerificationSessions: IdentityVerificationSessions,
@@ -179,7 +156,6 @@ export const Issuing = resourceNamespace('issuing', {
179
156
  Authorizations: IssuingAuthorizations,
180
157
  Cardholders: IssuingCardholders,
181
158
  Cards: IssuingCards,
182
- CreditUnderwritingRecords: IssuingCreditUnderwritingRecords,
183
159
  Disputes: IssuingDisputes,
184
160
  PersonalizationDesigns: IssuingPersonalizationDesigns,
185
161
  PhysicalBundles: IssuingPhysicalBundles,
@@ -199,9 +175,7 @@ export const Sigma = resourceNamespace('sigma', {
199
175
  ScheduledQueryRuns: SigmaScheduledQueryRuns,
200
176
  });
201
177
  export const Tax = resourceNamespace('tax', {
202
- Associations: TaxAssociations,
203
178
  Calculations: TaxCalculations,
204
- Forms: TaxForms,
205
179
  Registrations: TaxRegistrations,
206
180
  Settings: TaxSettings,
207
181
  Transactions: TaxTransactions,
@@ -2,7 +2,7 @@ import * as _Error from './Error.js';
2
2
  import { RequestSender } from './RequestSender.js';
3
3
  import { StripeResource } from './StripeResource.js';
4
4
  import { createWebhooks } from './Webhooks.js';
5
- import { ApiVersion } from './apiVersion.js';
5
+ import * as apiVersion from './apiVersion.js';
6
6
  import { CryptoProvider } from './crypto/CryptoProvider.js';
7
7
  import { HttpClient, HttpClientResponse } from './net/HttpClient.js';
8
8
  import * as resources from './resources.js';
@@ -10,7 +10,7 @@ import { determineProcessUserAgentProperties, pascalToCamelCase, validateInteger
10
10
  const DEFAULT_HOST = 'api.stripe.com';
11
11
  const DEFAULT_PORT = '443';
12
12
  const DEFAULT_BASE_PATH = '/v1/';
13
- const DEFAULT_API_VERSION = ApiVersion;
13
+ const DEFAULT_API_VERSION = apiVersion.ApiVersion;
14
14
  const DEFAULT_TIMEOUT = 80000;
15
15
  const MAX_NETWORK_RETRY_DELAY_SEC = 2;
16
16
  const INITIAL_NETWORK_RETRY_DELAY_SEC = 0.5;
@@ -31,7 +31,7 @@ const ALLOWED_CONFIG_PROPERTIES = [
31
31
  ];
32
32
  const defaultRequestSenderFactory = (stripe) => new RequestSender(stripe, StripeResource.MAX_BUFFERED_REQUEST_METRICS);
33
33
  export function createStripe(platformFunctions, requestSender = defaultRequestSenderFactory) {
34
- Stripe.PACKAGE_VERSION = '16.9.0-beta.1';
34
+ Stripe.PACKAGE_VERSION = '16.9.0';
35
35
  Stripe.USER_AGENT = Object.assign({ bindings_version: Stripe.PACKAGE_VERSION, lang: 'node', publisher: 'stripe', uname: null, typescript: false }, determineProcessUserAgentProperties());
36
36
  Stripe.StripeResource = StripeResource;
37
37
  Stripe.resources = resources;
@@ -147,9 +147,6 @@ export function createStripe(platformFunctions, requestSender = defaultRequestSe
147
147
  _enableTelemetry: null,
148
148
  _requestSender: null,
149
149
  _platformFunctions: null,
150
- rawRequest(method, path, params, options) {
151
- return this._requestSender._rawRequest(method, path, params, options);
152
- },
153
150
  /**
154
151
  * @private
155
152
  */
package/esm/utils.js CHANGED
@@ -7,8 +7,6 @@ const OPTIONS_KEYS = [
7
7
  'maxNetworkRetries',
8
8
  'timeout',
9
9
  'host',
10
- 'apiMode',
11
- 'additionalHeaders',
12
10
  ];
13
11
  export function isOptionsHash(o) {
14
12
  return (o &&
@@ -19,7 +17,7 @@ export function isOptionsHash(o) {
19
17
  * Stringifies an Object, accommodating nested objects
20
18
  * (forming the conventional key 'parent[child]=value')
21
19
  */
22
- export function queryStringifyRequestData(data) {
20
+ export function stringifyRequestData(data) {
23
21
  return (qs
24
22
  .stringify(data, {
25
23
  serializeDate: (d) => Math.floor(d.getTime() / 1000).toString(),
@@ -126,15 +124,6 @@ export function getOptionsFromArgs(args) {
126
124
  if (params.host) {
127
125
  opts.host = params.host;
128
126
  }
129
- if (params.apiMode) {
130
- if (params.apiMode !== 'standard' && params.apiMode !== 'preview') {
131
- throw new Error(`Invalid apiMode: ${params.apiMode}. Must be one of 'standard' or 'preview'`);
132
- }
133
- opts.apiMode = params.apiMode;
134
- }
135
- if (params.additionalHeaders) {
136
- opts.headers = params.additionalHeaders;
137
- }
138
127
  }
139
128
  }
140
129
  return opts;
@@ -240,9 +229,7 @@ export function isObject(obj) {
240
229
  export function flattenAndStringify(data) {
241
230
  const result = {};
242
231
  const step = (obj, prevKey) => {
243
- Object.keys(obj).forEach((key) => {
244
- // @ts-ignore
245
- const value = obj[key];
232
+ Object.entries(obj).forEach(([key, value]) => {
246
233
  const newKey = prevKey ? `${prevKey}[${key}]` : key;
247
234
  if (isObject(value)) {
248
235
  if (!(value instanceof Uint8Array) &&
@@ -296,18 +283,3 @@ export function concat(arrays) {
296
283
  });
297
284
  return merged;
298
285
  }
299
- /**
300
- * Replaces Date objects with Unix timestamps
301
- */
302
- function dateTimeReplacer(key, value) {
303
- if (this[key] instanceof Date) {
304
- return Math.floor(this[key].getTime() / 1000).toString();
305
- }
306
- return value;
307
- }
308
- /**
309
- * JSON stringifies an Object, replacing Date objects with Unix timestamps
310
- */
311
- export function jsonStringifyRequestData(data) {
312
- return JSON.stringify(data, dateTimeReplacer);
313
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stripe",
3
- "version": "16.9.0-beta.1",
3
+ "version": "16.9.0",
4
4
  "description": "Stripe API wrapper",
5
5
  "keywords": [
6
6
  "stripe",
@@ -46,7 +46,7 @@ declare module 'stripe' {
46
46
  /**
47
47
  * Specifies whether the platform collects only currently_due requirements (`currently_due`) or both currently_due and eventually_due requirements (`eventually_due`). If you don't specify `collection_options`, the default value is `currently_due`.
48
48
  */
49
- fields: CollectionOptions.Fields;
49
+ fields?: CollectionOptions.Fields;
50
50
 
51
51
  /**
52
52
  * Specifies whether the platform collects future_requirements in addition to requirements in Connect Onboarding. The default value is `omit`.
@@ -60,11 +60,7 @@ declare module 'stripe' {
60
60
  type FutureRequirements = 'include' | 'omit';
61
61
  }
62
62
 
63
- type Type =
64
- | 'account_onboarding'
65
- | 'account_update'
66
- | 'capital_financing_offer'
67
- | 'capital_financing_reporting';
63
+ type Type = 'account_onboarding' | 'account_update';
68
64
  }
69
65
 
70
66
  class AccountLinksResource {
@@ -52,12 +52,6 @@ declare module 'stripe' {
52
52
 
53
53
  balances: Components.Balances;
54
54
 
55
- capital_financing?: Components.CapitalFinancing | null;
56
-
57
- capital_financing_application?: Components.CapitalFinancingApplication | null;
58
-
59
- capital_financing_promotion?: Components.CapitalFinancingPromotion | null;
60
-
61
55
  documents: Components.Documents;
62
56
 
63
57
  notification_banner: Components.NotificationBanner;
@@ -145,45 +139,6 @@ declare module 'stripe' {
145
139
  }
146
140
  }
147
141
 
148
- interface CapitalFinancing {
149
- /**
150
- * Whether the embedded component is enabled.
151
- */
152
- enabled: boolean;
153
-
154
- features: CapitalFinancing.Features;
155
- }
156
-
157
- namespace CapitalFinancing {
158
- interface Features {}
159
- }
160
-
161
- interface CapitalFinancingApplication {
162
- /**
163
- * Whether the embedded component is enabled.
164
- */
165
- enabled: boolean;
166
-
167
- features: CapitalFinancingApplication.Features;
168
- }
169
-
170
- namespace CapitalFinancingApplication {
171
- interface Features {}
172
- }
173
-
174
- interface CapitalFinancingPromotion {
175
- /**
176
- * Whether the embedded component is enabled.
177
- */
178
- enabled: boolean;
179
-
180
- features: CapitalFinancingPromotion.Features;
181
- }
182
-
183
- namespace CapitalFinancingPromotion {
184
- interface Features {}
185
- }
186
-
187
142
  interface Documents {
188
143
  /**
189
144
  * Whether the embedded component is enabled.