@stripe/connect-js 3.3.20-preview-1 → 3.3.20
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 +29 -63
- package/dist/connect.js +29 -63
- package/dist/pure.esm.js +21 -55
- package/dist/pure.js +21 -55
- package/dist/src/shared.d.ts +1 -1
- package/dist/types/config.d.ts +44 -49
- package/package.json +2 -2
- package/src/shared.ts +13 -32
- package/types/config.ts +132 -72
- package/types/shared.d.ts +42 -14
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 => {},
|
|
@@ -33,7 +29,8 @@ const ConnectElementCustomMethodConfig = {
|
|
|
33
29
|
},
|
|
34
30
|
"issuing-cards-list": {
|
|
35
31
|
setFetchEphemeralKey: _fetchEphemeralKey => {},
|
|
36
|
-
setShowSpendControls: _showSpendControls => {}
|
|
32
|
+
setShowSpendControls: _showSpendControls => {},
|
|
33
|
+
setIssuingProgram: _issuingProgram => {}
|
|
37
34
|
},
|
|
38
35
|
"financial-account": {
|
|
39
36
|
setFinancialAccount: _financialAccount => {}
|
|
@@ -41,77 +38,46 @@ const ConnectElementCustomMethodConfig = {
|
|
|
41
38
|
"financial-account-transactions": {
|
|
42
39
|
setFinancialAccount: _financialAccount => {}
|
|
43
40
|
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
setOnAppInstallStateFetched: _listener => {},
|
|
47
|
-
setOnAppInstallStateChanged: _listener => {}
|
|
48
|
-
},
|
|
49
|
-
"app-viewport": {
|
|
50
|
-
setApp: _app => {},
|
|
51
|
-
setAppData: _appData => {}
|
|
41
|
+
payments: {
|
|
42
|
+
setDefaultFilters: _filters => {}
|
|
52
43
|
},
|
|
53
|
-
"payment-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"capital-financing": {
|
|
57
|
-
setDefaultFinancingOffer: _defaultFinancingOffer => {},
|
|
58
|
-
setShowFinancingSelector: _showFinancingSelector => {},
|
|
59
|
-
setFaqUrl: _faqUrl => {},
|
|
60
|
-
setSupportUrl: _supportUrl => {},
|
|
61
|
-
setOnFinancingsLoaded: _listener => {}
|
|
62
|
-
},
|
|
63
|
-
"capital-financing-application": {
|
|
64
|
-
setOnApplicationSubmitted: _listener => {},
|
|
65
|
-
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
66
|
-
setHowCapitalWorksUrl: _howCapitalWorksUrl => {}
|
|
44
|
+
"payment-details": {
|
|
45
|
+
setPayment: _payment => {},
|
|
46
|
+
setOnClose: _listener => {}
|
|
67
47
|
},
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
73
|
-
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
74
|
-
setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {}
|
|
48
|
+
"tax-settings": {
|
|
49
|
+
setHideProductTaxCodeSelector: _hidden => {},
|
|
50
|
+
setDisplayHeadOfficeCountries: _countries => {},
|
|
51
|
+
setOnTaxSettingsUpdated: _listener => {}
|
|
75
52
|
},
|
|
76
|
-
"
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
setIntervalEnd: _intervalEnd => {},
|
|
80
|
-
setIntervalType: _intervalType => {}
|
|
53
|
+
"tax-registrations": {
|
|
54
|
+
setOnAfterTaxRegistrationAdded: _listener => {},
|
|
55
|
+
setDisplayCountries: _countries => {}
|
|
81
56
|
}
|
|
82
57
|
};
|
|
83
58
|
|
|
84
59
|
const componentNameMapping = {
|
|
60
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
85
61
|
payments: "stripe-connect-payments",
|
|
86
|
-
payouts: "stripe-connect-payouts",
|
|
87
62
|
"payment-details": "stripe-connect-payment-details",
|
|
88
|
-
|
|
89
|
-
"
|
|
63
|
+
payouts: "stripe-connect-payouts",
|
|
64
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
65
|
+
balances: "stripe-connect-balances",
|
|
90
66
|
"account-management": "stripe-connect-account-management",
|
|
91
67
|
"notification-banner": "stripe-connect-notification-banner",
|
|
92
|
-
"instant-payouts": "stripe-connect-instant-payouts",
|
|
93
68
|
"issuing-card": "stripe-connect-issuing-card",
|
|
94
69
|
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
95
70
|
"financial-account": "stripe-connect-financial-account",
|
|
96
71
|
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
97
|
-
"capital-financing": "stripe-connect-capital-financing",
|
|
98
|
-
"capital-financing-application": "stripe-connect-capital-financing-application",
|
|
99
|
-
"capital-financing-promotion": "stripe-connect-capital-financing-promotion",
|
|
100
|
-
"capital-overview": "stripe-connect-capital-overview",
|
|
101
72
|
documents: "stripe-connect-documents",
|
|
102
73
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
103
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
104
|
-
balances: "stripe-connect-balances",
|
|
105
|
-
"payouts-list": "stripe-connect-payouts-list",
|
|
106
|
-
"app-install": "stripe-connect-app-install",
|
|
107
|
-
"app-viewport": "stripe-connect-app-viewport",
|
|
108
|
-
"reporting-chart": "stripe-connect-reporting-chart"
|
|
74
|
+
"tax-settings": "stripe-connect-tax-settings"
|
|
109
75
|
};
|
|
110
76
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
111
77
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
112
78
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
113
79
|
const findScript = () => {
|
|
114
|
-
return document.querySelectorAll(`script[src="${
|
|
80
|
+
return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
115
81
|
};
|
|
116
82
|
const injectScript = () => {
|
|
117
83
|
const script = document.createElement("script");
|
|
@@ -123,13 +89,13 @@ const injectScript = () => {
|
|
|
123
89
|
document.head.appendChild(script);
|
|
124
90
|
return script;
|
|
125
91
|
};
|
|
126
|
-
let stripePromise = null;
|
|
92
|
+
let stripePromise$1 = null;
|
|
127
93
|
const loadScript = () => {
|
|
128
94
|
// Ensure that we only attempt to load Connect.js at most once
|
|
129
|
-
if (stripePromise !== null) {
|
|
130
|
-
return stripePromise;
|
|
95
|
+
if (stripePromise$1 !== null) {
|
|
96
|
+
return stripePromise$1;
|
|
131
97
|
}
|
|
132
|
-
stripePromise = new Promise((resolve, reject) => {
|
|
98
|
+
stripePromise$1 = new Promise((resolve, reject) => {
|
|
133
99
|
if (typeof window === "undefined") {
|
|
134
100
|
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.");
|
|
135
101
|
return;
|
|
@@ -164,7 +130,7 @@ const loadScript = () => {
|
|
|
164
130
|
reject(error);
|
|
165
131
|
}
|
|
166
132
|
});
|
|
167
|
-
return stripePromise;
|
|
133
|
+
return stripePromise$1;
|
|
168
134
|
};
|
|
169
135
|
const hasCustomMethod = tagName => {
|
|
170
136
|
return tagName in ConnectElementCustomMethodConfig;
|
|
@@ -248,7 +214,7 @@ const createWrapper = stripeConnect => {
|
|
|
248
214
|
sdk: true,
|
|
249
215
|
sdkOptions: {
|
|
250
216
|
// This will be replaced by the npm package version when bundling
|
|
251
|
-
sdkVersion: "3.3.20
|
|
217
|
+
sdkVersion: "3.3.20"
|
|
252
218
|
}
|
|
253
219
|
})
|
|
254
220
|
}));
|
|
@@ -260,16 +226,16 @@ const createWrapper = stripeConnect => {
|
|
|
260
226
|
|
|
261
227
|
// Execute our own script injection after a tick to give users time to do their
|
|
262
228
|
// own script injection.
|
|
263
|
-
const stripePromise
|
|
229
|
+
const stripePromise = Promise.resolve().then(() => loadScript());
|
|
264
230
|
let loadCalled = false;
|
|
265
|
-
stripePromise
|
|
231
|
+
stripePromise.catch(err => {
|
|
266
232
|
if (!loadCalled) {
|
|
267
233
|
console.warn(err);
|
|
268
234
|
}
|
|
269
235
|
});
|
|
270
236
|
const loadConnectAndInitialize = initParams => {
|
|
271
237
|
loadCalled = true;
|
|
272
|
-
return initStripeConnect(stripePromise
|
|
238
|
+
return initStripeConnect(stripePromise, initParams);
|
|
273
239
|
};
|
|
274
240
|
|
|
275
241
|
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 => {},
|
|
@@ -37,7 +33,8 @@ const ConnectElementCustomMethodConfig = {
|
|
|
37
33
|
},
|
|
38
34
|
"issuing-cards-list": {
|
|
39
35
|
setFetchEphemeralKey: _fetchEphemeralKey => {},
|
|
40
|
-
setShowSpendControls: _showSpendControls => {}
|
|
36
|
+
setShowSpendControls: _showSpendControls => {},
|
|
37
|
+
setIssuingProgram: _issuingProgram => {}
|
|
41
38
|
},
|
|
42
39
|
"financial-account": {
|
|
43
40
|
setFinancialAccount: _financialAccount => {}
|
|
@@ -45,77 +42,46 @@ const ConnectElementCustomMethodConfig = {
|
|
|
45
42
|
"financial-account-transactions": {
|
|
46
43
|
setFinancialAccount: _financialAccount => {}
|
|
47
44
|
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
setOnAppInstallStateFetched: _listener => {},
|
|
51
|
-
setOnAppInstallStateChanged: _listener => {}
|
|
52
|
-
},
|
|
53
|
-
"app-viewport": {
|
|
54
|
-
setApp: _app => {},
|
|
55
|
-
setAppData: _appData => {}
|
|
45
|
+
payments: {
|
|
46
|
+
setDefaultFilters: _filters => {}
|
|
56
47
|
},
|
|
57
|
-
"payment-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"capital-financing": {
|
|
61
|
-
setDefaultFinancingOffer: _defaultFinancingOffer => {},
|
|
62
|
-
setShowFinancingSelector: _showFinancingSelector => {},
|
|
63
|
-
setFaqUrl: _faqUrl => {},
|
|
64
|
-
setSupportUrl: _supportUrl => {},
|
|
65
|
-
setOnFinancingsLoaded: _listener => {}
|
|
66
|
-
},
|
|
67
|
-
"capital-financing-application": {
|
|
68
|
-
setOnApplicationSubmitted: _listener => {},
|
|
69
|
-
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
70
|
-
setHowCapitalWorksUrl: _howCapitalWorksUrl => {}
|
|
48
|
+
"payment-details": {
|
|
49
|
+
setPayment: _payment => {},
|
|
50
|
+
setOnClose: _listener => {}
|
|
71
51
|
},
|
|
72
|
-
"
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
77
|
-
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
78
|
-
setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {}
|
|
52
|
+
"tax-settings": {
|
|
53
|
+
setHideProductTaxCodeSelector: _hidden => {},
|
|
54
|
+
setDisplayHeadOfficeCountries: _countries => {},
|
|
55
|
+
setOnTaxSettingsUpdated: _listener => {}
|
|
79
56
|
},
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
setIntervalEnd: _intervalEnd => {},
|
|
84
|
-
setIntervalType: _intervalType => {}
|
|
57
|
+
"tax-registrations": {
|
|
58
|
+
setOnAfterTaxRegistrationAdded: _listener => {},
|
|
59
|
+
setDisplayCountries: _countries => {}
|
|
85
60
|
}
|
|
86
61
|
};
|
|
87
62
|
|
|
88
63
|
const componentNameMapping = {
|
|
64
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
89
65
|
payments: "stripe-connect-payments",
|
|
90
|
-
payouts: "stripe-connect-payouts",
|
|
91
66
|
"payment-details": "stripe-connect-payment-details",
|
|
92
|
-
|
|
93
|
-
"
|
|
67
|
+
payouts: "stripe-connect-payouts",
|
|
68
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
69
|
+
balances: "stripe-connect-balances",
|
|
94
70
|
"account-management": "stripe-connect-account-management",
|
|
95
71
|
"notification-banner": "stripe-connect-notification-banner",
|
|
96
|
-
"instant-payouts": "stripe-connect-instant-payouts",
|
|
97
72
|
"issuing-card": "stripe-connect-issuing-card",
|
|
98
73
|
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
99
74
|
"financial-account": "stripe-connect-financial-account",
|
|
100
75
|
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
101
|
-
"capital-financing": "stripe-connect-capital-financing",
|
|
102
|
-
"capital-financing-application": "stripe-connect-capital-financing-application",
|
|
103
|
-
"capital-financing-promotion": "stripe-connect-capital-financing-promotion",
|
|
104
|
-
"capital-overview": "stripe-connect-capital-overview",
|
|
105
76
|
documents: "stripe-connect-documents",
|
|
106
77
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
107
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
108
|
-
balances: "stripe-connect-balances",
|
|
109
|
-
"payouts-list": "stripe-connect-payouts-list",
|
|
110
|
-
"app-install": "stripe-connect-app-install",
|
|
111
|
-
"app-viewport": "stripe-connect-app-viewport",
|
|
112
|
-
"reporting-chart": "stripe-connect-reporting-chart"
|
|
78
|
+
"tax-settings": "stripe-connect-tax-settings"
|
|
113
79
|
};
|
|
114
80
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
115
81
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
116
82
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
117
83
|
const findScript = () => {
|
|
118
|
-
return document.querySelectorAll(`script[src="${
|
|
84
|
+
return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
119
85
|
};
|
|
120
86
|
const injectScript = () => {
|
|
121
87
|
const script = document.createElement("script");
|
|
@@ -127,13 +93,13 @@ const injectScript = () => {
|
|
|
127
93
|
document.head.appendChild(script);
|
|
128
94
|
return script;
|
|
129
95
|
};
|
|
130
|
-
let stripePromise = null;
|
|
96
|
+
let stripePromise$1 = null;
|
|
131
97
|
const loadScript = () => {
|
|
132
98
|
// Ensure that we only attempt to load Connect.js at most once
|
|
133
|
-
if (stripePromise !== null) {
|
|
134
|
-
return stripePromise;
|
|
99
|
+
if (stripePromise$1 !== null) {
|
|
100
|
+
return stripePromise$1;
|
|
135
101
|
}
|
|
136
|
-
stripePromise = new Promise((resolve, reject) => {
|
|
102
|
+
stripePromise$1 = new Promise((resolve, reject) => {
|
|
137
103
|
if (typeof window === "undefined") {
|
|
138
104
|
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.");
|
|
139
105
|
return;
|
|
@@ -168,7 +134,7 @@ const loadScript = () => {
|
|
|
168
134
|
reject(error);
|
|
169
135
|
}
|
|
170
136
|
});
|
|
171
|
-
return stripePromise;
|
|
137
|
+
return stripePromise$1;
|
|
172
138
|
};
|
|
173
139
|
const hasCustomMethod = tagName => {
|
|
174
140
|
return tagName in ConnectElementCustomMethodConfig;
|
|
@@ -252,7 +218,7 @@ const createWrapper = stripeConnect => {
|
|
|
252
218
|
sdk: true,
|
|
253
219
|
sdkOptions: {
|
|
254
220
|
// This will be replaced by the npm package version when bundling
|
|
255
|
-
sdkVersion: "3.3.20
|
|
221
|
+
sdkVersion: "3.3.20"
|
|
256
222
|
}
|
|
257
223
|
})
|
|
258
224
|
}));
|
|
@@ -264,16 +230,16 @@ const createWrapper = stripeConnect => {
|
|
|
264
230
|
|
|
265
231
|
// Execute our own script injection after a tick to give users time to do their
|
|
266
232
|
// own script injection.
|
|
267
|
-
const stripePromise
|
|
233
|
+
const stripePromise = Promise.resolve().then(() => loadScript());
|
|
268
234
|
let loadCalled = false;
|
|
269
|
-
stripePromise
|
|
235
|
+
stripePromise.catch(err => {
|
|
270
236
|
if (!loadCalled) {
|
|
271
237
|
console.warn(err);
|
|
272
238
|
}
|
|
273
239
|
});
|
|
274
240
|
const loadConnectAndInitialize = initParams => {
|
|
275
241
|
loadCalled = true;
|
|
276
|
-
return initStripeConnect(stripePromise
|
|
242
|
+
return initStripeConnect(stripePromise, initParams);
|
|
277
243
|
};
|
|
278
244
|
|
|
279
245
|
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 => {},
|
|
@@ -33,7 +29,8 @@ const ConnectElementCustomMethodConfig = {
|
|
|
33
29
|
},
|
|
34
30
|
"issuing-cards-list": {
|
|
35
31
|
setFetchEphemeralKey: _fetchEphemeralKey => {},
|
|
36
|
-
setShowSpendControls: _showSpendControls => {}
|
|
32
|
+
setShowSpendControls: _showSpendControls => {},
|
|
33
|
+
setIssuingProgram: _issuingProgram => {}
|
|
37
34
|
},
|
|
38
35
|
"financial-account": {
|
|
39
36
|
setFinancialAccount: _financialAccount => {}
|
|
@@ -41,77 +38,46 @@ const ConnectElementCustomMethodConfig = {
|
|
|
41
38
|
"financial-account-transactions": {
|
|
42
39
|
setFinancialAccount: _financialAccount => {}
|
|
43
40
|
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
setOnAppInstallStateFetched: _listener => {},
|
|
47
|
-
setOnAppInstallStateChanged: _listener => {}
|
|
48
|
-
},
|
|
49
|
-
"app-viewport": {
|
|
50
|
-
setApp: _app => {},
|
|
51
|
-
setAppData: _appData => {}
|
|
41
|
+
payments: {
|
|
42
|
+
setDefaultFilters: _filters => {}
|
|
52
43
|
},
|
|
53
|
-
"payment-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"capital-financing": {
|
|
57
|
-
setDefaultFinancingOffer: _defaultFinancingOffer => {},
|
|
58
|
-
setShowFinancingSelector: _showFinancingSelector => {},
|
|
59
|
-
setFaqUrl: _faqUrl => {},
|
|
60
|
-
setSupportUrl: _supportUrl => {},
|
|
61
|
-
setOnFinancingsLoaded: _listener => {}
|
|
62
|
-
},
|
|
63
|
-
"capital-financing-application": {
|
|
64
|
-
setOnApplicationSubmitted: _listener => {},
|
|
65
|
-
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
66
|
-
setHowCapitalWorksUrl: _howCapitalWorksUrl => {}
|
|
44
|
+
"payment-details": {
|
|
45
|
+
setPayment: _payment => {},
|
|
46
|
+
setOnClose: _listener => {}
|
|
67
47
|
},
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
73
|
-
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
74
|
-
setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {}
|
|
48
|
+
"tax-settings": {
|
|
49
|
+
setHideProductTaxCodeSelector: _hidden => {},
|
|
50
|
+
setDisplayHeadOfficeCountries: _countries => {},
|
|
51
|
+
setOnTaxSettingsUpdated: _listener => {}
|
|
75
52
|
},
|
|
76
|
-
"
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
setIntervalEnd: _intervalEnd => {},
|
|
80
|
-
setIntervalType: _intervalType => {}
|
|
53
|
+
"tax-registrations": {
|
|
54
|
+
setOnAfterTaxRegistrationAdded: _listener => {},
|
|
55
|
+
setDisplayCountries: _countries => {}
|
|
81
56
|
}
|
|
82
57
|
};
|
|
83
58
|
|
|
84
59
|
const componentNameMapping = {
|
|
60
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
85
61
|
payments: "stripe-connect-payments",
|
|
86
|
-
payouts: "stripe-connect-payouts",
|
|
87
62
|
"payment-details": "stripe-connect-payment-details",
|
|
88
|
-
|
|
89
|
-
"
|
|
63
|
+
payouts: "stripe-connect-payouts",
|
|
64
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
65
|
+
balances: "stripe-connect-balances",
|
|
90
66
|
"account-management": "stripe-connect-account-management",
|
|
91
67
|
"notification-banner": "stripe-connect-notification-banner",
|
|
92
|
-
"instant-payouts": "stripe-connect-instant-payouts",
|
|
93
68
|
"issuing-card": "stripe-connect-issuing-card",
|
|
94
69
|
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
95
70
|
"financial-account": "stripe-connect-financial-account",
|
|
96
71
|
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
97
|
-
"capital-financing": "stripe-connect-capital-financing",
|
|
98
|
-
"capital-financing-application": "stripe-connect-capital-financing-application",
|
|
99
|
-
"capital-financing-promotion": "stripe-connect-capital-financing-promotion",
|
|
100
|
-
"capital-overview": "stripe-connect-capital-overview",
|
|
101
72
|
documents: "stripe-connect-documents",
|
|
102
73
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
103
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
104
|
-
balances: "stripe-connect-balances",
|
|
105
|
-
"payouts-list": "stripe-connect-payouts-list",
|
|
106
|
-
"app-install": "stripe-connect-app-install",
|
|
107
|
-
"app-viewport": "stripe-connect-app-viewport",
|
|
108
|
-
"reporting-chart": "stripe-connect-reporting-chart"
|
|
74
|
+
"tax-settings": "stripe-connect-tax-settings"
|
|
109
75
|
};
|
|
110
76
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
111
77
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
112
78
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
113
79
|
const findScript = () => {
|
|
114
|
-
return document.querySelectorAll(`script[src="${
|
|
80
|
+
return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
115
81
|
};
|
|
116
82
|
const injectScript = () => {
|
|
117
83
|
const script = document.createElement("script");
|
|
@@ -248,7 +214,7 @@ const createWrapper = stripeConnect => {
|
|
|
248
214
|
sdk: true,
|
|
249
215
|
sdkOptions: {
|
|
250
216
|
// This will be replaced by the npm package version when bundling
|
|
251
|
-
sdkVersion: "3.3.20
|
|
217
|
+
sdkVersion: "3.3.20"
|
|
252
218
|
}
|
|
253
219
|
})
|
|
254
220
|
}));
|
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 => {},
|
|
@@ -37,7 +33,8 @@ const ConnectElementCustomMethodConfig = {
|
|
|
37
33
|
},
|
|
38
34
|
"issuing-cards-list": {
|
|
39
35
|
setFetchEphemeralKey: _fetchEphemeralKey => {},
|
|
40
|
-
setShowSpendControls: _showSpendControls => {}
|
|
36
|
+
setShowSpendControls: _showSpendControls => {},
|
|
37
|
+
setIssuingProgram: _issuingProgram => {}
|
|
41
38
|
},
|
|
42
39
|
"financial-account": {
|
|
43
40
|
setFinancialAccount: _financialAccount => {}
|
|
@@ -45,77 +42,46 @@ const ConnectElementCustomMethodConfig = {
|
|
|
45
42
|
"financial-account-transactions": {
|
|
46
43
|
setFinancialAccount: _financialAccount => {}
|
|
47
44
|
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
setOnAppInstallStateFetched: _listener => {},
|
|
51
|
-
setOnAppInstallStateChanged: _listener => {}
|
|
52
|
-
},
|
|
53
|
-
"app-viewport": {
|
|
54
|
-
setApp: _app => {},
|
|
55
|
-
setAppData: _appData => {}
|
|
45
|
+
payments: {
|
|
46
|
+
setDefaultFilters: _filters => {}
|
|
56
47
|
},
|
|
57
|
-
"payment-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"capital-financing": {
|
|
61
|
-
setDefaultFinancingOffer: _defaultFinancingOffer => {},
|
|
62
|
-
setShowFinancingSelector: _showFinancingSelector => {},
|
|
63
|
-
setFaqUrl: _faqUrl => {},
|
|
64
|
-
setSupportUrl: _supportUrl => {},
|
|
65
|
-
setOnFinancingsLoaded: _listener => {}
|
|
66
|
-
},
|
|
67
|
-
"capital-financing-application": {
|
|
68
|
-
setOnApplicationSubmitted: _listener => {},
|
|
69
|
-
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
70
|
-
setHowCapitalWorksUrl: _howCapitalWorksUrl => {}
|
|
48
|
+
"payment-details": {
|
|
49
|
+
setPayment: _payment => {},
|
|
50
|
+
setOnClose: _listener => {}
|
|
71
51
|
},
|
|
72
|
-
"
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
77
|
-
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
78
|
-
setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {}
|
|
52
|
+
"tax-settings": {
|
|
53
|
+
setHideProductTaxCodeSelector: _hidden => {},
|
|
54
|
+
setDisplayHeadOfficeCountries: _countries => {},
|
|
55
|
+
setOnTaxSettingsUpdated: _listener => {}
|
|
79
56
|
},
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
setIntervalEnd: _intervalEnd => {},
|
|
84
|
-
setIntervalType: _intervalType => {}
|
|
57
|
+
"tax-registrations": {
|
|
58
|
+
setOnAfterTaxRegistrationAdded: _listener => {},
|
|
59
|
+
setDisplayCountries: _countries => {}
|
|
85
60
|
}
|
|
86
61
|
};
|
|
87
62
|
|
|
88
63
|
const componentNameMapping = {
|
|
64
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
89
65
|
payments: "stripe-connect-payments",
|
|
90
|
-
payouts: "stripe-connect-payouts",
|
|
91
66
|
"payment-details": "stripe-connect-payment-details",
|
|
92
|
-
|
|
93
|
-
"
|
|
67
|
+
payouts: "stripe-connect-payouts",
|
|
68
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
69
|
+
balances: "stripe-connect-balances",
|
|
94
70
|
"account-management": "stripe-connect-account-management",
|
|
95
71
|
"notification-banner": "stripe-connect-notification-banner",
|
|
96
|
-
"instant-payouts": "stripe-connect-instant-payouts",
|
|
97
72
|
"issuing-card": "stripe-connect-issuing-card",
|
|
98
73
|
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
99
74
|
"financial-account": "stripe-connect-financial-account",
|
|
100
75
|
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
101
|
-
"capital-financing": "stripe-connect-capital-financing",
|
|
102
|
-
"capital-financing-application": "stripe-connect-capital-financing-application",
|
|
103
|
-
"capital-financing-promotion": "stripe-connect-capital-financing-promotion",
|
|
104
|
-
"capital-overview": "stripe-connect-capital-overview",
|
|
105
76
|
documents: "stripe-connect-documents",
|
|
106
77
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
107
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
108
|
-
balances: "stripe-connect-balances",
|
|
109
|
-
"payouts-list": "stripe-connect-payouts-list",
|
|
110
|
-
"app-install": "stripe-connect-app-install",
|
|
111
|
-
"app-viewport": "stripe-connect-app-viewport",
|
|
112
|
-
"reporting-chart": "stripe-connect-reporting-chart"
|
|
78
|
+
"tax-settings": "stripe-connect-tax-settings"
|
|
113
79
|
};
|
|
114
80
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
115
81
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
116
82
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
117
83
|
const findScript = () => {
|
|
118
|
-
return document.querySelectorAll(`script[src="${
|
|
84
|
+
return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
119
85
|
};
|
|
120
86
|
const injectScript = () => {
|
|
121
87
|
const script = document.createElement("script");
|
|
@@ -252,7 +218,7 @@ const createWrapper = stripeConnect => {
|
|
|
252
218
|
sdk: true,
|
|
253
219
|
sdkOptions: {
|
|
254
220
|
// This will be replaced by the npm package version when bundling
|
|
255
|
-
sdkVersion: "3.3.20
|
|
221
|
+
sdkVersion: "3.3.20"
|
|
256
222
|
}
|
|
257
223
|
})
|
|
258
224
|
}));
|
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-issuing-card" | "stripe-connect-issuing-cards-list" | "stripe-connect-financial-account" | "stripe-connect-financial-account-transactions" | "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
|
@@ -10,14 +10,38 @@ export type CollectionOptions = {
|
|
|
10
10
|
fields: "currently_due" | "eventually_due";
|
|
11
11
|
futureRequirements?: "omit" | "include";
|
|
12
12
|
};
|
|
13
|
+
export type Status = "blocked" | "canceled" | "disputed" | "early_fraud_warning" | "failed" | "incomplete" | "partially_refunded" | "pending" | "refund_pending" | "refunded" | "successful" | "uncaptured";
|
|
14
|
+
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";
|
|
15
|
+
export type PaymentsListDefaultFilters = {
|
|
16
|
+
amount?: {
|
|
17
|
+
equals: number;
|
|
18
|
+
} | {
|
|
19
|
+
greaterThan: number;
|
|
20
|
+
} | {
|
|
21
|
+
lessThan: number;
|
|
22
|
+
} | {
|
|
23
|
+
between: {
|
|
24
|
+
lowerBound: number;
|
|
25
|
+
upperBound: number;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
date?: {
|
|
29
|
+
before: Date;
|
|
30
|
+
} | {
|
|
31
|
+
after: Date;
|
|
32
|
+
} | {
|
|
33
|
+
between: {
|
|
34
|
+
start: Date;
|
|
35
|
+
end: Date;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
status?: Array<Status>;
|
|
39
|
+
paymentMethod?: PaymentMethod;
|
|
40
|
+
};
|
|
13
41
|
export type NotificationCount = {
|
|
14
42
|
total: number;
|
|
15
43
|
actionRequired: number;
|
|
16
44
|
};
|
|
17
|
-
export type InstallState = {
|
|
18
|
-
appId: string;
|
|
19
|
-
state: "INSTALLED" | "UNINSTALLED";
|
|
20
|
-
};
|
|
21
45
|
export type LoaderStart = {
|
|
22
46
|
elementTagName: string;
|
|
23
47
|
};
|
|
@@ -32,12 +56,6 @@ export type EmbeddedError = {
|
|
|
32
56
|
type: EmbeddedErrorType;
|
|
33
57
|
message?: string;
|
|
34
58
|
};
|
|
35
|
-
export type FinancingProductType = {
|
|
36
|
-
productType: "standard" | "refill" | "none";
|
|
37
|
-
};
|
|
38
|
-
export type FinancingPromotionLayoutType = "full" | "banner";
|
|
39
|
-
export type IntervalType = "day" | "week" | "month" | "quarter" | "year";
|
|
40
|
-
export type ReportName = "gross_volume" | "net_volume";
|
|
41
59
|
export type EmbeddedErrorType =
|
|
42
60
|
/**
|
|
43
61
|
* Failure to connect to Stripe's API.
|
|
@@ -68,10 +86,6 @@ export declare const ConnectElementCommonMethodConfig: {
|
|
|
68
86
|
setOnLoaderStart: (_listener: (({ elementTagName }: LoaderStart) => void) | undefined) => void;
|
|
69
87
|
};
|
|
70
88
|
export declare const ConnectElementCustomMethodConfig: {
|
|
71
|
-
"payment-details": {
|
|
72
|
-
setPayment: (_payment: string | undefined) => void;
|
|
73
|
-
setOnClose: (_listener: (() => void) | undefined) => void;
|
|
74
|
-
};
|
|
75
89
|
"account-onboarding": {
|
|
76
90
|
setFullTermsOfServiceUrl: (_termOfServiceUrl: string | undefined) => void;
|
|
77
91
|
setRecipientTermsOfServiceUrl: (_recipientTermsOfServiceUrl: string | undefined) => void;
|
|
@@ -97,6 +111,7 @@ export declare const ConnectElementCustomMethodConfig: {
|
|
|
97
111
|
"issuing-cards-list": {
|
|
98
112
|
setFetchEphemeralKey: (_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined) => void;
|
|
99
113
|
setShowSpendControls: (_showSpendControls: boolean | undefined) => void;
|
|
114
|
+
setIssuingProgram: (_issuingProgram: string | undefined) => void;
|
|
100
115
|
};
|
|
101
116
|
"financial-account": {
|
|
102
117
|
setFinancialAccount: (_financialAccount: string) => void;
|
|
@@ -104,44 +119,24 @@ export declare const ConnectElementCustomMethodConfig: {
|
|
|
104
119
|
"financial-account-transactions": {
|
|
105
120
|
setFinancialAccount: (_financialAccount: string) => void;
|
|
106
121
|
};
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
setOnAppInstallStateFetched: (_listener: (({ appId, state }: InstallState) => void) | undefined) => void;
|
|
110
|
-
setOnAppInstallStateChanged: (_listener: (({ appId, state }: InstallState) => void) | undefined) => void;
|
|
122
|
+
payments: {
|
|
123
|
+
setDefaultFilters: (_filters: PaymentsListDefaultFilters | undefined) => void;
|
|
111
124
|
};
|
|
112
|
-
"
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
};
|
|
116
|
-
"payment-method-settings": {
|
|
117
|
-
setPaymentMethodConfiguration: (_paymentMethodConfiguration: string | undefined) => void;
|
|
125
|
+
"payment-details": {
|
|
126
|
+
setPayment: (_payment: string | undefined) => void;
|
|
127
|
+
setOnClose: (_listener: (() => void) | undefined) => void;
|
|
118
128
|
};
|
|
119
|
-
"
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
setOnFinancingsLoaded: (_listener: (({ total }: {
|
|
125
|
-
total: number;
|
|
129
|
+
"tax-settings": {
|
|
130
|
+
setHideProductTaxCodeSelector: (_hidden: boolean | undefined) => void;
|
|
131
|
+
setDisplayHeadOfficeCountries: (_countries: string[] | undefined) => void;
|
|
132
|
+
setOnTaxSettingsUpdated: (_listener: (({ id }: {
|
|
133
|
+
id: string;
|
|
126
134
|
}) => void) | undefined) => void;
|
|
127
135
|
};
|
|
128
|
-
"
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
"capital-financing-promotion": {
|
|
134
|
-
setLayout: (_layout: FinancingPromotionLayoutType | undefined) => void;
|
|
135
|
-
setOnApplicationSubmitted: (_listener: (() => void) | undefined) => void;
|
|
136
|
-
setOnEligibleFinancingOfferLoaded: (_listener: (({ productType }: FinancingProductType) => void) | undefined) => void;
|
|
137
|
-
setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined) => void;
|
|
138
|
-
setHowCapitalWorksUrl: (_howCapitalWorksUrl: string | undefined) => void;
|
|
139
|
-
setEligibilityCriteriaUrl: (_eligibilityCriteriaUrl: string | undefined) => void;
|
|
140
|
-
};
|
|
141
|
-
"reporting-chart": {
|
|
142
|
-
setReportName: (_reportName: ReportName) => void;
|
|
143
|
-
setIntervalStart: (_intervalStart: Date | undefined) => void;
|
|
144
|
-
setIntervalEnd: (_intervalEnd: Date | undefined) => void;
|
|
145
|
-
setIntervalType: (_intervalType: IntervalType | undefined) => void;
|
|
136
|
+
"tax-registrations": {
|
|
137
|
+
setOnAfterTaxRegistrationAdded: (_listener: (({ id }: {
|
|
138
|
+
id: string;
|
|
139
|
+
}) => void) | undefined) => void;
|
|
140
|
+
setDisplayCountries: (_countries: string[] | undefined) => void;
|
|
146
141
|
};
|
|
147
142
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stripe/connect-js",
|
|
3
|
-
"version": "3.3.20
|
|
3
|
+
"version": "3.3.20",
|
|
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,62 +13,43 @@ 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-instant-payouts"
|
|
25
22
|
| "stripe-connect-issuing-card"
|
|
26
23
|
| "stripe-connect-issuing-cards-list"
|
|
27
24
|
| "stripe-connect-financial-account"
|
|
28
25
|
| "stripe-connect-financial-account-transactions"
|
|
29
|
-
| "stripe-connect-
|
|
30
|
-
| "stripe-connect-
|
|
31
|
-
| "stripe-connect-
|
|
32
|
-
| "stripe-connect-capital-overview"
|
|
26
|
+
| "stripe-connect-payouts"
|
|
27
|
+
| "stripe-connect-payouts-list"
|
|
28
|
+
| "stripe-connect-balances"
|
|
33
29
|
| "stripe-connect-documents"
|
|
34
30
|
| "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"
|
|
40
|
-
| "stripe-connect-reporting-chart";
|
|
31
|
+
| "stripe-connect-tax-settings";
|
|
41
32
|
|
|
42
33
|
export const componentNameMapping: Record<
|
|
43
34
|
ConnectElementTagName,
|
|
44
35
|
ConnectElementHTMLName
|
|
45
36
|
> = {
|
|
37
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
46
38
|
payments: "stripe-connect-payments",
|
|
47
|
-
payouts: "stripe-connect-payouts",
|
|
48
39
|
"payment-details": "stripe-connect-payment-details",
|
|
49
|
-
|
|
50
|
-
"
|
|
40
|
+
payouts: "stripe-connect-payouts",
|
|
41
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
42
|
+
balances: "stripe-connect-balances",
|
|
51
43
|
"account-management": "stripe-connect-account-management",
|
|
52
44
|
"notification-banner": "stripe-connect-notification-banner",
|
|
53
|
-
"instant-payouts": "stripe-connect-instant-payouts",
|
|
54
45
|
"issuing-card": "stripe-connect-issuing-card",
|
|
55
46
|
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
56
47
|
"financial-account": "stripe-connect-financial-account",
|
|
57
48
|
"financial-account-transactions":
|
|
58
49
|
"stripe-connect-financial-account-transactions",
|
|
59
|
-
"capital-financing": "stripe-connect-capital-financing",
|
|
60
|
-
"capital-financing-application":
|
|
61
|
-
"stripe-connect-capital-financing-application",
|
|
62
|
-
"capital-financing-promotion": "stripe-connect-capital-financing-promotion",
|
|
63
|
-
"capital-overview": "stripe-connect-capital-overview",
|
|
64
50
|
documents: "stripe-connect-documents",
|
|
65
51
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
66
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
67
|
-
balances: "stripe-connect-balances",
|
|
68
|
-
"payouts-list": "stripe-connect-payouts-list",
|
|
69
|
-
"app-install": "stripe-connect-app-install",
|
|
70
|
-
"app-viewport": "stripe-connect-app-viewport",
|
|
71
|
-
"reporting-chart": "stripe-connect-reporting-chart"
|
|
52
|
+
"tax-settings": "stripe-connect-tax-settings"
|
|
72
53
|
};
|
|
73
54
|
|
|
74
55
|
type StripeConnectInstanceExtended = StripeConnectInstance & {
|
|
@@ -87,10 +68,10 @@ const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
|
87
68
|
export const findScript = (): HTMLScriptElement | null => {
|
|
88
69
|
return (
|
|
89
70
|
document.querySelectorAll<HTMLScriptElement>(
|
|
90
|
-
`script[src="${
|
|
71
|
+
`script[src="${V1_URL}"]`
|
|
91
72
|
)[0] ||
|
|
92
73
|
document.querySelectorAll<HTMLScriptElement>(
|
|
93
|
-
`script[src="${
|
|
74
|
+
`script[src="${V0_URL}"]`
|
|
94
75
|
)[0] ||
|
|
95
76
|
null
|
|
96
77
|
);
|
package/types/config.ts
CHANGED
|
@@ -15,16 +15,125 @@ export type CollectionOptions = {
|
|
|
15
15
|
futureRequirements?: "omit" | "include";
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
+
export type Status =
|
|
19
|
+
| "blocked"
|
|
20
|
+
| "canceled"
|
|
21
|
+
| "disputed"
|
|
22
|
+
| "early_fraud_warning"
|
|
23
|
+
| "failed"
|
|
24
|
+
| "incomplete"
|
|
25
|
+
| "partially_refunded"
|
|
26
|
+
| "pending"
|
|
27
|
+
| "refund_pending"
|
|
28
|
+
| "refunded"
|
|
29
|
+
| "successful"
|
|
30
|
+
| "uncaptured";
|
|
31
|
+
|
|
32
|
+
export type PaymentMethod =
|
|
33
|
+
| "ach_credit_transfer"
|
|
34
|
+
| "ach_debit"
|
|
35
|
+
| "acss_debit"
|
|
36
|
+
| "affirm"
|
|
37
|
+
| "afterpay_clearpay"
|
|
38
|
+
| "alipay"
|
|
39
|
+
| "alma"
|
|
40
|
+
| "amazon_pay"
|
|
41
|
+
| "amex_express_checkout"
|
|
42
|
+
| "android_pay"
|
|
43
|
+
| "apple_pay"
|
|
44
|
+
| "au_becs_debit"
|
|
45
|
+
| "nz_bank_account"
|
|
46
|
+
| "bancontact"
|
|
47
|
+
| "bacs_debit"
|
|
48
|
+
| "bitcoin_source"
|
|
49
|
+
| "bitcoin"
|
|
50
|
+
| "blik"
|
|
51
|
+
| "boleto"
|
|
52
|
+
| "boleto_pilot"
|
|
53
|
+
| "card_present"
|
|
54
|
+
| "card"
|
|
55
|
+
| "cashapp"
|
|
56
|
+
| "crypto"
|
|
57
|
+
| "customer_balance"
|
|
58
|
+
| "demo_pay"
|
|
59
|
+
| "dummy_passthrough_card"
|
|
60
|
+
| "gbp_credit_transfer"
|
|
61
|
+
| "google_pay"
|
|
62
|
+
| "eps"
|
|
63
|
+
| "fpx"
|
|
64
|
+
| "giropay"
|
|
65
|
+
| "grabpay"
|
|
66
|
+
| "ideal"
|
|
67
|
+
| "id_bank_transfer"
|
|
68
|
+
| "id_credit_transfer"
|
|
69
|
+
| "jp_credit_transfer"
|
|
70
|
+
| "interac_present"
|
|
71
|
+
| "kakao_pay"
|
|
72
|
+
| "klarna"
|
|
73
|
+
| "konbini"
|
|
74
|
+
| "kr_card"
|
|
75
|
+
| "kr_market"
|
|
76
|
+
| "link"
|
|
77
|
+
| "masterpass"
|
|
78
|
+
| "mb_way"
|
|
79
|
+
| "meta_pay"
|
|
80
|
+
| "multibanco"
|
|
81
|
+
| "mobilepay"
|
|
82
|
+
| "naver_pay"
|
|
83
|
+
| "netbanking"
|
|
84
|
+
| "ng_bank"
|
|
85
|
+
| "ng_bank_transfer"
|
|
86
|
+
| "ng_card"
|
|
87
|
+
| "ng_market"
|
|
88
|
+
| "ng_ussd"
|
|
89
|
+
| "vipps"
|
|
90
|
+
| "oxxo"
|
|
91
|
+
| "p24"
|
|
92
|
+
| "payto"
|
|
93
|
+
| "pay_by_bank"
|
|
94
|
+
| "paper_check"
|
|
95
|
+
| "payco"
|
|
96
|
+
| "paynow"
|
|
97
|
+
| "paypal"
|
|
98
|
+
| "pix"
|
|
99
|
+
| "promptpay"
|
|
100
|
+
| "revolut_pay"
|
|
101
|
+
| "samsung_pay"
|
|
102
|
+
| "sepa_credit_transfer"
|
|
103
|
+
| "sepa_debit"
|
|
104
|
+
| "sofort"
|
|
105
|
+
| "south_korea_market"
|
|
106
|
+
| "swish"
|
|
107
|
+
| "three_d_secure"
|
|
108
|
+
| "three_d_secure_2"
|
|
109
|
+
| "three_d_secure_2_eap"
|
|
110
|
+
| "twint"
|
|
111
|
+
| "upi"
|
|
112
|
+
| "us_bank_account"
|
|
113
|
+
| "visa_checkout"
|
|
114
|
+
| "wechat"
|
|
115
|
+
| "wechat_pay"
|
|
116
|
+
| "zip";
|
|
117
|
+
|
|
118
|
+
export type PaymentsListDefaultFilters = {
|
|
119
|
+
amount?:
|
|
120
|
+
| { equals: number }
|
|
121
|
+
| { greaterThan: number }
|
|
122
|
+
| { lessThan: number }
|
|
123
|
+
| { between: { lowerBound: number; upperBound: number } };
|
|
124
|
+
date?:
|
|
125
|
+
| { before: Date }
|
|
126
|
+
| { after: Date }
|
|
127
|
+
| { between: { start: Date; end: Date } };
|
|
128
|
+
status?: Array<Status>;
|
|
129
|
+
paymentMethod?: PaymentMethod;
|
|
130
|
+
};
|
|
131
|
+
|
|
18
132
|
export type NotificationCount = {
|
|
19
133
|
total: number;
|
|
20
134
|
actionRequired: number;
|
|
21
135
|
};
|
|
22
136
|
|
|
23
|
-
export type InstallState = {
|
|
24
|
-
appId: string;
|
|
25
|
-
state: "INSTALLED" | "UNINSTALLED";
|
|
26
|
-
};
|
|
27
|
-
|
|
28
137
|
export type LoaderStart = {
|
|
29
138
|
elementTagName: string;
|
|
30
139
|
};
|
|
@@ -43,16 +152,6 @@ export type EmbeddedError = {
|
|
|
43
152
|
message?: string;
|
|
44
153
|
};
|
|
45
154
|
|
|
46
|
-
export type FinancingProductType = {
|
|
47
|
-
productType: "standard" | "refill" | "none";
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export type FinancingPromotionLayoutType = "full" | "banner";
|
|
51
|
-
|
|
52
|
-
export type IntervalType = "day" | "week" | "month" | "quarter" | "year";
|
|
53
|
-
|
|
54
|
-
export type ReportName = "gross_volume" | "net_volume";
|
|
55
|
-
|
|
56
155
|
export type EmbeddedErrorType =
|
|
57
156
|
/**
|
|
58
157
|
* Failure to connect to Stripe's API.
|
|
@@ -89,10 +188,6 @@ export const ConnectElementCommonMethodConfig = {
|
|
|
89
188
|
};
|
|
90
189
|
|
|
91
190
|
export const ConnectElementCustomMethodConfig = {
|
|
92
|
-
"payment-details": {
|
|
93
|
-
setPayment: (_payment: string | undefined): void => {},
|
|
94
|
-
setOnClose: (_listener: (() => void) | undefined): void => {}
|
|
95
|
-
},
|
|
96
191
|
"account-onboarding": {
|
|
97
192
|
setFullTermsOfServiceUrl: (
|
|
98
193
|
_termOfServiceUrl: string | undefined
|
|
@@ -139,7 +234,8 @@ export const ConnectElementCustomMethodConfig = {
|
|
|
139
234
|
setFetchEphemeralKey: (
|
|
140
235
|
_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined
|
|
141
236
|
): void => {},
|
|
142
|
-
setShowSpendControls: (_showSpendControls: boolean | undefined): void => {}
|
|
237
|
+
setShowSpendControls: (_showSpendControls: boolean | undefined): void => {},
|
|
238
|
+
setIssuingProgram: (_issuingProgram: string | undefined): void => {}
|
|
143
239
|
},
|
|
144
240
|
"financial-account": {
|
|
145
241
|
setFinancialAccount: (_financialAccount: string): void => {}
|
|
@@ -147,64 +243,28 @@ export const ConnectElementCustomMethodConfig = {
|
|
|
147
243
|
"financial-account-transactions": {
|
|
148
244
|
setFinancialAccount: (_financialAccount: string): void => {}
|
|
149
245
|
},
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
_listener: (({ appId, state }: InstallState) => void) | undefined
|
|
154
|
-
): void => {},
|
|
155
|
-
setOnAppInstallStateChanged: (
|
|
156
|
-
_listener: (({ appId, state }: InstallState) => void) | undefined
|
|
246
|
+
payments: {
|
|
247
|
+
setDefaultFilters: (
|
|
248
|
+
_filters: PaymentsListDefaultFilters | undefined
|
|
157
249
|
): void => {}
|
|
158
250
|
},
|
|
159
|
-
"
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
},
|
|
163
|
-
"payment-method-settings": {
|
|
164
|
-
setPaymentMethodConfiguration: (
|
|
165
|
-
_paymentMethodConfiguration: string | undefined
|
|
166
|
-
): void => {}
|
|
251
|
+
"payment-details": {
|
|
252
|
+
setPayment: (_payment: string | undefined): void => {},
|
|
253
|
+
setOnClose: (_listener: (() => void) | undefined): void => {}
|
|
167
254
|
},
|
|
168
|
-
"
|
|
169
|
-
|
|
170
|
-
|
|
255
|
+
"tax-settings": {
|
|
256
|
+
setHideProductTaxCodeSelector: (_hidden: boolean | undefined): void => {},
|
|
257
|
+
setDisplayHeadOfficeCountries: (
|
|
258
|
+
_countries: string[] | undefined
|
|
171
259
|
): void => {},
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
): void => {},
|
|
175
|
-
setFaqUrl: (_faqUrl: string | undefined): void => {},
|
|
176
|
-
setSupportUrl: (_supportUrl: string | undefined): void => {},
|
|
177
|
-
setOnFinancingsLoaded: (
|
|
178
|
-
_listener: (({ total }: { total: number }) => void) | undefined
|
|
260
|
+
setOnTaxSettingsUpdated: (
|
|
261
|
+
_listener: (({ id }: { id: string }) => void) | undefined
|
|
179
262
|
): void => {}
|
|
180
263
|
},
|
|
181
|
-
"
|
|
182
|
-
|
|
183
|
-
_listener: (() => void) | undefined
|
|
264
|
+
"tax-registrations": {
|
|
265
|
+
setOnAfterTaxRegistrationAdded: (
|
|
266
|
+
_listener: (({ id }: { id: string }) => void) | undefined
|
|
184
267
|
): void => {},
|
|
185
|
-
|
|
186
|
-
setHowCapitalWorksUrl: (_howCapitalWorksUrl: string | undefined): void => {}
|
|
187
|
-
},
|
|
188
|
-
"capital-financing-promotion": {
|
|
189
|
-
setLayout: (_layout: FinancingPromotionLayoutType | undefined): void => {},
|
|
190
|
-
setOnApplicationSubmitted: (
|
|
191
|
-
_listener: (() => void) | undefined
|
|
192
|
-
): void => {},
|
|
193
|
-
setOnEligibleFinancingOfferLoaded: (
|
|
194
|
-
_listener: (({ productType }: FinancingProductType) => void) | undefined
|
|
195
|
-
): void => {},
|
|
196
|
-
setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined): void => {},
|
|
197
|
-
setHowCapitalWorksUrl: (
|
|
198
|
-
_howCapitalWorksUrl: string | undefined
|
|
199
|
-
): void => {},
|
|
200
|
-
setEligibilityCriteriaUrl: (
|
|
201
|
-
_eligibilityCriteriaUrl: string | undefined
|
|
202
|
-
): void => {}
|
|
203
|
-
},
|
|
204
|
-
"reporting-chart": {
|
|
205
|
-
setReportName: (_reportName: ReportName): void => {},
|
|
206
|
-
setIntervalStart: (_intervalStart: Date | undefined): void => {},
|
|
207
|
-
setIntervalEnd: (_intervalEnd: Date | undefined): void => {},
|
|
208
|
-
setIntervalType: (_intervalType: IntervalType | undefined): void => {}
|
|
268
|
+
setDisplayCountries: (_countries: string[] | undefined): void => {}
|
|
209
269
|
}
|
|
210
270
|
};
|
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,27 +488,18 @@ 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
|
-
| "instant-payouts"
|
|
462
496
|
| "issuing-card"
|
|
463
497
|
| "issuing-cards-list"
|
|
464
498
|
| "financial-account"
|
|
465
499
|
| "financial-account-transactions"
|
|
466
|
-
| "
|
|
467
|
-
| "
|
|
468
|
-
| "
|
|
469
|
-
| "capital-overview"
|
|
500
|
+
| "payouts"
|
|
501
|
+
| "payouts-list"
|
|
502
|
+
| "balances"
|
|
470
503
|
| "documents"
|
|
471
504
|
| "tax-registrations"
|
|
472
|
-
| "tax-settings"
|
|
473
|
-
| "balances"
|
|
474
|
-
| "payouts-list"
|
|
475
|
-
| "app-install"
|
|
476
|
-
| "app-viewport"
|
|
477
|
-
| "reporting-chart";
|
|
505
|
+
| "tax-settings";
|