@stripe/connect-js 3.3.18-preview-1 → 3.3.18
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/connect.esm.js +27 -68
- package/dist/connect.js +27 -68
- package/dist/pure.esm.js +19 -60
- package/dist/pure.js +19 -60
- package/dist/src/shared.d.ts +1 -1
- package/dist/types/config.d.ts +43 -58
- package/package.json +2 -2
- package/src/shared.ts +13 -39
- package/types/config.ts +130 -77
- package/types/shared.d.ts +42 -17
package/dist/connect.esm.js
CHANGED
|
@@ -5,10 +5,6 @@ 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 => {},
|
|
@@ -25,79 +21,42 @@ const ConnectElementCustomMethodConfig = {
|
|
|
25
21
|
setCollectionOptions: _collectionOptions => {},
|
|
26
22
|
setOnNotificationsChange: _listener => {}
|
|
27
23
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
setCardSwitching: _cardSwitching => {},
|
|
31
|
-
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
32
|
-
},
|
|
33
|
-
"issuing-cards-list": {
|
|
34
|
-
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
35
|
-
},
|
|
36
|
-
"financial-account": {
|
|
37
|
-
setFinancialAccount: _financialAccount => {}
|
|
24
|
+
payments: {
|
|
25
|
+
setDefaultFilters: _filters => {}
|
|
38
26
|
},
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"app-install": {
|
|
43
|
-
setApp: _app => {},
|
|
44
|
-
setOnAppInstallStateFetched: _listener => {},
|
|
45
|
-
setOnAppInstallStateChanged: _listener => {}
|
|
46
|
-
},
|
|
47
|
-
"app-viewport": {
|
|
48
|
-
setApp: _app => {},
|
|
49
|
-
setAppData: _appData => {}
|
|
50
|
-
},
|
|
51
|
-
"payment-method-settings": {
|
|
52
|
-
setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
|
|
53
|
-
},
|
|
54
|
-
"capital-financing": {
|
|
55
|
-
setDefaultFinancingOffer: _defaultFinancingOffer => {},
|
|
56
|
-
setShowFinancingSelector: _showFinancingSelector => {},
|
|
57
|
-
setFaqUrl: _faqUrl => {},
|
|
58
|
-
setSupportUrl: _supportUrl => {},
|
|
59
|
-
setOnFinancingsLoaded: _listener => {}
|
|
27
|
+
"payment-details": {
|
|
28
|
+
setPayment: _payment => {},
|
|
29
|
+
setOnClose: _listener => {}
|
|
60
30
|
},
|
|
61
|
-
"
|
|
62
|
-
|
|
31
|
+
"tax-settings": {
|
|
32
|
+
setHideProductTaxCodeSelector: _hidden => {},
|
|
33
|
+
setDisplayHeadOfficeCountries: _countries => {},
|
|
34
|
+
setOnTaxSettingsUpdated: _listener => {}
|
|
63
35
|
},
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
setOnEligibleFinancingOfferLoaded: _listener => {}
|
|
36
|
+
"tax-registrations": {
|
|
37
|
+
setOnAfterTaxRegistrationAdded: _listener => {},
|
|
38
|
+
setDisplayCountries: _countries => {}
|
|
68
39
|
}
|
|
69
40
|
};
|
|
70
41
|
|
|
71
42
|
const componentNameMapping = {
|
|
43
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
72
44
|
payments: "stripe-connect-payments",
|
|
73
|
-
payouts: "stripe-connect-payouts",
|
|
74
45
|
"payment-details": "stripe-connect-payment-details",
|
|
75
|
-
|
|
76
|
-
"
|
|
46
|
+
payouts: "stripe-connect-payouts",
|
|
47
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
48
|
+
balances: "stripe-connect-balances",
|
|
77
49
|
"account-management": "stripe-connect-account-management",
|
|
78
50
|
"notification-banner": "stripe-connect-notification-banner",
|
|
79
|
-
"instant-payouts": "stripe-connect-instant-payouts",
|
|
80
|
-
"issuing-card": "stripe-connect-issuing-card",
|
|
81
|
-
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
82
|
-
"financial-account": "stripe-connect-financial-account",
|
|
83
|
-
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
84
|
-
"capital-financing": "stripe-connect-capital-financing",
|
|
85
|
-
"capital-financing-application": "stripe-connect-capital-financing-application",
|
|
86
|
-
"capital-financing-promotion": "stripe-connect-capital-financing-promotion",
|
|
87
|
-
"capital-overview": "stripe-connect-capital-overview",
|
|
88
51
|
documents: "stripe-connect-documents",
|
|
89
52
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
90
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
91
|
-
balances: "stripe-connect-balances",
|
|
92
|
-
"payouts-list": "stripe-connect-payouts-list",
|
|
93
|
-
"app-install": "stripe-connect-app-install",
|
|
94
|
-
"app-viewport": "stripe-connect-app-viewport"
|
|
53
|
+
"tax-settings": "stripe-connect-tax-settings"
|
|
95
54
|
};
|
|
96
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";
|
|
97
56
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
98
57
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
99
58
|
const findScript = () => {
|
|
100
|
-
return document.querySelectorAll(`script[src="${
|
|
59
|
+
return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
101
60
|
};
|
|
102
61
|
const injectScript = () => {
|
|
103
62
|
const script = document.createElement("script");
|
|
@@ -109,13 +68,13 @@ const injectScript = () => {
|
|
|
109
68
|
document.head.appendChild(script);
|
|
110
69
|
return script;
|
|
111
70
|
};
|
|
112
|
-
let stripePromise = null;
|
|
71
|
+
let stripePromise$1 = null;
|
|
113
72
|
const loadScript = () => {
|
|
114
73
|
// Ensure that we only attempt to load Connect.js at most once
|
|
115
|
-
if (stripePromise !== null) {
|
|
116
|
-
return stripePromise;
|
|
74
|
+
if (stripePromise$1 !== null) {
|
|
75
|
+
return stripePromise$1;
|
|
117
76
|
}
|
|
118
|
-
stripePromise = new Promise((resolve, reject) => {
|
|
77
|
+
stripePromise$1 = new Promise((resolve, reject) => {
|
|
119
78
|
if (typeof window === "undefined") {
|
|
120
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.");
|
|
121
80
|
return;
|
|
@@ -150,7 +109,7 @@ const loadScript = () => {
|
|
|
150
109
|
reject(error);
|
|
151
110
|
}
|
|
152
111
|
});
|
|
153
|
-
return stripePromise;
|
|
112
|
+
return stripePromise$1;
|
|
154
113
|
};
|
|
155
114
|
const hasCustomMethod = tagName => {
|
|
156
115
|
return tagName in ConnectElementCustomMethodConfig;
|
|
@@ -234,7 +193,7 @@ const createWrapper = stripeConnect => {
|
|
|
234
193
|
sdk: true,
|
|
235
194
|
sdkOptions: {
|
|
236
195
|
// This will be replaced by the npm package version when bundling
|
|
237
|
-
sdkVersion: "3.3.18
|
|
196
|
+
sdkVersion: "3.3.18"
|
|
238
197
|
}
|
|
239
198
|
})
|
|
240
199
|
}));
|
|
@@ -246,16 +205,16 @@ const createWrapper = stripeConnect => {
|
|
|
246
205
|
|
|
247
206
|
// Execute our own script injection after a tick to give users time to do their
|
|
248
207
|
// own script injection.
|
|
249
|
-
const stripePromise
|
|
208
|
+
const stripePromise = Promise.resolve().then(() => loadScript());
|
|
250
209
|
let loadCalled = false;
|
|
251
|
-
stripePromise
|
|
210
|
+
stripePromise.catch(err => {
|
|
252
211
|
if (!loadCalled) {
|
|
253
212
|
console.warn(err);
|
|
254
213
|
}
|
|
255
214
|
});
|
|
256
215
|
const loadConnectAndInitialize = initParams => {
|
|
257
216
|
loadCalled = true;
|
|
258
|
-
return initStripeConnect(stripePromise
|
|
217
|
+
return initStripeConnect(stripePromise, initParams);
|
|
259
218
|
};
|
|
260
219
|
|
|
261
220
|
export { loadConnectAndInitialize };
|
package/dist/connect.js
CHANGED
|
@@ -9,10 +9,6 @@ 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 => {},
|
|
@@ -29,79 +25,42 @@ const ConnectElementCustomMethodConfig = {
|
|
|
29
25
|
setCollectionOptions: _collectionOptions => {},
|
|
30
26
|
setOnNotificationsChange: _listener => {}
|
|
31
27
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
setCardSwitching: _cardSwitching => {},
|
|
35
|
-
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
36
|
-
},
|
|
37
|
-
"issuing-cards-list": {
|
|
38
|
-
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
39
|
-
},
|
|
40
|
-
"financial-account": {
|
|
41
|
-
setFinancialAccount: _financialAccount => {}
|
|
28
|
+
payments: {
|
|
29
|
+
setDefaultFilters: _filters => {}
|
|
42
30
|
},
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"app-install": {
|
|
47
|
-
setApp: _app => {},
|
|
48
|
-
setOnAppInstallStateFetched: _listener => {},
|
|
49
|
-
setOnAppInstallStateChanged: _listener => {}
|
|
50
|
-
},
|
|
51
|
-
"app-viewport": {
|
|
52
|
-
setApp: _app => {},
|
|
53
|
-
setAppData: _appData => {}
|
|
54
|
-
},
|
|
55
|
-
"payment-method-settings": {
|
|
56
|
-
setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
|
|
57
|
-
},
|
|
58
|
-
"capital-financing": {
|
|
59
|
-
setDefaultFinancingOffer: _defaultFinancingOffer => {},
|
|
60
|
-
setShowFinancingSelector: _showFinancingSelector => {},
|
|
61
|
-
setFaqUrl: _faqUrl => {},
|
|
62
|
-
setSupportUrl: _supportUrl => {},
|
|
63
|
-
setOnFinancingsLoaded: _listener => {}
|
|
31
|
+
"payment-details": {
|
|
32
|
+
setPayment: _payment => {},
|
|
33
|
+
setOnClose: _listener => {}
|
|
64
34
|
},
|
|
65
|
-
"
|
|
66
|
-
|
|
35
|
+
"tax-settings": {
|
|
36
|
+
setHideProductTaxCodeSelector: _hidden => {},
|
|
37
|
+
setDisplayHeadOfficeCountries: _countries => {},
|
|
38
|
+
setOnTaxSettingsUpdated: _listener => {}
|
|
67
39
|
},
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
setOnEligibleFinancingOfferLoaded: _listener => {}
|
|
40
|
+
"tax-registrations": {
|
|
41
|
+
setOnAfterTaxRegistrationAdded: _listener => {},
|
|
42
|
+
setDisplayCountries: _countries => {}
|
|
72
43
|
}
|
|
73
44
|
};
|
|
74
45
|
|
|
75
46
|
const componentNameMapping = {
|
|
47
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
76
48
|
payments: "stripe-connect-payments",
|
|
77
|
-
payouts: "stripe-connect-payouts",
|
|
78
49
|
"payment-details": "stripe-connect-payment-details",
|
|
79
|
-
|
|
80
|
-
"
|
|
50
|
+
payouts: "stripe-connect-payouts",
|
|
51
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
52
|
+
balances: "stripe-connect-balances",
|
|
81
53
|
"account-management": "stripe-connect-account-management",
|
|
82
54
|
"notification-banner": "stripe-connect-notification-banner",
|
|
83
|
-
"instant-payouts": "stripe-connect-instant-payouts",
|
|
84
|
-
"issuing-card": "stripe-connect-issuing-card",
|
|
85
|
-
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
86
|
-
"financial-account": "stripe-connect-financial-account",
|
|
87
|
-
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
88
|
-
"capital-financing": "stripe-connect-capital-financing",
|
|
89
|
-
"capital-financing-application": "stripe-connect-capital-financing-application",
|
|
90
|
-
"capital-financing-promotion": "stripe-connect-capital-financing-promotion",
|
|
91
|
-
"capital-overview": "stripe-connect-capital-overview",
|
|
92
55
|
documents: "stripe-connect-documents",
|
|
93
56
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
94
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
95
|
-
balances: "stripe-connect-balances",
|
|
96
|
-
"payouts-list": "stripe-connect-payouts-list",
|
|
97
|
-
"app-install": "stripe-connect-app-install",
|
|
98
|
-
"app-viewport": "stripe-connect-app-viewport"
|
|
57
|
+
"tax-settings": "stripe-connect-tax-settings"
|
|
99
58
|
};
|
|
100
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";
|
|
101
60
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
102
61
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
103
62
|
const findScript = () => {
|
|
104
|
-
return document.querySelectorAll(`script[src="${
|
|
63
|
+
return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
105
64
|
};
|
|
106
65
|
const injectScript = () => {
|
|
107
66
|
const script = document.createElement("script");
|
|
@@ -113,13 +72,13 @@ const injectScript = () => {
|
|
|
113
72
|
document.head.appendChild(script);
|
|
114
73
|
return script;
|
|
115
74
|
};
|
|
116
|
-
let stripePromise = null;
|
|
75
|
+
let stripePromise$1 = null;
|
|
117
76
|
const loadScript = () => {
|
|
118
77
|
// Ensure that we only attempt to load Connect.js at most once
|
|
119
|
-
if (stripePromise !== null) {
|
|
120
|
-
return stripePromise;
|
|
78
|
+
if (stripePromise$1 !== null) {
|
|
79
|
+
return stripePromise$1;
|
|
121
80
|
}
|
|
122
|
-
stripePromise = new Promise((resolve, reject) => {
|
|
81
|
+
stripePromise$1 = new Promise((resolve, reject) => {
|
|
123
82
|
if (typeof window === "undefined") {
|
|
124
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.");
|
|
125
84
|
return;
|
|
@@ -154,7 +113,7 @@ const loadScript = () => {
|
|
|
154
113
|
reject(error);
|
|
155
114
|
}
|
|
156
115
|
});
|
|
157
|
-
return stripePromise;
|
|
116
|
+
return stripePromise$1;
|
|
158
117
|
};
|
|
159
118
|
const hasCustomMethod = tagName => {
|
|
160
119
|
return tagName in ConnectElementCustomMethodConfig;
|
|
@@ -238,7 +197,7 @@ const createWrapper = stripeConnect => {
|
|
|
238
197
|
sdk: true,
|
|
239
198
|
sdkOptions: {
|
|
240
199
|
// This will be replaced by the npm package version when bundling
|
|
241
|
-
sdkVersion: "3.3.18
|
|
200
|
+
sdkVersion: "3.3.18"
|
|
242
201
|
}
|
|
243
202
|
})
|
|
244
203
|
}));
|
|
@@ -250,16 +209,16 @@ const createWrapper = stripeConnect => {
|
|
|
250
209
|
|
|
251
210
|
// Execute our own script injection after a tick to give users time to do their
|
|
252
211
|
// own script injection.
|
|
253
|
-
const stripePromise
|
|
212
|
+
const stripePromise = Promise.resolve().then(() => loadScript());
|
|
254
213
|
let loadCalled = false;
|
|
255
|
-
stripePromise
|
|
214
|
+
stripePromise.catch(err => {
|
|
256
215
|
if (!loadCalled) {
|
|
257
216
|
console.warn(err);
|
|
258
217
|
}
|
|
259
218
|
});
|
|
260
219
|
const loadConnectAndInitialize = initParams => {
|
|
261
220
|
loadCalled = true;
|
|
262
|
-
return initStripeConnect(stripePromise
|
|
221
|
+
return initStripeConnect(stripePromise, initParams);
|
|
263
222
|
};
|
|
264
223
|
|
|
265
224
|
exports.loadConnectAndInitialize = loadConnectAndInitialize;
|
package/dist/pure.esm.js
CHANGED
|
@@ -5,10 +5,6 @@ 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 => {},
|
|
@@ -25,79 +21,42 @@ const ConnectElementCustomMethodConfig = {
|
|
|
25
21
|
setCollectionOptions: _collectionOptions => {},
|
|
26
22
|
setOnNotificationsChange: _listener => {}
|
|
27
23
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
setCardSwitching: _cardSwitching => {},
|
|
31
|
-
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
32
|
-
},
|
|
33
|
-
"issuing-cards-list": {
|
|
34
|
-
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
35
|
-
},
|
|
36
|
-
"financial-account": {
|
|
37
|
-
setFinancialAccount: _financialAccount => {}
|
|
24
|
+
payments: {
|
|
25
|
+
setDefaultFilters: _filters => {}
|
|
38
26
|
},
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"app-install": {
|
|
43
|
-
setApp: _app => {},
|
|
44
|
-
setOnAppInstallStateFetched: _listener => {},
|
|
45
|
-
setOnAppInstallStateChanged: _listener => {}
|
|
46
|
-
},
|
|
47
|
-
"app-viewport": {
|
|
48
|
-
setApp: _app => {},
|
|
49
|
-
setAppData: _appData => {}
|
|
50
|
-
},
|
|
51
|
-
"payment-method-settings": {
|
|
52
|
-
setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
|
|
53
|
-
},
|
|
54
|
-
"capital-financing": {
|
|
55
|
-
setDefaultFinancingOffer: _defaultFinancingOffer => {},
|
|
56
|
-
setShowFinancingSelector: _showFinancingSelector => {},
|
|
57
|
-
setFaqUrl: _faqUrl => {},
|
|
58
|
-
setSupportUrl: _supportUrl => {},
|
|
59
|
-
setOnFinancingsLoaded: _listener => {}
|
|
27
|
+
"payment-details": {
|
|
28
|
+
setPayment: _payment => {},
|
|
29
|
+
setOnClose: _listener => {}
|
|
60
30
|
},
|
|
61
|
-
"
|
|
62
|
-
|
|
31
|
+
"tax-settings": {
|
|
32
|
+
setHideProductTaxCodeSelector: _hidden => {},
|
|
33
|
+
setDisplayHeadOfficeCountries: _countries => {},
|
|
34
|
+
setOnTaxSettingsUpdated: _listener => {}
|
|
63
35
|
},
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
setOnEligibleFinancingOfferLoaded: _listener => {}
|
|
36
|
+
"tax-registrations": {
|
|
37
|
+
setOnAfterTaxRegistrationAdded: _listener => {},
|
|
38
|
+
setDisplayCountries: _countries => {}
|
|
68
39
|
}
|
|
69
40
|
};
|
|
70
41
|
|
|
71
42
|
const componentNameMapping = {
|
|
43
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
72
44
|
payments: "stripe-connect-payments",
|
|
73
|
-
payouts: "stripe-connect-payouts",
|
|
74
45
|
"payment-details": "stripe-connect-payment-details",
|
|
75
|
-
|
|
76
|
-
"
|
|
46
|
+
payouts: "stripe-connect-payouts",
|
|
47
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
48
|
+
balances: "stripe-connect-balances",
|
|
77
49
|
"account-management": "stripe-connect-account-management",
|
|
78
50
|
"notification-banner": "stripe-connect-notification-banner",
|
|
79
|
-
"instant-payouts": "stripe-connect-instant-payouts",
|
|
80
|
-
"issuing-card": "stripe-connect-issuing-card",
|
|
81
|
-
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
82
|
-
"financial-account": "stripe-connect-financial-account",
|
|
83
|
-
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
84
|
-
"capital-financing": "stripe-connect-capital-financing",
|
|
85
|
-
"capital-financing-application": "stripe-connect-capital-financing-application",
|
|
86
|
-
"capital-financing-promotion": "stripe-connect-capital-financing-promotion",
|
|
87
|
-
"capital-overview": "stripe-connect-capital-overview",
|
|
88
51
|
documents: "stripe-connect-documents",
|
|
89
52
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
90
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
91
|
-
balances: "stripe-connect-balances",
|
|
92
|
-
"payouts-list": "stripe-connect-payouts-list",
|
|
93
|
-
"app-install": "stripe-connect-app-install",
|
|
94
|
-
"app-viewport": "stripe-connect-app-viewport"
|
|
53
|
+
"tax-settings": "stripe-connect-tax-settings"
|
|
95
54
|
};
|
|
96
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";
|
|
97
56
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
98
57
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
99
58
|
const findScript = () => {
|
|
100
|
-
return document.querySelectorAll(`script[src="${
|
|
59
|
+
return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
101
60
|
};
|
|
102
61
|
const injectScript = () => {
|
|
103
62
|
const script = document.createElement("script");
|
|
@@ -234,7 +193,7 @@ const createWrapper = stripeConnect => {
|
|
|
234
193
|
sdk: true,
|
|
235
194
|
sdkOptions: {
|
|
236
195
|
// This will be replaced by the npm package version when bundling
|
|
237
|
-
sdkVersion: "3.3.18
|
|
196
|
+
sdkVersion: "3.3.18"
|
|
238
197
|
}
|
|
239
198
|
})
|
|
240
199
|
}));
|
package/dist/pure.js
CHANGED
|
@@ -9,10 +9,6 @@ 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 => {},
|
|
@@ -29,79 +25,42 @@ const ConnectElementCustomMethodConfig = {
|
|
|
29
25
|
setCollectionOptions: _collectionOptions => {},
|
|
30
26
|
setOnNotificationsChange: _listener => {}
|
|
31
27
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
setCardSwitching: _cardSwitching => {},
|
|
35
|
-
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
36
|
-
},
|
|
37
|
-
"issuing-cards-list": {
|
|
38
|
-
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
39
|
-
},
|
|
40
|
-
"financial-account": {
|
|
41
|
-
setFinancialAccount: _financialAccount => {}
|
|
28
|
+
payments: {
|
|
29
|
+
setDefaultFilters: _filters => {}
|
|
42
30
|
},
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"app-install": {
|
|
47
|
-
setApp: _app => {},
|
|
48
|
-
setOnAppInstallStateFetched: _listener => {},
|
|
49
|
-
setOnAppInstallStateChanged: _listener => {}
|
|
50
|
-
},
|
|
51
|
-
"app-viewport": {
|
|
52
|
-
setApp: _app => {},
|
|
53
|
-
setAppData: _appData => {}
|
|
54
|
-
},
|
|
55
|
-
"payment-method-settings": {
|
|
56
|
-
setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
|
|
57
|
-
},
|
|
58
|
-
"capital-financing": {
|
|
59
|
-
setDefaultFinancingOffer: _defaultFinancingOffer => {},
|
|
60
|
-
setShowFinancingSelector: _showFinancingSelector => {},
|
|
61
|
-
setFaqUrl: _faqUrl => {},
|
|
62
|
-
setSupportUrl: _supportUrl => {},
|
|
63
|
-
setOnFinancingsLoaded: _listener => {}
|
|
31
|
+
"payment-details": {
|
|
32
|
+
setPayment: _payment => {},
|
|
33
|
+
setOnClose: _listener => {}
|
|
64
34
|
},
|
|
65
|
-
"
|
|
66
|
-
|
|
35
|
+
"tax-settings": {
|
|
36
|
+
setHideProductTaxCodeSelector: _hidden => {},
|
|
37
|
+
setDisplayHeadOfficeCountries: _countries => {},
|
|
38
|
+
setOnTaxSettingsUpdated: _listener => {}
|
|
67
39
|
},
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
setOnEligibleFinancingOfferLoaded: _listener => {}
|
|
40
|
+
"tax-registrations": {
|
|
41
|
+
setOnAfterTaxRegistrationAdded: _listener => {},
|
|
42
|
+
setDisplayCountries: _countries => {}
|
|
72
43
|
}
|
|
73
44
|
};
|
|
74
45
|
|
|
75
46
|
const componentNameMapping = {
|
|
47
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
76
48
|
payments: "stripe-connect-payments",
|
|
77
|
-
payouts: "stripe-connect-payouts",
|
|
78
49
|
"payment-details": "stripe-connect-payment-details",
|
|
79
|
-
|
|
80
|
-
"
|
|
50
|
+
payouts: "stripe-connect-payouts",
|
|
51
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
52
|
+
balances: "stripe-connect-balances",
|
|
81
53
|
"account-management": "stripe-connect-account-management",
|
|
82
54
|
"notification-banner": "stripe-connect-notification-banner",
|
|
83
|
-
"instant-payouts": "stripe-connect-instant-payouts",
|
|
84
|
-
"issuing-card": "stripe-connect-issuing-card",
|
|
85
|
-
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
86
|
-
"financial-account": "stripe-connect-financial-account",
|
|
87
|
-
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
88
|
-
"capital-financing": "stripe-connect-capital-financing",
|
|
89
|
-
"capital-financing-application": "stripe-connect-capital-financing-application",
|
|
90
|
-
"capital-financing-promotion": "stripe-connect-capital-financing-promotion",
|
|
91
|
-
"capital-overview": "stripe-connect-capital-overview",
|
|
92
55
|
documents: "stripe-connect-documents",
|
|
93
56
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
94
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
95
|
-
balances: "stripe-connect-balances",
|
|
96
|
-
"payouts-list": "stripe-connect-payouts-list",
|
|
97
|
-
"app-install": "stripe-connect-app-install",
|
|
98
|
-
"app-viewport": "stripe-connect-app-viewport"
|
|
57
|
+
"tax-settings": "stripe-connect-tax-settings"
|
|
99
58
|
};
|
|
100
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";
|
|
101
60
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
102
61
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
103
62
|
const findScript = () => {
|
|
104
|
-
return document.querySelectorAll(`script[src="${
|
|
63
|
+
return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
105
64
|
};
|
|
106
65
|
const injectScript = () => {
|
|
107
66
|
const script = document.createElement("script");
|
|
@@ -238,7 +197,7 @@ const createWrapper = stripeConnect => {
|
|
|
238
197
|
sdk: true,
|
|
239
198
|
sdkOptions: {
|
|
240
199
|
// This will be replaced by the npm package version when bundling
|
|
241
|
-
sdkVersion: "3.3.18
|
|
200
|
+
sdkVersion: "3.3.18"
|
|
242
201
|
}
|
|
243
202
|
})
|
|
244
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
|
};
|
|
@@ -32,10 +48,6 @@ export type EmbeddedError = {
|
|
|
32
48
|
type: EmbeddedErrorType;
|
|
33
49
|
message?: string;
|
|
34
50
|
};
|
|
35
|
-
export type FinancingProductType = {
|
|
36
|
-
productType: "standard" | "refill" | "none";
|
|
37
|
-
};
|
|
38
|
-
export type FinancingPromotionLayoutType = "full" | "banner";
|
|
39
51
|
export type EmbeddedErrorType =
|
|
40
52
|
/**
|
|
41
53
|
* Failure to connect to Stripe's API.
|
|
@@ -66,10 +78,6 @@ export declare const ConnectElementCommonMethodConfig: {
|
|
|
66
78
|
setOnLoaderStart: (_listener: (({ elementTagName }: LoaderStart) => void) | undefined) => void;
|
|
67
79
|
};
|
|
68
80
|
export declare const ConnectElementCustomMethodConfig: {
|
|
69
|
-
"payment-details": {
|
|
70
|
-
setPayment: (_payment: string | undefined) => void;
|
|
71
|
-
setOnClose: (_listener: (() => void) | undefined) => void;
|
|
72
|
-
};
|
|
73
81
|
"account-onboarding": {
|
|
74
82
|
setFullTermsOfServiceUrl: (_termOfServiceUrl: string | undefined) => void;
|
|
75
83
|
setRecipientTermsOfServiceUrl: (_recipientTermsOfServiceUrl: string | undefined) => void;
|
|
@@ -86,47 +94,24 @@ export declare const ConnectElementCustomMethodConfig: {
|
|
|
86
94
|
setCollectionOptions: (_collectionOptions: CollectionOptions | undefined) => void;
|
|
87
95
|
setOnNotificationsChange: (_listener: (({ total, actionRequired }: NotificationCount) => void) | undefined) => void;
|
|
88
96
|
};
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
setCardSwitching: (_cardSwitching: boolean | undefined) => void;
|
|
92
|
-
setFetchEphemeralKey: (_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined) => void;
|
|
93
|
-
};
|
|
94
|
-
"issuing-cards-list": {
|
|
95
|
-
setFetchEphemeralKey: (_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined) => void;
|
|
97
|
+
payments: {
|
|
98
|
+
setDefaultFilters: (_filters: PaymentsListDefaultFilters | undefined) => void;
|
|
96
99
|
};
|
|
97
|
-
"
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
"financial-account-transactions": {
|
|
101
|
-
setFinancialAccount: (_financialAccount: string) => void;
|
|
102
|
-
};
|
|
103
|
-
"app-install": {
|
|
104
|
-
setApp: (_app: string | undefined) => void;
|
|
105
|
-
setOnAppInstallStateFetched: (_listener: (({ appId, state }: InstallState) => void) | undefined) => void;
|
|
106
|
-
setOnAppInstallStateChanged: (_listener: (({ appId, state }: InstallState) => void) | undefined) => void;
|
|
107
|
-
};
|
|
108
|
-
"app-viewport": {
|
|
109
|
-
setApp: (_app: string | undefined) => void;
|
|
110
|
-
setAppData: (_appData: Record<string, string> | undefined) => void;
|
|
111
|
-
};
|
|
112
|
-
"payment-method-settings": {
|
|
113
|
-
setPaymentMethodConfiguration: (_paymentMethodConfiguration: string | undefined) => void;
|
|
100
|
+
"payment-details": {
|
|
101
|
+
setPayment: (_payment: string | undefined) => void;
|
|
102
|
+
setOnClose: (_listener: (() => void) | undefined) => void;
|
|
114
103
|
};
|
|
115
|
-
"
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
setOnFinancingsLoaded: (_listener: (({ total }: {
|
|
121
|
-
total: number;
|
|
104
|
+
"tax-settings": {
|
|
105
|
+
setHideProductTaxCodeSelector: (_hidden: boolean | undefined) => void;
|
|
106
|
+
setDisplayHeadOfficeCountries: (_countries: string[] | undefined) => void;
|
|
107
|
+
setOnTaxSettingsUpdated: (_listener: (({ id }: {
|
|
108
|
+
id: string;
|
|
122
109
|
}) => void) | undefined) => void;
|
|
123
110
|
};
|
|
124
|
-
"
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
setOnApplicationSubmitted: (_listener: (() => void) | undefined) => void;
|
|
130
|
-
setOnEligibleFinancingOfferLoaded: (_listener: (({ productType }: FinancingProductType) => void) | undefined) => void;
|
|
111
|
+
"tax-registrations": {
|
|
112
|
+
setOnAfterTaxRegistrationAdded: (_listener: (({ id }: {
|
|
113
|
+
id: string;
|
|
114
|
+
}) => void) | undefined) => void;
|
|
115
|
+
setDisplayCountries: (_countries: string[] | undefined) => void;
|
|
131
116
|
};
|
|
132
117
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stripe/connect-js",
|
|
3
|
-
"version": "3.3.18
|
|
3
|
+
"version": "3.3.18",
|
|
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
|
};
|
|
@@ -43,12 +143,6 @@ export type EmbeddedError = {
|
|
|
43
143
|
message?: string;
|
|
44
144
|
};
|
|
45
145
|
|
|
46
|
-
export type FinancingProductType = {
|
|
47
|
-
productType: "standard" | "refill" | "none";
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export type FinancingPromotionLayoutType = "full" | "banner";
|
|
51
|
-
|
|
52
146
|
export type EmbeddedErrorType =
|
|
53
147
|
/**
|
|
54
148
|
* Failure to connect to Stripe's API.
|
|
@@ -85,10 +179,6 @@ export const ConnectElementCommonMethodConfig = {
|
|
|
85
179
|
};
|
|
86
180
|
|
|
87
181
|
export const ConnectElementCustomMethodConfig = {
|
|
88
|
-
"payment-details": {
|
|
89
|
-
setPayment: (_payment: string | undefined): void => {},
|
|
90
|
-
setOnClose: (_listener: (() => void) | undefined): void => {}
|
|
91
|
-
},
|
|
92
182
|
"account-onboarding": {
|
|
93
183
|
setFullTermsOfServiceUrl: (
|
|
94
184
|
_termOfServiceUrl: string | undefined
|
|
@@ -123,65 +213,28 @@ export const ConnectElementCustomMethodConfig = {
|
|
|
123
213
|
| undefined
|
|
124
214
|
): void => {}
|
|
125
215
|
},
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
setFetchEphemeralKey: (
|
|
130
|
-
_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined
|
|
216
|
+
payments: {
|
|
217
|
+
setDefaultFilters: (
|
|
218
|
+
_filters: PaymentsListDefaultFilters | undefined
|
|
131
219
|
): void => {}
|
|
132
220
|
},
|
|
133
|
-
"
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
): void => {}
|
|
137
|
-
},
|
|
138
|
-
"financial-account": {
|
|
139
|
-
setFinancialAccount: (_financialAccount: string): void => {}
|
|
140
|
-
},
|
|
141
|
-
"financial-account-transactions": {
|
|
142
|
-
setFinancialAccount: (_financialAccount: string): void => {}
|
|
143
|
-
},
|
|
144
|
-
"app-install": {
|
|
145
|
-
setApp: (_app: string | undefined): void => {},
|
|
146
|
-
setOnAppInstallStateFetched: (
|
|
147
|
-
_listener: (({ appId, state }: InstallState) => void) | undefined
|
|
148
|
-
): void => {},
|
|
149
|
-
setOnAppInstallStateChanged: (
|
|
150
|
-
_listener: (({ appId, state }: InstallState) => void) | undefined
|
|
151
|
-
): void => {}
|
|
152
|
-
},
|
|
153
|
-
"app-viewport": {
|
|
154
|
-
setApp: (_app: string | undefined): void => {},
|
|
155
|
-
setAppData: (_appData: Record<string, string> | undefined): void => {}
|
|
156
|
-
},
|
|
157
|
-
"payment-method-settings": {
|
|
158
|
-
setPaymentMethodConfiguration: (
|
|
159
|
-
_paymentMethodConfiguration: string | undefined
|
|
160
|
-
): void => {}
|
|
221
|
+
"payment-details": {
|
|
222
|
+
setPayment: (_payment: string | undefined): void => {},
|
|
223
|
+
setOnClose: (_listener: (() => void) | undefined): void => {}
|
|
161
224
|
},
|
|
162
|
-
"
|
|
163
|
-
|
|
164
|
-
|
|
225
|
+
"tax-settings": {
|
|
226
|
+
setHideProductTaxCodeSelector: (_hidden: boolean | undefined): void => {},
|
|
227
|
+
setDisplayHeadOfficeCountries: (
|
|
228
|
+
_countries: string[] | undefined
|
|
165
229
|
): void => {},
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
): void => {},
|
|
169
|
-
setFaqUrl: (_faqUrl: string | undefined): void => {},
|
|
170
|
-
setSupportUrl: (_supportUrl: string | undefined): void => {},
|
|
171
|
-
setOnFinancingsLoaded: (
|
|
172
|
-
_listener: (({ total }: { total: number }) => void) | undefined
|
|
230
|
+
setOnTaxSettingsUpdated: (
|
|
231
|
+
_listener: (({ id }: { id: string }) => void) | undefined
|
|
173
232
|
): void => {}
|
|
174
233
|
},
|
|
175
|
-
"
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
"capital-financing-promotion": {
|
|
179
|
-
setLayout: (_layout: FinancingPromotionLayoutType | undefined): void => {},
|
|
180
|
-
setOnApplicationSubmitted: (
|
|
181
|
-
_listener: (() => void) | undefined
|
|
234
|
+
"tax-registrations": {
|
|
235
|
+
setOnAfterTaxRegistrationAdded: (
|
|
236
|
+
_listener: (({ id }: { id: string }) => void) | undefined
|
|
182
237
|
): void => {},
|
|
183
|
-
|
|
184
|
-
_listener: (({ productType }: FinancingProductType) => void) | undefined
|
|
185
|
-
): void => {}
|
|
238
|
+
setDisplayCountries: (_countries: string[] | undefined): void => {}
|
|
186
239
|
}
|
|
187
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";
|