stripe 16.2.0 → 16.4.0-beta.1
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 +768 -109
- package/README.md +33 -0
- package/VERSION +1 -1
- package/cjs/RequestSender.js +66 -5
- package/cjs/ResourceNamespace.js +3 -0
- package/cjs/StripeResource.js +1 -1
- package/cjs/Webhooks.js +29 -17
- package/cjs/apiVersion.js +2 -1
- package/cjs/multipart.js +4 -1
- package/cjs/resources/AccountNotices.js +21 -0
- package/cjs/resources/Capital/FinancingOffers.js +21 -0
- package/cjs/resources/Capital/FinancingSummary.js +12 -0
- package/cjs/resources/Capital/FinancingTransactions.js +17 -0
- package/cjs/resources/FinancialConnections/Accounts.js +5 -0
- package/cjs/resources/FinancialConnections/Institutions.js +17 -0
- package/cjs/resources/GiftCards/Cards.js +23 -0
- package/cjs/resources/GiftCards/Transactions.js +33 -0
- package/cjs/resources/Invoices.js +13 -0
- package/cjs/resources/Issuing/CreditUnderwritingRecords.js +33 -0
- package/cjs/resources/Margins.js +22 -0
- package/cjs/resources/OAuth.js +1 -1
- package/cjs/resources/Orders.js +24 -0
- package/cjs/resources/PaymentIntents.js +4 -0
- package/cjs/resources/QuotePhases.js +22 -0
- package/cjs/resources/Quotes.js +32 -0
- package/cjs/resources/SubscriptionSchedules.js +4 -0
- package/cjs/resources/Tax/Forms.js +20 -0
- package/cjs/resources/Terminal/Readers.js +12 -0
- package/cjs/resources.js +38 -10
- package/cjs/stripe.core.js +16 -7
- package/cjs/utils.js +30 -3
- package/esm/RequestSender.js +67 -6
- package/esm/ResourceNamespace.js +3 -0
- package/esm/StripeResource.js +2 -2
- package/esm/Webhooks.js +29 -17
- package/esm/apiVersion.js +1 -0
- package/esm/multipart.js +5 -2
- package/esm/resources/AccountNotices.js +18 -0
- package/esm/resources/Capital/FinancingOffers.js +18 -0
- package/esm/resources/Capital/FinancingSummary.js +9 -0
- package/esm/resources/Capital/FinancingTransactions.js +14 -0
- package/esm/resources/FinancialConnections/Accounts.js +5 -0
- package/esm/resources/FinancialConnections/Institutions.js +14 -0
- package/esm/resources/GiftCards/Cards.js +20 -0
- package/esm/resources/GiftCards/Transactions.js +30 -0
- package/esm/resources/Invoices.js +13 -0
- package/esm/resources/Issuing/CreditUnderwritingRecords.js +30 -0
- package/esm/resources/Margins.js +19 -0
- package/esm/resources/OAuth.js +2 -2
- package/esm/resources/Orders.js +21 -0
- package/esm/resources/PaymentIntents.js +4 -0
- package/esm/resources/QuotePhases.js +19 -0
- package/esm/resources/Quotes.js +32 -0
- package/esm/resources/SubscriptionSchedules.js +4 -0
- package/esm/resources/Tax/Forms.js +17 -0
- package/esm/resources/Terminal/Readers.js +12 -0
- package/esm/resources.js +24 -0
- package/esm/stripe.core.js +16 -7
- package/esm/utils.js +27 -1
- package/package.json +1 -1
- package/types/AccountLinksResource.d.ts +5 -1
- package/types/AccountNotices.d.ts +110 -0
- package/types/AccountNoticesResource.d.ts +98 -0
- package/types/AccountSessions.d.ts +15 -0
- package/types/AccountSessionsResource.d.ts +205 -0
- package/types/Accounts.d.ts +88 -1
- package/types/AccountsResource.d.ts +204 -0
- package/types/BillingPortal/Sessions.d.ts +1 -1
- package/types/Capital/FinancingOffers.d.ts +188 -0
- package/types/Capital/FinancingOffersResource.d.ts +97 -0
- package/types/Capital/FinancingSummary.d.ts +106 -0
- package/types/Capital/FinancingSummaryResource.d.ts +27 -0
- package/types/Capital/FinancingTransactions.d.ts +135 -0
- package/types/Capital/FinancingTransactionsResource.d.ts +68 -0
- package/types/Charges.d.ts +67 -0
- package/types/ChargesResource.d.ts +1294 -0
- package/types/Checkout/Sessions.d.ts +28 -1
- package/types/Checkout/SessionsResource.d.ts +15 -1
- package/types/ConfirmationTokens.d.ts +83 -0
- package/types/Coupons.d.ts +1 -1
- package/types/CouponsResource.d.ts +1 -1
- package/types/CreditNotes.d.ts +21 -0
- package/types/CreditNotesResource.d.ts +51 -0
- package/types/CustomerSessions.d.ts +76 -0
- package/types/CustomerSessionsResource.d.ts +76 -0
- package/types/CustomersResource.d.ts +2 -0
- package/types/Disputes.d.ts +168 -0
- package/types/DisputesResource.d.ts +120 -0
- package/types/EventTypes.d.ts +426 -0
- package/types/Events.d.ts +83 -0
- package/types/FinancialConnections/AccountInferredBalances.d.ts +38 -0
- package/types/FinancialConnections/Accounts.d.ts +29 -1
- package/types/FinancialConnections/AccountsResource.d.ts +35 -3
- package/types/FinancialConnections/Institutions.d.ts +93 -0
- package/types/FinancialConnections/InstitutionsResource.d.ts +47 -0
- package/types/FinancialConnections/Sessions.d.ts +49 -1
- package/types/FinancialConnections/SessionsResource.d.ts +38 -1
- package/types/GiftCards/Cards.d.ts +118 -0
- package/types/GiftCards/CardsResource.d.ts +159 -0
- package/types/GiftCards/Transactions.d.ts +129 -0
- package/types/GiftCards/TransactionsResource.d.ts +201 -0
- package/types/InvoiceItems.d.ts +5 -0
- package/types/InvoiceItemsResource.d.ts +98 -0
- package/types/InvoiceLineItems.d.ts +22 -0
- package/types/InvoicePayments.d.ts +91 -0
- package/types/Invoices.d.ts +116 -6
- package/types/InvoicesResource.d.ts +5395 -1818
- package/types/Issuing/CardholdersResource.d.ts +2 -1
- package/types/Issuing/Cards.d.ts +34 -0
- package/types/Issuing/CardsResource.d.ts +125 -0
- package/types/Issuing/CreditUnderwritingRecords.d.ts +446 -0
- package/types/Issuing/CreditUnderwritingRecordsResource.d.ts +1017 -0
- package/types/LineItems.d.ts +7 -0
- package/types/Mandates.d.ts +77 -0
- package/types/Margins.d.ts +56 -0
- package/types/MarginsResource.d.ts +114 -0
- package/types/Orders.d.ts +1057 -0
- package/types/OrdersResource.d.ts +2711 -0
- package/types/PaymentIntents.d.ts +469 -6
- package/types/PaymentIntentsResource.d.ts +6721 -3373
- package/types/PaymentMethods.d.ts +62 -0
- package/types/PaymentMethodsResource.d.ts +110 -0
- package/types/Plans.d.ts +1 -1
- package/types/Prices.d.ts +23 -1
- package/types/PricesResource.d.ts +22 -0
- package/types/Products.d.ts +39 -0
- package/types/ProductsResource.d.ts +36 -0
- package/types/QuoteLines.d.ts +634 -0
- package/types/QuotePhases.d.ts +198 -0
- package/types/QuotePhasesResource.d.ts +67 -0
- package/types/QuotePreviewInvoices.d.ts +1530 -0
- package/types/QuotePreviewSubscriptionSchedules.d.ts +778 -0
- package/types/Quotes.d.ts +578 -1
- package/types/QuotesResource.d.ts +3174 -265
- package/types/SetupAttempts.d.ts +9 -5
- package/types/SetupIntents.d.ts +110 -6
- package/types/SetupIntentsResource.d.ts +498 -3
- package/types/Sources.d.ts +23 -0
- package/types/SubscriptionItems.d.ts +21 -0
- package/types/SubscriptionItemsResource.d.ts +109 -0
- package/types/SubscriptionSchedules.d.ts +164 -0
- package/types/SubscriptionSchedulesResource.d.ts +1234 -16
- package/types/Subscriptions.d.ts +46 -1
- package/types/SubscriptionsResource.d.ts +350 -5
- package/types/Tax/Forms.d.ts +133 -0
- package/types/Tax/FormsResource.d.ts +90 -0
- package/types/Terminal/Readers.d.ts +278 -0
- package/types/Terminal/ReadersResource.d.ts +208 -0
- package/types/TestHelpers/ConfirmationTokensResource.d.ts +55 -0
- package/types/TestHelpers/Treasury/ReceivedCreditsResource.d.ts +26 -0
- package/types/TestHelpers/Treasury/ReceivedDebitsResource.d.ts +26 -0
- package/types/Treasury/OutboundTransfers.d.ts +26 -0
- package/types/Treasury/OutboundTransfersResource.d.ts +26 -0
- package/types/Treasury/ReceivedCredits.d.ts +26 -0
- package/types/Treasury/ReceivedDebits.d.ts +31 -0
- package/types/WebhookEndpointsResource.d.ts +50 -0
- package/types/index.d.ts +64 -0
- package/types/lib.d.ts +12 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Forms = void 0;
|
|
5
|
+
const StripeResource_js_1 = require("../../StripeResource.js");
|
|
6
|
+
const stripeMethod = StripeResource_js_1.StripeResource.method;
|
|
7
|
+
exports.Forms = StripeResource_js_1.StripeResource.extend({
|
|
8
|
+
retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/tax/forms/{id}' }),
|
|
9
|
+
list: stripeMethod({
|
|
10
|
+
method: 'GET',
|
|
11
|
+
fullPath: '/v1/tax/forms',
|
|
12
|
+
methodType: 'list',
|
|
13
|
+
}),
|
|
14
|
+
pdf: stripeMethod({
|
|
15
|
+
method: 'GET',
|
|
16
|
+
fullPath: '/v1/tax/forms/{id}/pdf',
|
|
17
|
+
host: 'files.stripe.com',
|
|
18
|
+
streaming: true,
|
|
19
|
+
}),
|
|
20
|
+
});
|
|
@@ -27,6 +27,18 @@ exports.Readers = StripeResource_js_1.StripeResource.extend({
|
|
|
27
27
|
method: 'POST',
|
|
28
28
|
fullPath: '/v1/terminal/readers/{reader}/cancel_action',
|
|
29
29
|
}),
|
|
30
|
+
collectInputs: stripeMethod({
|
|
31
|
+
method: 'POST',
|
|
32
|
+
fullPath: '/v1/terminal/readers/{reader}/collect_inputs',
|
|
33
|
+
}),
|
|
34
|
+
collectPaymentMethod: stripeMethod({
|
|
35
|
+
method: 'POST',
|
|
36
|
+
fullPath: '/v1/terminal/readers/{reader}/collect_payment_method',
|
|
37
|
+
}),
|
|
38
|
+
confirmPaymentIntent: stripeMethod({
|
|
39
|
+
method: 'POST',
|
|
40
|
+
fullPath: '/v1/terminal/readers/{reader}/confirm_payment_intent',
|
|
41
|
+
}),
|
|
30
42
|
processPaymentIntent: stripeMethod({
|
|
31
43
|
method: 'POST',
|
|
32
44
|
fullPath: '/v1/terminal/readers/{reader}/process_payment_intent',
|
package/cjs/resources.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
5
|
-
exports.Treasury = exports.TestHelpers = exports.Terminal = exports.Tax = exports.Sigma = exports.Reporting = exports.Radar = exports.Issuing = exports.Identity = exports.Forwarding = exports.FinancialConnections = exports.Entitlements = exports.Climate = exports.Checkout = exports.BillingPortal = exports.Billing = exports.Apps = exports.WebhookEndpoints = exports.Transfers = void 0;
|
|
4
|
+
exports.TaxCodes = exports.Subscriptions = exports.SubscriptionSchedules = exports.SubscriptionItems = exports.Sources = exports.ShippingRates = exports.SetupIntents = exports.SetupAttempts = exports.Reviews = exports.Refunds = exports.Quotes = exports.QuotePhases = exports.PromotionCodes = exports.Products = exports.Prices = exports.Plans = exports.Payouts = exports.PaymentMethods = exports.PaymentMethodDomains = exports.PaymentMethodConfigurations = exports.PaymentLinks = exports.PaymentIntents = exports.Orders = exports.OAuth = exports.Margins = exports.Mandates = exports.Invoices = exports.InvoiceItems = exports.Files = exports.FileLinks = exports.ExchangeRates = exports.Events = exports.EphemeralKeys = exports.Disputes = exports.Customers = exports.CustomerSessions = exports.CreditNotes = exports.Coupons = exports.CountrySpecs = exports.ConfirmationTokens = exports.Charges = exports.BalanceTransactions = exports.Balance = exports.ApplicationFees = exports.ApplePayDomains = exports.Accounts = exports.AccountSessions = exports.AccountNotices = exports.AccountLinks = exports.Account = void 0;
|
|
5
|
+
exports.Treasury = exports.TestHelpers = exports.Terminal = exports.Tax = exports.Sigma = exports.Reporting = exports.Radar = exports.Issuing = exports.Identity = exports.GiftCards = exports.Forwarding = exports.FinancialConnections = exports.Entitlements = exports.Climate = exports.Checkout = exports.Capital = exports.BillingPortal = exports.Billing = exports.Apps = exports.WebhookEndpoints = exports.Transfers = exports.Topups = exports.Tokens = exports.TaxRates = exports.TaxIds = void 0;
|
|
6
6
|
const ResourceNamespace_js_1 = require("./ResourceNamespace.js");
|
|
7
7
|
const Accounts_js_1 = require("./resources/FinancialConnections/Accounts.js");
|
|
8
8
|
const ActiveEntitlements_js_1 = require("./resources/Entitlements/ActiveEntitlements.js");
|
|
@@ -11,20 +11,27 @@ const Authorizations_js_2 = require("./resources/Issuing/Authorizations.js");
|
|
|
11
11
|
const Calculations_js_1 = require("./resources/Tax/Calculations.js");
|
|
12
12
|
const Cardholders_js_1 = require("./resources/Issuing/Cardholders.js");
|
|
13
13
|
const Cards_js_1 = require("./resources/TestHelpers/Issuing/Cards.js");
|
|
14
|
-
const Cards_js_2 = require("./resources/
|
|
14
|
+
const Cards_js_2 = require("./resources/GiftCards/Cards.js");
|
|
15
|
+
const Cards_js_3 = require("./resources/Issuing/Cards.js");
|
|
15
16
|
const Configurations_js_1 = require("./resources/BillingPortal/Configurations.js");
|
|
16
17
|
const Configurations_js_2 = require("./resources/Terminal/Configurations.js");
|
|
17
18
|
const ConfirmationTokens_js_1 = require("./resources/TestHelpers/ConfirmationTokens.js");
|
|
18
19
|
const ConnectionTokens_js_1 = require("./resources/Terminal/ConnectionTokens.js");
|
|
19
20
|
const CreditReversals_js_1 = require("./resources/Treasury/CreditReversals.js");
|
|
21
|
+
const CreditUnderwritingRecords_js_1 = require("./resources/Issuing/CreditUnderwritingRecords.js");
|
|
20
22
|
const Customers_js_1 = require("./resources/TestHelpers/Customers.js");
|
|
21
23
|
const DebitReversals_js_1 = require("./resources/Treasury/DebitReversals.js");
|
|
22
24
|
const Disputes_js_1 = require("./resources/Issuing/Disputes.js");
|
|
23
25
|
const EarlyFraudWarnings_js_1 = require("./resources/Radar/EarlyFraudWarnings.js");
|
|
24
26
|
const Features_js_1 = require("./resources/Entitlements/Features.js");
|
|
25
27
|
const FinancialAccounts_js_1 = require("./resources/Treasury/FinancialAccounts.js");
|
|
28
|
+
const FinancingOffers_js_1 = require("./resources/Capital/FinancingOffers.js");
|
|
29
|
+
const FinancingSummary_js_1 = require("./resources/Capital/FinancingSummary.js");
|
|
30
|
+
const FinancingTransactions_js_1 = require("./resources/Capital/FinancingTransactions.js");
|
|
31
|
+
const Forms_js_1 = require("./resources/Tax/Forms.js");
|
|
26
32
|
const InboundTransfers_js_1 = require("./resources/TestHelpers/Treasury/InboundTransfers.js");
|
|
27
33
|
const InboundTransfers_js_2 = require("./resources/Treasury/InboundTransfers.js");
|
|
34
|
+
const Institutions_js_1 = require("./resources/FinancialConnections/Institutions.js");
|
|
28
35
|
const Locations_js_1 = require("./resources/Terminal/Locations.js");
|
|
29
36
|
const MeterEventAdjustments_js_1 = require("./resources/Billing/MeterEventAdjustments.js");
|
|
30
37
|
const MeterEvents_js_1 = require("./resources/Billing/MeterEvents.js");
|
|
@@ -61,9 +68,10 @@ const Tokens_js_1 = require("./resources/Issuing/Tokens.js");
|
|
|
61
68
|
const TransactionEntries_js_1 = require("./resources/Treasury/TransactionEntries.js");
|
|
62
69
|
const Transactions_js_1 = require("./resources/TestHelpers/Issuing/Transactions.js");
|
|
63
70
|
const Transactions_js_2 = require("./resources/FinancialConnections/Transactions.js");
|
|
64
|
-
const Transactions_js_3 = require("./resources/
|
|
65
|
-
const Transactions_js_4 = require("./resources/
|
|
66
|
-
const Transactions_js_5 = require("./resources/
|
|
71
|
+
const Transactions_js_3 = require("./resources/GiftCards/Transactions.js");
|
|
72
|
+
const Transactions_js_4 = require("./resources/Issuing/Transactions.js");
|
|
73
|
+
const Transactions_js_5 = require("./resources/Tax/Transactions.js");
|
|
74
|
+
const Transactions_js_6 = require("./resources/Treasury/Transactions.js");
|
|
67
75
|
const ValueListItems_js_1 = require("./resources/Radar/ValueListItems.js");
|
|
68
76
|
const ValueLists_js_1 = require("./resources/Radar/ValueLists.js");
|
|
69
77
|
const VerificationReports_js_1 = require("./resources/Identity/VerificationReports.js");
|
|
@@ -72,6 +80,8 @@ var Accounts_js_2 = require("./resources/Accounts.js");
|
|
|
72
80
|
Object.defineProperty(exports, "Account", { enumerable: true, get: function () { return Accounts_js_2.Accounts; } });
|
|
73
81
|
var AccountLinks_js_1 = require("./resources/AccountLinks.js");
|
|
74
82
|
Object.defineProperty(exports, "AccountLinks", { enumerable: true, get: function () { return AccountLinks_js_1.AccountLinks; } });
|
|
83
|
+
var AccountNotices_js_1 = require("./resources/AccountNotices.js");
|
|
84
|
+
Object.defineProperty(exports, "AccountNotices", { enumerable: true, get: function () { return AccountNotices_js_1.AccountNotices; } });
|
|
75
85
|
var AccountSessions_js_1 = require("./resources/AccountSessions.js");
|
|
76
86
|
Object.defineProperty(exports, "AccountSessions", { enumerable: true, get: function () { return AccountSessions_js_1.AccountSessions; } });
|
|
77
87
|
var Accounts_js_3 = require("./resources/Accounts.js");
|
|
@@ -116,8 +126,12 @@ var Invoices_js_1 = require("./resources/Invoices.js");
|
|
|
116
126
|
Object.defineProperty(exports, "Invoices", { enumerable: true, get: function () { return Invoices_js_1.Invoices; } });
|
|
117
127
|
var Mandates_js_1 = require("./resources/Mandates.js");
|
|
118
128
|
Object.defineProperty(exports, "Mandates", { enumerable: true, get: function () { return Mandates_js_1.Mandates; } });
|
|
129
|
+
var Margins_js_1 = require("./resources/Margins.js");
|
|
130
|
+
Object.defineProperty(exports, "Margins", { enumerable: true, get: function () { return Margins_js_1.Margins; } });
|
|
119
131
|
var OAuth_js_1 = require("./resources/OAuth.js");
|
|
120
132
|
Object.defineProperty(exports, "OAuth", { enumerable: true, get: function () { return OAuth_js_1.OAuth; } });
|
|
133
|
+
var Orders_js_2 = require("./resources/Orders.js");
|
|
134
|
+
Object.defineProperty(exports, "Orders", { enumerable: true, get: function () { return Orders_js_2.Orders; } });
|
|
121
135
|
var PaymentIntents_js_1 = require("./resources/PaymentIntents.js");
|
|
122
136
|
Object.defineProperty(exports, "PaymentIntents", { enumerable: true, get: function () { return PaymentIntents_js_1.PaymentIntents; } });
|
|
123
137
|
var PaymentLinks_js_1 = require("./resources/PaymentLinks.js");
|
|
@@ -138,6 +152,8 @@ var Products_js_2 = require("./resources/Products.js");
|
|
|
138
152
|
Object.defineProperty(exports, "Products", { enumerable: true, get: function () { return Products_js_2.Products; } });
|
|
139
153
|
var PromotionCodes_js_1 = require("./resources/PromotionCodes.js");
|
|
140
154
|
Object.defineProperty(exports, "PromotionCodes", { enumerable: true, get: function () { return PromotionCodes_js_1.PromotionCodes; } });
|
|
155
|
+
var QuotePhases_js_1 = require("./resources/QuotePhases.js");
|
|
156
|
+
Object.defineProperty(exports, "QuotePhases", { enumerable: true, get: function () { return QuotePhases_js_1.QuotePhases; } });
|
|
141
157
|
var Quotes_js_1 = require("./resources/Quotes.js");
|
|
142
158
|
Object.defineProperty(exports, "Quotes", { enumerable: true, get: function () { return Quotes_js_1.Quotes; } });
|
|
143
159
|
var Refunds_js_2 = require("./resources/Refunds.js");
|
|
@@ -182,6 +198,11 @@ exports.BillingPortal = (0, ResourceNamespace_js_1.resourceNamespace)('billingPo
|
|
|
182
198
|
Configurations: Configurations_js_1.Configurations,
|
|
183
199
|
Sessions: Sessions_js_1.Sessions,
|
|
184
200
|
});
|
|
201
|
+
exports.Capital = (0, ResourceNamespace_js_1.resourceNamespace)('capital', {
|
|
202
|
+
FinancingOffers: FinancingOffers_js_1.FinancingOffers,
|
|
203
|
+
FinancingSummary: FinancingSummary_js_1.FinancingSummary,
|
|
204
|
+
FinancingTransactions: FinancingTransactions_js_1.FinancingTransactions,
|
|
205
|
+
});
|
|
185
206
|
exports.Checkout = (0, ResourceNamespace_js_1.resourceNamespace)('checkout', {
|
|
186
207
|
Sessions: Sessions_js_2.Sessions,
|
|
187
208
|
});
|
|
@@ -196,12 +217,17 @@ exports.Entitlements = (0, ResourceNamespace_js_1.resourceNamespace)('entitlemen
|
|
|
196
217
|
});
|
|
197
218
|
exports.FinancialConnections = (0, ResourceNamespace_js_1.resourceNamespace)('financialConnections', {
|
|
198
219
|
Accounts: Accounts_js_1.Accounts,
|
|
220
|
+
Institutions: Institutions_js_1.Institutions,
|
|
199
221
|
Sessions: Sessions_js_3.Sessions,
|
|
200
222
|
Transactions: Transactions_js_2.Transactions,
|
|
201
223
|
});
|
|
202
224
|
exports.Forwarding = (0, ResourceNamespace_js_1.resourceNamespace)('forwarding', {
|
|
203
225
|
Requests: Requests_js_1.Requests,
|
|
204
226
|
});
|
|
227
|
+
exports.GiftCards = (0, ResourceNamespace_js_1.resourceNamespace)('giftCards', {
|
|
228
|
+
Cards: Cards_js_2.Cards,
|
|
229
|
+
Transactions: Transactions_js_3.Transactions,
|
|
230
|
+
});
|
|
205
231
|
exports.Identity = (0, ResourceNamespace_js_1.resourceNamespace)('identity', {
|
|
206
232
|
VerificationReports: VerificationReports_js_1.VerificationReports,
|
|
207
233
|
VerificationSessions: VerificationSessions_js_1.VerificationSessions,
|
|
@@ -209,12 +235,13 @@ exports.Identity = (0, ResourceNamespace_js_1.resourceNamespace)('identity', {
|
|
|
209
235
|
exports.Issuing = (0, ResourceNamespace_js_1.resourceNamespace)('issuing', {
|
|
210
236
|
Authorizations: Authorizations_js_2.Authorizations,
|
|
211
237
|
Cardholders: Cardholders_js_1.Cardholders,
|
|
212
|
-
Cards:
|
|
238
|
+
Cards: Cards_js_3.Cards,
|
|
239
|
+
CreditUnderwritingRecords: CreditUnderwritingRecords_js_1.CreditUnderwritingRecords,
|
|
213
240
|
Disputes: Disputes_js_1.Disputes,
|
|
214
241
|
PersonalizationDesigns: PersonalizationDesigns_js_2.PersonalizationDesigns,
|
|
215
242
|
PhysicalBundles: PhysicalBundles_js_1.PhysicalBundles,
|
|
216
243
|
Tokens: Tokens_js_1.Tokens,
|
|
217
|
-
Transactions:
|
|
244
|
+
Transactions: Transactions_js_4.Transactions,
|
|
218
245
|
});
|
|
219
246
|
exports.Radar = (0, ResourceNamespace_js_1.resourceNamespace)('radar', {
|
|
220
247
|
EarlyFraudWarnings: EarlyFraudWarnings_js_1.EarlyFraudWarnings,
|
|
@@ -230,9 +257,10 @@ exports.Sigma = (0, ResourceNamespace_js_1.resourceNamespace)('sigma', {
|
|
|
230
257
|
});
|
|
231
258
|
exports.Tax = (0, ResourceNamespace_js_1.resourceNamespace)('tax', {
|
|
232
259
|
Calculations: Calculations_js_1.Calculations,
|
|
260
|
+
Forms: Forms_js_1.Forms,
|
|
233
261
|
Registrations: Registrations_js_1.Registrations,
|
|
234
262
|
Settings: Settings_js_1.Settings,
|
|
235
|
-
Transactions:
|
|
263
|
+
Transactions: Transactions_js_5.Transactions,
|
|
236
264
|
});
|
|
237
265
|
exports.Terminal = (0, ResourceNamespace_js_1.resourceNamespace)('terminal', {
|
|
238
266
|
Configurations: Configurations_js_2.Configurations,
|
|
@@ -272,5 +300,5 @@ exports.Treasury = (0, ResourceNamespace_js_1.resourceNamespace)('treasury', {
|
|
|
272
300
|
ReceivedCredits: ReceivedCredits_js_2.ReceivedCredits,
|
|
273
301
|
ReceivedDebits: ReceivedDebits_js_2.ReceivedDebits,
|
|
274
302
|
TransactionEntries: TransactionEntries_js_1.TransactionEntries,
|
|
275
|
-
Transactions:
|
|
303
|
+
Transactions: Transactions_js_6.Transactions,
|
|
276
304
|
});
|
package/cjs/stripe.core.js
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createStripe = void 0;
|
|
4
4
|
const _Error = require("./Error.js");
|
|
5
|
-
const apiVersion = require("./apiVersion.js");
|
|
6
|
-
const resources = require("./resources.js");
|
|
7
|
-
const HttpClient_js_1 = require("./net/HttpClient.js");
|
|
8
|
-
const utils_js_1 = require("./utils.js");
|
|
9
|
-
const CryptoProvider_js_1 = require("./crypto/CryptoProvider.js");
|
|
10
5
|
const RequestSender_js_1 = require("./RequestSender.js");
|
|
11
6
|
const StripeResource_js_1 = require("./StripeResource.js");
|
|
12
7
|
const Webhooks_js_1 = require("./Webhooks.js");
|
|
8
|
+
const apiVersion_js_1 = require("./apiVersion.js");
|
|
9
|
+
const CryptoProvider_js_1 = require("./crypto/CryptoProvider.js");
|
|
10
|
+
const HttpClient_js_1 = require("./net/HttpClient.js");
|
|
11
|
+
const resources = require("./resources.js");
|
|
12
|
+
const utils_js_1 = require("./utils.js");
|
|
13
13
|
const DEFAULT_HOST = 'api.stripe.com';
|
|
14
14
|
const DEFAULT_PORT = '443';
|
|
15
15
|
const DEFAULT_BASE_PATH = '/v1/';
|
|
16
|
-
const DEFAULT_API_VERSION =
|
|
16
|
+
const DEFAULT_API_VERSION = apiVersion_js_1.ApiVersion;
|
|
17
17
|
const DEFAULT_TIMEOUT = 80000;
|
|
18
18
|
const MAX_NETWORK_RETRY_DELAY_SEC = 2;
|
|
19
19
|
const INITIAL_NETWORK_RETRY_DELAY_SEC = 0.5;
|
|
@@ -34,7 +34,7 @@ const ALLOWED_CONFIG_PROPERTIES = [
|
|
|
34
34
|
];
|
|
35
35
|
const defaultRequestSenderFactory = (stripe) => new RequestSender_js_1.RequestSender(stripe, StripeResource_js_1.StripeResource.MAX_BUFFERED_REQUEST_METRICS);
|
|
36
36
|
function createStripe(platformFunctions, requestSender = defaultRequestSenderFactory) {
|
|
37
|
-
Stripe.PACKAGE_VERSION = '16.
|
|
37
|
+
Stripe.PACKAGE_VERSION = '16.4.0-beta.1';
|
|
38
38
|
Stripe.USER_AGENT = Object.assign({ bindings_version: Stripe.PACKAGE_VERSION, lang: 'node', publisher: 'stripe', uname: null, typescript: false }, (0, utils_js_1.determineProcessUserAgentProperties)());
|
|
39
39
|
Stripe.StripeResource = StripeResource_js_1.StripeResource;
|
|
40
40
|
Stripe.resources = resources;
|
|
@@ -150,6 +150,9 @@ function createStripe(platformFunctions, requestSender = defaultRequestSenderFac
|
|
|
150
150
|
_enableTelemetry: null,
|
|
151
151
|
_requestSender: null,
|
|
152
152
|
_platformFunctions: null,
|
|
153
|
+
rawRequest(method, path, params, options) {
|
|
154
|
+
return this._requestSender._rawRequest(method, path, params, options);
|
|
155
|
+
},
|
|
153
156
|
/**
|
|
154
157
|
* @private
|
|
155
158
|
*/
|
|
@@ -274,6 +277,9 @@ function createStripe(platformFunctions, requestSender = defaultRequestSenderFac
|
|
|
274
277
|
var _a;
|
|
275
278
|
const userAgent = {};
|
|
276
279
|
for (const field in seed) {
|
|
280
|
+
if (!Object.prototype.hasOwnProperty.call(seed, field)) {
|
|
281
|
+
continue;
|
|
282
|
+
}
|
|
277
283
|
userAgent[field] = encodeURIComponent((_a = seed[field]) !== null && _a !== void 0 ? _a : 'null');
|
|
278
284
|
}
|
|
279
285
|
// URI-encode in case there are unusual characters in the system's uname.
|
|
@@ -317,6 +323,9 @@ function createStripe(platformFunctions, requestSender = defaultRequestSenderFac
|
|
|
317
323
|
*/
|
|
318
324
|
_prepResources() {
|
|
319
325
|
for (const name in resources) {
|
|
326
|
+
if (!Object.prototype.hasOwnProperty.call(resources, name)) {
|
|
327
|
+
continue;
|
|
328
|
+
}
|
|
320
329
|
// @ts-ignore
|
|
321
330
|
this[(0, utils_js_1.pascalToCamelCase)(name)] = new resources[name](this);
|
|
322
331
|
}
|
package/cjs/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.concat = exports.determineProcessUserAgentProperties = exports.validateInteger = exports.flattenAndStringify = exports.isObject = exports.emitWarning = exports.pascalToCamelCase = exports.callbackifyPromiseWithTimeout = exports.normalizeHeader = exports.normalizeHeaders = exports.removeNullish = exports.protoExtend = exports.getOptionsFromArgs = exports.getDataFromArgs = exports.extractUrlParams = exports.makeURLInterpolator = exports.
|
|
3
|
+
exports.jsonStringifyRequestData = exports.concat = exports.determineProcessUserAgentProperties = exports.validateInteger = exports.flattenAndStringify = exports.isObject = exports.emitWarning = exports.pascalToCamelCase = exports.callbackifyPromiseWithTimeout = exports.normalizeHeader = exports.normalizeHeaders = exports.removeNullish = exports.protoExtend = exports.getOptionsFromArgs = exports.getDataFromArgs = exports.extractUrlParams = exports.makeURLInterpolator = exports.queryStringifyRequestData = exports.isOptionsHash = void 0;
|
|
4
4
|
const qs = require("qs");
|
|
5
5
|
const OPTIONS_KEYS = [
|
|
6
6
|
'apiKey',
|
|
@@ -10,6 +10,8 @@ const OPTIONS_KEYS = [
|
|
|
10
10
|
'maxNetworkRetries',
|
|
11
11
|
'timeout',
|
|
12
12
|
'host',
|
|
13
|
+
'apiMode',
|
|
14
|
+
'additionalHeaders',
|
|
13
15
|
];
|
|
14
16
|
function isOptionsHash(o) {
|
|
15
17
|
return (o &&
|
|
@@ -21,7 +23,7 @@ exports.isOptionsHash = isOptionsHash;
|
|
|
21
23
|
* Stringifies an Object, accommodating nested objects
|
|
22
24
|
* (forming the conventional key 'parent[child]=value')
|
|
23
25
|
*/
|
|
24
|
-
function
|
|
26
|
+
function queryStringifyRequestData(data) {
|
|
25
27
|
return (qs
|
|
26
28
|
.stringify(data, {
|
|
27
29
|
serializeDate: (d) => Math.floor(d.getTime() / 1000).toString(),
|
|
@@ -32,7 +34,7 @@ function stringifyRequestData(data) {
|
|
|
32
34
|
.replace(/%5B/g, '[')
|
|
33
35
|
.replace(/%5D/g, ']'));
|
|
34
36
|
}
|
|
35
|
-
exports.
|
|
37
|
+
exports.queryStringifyRequestData = queryStringifyRequestData;
|
|
36
38
|
/**
|
|
37
39
|
* Outputs a new function with interpolated object property values.
|
|
38
40
|
* Use like so:
|
|
@@ -131,6 +133,15 @@ function getOptionsFromArgs(args) {
|
|
|
131
133
|
if (params.host) {
|
|
132
134
|
opts.host = params.host;
|
|
133
135
|
}
|
|
136
|
+
if (params.apiMode) {
|
|
137
|
+
if (params.apiMode !== 'standard' && params.apiMode !== 'preview') {
|
|
138
|
+
throw new Error(`Invalid apiMode: ${params.apiMode}. Must be one of 'standard' or 'preview'`);
|
|
139
|
+
}
|
|
140
|
+
opts.apiMode = params.apiMode;
|
|
141
|
+
}
|
|
142
|
+
if (params.additionalHeaders) {
|
|
143
|
+
opts.headers = params.additionalHeaders;
|
|
144
|
+
}
|
|
134
145
|
}
|
|
135
146
|
}
|
|
136
147
|
return opts;
|
|
@@ -305,3 +316,19 @@ function concat(arrays) {
|
|
|
305
316
|
return merged;
|
|
306
317
|
}
|
|
307
318
|
exports.concat = concat;
|
|
319
|
+
/**
|
|
320
|
+
* Replaces Date objects with Unix timestamps
|
|
321
|
+
*/
|
|
322
|
+
function dateTimeReplacer(key, value) {
|
|
323
|
+
if (this[key] instanceof Date) {
|
|
324
|
+
return Math.floor(this[key].getTime() / 1000).toString();
|
|
325
|
+
}
|
|
326
|
+
return value;
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* JSON stringifies an Object, replacing Date objects with Unix timestamps
|
|
330
|
+
*/
|
|
331
|
+
function jsonStringifyRequestData(data) {
|
|
332
|
+
return JSON.stringify(data, dateTimeReplacer);
|
|
333
|
+
}
|
|
334
|
+
exports.jsonStringifyRequestData = jsonStringifyRequestData;
|
package/esm/RequestSender.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { StripeAPIError, StripeAuthenticationError, StripeConnectionError, StripeError, StripePermissionError, StripeRateLimitError, } from './Error.js';
|
|
2
|
-
import { emitWarning, normalizeHeaders, removeNullish,
|
|
2
|
+
import { emitWarning, jsonStringifyRequestData, normalizeHeaders, removeNullish, queryStringifyRequestData, getDataFromArgs, getOptionsFromArgs, } from './utils.js';
|
|
3
3
|
import { HttpClient } from './net/HttpClient.js';
|
|
4
|
+
import { PreviewVersion } from './apiVersion.js';
|
|
4
5
|
const MAX_RETRY_AFTER_WAIT = 60;
|
|
5
6
|
export class RequestSender {
|
|
6
7
|
constructor(stripe, maxBufferedRequestMetric) {
|
|
@@ -198,12 +199,12 @@ export class RequestSender {
|
|
|
198
199
|
}
|
|
199
200
|
return null;
|
|
200
201
|
}
|
|
201
|
-
_makeHeaders(auth, contentLength, apiVersion, clientUserAgent, method, userSuppliedHeaders, userSuppliedSettings) {
|
|
202
|
+
_makeHeaders(auth, contentType, contentLength, apiVersion, clientUserAgent, method, userSuppliedHeaders, userSuppliedSettings) {
|
|
202
203
|
const defaultHeaders = {
|
|
203
204
|
// Use specified auth token or use default from this stripe instance:
|
|
204
205
|
Authorization: auth ? `Bearer ${auth}` : this._stripe.getApiField('auth'),
|
|
205
206
|
Accept: 'application/json',
|
|
206
|
-
'Content-Type':
|
|
207
|
+
'Content-Type': contentType,
|
|
207
208
|
'User-Agent': this._getUserAgentString(),
|
|
208
209
|
'X-Stripe-Client-User-Agent': clientUserAgent,
|
|
209
210
|
'X-Stripe-Client-Telemetry': this._getTelemetryHeader(),
|
|
@@ -271,6 +272,54 @@ export class RequestSender {
|
|
|
271
272
|
}
|
|
272
273
|
}
|
|
273
274
|
}
|
|
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
|
+
}
|
|
274
323
|
_request(method, host, path, data, auth, options = {}, usage = [], callback, requestDataProcessor = null) {
|
|
275
324
|
let requestData;
|
|
276
325
|
const retryRequest = (requestFn, apiVersion, headers, requestRetries, retryAfter) => {
|
|
@@ -335,10 +384,15 @@ export class RequestSender {
|
|
|
335
384
|
return callback(error);
|
|
336
385
|
}
|
|
337
386
|
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
|
+
}
|
|
338
393
|
this._stripe.getClientUserAgent((clientUserAgent) => {
|
|
339
394
|
var _a, _b;
|
|
340
|
-
const
|
|
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 : {});
|
|
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 : {});
|
|
342
396
|
makeRequest(apiVersion, headers, 0);
|
|
343
397
|
});
|
|
344
398
|
};
|
|
@@ -346,7 +400,14 @@ export class RequestSender {
|
|
|
346
400
|
requestDataProcessor(method, data, options.headers, prepareAndMakeRequest);
|
|
347
401
|
}
|
|
348
402
|
else {
|
|
349
|
-
|
|
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);
|
|
350
411
|
}
|
|
351
412
|
}
|
|
352
413
|
}
|
package/esm/ResourceNamespace.js
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
// It also works recursively, so you could do i.e. `stripe.billing.invoicing.pay`.
|
|
3
3
|
function ResourceNamespace(stripe, resources) {
|
|
4
4
|
for (const name in resources) {
|
|
5
|
+
if (!Object.prototype.hasOwnProperty.call(resources, name)) {
|
|
6
|
+
continue;
|
|
7
|
+
}
|
|
5
8
|
const camelCaseName = name[0].toLowerCase() + name.substring(1);
|
|
6
9
|
const resource = new resources[name](stripe);
|
|
7
10
|
this[camelCaseName] = resource;
|
package/esm/StripeResource.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getDataFromArgs, getOptionsFromArgs, makeURLInterpolator, protoExtend,
|
|
1
|
+
import { getDataFromArgs, getOptionsFromArgs, makeURLInterpolator, protoExtend, queryStringifyRequestData, } 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
|
+
queryStringifyRequestData(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/Webhooks.js
CHANGED
|
@@ -40,23 +40,16 @@ export function createWebhooks(platformFunctions) {
|
|
|
40
40
|
* @property {CryptoProvider} cryptoProvider - Crypto provider to use for computing the signature if none was provided. Defaults to NodeCryptoProvider.
|
|
41
41
|
*/
|
|
42
42
|
generateTestHeaderString: function (opts) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
opts.signature ||
|
|
54
|
-
opts.cryptoProvider.computeHMACSignature(opts.timestamp + '.' + opts.payload, opts.secret);
|
|
55
|
-
const generatedHeader = [
|
|
56
|
-
't=' + opts.timestamp,
|
|
57
|
-
opts.scheme + '=' + opts.signature,
|
|
58
|
-
].join(',');
|
|
59
|
-
return generatedHeader;
|
|
43
|
+
const preparedOpts = prepareOptions(opts);
|
|
44
|
+
const signature = preparedOpts.signature ||
|
|
45
|
+
preparedOpts.cryptoProvider.computeHMACSignature(preparedOpts.payloadString, preparedOpts.secret);
|
|
46
|
+
return preparedOpts.generateHeaderString(signature);
|
|
47
|
+
},
|
|
48
|
+
generateTestHeaderStringAsync: async function (opts) {
|
|
49
|
+
const preparedOpts = prepareOptions(opts);
|
|
50
|
+
const signature = preparedOpts.signature ||
|
|
51
|
+
(await preparedOpts.cryptoProvider.computeHMACSignatureAsync(preparedOpts.payloadString, preparedOpts.secret));
|
|
52
|
+
return preparedOpts.generateHeaderString(signature);
|
|
60
53
|
},
|
|
61
54
|
};
|
|
62
55
|
const signature = {
|
|
@@ -191,6 +184,25 @@ export function createWebhooks(platformFunctions) {
|
|
|
191
184
|
}
|
|
192
185
|
return webhooksCryptoProviderInstance;
|
|
193
186
|
}
|
|
187
|
+
function prepareOptions(opts) {
|
|
188
|
+
if (!opts) {
|
|
189
|
+
throw new StripeError({
|
|
190
|
+
message: 'Options are required',
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
const timestamp = Math.floor(opts.timestamp) || Math.floor(Date.now() / 1000);
|
|
194
|
+
const scheme = opts.scheme || signature.EXPECTED_SCHEME;
|
|
195
|
+
const cryptoProvider = opts.cryptoProvider || getCryptoProvider();
|
|
196
|
+
const payloadString = `${timestamp}.${opts.payload}`;
|
|
197
|
+
const generateHeaderString = (signature) => {
|
|
198
|
+
return `t=${timestamp},${scheme}=${signature}`;
|
|
199
|
+
};
|
|
200
|
+
return Object.assign(Object.assign({}, opts), { timestamp,
|
|
201
|
+
scheme,
|
|
202
|
+
cryptoProvider,
|
|
203
|
+
payloadString,
|
|
204
|
+
generateHeaderString });
|
|
205
|
+
}
|
|
194
206
|
Webhook.signature = signature;
|
|
195
207
|
return Webhook;
|
|
196
208
|
}
|
package/esm/apiVersion.js
CHANGED
package/esm/multipart.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { flattenAndStringify,
|
|
1
|
+
import { flattenAndStringify, queryStringifyRequestData } 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
|
|
@@ -21,6 +21,9 @@ const multipartDataGenerator = (method, data, headers) => {
|
|
|
21
21
|
}
|
|
22
22
|
const flattenedData = flattenAndStringify(data);
|
|
23
23
|
for (const k in flattenedData) {
|
|
24
|
+
if (!Object.prototype.hasOwnProperty.call(flattenedData, k)) {
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
24
27
|
const v = flattenedData[k];
|
|
25
28
|
push(`--${segno}`);
|
|
26
29
|
if (Object.prototype.hasOwnProperty.call(v, 'data')) {
|
|
@@ -42,7 +45,7 @@ const multipartDataGenerator = (method, data, headers) => {
|
|
|
42
45
|
export function multipartRequestDataProcessor(method, data, headers, callback) {
|
|
43
46
|
data = data || {};
|
|
44
47
|
if (method !== 'POST') {
|
|
45
|
-
return callback(null,
|
|
48
|
+
return callback(null, queryStringifyRequestData(data));
|
|
46
49
|
}
|
|
47
50
|
this._stripe._platformFunctions
|
|
48
51
|
.tryBufferData(data)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec
|
|
2
|
+
import { StripeResource } from '../StripeResource.js';
|
|
3
|
+
const stripeMethod = StripeResource.method;
|
|
4
|
+
export const AccountNotices = StripeResource.extend({
|
|
5
|
+
retrieve: stripeMethod({
|
|
6
|
+
method: 'GET',
|
|
7
|
+
fullPath: '/v1/account_notices/{account_notice}',
|
|
8
|
+
}),
|
|
9
|
+
update: stripeMethod({
|
|
10
|
+
method: 'POST',
|
|
11
|
+
fullPath: '/v1/account_notices/{account_notice}',
|
|
12
|
+
}),
|
|
13
|
+
list: stripeMethod({
|
|
14
|
+
method: 'GET',
|
|
15
|
+
fullPath: '/v1/account_notices',
|
|
16
|
+
methodType: 'list',
|
|
17
|
+
}),
|
|
18
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec
|
|
2
|
+
import { StripeResource } from '../../StripeResource.js';
|
|
3
|
+
const stripeMethod = StripeResource.method;
|
|
4
|
+
export const FinancingOffers = StripeResource.extend({
|
|
5
|
+
retrieve: stripeMethod({
|
|
6
|
+
method: 'GET',
|
|
7
|
+
fullPath: '/v1/capital/financing_offers/{financing_offer}',
|
|
8
|
+
}),
|
|
9
|
+
list: stripeMethod({
|
|
10
|
+
method: 'GET',
|
|
11
|
+
fullPath: '/v1/capital/financing_offers',
|
|
12
|
+
methodType: 'list',
|
|
13
|
+
}),
|
|
14
|
+
markDelivered: stripeMethod({
|
|
15
|
+
method: 'POST',
|
|
16
|
+
fullPath: '/v1/capital/financing_offers/{financing_offer}/mark_delivered',
|
|
17
|
+
}),
|
|
18
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec
|
|
2
|
+
import { StripeResource } from '../../StripeResource.js';
|
|
3
|
+
const stripeMethod = StripeResource.method;
|
|
4
|
+
export const FinancingSummary = StripeResource.extend({
|
|
5
|
+
retrieve: stripeMethod({
|
|
6
|
+
method: 'GET',
|
|
7
|
+
fullPath: '/v1/capital/financing_summary',
|
|
8
|
+
}),
|
|
9
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec
|
|
2
|
+
import { StripeResource } from '../../StripeResource.js';
|
|
3
|
+
const stripeMethod = StripeResource.method;
|
|
4
|
+
export const FinancingTransactions = StripeResource.extend({
|
|
5
|
+
retrieve: stripeMethod({
|
|
6
|
+
method: 'GET',
|
|
7
|
+
fullPath: '/v1/capital/financing_transactions/{financing_transaction}',
|
|
8
|
+
}),
|
|
9
|
+
list: stripeMethod({
|
|
10
|
+
method: 'GET',
|
|
11
|
+
fullPath: '/v1/capital/financing_transactions',
|
|
12
|
+
methodType: 'list',
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
@@ -15,6 +15,11 @@ 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
|
+
}),
|
|
18
23
|
listOwners: stripeMethod({
|
|
19
24
|
method: 'GET',
|
|
20
25
|
fullPath: '/v1/financial_connections/accounts/{account}/owners',
|