stripe 14.8.0 → 14.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +6 -4
- package/VERSION +1 -1
- package/cjs/RequestSender.js +14 -10
- package/cjs/StripeResource.js +3 -1
- package/cjs/stripe.core.js +1 -1
- package/esm/RequestSender.js +14 -10
- package/esm/StripeResource.js +3 -1
- package/esm/stripe.core.js +1 -1
- package/package.json +1 -1
- package/types/AccountSessionsResource.d.ts +0 -3
- package/types/Checkout/Sessions.d.ts +30 -0
- package/types/Checkout/SessionsResource.d.ts +29 -0
- package/types/InvoicesResource.d.ts +4 -4
- package/types/PaymentIntents.d.ts +3 -0
- package/types/PaymentIntentsResource.d.ts +3 -0
- package/types/PaymentLinks.d.ts +30 -0
- package/types/PaymentLinksResource.d.ts +41 -0
- package/types/Radar/EarlyFraudWarningsResource.d.ts +5 -0
- package/types/TestHelpers/Issuing/AuthorizationsResource.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 14.9.0 - 2023-12-14
|
|
4
|
+
* [#1973](https://github.com/stripe/stripe-node/pull/1973) Add `usage` to X-Stripe-Client-Telemetry
|
|
5
|
+
* [#1971](https://github.com/stripe/stripe-node/pull/1971) Update generated code
|
|
6
|
+
* Add support for `payment_method_reuse_agreement` on `Checkout.Session.consent_collection`, `Checkout.SessionCreateParams.consent_collection`, `PaymentLink.consent_collection`, and `PaymentLinkCreateParams.consent_collection`
|
|
7
|
+
* Add support for `after_submit` on `Checkout.Session.custom_text`, `Checkout.SessionCreateParams.custom_text`, `PaymentLink.custom_text`, `PaymentLinkCreateParams.custom_text`, and `PaymentLinkUpdateParams.custom_text`
|
|
8
|
+
* Add support for `created` on `Radar.EarlyFraudWarningListParams`
|
|
9
|
+
|
|
3
10
|
## 14.8.0 - 2023-12-07
|
|
4
11
|
* [#1968](https://github.com/stripe/stripe-node/pull/1968) Update generated code
|
|
5
12
|
* Add support for `payment_details`, `payments`, and `payouts` on `AccountSession.components` and `AccountSessionCreateParams.components`
|
package/README.md
CHANGED
|
@@ -197,7 +197,7 @@ const stripe = Stripe('sk_test_...', {
|
|
|
197
197
|
| `host` | `'api.stripe.com'` | Host that requests are made to. |
|
|
198
198
|
| `port` | 443 | Port that requests are made to. |
|
|
199
199
|
| `protocol` | `'https'` | `'https'` or `'http'`. `http` is never appropriate for sending requests to Stripe servers, and we strongly discourage `http`, even in local testing scenarios, as this can result in your credentials being transmitted over an insecure channel. |
|
|
200
|
-
| `telemetry` | `true` | Allow Stripe to send
|
|
200
|
+
| `telemetry` | `true` | Allow Stripe to send [telemetry](#telemetry). |
|
|
201
201
|
|
|
202
202
|
> **Note**
|
|
203
203
|
> Both `maxNetworkRetries` and `timeout` can be overridden on a per-request basis.
|
|
@@ -477,10 +477,12 @@ const allNewCustomers = await stripe.customers
|
|
|
477
477
|
.autoPagingToArray({limit: 10000});
|
|
478
478
|
```
|
|
479
479
|
|
|
480
|
-
###
|
|
480
|
+
### Telemetry
|
|
481
481
|
|
|
482
|
-
By default, the library sends request
|
|
483
|
-
|
|
482
|
+
By default, the library sends request telemetry to Stripe regarding request
|
|
483
|
+
latency and feature usage. These
|
|
484
|
+
numbers help Stripe improve the overall latency of its API for all users, and
|
|
485
|
+
improve popular features.
|
|
484
486
|
|
|
485
487
|
You can disable this behavior if you prefer:
|
|
486
488
|
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
14.
|
|
1
|
+
14.9.0
|
package/cjs/RequestSender.js
CHANGED
|
@@ -48,13 +48,13 @@ class RequestSender {
|
|
|
48
48
|
* still be buffered/parsed and handled by _jsonResponseHandler -- see
|
|
49
49
|
* makeRequest)
|
|
50
50
|
*/
|
|
51
|
-
_streamingResponseHandler(requestEvent, callback) {
|
|
51
|
+
_streamingResponseHandler(requestEvent, usage, callback) {
|
|
52
52
|
return (res) => {
|
|
53
53
|
const headers = res.getHeaders();
|
|
54
54
|
const streamCompleteCallback = () => {
|
|
55
55
|
const responseEvent = this._makeResponseEvent(requestEvent, res.getStatusCode(), headers);
|
|
56
56
|
this._stripe._emitter.emit('response', responseEvent);
|
|
57
|
-
this._recordRequestMetrics(this._getRequestId(headers), responseEvent.elapsed);
|
|
57
|
+
this._recordRequestMetrics(this._getRequestId(headers), responseEvent.elapsed, usage);
|
|
58
58
|
};
|
|
59
59
|
const stream = res.toStream(streamCompleteCallback);
|
|
60
60
|
// This is here for backwards compatibility, as the stream is a raw
|
|
@@ -69,7 +69,7 @@ class RequestSender {
|
|
|
69
69
|
* parses the JSON and returns it (i.e. passes it to the callback) if there
|
|
70
70
|
* is no "error" field. Otherwise constructs/passes an appropriate Error.
|
|
71
71
|
*/
|
|
72
|
-
_jsonResponseHandler(requestEvent, callback) {
|
|
72
|
+
_jsonResponseHandler(requestEvent, usage, callback) {
|
|
73
73
|
return (res) => {
|
|
74
74
|
const headers = res.getHeaders();
|
|
75
75
|
const requestId = this._getRequestId(headers);
|
|
@@ -115,7 +115,7 @@ class RequestSender {
|
|
|
115
115
|
});
|
|
116
116
|
})
|
|
117
117
|
.then((jsonResponse) => {
|
|
118
|
-
this._recordRequestMetrics(requestId, responseEvent.elapsed);
|
|
118
|
+
this._recordRequestMetrics(requestId, responseEvent.elapsed, usage);
|
|
119
119
|
// Expose raw response object.
|
|
120
120
|
const rawResponse = res.getRawResponse();
|
|
121
121
|
this._addHeadersDirectlyToObject(rawResponse, headers);
|
|
@@ -257,20 +257,24 @@ class RequestSender {
|
|
|
257
257
|
});
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
|
-
_recordRequestMetrics(requestId, requestDurationMs) {
|
|
260
|
+
_recordRequestMetrics(requestId, requestDurationMs, usage) {
|
|
261
261
|
if (this._stripe.getTelemetryEnabled() && requestId) {
|
|
262
262
|
if (this._stripe._prevRequestMetrics.length > this._maxBufferedRequestMetric) {
|
|
263
263
|
(0, utils_js_1.emitWarning)('Request metrics buffer is full, dropping telemetry message.');
|
|
264
264
|
}
|
|
265
265
|
else {
|
|
266
|
-
|
|
266
|
+
const m = {
|
|
267
267
|
request_id: requestId,
|
|
268
268
|
request_duration_ms: requestDurationMs,
|
|
269
|
-
}
|
|
269
|
+
};
|
|
270
|
+
if (usage && usage.length > 0) {
|
|
271
|
+
m.usage = usage;
|
|
272
|
+
}
|
|
273
|
+
this._stripe._prevRequestMetrics.push(m);
|
|
270
274
|
}
|
|
271
275
|
}
|
|
272
276
|
}
|
|
273
|
-
_request(method, host, path, data, auth, options = {}, callback, requestDataProcessor = null) {
|
|
277
|
+
_request(method, host, path, data, auth, options = {}, usage = [], callback, requestDataProcessor = null) {
|
|
274
278
|
let requestData;
|
|
275
279
|
const retryRequest = (requestFn, apiVersion, headers, requestRetries, retryAfter) => {
|
|
276
280
|
return setTimeout(requestFn, this._getSleepTimeInMS(requestRetries, retryAfter), apiVersion, headers, requestRetries + 1);
|
|
@@ -307,10 +311,10 @@ class RequestSender {
|
|
|
307
311
|
res.getHeaders()['retry-after']);
|
|
308
312
|
}
|
|
309
313
|
else if (options.streaming && res.getStatusCode() < 400) {
|
|
310
|
-
return this._streamingResponseHandler(requestEvent, callback)(res);
|
|
314
|
+
return this._streamingResponseHandler(requestEvent, usage, callback)(res);
|
|
311
315
|
}
|
|
312
316
|
else {
|
|
313
|
-
return this._jsonResponseHandler(requestEvent, callback)(res);
|
|
317
|
+
return this._jsonResponseHandler(requestEvent, usage, callback)(res);
|
|
314
318
|
}
|
|
315
319
|
})
|
|
316
320
|
.catch((error) => {
|
package/cjs/StripeResource.js
CHANGED
|
@@ -81,6 +81,7 @@ StripeResource.prototype = {
|
|
|
81
81
|
_getRequestOpts(requestArgs, spec, overrideData) {
|
|
82
82
|
// Extract spec values with defaults.
|
|
83
83
|
const requestMethod = (spec.method || 'GET').toUpperCase();
|
|
84
|
+
const usage = spec.usage || [];
|
|
84
85
|
const urlParams = spec.urlParams || [];
|
|
85
86
|
const encode = spec.encode || ((data) => data);
|
|
86
87
|
const isUsingFullPath = !!spec.fullPath;
|
|
@@ -133,6 +134,7 @@ StripeResource.prototype = {
|
|
|
133
134
|
host: host !== null && host !== void 0 ? host : null,
|
|
134
135
|
streaming,
|
|
135
136
|
settings: options.settings,
|
|
137
|
+
usage,
|
|
136
138
|
};
|
|
137
139
|
},
|
|
138
140
|
_makeRequest(requestArgs, spec, overrideData) {
|
|
@@ -163,7 +165,7 @@ StripeResource.prototype = {
|
|
|
163
165
|
(0, utils_js_1.stringifyRequestData)(opts.queryData),
|
|
164
166
|
].join('');
|
|
165
167
|
const { headers, settings } = opts;
|
|
166
|
-
this._stripe._requestSender._request(opts.requestMethod, opts.host, path, opts.bodyData, opts.auth, { headers, settings, streaming: opts.streaming }, requestCallback, (_a = this.requestDataProcessor) === null || _a === void 0 ? void 0 : _a.bind(this));
|
|
168
|
+
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));
|
|
167
169
|
});
|
|
168
170
|
},
|
|
169
171
|
};
|
package/cjs/stripe.core.js
CHANGED
|
@@ -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.
|
|
37
|
+
Stripe.PACKAGE_VERSION = '14.9.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/RequestSender.js
CHANGED
|
@@ -45,13 +45,13 @@ export class RequestSender {
|
|
|
45
45
|
* still be buffered/parsed and handled by _jsonResponseHandler -- see
|
|
46
46
|
* makeRequest)
|
|
47
47
|
*/
|
|
48
|
-
_streamingResponseHandler(requestEvent, callback) {
|
|
48
|
+
_streamingResponseHandler(requestEvent, usage, callback) {
|
|
49
49
|
return (res) => {
|
|
50
50
|
const headers = res.getHeaders();
|
|
51
51
|
const streamCompleteCallback = () => {
|
|
52
52
|
const responseEvent = this._makeResponseEvent(requestEvent, res.getStatusCode(), headers);
|
|
53
53
|
this._stripe._emitter.emit('response', responseEvent);
|
|
54
|
-
this._recordRequestMetrics(this._getRequestId(headers), responseEvent.elapsed);
|
|
54
|
+
this._recordRequestMetrics(this._getRequestId(headers), responseEvent.elapsed, usage);
|
|
55
55
|
};
|
|
56
56
|
const stream = res.toStream(streamCompleteCallback);
|
|
57
57
|
// This is here for backwards compatibility, as the stream is a raw
|
|
@@ -66,7 +66,7 @@ export class RequestSender {
|
|
|
66
66
|
* parses the JSON and returns it (i.e. passes it to the callback) if there
|
|
67
67
|
* is no "error" field. Otherwise constructs/passes an appropriate Error.
|
|
68
68
|
*/
|
|
69
|
-
_jsonResponseHandler(requestEvent, callback) {
|
|
69
|
+
_jsonResponseHandler(requestEvent, usage, callback) {
|
|
70
70
|
return (res) => {
|
|
71
71
|
const headers = res.getHeaders();
|
|
72
72
|
const requestId = this._getRequestId(headers);
|
|
@@ -112,7 +112,7 @@ export class RequestSender {
|
|
|
112
112
|
});
|
|
113
113
|
})
|
|
114
114
|
.then((jsonResponse) => {
|
|
115
|
-
this._recordRequestMetrics(requestId, responseEvent.elapsed);
|
|
115
|
+
this._recordRequestMetrics(requestId, responseEvent.elapsed, usage);
|
|
116
116
|
// Expose raw response object.
|
|
117
117
|
const rawResponse = res.getRawResponse();
|
|
118
118
|
this._addHeadersDirectlyToObject(rawResponse, headers);
|
|
@@ -254,20 +254,24 @@ export class RequestSender {
|
|
|
254
254
|
});
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
-
_recordRequestMetrics(requestId, requestDurationMs) {
|
|
257
|
+
_recordRequestMetrics(requestId, requestDurationMs, usage) {
|
|
258
258
|
if (this._stripe.getTelemetryEnabled() && requestId) {
|
|
259
259
|
if (this._stripe._prevRequestMetrics.length > this._maxBufferedRequestMetric) {
|
|
260
260
|
emitWarning('Request metrics buffer is full, dropping telemetry message.');
|
|
261
261
|
}
|
|
262
262
|
else {
|
|
263
|
-
|
|
263
|
+
const m = {
|
|
264
264
|
request_id: requestId,
|
|
265
265
|
request_duration_ms: requestDurationMs,
|
|
266
|
-
}
|
|
266
|
+
};
|
|
267
|
+
if (usage && usage.length > 0) {
|
|
268
|
+
m.usage = usage;
|
|
269
|
+
}
|
|
270
|
+
this._stripe._prevRequestMetrics.push(m);
|
|
267
271
|
}
|
|
268
272
|
}
|
|
269
273
|
}
|
|
270
|
-
_request(method, host, path, data, auth, options = {}, callback, requestDataProcessor = null) {
|
|
274
|
+
_request(method, host, path, data, auth, options = {}, usage = [], callback, requestDataProcessor = null) {
|
|
271
275
|
let requestData;
|
|
272
276
|
const retryRequest = (requestFn, apiVersion, headers, requestRetries, retryAfter) => {
|
|
273
277
|
return setTimeout(requestFn, this._getSleepTimeInMS(requestRetries, retryAfter), apiVersion, headers, requestRetries + 1);
|
|
@@ -304,10 +308,10 @@ export class RequestSender {
|
|
|
304
308
|
res.getHeaders()['retry-after']);
|
|
305
309
|
}
|
|
306
310
|
else if (options.streaming && res.getStatusCode() < 400) {
|
|
307
|
-
return this._streamingResponseHandler(requestEvent, callback)(res);
|
|
311
|
+
return this._streamingResponseHandler(requestEvent, usage, callback)(res);
|
|
308
312
|
}
|
|
309
313
|
else {
|
|
310
|
-
return this._jsonResponseHandler(requestEvent, callback)(res);
|
|
314
|
+
return this._jsonResponseHandler(requestEvent, usage, callback)(res);
|
|
311
315
|
}
|
|
312
316
|
})
|
|
313
317
|
.catch((error) => {
|
package/esm/StripeResource.js
CHANGED
|
@@ -77,6 +77,7 @@ StripeResource.prototype = {
|
|
|
77
77
|
_getRequestOpts(requestArgs, spec, overrideData) {
|
|
78
78
|
// Extract spec values with defaults.
|
|
79
79
|
const requestMethod = (spec.method || 'GET').toUpperCase();
|
|
80
|
+
const usage = spec.usage || [];
|
|
80
81
|
const urlParams = spec.urlParams || [];
|
|
81
82
|
const encode = spec.encode || ((data) => data);
|
|
82
83
|
const isUsingFullPath = !!spec.fullPath;
|
|
@@ -129,6 +130,7 @@ StripeResource.prototype = {
|
|
|
129
130
|
host: host !== null && host !== void 0 ? host : null,
|
|
130
131
|
streaming,
|
|
131
132
|
settings: options.settings,
|
|
133
|
+
usage,
|
|
132
134
|
};
|
|
133
135
|
},
|
|
134
136
|
_makeRequest(requestArgs, spec, overrideData) {
|
|
@@ -159,7 +161,7 @@ StripeResource.prototype = {
|
|
|
159
161
|
stringifyRequestData(opts.queryData),
|
|
160
162
|
].join('');
|
|
161
163
|
const { headers, settings } = opts;
|
|
162
|
-
this._stripe._requestSender._request(opts.requestMethod, opts.host, path, opts.bodyData, opts.auth, { headers, settings, streaming: opts.streaming }, requestCallback, (_a = this.requestDataProcessor) === null || _a === void 0 ? void 0 : _a.bind(this));
|
|
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));
|
|
163
165
|
});
|
|
164
166
|
},
|
|
165
167
|
};
|
package/esm/stripe.core.js
CHANGED
|
@@ -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.
|
|
34
|
+
Stripe.PACKAGE_VERSION = '14.9.0';
|
|
35
35
|
Stripe.USER_AGENT = Object.assign({ bindings_version: Stripe.PACKAGE_VERSION, lang: 'node', publisher: 'stripe', uname: null, typescript: false }, determineProcessUserAgentProperties());
|
|
36
36
|
Stripe.StripeResource = StripeResource;
|
|
37
37
|
Stripe.resources = resources;
|
package/package.json
CHANGED
|
@@ -366,6 +366,11 @@ declare module 'stripe' {
|
|
|
366
366
|
}
|
|
367
367
|
|
|
368
368
|
interface ConsentCollection {
|
|
369
|
+
/**
|
|
370
|
+
* If set to `hidden`, it will hide legal text related to the reuse of a payment method.
|
|
371
|
+
*/
|
|
372
|
+
payment_method_reuse_agreement: ConsentCollection.PaymentMethodReuseAgreement | null;
|
|
373
|
+
|
|
369
374
|
/**
|
|
370
375
|
* If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout
|
|
371
376
|
* Session will determine whether to display an option to opt into promotional communication
|
|
@@ -380,6 +385,19 @@ declare module 'stripe' {
|
|
|
380
385
|
}
|
|
381
386
|
|
|
382
387
|
namespace ConsentCollection {
|
|
388
|
+
interface PaymentMethodReuseAgreement {
|
|
389
|
+
/**
|
|
390
|
+
* Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's defaults will be used.
|
|
391
|
+
*
|
|
392
|
+
* When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI.
|
|
393
|
+
*/
|
|
394
|
+
position: PaymentMethodReuseAgreement.Position;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
namespace PaymentMethodReuseAgreement {
|
|
398
|
+
type Position = 'auto' | 'hidden';
|
|
399
|
+
}
|
|
400
|
+
|
|
383
401
|
type Promotions = 'auto' | 'none';
|
|
384
402
|
|
|
385
403
|
type TermsOfService = 'none' | 'required';
|
|
@@ -631,6 +649,11 @@ declare module 'stripe' {
|
|
|
631
649
|
}
|
|
632
650
|
|
|
633
651
|
interface CustomText {
|
|
652
|
+
/**
|
|
653
|
+
* Custom text that should be displayed after the payment confirmation button.
|
|
654
|
+
*/
|
|
655
|
+
after_submit: CustomText.AfterSubmit | null;
|
|
656
|
+
|
|
634
657
|
/**
|
|
635
658
|
* Custom text that should be displayed alongside shipping address collection.
|
|
636
659
|
*/
|
|
@@ -648,6 +671,13 @@ declare module 'stripe' {
|
|
|
648
671
|
}
|
|
649
672
|
|
|
650
673
|
namespace CustomText {
|
|
674
|
+
interface AfterSubmit {
|
|
675
|
+
/**
|
|
676
|
+
* Text may be up to 1200 characters in length.
|
|
677
|
+
*/
|
|
678
|
+
message: string;
|
|
679
|
+
}
|
|
680
|
+
|
|
651
681
|
interface ShippingAddress {
|
|
652
682
|
/**
|
|
653
683
|
* Text may be up to 1200 characters in length.
|
|
@@ -284,6 +284,11 @@ declare module 'stripe' {
|
|
|
284
284
|
type BillingAddressCollection = 'auto' | 'required';
|
|
285
285
|
|
|
286
286
|
interface ConsentCollection {
|
|
287
|
+
/**
|
|
288
|
+
* Determines the display of payment method reuse agreement text in the UI. If set to `hidden`, it will hide legal text related to the reuse of a payment method.
|
|
289
|
+
*/
|
|
290
|
+
payment_method_reuse_agreement?: ConsentCollection.PaymentMethodReuseAgreement;
|
|
291
|
+
|
|
287
292
|
/**
|
|
288
293
|
* If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout
|
|
289
294
|
* Session will determine whether to display an option to opt into promotional communication
|
|
@@ -299,6 +304,18 @@ declare module 'stripe' {
|
|
|
299
304
|
}
|
|
300
305
|
|
|
301
306
|
namespace ConsentCollection {
|
|
307
|
+
interface PaymentMethodReuseAgreement {
|
|
308
|
+
/**
|
|
309
|
+
* Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's
|
|
310
|
+
* defaults will be used. When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI.
|
|
311
|
+
*/
|
|
312
|
+
position: PaymentMethodReuseAgreement.Position;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
namespace PaymentMethodReuseAgreement {
|
|
316
|
+
type Position = 'auto' | 'hidden';
|
|
317
|
+
}
|
|
318
|
+
|
|
302
319
|
type Promotions = 'auto' | 'none';
|
|
303
320
|
|
|
304
321
|
type TermsOfService = 'none' | 'required';
|
|
@@ -432,6 +449,11 @@ declare module 'stripe' {
|
|
|
432
449
|
}
|
|
433
450
|
|
|
434
451
|
interface CustomText {
|
|
452
|
+
/**
|
|
453
|
+
* Custom text that should be displayed after the payment confirmation button.
|
|
454
|
+
*/
|
|
455
|
+
after_submit?: Stripe.Emptyable<CustomText.AfterSubmit>;
|
|
456
|
+
|
|
435
457
|
/**
|
|
436
458
|
* Custom text that should be displayed alongside shipping address collection.
|
|
437
459
|
*/
|
|
@@ -451,6 +473,13 @@ declare module 'stripe' {
|
|
|
451
473
|
}
|
|
452
474
|
|
|
453
475
|
namespace CustomText {
|
|
476
|
+
interface AfterSubmit {
|
|
477
|
+
/**
|
|
478
|
+
* Text may be up to 1200 characters in length.
|
|
479
|
+
*/
|
|
480
|
+
message: string;
|
|
481
|
+
}
|
|
482
|
+
|
|
454
483
|
interface ShippingAddress {
|
|
455
484
|
/**
|
|
456
485
|
* Text may be up to 1200 characters in length.
|
|
@@ -1410,7 +1410,7 @@ declare module 'stripe' {
|
|
|
1410
1410
|
| number;
|
|
1411
1411
|
|
|
1412
1412
|
/**
|
|
1413
|
-
*
|
|
1413
|
+
* A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period.
|
|
1414
1414
|
*/
|
|
1415
1415
|
subscription_cancel_at?: Stripe.Emptyable<number>;
|
|
1416
1416
|
|
|
@@ -1452,7 +1452,7 @@ declare module 'stripe' {
|
|
|
1452
1452
|
subscription_resume_at?: 'now';
|
|
1453
1453
|
|
|
1454
1454
|
/**
|
|
1455
|
-
* Date a subscription is intended to start (can be future or past)
|
|
1455
|
+
* Date a subscription is intended to start (can be future or past).
|
|
1456
1456
|
*/
|
|
1457
1457
|
subscription_start_date?: number;
|
|
1458
1458
|
|
|
@@ -1995,7 +1995,7 @@ declare module 'stripe' {
|
|
|
1995
1995
|
| number;
|
|
1996
1996
|
|
|
1997
1997
|
/**
|
|
1998
|
-
*
|
|
1998
|
+
* A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period.
|
|
1999
1999
|
*/
|
|
2000
2000
|
subscription_cancel_at?: Stripe.Emptyable<number>;
|
|
2001
2001
|
|
|
@@ -2037,7 +2037,7 @@ declare module 'stripe' {
|
|
|
2037
2037
|
subscription_resume_at?: 'now';
|
|
2038
2038
|
|
|
2039
2039
|
/**
|
|
2040
|
-
* Date a subscription is intended to start (can be future or past)
|
|
2040
|
+
* Date a subscription is intended to start (can be future or past).
|
|
2041
2041
|
*/
|
|
2042
2042
|
subscription_start_date?: number;
|
|
2043
2043
|
|
|
@@ -82,6 +82,9 @@ declare module 'stripe' {
|
|
|
82
82
|
*/
|
|
83
83
|
client_secret: string | null;
|
|
84
84
|
|
|
85
|
+
/**
|
|
86
|
+
* Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment.
|
|
87
|
+
*/
|
|
85
88
|
confirmation_method: PaymentIntent.ConfirmationMethod;
|
|
86
89
|
|
|
87
90
|
/**
|
|
@@ -33,6 +33,9 @@ declare module 'stripe' {
|
|
|
33
33
|
*/
|
|
34
34
|
confirm?: boolean;
|
|
35
35
|
|
|
36
|
+
/**
|
|
37
|
+
* Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment.
|
|
38
|
+
*/
|
|
36
39
|
confirmation_method?: PaymentIntentCreateParams.ConfirmationMethod;
|
|
37
40
|
|
|
38
41
|
/**
|
package/types/PaymentLinks.d.ts
CHANGED
|
@@ -205,6 +205,11 @@ declare module 'stripe' {
|
|
|
205
205
|
type BillingAddressCollection = 'auto' | 'required';
|
|
206
206
|
|
|
207
207
|
interface ConsentCollection {
|
|
208
|
+
/**
|
|
209
|
+
* Settings related to the payment method reuse text shown in the Checkout UI.
|
|
210
|
+
*/
|
|
211
|
+
payment_method_reuse_agreement: ConsentCollection.PaymentMethodReuseAgreement | null;
|
|
212
|
+
|
|
208
213
|
/**
|
|
209
214
|
* If set to `auto`, enables the collection of customer consent for promotional communications.
|
|
210
215
|
*/
|
|
@@ -217,6 +222,19 @@ declare module 'stripe' {
|
|
|
217
222
|
}
|
|
218
223
|
|
|
219
224
|
namespace ConsentCollection {
|
|
225
|
+
interface PaymentMethodReuseAgreement {
|
|
226
|
+
/**
|
|
227
|
+
* Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's defaults will be used.
|
|
228
|
+
*
|
|
229
|
+
* When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI.
|
|
230
|
+
*/
|
|
231
|
+
position: PaymentMethodReuseAgreement.Position;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
namespace PaymentMethodReuseAgreement {
|
|
235
|
+
type Position = 'auto' | 'hidden';
|
|
236
|
+
}
|
|
237
|
+
|
|
220
238
|
type Promotions = 'auto' | 'none';
|
|
221
239
|
|
|
222
240
|
type TermsOfService = 'none' | 'required';
|
|
@@ -311,6 +329,11 @@ declare module 'stripe' {
|
|
|
311
329
|
}
|
|
312
330
|
|
|
313
331
|
interface CustomText {
|
|
332
|
+
/**
|
|
333
|
+
* Custom text that should be displayed after the payment confirmation button.
|
|
334
|
+
*/
|
|
335
|
+
after_submit: CustomText.AfterSubmit | null;
|
|
336
|
+
|
|
314
337
|
/**
|
|
315
338
|
* Custom text that should be displayed alongside shipping address collection.
|
|
316
339
|
*/
|
|
@@ -328,6 +351,13 @@ declare module 'stripe' {
|
|
|
328
351
|
}
|
|
329
352
|
|
|
330
353
|
namespace CustomText {
|
|
354
|
+
interface AfterSubmit {
|
|
355
|
+
/**
|
|
356
|
+
* Text may be up to 1200 characters in length.
|
|
357
|
+
*/
|
|
358
|
+
message: string;
|
|
359
|
+
}
|
|
360
|
+
|
|
331
361
|
interface ShippingAddress {
|
|
332
362
|
/**
|
|
333
363
|
* Text may be up to 1200 characters in length.
|
|
@@ -196,6 +196,11 @@ declare module 'stripe' {
|
|
|
196
196
|
type BillingAddressCollection = 'auto' | 'required';
|
|
197
197
|
|
|
198
198
|
interface ConsentCollection {
|
|
199
|
+
/**
|
|
200
|
+
* Determines the display of payment method reuse agreement text in the UI. If set to `hidden`, it will hide legal text related to the reuse of a payment method.
|
|
201
|
+
*/
|
|
202
|
+
payment_method_reuse_agreement?: ConsentCollection.PaymentMethodReuseAgreement;
|
|
203
|
+
|
|
199
204
|
/**
|
|
200
205
|
* If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout
|
|
201
206
|
* Session will determine whether to display an option to opt into promotional communication
|
|
@@ -211,6 +216,18 @@ declare module 'stripe' {
|
|
|
211
216
|
}
|
|
212
217
|
|
|
213
218
|
namespace ConsentCollection {
|
|
219
|
+
interface PaymentMethodReuseAgreement {
|
|
220
|
+
/**
|
|
221
|
+
* Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's
|
|
222
|
+
* defaults will be used. When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI.
|
|
223
|
+
*/
|
|
224
|
+
position: PaymentMethodReuseAgreement.Position;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
namespace PaymentMethodReuseAgreement {
|
|
228
|
+
type Position = 'auto' | 'hidden';
|
|
229
|
+
}
|
|
230
|
+
|
|
214
231
|
type Promotions = 'auto' | 'none';
|
|
215
232
|
|
|
216
233
|
type TermsOfService = 'none' | 'required';
|
|
@@ -317,6 +334,11 @@ declare module 'stripe' {
|
|
|
317
334
|
}
|
|
318
335
|
|
|
319
336
|
interface CustomText {
|
|
337
|
+
/**
|
|
338
|
+
* Custom text that should be displayed after the payment confirmation button.
|
|
339
|
+
*/
|
|
340
|
+
after_submit?: Stripe.Emptyable<CustomText.AfterSubmit>;
|
|
341
|
+
|
|
320
342
|
/**
|
|
321
343
|
* Custom text that should be displayed alongside shipping address collection.
|
|
322
344
|
*/
|
|
@@ -336,6 +358,13 @@ declare module 'stripe' {
|
|
|
336
358
|
}
|
|
337
359
|
|
|
338
360
|
namespace CustomText {
|
|
361
|
+
interface AfterSubmit {
|
|
362
|
+
/**
|
|
363
|
+
* Text may be up to 1200 characters in length.
|
|
364
|
+
*/
|
|
365
|
+
message: string;
|
|
366
|
+
}
|
|
367
|
+
|
|
339
368
|
interface ShippingAddress {
|
|
340
369
|
/**
|
|
341
370
|
* Text may be up to 1200 characters in length.
|
|
@@ -1160,6 +1189,11 @@ declare module 'stripe' {
|
|
|
1160
1189
|
}
|
|
1161
1190
|
|
|
1162
1191
|
interface CustomText {
|
|
1192
|
+
/**
|
|
1193
|
+
* Custom text that should be displayed after the payment confirmation button.
|
|
1194
|
+
*/
|
|
1195
|
+
after_submit?: Stripe.Emptyable<CustomText.AfterSubmit>;
|
|
1196
|
+
|
|
1163
1197
|
/**
|
|
1164
1198
|
* Custom text that should be displayed alongside shipping address collection.
|
|
1165
1199
|
*/
|
|
@@ -1179,6 +1213,13 @@ declare module 'stripe' {
|
|
|
1179
1213
|
}
|
|
1180
1214
|
|
|
1181
1215
|
namespace CustomText {
|
|
1216
|
+
interface AfterSubmit {
|
|
1217
|
+
/**
|
|
1218
|
+
* Text may be up to 1200 characters in length.
|
|
1219
|
+
*/
|
|
1220
|
+
message: string;
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1182
1223
|
interface ShippingAddress {
|
|
1183
1224
|
/**
|
|
1184
1225
|
* Text may be up to 1200 characters in length.
|
|
@@ -16,6 +16,11 @@ declare module 'stripe' {
|
|
|
16
16
|
*/
|
|
17
17
|
charge?: string;
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Only return early fraud warnings that were created during the given date interval.
|
|
21
|
+
*/
|
|
22
|
+
created?: Stripe.RangeQueryParam | number;
|
|
23
|
+
|
|
19
24
|
/**
|
|
20
25
|
* Specifies which fields in the response should be expanded.
|
|
21
26
|
*/
|
|
@@ -6,7 +6,7 @@ declare module 'stripe' {
|
|
|
6
6
|
namespace Issuing {
|
|
7
7
|
interface AuthorizationCreateParams {
|
|
8
8
|
/**
|
|
9
|
-
* The total amount to attempt to authorize. This amount is in the provided currency, or defaults to the
|
|
9
|
+
* The total amount to attempt to authorize. This amount is in the provided currency, or defaults to the card's currency, and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
|
|
10
10
|
*/
|
|
11
11
|
amount: number;
|
|
12
12
|
|