@stripe/connect-js 3.3.16-beta-1 → 3.3.16
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/README.md +2 -3
- package/dist/connect.esm.js +29 -67
- package/dist/connect.js +29 -67
- package/dist/pure.esm.js +21 -59
- package/dist/pure.js +21 -59
- package/dist/src/shared.d.ts +1 -1
- package/dist/types/config.d.ts +47 -52
- package/package.json +2 -2
- package/src/shared.ts +13 -39
- package/types/config.ts +138 -66
- package/types/shared.d.ts +42 -17
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Calling `loadConnectAndInitialize` always loads the latest version of Connect.js
|
|
|
7
7
|
|
|
8
8
|
The embedded onboarding component is generally available now. Please refer to our [documentation](https://stripe.com/docs/connect/supported-embedded-components#account-onboarding) for more information.
|
|
9
9
|
|
|
10
|
-
Note:
|
|
10
|
+
Note: Some Connect embedded components are currently still in preview. These can be [viewed on our doc site](https://docs.stripe.com/connect/supported-embedded-components), where you can also request preview access.
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
@@ -20,8 +20,7 @@ npm install @stripe/connect-js
|
|
|
20
20
|
## Documentation
|
|
21
21
|
|
|
22
22
|
- [Connect embedded components](https://stripe.com/docs/connect/get-started-connect-embedded-components)
|
|
23
|
-
- [Quickstart guide
|
|
24
|
-
- [Quickstart guide for beta](https://stripe.com/docs/connect/connect-embedded-components/beta-quickstart)
|
|
23
|
+
- [Quickstart guide](https://stripe.com/docs/connect/connect-embedded-components/quickstart)
|
|
25
24
|
|
|
26
25
|
## Usage
|
|
27
26
|
|
package/dist/connect.esm.js
CHANGED
|
@@ -5,17 +5,14 @@ const ConnectElementCommonMethodConfig = {
|
|
|
5
5
|
setOnLoaderStart: _listener => {}
|
|
6
6
|
};
|
|
7
7
|
const ConnectElementCustomMethodConfig = {
|
|
8
|
-
"payment-details": {
|
|
9
|
-
setPayment: _payment => {},
|
|
10
|
-
setOnClose: _listener => {}
|
|
11
|
-
},
|
|
12
8
|
"account-onboarding": {
|
|
13
9
|
setFullTermsOfServiceUrl: _termOfServiceUrl => {},
|
|
14
10
|
setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
|
|
15
11
|
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
16
12
|
setSkipTermsOfServiceCollection: _skipTermsOfServiceCollection => {},
|
|
17
13
|
setCollectionOptions: _collectionOptions => {},
|
|
18
|
-
setOnExit: _listener => {}
|
|
14
|
+
setOnExit: _listener => {},
|
|
15
|
+
setOnStepChange: _listener => {}
|
|
19
16
|
},
|
|
20
17
|
"account-management": {
|
|
21
18
|
setCollectionOptions: _collectionOptions => {}
|
|
@@ -24,77 +21,42 @@ const ConnectElementCustomMethodConfig = {
|
|
|
24
21
|
setCollectionOptions: _collectionOptions => {},
|
|
25
22
|
setOnNotificationsChange: _listener => {}
|
|
26
23
|
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
setCardSwitching: _cardSwitching => {},
|
|
30
|
-
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
31
|
-
},
|
|
32
|
-
"issuing-cards-list": {
|
|
33
|
-
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
34
|
-
},
|
|
35
|
-
"financial-account": {
|
|
36
|
-
setFinancialAccount: _financialAccount => {}
|
|
24
|
+
payments: {
|
|
25
|
+
setDefaultFilters: _filters => {}
|
|
37
26
|
},
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"app-install": {
|
|
42
|
-
setApp: _app => {},
|
|
43
|
-
setOnAppInstallStateFetched: _listener => {},
|
|
44
|
-
setOnAppInstallStateChanged: _listener => {}
|
|
45
|
-
},
|
|
46
|
-
"app-viewport": {
|
|
47
|
-
setApp: _app => {},
|
|
48
|
-
setAppData: _appData => {}
|
|
49
|
-
},
|
|
50
|
-
"payment-method-settings": {
|
|
51
|
-
setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
|
|
52
|
-
},
|
|
53
|
-
"capital-financing": {
|
|
54
|
-
setDefaultFinancingOffer: _defaultFinancingOffer => {},
|
|
55
|
-
setShowFinancingSelector: _showFinancingSelector => {},
|
|
56
|
-
setFaqUrl: _faqUrl => {},
|
|
57
|
-
setSupportUrl: _supportUrl => {},
|
|
58
|
-
setOnFinancingsLoaded: _listener => {}
|
|
27
|
+
"payment-details": {
|
|
28
|
+
setPayment: _payment => {},
|
|
29
|
+
setOnClose: _listener => {}
|
|
59
30
|
},
|
|
60
|
-
"
|
|
61
|
-
|
|
31
|
+
"tax-settings": {
|
|
32
|
+
setHideProductTaxCodeSelector: _hidden => {},
|
|
33
|
+
setDisplayHeadOfficeCountries: _countries => {},
|
|
34
|
+
setOnTaxSettingsUpdated: _listener => {}
|
|
62
35
|
},
|
|
63
|
-
"
|
|
64
|
-
|
|
36
|
+
"tax-registrations": {
|
|
37
|
+
setOnAfterTaxRegistrationAdded: _listener => {},
|
|
38
|
+
setDisplayCountries: _countries => {}
|
|
65
39
|
}
|
|
66
40
|
};
|
|
67
41
|
|
|
68
42
|
const componentNameMapping = {
|
|
43
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
69
44
|
payments: "stripe-connect-payments",
|
|
70
|
-
payouts: "stripe-connect-payouts",
|
|
71
45
|
"payment-details": "stripe-connect-payment-details",
|
|
72
|
-
|
|
73
|
-
"
|
|
46
|
+
payouts: "stripe-connect-payouts",
|
|
47
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
48
|
+
balances: "stripe-connect-balances",
|
|
74
49
|
"account-management": "stripe-connect-account-management",
|
|
75
50
|
"notification-banner": "stripe-connect-notification-banner",
|
|
76
|
-
"instant-payouts": "stripe-connect-instant-payouts",
|
|
77
|
-
"issuing-card": "stripe-connect-issuing-card",
|
|
78
|
-
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
79
|
-
"financial-account": "stripe-connect-financial-account",
|
|
80
|
-
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
81
|
-
"capital-financing": "stripe-connect-capital-financing",
|
|
82
|
-
"capital-financing-application": "stripe-connect-capital-financing-application",
|
|
83
|
-
"capital-financing-promotion": "stripe-connect-capital-financing-promotion",
|
|
84
|
-
"capital-overview": "stripe-connect-capital-overview",
|
|
85
51
|
documents: "stripe-connect-documents",
|
|
86
52
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
87
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
88
|
-
balances: "stripe-connect-balances",
|
|
89
|
-
"payouts-list": "stripe-connect-payouts-list",
|
|
90
|
-
"app-install": "stripe-connect-app-install",
|
|
91
|
-
"app-viewport": "stripe-connect-app-viewport"
|
|
53
|
+
"tax-settings": "stripe-connect-tax-settings"
|
|
92
54
|
};
|
|
93
55
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
94
56
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
95
57
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
96
58
|
const findScript = () => {
|
|
97
|
-
return document.querySelectorAll(`script[src="${
|
|
59
|
+
return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
98
60
|
};
|
|
99
61
|
const injectScript = () => {
|
|
100
62
|
const script = document.createElement("script");
|
|
@@ -106,13 +68,13 @@ const injectScript = () => {
|
|
|
106
68
|
document.head.appendChild(script);
|
|
107
69
|
return script;
|
|
108
70
|
};
|
|
109
|
-
let stripePromise = null;
|
|
71
|
+
let stripePromise$1 = null;
|
|
110
72
|
const loadScript = () => {
|
|
111
73
|
// Ensure that we only attempt to load Connect.js at most once
|
|
112
|
-
if (stripePromise !== null) {
|
|
113
|
-
return stripePromise;
|
|
74
|
+
if (stripePromise$1 !== null) {
|
|
75
|
+
return stripePromise$1;
|
|
114
76
|
}
|
|
115
|
-
stripePromise = new Promise((resolve, reject) => {
|
|
77
|
+
stripePromise$1 = new Promise((resolve, reject) => {
|
|
116
78
|
if (typeof window === "undefined") {
|
|
117
79
|
reject("ConnectJS won't load when rendering code in the server - it can only be loaded on a browser. This error is expected when loading ConnectJS in SSR environments, like NextJS. It will have no impact in the UI, however if you wish to avoid it, you can switch to the `pure` version of the connect.js loader: https://github.com/stripe/connect-js#importing-loadconnect-without-side-effects.");
|
|
118
80
|
return;
|
|
@@ -147,7 +109,7 @@ const loadScript = () => {
|
|
|
147
109
|
reject(error);
|
|
148
110
|
}
|
|
149
111
|
});
|
|
150
|
-
return stripePromise;
|
|
112
|
+
return stripePromise$1;
|
|
151
113
|
};
|
|
152
114
|
const hasCustomMethod = tagName => {
|
|
153
115
|
return tagName in ConnectElementCustomMethodConfig;
|
|
@@ -231,7 +193,7 @@ const createWrapper = stripeConnect => {
|
|
|
231
193
|
sdk: true,
|
|
232
194
|
sdkOptions: {
|
|
233
195
|
// This will be replaced by the npm package version when bundling
|
|
234
|
-
sdkVersion: "3.3.
|
|
196
|
+
sdkVersion: "3.3.15"
|
|
235
197
|
}
|
|
236
198
|
})
|
|
237
199
|
}));
|
|
@@ -243,16 +205,16 @@ const createWrapper = stripeConnect => {
|
|
|
243
205
|
|
|
244
206
|
// Execute our own script injection after a tick to give users time to do their
|
|
245
207
|
// own script injection.
|
|
246
|
-
const stripePromise
|
|
208
|
+
const stripePromise = Promise.resolve().then(() => loadScript());
|
|
247
209
|
let loadCalled = false;
|
|
248
|
-
stripePromise
|
|
210
|
+
stripePromise.catch(err => {
|
|
249
211
|
if (!loadCalled) {
|
|
250
212
|
console.warn(err);
|
|
251
213
|
}
|
|
252
214
|
});
|
|
253
215
|
const loadConnectAndInitialize = initParams => {
|
|
254
216
|
loadCalled = true;
|
|
255
|
-
return initStripeConnect(stripePromise
|
|
217
|
+
return initStripeConnect(stripePromise, initParams);
|
|
256
218
|
};
|
|
257
219
|
|
|
258
220
|
export { loadConnectAndInitialize };
|
package/dist/connect.js
CHANGED
|
@@ -9,17 +9,14 @@ const ConnectElementCommonMethodConfig = {
|
|
|
9
9
|
setOnLoaderStart: _listener => {}
|
|
10
10
|
};
|
|
11
11
|
const ConnectElementCustomMethodConfig = {
|
|
12
|
-
"payment-details": {
|
|
13
|
-
setPayment: _payment => {},
|
|
14
|
-
setOnClose: _listener => {}
|
|
15
|
-
},
|
|
16
12
|
"account-onboarding": {
|
|
17
13
|
setFullTermsOfServiceUrl: _termOfServiceUrl => {},
|
|
18
14
|
setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
|
|
19
15
|
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
20
16
|
setSkipTermsOfServiceCollection: _skipTermsOfServiceCollection => {},
|
|
21
17
|
setCollectionOptions: _collectionOptions => {},
|
|
22
|
-
setOnExit: _listener => {}
|
|
18
|
+
setOnExit: _listener => {},
|
|
19
|
+
setOnStepChange: _listener => {}
|
|
23
20
|
},
|
|
24
21
|
"account-management": {
|
|
25
22
|
setCollectionOptions: _collectionOptions => {}
|
|
@@ -28,77 +25,42 @@ const ConnectElementCustomMethodConfig = {
|
|
|
28
25
|
setCollectionOptions: _collectionOptions => {},
|
|
29
26
|
setOnNotificationsChange: _listener => {}
|
|
30
27
|
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
setCardSwitching: _cardSwitching => {},
|
|
34
|
-
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
35
|
-
},
|
|
36
|
-
"issuing-cards-list": {
|
|
37
|
-
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
38
|
-
},
|
|
39
|
-
"financial-account": {
|
|
40
|
-
setFinancialAccount: _financialAccount => {}
|
|
28
|
+
payments: {
|
|
29
|
+
setDefaultFilters: _filters => {}
|
|
41
30
|
},
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"app-install": {
|
|
46
|
-
setApp: _app => {},
|
|
47
|
-
setOnAppInstallStateFetched: _listener => {},
|
|
48
|
-
setOnAppInstallStateChanged: _listener => {}
|
|
49
|
-
},
|
|
50
|
-
"app-viewport": {
|
|
51
|
-
setApp: _app => {},
|
|
52
|
-
setAppData: _appData => {}
|
|
53
|
-
},
|
|
54
|
-
"payment-method-settings": {
|
|
55
|
-
setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
|
|
56
|
-
},
|
|
57
|
-
"capital-financing": {
|
|
58
|
-
setDefaultFinancingOffer: _defaultFinancingOffer => {},
|
|
59
|
-
setShowFinancingSelector: _showFinancingSelector => {},
|
|
60
|
-
setFaqUrl: _faqUrl => {},
|
|
61
|
-
setSupportUrl: _supportUrl => {},
|
|
62
|
-
setOnFinancingsLoaded: _listener => {}
|
|
31
|
+
"payment-details": {
|
|
32
|
+
setPayment: _payment => {},
|
|
33
|
+
setOnClose: _listener => {}
|
|
63
34
|
},
|
|
64
|
-
"
|
|
65
|
-
|
|
35
|
+
"tax-settings": {
|
|
36
|
+
setHideProductTaxCodeSelector: _hidden => {},
|
|
37
|
+
setDisplayHeadOfficeCountries: _countries => {},
|
|
38
|
+
setOnTaxSettingsUpdated: _listener => {}
|
|
66
39
|
},
|
|
67
|
-
"
|
|
68
|
-
|
|
40
|
+
"tax-registrations": {
|
|
41
|
+
setOnAfterTaxRegistrationAdded: _listener => {},
|
|
42
|
+
setDisplayCountries: _countries => {}
|
|
69
43
|
}
|
|
70
44
|
};
|
|
71
45
|
|
|
72
46
|
const componentNameMapping = {
|
|
47
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
73
48
|
payments: "stripe-connect-payments",
|
|
74
|
-
payouts: "stripe-connect-payouts",
|
|
75
49
|
"payment-details": "stripe-connect-payment-details",
|
|
76
|
-
|
|
77
|
-
"
|
|
50
|
+
payouts: "stripe-connect-payouts",
|
|
51
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
52
|
+
balances: "stripe-connect-balances",
|
|
78
53
|
"account-management": "stripe-connect-account-management",
|
|
79
54
|
"notification-banner": "stripe-connect-notification-banner",
|
|
80
|
-
"instant-payouts": "stripe-connect-instant-payouts",
|
|
81
|
-
"issuing-card": "stripe-connect-issuing-card",
|
|
82
|
-
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
83
|
-
"financial-account": "stripe-connect-financial-account",
|
|
84
|
-
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
85
|
-
"capital-financing": "stripe-connect-capital-financing",
|
|
86
|
-
"capital-financing-application": "stripe-connect-capital-financing-application",
|
|
87
|
-
"capital-financing-promotion": "stripe-connect-capital-financing-promotion",
|
|
88
|
-
"capital-overview": "stripe-connect-capital-overview",
|
|
89
55
|
documents: "stripe-connect-documents",
|
|
90
56
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
91
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
92
|
-
balances: "stripe-connect-balances",
|
|
93
|
-
"payouts-list": "stripe-connect-payouts-list",
|
|
94
|
-
"app-install": "stripe-connect-app-install",
|
|
95
|
-
"app-viewport": "stripe-connect-app-viewport"
|
|
57
|
+
"tax-settings": "stripe-connect-tax-settings"
|
|
96
58
|
};
|
|
97
59
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
98
60
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
99
61
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
100
62
|
const findScript = () => {
|
|
101
|
-
return document.querySelectorAll(`script[src="${
|
|
63
|
+
return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
102
64
|
};
|
|
103
65
|
const injectScript = () => {
|
|
104
66
|
const script = document.createElement("script");
|
|
@@ -110,13 +72,13 @@ const injectScript = () => {
|
|
|
110
72
|
document.head.appendChild(script);
|
|
111
73
|
return script;
|
|
112
74
|
};
|
|
113
|
-
let stripePromise = null;
|
|
75
|
+
let stripePromise$1 = null;
|
|
114
76
|
const loadScript = () => {
|
|
115
77
|
// Ensure that we only attempt to load Connect.js at most once
|
|
116
|
-
if (stripePromise !== null) {
|
|
117
|
-
return stripePromise;
|
|
78
|
+
if (stripePromise$1 !== null) {
|
|
79
|
+
return stripePromise$1;
|
|
118
80
|
}
|
|
119
|
-
stripePromise = new Promise((resolve, reject) => {
|
|
81
|
+
stripePromise$1 = new Promise((resolve, reject) => {
|
|
120
82
|
if (typeof window === "undefined") {
|
|
121
83
|
reject("ConnectJS won't load when rendering code in the server - it can only be loaded on a browser. This error is expected when loading ConnectJS in SSR environments, like NextJS. It will have no impact in the UI, however if you wish to avoid it, you can switch to the `pure` version of the connect.js loader: https://github.com/stripe/connect-js#importing-loadconnect-without-side-effects.");
|
|
122
84
|
return;
|
|
@@ -151,7 +113,7 @@ const loadScript = () => {
|
|
|
151
113
|
reject(error);
|
|
152
114
|
}
|
|
153
115
|
});
|
|
154
|
-
return stripePromise;
|
|
116
|
+
return stripePromise$1;
|
|
155
117
|
};
|
|
156
118
|
const hasCustomMethod = tagName => {
|
|
157
119
|
return tagName in ConnectElementCustomMethodConfig;
|
|
@@ -235,7 +197,7 @@ const createWrapper = stripeConnect => {
|
|
|
235
197
|
sdk: true,
|
|
236
198
|
sdkOptions: {
|
|
237
199
|
// This will be replaced by the npm package version when bundling
|
|
238
|
-
sdkVersion: "3.3.
|
|
200
|
+
sdkVersion: "3.3.15"
|
|
239
201
|
}
|
|
240
202
|
})
|
|
241
203
|
}));
|
|
@@ -247,16 +209,16 @@ const createWrapper = stripeConnect => {
|
|
|
247
209
|
|
|
248
210
|
// Execute our own script injection after a tick to give users time to do their
|
|
249
211
|
// own script injection.
|
|
250
|
-
const stripePromise
|
|
212
|
+
const stripePromise = Promise.resolve().then(() => loadScript());
|
|
251
213
|
let loadCalled = false;
|
|
252
|
-
stripePromise
|
|
214
|
+
stripePromise.catch(err => {
|
|
253
215
|
if (!loadCalled) {
|
|
254
216
|
console.warn(err);
|
|
255
217
|
}
|
|
256
218
|
});
|
|
257
219
|
const loadConnectAndInitialize = initParams => {
|
|
258
220
|
loadCalled = true;
|
|
259
|
-
return initStripeConnect(stripePromise
|
|
221
|
+
return initStripeConnect(stripePromise, initParams);
|
|
260
222
|
};
|
|
261
223
|
|
|
262
224
|
exports.loadConnectAndInitialize = loadConnectAndInitialize;
|
package/dist/pure.esm.js
CHANGED
|
@@ -5,17 +5,14 @@ const ConnectElementCommonMethodConfig = {
|
|
|
5
5
|
setOnLoaderStart: _listener => {}
|
|
6
6
|
};
|
|
7
7
|
const ConnectElementCustomMethodConfig = {
|
|
8
|
-
"payment-details": {
|
|
9
|
-
setPayment: _payment => {},
|
|
10
|
-
setOnClose: _listener => {}
|
|
11
|
-
},
|
|
12
8
|
"account-onboarding": {
|
|
13
9
|
setFullTermsOfServiceUrl: _termOfServiceUrl => {},
|
|
14
10
|
setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
|
|
15
11
|
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
16
12
|
setSkipTermsOfServiceCollection: _skipTermsOfServiceCollection => {},
|
|
17
13
|
setCollectionOptions: _collectionOptions => {},
|
|
18
|
-
setOnExit: _listener => {}
|
|
14
|
+
setOnExit: _listener => {},
|
|
15
|
+
setOnStepChange: _listener => {}
|
|
19
16
|
},
|
|
20
17
|
"account-management": {
|
|
21
18
|
setCollectionOptions: _collectionOptions => {}
|
|
@@ -24,77 +21,42 @@ const ConnectElementCustomMethodConfig = {
|
|
|
24
21
|
setCollectionOptions: _collectionOptions => {},
|
|
25
22
|
setOnNotificationsChange: _listener => {}
|
|
26
23
|
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
setCardSwitching: _cardSwitching => {},
|
|
30
|
-
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
31
|
-
},
|
|
32
|
-
"issuing-cards-list": {
|
|
33
|
-
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
34
|
-
},
|
|
35
|
-
"financial-account": {
|
|
36
|
-
setFinancialAccount: _financialAccount => {}
|
|
24
|
+
payments: {
|
|
25
|
+
setDefaultFilters: _filters => {}
|
|
37
26
|
},
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"app-install": {
|
|
42
|
-
setApp: _app => {},
|
|
43
|
-
setOnAppInstallStateFetched: _listener => {},
|
|
44
|
-
setOnAppInstallStateChanged: _listener => {}
|
|
45
|
-
},
|
|
46
|
-
"app-viewport": {
|
|
47
|
-
setApp: _app => {},
|
|
48
|
-
setAppData: _appData => {}
|
|
49
|
-
},
|
|
50
|
-
"payment-method-settings": {
|
|
51
|
-
setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
|
|
52
|
-
},
|
|
53
|
-
"capital-financing": {
|
|
54
|
-
setDefaultFinancingOffer: _defaultFinancingOffer => {},
|
|
55
|
-
setShowFinancingSelector: _showFinancingSelector => {},
|
|
56
|
-
setFaqUrl: _faqUrl => {},
|
|
57
|
-
setSupportUrl: _supportUrl => {},
|
|
58
|
-
setOnFinancingsLoaded: _listener => {}
|
|
27
|
+
"payment-details": {
|
|
28
|
+
setPayment: _payment => {},
|
|
29
|
+
setOnClose: _listener => {}
|
|
59
30
|
},
|
|
60
|
-
"
|
|
61
|
-
|
|
31
|
+
"tax-settings": {
|
|
32
|
+
setHideProductTaxCodeSelector: _hidden => {},
|
|
33
|
+
setDisplayHeadOfficeCountries: _countries => {},
|
|
34
|
+
setOnTaxSettingsUpdated: _listener => {}
|
|
62
35
|
},
|
|
63
|
-
"
|
|
64
|
-
|
|
36
|
+
"tax-registrations": {
|
|
37
|
+
setOnAfterTaxRegistrationAdded: _listener => {},
|
|
38
|
+
setDisplayCountries: _countries => {}
|
|
65
39
|
}
|
|
66
40
|
};
|
|
67
41
|
|
|
68
42
|
const componentNameMapping = {
|
|
43
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
69
44
|
payments: "stripe-connect-payments",
|
|
70
|
-
payouts: "stripe-connect-payouts",
|
|
71
45
|
"payment-details": "stripe-connect-payment-details",
|
|
72
|
-
|
|
73
|
-
"
|
|
46
|
+
payouts: "stripe-connect-payouts",
|
|
47
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
48
|
+
balances: "stripe-connect-balances",
|
|
74
49
|
"account-management": "stripe-connect-account-management",
|
|
75
50
|
"notification-banner": "stripe-connect-notification-banner",
|
|
76
|
-
"instant-payouts": "stripe-connect-instant-payouts",
|
|
77
|
-
"issuing-card": "stripe-connect-issuing-card",
|
|
78
|
-
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
79
|
-
"financial-account": "stripe-connect-financial-account",
|
|
80
|
-
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
81
|
-
"capital-financing": "stripe-connect-capital-financing",
|
|
82
|
-
"capital-financing-application": "stripe-connect-capital-financing-application",
|
|
83
|
-
"capital-financing-promotion": "stripe-connect-capital-financing-promotion",
|
|
84
|
-
"capital-overview": "stripe-connect-capital-overview",
|
|
85
51
|
documents: "stripe-connect-documents",
|
|
86
52
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
87
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
88
|
-
balances: "stripe-connect-balances",
|
|
89
|
-
"payouts-list": "stripe-connect-payouts-list",
|
|
90
|
-
"app-install": "stripe-connect-app-install",
|
|
91
|
-
"app-viewport": "stripe-connect-app-viewport"
|
|
53
|
+
"tax-settings": "stripe-connect-tax-settings"
|
|
92
54
|
};
|
|
93
55
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
94
56
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
95
57
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
96
58
|
const findScript = () => {
|
|
97
|
-
return document.querySelectorAll(`script[src="${
|
|
59
|
+
return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
98
60
|
};
|
|
99
61
|
const injectScript = () => {
|
|
100
62
|
const script = document.createElement("script");
|
|
@@ -231,7 +193,7 @@ const createWrapper = stripeConnect => {
|
|
|
231
193
|
sdk: true,
|
|
232
194
|
sdkOptions: {
|
|
233
195
|
// This will be replaced by the npm package version when bundling
|
|
234
|
-
sdkVersion: "3.3.
|
|
196
|
+
sdkVersion: "3.3.15"
|
|
235
197
|
}
|
|
236
198
|
})
|
|
237
199
|
}));
|
package/dist/pure.js
CHANGED
|
@@ -9,17 +9,14 @@ const ConnectElementCommonMethodConfig = {
|
|
|
9
9
|
setOnLoaderStart: _listener => {}
|
|
10
10
|
};
|
|
11
11
|
const ConnectElementCustomMethodConfig = {
|
|
12
|
-
"payment-details": {
|
|
13
|
-
setPayment: _payment => {},
|
|
14
|
-
setOnClose: _listener => {}
|
|
15
|
-
},
|
|
16
12
|
"account-onboarding": {
|
|
17
13
|
setFullTermsOfServiceUrl: _termOfServiceUrl => {},
|
|
18
14
|
setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
|
|
19
15
|
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
20
16
|
setSkipTermsOfServiceCollection: _skipTermsOfServiceCollection => {},
|
|
21
17
|
setCollectionOptions: _collectionOptions => {},
|
|
22
|
-
setOnExit: _listener => {}
|
|
18
|
+
setOnExit: _listener => {},
|
|
19
|
+
setOnStepChange: _listener => {}
|
|
23
20
|
},
|
|
24
21
|
"account-management": {
|
|
25
22
|
setCollectionOptions: _collectionOptions => {}
|
|
@@ -28,77 +25,42 @@ const ConnectElementCustomMethodConfig = {
|
|
|
28
25
|
setCollectionOptions: _collectionOptions => {},
|
|
29
26
|
setOnNotificationsChange: _listener => {}
|
|
30
27
|
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
setCardSwitching: _cardSwitching => {},
|
|
34
|
-
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
35
|
-
},
|
|
36
|
-
"issuing-cards-list": {
|
|
37
|
-
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
38
|
-
},
|
|
39
|
-
"financial-account": {
|
|
40
|
-
setFinancialAccount: _financialAccount => {}
|
|
28
|
+
payments: {
|
|
29
|
+
setDefaultFilters: _filters => {}
|
|
41
30
|
},
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"app-install": {
|
|
46
|
-
setApp: _app => {},
|
|
47
|
-
setOnAppInstallStateFetched: _listener => {},
|
|
48
|
-
setOnAppInstallStateChanged: _listener => {}
|
|
49
|
-
},
|
|
50
|
-
"app-viewport": {
|
|
51
|
-
setApp: _app => {},
|
|
52
|
-
setAppData: _appData => {}
|
|
53
|
-
},
|
|
54
|
-
"payment-method-settings": {
|
|
55
|
-
setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
|
|
56
|
-
},
|
|
57
|
-
"capital-financing": {
|
|
58
|
-
setDefaultFinancingOffer: _defaultFinancingOffer => {},
|
|
59
|
-
setShowFinancingSelector: _showFinancingSelector => {},
|
|
60
|
-
setFaqUrl: _faqUrl => {},
|
|
61
|
-
setSupportUrl: _supportUrl => {},
|
|
62
|
-
setOnFinancingsLoaded: _listener => {}
|
|
31
|
+
"payment-details": {
|
|
32
|
+
setPayment: _payment => {},
|
|
33
|
+
setOnClose: _listener => {}
|
|
63
34
|
},
|
|
64
|
-
"
|
|
65
|
-
|
|
35
|
+
"tax-settings": {
|
|
36
|
+
setHideProductTaxCodeSelector: _hidden => {},
|
|
37
|
+
setDisplayHeadOfficeCountries: _countries => {},
|
|
38
|
+
setOnTaxSettingsUpdated: _listener => {}
|
|
66
39
|
},
|
|
67
|
-
"
|
|
68
|
-
|
|
40
|
+
"tax-registrations": {
|
|
41
|
+
setOnAfterTaxRegistrationAdded: _listener => {},
|
|
42
|
+
setDisplayCountries: _countries => {}
|
|
69
43
|
}
|
|
70
44
|
};
|
|
71
45
|
|
|
72
46
|
const componentNameMapping = {
|
|
47
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
73
48
|
payments: "stripe-connect-payments",
|
|
74
|
-
payouts: "stripe-connect-payouts",
|
|
75
49
|
"payment-details": "stripe-connect-payment-details",
|
|
76
|
-
|
|
77
|
-
"
|
|
50
|
+
payouts: "stripe-connect-payouts",
|
|
51
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
52
|
+
balances: "stripe-connect-balances",
|
|
78
53
|
"account-management": "stripe-connect-account-management",
|
|
79
54
|
"notification-banner": "stripe-connect-notification-banner",
|
|
80
|
-
"instant-payouts": "stripe-connect-instant-payouts",
|
|
81
|
-
"issuing-card": "stripe-connect-issuing-card",
|
|
82
|
-
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
83
|
-
"financial-account": "stripe-connect-financial-account",
|
|
84
|
-
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
85
|
-
"capital-financing": "stripe-connect-capital-financing",
|
|
86
|
-
"capital-financing-application": "stripe-connect-capital-financing-application",
|
|
87
|
-
"capital-financing-promotion": "stripe-connect-capital-financing-promotion",
|
|
88
|
-
"capital-overview": "stripe-connect-capital-overview",
|
|
89
55
|
documents: "stripe-connect-documents",
|
|
90
56
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
91
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
92
|
-
balances: "stripe-connect-balances",
|
|
93
|
-
"payouts-list": "stripe-connect-payouts-list",
|
|
94
|
-
"app-install": "stripe-connect-app-install",
|
|
95
|
-
"app-viewport": "stripe-connect-app-viewport"
|
|
57
|
+
"tax-settings": "stripe-connect-tax-settings"
|
|
96
58
|
};
|
|
97
59
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
98
60
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
99
61
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
100
62
|
const findScript = () => {
|
|
101
|
-
return document.querySelectorAll(`script[src="${
|
|
63
|
+
return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
102
64
|
};
|
|
103
65
|
const injectScript = () => {
|
|
104
66
|
const script = document.createElement("script");
|
|
@@ -235,7 +197,7 @@ const createWrapper = stripeConnect => {
|
|
|
235
197
|
sdk: true,
|
|
236
198
|
sdkOptions: {
|
|
237
199
|
// This will be replaced by the npm package version when bundling
|
|
238
|
-
sdkVersion: "3.3.
|
|
200
|
+
sdkVersion: "3.3.15"
|
|
239
201
|
}
|
|
240
202
|
})
|
|
241
203
|
}));
|
package/dist/src/shared.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IStripeConnectInitParams, StripeConnectInstance, ConnectElementTagName } from "../types";
|
|
2
2
|
export type LoadConnectAndInitialize = (initParams: IStripeConnectInitParams) => StripeConnectInstance;
|
|
3
|
-
|
|
3
|
+
type ConnectElementHTMLName = "stripe-connect-account-onboarding" | "stripe-connect-payments" | "stripe-connect-payment-details" | "stripe-connect-account-management" | "stripe-connect-notification-banner" | "stripe-connect-payouts" | "stripe-connect-payouts-list" | "stripe-connect-balances" | "stripe-connect-documents" | "stripe-connect-tax-registrations" | "stripe-connect-tax-settings";
|
|
4
4
|
export declare const componentNameMapping: Record<ConnectElementTagName, ConnectElementHTMLName>;
|
|
5
5
|
type StripeConnectInstanceExtended = StripeConnectInstance & {
|
|
6
6
|
debugInstance: () => Promise<StripeConnectInstance>;
|
package/dist/types/config.d.ts
CHANGED
|
@@ -1,23 +1,39 @@
|
|
|
1
|
-
export type FetchEphemeralKeyFunction = (fetchParams: {
|
|
2
|
-
issuingCard: string;
|
|
3
|
-
nonce: string;
|
|
4
|
-
}) => Promise<{
|
|
5
|
-
issuingCard: string;
|
|
6
|
-
nonce: string;
|
|
7
|
-
ephemeralKeySecret: string;
|
|
8
|
-
}>;
|
|
9
1
|
export type CollectionOptions = {
|
|
10
2
|
fields: "currently_due" | "eventually_due";
|
|
11
3
|
futureRequirements?: "omit" | "include";
|
|
12
4
|
};
|
|
5
|
+
export type Status = "blocked" | "canceled" | "disputed" | "early_fraud_warning" | "failed" | "incomplete" | "partially_refunded" | "pending" | "refund_pending" | "refunded" | "successful" | "uncaptured";
|
|
6
|
+
export type PaymentMethod = "ach_credit_transfer" | "ach_debit" | "acss_debit" | "affirm" | "afterpay_clearpay" | "alipay" | "alma" | "amazon_pay" | "amex_express_checkout" | "android_pay" | "apple_pay" | "au_becs_debit" | "nz_bank_account" | "bancontact" | "bacs_debit" | "bitcoin_source" | "bitcoin" | "blik" | "boleto" | "boleto_pilot" | "card_present" | "card" | "cashapp" | "crypto" | "customer_balance" | "demo_pay" | "dummy_passthrough_card" | "gbp_credit_transfer" | "google_pay" | "eps" | "fpx" | "giropay" | "grabpay" | "ideal" | "id_bank_transfer" | "id_credit_transfer" | "jp_credit_transfer" | "interac_present" | "kakao_pay" | "klarna" | "konbini" | "kr_card" | "kr_market" | "link" | "masterpass" | "mb_way" | "meta_pay" | "multibanco" | "mobilepay" | "naver_pay" | "netbanking" | "ng_bank" | "ng_bank_transfer" | "ng_card" | "ng_market" | "ng_ussd" | "vipps" | "oxxo" | "p24" | "payto" | "pay_by_bank" | "paper_check" | "payco" | "paynow" | "paypal" | "pix" | "promptpay" | "revolut_pay" | "samsung_pay" | "sepa_credit_transfer" | "sepa_debit" | "sofort" | "south_korea_market" | "swish" | "three_d_secure" | "three_d_secure_2" | "three_d_secure_2_eap" | "twint" | "upi" | "us_bank_account" | "visa_checkout" | "wechat" | "wechat_pay" | "zip";
|
|
7
|
+
export type PaymentsListDefaultFilters = {
|
|
8
|
+
amount?: {
|
|
9
|
+
equals: number;
|
|
10
|
+
} | {
|
|
11
|
+
greaterThan: number;
|
|
12
|
+
} | {
|
|
13
|
+
lessThan: number;
|
|
14
|
+
} | {
|
|
15
|
+
between: {
|
|
16
|
+
lowerBound: number;
|
|
17
|
+
upperBound: number;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
date?: {
|
|
21
|
+
before: Date;
|
|
22
|
+
} | {
|
|
23
|
+
after: Date;
|
|
24
|
+
} | {
|
|
25
|
+
between: {
|
|
26
|
+
start: Date;
|
|
27
|
+
end: Date;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
status?: Array<Status>;
|
|
31
|
+
paymentMethod?: PaymentMethod;
|
|
32
|
+
};
|
|
13
33
|
export type NotificationCount = {
|
|
14
34
|
total: number;
|
|
15
35
|
actionRequired: number;
|
|
16
36
|
};
|
|
17
|
-
export type InstallState = {
|
|
18
|
-
appId: string;
|
|
19
|
-
state: "INSTALLED" | "UNINSTALLED";
|
|
20
|
-
};
|
|
21
37
|
export type LoaderStart = {
|
|
22
38
|
elementTagName: string;
|
|
23
39
|
};
|
|
@@ -25,6 +41,9 @@ export type LoadError = {
|
|
|
25
41
|
elementTagName: string;
|
|
26
42
|
error: EmbeddedError;
|
|
27
43
|
};
|
|
44
|
+
export type StepChange = {
|
|
45
|
+
step: string;
|
|
46
|
+
};
|
|
28
47
|
export type EmbeddedError = {
|
|
29
48
|
type: EmbeddedErrorType;
|
|
30
49
|
message?: string;
|
|
@@ -59,10 +78,6 @@ export declare const ConnectElementCommonMethodConfig: {
|
|
|
59
78
|
setOnLoaderStart: (_listener: (({ elementTagName }: LoaderStart) => void) | undefined) => void;
|
|
60
79
|
};
|
|
61
80
|
export declare const ConnectElementCustomMethodConfig: {
|
|
62
|
-
"payment-details": {
|
|
63
|
-
setPayment: (_payment: string | undefined) => void;
|
|
64
|
-
setOnClose: (_listener: (() => void) | undefined) => void;
|
|
65
|
-
};
|
|
66
81
|
"account-onboarding": {
|
|
67
82
|
setFullTermsOfServiceUrl: (_termOfServiceUrl: string | undefined) => void;
|
|
68
83
|
setRecipientTermsOfServiceUrl: (_recipientTermsOfServiceUrl: string | undefined) => void;
|
|
@@ -70,6 +85,7 @@ export declare const ConnectElementCustomMethodConfig: {
|
|
|
70
85
|
setSkipTermsOfServiceCollection: (_skipTermsOfServiceCollection: boolean | undefined) => void;
|
|
71
86
|
setCollectionOptions: (_collectionOptions: CollectionOptions | undefined) => void;
|
|
72
87
|
setOnExit: (_listener: (() => void) | undefined) => void;
|
|
88
|
+
setOnStepChange: (_listener: (({ step }: StepChange) => void) | undefined) => void;
|
|
73
89
|
};
|
|
74
90
|
"account-management": {
|
|
75
91
|
setCollectionOptions: (_collectionOptions: CollectionOptions | undefined) => void;
|
|
@@ -78,45 +94,24 @@ export declare const ConnectElementCustomMethodConfig: {
|
|
|
78
94
|
setCollectionOptions: (_collectionOptions: CollectionOptions | undefined) => void;
|
|
79
95
|
setOnNotificationsChange: (_listener: (({ total, actionRequired }: NotificationCount) => void) | undefined) => void;
|
|
80
96
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
setCardSwitching: (_cardSwitching: boolean | undefined) => void;
|
|
84
|
-
setFetchEphemeralKey: (_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined) => void;
|
|
85
|
-
};
|
|
86
|
-
"issuing-cards-list": {
|
|
87
|
-
setFetchEphemeralKey: (_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined) => void;
|
|
97
|
+
payments: {
|
|
98
|
+
setDefaultFilters: (_filters: PaymentsListDefaultFilters | undefined) => void;
|
|
88
99
|
};
|
|
89
|
-
"
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"financial-account-transactions": {
|
|
93
|
-
setFinancialAccount: (_financialAccount: string) => void;
|
|
94
|
-
};
|
|
95
|
-
"app-install": {
|
|
96
|
-
setApp: (_app: string | undefined) => void;
|
|
97
|
-
setOnAppInstallStateFetched: (_listener: (({ appId, state }: InstallState) => void) | undefined) => void;
|
|
98
|
-
setOnAppInstallStateChanged: (_listener: (({ appId, state }: InstallState) => void) | undefined) => void;
|
|
99
|
-
};
|
|
100
|
-
"app-viewport": {
|
|
101
|
-
setApp: (_app: string | undefined) => void;
|
|
102
|
-
setAppData: (_appData: Record<string, string> | undefined) => void;
|
|
103
|
-
};
|
|
104
|
-
"payment-method-settings": {
|
|
105
|
-
setPaymentMethodConfiguration: (_paymentMethodConfiguration: string | undefined) => void;
|
|
100
|
+
"payment-details": {
|
|
101
|
+
setPayment: (_payment: string | undefined) => void;
|
|
102
|
+
setOnClose: (_listener: (() => void) | undefined) => void;
|
|
106
103
|
};
|
|
107
|
-
"
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
setOnFinancingsLoaded: (_listener: (({ total }: {
|
|
113
|
-
total: number;
|
|
104
|
+
"tax-settings": {
|
|
105
|
+
setHideProductTaxCodeSelector: (_hidden: boolean | undefined) => void;
|
|
106
|
+
setDisplayHeadOfficeCountries: (_countries: string[] | undefined) => void;
|
|
107
|
+
setOnTaxSettingsUpdated: (_listener: (({ id }: {
|
|
108
|
+
id: string;
|
|
114
109
|
}) => void) | undefined) => void;
|
|
115
110
|
};
|
|
116
|
-
"
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
111
|
+
"tax-registrations": {
|
|
112
|
+
setOnAfterTaxRegistrationAdded: (_listener: (({ id }: {
|
|
113
|
+
id: string;
|
|
114
|
+
}) => void) | undefined) => void;
|
|
115
|
+
setDisplayCountries: (_countries: string[] | undefined) => void;
|
|
121
116
|
};
|
|
122
117
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stripe/connect-js",
|
|
3
|
-
"version": "3.3.16
|
|
3
|
+
"version": "3.3.16",
|
|
4
4
|
"description": "Connect.js loading utility package",
|
|
5
5
|
"main": "dist/connect.js",
|
|
6
6
|
"module": "dist/connect.esm.js",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"jest-environment-jsdom": "^29.5.0",
|
|
60
60
|
"prettier": "^1.19.1",
|
|
61
61
|
"rimraf": "^2.6.2",
|
|
62
|
-
"rollup": "^
|
|
62
|
+
"rollup": "^2.79.2",
|
|
63
63
|
"rollup-plugin-babel": "^4.4.0",
|
|
64
64
|
"rollup-plugin-typescript2": "^0.25.3",
|
|
65
65
|
"ts-jest": "^29.1.0",
|
package/src/shared.ts
CHANGED
|
@@ -13,60 +13,34 @@ export type LoadConnectAndInitialize = (
|
|
|
13
13
|
initParams: IStripeConnectInitParams
|
|
14
14
|
) => StripeConnectInstance;
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
type ConnectElementHTMLName =
|
|
17
|
+
| "stripe-connect-account-onboarding"
|
|
17
18
|
| "stripe-connect-payments"
|
|
18
|
-
| "stripe-connect-payouts"
|
|
19
19
|
| "stripe-connect-payment-details"
|
|
20
|
-
| "stripe-connect-account-onboarding"
|
|
21
|
-
| "stripe-connect-payment-method-settings"
|
|
22
20
|
| "stripe-connect-account-management"
|
|
23
21
|
| "stripe-connect-notification-banner"
|
|
24
|
-
| "stripe-connect-
|
|
25
|
-
| "stripe-connect-
|
|
26
|
-
| "stripe-connect-
|
|
27
|
-
| "stripe-connect-financial-account"
|
|
28
|
-
| "stripe-connect-financial-account-transactions"
|
|
29
|
-
| "stripe-connect-capital-financing"
|
|
30
|
-
| "stripe-connect-capital-financing-application"
|
|
31
|
-
| "stripe-connect-capital-financing-promotion"
|
|
32
|
-
| "stripe-connect-capital-overview"
|
|
22
|
+
| "stripe-connect-payouts"
|
|
23
|
+
| "stripe-connect-payouts-list"
|
|
24
|
+
| "stripe-connect-balances"
|
|
33
25
|
| "stripe-connect-documents"
|
|
34
26
|
| "stripe-connect-tax-registrations"
|
|
35
|
-
| "stripe-connect-tax-settings"
|
|
36
|
-
| "stripe-connect-balances"
|
|
37
|
-
| "stripe-connect-payouts-list"
|
|
38
|
-
| "stripe-connect-app-install"
|
|
39
|
-
| "stripe-connect-app-viewport";
|
|
27
|
+
| "stripe-connect-tax-settings";
|
|
40
28
|
|
|
41
29
|
export const componentNameMapping: Record<
|
|
42
30
|
ConnectElementTagName,
|
|
43
31
|
ConnectElementHTMLName
|
|
44
32
|
> = {
|
|
33
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
45
34
|
payments: "stripe-connect-payments",
|
|
46
|
-
payouts: "stripe-connect-payouts",
|
|
47
35
|
"payment-details": "stripe-connect-payment-details",
|
|
48
|
-
|
|
49
|
-
"
|
|
36
|
+
payouts: "stripe-connect-payouts",
|
|
37
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
38
|
+
balances: "stripe-connect-balances",
|
|
50
39
|
"account-management": "stripe-connect-account-management",
|
|
51
40
|
"notification-banner": "stripe-connect-notification-banner",
|
|
52
|
-
"instant-payouts": "stripe-connect-instant-payouts",
|
|
53
|
-
"issuing-card": "stripe-connect-issuing-card",
|
|
54
|
-
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
55
|
-
"financial-account": "stripe-connect-financial-account",
|
|
56
|
-
"financial-account-transactions":
|
|
57
|
-
"stripe-connect-financial-account-transactions",
|
|
58
|
-
"capital-financing": "stripe-connect-capital-financing",
|
|
59
|
-
"capital-financing-application":
|
|
60
|
-
"stripe-connect-capital-financing-application",
|
|
61
|
-
"capital-financing-promotion": "stripe-connect-capital-financing-promotion",
|
|
62
|
-
"capital-overview": "stripe-connect-capital-overview",
|
|
63
41
|
documents: "stripe-connect-documents",
|
|
64
42
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
65
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
66
|
-
balances: "stripe-connect-balances",
|
|
67
|
-
"payouts-list": "stripe-connect-payouts-list",
|
|
68
|
-
"app-install": "stripe-connect-app-install",
|
|
69
|
-
"app-viewport": "stripe-connect-app-viewport"
|
|
43
|
+
"tax-settings": "stripe-connect-tax-settings"
|
|
70
44
|
};
|
|
71
45
|
|
|
72
46
|
type StripeConnectInstanceExtended = StripeConnectInstance & {
|
|
@@ -85,10 +59,10 @@ const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
|
85
59
|
export const findScript = (): HTMLScriptElement | null => {
|
|
86
60
|
return (
|
|
87
61
|
document.querySelectorAll<HTMLScriptElement>(
|
|
88
|
-
`script[src="${
|
|
62
|
+
`script[src="${V1_URL}"]`
|
|
89
63
|
)[0] ||
|
|
90
64
|
document.querySelectorAll<HTMLScriptElement>(
|
|
91
|
-
`script[src="${
|
|
65
|
+
`script[src="${V0_URL}"]`
|
|
92
66
|
)[0] ||
|
|
93
67
|
null
|
|
94
68
|
);
|
package/types/config.ts
CHANGED
|
@@ -1,30 +1,130 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
3
3
|
|
|
4
|
-
export type FetchEphemeralKeyFunction = (fetchParams: {
|
|
5
|
-
issuingCard: string;
|
|
6
|
-
nonce: string;
|
|
7
|
-
}) => Promise<{
|
|
8
|
-
issuingCard: string;
|
|
9
|
-
nonce: string;
|
|
10
|
-
ephemeralKeySecret: string;
|
|
11
|
-
}>;
|
|
12
|
-
|
|
13
4
|
export type CollectionOptions = {
|
|
14
5
|
fields: "currently_due" | "eventually_due";
|
|
15
6
|
futureRequirements?: "omit" | "include";
|
|
16
7
|
};
|
|
17
8
|
|
|
9
|
+
export type Status =
|
|
10
|
+
| "blocked"
|
|
11
|
+
| "canceled"
|
|
12
|
+
| "disputed"
|
|
13
|
+
| "early_fraud_warning"
|
|
14
|
+
| "failed"
|
|
15
|
+
| "incomplete"
|
|
16
|
+
| "partially_refunded"
|
|
17
|
+
| "pending"
|
|
18
|
+
| "refund_pending"
|
|
19
|
+
| "refunded"
|
|
20
|
+
| "successful"
|
|
21
|
+
| "uncaptured";
|
|
22
|
+
|
|
23
|
+
export type PaymentMethod =
|
|
24
|
+
| "ach_credit_transfer"
|
|
25
|
+
| "ach_debit"
|
|
26
|
+
| "acss_debit"
|
|
27
|
+
| "affirm"
|
|
28
|
+
| "afterpay_clearpay"
|
|
29
|
+
| "alipay"
|
|
30
|
+
| "alma"
|
|
31
|
+
| "amazon_pay"
|
|
32
|
+
| "amex_express_checkout"
|
|
33
|
+
| "android_pay"
|
|
34
|
+
| "apple_pay"
|
|
35
|
+
| "au_becs_debit"
|
|
36
|
+
| "nz_bank_account"
|
|
37
|
+
| "bancontact"
|
|
38
|
+
| "bacs_debit"
|
|
39
|
+
| "bitcoin_source"
|
|
40
|
+
| "bitcoin"
|
|
41
|
+
| "blik"
|
|
42
|
+
| "boleto"
|
|
43
|
+
| "boleto_pilot"
|
|
44
|
+
| "card_present"
|
|
45
|
+
| "card"
|
|
46
|
+
| "cashapp"
|
|
47
|
+
| "crypto"
|
|
48
|
+
| "customer_balance"
|
|
49
|
+
| "demo_pay"
|
|
50
|
+
| "dummy_passthrough_card"
|
|
51
|
+
| "gbp_credit_transfer"
|
|
52
|
+
| "google_pay"
|
|
53
|
+
| "eps"
|
|
54
|
+
| "fpx"
|
|
55
|
+
| "giropay"
|
|
56
|
+
| "grabpay"
|
|
57
|
+
| "ideal"
|
|
58
|
+
| "id_bank_transfer"
|
|
59
|
+
| "id_credit_transfer"
|
|
60
|
+
| "jp_credit_transfer"
|
|
61
|
+
| "interac_present"
|
|
62
|
+
| "kakao_pay"
|
|
63
|
+
| "klarna"
|
|
64
|
+
| "konbini"
|
|
65
|
+
| "kr_card"
|
|
66
|
+
| "kr_market"
|
|
67
|
+
| "link"
|
|
68
|
+
| "masterpass"
|
|
69
|
+
| "mb_way"
|
|
70
|
+
| "meta_pay"
|
|
71
|
+
| "multibanco"
|
|
72
|
+
| "mobilepay"
|
|
73
|
+
| "naver_pay"
|
|
74
|
+
| "netbanking"
|
|
75
|
+
| "ng_bank"
|
|
76
|
+
| "ng_bank_transfer"
|
|
77
|
+
| "ng_card"
|
|
78
|
+
| "ng_market"
|
|
79
|
+
| "ng_ussd"
|
|
80
|
+
| "vipps"
|
|
81
|
+
| "oxxo"
|
|
82
|
+
| "p24"
|
|
83
|
+
| "payto"
|
|
84
|
+
| "pay_by_bank"
|
|
85
|
+
| "paper_check"
|
|
86
|
+
| "payco"
|
|
87
|
+
| "paynow"
|
|
88
|
+
| "paypal"
|
|
89
|
+
| "pix"
|
|
90
|
+
| "promptpay"
|
|
91
|
+
| "revolut_pay"
|
|
92
|
+
| "samsung_pay"
|
|
93
|
+
| "sepa_credit_transfer"
|
|
94
|
+
| "sepa_debit"
|
|
95
|
+
| "sofort"
|
|
96
|
+
| "south_korea_market"
|
|
97
|
+
| "swish"
|
|
98
|
+
| "three_d_secure"
|
|
99
|
+
| "three_d_secure_2"
|
|
100
|
+
| "three_d_secure_2_eap"
|
|
101
|
+
| "twint"
|
|
102
|
+
| "upi"
|
|
103
|
+
| "us_bank_account"
|
|
104
|
+
| "visa_checkout"
|
|
105
|
+
| "wechat"
|
|
106
|
+
| "wechat_pay"
|
|
107
|
+
| "zip";
|
|
108
|
+
|
|
109
|
+
export type PaymentsListDefaultFilters = {
|
|
110
|
+
amount?:
|
|
111
|
+
| { equals: number }
|
|
112
|
+
| { greaterThan: number }
|
|
113
|
+
| { lessThan: number }
|
|
114
|
+
| { between: { lowerBound: number; upperBound: number } };
|
|
115
|
+
date?:
|
|
116
|
+
| { before: Date }
|
|
117
|
+
| { after: Date }
|
|
118
|
+
| { between: { start: Date; end: Date } };
|
|
119
|
+
status?: Array<Status>;
|
|
120
|
+
paymentMethod?: PaymentMethod;
|
|
121
|
+
};
|
|
122
|
+
|
|
18
123
|
export type NotificationCount = {
|
|
19
124
|
total: number;
|
|
20
125
|
actionRequired: number;
|
|
21
126
|
};
|
|
22
127
|
|
|
23
|
-
export type InstallState = {
|
|
24
|
-
appId: string;
|
|
25
|
-
state: "INSTALLED" | "UNINSTALLED";
|
|
26
|
-
};
|
|
27
|
-
|
|
28
128
|
export type LoaderStart = {
|
|
29
129
|
elementTagName: string;
|
|
30
130
|
};
|
|
@@ -34,6 +134,10 @@ export type LoadError = {
|
|
|
34
134
|
error: EmbeddedError;
|
|
35
135
|
};
|
|
36
136
|
|
|
137
|
+
export type StepChange = {
|
|
138
|
+
step: string;
|
|
139
|
+
};
|
|
140
|
+
|
|
37
141
|
export type EmbeddedError = {
|
|
38
142
|
type: EmbeddedErrorType;
|
|
39
143
|
message?: string;
|
|
@@ -75,10 +179,6 @@ export const ConnectElementCommonMethodConfig = {
|
|
|
75
179
|
};
|
|
76
180
|
|
|
77
181
|
export const ConnectElementCustomMethodConfig = {
|
|
78
|
-
"payment-details": {
|
|
79
|
-
setPayment: (_payment: string | undefined): void => {},
|
|
80
|
-
setOnClose: (_listener: (() => void) | undefined): void => {}
|
|
81
|
-
},
|
|
82
182
|
"account-onboarding": {
|
|
83
183
|
setFullTermsOfServiceUrl: (
|
|
84
184
|
_termOfServiceUrl: string | undefined
|
|
@@ -93,7 +193,10 @@ export const ConnectElementCustomMethodConfig = {
|
|
|
93
193
|
setCollectionOptions: (
|
|
94
194
|
_collectionOptions: CollectionOptions | undefined
|
|
95
195
|
): void => {},
|
|
96
|
-
setOnExit: (_listener: (() => void) | undefined): void => {}
|
|
196
|
+
setOnExit: (_listener: (() => void) | undefined): void => {},
|
|
197
|
+
setOnStepChange: (
|
|
198
|
+
_listener: (({ step }: StepChange) => void) | undefined
|
|
199
|
+
): void => {}
|
|
97
200
|
},
|
|
98
201
|
"account-management": {
|
|
99
202
|
setCollectionOptions: (
|
|
@@ -110,59 +213,28 @@ export const ConnectElementCustomMethodConfig = {
|
|
|
110
213
|
| undefined
|
|
111
214
|
): void => {}
|
|
112
215
|
},
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
setFetchEphemeralKey: (
|
|
117
|
-
_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined
|
|
216
|
+
payments: {
|
|
217
|
+
setDefaultFilters: (
|
|
218
|
+
_filters: PaymentsListDefaultFilters | undefined
|
|
118
219
|
): void => {}
|
|
119
220
|
},
|
|
120
|
-
"
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
): void => {}
|
|
124
|
-
},
|
|
125
|
-
"financial-account": {
|
|
126
|
-
setFinancialAccount: (_financialAccount: string): void => {}
|
|
127
|
-
},
|
|
128
|
-
"financial-account-transactions": {
|
|
129
|
-
setFinancialAccount: (_financialAccount: string): void => {}
|
|
221
|
+
"payment-details": {
|
|
222
|
+
setPayment: (_payment: string | undefined): void => {},
|
|
223
|
+
setOnClose: (_listener: (() => void) | undefined): void => {}
|
|
130
224
|
},
|
|
131
|
-
"
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
225
|
+
"tax-settings": {
|
|
226
|
+
setHideProductTaxCodeSelector: (_hidden: boolean | undefined): void => {},
|
|
227
|
+
setDisplayHeadOfficeCountries: (
|
|
228
|
+
_countries: string[] | undefined
|
|
135
229
|
): void => {},
|
|
136
|
-
|
|
137
|
-
_listener: (({
|
|
230
|
+
setOnTaxSettingsUpdated: (
|
|
231
|
+
_listener: (({ id }: { id: string }) => void) | undefined
|
|
138
232
|
): void => {}
|
|
139
233
|
},
|
|
140
|
-
"
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
},
|
|
144
|
-
"payment-method-settings": {
|
|
145
|
-
setPaymentMethodConfiguration: (
|
|
146
|
-
_paymentMethodConfiguration: string | undefined
|
|
147
|
-
): void => {}
|
|
148
|
-
},
|
|
149
|
-
"capital-financing": {
|
|
150
|
-
setDefaultFinancingOffer: (
|
|
151
|
-
_defaultFinancingOffer: string | undefined
|
|
152
|
-
): void => {},
|
|
153
|
-
setShowFinancingSelector: (
|
|
154
|
-
_showFinancingSelector: boolean | undefined
|
|
234
|
+
"tax-registrations": {
|
|
235
|
+
setOnAfterTaxRegistrationAdded: (
|
|
236
|
+
_listener: (({ id }: { id: string }) => void) | undefined
|
|
155
237
|
): void => {},
|
|
156
|
-
|
|
157
|
-
setSupportUrl: (_supportUrl: string | undefined): void => {},
|
|
158
|
-
setOnFinancingsLoaded: (
|
|
159
|
-
_listener: (({ total }: { total: number }) => void) | undefined
|
|
160
|
-
): void => {}
|
|
161
|
-
},
|
|
162
|
-
"capital-financing-application": {
|
|
163
|
-
setOnApplicationSubmitted: (_listener: (() => void) | undefined): void => {}
|
|
164
|
-
},
|
|
165
|
-
"capital-financing-promotion": {
|
|
166
|
-
setOnApplicationSubmitted: (_listener: (() => void) | undefined): void => {}
|
|
238
|
+
setDisplayCountries: (_countries: string[] | undefined): void => {}
|
|
167
239
|
}
|
|
168
240
|
};
|
package/types/shared.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
ConnectElementCustomMethodConfig,
|
|
3
3
|
ConnectElementCommonMethodConfig
|
|
4
4
|
} from "./config";
|
|
5
|
+
|
|
5
6
|
export declare type LoadConnectAndInitialize = (
|
|
6
7
|
initParams: IStripeConnectInitParams
|
|
7
8
|
) => StripeConnectInstance;
|
|
@@ -150,10 +151,42 @@ export declare type AppearanceVariables = {
|
|
|
150
151
|
* The color used for primary actions and links. This accepts hex values or RGB/HSL strings.
|
|
151
152
|
*/
|
|
152
153
|
actionPrimaryColorText?: string;
|
|
154
|
+
/**
|
|
155
|
+
* The line type used for text decoration of primary actions and links. This accepts a valid text decoration line value.
|
|
156
|
+
*/
|
|
157
|
+
actionPrimaryTextDecorationLine?: string;
|
|
158
|
+
/**
|
|
159
|
+
* The color used for text decoration of primary actions and links. This accepts hex values or RGB/HSL strings.
|
|
160
|
+
*/
|
|
161
|
+
actionPrimaryTextDecorationColor?: string;
|
|
162
|
+
/**
|
|
163
|
+
* The style of text decoration of primary actions and links. This accepts a valid text decoration style value.
|
|
164
|
+
*/
|
|
165
|
+
actionPrimaryTextDecorationStyle?: string;
|
|
166
|
+
/**
|
|
167
|
+
* The thickness of text decoration of primary actions and links. This accepts a valid text decoration thickness value.
|
|
168
|
+
*/
|
|
169
|
+
actionPrimaryTextDecorationThickness?: string;
|
|
153
170
|
/**
|
|
154
171
|
* The color used for secondary actions and links. This accepts hex values or RGB/HSL strings.
|
|
155
172
|
*/
|
|
156
173
|
actionSecondaryColorText?: string;
|
|
174
|
+
/**
|
|
175
|
+
* The line type used for text decoration of secondary actions and links. This accepts a valid text decoration line value.
|
|
176
|
+
*/
|
|
177
|
+
actionSecondaryTextDecorationLine?: string;
|
|
178
|
+
/**
|
|
179
|
+
* The color used for text decoration of secondary actions and links. This accepts hex values or RGB/HSL strings.
|
|
180
|
+
*/
|
|
181
|
+
actionSecondaryTextDecorationColor?: string;
|
|
182
|
+
/**
|
|
183
|
+
* The style of text decoration of secondary actions and links. This accepts a valid text decoration style value.
|
|
184
|
+
*/
|
|
185
|
+
actionSecondaryTextDecorationStyle?: string;
|
|
186
|
+
/**
|
|
187
|
+
* The thickness of text decoration of secondary actions and links. This accepts a valid text decoration thickness value.
|
|
188
|
+
*/
|
|
189
|
+
actionSecondaryTextDecorationThickness?: string;
|
|
157
190
|
|
|
158
191
|
// Neutral Badge Colors
|
|
159
192
|
/**
|
|
@@ -261,6 +294,10 @@ export declare type AppearanceVariables = {
|
|
|
261
294
|
* A z-index to use for the overlay throughout embedded components. Set this number to control the z-order of the overlay.
|
|
262
295
|
*/
|
|
263
296
|
overlayZIndex?: number;
|
|
297
|
+
/**
|
|
298
|
+
* The backdrop color when an overlay is opened. This accepts hex values or RGB/RGBA/HSL strings.
|
|
299
|
+
*/
|
|
300
|
+
overlayBackdropColor?: string;
|
|
264
301
|
|
|
265
302
|
// Body Typography
|
|
266
303
|
/**
|
|
@@ -451,26 +488,14 @@ export interface StripeConnectInstance {
|
|
|
451
488
|
* Tagnames to be used with the `create` method of the Connect instance.
|
|
452
489
|
*/
|
|
453
490
|
export type ConnectElementTagName =
|
|
491
|
+
| "account-onboarding"
|
|
454
492
|
| "payments"
|
|
455
|
-
| "payouts"
|
|
456
493
|
| "payment-details"
|
|
457
|
-
| "account-onboarding"
|
|
458
|
-
| "payment-method-settings"
|
|
459
494
|
| "account-management"
|
|
460
495
|
| "notification-banner"
|
|
461
|
-
| "
|
|
462
|
-
| "
|
|
463
|
-
| "
|
|
464
|
-
| "financial-account"
|
|
465
|
-
| "financial-account-transactions"
|
|
466
|
-
| "capital-financing"
|
|
467
|
-
| "capital-financing-application"
|
|
468
|
-
| "capital-financing-promotion"
|
|
469
|
-
| "capital-overview"
|
|
496
|
+
| "payouts"
|
|
497
|
+
| "payouts-list"
|
|
498
|
+
| "balances"
|
|
470
499
|
| "documents"
|
|
471
500
|
| "tax-registrations"
|
|
472
|
-
| "tax-settings"
|
|
473
|
-
| "balances"
|
|
474
|
-
| "payouts-list"
|
|
475
|
-
| "app-install"
|
|
476
|
-
| "app-viewport";
|
|
501
|
+
| "tax-settings";
|