@stripe/stripe-js 3.3.0 → 3.4.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/dist/stripe-js/payment-intents.d.mts +7 -0
- package/dist/stripe-js/payment-intents.d.ts +7 -0
- package/dist/stripe-js/setup-intents.d.mts +54 -1
- package/dist/stripe-js/setup-intents.d.ts +54 -1
- package/dist/stripe-js/stripe.d.mts +6 -6
- package/dist/stripe-js/stripe.d.ts +6 -6
- package/package.json +4 -2
|
@@ -1432,6 +1432,13 @@ export interface ConfirmPaymentData extends PaymentIntentConfirmParams {
|
|
|
1432
1432
|
allow_redisplay?: 'always' | 'limited' | 'unspecified';
|
|
1433
1433
|
};
|
|
1434
1434
|
|
|
1435
|
+
/**
|
|
1436
|
+
* Optional `id` of an existing [ConfirmationToken](https://stripe.com/docs/api/confirmation_tokens).
|
|
1437
|
+
*
|
|
1438
|
+
* @docs https://stripe.com/docs/js/payment_intents/confirm_payment#confirm_payment_intent-options-confirmParams-confirmation_token
|
|
1439
|
+
*/
|
|
1440
|
+
confirmation_token?: string;
|
|
1441
|
+
|
|
1435
1442
|
/**
|
|
1436
1443
|
* Optional `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods).
|
|
1437
1444
|
*
|
|
@@ -1432,6 +1432,13 @@ export interface ConfirmPaymentData extends PaymentIntentConfirmParams {
|
|
|
1432
1432
|
allow_redisplay?: 'always' | 'limited' | 'unspecified';
|
|
1433
1433
|
};
|
|
1434
1434
|
|
|
1435
|
+
/**
|
|
1436
|
+
* Optional `id` of an existing [ConfirmationToken](https://stripe.com/docs/api/confirmation_tokens).
|
|
1437
|
+
*
|
|
1438
|
+
* @docs https://stripe.com/docs/js/payment_intents/confirm_payment#confirm_payment_intent-options-confirmParams-confirmation_token
|
|
1439
|
+
*/
|
|
1440
|
+
confirmation_token?: string;
|
|
1441
|
+
|
|
1435
1442
|
/**
|
|
1436
1443
|
* Optional `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods).
|
|
1437
1444
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {SetupIntentConfirmParams} from '../api';
|
|
1
|
+
import {PaymentMethodCreateParams, SetupIntentConfirmParams} from '../api';
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
CreatePaymentMethodAcssDebitData,
|
|
@@ -17,6 +17,59 @@ import {
|
|
|
17
17
|
|
|
18
18
|
import {Omit} from '../utils';
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Data to be sent with a `stripe.confirmSetup` request.
|
|
22
|
+
* Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters.
|
|
23
|
+
*/
|
|
24
|
+
export interface ConfirmSetupData extends SetupIntentConfirmParams {
|
|
25
|
+
/**
|
|
26
|
+
* The url your customer will be directed to after they complete payment.
|
|
27
|
+
*/
|
|
28
|
+
return_url: string;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* An object to attach additional billing_details to the PaymentMethod created via Elements.
|
|
32
|
+
*
|
|
33
|
+
* @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_data
|
|
34
|
+
*/
|
|
35
|
+
payment_method_data?: {
|
|
36
|
+
/**
|
|
37
|
+
* The customer's billing details. Details collected by Elements will override values passed here.
|
|
38
|
+
* Billing fields that are omitted in the Payment Element via the `fields` option required.
|
|
39
|
+
*
|
|
40
|
+
* @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_data-billing_details
|
|
41
|
+
*/
|
|
42
|
+
billing_details?: PaymentMethodCreateParams.BillingDetails;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Requires beta access:
|
|
46
|
+
* Contact [Stripe support](https://support.stripe.com/) for more information.
|
|
47
|
+
*
|
|
48
|
+
* Specifies if the PaymentMethod should be redisplayed when using the Saved Payment Method feature
|
|
49
|
+
*/
|
|
50
|
+
allow_redisplay?: 'always' | 'limited' | 'unspecified';
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Optional `id` of an existing [ConfirmationToken](https://stripe.com/docs/api/confirmation_tokens).
|
|
55
|
+
*
|
|
56
|
+
* @docs https://stripe.com/docs/js/payment_intents/confirm_payment#confirm_payment_intent-options-confirmParams-confirmation_token
|
|
57
|
+
*/
|
|
58
|
+
confirmation_token?: string;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Optional `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods).
|
|
62
|
+
*
|
|
63
|
+
* @docs https://stripe.com/docs/js/payment_intents/confirm_payment#confirm_payment_intent-options-confirmParams-payment_method
|
|
64
|
+
*/
|
|
65
|
+
payment_method?: string;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Specifies which fields in the response should be expanded.
|
|
69
|
+
*/
|
|
70
|
+
expand?: Array<string>;
|
|
71
|
+
}
|
|
72
|
+
|
|
20
73
|
/**
|
|
21
74
|
* Data to be sent with a `stripe.confirmCardSetup` request.
|
|
22
75
|
* Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {SetupIntentConfirmParams} from '../api';
|
|
1
|
+
import {PaymentMethodCreateParams, SetupIntentConfirmParams} from '../api';
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
CreatePaymentMethodAcssDebitData,
|
|
@@ -17,6 +17,59 @@ import {
|
|
|
17
17
|
|
|
18
18
|
import {Omit} from '../utils';
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Data to be sent with a `stripe.confirmSetup` request.
|
|
22
|
+
* Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters.
|
|
23
|
+
*/
|
|
24
|
+
export interface ConfirmSetupData extends SetupIntentConfirmParams {
|
|
25
|
+
/**
|
|
26
|
+
* The url your customer will be directed to after they complete payment.
|
|
27
|
+
*/
|
|
28
|
+
return_url: string;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* An object to attach additional billing_details to the PaymentMethod created via Elements.
|
|
32
|
+
*
|
|
33
|
+
* @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_data
|
|
34
|
+
*/
|
|
35
|
+
payment_method_data?: {
|
|
36
|
+
/**
|
|
37
|
+
* The customer's billing details. Details collected by Elements will override values passed here.
|
|
38
|
+
* Billing fields that are omitted in the Payment Element via the `fields` option required.
|
|
39
|
+
*
|
|
40
|
+
* @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_data-billing_details
|
|
41
|
+
*/
|
|
42
|
+
billing_details?: PaymentMethodCreateParams.BillingDetails;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Requires beta access:
|
|
46
|
+
* Contact [Stripe support](https://support.stripe.com/) for more information.
|
|
47
|
+
*
|
|
48
|
+
* Specifies if the PaymentMethod should be redisplayed when using the Saved Payment Method feature
|
|
49
|
+
*/
|
|
50
|
+
allow_redisplay?: 'always' | 'limited' | 'unspecified';
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Optional `id` of an existing [ConfirmationToken](https://stripe.com/docs/api/confirmation_tokens).
|
|
55
|
+
*
|
|
56
|
+
* @docs https://stripe.com/docs/js/payment_intents/confirm_payment#confirm_payment_intent-options-confirmParams-confirmation_token
|
|
57
|
+
*/
|
|
58
|
+
confirmation_token?: string;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Optional `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods).
|
|
62
|
+
*
|
|
63
|
+
* @docs https://stripe.com/docs/js/payment_intents/confirm_payment#confirm_payment_intent-options-confirmParams-payment_method
|
|
64
|
+
*/
|
|
65
|
+
payment_method?: string;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Specifies which fields in the response should be expanded.
|
|
69
|
+
*/
|
|
70
|
+
expand?: Array<string>;
|
|
71
|
+
}
|
|
72
|
+
|
|
20
73
|
/**
|
|
21
74
|
* Data to be sent with a `stripe.confirmCardSetup` request.
|
|
22
75
|
* Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters.
|
|
@@ -707,7 +707,7 @@ export interface Stripe {
|
|
|
707
707
|
*/
|
|
708
708
|
confirmSetup(options: {
|
|
709
709
|
elements: StripeElements;
|
|
710
|
-
confirmParams?: Partial<
|
|
710
|
+
confirmParams?: Partial<setupIntents.ConfirmSetupData>;
|
|
711
711
|
redirect: 'if_required';
|
|
712
712
|
}): Promise<SetupIntentResult>;
|
|
713
713
|
|
|
@@ -725,7 +725,7 @@ export interface Stripe {
|
|
|
725
725
|
confirmSetup(options: {
|
|
726
726
|
elements?: StripeElements;
|
|
727
727
|
clientSecret: string;
|
|
728
|
-
confirmParams?: Partial<
|
|
728
|
+
confirmParams?: Partial<setupIntents.ConfirmSetupData>;
|
|
729
729
|
redirect: 'if_required';
|
|
730
730
|
}): Promise<SetupIntentResult>;
|
|
731
731
|
|
|
@@ -738,7 +738,7 @@ export interface Stripe {
|
|
|
738
738
|
*/
|
|
739
739
|
confirmSetup(options: {
|
|
740
740
|
elements: StripeElements;
|
|
741
|
-
confirmParams:
|
|
741
|
+
confirmParams: setupIntents.ConfirmSetupData;
|
|
742
742
|
redirect?: 'always';
|
|
743
743
|
}): Promise<never | {error: StripeError}>;
|
|
744
744
|
|
|
@@ -752,7 +752,7 @@ export interface Stripe {
|
|
|
752
752
|
confirmSetup(options: {
|
|
753
753
|
elements?: StripeElements;
|
|
754
754
|
clientSecret: string;
|
|
755
|
-
confirmParams:
|
|
755
|
+
confirmParams: setupIntents.ConfirmSetupData;
|
|
756
756
|
redirect?: 'always';
|
|
757
757
|
}): Promise<never | {error: StripeError}>;
|
|
758
758
|
|
|
@@ -1299,8 +1299,8 @@ export type EphemeralKeyNonceResult =
|
|
|
1299
1299
|
| {nonce: string; error?: undefined}
|
|
1300
1300
|
| {nonce?: undefined; error: StripeError};
|
|
1301
1301
|
|
|
1302
|
-
/* A Radar Session is a snapshot of the browser metadata and device details that helps Radar make more accurate predictions on your payments.
|
|
1303
|
-
This metadata includes information like IP address, browser, screen or device information, and other device characteristics.
|
|
1302
|
+
/* A Radar Session is a snapshot of the browser metadata and device details that helps Radar make more accurate predictions on your payments.
|
|
1303
|
+
This metadata includes information like IP address, browser, screen or device information, and other device characteristics.
|
|
1304
1304
|
You can find more details about how Radar uses this data by reading about how Radar performs [advanced fraud detection](https://stripe.com/docs/disputes/prevention/advanced-fraud-detection).
|
|
1305
1305
|
*/
|
|
1306
1306
|
export type RadarSessionPayload =
|
|
@@ -707,7 +707,7 @@ export interface Stripe {
|
|
|
707
707
|
*/
|
|
708
708
|
confirmSetup(options: {
|
|
709
709
|
elements: StripeElements;
|
|
710
|
-
confirmParams?: Partial<
|
|
710
|
+
confirmParams?: Partial<setupIntents.ConfirmSetupData>;
|
|
711
711
|
redirect: 'if_required';
|
|
712
712
|
}): Promise<SetupIntentResult>;
|
|
713
713
|
|
|
@@ -725,7 +725,7 @@ export interface Stripe {
|
|
|
725
725
|
confirmSetup(options: {
|
|
726
726
|
elements?: StripeElements;
|
|
727
727
|
clientSecret: string;
|
|
728
|
-
confirmParams?: Partial<
|
|
728
|
+
confirmParams?: Partial<setupIntents.ConfirmSetupData>;
|
|
729
729
|
redirect: 'if_required';
|
|
730
730
|
}): Promise<SetupIntentResult>;
|
|
731
731
|
|
|
@@ -738,7 +738,7 @@ export interface Stripe {
|
|
|
738
738
|
*/
|
|
739
739
|
confirmSetup(options: {
|
|
740
740
|
elements: StripeElements;
|
|
741
|
-
confirmParams:
|
|
741
|
+
confirmParams: setupIntents.ConfirmSetupData;
|
|
742
742
|
redirect?: 'always';
|
|
743
743
|
}): Promise<never | {error: StripeError}>;
|
|
744
744
|
|
|
@@ -752,7 +752,7 @@ export interface Stripe {
|
|
|
752
752
|
confirmSetup(options: {
|
|
753
753
|
elements?: StripeElements;
|
|
754
754
|
clientSecret: string;
|
|
755
|
-
confirmParams:
|
|
755
|
+
confirmParams: setupIntents.ConfirmSetupData;
|
|
756
756
|
redirect?: 'always';
|
|
757
757
|
}): Promise<never | {error: StripeError}>;
|
|
758
758
|
|
|
@@ -1299,8 +1299,8 @@ export type EphemeralKeyNonceResult =
|
|
|
1299
1299
|
| {nonce: string; error?: undefined}
|
|
1300
1300
|
| {nonce?: undefined; error: StripeError};
|
|
1301
1301
|
|
|
1302
|
-
/* A Radar Session is a snapshot of the browser metadata and device details that helps Radar make more accurate predictions on your payments.
|
|
1303
|
-
This metadata includes information like IP address, browser, screen or device information, and other device characteristics.
|
|
1302
|
+
/* A Radar Session is a snapshot of the browser metadata and device details that helps Radar make more accurate predictions on your payments.
|
|
1303
|
+
This metadata includes information like IP address, browser, screen or device information, and other device characteristics.
|
|
1304
1304
|
You can find more details about how Radar uses this data by reading about how Radar performs [advanced fraud detection](https://stripe.com/docs/disputes/prevention/advanced-fraud-detection).
|
|
1305
1305
|
*/
|
|
1306
1306
|
export type RadarSessionPayload =
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stripe/stripe-js",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"description": "Stripe.js loading utility",
|
|
5
5
|
"repository": "github:stripe/stripe-js",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
"types": "lib/index.d.ts",
|
|
10
10
|
"typings": "lib/index.d.ts",
|
|
11
11
|
"scripts": {
|
|
12
|
-
"test": "yarn lint && yarn test:unit && yarn test:types && yarn typecheck",
|
|
12
|
+
"test": "yarn lint && yarn test:unit && yarn test:package-types && yarn test:types && yarn typecheck",
|
|
13
13
|
"test:unit": "jest",
|
|
14
|
+
"test:package-types": "attw --pack . --entrypoints ./lib ./pure",
|
|
14
15
|
"test:types": "zx ./tests/types/scripts/test.mjs",
|
|
15
16
|
"lint": "eslint '{src,types}/**/*.{ts,js}' && yarn prettier-check",
|
|
16
17
|
"typecheck": "tsc",
|
|
@@ -39,6 +40,7 @@
|
|
|
39
40
|
"node": ">=12.16"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
43
|
+
"@arethetypeswrong/cli": "^0.15.3",
|
|
42
44
|
"@babel/core": "^7.7.2",
|
|
43
45
|
"@babel/preset-env": "^7.7.1",
|
|
44
46
|
"@rollup/plugin-replace": "^2.3.1",
|