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