stripe 16.8.0-beta.1 → 16.8.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.
- package/CHANGELOG.md +118 -798
- package/README.md +0 -33
- package/VERSION +1 -1
- package/cjs/RequestSender.js +5 -66
- package/cjs/StripeResource.js +1 -1
- package/cjs/apiVersion.js +1 -2
- package/cjs/multipart.js +1 -1
- package/cjs/resources/FinancialConnections/Accounts.js +0 -5
- package/cjs/resources/Invoices.js +0 -17
- package/cjs/resources/OAuth.js +1 -1
- package/cjs/resources/PaymentIntents.js +0 -4
- package/cjs/resources/Quotes.js +0 -32
- package/cjs/resources/SubscriptionSchedules.js +0 -4
- package/cjs/resources/Terminal/Readers.js +0 -12
- package/cjs/resources.js +10 -40
- package/cjs/stripe.core.js +3 -6
- package/cjs/utils.js +3 -30
- package/esm/RequestSender.js +6 -67
- package/esm/StripeResource.js +2 -2
- package/esm/apiVersion.js +0 -1
- package/esm/multipart.js +2 -2
- package/esm/resources/FinancialConnections/Accounts.js +0 -5
- package/esm/resources/Invoices.js +0 -17
- package/esm/resources/OAuth.js +2 -2
- package/esm/resources/PaymentIntents.js +0 -4
- package/esm/resources/Quotes.js +0 -32
- package/esm/resources/SubscriptionSchedules.js +0 -4
- package/esm/resources/Terminal/Readers.js +0 -12
- package/esm/resources.js +0 -26
- package/esm/stripe.core.js +3 -6
- package/esm/utils.js +1 -27
- package/package.json +1 -1
- package/types/AccountLinksResource.d.ts +1 -5
- package/types/AccountSessions.d.ts +0 -45
- package/types/AccountSessionsResource.d.ts +0 -215
- package/types/Accounts.d.ts +1 -106
- package/types/AccountsResource.d.ts +5 -251
- package/types/Charges.d.ts +17 -77
- package/types/ChargesResource.d.ts +2 -1296
- package/types/Checkout/Sessions.d.ts +4 -116
- package/types/Checkout/SessionsResource.d.ts +5 -111
- package/types/ConfirmationTokens.d.ts +31 -66
- package/types/Coupons.d.ts +1 -1
- package/types/CouponsResource.d.ts +1 -1
- package/types/CreditNotes.d.ts +0 -21
- package/types/CreditNotesResource.d.ts +0 -51
- package/types/CustomersResource.d.ts +0 -2
- package/types/Disputes.d.ts +0 -158
- package/types/DisputesResource.d.ts +0 -120
- package/types/EventTypes.d.ts +0 -460
- package/types/Events.d.ts +0 -85
- package/types/FinancialConnections/Accounts.d.ts +1 -29
- package/types/FinancialConnections/AccountsResource.d.ts +3 -35
- package/types/FinancialConnections/Sessions.d.ts +1 -49
- package/types/FinancialConnections/SessionsResource.d.ts +1 -38
- package/types/InvoiceItems.d.ts +0 -5
- package/types/InvoiceItemsResource.d.ts +0 -98
- package/types/InvoiceLineItems.d.ts +0 -22
- package/types/Invoices.d.ts +1 -116
- package/types/InvoicesResource.d.ts +1833 -5491
- package/types/Issuing/CardholdersResource.d.ts +1 -2
- package/types/LineItems.d.ts +0 -7
- package/types/Mandates.d.ts +0 -77
- package/types/PaymentIntents.d.ts +3 -489
- package/types/PaymentIntentsResource.d.ts +3456 -6972
- package/types/PaymentLinks.d.ts +0 -1
- package/types/PaymentLinksResource.d.ts +0 -2
- package/types/PaymentMethodConfigurations.d.ts +0 -36
- package/types/PaymentMethodConfigurationsResource.d.ts +0 -50
- package/types/PaymentMethods.d.ts +31 -66
- package/types/PaymentMethodsResource.d.ts +0 -110
- package/types/Prices.d.ts +0 -22
- package/types/PricesResource.d.ts +0 -22
- package/types/Products.d.ts +0 -39
- package/types/ProductsResource.d.ts +0 -36
- package/types/Quotes.d.ts +1 -596
- package/types/QuotesResource.d.ts +267 -3176
- package/types/SetupAttempts.d.ts +0 -9
- package/types/SetupIntents.d.ts +2 -111
- package/types/SetupIntentsResource.d.ts +3 -498
- package/types/Sources.d.ts +0 -23
- package/types/SubscriptionItems.d.ts +0 -21
- package/types/SubscriptionItemsResource.d.ts +0 -109
- package/types/SubscriptionSchedules.d.ts +0 -200
- package/types/SubscriptionSchedulesResource.d.ts +13 -1231
- package/types/Subscriptions.d.ts +1 -82
- package/types/SubscriptionsResource.d.ts +2 -347
- package/types/Terminal/Readers.d.ts +0 -278
- package/types/Terminal/ReadersResource.d.ts +0 -208
- package/types/TestHelpers/ConfirmationTokensResource.d.ts +0 -55
- package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +0 -26
- package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +0 -26
- package/types/TokensResource.d.ts +1 -1
- package/types/Treasury/FinancialAccounts.d.ts +0 -5
- package/types/Treasury/FinancialAccountsResource.d.ts +0 -10
- package/types/Treasury/OutboundTransfers.d.ts +0 -26
- package/types/Treasury/OutboundTransfersResource.d.ts +0 -26
- package/types/Treasury/ReceivedCredits.d.ts +0 -26
- package/types/Treasury/ReceivedDebits.d.ts +0 -31
- package/types/WebhookEndpointsResource.d.ts +0 -54
- package/types/index.d.ts +0 -67
- package/types/lib.d.ts +0 -12
- package/cjs/resources/AccountNotices.js +0 -21
- package/cjs/resources/Capital/FinancingOffers.js +0 -21
- package/cjs/resources/Capital/FinancingSummary.js +0 -12
- package/cjs/resources/Capital/FinancingTransactions.js +0 -17
- package/cjs/resources/FinancialConnections/Institutions.js +0 -17
- package/cjs/resources/GiftCards/Cards.js +0 -23
- package/cjs/resources/GiftCards/Transactions.js +0 -33
- package/cjs/resources/Issuing/CreditUnderwritingRecords.js +0 -33
- package/cjs/resources/Margins.js +0 -22
- package/cjs/resources/Orders.js +0 -24
- package/cjs/resources/QuotePhases.js +0 -22
- package/cjs/resources/Tax/Associations.js +0 -9
- package/cjs/resources/Tax/Forms.js +0 -20
- package/esm/resources/AccountNotices.js +0 -18
- package/esm/resources/Capital/FinancingOffers.js +0 -18
- package/esm/resources/Capital/FinancingSummary.js +0 -9
- package/esm/resources/Capital/FinancingTransactions.js +0 -14
- package/esm/resources/FinancialConnections/Institutions.js +0 -14
- package/esm/resources/GiftCards/Cards.js +0 -20
- package/esm/resources/GiftCards/Transactions.js +0 -30
- package/esm/resources/Issuing/CreditUnderwritingRecords.js +0 -30
- package/esm/resources/Margins.js +0 -19
- package/esm/resources/Orders.js +0 -21
- package/esm/resources/QuotePhases.js +0 -19
- package/esm/resources/Tax/Associations.js +0 -6
- package/esm/resources/Tax/Forms.js +0 -17
- package/types/AccountNotices.d.ts +0 -113
- package/types/AccountNoticesResource.d.ts +0 -98
- package/types/Capital/FinancingOffers.d.ts +0 -188
- package/types/Capital/FinancingOffersResource.d.ts +0 -97
- package/types/Capital/FinancingSummary.d.ts +0 -106
- package/types/Capital/FinancingSummaryResource.d.ts +0 -27
- package/types/Capital/FinancingTransactions.d.ts +0 -135
- package/types/Capital/FinancingTransactionsResource.d.ts +0 -68
- package/types/FinancialConnections/AccountInferredBalances.d.ts +0 -38
- package/types/FinancialConnections/Institutions.d.ts +0 -93
- package/types/FinancialConnections/InstitutionsResource.d.ts +0 -47
- package/types/GiftCards/Cards.d.ts +0 -118
- package/types/GiftCards/CardsResource.d.ts +0 -159
- package/types/GiftCards/Transactions.d.ts +0 -129
- package/types/GiftCards/TransactionsResource.d.ts +0 -201
- package/types/InvoicePayments.d.ts +0 -138
- package/types/Issuing/CreditUnderwritingRecords.d.ts +0 -446
- package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +0 -1017
- package/types/Margins.d.ts +0 -56
- package/types/MarginsResource.d.ts +0 -114
- package/types/Orders.d.ts +0 -1083
- package/types/OrdersResource.d.ts +0 -2763
- package/types/QuoteLines.d.ts +0 -634
- package/types/QuotePhases.d.ts +0 -198
- package/types/QuotePhasesResource.d.ts +0 -67
- package/types/QuotePreviewInvoices.d.ts +0 -1530
- package/types/QuotePreviewSubscriptionSchedules.d.ts +0 -814
- package/types/Tax/Associations.d.ts +0 -126
- package/types/Tax/AssociationsResource.d.ts +0 -29
- package/types/Tax/Forms.d.ts +0 -133
- package/types/Tax/FormsResource.d.ts +0 -90
package/esm/RequestSender.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { StripeAPIError, StripeAuthenticationError, StripeConnectionError, StripeError, StripePermissionError, StripeRateLimitError, } from './Error.js';
|
|
2
|
-
import { emitWarning,
|
|
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,
|
|
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':
|
|
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
|
|
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
|
-
|
|
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
|
}
|
package/esm/StripeResource.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getDataFromArgs, getOptionsFromArgs, makeURLInterpolator, protoExtend,
|
|
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
|
-
|
|
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
package/esm/multipart.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { flattenAndStringify,
|
|
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,
|
|
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',
|
package/esm/resources/OAuth.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
import { StripeResource } from '../StripeResource.js';
|
|
3
|
-
import {
|
|
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}?${
|
|
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',
|
package/esm/resources/Quotes.js
CHANGED
|
@@ -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,
|
package/esm/stripe.core.js
CHANGED
|
@@ -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
|
|
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.8.0
|
|
34
|
+
Stripe.PACKAGE_VERSION = '16.8.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
|
|
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;
|
|
@@ -296,18 +285,3 @@ export function concat(arrays) {
|
|
|
296
285
|
});
|
|
297
286
|
return merged;
|
|
298
287
|
}
|
|
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
|
@@ -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.
|