@stripe/stripe-js 1.46.0 → 1.48.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/pure.esm.js +17 -2
- package/dist/pure.js +17 -2
- package/dist/stripe.esm.js +2 -2
- package/dist/stripe.js +2 -2
- package/package.json +1 -1
- package/src/pure.test.ts +12 -1
- package/src/pure.ts +21 -0
- package/src/shared.ts +1 -1
- package/types/stripe-js/checkout.d.ts +2 -0
- package/types/stripe-js/elements/address.d.ts +7 -0
- package/types/stripe-js/elements/{pay-button.d.ts → express-checkout.d.ts} +106 -87
- package/types/stripe-js/elements/index.d.ts +1 -1
- package/types/stripe-js/elements/issuing/issuing-card-number-display.d.ts +8 -0
- package/types/stripe-js/elements-group.d.ts +15 -10
- package/types/stripe-js/index.d.ts +3 -0
- package/types/stripe-js/stripe.d.ts +1 -1
package/dist/pure.esm.js
CHANGED
|
@@ -54,7 +54,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
|
|
|
54
54
|
|
|
55
55
|
stripe._registerWrapper({
|
|
56
56
|
name: 'stripe-js',
|
|
57
|
-
version: "1.
|
|
57
|
+
version: "1.48.0",
|
|
58
58
|
startTime: startTime
|
|
59
59
|
});
|
|
60
60
|
};
|
|
@@ -67,7 +67,7 @@ var loadScript = function loadScript(params) {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
stripePromise = new Promise(function (resolve, reject) {
|
|
70
|
-
if (typeof window === 'undefined') {
|
|
70
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') {
|
|
71
71
|
// Resolve to null when imported server side. This makes the module
|
|
72
72
|
// safe to import in an isomorphic code base.
|
|
73
73
|
resolve(null);
|
|
@@ -148,6 +148,21 @@ var loadStripe = function loadStripe() {
|
|
|
148
148
|
};
|
|
149
149
|
|
|
150
150
|
loadStripe.setLoadParameters = function (params) {
|
|
151
|
+
// we won't throw an error if setLoadParameters is called with the same values as before
|
|
152
|
+
if (loadStripeCalled && loadParams) {
|
|
153
|
+
var validatedParams = validateLoadParams(params);
|
|
154
|
+
var parameterKeys = Object.keys(validatedParams);
|
|
155
|
+
var sameParameters = parameterKeys.reduce(function (previousValue, currentValue) {
|
|
156
|
+
var _loadParams;
|
|
157
|
+
|
|
158
|
+
return previousValue && params[currentValue] === ((_loadParams = loadParams) === null || _loadParams === void 0 ? void 0 : _loadParams[currentValue]);
|
|
159
|
+
}, true);
|
|
160
|
+
|
|
161
|
+
if (sameParameters) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
151
166
|
if (loadStripeCalled) {
|
|
152
167
|
throw new Error('You cannot change load parameters after calling loadStripe');
|
|
153
168
|
}
|
package/dist/pure.js
CHANGED
|
@@ -58,7 +58,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
|
|
|
58
58
|
|
|
59
59
|
stripe._registerWrapper({
|
|
60
60
|
name: 'stripe-js',
|
|
61
|
-
version: "1.
|
|
61
|
+
version: "1.48.0",
|
|
62
62
|
startTime: startTime
|
|
63
63
|
});
|
|
64
64
|
};
|
|
@@ -71,7 +71,7 @@ var loadScript = function loadScript(params) {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
stripePromise = new Promise(function (resolve, reject) {
|
|
74
|
-
if (typeof window === 'undefined') {
|
|
74
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') {
|
|
75
75
|
// Resolve to null when imported server side. This makes the module
|
|
76
76
|
// safe to import in an isomorphic code base.
|
|
77
77
|
resolve(null);
|
|
@@ -152,6 +152,21 @@ var loadStripe = function loadStripe() {
|
|
|
152
152
|
};
|
|
153
153
|
|
|
154
154
|
loadStripe.setLoadParameters = function (params) {
|
|
155
|
+
// we won't throw an error if setLoadParameters is called with the same values as before
|
|
156
|
+
if (loadStripeCalled && loadParams) {
|
|
157
|
+
var validatedParams = validateLoadParams(params);
|
|
158
|
+
var parameterKeys = Object.keys(validatedParams);
|
|
159
|
+
var sameParameters = parameterKeys.reduce(function (previousValue, currentValue) {
|
|
160
|
+
var _loadParams;
|
|
161
|
+
|
|
162
|
+
return previousValue && params[currentValue] === ((_loadParams = loadParams) === null || _loadParams === void 0 ? void 0 : _loadParams[currentValue]);
|
|
163
|
+
}, true);
|
|
164
|
+
|
|
165
|
+
if (sameParameters) {
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
155
170
|
if (loadStripeCalled) {
|
|
156
171
|
throw new Error('You cannot change load parameters after calling loadStripe');
|
|
157
172
|
}
|
package/dist/stripe.esm.js
CHANGED
|
@@ -38,7 +38,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
|
|
|
38
38
|
|
|
39
39
|
stripe._registerWrapper({
|
|
40
40
|
name: 'stripe-js',
|
|
41
|
-
version: "1.
|
|
41
|
+
version: "1.48.0",
|
|
42
42
|
startTime: startTime
|
|
43
43
|
});
|
|
44
44
|
};
|
|
@@ -51,7 +51,7 @@ var loadScript = function loadScript(params) {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
stripePromise = new Promise(function (resolve, reject) {
|
|
54
|
-
if (typeof window === 'undefined') {
|
|
54
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') {
|
|
55
55
|
// Resolve to null when imported server side. This makes the module
|
|
56
56
|
// safe to import in an isomorphic code base.
|
|
57
57
|
resolve(null);
|
package/dist/stripe.js
CHANGED
|
@@ -42,7 +42,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
|
|
|
42
42
|
|
|
43
43
|
stripe._registerWrapper({
|
|
44
44
|
name: 'stripe-js',
|
|
45
|
-
version: "1.
|
|
45
|
+
version: "1.48.0",
|
|
46
46
|
startTime: startTime
|
|
47
47
|
});
|
|
48
48
|
};
|
|
@@ -55,7 +55,7 @@ var loadScript = function loadScript(params) {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
stripePromise = new Promise(function (resolve, reject) {
|
|
58
|
-
if (typeof window === 'undefined') {
|
|
58
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') {
|
|
59
59
|
// Resolve to null when imported server side. This makes the module
|
|
60
60
|
// safe to import in an isomorphic code base.
|
|
61
61
|
resolve(null);
|
package/package.json
CHANGED
package/src/pure.test.ts
CHANGED
|
@@ -127,7 +127,18 @@ describe('pure module', () => {
|
|
|
127
127
|
loadStripe('pk_foo');
|
|
128
128
|
|
|
129
129
|
expect(() => {
|
|
130
|
-
loadStripe.setLoadParameters({advancedFraudSignals:
|
|
130
|
+
loadStripe.setLoadParameters({advancedFraudSignals: true});
|
|
131
131
|
}).toThrow('cannot change load parameters');
|
|
132
132
|
});
|
|
133
|
+
|
|
134
|
+
test('does not throw an error if calling setLoadParameters after loadStripe but the parameters are the same', () => {
|
|
135
|
+
const {loadStripe} = require('./pure');
|
|
136
|
+
|
|
137
|
+
loadStripe.setLoadParameters({advancedFraudSignals: false});
|
|
138
|
+
loadStripe('pk_foo');
|
|
139
|
+
|
|
140
|
+
expect(() => {
|
|
141
|
+
loadStripe.setLoadParameters({advancedFraudSignals: false});
|
|
142
|
+
}).not.toThrow('cannot change load parameters');
|
|
143
|
+
});
|
|
133
144
|
});
|
package/src/pure.ts
CHANGED
|
@@ -23,6 +23,27 @@ export const loadStripe: LoadStripe & {setLoadParameters: SetLoadParams} = (
|
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
loadStripe.setLoadParameters = (params): void => {
|
|
26
|
+
// we won't throw an error if setLoadParameters is called with the same values as before
|
|
27
|
+
if (loadStripeCalled && loadParams) {
|
|
28
|
+
const validatedParams = validateLoadParams(params);
|
|
29
|
+
const parameterKeys = Object.keys(validatedParams) as Array<
|
|
30
|
+
keyof LoadParams
|
|
31
|
+
>;
|
|
32
|
+
|
|
33
|
+
const sameParameters = parameterKeys.reduce(
|
|
34
|
+
(previousValue, currentValue) => {
|
|
35
|
+
return (
|
|
36
|
+
previousValue && params[currentValue] === loadParams?.[currentValue]
|
|
37
|
+
);
|
|
38
|
+
},
|
|
39
|
+
true
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
if (sameParameters) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
26
47
|
if (loadStripeCalled) {
|
|
27
48
|
throw new Error(
|
|
28
49
|
'You cannot change load parameters after calling loadStripe'
|
package/src/shared.ts
CHANGED
|
@@ -73,7 +73,7 @@ export const loadScript = (
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
stripePromise = new Promise((resolve, reject) => {
|
|
76
|
-
if (typeof window === 'undefined') {
|
|
76
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') {
|
|
77
77
|
// Resolve to null when imported server side. This makes the module
|
|
78
78
|
// safe to import in an isomorphic code base.
|
|
79
79
|
resolve(null);
|
|
@@ -119,6 +119,13 @@ export type StripeAddressElement = StripeElementBase & {
|
|
|
119
119
|
* Updates are merged into the existing configuration.
|
|
120
120
|
*/
|
|
121
121
|
update(options: Partial<StripeAddressElementOptions>): StripeAddressElement;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Validates and retrieves form values from the `AddressElement`.
|
|
125
|
+
*/
|
|
126
|
+
getValue(): Promise<
|
|
127
|
+
Pick<StripeAddressElementChangeEvent, 'complete' | 'isNewAddress' | 'value'>
|
|
128
|
+
>;
|
|
122
129
|
};
|
|
123
130
|
|
|
124
131
|
export interface ContactOption {
|
|
@@ -1,184 +1,203 @@
|
|
|
1
1
|
import {StripeElementBase} from './base';
|
|
2
2
|
import {StripeError} from '../stripe';
|
|
3
3
|
|
|
4
|
-
export type
|
|
4
|
+
export type StripeExpressCheckoutElement = StripeElementBase & {
|
|
5
5
|
/**
|
|
6
6
|
* Triggered when the element is fully rendered and can accept `element.focus` calls.
|
|
7
7
|
*/
|
|
8
8
|
on(
|
|
9
9
|
eventType: 'ready',
|
|
10
|
-
handler: (event:
|
|
11
|
-
):
|
|
10
|
+
handler: (event: StripeExpressCheckoutElementReadyEvent) => any
|
|
11
|
+
): StripeExpressCheckoutElement;
|
|
12
12
|
once(
|
|
13
13
|
eventType: 'ready',
|
|
14
|
-
handler: (event:
|
|
15
|
-
):
|
|
14
|
+
handler: (event: StripeExpressCheckoutElementReadyEvent) => any
|
|
15
|
+
): StripeExpressCheckoutElement;
|
|
16
16
|
off(
|
|
17
17
|
eventType: 'ready',
|
|
18
|
-
handler?: (event:
|
|
19
|
-
):
|
|
18
|
+
handler?: (event: StripeExpressCheckoutElementReadyEvent) => any
|
|
19
|
+
): StripeExpressCheckoutElement;
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Triggered when a button on the element is clicked.
|
|
23
23
|
*/
|
|
24
24
|
on(
|
|
25
25
|
eventType: 'click',
|
|
26
|
-
handler: (event:
|
|
27
|
-
):
|
|
26
|
+
handler: (event: StripeExpressCheckoutElementClickEvent) => any
|
|
27
|
+
): StripeExpressCheckoutElement;
|
|
28
28
|
once(
|
|
29
29
|
eventType: 'click',
|
|
30
|
-
handler: (event:
|
|
31
|
-
):
|
|
30
|
+
handler: (event: StripeExpressCheckoutElementClickEvent) => any
|
|
31
|
+
): StripeExpressCheckoutElement;
|
|
32
32
|
off(
|
|
33
33
|
eventType: 'click',
|
|
34
|
-
handler?: (event:
|
|
35
|
-
):
|
|
34
|
+
handler?: (event: StripeExpressCheckoutElementClickEvent) => any
|
|
35
|
+
): StripeExpressCheckoutElement;
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* Triggered when the element gains focus.
|
|
39
39
|
*/
|
|
40
40
|
on(
|
|
41
41
|
eventType: 'focus',
|
|
42
|
-
handler: (event: {elementType: '
|
|
43
|
-
):
|
|
42
|
+
handler: (event: {elementType: 'expressCheckout'}) => any
|
|
43
|
+
): StripeExpressCheckoutElement;
|
|
44
44
|
once(
|
|
45
45
|
eventType: 'focus',
|
|
46
|
-
handler: (event: {elementType: '
|
|
47
|
-
):
|
|
46
|
+
handler: (event: {elementType: 'expressCheckout'}) => any
|
|
47
|
+
): StripeExpressCheckoutElement;
|
|
48
48
|
off(
|
|
49
49
|
eventType: 'focus',
|
|
50
|
-
handler?: (event: {elementType: '
|
|
51
|
-
):
|
|
50
|
+
handler?: (event: {elementType: 'expressCheckout'}) => any
|
|
51
|
+
): StripeExpressCheckoutElement;
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
54
|
* Triggered when the element loses focus.
|
|
55
55
|
*/
|
|
56
56
|
on(
|
|
57
57
|
eventType: 'blur',
|
|
58
|
-
handler: (event: {elementType: '
|
|
59
|
-
):
|
|
58
|
+
handler: (event: {elementType: 'expressCheckout'}) => any
|
|
59
|
+
): StripeExpressCheckoutElement;
|
|
60
60
|
once(
|
|
61
61
|
eventType: 'blur',
|
|
62
|
-
handler: (event: {elementType: '
|
|
63
|
-
):
|
|
62
|
+
handler: (event: {elementType: 'expressCheckout'}) => any
|
|
63
|
+
): StripeExpressCheckoutElement;
|
|
64
64
|
off(
|
|
65
65
|
eventType: 'blur',
|
|
66
|
-
handler?: (event: {elementType: '
|
|
67
|
-
):
|
|
66
|
+
handler?: (event: {elementType: 'expressCheckout'}) => any
|
|
67
|
+
): StripeExpressCheckoutElement;
|
|
68
68
|
|
|
69
69
|
/**
|
|
70
70
|
* Triggered when the escape key is pressed within the element.
|
|
71
71
|
*/
|
|
72
72
|
on(
|
|
73
73
|
eventType: 'escape',
|
|
74
|
-
handler: (event: {elementType: '
|
|
75
|
-
):
|
|
74
|
+
handler: (event: {elementType: 'expressCheckout'}) => any
|
|
75
|
+
): StripeExpressCheckoutElement;
|
|
76
76
|
once(
|
|
77
77
|
eventType: 'escape',
|
|
78
|
-
handler: (event: {elementType: '
|
|
79
|
-
):
|
|
78
|
+
handler: (event: {elementType: 'expressCheckout'}) => any
|
|
79
|
+
): StripeExpressCheckoutElement;
|
|
80
80
|
off(
|
|
81
81
|
eventType: 'escape',
|
|
82
|
-
handler?: (event: {elementType: '
|
|
83
|
-
):
|
|
82
|
+
handler?: (event: {elementType: 'expressCheckout'}) => any
|
|
83
|
+
): StripeExpressCheckoutElement;
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
86
|
* Triggered when the element fails to load.
|
|
87
87
|
*/
|
|
88
88
|
on(
|
|
89
89
|
eventType: 'loaderror',
|
|
90
|
-
handler: (event: {
|
|
91
|
-
|
|
90
|
+
handler: (event: {
|
|
91
|
+
elementType: 'expressCheckout';
|
|
92
|
+
error: StripeError;
|
|
93
|
+
}) => any
|
|
94
|
+
): StripeExpressCheckoutElement;
|
|
92
95
|
once(
|
|
93
96
|
eventType: 'loaderror',
|
|
94
|
-
handler: (event: {
|
|
95
|
-
|
|
97
|
+
handler: (event: {
|
|
98
|
+
elementType: 'expressCheckout';
|
|
99
|
+
error: StripeError;
|
|
100
|
+
}) => any
|
|
101
|
+
): StripeExpressCheckoutElement;
|
|
96
102
|
off(
|
|
97
103
|
eventType: 'loaderror',
|
|
98
|
-
handler?: (event: {
|
|
99
|
-
|
|
104
|
+
handler?: (event: {
|
|
105
|
+
elementType: 'expressCheckout';
|
|
106
|
+
error: StripeError;
|
|
107
|
+
}) => any
|
|
108
|
+
): StripeExpressCheckoutElement;
|
|
100
109
|
|
|
101
110
|
/**
|
|
102
111
|
* Triggered when a buyer authorizes a payment within a supported payment method.
|
|
103
112
|
*/
|
|
104
113
|
on(
|
|
105
114
|
eventType: 'confirm',
|
|
106
|
-
handler: (event:
|
|
107
|
-
):
|
|
115
|
+
handler: (event: StripeExpressCheckoutElementConfirmEvent) => any
|
|
116
|
+
): StripeExpressCheckoutElement;
|
|
108
117
|
once(
|
|
109
118
|
eventType: 'confirm',
|
|
110
|
-
handler: (event:
|
|
111
|
-
):
|
|
119
|
+
handler: (event: StripeExpressCheckoutElementConfirmEvent) => any
|
|
120
|
+
): StripeExpressCheckoutElement;
|
|
112
121
|
off(
|
|
113
122
|
eventType: 'confirm',
|
|
114
|
-
handler?: (event:
|
|
115
|
-
):
|
|
123
|
+
handler?: (event: StripeExpressCheckoutElementConfirmEvent) => any
|
|
124
|
+
): StripeExpressCheckoutElement;
|
|
116
125
|
|
|
117
126
|
/**
|
|
118
127
|
* Triggered when a payment interface is dismissed (e.g., a buyer closes the payment interface)
|
|
119
128
|
*/
|
|
120
129
|
on(
|
|
121
130
|
eventType: 'cancel',
|
|
122
|
-
handler: (event: {elementType: '
|
|
123
|
-
):
|
|
131
|
+
handler: (event: {elementType: 'expressCheckout'}) => any
|
|
132
|
+
): StripeExpressCheckoutElement;
|
|
124
133
|
once(
|
|
125
134
|
eventType: 'cancel',
|
|
126
|
-
handler: (event: {elementType: '
|
|
127
|
-
):
|
|
135
|
+
handler: (event: {elementType: 'expressCheckout'}) => any
|
|
136
|
+
): StripeExpressCheckoutElement;
|
|
128
137
|
off(
|
|
129
138
|
eventType: 'cancel',
|
|
130
|
-
handler?: (event: {elementType: '
|
|
131
|
-
):
|
|
139
|
+
handler?: (event: {elementType: 'expressCheckout'}) => any
|
|
140
|
+
): StripeExpressCheckoutElement;
|
|
132
141
|
|
|
133
142
|
/**
|
|
134
143
|
* Triggered when a buyer selects a different shipping address.
|
|
135
144
|
*/
|
|
136
145
|
on(
|
|
137
146
|
eventType: 'shippingaddresschange',
|
|
138
|
-
handler: (
|
|
139
|
-
|
|
147
|
+
handler: (
|
|
148
|
+
event: StripeExpressCheckoutElementShippingAddressChangeEvent
|
|
149
|
+
) => any
|
|
150
|
+
): StripeExpressCheckoutElement;
|
|
140
151
|
once(
|
|
141
152
|
eventType: 'shippingaddresschange',
|
|
142
|
-
handler: (
|
|
143
|
-
|
|
153
|
+
handler: (
|
|
154
|
+
event: StripeExpressCheckoutElementShippingAddressChangeEvent
|
|
155
|
+
) => any
|
|
156
|
+
): StripeExpressCheckoutElement;
|
|
144
157
|
off(
|
|
145
158
|
eventType: 'shippingaddresschange',
|
|
146
|
-
handler?: (
|
|
147
|
-
|
|
159
|
+
handler?: (
|
|
160
|
+
event: StripeExpressCheckoutElementShippingAddressChangeEvent
|
|
161
|
+
) => any
|
|
162
|
+
): StripeExpressCheckoutElement;
|
|
148
163
|
|
|
149
164
|
/**
|
|
150
165
|
* Triggered when a buyer selects a different shipping rate.
|
|
151
166
|
*/
|
|
152
167
|
on(
|
|
153
168
|
eventType: 'shippingratechange',
|
|
154
|
-
handler: (event:
|
|
155
|
-
):
|
|
169
|
+
handler: (event: StripeExpressCheckoutElementShippingRateChangeEvent) => any
|
|
170
|
+
): StripeExpressCheckoutElement;
|
|
156
171
|
once(
|
|
157
172
|
eventType: 'shippingratechange',
|
|
158
|
-
handler: (event:
|
|
159
|
-
):
|
|
173
|
+
handler: (event: StripeExpressCheckoutElementShippingRateChangeEvent) => any
|
|
174
|
+
): StripeExpressCheckoutElement;
|
|
160
175
|
off(
|
|
161
176
|
eventType: 'shippingratechange',
|
|
162
|
-
handler?: (
|
|
163
|
-
|
|
177
|
+
handler?: (
|
|
178
|
+
event: StripeExpressCheckoutElementShippingRateChangeEvent
|
|
179
|
+
) => any
|
|
180
|
+
): StripeExpressCheckoutElement;
|
|
164
181
|
|
|
165
182
|
/**
|
|
166
|
-
* Updates the options the `
|
|
183
|
+
* Updates the options the `ExpressCheckoutElement` was initialized with.
|
|
167
184
|
* Updates are merged into the existing configuration.
|
|
168
185
|
*/
|
|
169
|
-
update(
|
|
186
|
+
update(
|
|
187
|
+
options: StripeExpressCheckoutElementUpdateOptions
|
|
188
|
+
): StripeExpressCheckoutElement;
|
|
170
189
|
};
|
|
171
190
|
|
|
172
|
-
export type PaymentMethodType = 'google_pay' | 'apple_pay';
|
|
191
|
+
export type PaymentMethodType = 'google_pay' | 'apple_pay' | 'link';
|
|
173
192
|
|
|
174
|
-
export type
|
|
193
|
+
export type ExpressCheckoutPartialAddress = {
|
|
175
194
|
city: string;
|
|
176
195
|
state: string;
|
|
177
196
|
postal_code: string;
|
|
178
197
|
country: string;
|
|
179
198
|
};
|
|
180
199
|
|
|
181
|
-
export type
|
|
200
|
+
export type ExpressCheckoutAddress = ExpressCheckoutPartialAddress & {
|
|
182
201
|
line1: string;
|
|
183
202
|
line2: string | null;
|
|
184
203
|
};
|
|
@@ -187,12 +206,12 @@ export type BillingDetails = {
|
|
|
187
206
|
name: string;
|
|
188
207
|
email?: string;
|
|
189
208
|
phone?: string;
|
|
190
|
-
address:
|
|
209
|
+
address: ExpressCheckoutAddress;
|
|
191
210
|
};
|
|
192
211
|
|
|
193
212
|
export type ShippingAddress = {
|
|
194
213
|
name: string;
|
|
195
|
-
address:
|
|
214
|
+
address: ExpressCheckoutAddress;
|
|
196
215
|
};
|
|
197
216
|
|
|
198
217
|
export type LineItem = {
|
|
@@ -226,11 +245,11 @@ export type LayoutOption =
|
|
|
226
245
|
visibleButtonCount?: number;
|
|
227
246
|
};
|
|
228
247
|
|
|
229
|
-
export type
|
|
248
|
+
export type ExpressCheckoutWalletOption = 'always' | 'auto' | 'never';
|
|
230
249
|
|
|
231
|
-
export type
|
|
232
|
-
applePay?:
|
|
233
|
-
googlePay?:
|
|
250
|
+
export type ExpressCheckoutWalletsOption = {
|
|
251
|
+
applePay?: ExpressCheckoutWalletOption;
|
|
252
|
+
googlePay?: ExpressCheckoutWalletOption;
|
|
234
253
|
};
|
|
235
254
|
|
|
236
255
|
export type ApplePayButtonTheme = 'black' | 'white' | 'white-outline';
|
|
@@ -273,7 +292,7 @@ export type ButtonTypeOption = {
|
|
|
273
292
|
googlePay?: GooglePayButtonType;
|
|
274
293
|
};
|
|
275
294
|
|
|
276
|
-
export interface
|
|
295
|
+
export interface StripeExpressCheckoutElementOptions {
|
|
277
296
|
/**
|
|
278
297
|
* Manually sets the height of the buttons shown.
|
|
279
298
|
*/
|
|
@@ -295,21 +314,21 @@ export interface StripePayButtonElementOptions {
|
|
|
295
314
|
layout?: LayoutOption;
|
|
296
315
|
|
|
297
316
|
/**
|
|
298
|
-
* Override the order in which payment methods are displayed in the
|
|
299
|
-
* By default, the
|
|
317
|
+
* Override the order in which payment methods are displayed in the Express Checkout Element.
|
|
318
|
+
* By default, the Express Checkout Element will use a dynamic ordering that optimizes payment method display for each user.
|
|
300
319
|
*/
|
|
301
320
|
paymentMethodOrder?: string[];
|
|
302
321
|
|
|
303
322
|
/**
|
|
304
|
-
* Control wallets display in the
|
|
323
|
+
* Control wallets display in the Express Checkout Element.
|
|
305
324
|
*/
|
|
306
|
-
wallets?:
|
|
325
|
+
wallets?: ExpressCheckoutWalletsOption;
|
|
307
326
|
}
|
|
308
327
|
|
|
309
328
|
/*
|
|
310
329
|
* Updatable options for an `Elements` instance
|
|
311
330
|
*/
|
|
312
|
-
export interface
|
|
331
|
+
export interface StripeExpressCheckoutElementUpdateOptions {
|
|
313
332
|
/**
|
|
314
333
|
* Manually sets the height of the buttons shown.
|
|
315
334
|
*/
|
|
@@ -322,7 +341,7 @@ export interface StripePayButtonElementUpdateOptions {
|
|
|
322
341
|
|
|
323
342
|
/**
|
|
324
343
|
* Override the order in which payment methods are displayed in the Pay Button Element.
|
|
325
|
-
* By default, the
|
|
344
|
+
* By default, the Express Checkout Element will use a dynamic ordering that optimizes payment method display for each user.
|
|
326
345
|
*/
|
|
327
346
|
paymentMethodOrder?: string[];
|
|
328
347
|
}
|
|
@@ -332,11 +351,11 @@ export type AvailablePaymentMethods = {
|
|
|
332
351
|
googlePay: boolean;
|
|
333
352
|
};
|
|
334
353
|
|
|
335
|
-
export interface
|
|
354
|
+
export interface StripeExpressCheckoutElementReadyEvent {
|
|
336
355
|
/**
|
|
337
356
|
* The type of element that emitted this event.
|
|
338
357
|
*/
|
|
339
|
-
elementType: '
|
|
358
|
+
elementType: 'expressCheckout';
|
|
340
359
|
|
|
341
360
|
/**
|
|
342
361
|
* The list of payment methods that could possibly show in the element, or undefined if no payment methods can show.
|
|
@@ -395,11 +414,11 @@ export type ClickResolveDetails = {
|
|
|
395
414
|
applePay?: ApplePayOption;
|
|
396
415
|
};
|
|
397
416
|
|
|
398
|
-
export interface
|
|
417
|
+
export interface StripeExpressCheckoutElementClickEvent {
|
|
399
418
|
/**
|
|
400
419
|
* The type of element that emitted this event.
|
|
401
420
|
*/
|
|
402
|
-
elementType: '
|
|
421
|
+
elementType: 'expressCheckout';
|
|
403
422
|
|
|
404
423
|
/**
|
|
405
424
|
* The payment method associated with the button that was clicked.
|
|
@@ -413,7 +432,7 @@ export interface StripePayButtonElementClickEvent {
|
|
|
413
432
|
resolve: (resolveDetails?: ClickResolveDetails) => void;
|
|
414
433
|
}
|
|
415
434
|
|
|
416
|
-
export interface
|
|
435
|
+
export interface StripeExpressCheckoutElementConfirmEvent {
|
|
417
436
|
/**
|
|
418
437
|
* Callback when a payment is unsuccessful. Optionally, specifying a reason will show a more detailed error in the payment interface.
|
|
419
438
|
*/
|
|
@@ -435,14 +454,14 @@ export type ChangeResolveDetails = {
|
|
|
435
454
|
shippingRates?: Array<ShippingRate>;
|
|
436
455
|
};
|
|
437
456
|
|
|
438
|
-
export interface
|
|
457
|
+
export interface StripeExpressCheckoutElementShippingAddressChangeEvent {
|
|
439
458
|
name: string;
|
|
440
|
-
address:
|
|
459
|
+
address: ExpressCheckoutPartialAddress;
|
|
441
460
|
resolve: (resolveDetails?: ChangeResolveDetails) => void;
|
|
442
461
|
reject: () => void;
|
|
443
462
|
}
|
|
444
463
|
|
|
445
|
-
export interface
|
|
464
|
+
export interface StripeExpressCheckoutElementShippingRateChangeEvent {
|
|
446
465
|
shippingRate: ShippingRate;
|
|
447
466
|
resolve: (resolveDetails?: ChangeResolveDetails) => void;
|
|
448
467
|
reject: () => void;
|
|
@@ -10,12 +10,12 @@ export * from './card-number';
|
|
|
10
10
|
export * from './card';
|
|
11
11
|
export * from './cart';
|
|
12
12
|
export * from './eps-bank';
|
|
13
|
+
export * from './express-checkout';
|
|
13
14
|
export * from './fpx-bank';
|
|
14
15
|
export * from './iban';
|
|
15
16
|
export * from './ideal-bank';
|
|
16
17
|
export * from './link-authentication';
|
|
17
18
|
export * from './p24-bank';
|
|
18
|
-
export * from './pay-button';
|
|
19
19
|
export * from './payment-request-button';
|
|
20
20
|
export * from './payment';
|
|
21
21
|
export * from './shipping-address';
|
|
@@ -9,6 +9,14 @@ export type StripeIssuingCardNumberDisplayElement = StripeElementBase & {
|
|
|
9
9
|
* This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices.
|
|
10
10
|
*/
|
|
11
11
|
update(options: Partial<StripeIssuingCardNumberDisplayElementOptions>): void;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Triggered when the element is fully rendered and can accept `element.focus` calls.
|
|
15
|
+
*/
|
|
16
|
+
on(
|
|
17
|
+
eventType: 'ready',
|
|
18
|
+
handler: (event: {elementType: 'issuingCardNumberDisplay'}) => any
|
|
19
|
+
): StripeIssuingCardNumberDisplayElement;
|
|
12
20
|
};
|
|
13
21
|
|
|
14
22
|
export interface StripeIssuingCardNumberDisplayElementOptions {
|
|
@@ -47,8 +47,8 @@ import {
|
|
|
47
47
|
StripeIssuingCardPinDisplayElementOptions,
|
|
48
48
|
StripeIssuingCardCopyButtonElement,
|
|
49
49
|
StripeIssuingCardCopyButtonElementOptions,
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
StripeExpressCheckoutElement,
|
|
51
|
+
StripeExpressCheckoutElementOptions,
|
|
52
52
|
} from './elements';
|
|
53
53
|
|
|
54
54
|
export interface StripeElements {
|
|
@@ -367,19 +367,19 @@ export interface StripeElements {
|
|
|
367
367
|
): StripeLinkAuthenticationElement | null;
|
|
368
368
|
|
|
369
369
|
/////////////////////////////
|
|
370
|
-
///
|
|
370
|
+
/// expressCheckout
|
|
371
371
|
/////////////////////////////
|
|
372
372
|
|
|
373
373
|
/**
|
|
374
374
|
* Requires beta access:
|
|
375
375
|
* Contact [Stripe support](https://support.stripe.com/) for more information.
|
|
376
376
|
*
|
|
377
|
-
* Creates a `
|
|
377
|
+
* Creates a `ExpressCheckoutElement`.
|
|
378
378
|
*/
|
|
379
379
|
create(
|
|
380
|
-
elementType: '
|
|
381
|
-
options?:
|
|
382
|
-
):
|
|
380
|
+
elementType: 'expressCheckout',
|
|
381
|
+
options?: StripeExpressCheckoutElementOptions
|
|
382
|
+
): StripeExpressCheckoutElement;
|
|
383
383
|
|
|
384
384
|
/**
|
|
385
385
|
* Requires beta access:
|
|
@@ -387,7 +387,9 @@ export interface StripeElements {
|
|
|
387
387
|
*
|
|
388
388
|
* Looks up a previously created `Element` by its type.
|
|
389
389
|
*/
|
|
390
|
-
getElement(
|
|
390
|
+
getElement(
|
|
391
|
+
elementType: 'expressCheckout'
|
|
392
|
+
): StripeExpressCheckoutElement | null;
|
|
391
393
|
|
|
392
394
|
/////////////////////////////
|
|
393
395
|
/// payment
|
|
@@ -520,11 +522,11 @@ export type StripeElementType =
|
|
|
520
522
|
| 'cardCvc'
|
|
521
523
|
| 'cart'
|
|
522
524
|
| 'epsBank'
|
|
525
|
+
| 'expressCheckout'
|
|
523
526
|
| 'fpxBank'
|
|
524
527
|
| 'iban'
|
|
525
528
|
| 'idealBank'
|
|
526
529
|
| 'p24Bank'
|
|
527
|
-
| 'payButton'
|
|
528
530
|
| 'payment'
|
|
529
531
|
| 'paymentMethodMessaging'
|
|
530
532
|
| 'paymentRequestButton'
|
|
@@ -551,7 +553,7 @@ export type StripeElement =
|
|
|
551
553
|
| StripeIbanElement
|
|
552
554
|
| StripeIdealBankElement
|
|
553
555
|
| StripeP24BankElement
|
|
554
|
-
|
|
|
556
|
+
| StripeExpressCheckoutElement
|
|
555
557
|
| StripePaymentElement
|
|
556
558
|
| StripePaymentMethodMessagingElement
|
|
557
559
|
| StripePaymentRequestButtonElement
|
|
@@ -580,10 +582,13 @@ export type StripeElementLocale =
|
|
|
580
582
|
| 'es-419'
|
|
581
583
|
| 'et'
|
|
582
584
|
| 'fi'
|
|
585
|
+
| 'fil'
|
|
583
586
|
| 'fr'
|
|
587
|
+
| 'fr-CA'
|
|
584
588
|
| 'fr-FR'
|
|
585
589
|
| 'he'
|
|
586
590
|
| 'hu'
|
|
591
|
+
| 'hr'
|
|
587
592
|
| 'id'
|
|
588
593
|
| 'it'
|
|
589
594
|
| 'it-IT'
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export * from './checkout';
|
|
2
2
|
export * from './elements';
|
|
3
3
|
export * from './elements-group';
|
|
4
|
+
export * from './ephemeral-keys';
|
|
5
|
+
export * from './financial-connections';
|
|
6
|
+
export * from './orders';
|
|
4
7
|
export * from './payment-intents';
|
|
5
8
|
export * from './payment-request';
|
|
6
9
|
export * from './setup-intents';
|
|
@@ -804,7 +804,7 @@ export interface Stripe {
|
|
|
804
804
|
verifyMicrodepositsForSetup(
|
|
805
805
|
clientSecret: string,
|
|
806
806
|
data?: setupIntents.VerifyMicrodepositsForSetupData
|
|
807
|
-
): Promise<
|
|
807
|
+
): Promise<SetupIntentResult>;
|
|
808
808
|
|
|
809
809
|
/**
|
|
810
810
|
* Use `stripe.collectBankAccountForSetup` in the [Save bank details](https://stripe.com/docs/payments/ach-debit/set-up-payment) flow for the [ACH Direct Debit](https://stripe.com/docs/payments/ach-debit)
|