stripe 14.21.0 → 14.22.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 (41) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/VERSION +1 -1
  3. package/cjs/Error.js +33 -3
  4. package/cjs/resources/ConfirmationTokens.js +12 -0
  5. package/cjs/resources/Forwarding/Requests.js +18 -0
  6. package/cjs/resources/TestHelpers/ConfirmationTokens.js +12 -0
  7. package/cjs/resources.js +10 -2
  8. package/cjs/stripe.core.js +1 -1
  9. package/esm/Error.js +33 -3
  10. package/esm/resources/ConfirmationTokens.js +9 -0
  11. package/esm/resources/Forwarding/Requests.js +15 -0
  12. package/esm/resources/TestHelpers/ConfirmationTokens.js +9 -0
  13. package/esm/resources.js +7 -0
  14. package/esm/stripe.core.js +1 -1
  15. package/package.json +1 -1
  16. package/types/Accounts.d.ts +7 -0
  17. package/types/AccountsResource.d.ts +24 -0
  18. package/types/Charges.d.ts +40 -0
  19. package/types/ConfirmationTokens.d.ts +1168 -0
  20. package/types/ConfirmationTokensResource.d.ts +27 -0
  21. package/types/CustomersResource.d.ts +1 -0
  22. package/types/Forwarding/Requests.d.ts +162 -0
  23. package/types/Forwarding/RequestsResource.d.ts +126 -0
  24. package/types/Invoices.d.ts +4 -0
  25. package/types/PaymentIntents.d.ts +22 -0
  26. package/types/PaymentIntentsResource.d.ts +119 -0
  27. package/types/PaymentMethods.d.ts +5 -0
  28. package/types/PaymentMethodsResource.d.ts +9 -0
  29. package/types/Products.d.ts +2 -2
  30. package/types/ProductsResource.d.ts +4 -4
  31. package/types/QuotesResource.d.ts +1 -1
  32. package/types/SetupAttempts.d.ts +4 -0
  33. package/types/SetupIntents.d.ts +4 -0
  34. package/types/SetupIntentsResource.d.ts +38 -0
  35. package/types/Subscriptions.d.ts +5 -3
  36. package/types/SubscriptionsResource.d.ts +1 -1
  37. package/types/Terminal/Configurations.d.ts +5 -0
  38. package/types/Terminal/ConfigurationsResource.d.ts +10 -0
  39. package/types/TestHelpers/ConfirmationTokensResource.d.ts +645 -0
  40. package/types/Treasury/ReceivedDebits.d.ts +5 -0
  41. package/types/index.d.ts +10 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## 14.22.0 - 2024-03-21
4
+ * [#2040](https://github.com/stripe/stripe-node/pull/2040) Update generated code
5
+ * Add support for new resources `ConfirmationToken` and `Forwarding.Request`
6
+ * Add support for `retrieve` method on resource `ConfirmationToken`
7
+ * Add support for `create`, `list`, and `retrieve` methods on resource `Request`
8
+ * Add support for `mobilepay_payments` on `Account.capabilities`, `AccountCreateParams.capabilities`, and `AccountUpdateParams.capabilities`
9
+ * Add support for new values `forwarding_api_inactive`, `forwarding_api_invalid_parameter`, `forwarding_api_upstream_connection_error`, and `forwarding_api_upstream_connection_timeout` on enums `Invoice.last_finalization_error.code`, `PaymentIntent.last_payment_error.code`, `SetupAttempt.setup_error.code`, `SetupIntent.last_setup_error.code`, and `StripeError.code`
10
+ * Add support for `mobilepay` on `Charge.payment_method_details`, `PaymentIntent.payment_method_options`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentConfirmParams.payment_method_options`, `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentMethodCreateParams`, `PaymentMethod`, `SetupIntentConfirmParams.payment_method_data`, `SetupIntentCreateParams.payment_method_data`, and `SetupIntentUpdateParams.payment_method_data`
11
+ * Add support for `payment_reference` on `Charge.payment_method_details.us_bank_account`
12
+ * Add support for new value `mobilepay` on enums `CustomerListPaymentMethodsParams.type`, `PaymentMethodCreateParams.type`, and `PaymentMethodListParams.type`
13
+ * Add support for `confirmation_token` on `PaymentIntentConfirmParams`, `PaymentIntentCreateParams`, `SetupIntentConfirmParams`, and `SetupIntentCreateParams`
14
+ * Add support for new value `mobilepay` on enums `PaymentIntentConfirmParams.payment_method_data.type`, `PaymentIntentCreateParams.payment_method_data.type`, `PaymentIntentUpdateParams.payment_method_data.type`, `SetupIntentConfirmParams.payment_method_data.type`, `SetupIntentCreateParams.payment_method_data.type`, and `SetupIntentUpdateParams.payment_method_data.type`
15
+ * Add support for new value `mobilepay` on enum `PaymentMethod.type`
16
+ * Add support for `name` on `Terminal.ConfigurationCreateParams`, `Terminal.ConfigurationUpdateParams`, and `Terminal.Configuration`
17
+ * Add support for `payout` on `Treasury.ReceivedDebit.linked_flows`
18
+ * [#2043](https://github.com/stripe/stripe-node/pull/2043) Don't mutate error.type during minification
19
+
3
20
  ## 14.21.0 - 2024-03-14
4
21
  * [#2035](https://github.com/stripe/stripe-node/pull/2035) Update generated code
5
22
  * Add support for new resources `Issuing.PersonalizationDesign` and `Issuing.PhysicalBundle`
package/VERSION CHANGED
@@ -1 +1 @@
1
- 14.21.0
1
+ 14.22.0
package/cjs/Error.js CHANGED
@@ -28,9 +28,9 @@ exports.generate = generate;
28
28
  * Specifically for errors returned from Stripe's REST API.
29
29
  */
30
30
  class StripeError extends Error {
31
- constructor(raw = {}) {
31
+ constructor(raw = {}, type = null) {
32
32
  super(raw.message);
33
- this.type = this.constructor.name;
33
+ this.type = type || this.constructor.name;
34
34
  this.raw = raw;
35
35
  this.rawType = raw.type;
36
36
  this.code = raw.code;
@@ -62,6 +62,9 @@ StripeError.generate = exports.generate;
62
62
  * some reason.
63
63
  */
64
64
  class StripeCardError extends StripeError {
65
+ constructor(raw = {}) {
66
+ super(raw, 'StripeCardError');
67
+ }
65
68
  }
66
69
  exports.StripeCardError = StripeCardError;
67
70
  /**
@@ -69,6 +72,9 @@ exports.StripeCardError = StripeCardError;
69
72
  * parameters.
70
73
  */
71
74
  class StripeInvalidRequestError extends StripeError {
75
+ constructor(raw = {}) {
76
+ super(raw, 'StripeInvalidRequestError');
77
+ }
72
78
  }
73
79
  exports.StripeInvalidRequestError = StripeInvalidRequestError;
74
80
  /**
@@ -78,6 +84,9 @@ exports.StripeInvalidRequestError = StripeInvalidRequestError;
78
84
  * Node.JS SDK doesn't know how to handle it.
79
85
  */
80
86
  class StripeAPIError extends StripeError {
87
+ constructor(raw = {}) {
88
+ super(raw, 'StripeAPIError');
89
+ }
81
90
  }
82
91
  exports.StripeAPIError = StripeAPIError;
83
92
  /**
@@ -85,6 +94,9 @@ exports.StripeAPIError = StripeAPIError;
85
94
  * to Stripe's servers.
86
95
  */
87
96
  class StripeAuthenticationError extends StripeError {
97
+ constructor(raw = {}) {
98
+ super(raw, 'StripeAuthenticationError');
99
+ }
88
100
  }
89
101
  exports.StripeAuthenticationError = StripeAuthenticationError;
90
102
  /**
@@ -92,6 +104,9 @@ exports.StripeAuthenticationError = StripeAuthenticationError;
92
104
  * that wasn't allowed.
93
105
  */
94
106
  class StripePermissionError extends StripeError {
107
+ constructor(raw = {}) {
108
+ super(raw, 'StripePermissionError');
109
+ }
95
110
  }
96
111
  exports.StripePermissionError = StripePermissionError;
97
112
  /**
@@ -100,6 +115,9 @@ exports.StripePermissionError = StripePermissionError;
100
115
  * back off on request rate.
101
116
  */
102
117
  class StripeRateLimitError extends StripeError {
118
+ constructor(raw = {}) {
119
+ super(raw, 'StripeRateLimitError');
120
+ }
103
121
  }
104
122
  exports.StripeRateLimitError = StripeRateLimitError;
105
123
  /**
@@ -108,6 +126,9 @@ exports.StripeRateLimitError = StripeRateLimitError;
108
126
  * downed network to a bad TLS certificate.
109
127
  */
110
128
  class StripeConnectionError extends StripeError {
129
+ constructor(raw = {}) {
130
+ super(raw, 'StripeConnectionError');
131
+ }
111
132
  }
112
133
  exports.StripeConnectionError = StripeConnectionError;
113
134
  /**
@@ -116,7 +137,7 @@ exports.StripeConnectionError = StripeConnectionError;
116
137
  */
117
138
  class StripeSignatureVerificationError extends StripeError {
118
139
  constructor(header, payload, raw = {}) {
119
- super(raw);
140
+ super(raw, 'StripeSignatureVerificationError');
120
141
  this.header = header;
121
142
  this.payload = payload;
122
143
  }
@@ -127,6 +148,9 @@ exports.StripeSignatureVerificationError = StripeSignatureVerificationError;
127
148
  * improperly.
128
149
  */
129
150
  class StripeIdempotencyError extends StripeError {
151
+ constructor(raw = {}) {
152
+ super(raw, 'StripeIdempotencyError');
153
+ }
130
154
  }
131
155
  exports.StripeIdempotencyError = StripeIdempotencyError;
132
156
  /**
@@ -136,11 +160,17 @@ exports.StripeIdempotencyError = StripeIdempotencyError;
136
160
  * doesn't match the mode of a code or refresh token.
137
161
  */
138
162
  class StripeInvalidGrantError extends StripeError {
163
+ constructor(raw = {}) {
164
+ super(raw, 'StripeInvalidGrantError');
165
+ }
139
166
  }
140
167
  exports.StripeInvalidGrantError = StripeInvalidGrantError;
141
168
  /**
142
169
  * Any other error from Stripe not specifically captured above
143
170
  */
144
171
  class StripeUnknownError extends StripeError {
172
+ constructor(raw = {}) {
173
+ super(raw, 'StripeUnknownError');
174
+ }
145
175
  }
146
176
  exports.StripeUnknownError = StripeUnknownError;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ConfirmationTokens = void 0;
5
+ const StripeResource_js_1 = require("../StripeResource.js");
6
+ const stripeMethod = StripeResource_js_1.StripeResource.method;
7
+ exports.ConfirmationTokens = StripeResource_js_1.StripeResource.extend({
8
+ retrieve: stripeMethod({
9
+ method: 'GET',
10
+ fullPath: '/v1/confirmation_tokens/{confirmation_token}',
11
+ }),
12
+ });
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Requests = void 0;
5
+ const StripeResource_js_1 = require("../../StripeResource.js");
6
+ const stripeMethod = StripeResource_js_1.StripeResource.method;
7
+ exports.Requests = StripeResource_js_1.StripeResource.extend({
8
+ create: stripeMethod({ method: 'POST', fullPath: '/v1/forwarding/requests' }),
9
+ retrieve: stripeMethod({
10
+ method: 'GET',
11
+ fullPath: '/v1/forwarding/requests/{id}',
12
+ }),
13
+ list: stripeMethod({
14
+ method: 'GET',
15
+ fullPath: '/v1/forwarding/requests',
16
+ methodType: 'list',
17
+ }),
18
+ });
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ConfirmationTokens = void 0;
5
+ const StripeResource_js_1 = require("../../StripeResource.js");
6
+ const stripeMethod = StripeResource_js_1.StripeResource.method;
7
+ exports.ConfirmationTokens = StripeResource_js_1.StripeResource.extend({
8
+ create: stripeMethod({
9
+ method: 'POST',
10
+ fullPath: '/v1/test_helpers/confirmation_tokens',
11
+ }),
12
+ });
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.Transfers = exports.Topups = exports.Tokens = exports.TaxRates = exports.TaxIds = exports.TaxCodes = exports.Subscriptions = exports.SubscriptionSchedules = exports.SubscriptionItems = exports.Sources = exports.ShippingRates = exports.SetupIntents = exports.SetupAttempts = exports.Reviews = exports.Refunds = exports.Quotes = exports.PromotionCodes = exports.Products = exports.Prices = exports.Plans = exports.Payouts = exports.PaymentMethods = exports.PaymentMethodDomains = exports.PaymentMethodConfigurations = exports.PaymentLinks = exports.PaymentIntents = exports.OAuth = exports.Mandates = exports.Invoices = exports.InvoiceItems = exports.Files = exports.FileLinks = exports.ExchangeRates = exports.Events = exports.EphemeralKeys = exports.Disputes = exports.Customers = exports.CustomerSessions = exports.CreditNotes = exports.Coupons = exports.CountrySpecs = exports.Charges = exports.BalanceTransactions = exports.Balance = exports.ApplicationFees = exports.ApplePayDomains = exports.Accounts = exports.AccountSessions = exports.AccountLinks = exports.Account = void 0;
5
- exports.Treasury = exports.TestHelpers = exports.Terminal = exports.Tax = exports.Sigma = exports.Reporting = exports.Radar = exports.Issuing = exports.Identity = exports.FinancialConnections = exports.Climate = exports.Checkout = exports.BillingPortal = exports.Apps = exports.WebhookEndpoints = void 0;
4
+ exports.Topups = exports.Tokens = exports.TaxRates = exports.TaxIds = exports.TaxCodes = exports.Subscriptions = exports.SubscriptionSchedules = exports.SubscriptionItems = exports.Sources = exports.ShippingRates = exports.SetupIntents = exports.SetupAttempts = exports.Reviews = exports.Refunds = exports.Quotes = exports.PromotionCodes = exports.Products = exports.Prices = exports.Plans = exports.Payouts = exports.PaymentMethods = exports.PaymentMethodDomains = exports.PaymentMethodConfigurations = exports.PaymentLinks = exports.PaymentIntents = exports.OAuth = exports.Mandates = exports.Invoices = exports.InvoiceItems = exports.Files = exports.FileLinks = exports.ExchangeRates = exports.Events = exports.EphemeralKeys = exports.Disputes = exports.Customers = exports.CustomerSessions = exports.CreditNotes = exports.Coupons = exports.CountrySpecs = exports.ConfirmationTokens = exports.Charges = exports.BalanceTransactions = exports.Balance = exports.ApplicationFees = exports.ApplePayDomains = exports.Accounts = exports.AccountSessions = exports.AccountLinks = exports.Account = void 0;
5
+ exports.Treasury = exports.TestHelpers = exports.Terminal = exports.Tax = exports.Sigma = exports.Reporting = exports.Radar = exports.Issuing = exports.Identity = exports.Forwarding = exports.FinancialConnections = exports.Climate = exports.Checkout = exports.BillingPortal = exports.Apps = exports.WebhookEndpoints = exports.Transfers = void 0;
6
6
  const ResourceNamespace_js_1 = require("./ResourceNamespace.js");
7
7
  const Accounts_js_1 = require("./resources/FinancialConnections/Accounts.js");
8
8
  const Authorizations_js_1 = require("./resources/TestHelpers/Issuing/Authorizations.js");
@@ -13,6 +13,7 @@ const Cards_js_1 = require("./resources/TestHelpers/Issuing/Cards.js");
13
13
  const Cards_js_2 = require("./resources/Issuing/Cards.js");
14
14
  const Configurations_js_1 = require("./resources/BillingPortal/Configurations.js");
15
15
  const Configurations_js_2 = require("./resources/Terminal/Configurations.js");
16
+ const ConfirmationTokens_js_1 = require("./resources/TestHelpers/ConfirmationTokens.js");
16
17
  const ConnectionTokens_js_1 = require("./resources/Terminal/ConnectionTokens.js");
17
18
  const CreditReversals_js_1 = require("./resources/Treasury/CreditReversals.js");
18
19
  const Customers_js_1 = require("./resources/TestHelpers/Customers.js");
@@ -42,6 +43,7 @@ const Refunds_js_1 = require("./resources/TestHelpers/Refunds.js");
42
43
  const Registrations_js_1 = require("./resources/Tax/Registrations.js");
43
44
  const ReportRuns_js_1 = require("./resources/Reporting/ReportRuns.js");
44
45
  const ReportTypes_js_1 = require("./resources/Reporting/ReportTypes.js");
46
+ const Requests_js_1 = require("./resources/Forwarding/Requests.js");
45
47
  const ScheduledQueryRuns_js_1 = require("./resources/Sigma/ScheduledQueryRuns.js");
46
48
  const Secrets_js_1 = require("./resources/Apps/Secrets.js");
47
49
  const Sessions_js_1 = require("./resources/BillingPortal/Sessions.js");
@@ -79,6 +81,8 @@ var BalanceTransactions_js_1 = require("./resources/BalanceTransactions.js");
79
81
  Object.defineProperty(exports, "BalanceTransactions", { enumerable: true, get: function () { return BalanceTransactions_js_1.BalanceTransactions; } });
80
82
  var Charges_js_1 = require("./resources/Charges.js");
81
83
  Object.defineProperty(exports, "Charges", { enumerable: true, get: function () { return Charges_js_1.Charges; } });
84
+ var ConfirmationTokens_js_2 = require("./resources/ConfirmationTokens.js");
85
+ Object.defineProperty(exports, "ConfirmationTokens", { enumerable: true, get: function () { return ConfirmationTokens_js_2.ConfirmationTokens; } });
82
86
  var CountrySpecs_js_1 = require("./resources/CountrySpecs.js");
83
87
  Object.defineProperty(exports, "CountrySpecs", { enumerable: true, get: function () { return CountrySpecs_js_1.CountrySpecs; } });
84
88
  var Coupons_js_1 = require("./resources/Coupons.js");
@@ -181,6 +185,9 @@ exports.FinancialConnections = (0, ResourceNamespace_js_1.resourceNamespace)('fi
181
185
  Sessions: Sessions_js_3.Sessions,
182
186
  Transactions: Transactions_js_2.Transactions,
183
187
  });
188
+ exports.Forwarding = (0, ResourceNamespace_js_1.resourceNamespace)('forwarding', {
189
+ Requests: Requests_js_1.Requests,
190
+ });
184
191
  exports.Identity = (0, ResourceNamespace_js_1.resourceNamespace)('identity', {
185
192
  VerificationReports: VerificationReports_js_1.VerificationReports,
186
193
  VerificationSessions: VerificationSessions_js_1.VerificationSessions,
@@ -220,6 +227,7 @@ exports.Terminal = (0, ResourceNamespace_js_1.resourceNamespace)('terminal', {
220
227
  Readers: Readers_js_2.Readers,
221
228
  });
222
229
  exports.TestHelpers = (0, ResourceNamespace_js_1.resourceNamespace)('testHelpers', {
230
+ ConfirmationTokens: ConfirmationTokens_js_1.ConfirmationTokens,
223
231
  Customers: Customers_js_1.Customers,
224
232
  Refunds: Refunds_js_1.Refunds,
225
233
  TestClocks: TestClocks_js_1.TestClocks,
@@ -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 = '14.21.0';
37
+ Stripe.PACKAGE_VERSION = '14.22.0';
38
38
  Stripe.USER_AGENT = Object.assign({ bindings_version: Stripe.PACKAGE_VERSION, lang: 'node', publisher: 'stripe', uname: null, typescript: false }, (0, utils_js_1.determineProcessUserAgentProperties)());
39
39
  Stripe.StripeResource = StripeResource_js_1.StripeResource;
40
40
  Stripe.resources = resources;
package/esm/Error.js CHANGED
@@ -24,9 +24,9 @@ export const generate = (rawStripeError) => {
24
24
  * Specifically for errors returned from Stripe's REST API.
25
25
  */
26
26
  export class StripeError extends Error {
27
- constructor(raw = {}) {
27
+ constructor(raw = {}, type = null) {
28
28
  super(raw.message);
29
- this.type = this.constructor.name;
29
+ this.type = type || this.constructor.name;
30
30
  this.raw = raw;
31
31
  this.rawType = raw.type;
32
32
  this.code = raw.code;
@@ -57,12 +57,18 @@ StripeError.generate = generate;
57
57
  * some reason.
58
58
  */
59
59
  export class StripeCardError extends StripeError {
60
+ constructor(raw = {}) {
61
+ super(raw, 'StripeCardError');
62
+ }
60
63
  }
61
64
  /**
62
65
  * InvalidRequestError is raised when a request is initiated with invalid
63
66
  * parameters.
64
67
  */
65
68
  export class StripeInvalidRequestError extends StripeError {
69
+ constructor(raw = {}) {
70
+ super(raw, 'StripeInvalidRequestError');
71
+ }
66
72
  }
67
73
  /**
68
74
  * APIError is a generic error that may be raised in cases where none of the
@@ -71,18 +77,27 @@ export class StripeInvalidRequestError extends StripeError {
71
77
  * Node.JS SDK doesn't know how to handle it.
72
78
  */
73
79
  export class StripeAPIError extends StripeError {
80
+ constructor(raw = {}) {
81
+ super(raw, 'StripeAPIError');
82
+ }
74
83
  }
75
84
  /**
76
85
  * AuthenticationError is raised when invalid credentials are used to connect
77
86
  * to Stripe's servers.
78
87
  */
79
88
  export class StripeAuthenticationError extends StripeError {
89
+ constructor(raw = {}) {
90
+ super(raw, 'StripeAuthenticationError');
91
+ }
80
92
  }
81
93
  /**
82
94
  * PermissionError is raised in cases where access was attempted on a resource
83
95
  * that wasn't allowed.
84
96
  */
85
97
  export class StripePermissionError extends StripeError {
98
+ constructor(raw = {}) {
99
+ super(raw, 'StripePermissionError');
100
+ }
86
101
  }
87
102
  /**
88
103
  * RateLimitError is raised in cases where an account is putting too much load
@@ -90,6 +105,9 @@ export class StripePermissionError extends StripeError {
90
105
  * back off on request rate.
91
106
  */
92
107
  export class StripeRateLimitError extends StripeError {
108
+ constructor(raw = {}) {
109
+ super(raw, 'StripeRateLimitError');
110
+ }
93
111
  }
94
112
  /**
95
113
  * StripeConnectionError is raised in the event that the SDK can't connect to
@@ -97,6 +115,9 @@ export class StripeRateLimitError extends StripeError {
97
115
  * downed network to a bad TLS certificate.
98
116
  */
99
117
  export class StripeConnectionError extends StripeError {
118
+ constructor(raw = {}) {
119
+ super(raw, 'StripeConnectionError');
120
+ }
100
121
  }
101
122
  /**
102
123
  * SignatureVerificationError is raised when the signature verification for a
@@ -104,7 +125,7 @@ export class StripeConnectionError extends StripeError {
104
125
  */
105
126
  export class StripeSignatureVerificationError extends StripeError {
106
127
  constructor(header, payload, raw = {}) {
107
- super(raw);
128
+ super(raw, 'StripeSignatureVerificationError');
108
129
  this.header = header;
109
130
  this.payload = payload;
110
131
  }
@@ -114,6 +135,9 @@ export class StripeSignatureVerificationError extends StripeError {
114
135
  * improperly.
115
136
  */
116
137
  export class StripeIdempotencyError extends StripeError {
138
+ constructor(raw = {}) {
139
+ super(raw, 'StripeIdempotencyError');
140
+ }
117
141
  }
118
142
  /**
119
143
  * InvalidGrantError is raised when a specified code doesn't exist, is
@@ -122,9 +146,15 @@ export class StripeIdempotencyError extends StripeError {
122
146
  * doesn't match the mode of a code or refresh token.
123
147
  */
124
148
  export class StripeInvalidGrantError extends StripeError {
149
+ constructor(raw = {}) {
150
+ super(raw, 'StripeInvalidGrantError');
151
+ }
125
152
  }
126
153
  /**
127
154
  * Any other error from Stripe not specifically captured above
128
155
  */
129
156
  export class StripeUnknownError extends StripeError {
157
+ constructor(raw = {}) {
158
+ super(raw, 'StripeUnknownError');
159
+ }
130
160
  }
@@ -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 ConfirmationTokens = StripeResource.extend({
5
+ retrieve: stripeMethod({
6
+ method: 'GET',
7
+ fullPath: '/v1/confirmation_tokens/{confirmation_token}',
8
+ }),
9
+ });
@@ -0,0 +1,15 @@
1
+ // File generated from our OpenAPI spec
2
+ import { StripeResource } from '../../StripeResource.js';
3
+ const stripeMethod = StripeResource.method;
4
+ export const Requests = StripeResource.extend({
5
+ create: stripeMethod({ method: 'POST', fullPath: '/v1/forwarding/requests' }),
6
+ retrieve: stripeMethod({
7
+ method: 'GET',
8
+ fullPath: '/v1/forwarding/requests/{id}',
9
+ }),
10
+ list: stripeMethod({
11
+ method: 'GET',
12
+ fullPath: '/v1/forwarding/requests',
13
+ methodType: 'list',
14
+ }),
15
+ });
@@ -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 ConfirmationTokens = StripeResource.extend({
5
+ create: stripeMethod({
6
+ method: 'POST',
7
+ fullPath: '/v1/test_helpers/confirmation_tokens',
8
+ }),
9
+ });
package/esm/resources.js CHANGED
@@ -9,6 +9,7 @@ import { Cards as TestHelpersIssuingCards } from './resources/TestHelpers/Issuin
9
9
  import { Cards as IssuingCards } from './resources/Issuing/Cards.js';
10
10
  import { Configurations as BillingPortalConfigurations } from './resources/BillingPortal/Configurations.js';
11
11
  import { Configurations as TerminalConfigurations } from './resources/Terminal/Configurations.js';
12
+ import { ConfirmationTokens as TestHelpersConfirmationTokens } from './resources/TestHelpers/ConfirmationTokens.js';
12
13
  import { ConnectionTokens as TerminalConnectionTokens } from './resources/Terminal/ConnectionTokens.js';
13
14
  import { CreditReversals as TreasuryCreditReversals } from './resources/Treasury/CreditReversals.js';
14
15
  import { Customers as TestHelpersCustomers } from './resources/TestHelpers/Customers.js';
@@ -38,6 +39,7 @@ import { Refunds as TestHelpersRefunds } from './resources/TestHelpers/Refunds.j
38
39
  import { Registrations as TaxRegistrations } from './resources/Tax/Registrations.js';
39
40
  import { ReportRuns as ReportingReportRuns } from './resources/Reporting/ReportRuns.js';
40
41
  import { ReportTypes as ReportingReportTypes } from './resources/Reporting/ReportTypes.js';
42
+ import { Requests as ForwardingRequests } from './resources/Forwarding/Requests.js';
41
43
  import { ScheduledQueryRuns as SigmaScheduledQueryRuns } from './resources/Sigma/ScheduledQueryRuns.js';
42
44
  import { Secrets as AppsSecrets } from './resources/Apps/Secrets.js';
43
45
  import { Sessions as BillingPortalSessions } from './resources/BillingPortal/Sessions.js';
@@ -66,6 +68,7 @@ export { ApplicationFees } from './resources/ApplicationFees.js';
66
68
  export { Balance } from './resources/Balance.js';
67
69
  export { BalanceTransactions } from './resources/BalanceTransactions.js';
68
70
  export { Charges } from './resources/Charges.js';
71
+ export { ConfirmationTokens } from './resources/ConfirmationTokens.js';
69
72
  export { CountrySpecs } from './resources/CountrySpecs.js';
70
73
  export { Coupons } from './resources/Coupons.js';
71
74
  export { CreditNotes } from './resources/CreditNotes.js';
@@ -126,6 +129,9 @@ export const FinancialConnections = resourceNamespace('financialConnections', {
126
129
  Sessions: FinancialConnectionsSessions,
127
130
  Transactions: FinancialConnectionsTransactions,
128
131
  });
132
+ export const Forwarding = resourceNamespace('forwarding', {
133
+ Requests: ForwardingRequests,
134
+ });
129
135
  export const Identity = resourceNamespace('identity', {
130
136
  VerificationReports: IdentityVerificationReports,
131
137
  VerificationSessions: IdentityVerificationSessions,
@@ -165,6 +171,7 @@ export const Terminal = resourceNamespace('terminal', {
165
171
  Readers: TerminalReaders,
166
172
  });
167
173
  export const TestHelpers = resourceNamespace('testHelpers', {
174
+ ConfirmationTokens: TestHelpersConfirmationTokens,
168
175
  Customers: TestHelpersCustomers,
169
176
  Refunds: TestHelpersRefunds,
170
177
  TestClocks: TestHelpersTestClocks,
@@ -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 = '14.21.0';
34
+ Stripe.PACKAGE_VERSION = '14.22.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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stripe",
3
- "version": "14.21.0",
3
+ "version": "14.22.0",
4
4
  "description": "Stripe API wrapper",
5
5
  "keywords": [
6
6
  "stripe",
@@ -328,6 +328,11 @@ declare module 'stripe' {
328
328
  */
329
329
  link_payments?: Capabilities.LinkPayments;
330
330
 
331
+ /**
332
+ * The status of the MobilepPay capability of the account, or whether the account can directly process MobilePay charges.
333
+ */
334
+ mobilepay_payments?: Capabilities.MobilepayPayments;
335
+
331
336
  /**
332
337
  * The status of the OXXO payments capability of the account, or whether the account can directly process OXXO charges.
333
338
  */
@@ -448,6 +453,8 @@ declare module 'stripe' {
448
453
 
449
454
  type LinkPayments = 'active' | 'inactive' | 'pending';
450
455
 
456
+ type MobilepayPayments = 'active' | 'inactive' | 'pending';
457
+
451
458
  type OxxoPayments = 'active' | 'inactive' | 'pending';
452
459
 
453
460
  type P24Payments = 'active' | 'inactive' | 'pending';
@@ -302,6 +302,11 @@ declare module 'stripe' {
302
302
  */
303
303
  link_payments?: Capabilities.LinkPayments;
304
304
 
305
+ /**
306
+ * The mobilepay_payments capability.
307
+ */
308
+ mobilepay_payments?: Capabilities.MobilepayPayments;
309
+
305
310
  /**
306
311
  * The oxxo_payments capability.
307
312
  */
@@ -542,6 +547,13 @@ declare module 'stripe' {
542
547
  requested?: boolean;
543
548
  }
544
549
 
550
+ interface MobilepayPayments {
551
+ /**
552
+ * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.
553
+ */
554
+ requested?: boolean;
555
+ }
556
+
545
557
  interface OxxoPayments {
546
558
  /**
547
559
  * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.
@@ -1723,6 +1735,11 @@ declare module 'stripe' {
1723
1735
  */
1724
1736
  link_payments?: Capabilities.LinkPayments;
1725
1737
 
1738
+ /**
1739
+ * The mobilepay_payments capability.
1740
+ */
1741
+ mobilepay_payments?: Capabilities.MobilepayPayments;
1742
+
1726
1743
  /**
1727
1744
  * The oxxo_payments capability.
1728
1745
  */
@@ -1963,6 +1980,13 @@ declare module 'stripe' {
1963
1980
  requested?: boolean;
1964
1981
  }
1965
1982
 
1983
+ interface MobilepayPayments {
1984
+ /**
1985
+ * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.
1986
+ */
1987
+ requested?: boolean;
1988
+ }
1989
+
1966
1990
  interface OxxoPayments {
1967
1991
  /**
1968
1992
  * Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.
@@ -414,6 +414,8 @@ declare module 'stripe' {
414
414
 
415
415
  link?: PaymentMethodDetails.Link;
416
416
 
417
+ mobilepay?: PaymentMethodDetails.Mobilepay;
418
+
417
419
  multibanco?: PaymentMethodDetails.Multibanco;
418
420
 
419
421
  oxxo?: PaymentMethodDetails.Oxxo;
@@ -1635,6 +1637,39 @@ declare module 'stripe' {
1635
1637
  country: string | null;
1636
1638
  }
1637
1639
 
1640
+ interface Mobilepay {
1641
+ card: Mobilepay.Card | null;
1642
+ }
1643
+
1644
+ namespace Mobilepay {
1645
+ interface Card {
1646
+ /**
1647
+ * Brand of the card used in the transaction
1648
+ */
1649
+ brand: string | null;
1650
+
1651
+ /**
1652
+ * Two-letter ISO code representing the country of the card
1653
+ */
1654
+ country: string | null;
1655
+
1656
+ /**
1657
+ * Two digit number representing the card's expiration month
1658
+ */
1659
+ exp_month: number | null;
1660
+
1661
+ /**
1662
+ * Two digit number representing the card's expiration year
1663
+ */
1664
+ exp_year: number | null;
1665
+
1666
+ /**
1667
+ * The last 4 digits of the card
1668
+ */
1669
+ last4: string | null;
1670
+ }
1671
+ }
1672
+
1638
1673
  interface Multibanco {
1639
1674
  /**
1640
1675
  * Entity number associated with this Multibanco payment.
@@ -1929,6 +1964,11 @@ declare module 'stripe' {
1929
1964
  */
1930
1965
  last4: string | null;
1931
1966
 
1967
+ /**
1968
+ * Reference number to locate ACH payments with customer's bank.
1969
+ */
1970
+ payment_reference?: string | null;
1971
+
1932
1972
  /**
1933
1973
  * Routing number of the bank account.
1934
1974
  */