@stripe/connect-js 3.3.21-preview-1 → 3.3.21
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 -66
- package/dist/connect.js +27 -66
- package/dist/pure.esm.js +19 -58
- package/dist/pure.js +19 -58
- package/dist/src/shared.d.ts +1 -1
- package/dist/types/config.d.ts +43 -53
- package/package.json +2 -2
- package/src/shared.ts +13 -34
- package/types/config.ts +130 -78
- package/types/shared.d.ts +6 -15
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 => {},
|
|
@@ -42,81 +38,46 @@ const ConnectElementCustomMethodConfig = {
|
|
|
42
38
|
"financial-account-transactions": {
|
|
43
39
|
setFinancialAccount: _financialAccount => {}
|
|
44
40
|
},
|
|
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 => {}
|
|
41
|
+
payments: {
|
|
42
|
+
setDefaultFilters: _filters => {}
|
|
56
43
|
},
|
|
57
|
-
"payment-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"capital-financing": {
|
|
61
|
-
setDefaultFinancingOffer: _defaultFinancingOffer => {},
|
|
62
|
-
setShowFinancingSelector: _showFinancingSelector => {},
|
|
63
|
-
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
64
|
-
setSupportUrl: _supportUrl => {},
|
|
65
|
-
setOnFinancingsLoaded: _listener => {}
|
|
66
|
-
},
|
|
67
|
-
"capital-financing-application": {
|
|
68
|
-
setOnApplicationSubmitted: _listener => {},
|
|
69
|
-
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
70
|
-
setHowCapitalWorksUrl: _howCapitalWorksUrl => {}
|
|
44
|
+
"payment-details": {
|
|
45
|
+
setPayment: _payment => {},
|
|
46
|
+
setOnClose: _listener => {}
|
|
71
47
|
},
|
|
72
|
-
"
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
77
|
-
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
78
|
-
setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {}
|
|
48
|
+
"tax-settings": {
|
|
49
|
+
setHideProductTaxCodeSelector: _hidden => {},
|
|
50
|
+
setDisplayHeadOfficeCountries: _countries => {},
|
|
51
|
+
setOnTaxSettingsUpdated: _listener => {}
|
|
79
52
|
},
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
setIntervalEnd: _intervalEnd => {},
|
|
84
|
-
setIntervalType: _intervalType => {}
|
|
53
|
+
"tax-registrations": {
|
|
54
|
+
setOnAfterTaxRegistrationAdded: _listener => {},
|
|
55
|
+
setDisplayCountries: _countries => {}
|
|
85
56
|
}
|
|
86
57
|
};
|
|
87
58
|
|
|
88
59
|
const componentNameMapping = {
|
|
60
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
89
61
|
payments: "stripe-connect-payments",
|
|
90
|
-
payouts: "stripe-connect-payouts",
|
|
91
62
|
"payment-details": "stripe-connect-payment-details",
|
|
92
|
-
|
|
93
|
-
"
|
|
63
|
+
payouts: "stripe-connect-payouts",
|
|
64
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
65
|
+
balances: "stripe-connect-balances",
|
|
94
66
|
"account-management": "stripe-connect-account-management",
|
|
95
67
|
"notification-banner": "stripe-connect-notification-banner",
|
|
96
|
-
"instant-payouts": "stripe-connect-instant-payouts",
|
|
97
68
|
"issuing-card": "stripe-connect-issuing-card",
|
|
98
69
|
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
99
70
|
"financial-account": "stripe-connect-financial-account",
|
|
100
|
-
recipients: "stripe-connect-recipients",
|
|
101
71
|
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
102
|
-
"capital-financing": "stripe-connect-capital-financing",
|
|
103
|
-
"capital-financing-application": "stripe-connect-capital-financing-application",
|
|
104
|
-
"capital-financing-promotion": "stripe-connect-capital-financing-promotion",
|
|
105
|
-
"capital-overview": "stripe-connect-capital-overview",
|
|
106
72
|
documents: "stripe-connect-documents",
|
|
107
73
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
108
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
109
|
-
balances: "stripe-connect-balances",
|
|
110
|
-
"payouts-list": "stripe-connect-payouts-list",
|
|
111
|
-
"app-install": "stripe-connect-app-install",
|
|
112
|
-
"app-viewport": "stripe-connect-app-viewport",
|
|
113
|
-
"reporting-chart": "stripe-connect-reporting-chart"
|
|
74
|
+
"tax-settings": "stripe-connect-tax-settings"
|
|
114
75
|
};
|
|
115
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";
|
|
116
77
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
117
78
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
118
79
|
const findScript = () => {
|
|
119
|
-
return document.querySelectorAll(`script[src="${
|
|
80
|
+
return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
120
81
|
};
|
|
121
82
|
const injectScript = () => {
|
|
122
83
|
const script = document.createElement("script");
|
|
@@ -128,13 +89,13 @@ const injectScript = () => {
|
|
|
128
89
|
document.head.appendChild(script);
|
|
129
90
|
return script;
|
|
130
91
|
};
|
|
131
|
-
let stripePromise = null;
|
|
92
|
+
let stripePromise$1 = null;
|
|
132
93
|
const loadScript = () => {
|
|
133
94
|
// Ensure that we only attempt to load Connect.js at most once
|
|
134
|
-
if (stripePromise !== null) {
|
|
135
|
-
return stripePromise;
|
|
95
|
+
if (stripePromise$1 !== null) {
|
|
96
|
+
return stripePromise$1;
|
|
136
97
|
}
|
|
137
|
-
stripePromise = new Promise((resolve, reject) => {
|
|
98
|
+
stripePromise$1 = new Promise((resolve, reject) => {
|
|
138
99
|
if (typeof window === "undefined") {
|
|
139
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.");
|
|
140
101
|
return;
|
|
@@ -169,7 +130,7 @@ const loadScript = () => {
|
|
|
169
130
|
reject(error);
|
|
170
131
|
}
|
|
171
132
|
});
|
|
172
|
-
return stripePromise;
|
|
133
|
+
return stripePromise$1;
|
|
173
134
|
};
|
|
174
135
|
const hasCustomMethod = tagName => {
|
|
175
136
|
return tagName in ConnectElementCustomMethodConfig;
|
|
@@ -253,7 +214,7 @@ const createWrapper = stripeConnect => {
|
|
|
253
214
|
sdk: true,
|
|
254
215
|
sdkOptions: {
|
|
255
216
|
// This will be replaced by the npm package version when bundling
|
|
256
|
-
sdkVersion: "3.3.21
|
|
217
|
+
sdkVersion: "3.3.21"
|
|
257
218
|
}
|
|
258
219
|
})
|
|
259
220
|
}));
|
|
@@ -265,16 +226,16 @@ const createWrapper = stripeConnect => {
|
|
|
265
226
|
|
|
266
227
|
// Execute our own script injection after a tick to give users time to do their
|
|
267
228
|
// own script injection.
|
|
268
|
-
const stripePromise
|
|
229
|
+
const stripePromise = Promise.resolve().then(() => loadScript());
|
|
269
230
|
let loadCalled = false;
|
|
270
|
-
stripePromise
|
|
231
|
+
stripePromise.catch(err => {
|
|
271
232
|
if (!loadCalled) {
|
|
272
233
|
console.warn(err);
|
|
273
234
|
}
|
|
274
235
|
});
|
|
275
236
|
const loadConnectAndInitialize = initParams => {
|
|
276
237
|
loadCalled = true;
|
|
277
|
-
return initStripeConnect(stripePromise
|
|
238
|
+
return initStripeConnect(stripePromise, initParams);
|
|
278
239
|
};
|
|
279
240
|
|
|
280
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 => {},
|
|
@@ -46,81 +42,46 @@ const ConnectElementCustomMethodConfig = {
|
|
|
46
42
|
"financial-account-transactions": {
|
|
47
43
|
setFinancialAccount: _financialAccount => {}
|
|
48
44
|
},
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
},
|
|
52
|
-
"app-install": {
|
|
53
|
-
setApp: _app => {},
|
|
54
|
-
setOnAppInstallStateFetched: _listener => {},
|
|
55
|
-
setOnAppInstallStateChanged: _listener => {}
|
|
56
|
-
},
|
|
57
|
-
"app-viewport": {
|
|
58
|
-
setApp: _app => {},
|
|
59
|
-
setAppData: _appData => {}
|
|
45
|
+
payments: {
|
|
46
|
+
setDefaultFilters: _filters => {}
|
|
60
47
|
},
|
|
61
|
-
"payment-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
"capital-financing": {
|
|
65
|
-
setDefaultFinancingOffer: _defaultFinancingOffer => {},
|
|
66
|
-
setShowFinancingSelector: _showFinancingSelector => {},
|
|
67
|
-
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
68
|
-
setSupportUrl: _supportUrl => {},
|
|
69
|
-
setOnFinancingsLoaded: _listener => {}
|
|
70
|
-
},
|
|
71
|
-
"capital-financing-application": {
|
|
72
|
-
setOnApplicationSubmitted: _listener => {},
|
|
73
|
-
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
74
|
-
setHowCapitalWorksUrl: _howCapitalWorksUrl => {}
|
|
48
|
+
"payment-details": {
|
|
49
|
+
setPayment: _payment => {},
|
|
50
|
+
setOnClose: _listener => {}
|
|
75
51
|
},
|
|
76
|
-
"
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
81
|
-
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
82
|
-
setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {}
|
|
52
|
+
"tax-settings": {
|
|
53
|
+
setHideProductTaxCodeSelector: _hidden => {},
|
|
54
|
+
setDisplayHeadOfficeCountries: _countries => {},
|
|
55
|
+
setOnTaxSettingsUpdated: _listener => {}
|
|
83
56
|
},
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
setIntervalEnd: _intervalEnd => {},
|
|
88
|
-
setIntervalType: _intervalType => {}
|
|
57
|
+
"tax-registrations": {
|
|
58
|
+
setOnAfterTaxRegistrationAdded: _listener => {},
|
|
59
|
+
setDisplayCountries: _countries => {}
|
|
89
60
|
}
|
|
90
61
|
};
|
|
91
62
|
|
|
92
63
|
const componentNameMapping = {
|
|
64
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
93
65
|
payments: "stripe-connect-payments",
|
|
94
|
-
payouts: "stripe-connect-payouts",
|
|
95
66
|
"payment-details": "stripe-connect-payment-details",
|
|
96
|
-
|
|
97
|
-
"
|
|
67
|
+
payouts: "stripe-connect-payouts",
|
|
68
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
69
|
+
balances: "stripe-connect-balances",
|
|
98
70
|
"account-management": "stripe-connect-account-management",
|
|
99
71
|
"notification-banner": "stripe-connect-notification-banner",
|
|
100
|
-
"instant-payouts": "stripe-connect-instant-payouts",
|
|
101
72
|
"issuing-card": "stripe-connect-issuing-card",
|
|
102
73
|
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
103
74
|
"financial-account": "stripe-connect-financial-account",
|
|
104
|
-
recipients: "stripe-connect-recipients",
|
|
105
75
|
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
106
|
-
"capital-financing": "stripe-connect-capital-financing",
|
|
107
|
-
"capital-financing-application": "stripe-connect-capital-financing-application",
|
|
108
|
-
"capital-financing-promotion": "stripe-connect-capital-financing-promotion",
|
|
109
|
-
"capital-overview": "stripe-connect-capital-overview",
|
|
110
76
|
documents: "stripe-connect-documents",
|
|
111
77
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
112
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
113
|
-
balances: "stripe-connect-balances",
|
|
114
|
-
"payouts-list": "stripe-connect-payouts-list",
|
|
115
|
-
"app-install": "stripe-connect-app-install",
|
|
116
|
-
"app-viewport": "stripe-connect-app-viewport",
|
|
117
|
-
"reporting-chart": "stripe-connect-reporting-chart"
|
|
78
|
+
"tax-settings": "stripe-connect-tax-settings"
|
|
118
79
|
};
|
|
119
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";
|
|
120
81
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
121
82
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
122
83
|
const findScript = () => {
|
|
123
|
-
return document.querySelectorAll(`script[src="${
|
|
84
|
+
return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
124
85
|
};
|
|
125
86
|
const injectScript = () => {
|
|
126
87
|
const script = document.createElement("script");
|
|
@@ -132,13 +93,13 @@ const injectScript = () => {
|
|
|
132
93
|
document.head.appendChild(script);
|
|
133
94
|
return script;
|
|
134
95
|
};
|
|
135
|
-
let stripePromise = null;
|
|
96
|
+
let stripePromise$1 = null;
|
|
136
97
|
const loadScript = () => {
|
|
137
98
|
// Ensure that we only attempt to load Connect.js at most once
|
|
138
|
-
if (stripePromise !== null) {
|
|
139
|
-
return stripePromise;
|
|
99
|
+
if (stripePromise$1 !== null) {
|
|
100
|
+
return stripePromise$1;
|
|
140
101
|
}
|
|
141
|
-
stripePromise = new Promise((resolve, reject) => {
|
|
102
|
+
stripePromise$1 = new Promise((resolve, reject) => {
|
|
142
103
|
if (typeof window === "undefined") {
|
|
143
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.");
|
|
144
105
|
return;
|
|
@@ -173,7 +134,7 @@ const loadScript = () => {
|
|
|
173
134
|
reject(error);
|
|
174
135
|
}
|
|
175
136
|
});
|
|
176
|
-
return stripePromise;
|
|
137
|
+
return stripePromise$1;
|
|
177
138
|
};
|
|
178
139
|
const hasCustomMethod = tagName => {
|
|
179
140
|
return tagName in ConnectElementCustomMethodConfig;
|
|
@@ -257,7 +218,7 @@ const createWrapper = stripeConnect => {
|
|
|
257
218
|
sdk: true,
|
|
258
219
|
sdkOptions: {
|
|
259
220
|
// This will be replaced by the npm package version when bundling
|
|
260
|
-
sdkVersion: "3.3.21
|
|
221
|
+
sdkVersion: "3.3.21"
|
|
261
222
|
}
|
|
262
223
|
})
|
|
263
224
|
}));
|
|
@@ -269,16 +230,16 @@ const createWrapper = stripeConnect => {
|
|
|
269
230
|
|
|
270
231
|
// Execute our own script injection after a tick to give users time to do their
|
|
271
232
|
// own script injection.
|
|
272
|
-
const stripePromise
|
|
233
|
+
const stripePromise = Promise.resolve().then(() => loadScript());
|
|
273
234
|
let loadCalled = false;
|
|
274
|
-
stripePromise
|
|
235
|
+
stripePromise.catch(err => {
|
|
275
236
|
if (!loadCalled) {
|
|
276
237
|
console.warn(err);
|
|
277
238
|
}
|
|
278
239
|
});
|
|
279
240
|
const loadConnectAndInitialize = initParams => {
|
|
280
241
|
loadCalled = true;
|
|
281
|
-
return initStripeConnect(stripePromise
|
|
242
|
+
return initStripeConnect(stripePromise, initParams);
|
|
282
243
|
};
|
|
283
244
|
|
|
284
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 => {},
|
|
@@ -42,81 +38,46 @@ const ConnectElementCustomMethodConfig = {
|
|
|
42
38
|
"financial-account-transactions": {
|
|
43
39
|
setFinancialAccount: _financialAccount => {}
|
|
44
40
|
},
|
|
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 => {}
|
|
41
|
+
payments: {
|
|
42
|
+
setDefaultFilters: _filters => {}
|
|
56
43
|
},
|
|
57
|
-
"payment-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"capital-financing": {
|
|
61
|
-
setDefaultFinancingOffer: _defaultFinancingOffer => {},
|
|
62
|
-
setShowFinancingSelector: _showFinancingSelector => {},
|
|
63
|
-
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
64
|
-
setSupportUrl: _supportUrl => {},
|
|
65
|
-
setOnFinancingsLoaded: _listener => {}
|
|
66
|
-
},
|
|
67
|
-
"capital-financing-application": {
|
|
68
|
-
setOnApplicationSubmitted: _listener => {},
|
|
69
|
-
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
70
|
-
setHowCapitalWorksUrl: _howCapitalWorksUrl => {}
|
|
44
|
+
"payment-details": {
|
|
45
|
+
setPayment: _payment => {},
|
|
46
|
+
setOnClose: _listener => {}
|
|
71
47
|
},
|
|
72
|
-
"
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
77
|
-
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
78
|
-
setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {}
|
|
48
|
+
"tax-settings": {
|
|
49
|
+
setHideProductTaxCodeSelector: _hidden => {},
|
|
50
|
+
setDisplayHeadOfficeCountries: _countries => {},
|
|
51
|
+
setOnTaxSettingsUpdated: _listener => {}
|
|
79
52
|
},
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
setIntervalEnd: _intervalEnd => {},
|
|
84
|
-
setIntervalType: _intervalType => {}
|
|
53
|
+
"tax-registrations": {
|
|
54
|
+
setOnAfterTaxRegistrationAdded: _listener => {},
|
|
55
|
+
setDisplayCountries: _countries => {}
|
|
85
56
|
}
|
|
86
57
|
};
|
|
87
58
|
|
|
88
59
|
const componentNameMapping = {
|
|
60
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
89
61
|
payments: "stripe-connect-payments",
|
|
90
|
-
payouts: "stripe-connect-payouts",
|
|
91
62
|
"payment-details": "stripe-connect-payment-details",
|
|
92
|
-
|
|
93
|
-
"
|
|
63
|
+
payouts: "stripe-connect-payouts",
|
|
64
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
65
|
+
balances: "stripe-connect-balances",
|
|
94
66
|
"account-management": "stripe-connect-account-management",
|
|
95
67
|
"notification-banner": "stripe-connect-notification-banner",
|
|
96
|
-
"instant-payouts": "stripe-connect-instant-payouts",
|
|
97
68
|
"issuing-card": "stripe-connect-issuing-card",
|
|
98
69
|
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
99
70
|
"financial-account": "stripe-connect-financial-account",
|
|
100
|
-
recipients: "stripe-connect-recipients",
|
|
101
71
|
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
102
|
-
"capital-financing": "stripe-connect-capital-financing",
|
|
103
|
-
"capital-financing-application": "stripe-connect-capital-financing-application",
|
|
104
|
-
"capital-financing-promotion": "stripe-connect-capital-financing-promotion",
|
|
105
|
-
"capital-overview": "stripe-connect-capital-overview",
|
|
106
72
|
documents: "stripe-connect-documents",
|
|
107
73
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
108
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
109
|
-
balances: "stripe-connect-balances",
|
|
110
|
-
"payouts-list": "stripe-connect-payouts-list",
|
|
111
|
-
"app-install": "stripe-connect-app-install",
|
|
112
|
-
"app-viewport": "stripe-connect-app-viewport",
|
|
113
|
-
"reporting-chart": "stripe-connect-reporting-chart"
|
|
74
|
+
"tax-settings": "stripe-connect-tax-settings"
|
|
114
75
|
};
|
|
115
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";
|
|
116
77
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
117
78
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
118
79
|
const findScript = () => {
|
|
119
|
-
return document.querySelectorAll(`script[src="${
|
|
80
|
+
return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
120
81
|
};
|
|
121
82
|
const injectScript = () => {
|
|
122
83
|
const script = document.createElement("script");
|
|
@@ -253,7 +214,7 @@ const createWrapper = stripeConnect => {
|
|
|
253
214
|
sdk: true,
|
|
254
215
|
sdkOptions: {
|
|
255
216
|
// This will be replaced by the npm package version when bundling
|
|
256
|
-
sdkVersion: "3.3.21
|
|
217
|
+
sdkVersion: "3.3.21"
|
|
257
218
|
}
|
|
258
219
|
})
|
|
259
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 => {},
|
|
@@ -46,81 +42,46 @@ const ConnectElementCustomMethodConfig = {
|
|
|
46
42
|
"financial-account-transactions": {
|
|
47
43
|
setFinancialAccount: _financialAccount => {}
|
|
48
44
|
},
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
},
|
|
52
|
-
"app-install": {
|
|
53
|
-
setApp: _app => {},
|
|
54
|
-
setOnAppInstallStateFetched: _listener => {},
|
|
55
|
-
setOnAppInstallStateChanged: _listener => {}
|
|
56
|
-
},
|
|
57
|
-
"app-viewport": {
|
|
58
|
-
setApp: _app => {},
|
|
59
|
-
setAppData: _appData => {}
|
|
45
|
+
payments: {
|
|
46
|
+
setDefaultFilters: _filters => {}
|
|
60
47
|
},
|
|
61
|
-
"payment-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
"capital-financing": {
|
|
65
|
-
setDefaultFinancingOffer: _defaultFinancingOffer => {},
|
|
66
|
-
setShowFinancingSelector: _showFinancingSelector => {},
|
|
67
|
-
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
68
|
-
setSupportUrl: _supportUrl => {},
|
|
69
|
-
setOnFinancingsLoaded: _listener => {}
|
|
70
|
-
},
|
|
71
|
-
"capital-financing-application": {
|
|
72
|
-
setOnApplicationSubmitted: _listener => {},
|
|
73
|
-
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
74
|
-
setHowCapitalWorksUrl: _howCapitalWorksUrl => {}
|
|
48
|
+
"payment-details": {
|
|
49
|
+
setPayment: _payment => {},
|
|
50
|
+
setOnClose: _listener => {}
|
|
75
51
|
},
|
|
76
|
-
"
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
81
|
-
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
82
|
-
setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {}
|
|
52
|
+
"tax-settings": {
|
|
53
|
+
setHideProductTaxCodeSelector: _hidden => {},
|
|
54
|
+
setDisplayHeadOfficeCountries: _countries => {},
|
|
55
|
+
setOnTaxSettingsUpdated: _listener => {}
|
|
83
56
|
},
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
setIntervalEnd: _intervalEnd => {},
|
|
88
|
-
setIntervalType: _intervalType => {}
|
|
57
|
+
"tax-registrations": {
|
|
58
|
+
setOnAfterTaxRegistrationAdded: _listener => {},
|
|
59
|
+
setDisplayCountries: _countries => {}
|
|
89
60
|
}
|
|
90
61
|
};
|
|
91
62
|
|
|
92
63
|
const componentNameMapping = {
|
|
64
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
93
65
|
payments: "stripe-connect-payments",
|
|
94
|
-
payouts: "stripe-connect-payouts",
|
|
95
66
|
"payment-details": "stripe-connect-payment-details",
|
|
96
|
-
|
|
97
|
-
"
|
|
67
|
+
payouts: "stripe-connect-payouts",
|
|
68
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
69
|
+
balances: "stripe-connect-balances",
|
|
98
70
|
"account-management": "stripe-connect-account-management",
|
|
99
71
|
"notification-banner": "stripe-connect-notification-banner",
|
|
100
|
-
"instant-payouts": "stripe-connect-instant-payouts",
|
|
101
72
|
"issuing-card": "stripe-connect-issuing-card",
|
|
102
73
|
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
103
74
|
"financial-account": "stripe-connect-financial-account",
|
|
104
|
-
recipients: "stripe-connect-recipients",
|
|
105
75
|
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
106
|
-
"capital-financing": "stripe-connect-capital-financing",
|
|
107
|
-
"capital-financing-application": "stripe-connect-capital-financing-application",
|
|
108
|
-
"capital-financing-promotion": "stripe-connect-capital-financing-promotion",
|
|
109
|
-
"capital-overview": "stripe-connect-capital-overview",
|
|
110
76
|
documents: "stripe-connect-documents",
|
|
111
77
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
112
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
113
|
-
balances: "stripe-connect-balances",
|
|
114
|
-
"payouts-list": "stripe-connect-payouts-list",
|
|
115
|
-
"app-install": "stripe-connect-app-install",
|
|
116
|
-
"app-viewport": "stripe-connect-app-viewport",
|
|
117
|
-
"reporting-chart": "stripe-connect-reporting-chart"
|
|
78
|
+
"tax-settings": "stripe-connect-tax-settings"
|
|
118
79
|
};
|
|
119
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";
|
|
120
81
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
121
82
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
122
83
|
const findScript = () => {
|
|
123
|
-
return document.querySelectorAll(`script[src="${
|
|
84
|
+
return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
124
85
|
};
|
|
125
86
|
const injectScript = () => {
|
|
126
87
|
const script = document.createElement("script");
|
|
@@ -257,7 +218,7 @@ const createWrapper = stripeConnect => {
|
|
|
257
218
|
sdk: true,
|
|
258
219
|
sdkOptions: {
|
|
259
220
|
// This will be replaced by the npm package version when bundling
|
|
260
|
-
sdkVersion: "3.3.21
|
|
221
|
+
sdkVersion: "3.3.21"
|
|
261
222
|
}
|
|
262
223
|
})
|
|
263
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,13 +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
|
-
export type RecipientDataSource = "customers";
|
|
42
59
|
export type EmbeddedErrorType =
|
|
43
60
|
/**
|
|
44
61
|
* Failure to connect to Stripe's API.
|
|
@@ -69,10 +86,6 @@ export declare const ConnectElementCommonMethodConfig: {
|
|
|
69
86
|
setOnLoaderStart: (_listener: (({ elementTagName }: LoaderStart) => void) | undefined) => void;
|
|
70
87
|
};
|
|
71
88
|
export declare const ConnectElementCustomMethodConfig: {
|
|
72
|
-
"payment-details": {
|
|
73
|
-
setPayment: (_payment: string | undefined) => void;
|
|
74
|
-
setOnClose: (_listener: (() => void) | undefined) => void;
|
|
75
|
-
};
|
|
76
89
|
"account-onboarding": {
|
|
77
90
|
setFullTermsOfServiceUrl: (_termOfServiceUrl: string | undefined) => void;
|
|
78
91
|
setRecipientTermsOfServiceUrl: (_recipientTermsOfServiceUrl: string | undefined) => void;
|
|
@@ -106,47 +119,24 @@ export declare const ConnectElementCustomMethodConfig: {
|
|
|
106
119
|
"financial-account-transactions": {
|
|
107
120
|
setFinancialAccount: (_financialAccount: string) => void;
|
|
108
121
|
};
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
};
|
|
112
|
-
"app-install": {
|
|
113
|
-
setApp: (_app: string | undefined) => void;
|
|
114
|
-
setOnAppInstallStateFetched: (_listener: (({ appId, state }: InstallState) => void) | undefined) => void;
|
|
115
|
-
setOnAppInstallStateChanged: (_listener: (({ appId, state }: InstallState) => void) | undefined) => void;
|
|
116
|
-
};
|
|
117
|
-
"app-viewport": {
|
|
118
|
-
setApp: (_app: string | undefined) => void;
|
|
119
|
-
setAppData: (_appData: Record<string, string> | undefined) => void;
|
|
122
|
+
payments: {
|
|
123
|
+
setDefaultFilters: (_filters: PaymentsListDefaultFilters | undefined) => void;
|
|
120
124
|
};
|
|
121
|
-
"payment-
|
|
122
|
-
|
|
125
|
+
"payment-details": {
|
|
126
|
+
setPayment: (_payment: string | undefined) => void;
|
|
127
|
+
setOnClose: (_listener: (() => void) | undefined) => void;
|
|
123
128
|
};
|
|
124
|
-
"
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
setOnFinancingsLoaded: (_listener: (({ total }: {
|
|
130
|
-
total: number;
|
|
129
|
+
"tax-settings": {
|
|
130
|
+
setHideProductTaxCodeSelector: (_hidden: boolean | undefined) => void;
|
|
131
|
+
setDisplayHeadOfficeCountries: (_countries: string[] | undefined) => void;
|
|
132
|
+
setOnTaxSettingsUpdated: (_listener: (({ id }: {
|
|
133
|
+
id: string;
|
|
131
134
|
}) => void) | undefined) => void;
|
|
132
135
|
};
|
|
133
|
-
"
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
"capital-financing-promotion": {
|
|
139
|
-
setLayout: (_layout: FinancingPromotionLayoutType | undefined) => void;
|
|
140
|
-
setOnApplicationSubmitted: (_listener: (() => void) | undefined) => void;
|
|
141
|
-
setOnEligibleFinancingOfferLoaded: (_listener: (({ productType }: FinancingProductType) => void) | undefined) => void;
|
|
142
|
-
setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined) => void;
|
|
143
|
-
setHowCapitalWorksUrl: (_howCapitalWorksUrl: string | undefined) => void;
|
|
144
|
-
setEligibilityCriteriaUrl: (_eligibilityCriteriaUrl: string | undefined) => void;
|
|
145
|
-
};
|
|
146
|
-
"reporting-chart": {
|
|
147
|
-
setReportName: (_reportName: ReportName) => void;
|
|
148
|
-
setIntervalStart: (_intervalStart: Date | undefined) => void;
|
|
149
|
-
setIntervalEnd: (_intervalEnd: Date | undefined) => void;
|
|
150
|
-
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;
|
|
151
141
|
};
|
|
152
142
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stripe/connect-js",
|
|
3
|
-
"version": "3.3.21
|
|
3
|
+
"version": "3.3.21",
|
|
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,64 +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-financing-promotion"
|
|
33
|
-
| "stripe-connect-capital-overview"
|
|
26
|
+
| "stripe-connect-payouts"
|
|
27
|
+
| "stripe-connect-payouts-list"
|
|
28
|
+
| "stripe-connect-balances"
|
|
34
29
|
| "stripe-connect-documents"
|
|
35
30
|
| "stripe-connect-tax-registrations"
|
|
36
|
-
| "stripe-connect-tax-settings"
|
|
37
|
-
| "stripe-connect-balances"
|
|
38
|
-
| "stripe-connect-payouts-list"
|
|
39
|
-
| "stripe-connect-app-install"
|
|
40
|
-
| "stripe-connect-app-viewport"
|
|
41
|
-
| "stripe-connect-reporting-chart";
|
|
31
|
+
| "stripe-connect-tax-settings";
|
|
42
32
|
|
|
43
33
|
export const componentNameMapping: Record<
|
|
44
34
|
ConnectElementTagName,
|
|
45
35
|
ConnectElementHTMLName
|
|
46
36
|
> = {
|
|
37
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
47
38
|
payments: "stripe-connect-payments",
|
|
48
|
-
payouts: "stripe-connect-payouts",
|
|
49
39
|
"payment-details": "stripe-connect-payment-details",
|
|
50
|
-
|
|
51
|
-
"
|
|
40
|
+
payouts: "stripe-connect-payouts",
|
|
41
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
42
|
+
balances: "stripe-connect-balances",
|
|
52
43
|
"account-management": "stripe-connect-account-management",
|
|
53
44
|
"notification-banner": "stripe-connect-notification-banner",
|
|
54
|
-
"instant-payouts": "stripe-connect-instant-payouts",
|
|
55
45
|
"issuing-card": "stripe-connect-issuing-card",
|
|
56
46
|
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
57
47
|
"financial-account": "stripe-connect-financial-account",
|
|
58
|
-
recipients: "stripe-connect-recipients",
|
|
59
48
|
"financial-account-transactions":
|
|
60
49
|
"stripe-connect-financial-account-transactions",
|
|
61
|
-
"capital-financing": "stripe-connect-capital-financing",
|
|
62
|
-
"capital-financing-application":
|
|
63
|
-
"stripe-connect-capital-financing-application",
|
|
64
|
-
"capital-financing-promotion": "stripe-connect-capital-financing-promotion",
|
|
65
|
-
"capital-overview": "stripe-connect-capital-overview",
|
|
66
50
|
documents: "stripe-connect-documents",
|
|
67
51
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
68
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
69
|
-
balances: "stripe-connect-balances",
|
|
70
|
-
"payouts-list": "stripe-connect-payouts-list",
|
|
71
|
-
"app-install": "stripe-connect-app-install",
|
|
72
|
-
"app-viewport": "stripe-connect-app-viewport",
|
|
73
|
-
"reporting-chart": "stripe-connect-reporting-chart"
|
|
52
|
+
"tax-settings": "stripe-connect-tax-settings"
|
|
74
53
|
};
|
|
75
54
|
|
|
76
55
|
type StripeConnectInstanceExtended = StripeConnectInstance & {
|
|
@@ -89,10 +68,10 @@ const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
|
89
68
|
export const findScript = (): HTMLScriptElement | null => {
|
|
90
69
|
return (
|
|
91
70
|
document.querySelectorAll<HTMLScriptElement>(
|
|
92
|
-
`script[src="${
|
|
71
|
+
`script[src="${V1_URL}"]`
|
|
93
72
|
)[0] ||
|
|
94
73
|
document.querySelectorAll<HTMLScriptElement>(
|
|
95
|
-
`script[src="${
|
|
74
|
+
`script[src="${V0_URL}"]`
|
|
96
75
|
)[0] ||
|
|
97
76
|
null
|
|
98
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,18 +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
|
-
export type RecipientDataSource = "customers";
|
|
57
|
-
|
|
58
155
|
export type EmbeddedErrorType =
|
|
59
156
|
/**
|
|
60
157
|
* Failure to connect to Stripe's API.
|
|
@@ -91,10 +188,6 @@ export const ConnectElementCommonMethodConfig = {
|
|
|
91
188
|
};
|
|
92
189
|
|
|
93
190
|
export const ConnectElementCustomMethodConfig = {
|
|
94
|
-
"payment-details": {
|
|
95
|
-
setPayment: (_payment: string | undefined): void => {},
|
|
96
|
-
setOnClose: (_listener: (() => void) | undefined): void => {}
|
|
97
|
-
},
|
|
98
191
|
"account-onboarding": {
|
|
99
192
|
setFullTermsOfServiceUrl: (
|
|
100
193
|
_termOfServiceUrl: string | undefined
|
|
@@ -150,69 +243,28 @@ export const ConnectElementCustomMethodConfig = {
|
|
|
150
243
|
"financial-account-transactions": {
|
|
151
244
|
setFinancialAccount: (_financialAccount: string): void => {}
|
|
152
245
|
},
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
"app-install": {
|
|
157
|
-
setApp: (_app: string | undefined): void => {},
|
|
158
|
-
setOnAppInstallStateFetched: (
|
|
159
|
-
_listener: (({ appId, state }: InstallState) => void) | undefined
|
|
160
|
-
): void => {},
|
|
161
|
-
setOnAppInstallStateChanged: (
|
|
162
|
-
_listener: (({ appId, state }: InstallState) => void) | undefined
|
|
246
|
+
payments: {
|
|
247
|
+
setDefaultFilters: (
|
|
248
|
+
_filters: PaymentsListDefaultFilters | undefined
|
|
163
249
|
): void => {}
|
|
164
250
|
},
|
|
165
|
-
"
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
},
|
|
169
|
-
"payment-method-settings": {
|
|
170
|
-
setPaymentMethodConfiguration: (
|
|
171
|
-
_paymentMethodConfiguration: string | undefined
|
|
172
|
-
): void => {}
|
|
251
|
+
"payment-details": {
|
|
252
|
+
setPayment: (_payment: string | undefined): void => {},
|
|
253
|
+
setOnClose: (_listener: (() => void) | undefined): void => {}
|
|
173
254
|
},
|
|
174
|
-
"
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
setShowFinancingSelector: (
|
|
179
|
-
_showFinancingSelector: boolean | undefined
|
|
180
|
-
): void => {},
|
|
181
|
-
setHowCapitalWorksUrl: (
|
|
182
|
-
_howCapitalWorksUrl: string | undefined
|
|
255
|
+
"tax-settings": {
|
|
256
|
+
setHideProductTaxCodeSelector: (_hidden: boolean | undefined): void => {},
|
|
257
|
+
setDisplayHeadOfficeCountries: (
|
|
258
|
+
_countries: string[] | undefined
|
|
183
259
|
): void => {},
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
_listener: (({ total }: { total: number }) => void) | undefined
|
|
260
|
+
setOnTaxSettingsUpdated: (
|
|
261
|
+
_listener: (({ id }: { id: string }) => void) | undefined
|
|
187
262
|
): void => {}
|
|
188
263
|
},
|
|
189
|
-
"
|
|
190
|
-
|
|
191
|
-
_listener: (() => void) | undefined
|
|
264
|
+
"tax-registrations": {
|
|
265
|
+
setOnAfterTaxRegistrationAdded: (
|
|
266
|
+
_listener: (({ id }: { id: string }) => void) | undefined
|
|
192
267
|
): void => {},
|
|
193
|
-
|
|
194
|
-
setHowCapitalWorksUrl: (_howCapitalWorksUrl: string | undefined): void => {}
|
|
195
|
-
},
|
|
196
|
-
"capital-financing-promotion": {
|
|
197
|
-
setLayout: (_layout: FinancingPromotionLayoutType | undefined): void => {},
|
|
198
|
-
setOnApplicationSubmitted: (
|
|
199
|
-
_listener: (() => void) | undefined
|
|
200
|
-
): void => {},
|
|
201
|
-
setOnEligibleFinancingOfferLoaded: (
|
|
202
|
-
_listener: (({ productType }: FinancingProductType) => void) | undefined
|
|
203
|
-
): void => {},
|
|
204
|
-
setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined): void => {},
|
|
205
|
-
setHowCapitalWorksUrl: (
|
|
206
|
-
_howCapitalWorksUrl: string | undefined
|
|
207
|
-
): void => {},
|
|
208
|
-
setEligibilityCriteriaUrl: (
|
|
209
|
-
_eligibilityCriteriaUrl: string | undefined
|
|
210
|
-
): void => {}
|
|
211
|
-
},
|
|
212
|
-
"reporting-chart": {
|
|
213
|
-
setReportName: (_reportName: ReportName): void => {},
|
|
214
|
-
setIntervalStart: (_intervalStart: Date | undefined): void => {},
|
|
215
|
-
setIntervalEnd: (_intervalEnd: Date | undefined): void => {},
|
|
216
|
-
setIntervalType: (_intervalType: IntervalType | undefined): void => {}
|
|
268
|
+
setDisplayCountries: (_countries: string[] | undefined): void => {}
|
|
217
269
|
}
|
|
218
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;
|
|
@@ -487,28 +488,18 @@ export interface StripeConnectInstance {
|
|
|
487
488
|
* Tagnames to be used with the `create` method of the Connect instance.
|
|
488
489
|
*/
|
|
489
490
|
export type ConnectElementTagName =
|
|
491
|
+
| "account-onboarding"
|
|
490
492
|
| "payments"
|
|
491
|
-
| "payouts"
|
|
492
493
|
| "payment-details"
|
|
493
|
-
| "account-onboarding"
|
|
494
|
-
| "payment-method-settings"
|
|
495
494
|
| "account-management"
|
|
496
495
|
| "notification-banner"
|
|
497
|
-
| "instant-payouts"
|
|
498
496
|
| "issuing-card"
|
|
499
497
|
| "issuing-cards-list"
|
|
500
498
|
| "financial-account"
|
|
501
499
|
| "financial-account-transactions"
|
|
502
|
-
| "
|
|
503
|
-
| "
|
|
504
|
-
| "
|
|
505
|
-
| "capital-financing-promotion"
|
|
506
|
-
| "capital-overview"
|
|
500
|
+
| "payouts"
|
|
501
|
+
| "payouts-list"
|
|
502
|
+
| "balances"
|
|
507
503
|
| "documents"
|
|
508
504
|
| "tax-registrations"
|
|
509
|
-
| "tax-settings"
|
|
510
|
-
| "balances"
|
|
511
|
-
| "payouts-list"
|
|
512
|
-
| "app-install"
|
|
513
|
-
| "app-viewport"
|
|
514
|
-
| "reporting-chart";
|
|
505
|
+
| "tax-settings";
|