stripe 16.12.0-beta.1 → 16.12.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 (176) hide show
  1. package/CHANGELOG.md +130 -841
  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 -44
  16. package/cjs/stripe.core.js +3 -6
  17. package/cjs/utils.js +3 -30
  18. package/esm/RequestSender.js +6 -67
  19. package/esm/StripeResource.js +2 -2
  20. package/esm/apiVersion.js +0 -1
  21. package/esm/multipart.js +2 -2
  22. package/esm/resources/FinancialConnections/Accounts.js +0 -5
  23. package/esm/resources/Invoices.js +0 -17
  24. package/esm/resources/OAuth.js +2 -2
  25. package/esm/resources/PaymentIntents.js +0 -4
  26. package/esm/resources/Quotes.js +0 -32
  27. package/esm/resources/SubscriptionSchedules.js +0 -4
  28. package/esm/resources/Terminal/Readers.js +0 -12
  29. package/esm/resources.js +0 -30
  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 -45
  35. package/types/AccountSessionsResource.d.ts +0 -278
  36. package/types/Accounts.d.ts +5 -115
  37. package/types/AccountsResource.d.ts +0 -270
  38. package/types/BankAccounts.d.ts +4 -2
  39. package/types/Capabilities.d.ts +4 -2
  40. package/types/Charges.d.ts +23 -71
  41. package/types/ChargesResource.d.ts +0 -1294
  42. package/types/Checkout/Sessions.d.ts +4 -296
  43. package/types/Checkout/SessionsResource.d.ts +5 -351
  44. package/types/ConfirmationTokens.d.ts +0 -67
  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 -3
  50. package/types/Disputes.d.ts +14 -153
  51. package/types/DisputesResource.d.ts +0 -120
  52. package/types/EventTypes.d.ts +0 -545
  53. package/types/Events.d.ts +0 -90
  54. package/types/FinancialConnections/Accounts.d.ts +1 -29
  55. package/types/FinancialConnections/AccountsResource.d.ts +3 -35
  56. package/types/FinancialConnections/Sessions.d.ts +1 -49
  57. package/types/FinancialConnections/SessionsResource.d.ts +1 -38
  58. package/types/InvoiceItems.d.ts +0 -5
  59. package/types/InvoiceItemsResource.d.ts +0 -98
  60. package/types/InvoiceLineItems.d.ts +0 -22
  61. package/types/InvoiceRenderingTemplates.d.ts +2 -1
  62. package/types/Invoices.d.ts +7 -117
  63. package/types/InvoicesResource.d.ts +1835 -5493
  64. package/types/Issuing/CardholdersResource.d.ts +1 -2
  65. package/types/Issuing/Transactions.d.ts +0 -2
  66. package/types/Issuing/TransactionsResource.d.ts +0 -5
  67. package/types/LineItems.d.ts +0 -7
  68. package/types/Mandates.d.ts +0 -77
  69. package/types/PaymentIntents.d.ts +2 -503
  70. package/types/PaymentIntentsResource.d.ts +3464 -7064
  71. package/types/PaymentLinks.d.ts +0 -2
  72. package/types/PaymentLinksResource.d.ts +0 -4
  73. package/types/PaymentMethodConfigurations.d.ts +0 -36
  74. package/types/PaymentMethodConfigurationsResource.d.ts +0 -50
  75. package/types/PaymentMethods.d.ts +0 -67
  76. package/types/PaymentMethodsResource.d.ts +0 -88
  77. package/types/Persons.d.ts +4 -2
  78. package/types/Prices.d.ts +0 -22
  79. package/types/PricesResource.d.ts +0 -22
  80. package/types/Products.d.ts +0 -39
  81. package/types/ProductsResource.d.ts +0 -36
  82. package/types/Quotes.d.ts +1 -596
  83. package/types/QuotesResource.d.ts +199 -2531
  84. package/types/SetupAttempts.d.ts +1 -10
  85. package/types/SetupIntents.d.ts +2 -111
  86. package/types/SetupIntentsResource.d.ts +3 -522
  87. package/types/Sources.d.ts +0 -23
  88. package/types/SubscriptionItems.d.ts +0 -21
  89. package/types/SubscriptionItemsResource.d.ts +0 -109
  90. package/types/SubscriptionSchedules.d.ts +0 -200
  91. package/types/SubscriptionSchedulesResource.d.ts +13 -1231
  92. package/types/Subscriptions.d.ts +1 -82
  93. package/types/SubscriptionsResource.d.ts +2 -347
  94. package/types/Tax/Registrations.d.ts +30 -0
  95. package/types/Tax/RegistrationsResource.d.ts +33 -0
  96. package/types/Terminal/Readers.d.ts +0 -278
  97. package/types/Terminal/ReadersResource.d.ts +0 -208
  98. package/types/TestHelpers/ConfirmationTokensResource.d.ts +0 -63
  99. package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +0 -26
  100. package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +0 -26
  101. package/types/Treasury/FinancialAccounts.d.ts +0 -5
  102. package/types/Treasury/FinancialAccountsResource.d.ts +0 -10
  103. package/types/Treasury/OutboundTransfers.d.ts +0 -26
  104. package/types/Treasury/OutboundTransfersResource.d.ts +0 -26
  105. package/types/Treasury/ReceivedCredits.d.ts +0 -26
  106. package/types/Treasury/ReceivedDebits.d.ts +1 -31
  107. package/types/WebhookEndpointsResource.d.ts +0 -64
  108. package/types/index.d.ts +0 -75
  109. package/types/lib.d.ts +0 -12
  110. package/cjs/resources/AccountNotices.js +0 -21
  111. package/cjs/resources/Capital/FinancingOffers.js +0 -21
  112. package/cjs/resources/Capital/FinancingSummary.js +0 -12
  113. package/cjs/resources/Capital/FinancingTransactions.js +0 -17
  114. package/cjs/resources/FinancialConnections/Institutions.js +0 -17
  115. package/cjs/resources/GiftCards/Cards.js +0 -23
  116. package/cjs/resources/GiftCards/Transactions.js +0 -33
  117. package/cjs/resources/Issuing/CreditUnderwritingRecords.js +0 -33
  118. package/cjs/resources/Issuing/DisputeSettlementDetails.js +0 -17
  119. package/cjs/resources/Margins.js +0 -22
  120. package/cjs/resources/Orders.js +0 -24
  121. package/cjs/resources/QuotePhases.js +0 -17
  122. package/cjs/resources/Tax/Associations.js +0 -9
  123. package/cjs/resources/Tax/Forms.js +0 -20
  124. package/cjs/resources/Terminal/ReaderCollectedData.js +0 -12
  125. package/esm/resources/AccountNotices.js +0 -18
  126. package/esm/resources/Capital/FinancingOffers.js +0 -18
  127. package/esm/resources/Capital/FinancingSummary.js +0 -9
  128. package/esm/resources/Capital/FinancingTransactions.js +0 -14
  129. package/esm/resources/FinancialConnections/Institutions.js +0 -14
  130. package/esm/resources/GiftCards/Cards.js +0 -20
  131. package/esm/resources/GiftCards/Transactions.js +0 -30
  132. package/esm/resources/Issuing/CreditUnderwritingRecords.js +0 -30
  133. package/esm/resources/Issuing/DisputeSettlementDetails.js +0 -14
  134. package/esm/resources/Margins.js +0 -19
  135. package/esm/resources/Orders.js +0 -21
  136. package/esm/resources/QuotePhases.js +0 -14
  137. package/esm/resources/Tax/Associations.js +0 -6
  138. package/esm/resources/Tax/Forms.js +0 -17
  139. package/esm/resources/Terminal/ReaderCollectedData.js +0 -9
  140. package/types/AccountNotices.d.ts +0 -113
  141. package/types/AccountNoticesResource.d.ts +0 -98
  142. package/types/Billing/MeterErrorReports.d.ts +0 -106
  143. package/types/Capital/FinancingOffers.d.ts +0 -188
  144. package/types/Capital/FinancingOffersResource.d.ts +0 -97
  145. package/types/Capital/FinancingSummary.d.ts +0 -106
  146. package/types/Capital/FinancingSummaryResource.d.ts +0 -27
  147. package/types/Capital/FinancingTransactions.d.ts +0 -135
  148. package/types/Capital/FinancingTransactionsResource.d.ts +0 -68
  149. package/types/FinancialConnections/AccountInferredBalances.d.ts +0 -38
  150. package/types/FinancialConnections/Institutions.d.ts +0 -93
  151. package/types/FinancialConnections/InstitutionsResource.d.ts +0 -47
  152. package/types/GiftCards/Cards.d.ts +0 -118
  153. package/types/GiftCards/CardsResource.d.ts +0 -159
  154. package/types/GiftCards/Transactions.d.ts +0 -129
  155. package/types/GiftCards/TransactionsResource.d.ts +0 -201
  156. package/types/InvoicePayments.d.ts +0 -138
  157. package/types/Issuing/CreditUnderwritingRecords.d.ts +0 -451
  158. package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +0 -1032
  159. package/types/Issuing/DisputeSettlementDetails.d.ts +0 -73
  160. package/types/Issuing/DisputeSettlementDetailsResource.d.ts +0 -52
  161. package/types/Issuing/Settlements.d.ts +0 -103
  162. package/types/Margins.d.ts +0 -56
  163. package/types/MarginsResource.d.ts +0 -114
  164. package/types/Orders.d.ts +0 -1084
  165. package/types/OrdersResource.d.ts +0 -2765
  166. package/types/QuoteLines.d.ts +0 -634
  167. package/types/QuotePhases.d.ts +0 -198
  168. package/types/QuotePhasesResource.d.ts +0 -47
  169. package/types/QuotePreviewInvoices.d.ts +0 -1542
  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
  175. package/types/Terminal/ReaderCollectedData.d.ts +0 -51
  176. package/types/Terminal/ReaderCollectedDataResource.d.ts +0 -29
@@ -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-09-05.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,34 +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
- import { DisputeSettlementDetails as IssuingDisputeSettlementDetails } from './resources/Issuing/DisputeSettlementDetails.js';
23
19
  import { Disputes as IssuingDisputes } from './resources/Issuing/Disputes.js';
24
20
  import { EarlyFraudWarnings as RadarEarlyFraudWarnings } from './resources/Radar/EarlyFraudWarnings.js';
25
21
  import { Features as EntitlementsFeatures } from './resources/Entitlements/Features.js';
26
22
  import { FinancialAccounts as TreasuryFinancialAccounts } from './resources/Treasury/FinancialAccounts.js';
27
- import { FinancingOffers as CapitalFinancingOffers } from './resources/Capital/FinancingOffers.js';
28
- import { FinancingSummary as CapitalFinancingSummary } from './resources/Capital/FinancingSummary.js';
29
- import { FinancingTransactions as CapitalFinancingTransactions } from './resources/Capital/FinancingTransactions.js';
30
- import { Forms as TaxForms } from './resources/Tax/Forms.js';
31
23
  import { InboundTransfers as TestHelpersTreasuryInboundTransfers } from './resources/TestHelpers/Treasury/InboundTransfers.js';
32
24
  import { InboundTransfers as TreasuryInboundTransfers } from './resources/Treasury/InboundTransfers.js';
33
- import { Institutions as FinancialConnectionsInstitutions } from './resources/FinancialConnections/Institutions.js';
34
25
  import { Locations as TerminalLocations } from './resources/Terminal/Locations.js';
35
26
  import { MeterEventAdjustments as BillingMeterEventAdjustments } from './resources/Billing/MeterEventAdjustments.js';
36
27
  import { MeterEvents as BillingMeterEvents } from './resources/Billing/MeterEvents.js';
@@ -44,7 +35,6 @@ import { PersonalizationDesigns as TestHelpersIssuingPersonalizationDesigns } fr
44
35
  import { PersonalizationDesigns as IssuingPersonalizationDesigns } from './resources/Issuing/PersonalizationDesigns.js';
45
36
  import { PhysicalBundles as IssuingPhysicalBundles } from './resources/Issuing/PhysicalBundles.js';
46
37
  import { Products as ClimateProducts } from './resources/Climate/Products.js';
47
- import { ReaderCollectedData as TerminalReaderCollectedData } from './resources/Terminal/ReaderCollectedData.js';
48
38
  import { Readers as TestHelpersTerminalReaders } from './resources/TestHelpers/Terminal/Readers.js';
49
39
  import { Readers as TerminalReaders } from './resources/Terminal/Readers.js';
50
40
  import { ReceivedCredits as TestHelpersTreasuryReceivedCredits } from './resources/TestHelpers/Treasury/ReceivedCredits.js';
@@ -68,7 +58,6 @@ import { Tokens as IssuingTokens } from './resources/Issuing/Tokens.js';
68
58
  import { TransactionEntries as TreasuryTransactionEntries } from './resources/Treasury/TransactionEntries.js';
69
59
  import { Transactions as TestHelpersIssuingTransactions } from './resources/TestHelpers/Issuing/Transactions.js';
70
60
  import { Transactions as FinancialConnectionsTransactions } from './resources/FinancialConnections/Transactions.js';
71
- import { Transactions as GiftCardsTransactions } from './resources/GiftCards/Transactions.js';
72
61
  import { Transactions as IssuingTransactions } from './resources/Issuing/Transactions.js';
73
62
  import { Transactions as TaxTransactions } from './resources/Tax/Transactions.js';
74
63
  import { Transactions as TreasuryTransactions } from './resources/Treasury/Transactions.js';
@@ -78,7 +67,6 @@ import { VerificationReports as IdentityVerificationReports } from './resources/
78
67
  import { VerificationSessions as IdentityVerificationSessions } from './resources/Identity/VerificationSessions.js';
79
68
  export { Accounts as Account } from './resources/Accounts.js';
80
69
  export { AccountLinks } from './resources/AccountLinks.js';
81
- export { AccountNotices } from './resources/AccountNotices.js';
82
70
  export { AccountSessions } from './resources/AccountSessions.js';
83
71
  export { Accounts } from './resources/Accounts.js';
84
72
  export { ApplePayDomains } from './resources/ApplePayDomains.js';
@@ -102,9 +90,7 @@ export { InvoiceItems } from './resources/InvoiceItems.js';
102
90
  export { InvoiceRenderingTemplates } from './resources/InvoiceRenderingTemplates.js';
103
91
  export { Invoices } from './resources/Invoices.js';
104
92
  export { Mandates } from './resources/Mandates.js';
105
- export { Margins } from './resources/Margins.js';
106
93
  export { OAuth } from './resources/OAuth.js';
107
- export { Orders } from './resources/Orders.js';
108
94
  export { PaymentIntents } from './resources/PaymentIntents.js';
109
95
  export { PaymentLinks } from './resources/PaymentLinks.js';
110
96
  export { PaymentMethodConfigurations } from './resources/PaymentMethodConfigurations.js';
@@ -115,7 +101,6 @@ export { Plans } from './resources/Plans.js';
115
101
  export { Prices } from './resources/Prices.js';
116
102
  export { Products } from './resources/Products.js';
117
103
  export { PromotionCodes } from './resources/PromotionCodes.js';
118
- export { QuotePhases } from './resources/QuotePhases.js';
119
104
  export { Quotes } from './resources/Quotes.js';
120
105
  export { Refunds } from './resources/Refunds.js';
121
106
  export { Reviews } from './resources/Reviews.js';
@@ -144,11 +129,6 @@ export const BillingPortal = resourceNamespace('billingPortal', {
144
129
  Configurations: BillingPortalConfigurations,
145
130
  Sessions: BillingPortalSessions,
146
131
  });
147
- export const Capital = resourceNamespace('capital', {
148
- FinancingOffers: CapitalFinancingOffers,
149
- FinancingSummary: CapitalFinancingSummary,
150
- FinancingTransactions: CapitalFinancingTransactions,
151
- });
152
132
  export const Checkout = resourceNamespace('checkout', {
153
133
  Sessions: CheckoutSessions,
154
134
  });
@@ -163,17 +143,12 @@ export const Entitlements = resourceNamespace('entitlements', {
163
143
  });
164
144
  export const FinancialConnections = resourceNamespace('financialConnections', {
165
145
  Accounts: FinancialConnectionsAccounts,
166
- Institutions: FinancialConnectionsInstitutions,
167
146
  Sessions: FinancialConnectionsSessions,
168
147
  Transactions: FinancialConnectionsTransactions,
169
148
  });
170
149
  export const Forwarding = resourceNamespace('forwarding', {
171
150
  Requests: ForwardingRequests,
172
151
  });
173
- export const GiftCards = resourceNamespace('giftCards', {
174
- Cards: GiftCardsCards,
175
- Transactions: GiftCardsTransactions,
176
- });
177
152
  export const Identity = resourceNamespace('identity', {
178
153
  VerificationReports: IdentityVerificationReports,
179
154
  VerificationSessions: IdentityVerificationSessions,
@@ -182,8 +157,6 @@ export const Issuing = resourceNamespace('issuing', {
182
157
  Authorizations: IssuingAuthorizations,
183
158
  Cardholders: IssuingCardholders,
184
159
  Cards: IssuingCards,
185
- CreditUnderwritingRecords: IssuingCreditUnderwritingRecords,
186
- DisputeSettlementDetails: IssuingDisputeSettlementDetails,
187
160
  Disputes: IssuingDisputes,
188
161
  PersonalizationDesigns: IssuingPersonalizationDesigns,
189
162
  PhysicalBundles: IssuingPhysicalBundles,
@@ -203,9 +176,7 @@ export const Sigma = resourceNamespace('sigma', {
203
176
  ScheduledQueryRuns: SigmaScheduledQueryRuns,
204
177
  });
205
178
  export const Tax = resourceNamespace('tax', {
206
- Associations: TaxAssociations,
207
179
  Calculations: TaxCalculations,
208
- Forms: TaxForms,
209
180
  Registrations: TaxRegistrations,
210
181
  Settings: TaxSettings,
211
182
  Transactions: TaxTransactions,
@@ -214,7 +185,6 @@ export const Terminal = resourceNamespace('terminal', {
214
185
  Configurations: TerminalConfigurations,
215
186
  ConnectionTokens: TerminalConnectionTokens,
216
187
  Locations: TerminalLocations,
217
- ReaderCollectedData: TerminalReaderCollectedData,
218
188
  Readers: TerminalReaders,
219
189
  });
220
190
  export const TestHelpers = resourceNamespace('testHelpers', {
@@ -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.12.0-beta.1';
34
+ Stripe.PACKAGE_VERSION = '16.12.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;
@@ -294,18 +283,3 @@ export function concat(arrays) {
294
283
  });
295
284
  return merged;
296
285
  }
297
- /**
298
- * Replaces Date objects with Unix timestamps
299
- */
300
- function dateTimeReplacer(key, value) {
301
- if (this[key] instanceof Date) {
302
- return Math.floor(this[key].getTime() / 1000).toString();
303
- }
304
- return value;
305
- }
306
- /**
307
- * JSON stringifies an Object, replacing Date objects with Unix timestamps
308
- */
309
- export function jsonStringifyRequestData(data) {
310
- return JSON.stringify(data, dateTimeReplacer);
311
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stripe",
3
- "version": "16.12.0-beta.1",
3
+ "version": "16.12.0",
4
4
  "description": "Stripe API wrapper",
5
5
  "keywords": [
6
6
  "stripe",
@@ -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.