@stripe/connect-js 3.3.22-preview-1 → 3.3.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/connect.esm.js +20 -68
- package/dist/connect.js +20 -68
- package/dist/pure.esm.js +12 -60
- package/dist/pure.js +12 -60
- package/dist/src/index.d.ts +1 -1
- package/dist/src/pure.d.ts +1 -1
- package/dist/src/shared.d.ts +2 -2
- package/dist/types/config.d.ts +33 -56
- package/package.json +14 -10
- package/src/index.ts +3 -6
- package/src/pure.test.ts +2 -2
- package/src/pure.ts +3 -6
- package/src/shared.ts +29 -50
- package/types/checks.ts +2 -2
- package/types/config.ts +131 -94
- package/types/index.d.ts +1 -1
- package/types/shared.d.ts +8 -17
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@ const fetchClientSecret = async () => {
|
|
|
36
36
|
|
|
37
37
|
const instance = loadConnectAndInitialize({
|
|
38
38
|
publishableKey: "{{pk test123}}",
|
|
39
|
-
fetchClientSecret: fetchClientSecret
|
|
39
|
+
fetchClientSecret: fetchClientSecret,
|
|
40
40
|
});
|
|
41
41
|
```
|
|
42
42
|
|
|
@@ -47,7 +47,7 @@ test this code through your Connect account.
|
|
|
47
47
|
If you have deployed a
|
|
48
48
|
[Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/Security/CSP),
|
|
49
49
|
make sure to
|
|
50
|
-
[include Connect.js in your directives](https://stripe.com/docs/
|
|
50
|
+
[include Connect.js in your directives](https://stripe.com/docs/connect/get-started-connect-embedded-components?platform=web#csp-and-http-header-requirements).
|
|
51
51
|
|
|
52
52
|
### Import as a side effect
|
|
53
53
|
|
|
@@ -71,6 +71,6 @@ import { loadConnectAndInitialize } from "@stripe/connect-js/pure";
|
|
|
71
71
|
// Connect.js will not be loaded until `loadConnect` is called
|
|
72
72
|
const instance = loadConnectAndInitialize({
|
|
73
73
|
publishableKey: "{{pk test123}}",
|
|
74
|
-
fetchClientSecret: fetchClientSecret
|
|
74
|
+
fetchClientSecret: fetchClientSecret,
|
|
75
75
|
});
|
|
76
76
|
```
|
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,46 +38,12 @@ 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 => {}
|
|
56
|
-
},
|
|
57
|
-
"payment-method-settings": {
|
|
58
|
-
setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
|
|
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 => {}
|
|
71
|
-
},
|
|
72
|
-
"capital-financing-promotion": {
|
|
73
|
-
setLayout: _layout => {},
|
|
74
|
-
setOnApplicationSubmitted: _listener => {},
|
|
75
|
-
setOnEligibleFinancingOfferLoaded: _listener => {},
|
|
76
|
-
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
77
|
-
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
78
|
-
setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {}
|
|
41
|
+
payments: {
|
|
42
|
+
setDefaultFilters: _filters => {}
|
|
79
43
|
},
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
setIntervalEnd: _intervalEnd => {},
|
|
84
|
-
setIntervalType: _intervalType => {}
|
|
44
|
+
"payment-details": {
|
|
45
|
+
setPayment: _payment => {},
|
|
46
|
+
setOnClose: _listener => {}
|
|
85
47
|
},
|
|
86
48
|
"tax-settings": {
|
|
87
49
|
setHideProductTaxCodeSelector: _hidden => {},
|
|
@@ -95,37 +57,27 @@ const ConnectElementCustomMethodConfig = {
|
|
|
95
57
|
};
|
|
96
58
|
|
|
97
59
|
const componentNameMapping = {
|
|
60
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
98
61
|
payments: "stripe-connect-payments",
|
|
99
|
-
payouts: "stripe-connect-payouts",
|
|
100
62
|
"payment-details": "stripe-connect-payment-details",
|
|
101
|
-
|
|
102
|
-
"
|
|
63
|
+
payouts: "stripe-connect-payouts",
|
|
64
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
65
|
+
balances: "stripe-connect-balances",
|
|
103
66
|
"account-management": "stripe-connect-account-management",
|
|
104
67
|
"notification-banner": "stripe-connect-notification-banner",
|
|
105
|
-
"instant-payouts": "stripe-connect-instant-payouts",
|
|
106
68
|
"issuing-card": "stripe-connect-issuing-card",
|
|
107
69
|
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
108
70
|
"financial-account": "stripe-connect-financial-account",
|
|
109
|
-
recipients: "stripe-connect-recipients",
|
|
110
71
|
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
111
|
-
"capital-financing": "stripe-connect-capital-financing",
|
|
112
|
-
"capital-financing-application": "stripe-connect-capital-financing-application",
|
|
113
|
-
"capital-financing-promotion": "stripe-connect-capital-financing-promotion",
|
|
114
|
-
"capital-overview": "stripe-connect-capital-overview",
|
|
115
72
|
documents: "stripe-connect-documents",
|
|
116
73
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
117
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
118
|
-
balances: "stripe-connect-balances",
|
|
119
|
-
"payouts-list": "stripe-connect-payouts-list",
|
|
120
|
-
"app-install": "stripe-connect-app-install",
|
|
121
|
-
"app-viewport": "stripe-connect-app-viewport",
|
|
122
|
-
"reporting-chart": "stripe-connect-reporting-chart"
|
|
74
|
+
"tax-settings": "stripe-connect-tax-settings"
|
|
123
75
|
};
|
|
124
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";
|
|
125
77
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
126
78
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
127
79
|
const findScript = () => {
|
|
128
|
-
return document.querySelectorAll(`script[src="${
|
|
80
|
+
return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
129
81
|
};
|
|
130
82
|
const injectScript = () => {
|
|
131
83
|
const script = document.createElement("script");
|
|
@@ -137,13 +89,13 @@ const injectScript = () => {
|
|
|
137
89
|
document.head.appendChild(script);
|
|
138
90
|
return script;
|
|
139
91
|
};
|
|
140
|
-
let stripePromise = null;
|
|
92
|
+
let stripePromise$1 = null;
|
|
141
93
|
const loadScript = () => {
|
|
142
94
|
// Ensure that we only attempt to load Connect.js at most once
|
|
143
|
-
if (stripePromise !== null) {
|
|
144
|
-
return stripePromise;
|
|
95
|
+
if (stripePromise$1 !== null) {
|
|
96
|
+
return stripePromise$1;
|
|
145
97
|
}
|
|
146
|
-
stripePromise = new Promise((resolve, reject) => {
|
|
98
|
+
stripePromise$1 = new Promise((resolve, reject) => {
|
|
147
99
|
if (typeof window === "undefined") {
|
|
148
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.");
|
|
149
101
|
return;
|
|
@@ -178,7 +130,7 @@ const loadScript = () => {
|
|
|
178
130
|
reject(error);
|
|
179
131
|
}
|
|
180
132
|
});
|
|
181
|
-
return stripePromise;
|
|
133
|
+
return stripePromise$1;
|
|
182
134
|
};
|
|
183
135
|
const hasCustomMethod = tagName => {
|
|
184
136
|
return tagName in ConnectElementCustomMethodConfig;
|
|
@@ -262,7 +214,7 @@ const createWrapper = stripeConnect => {
|
|
|
262
214
|
sdk: true,
|
|
263
215
|
sdkOptions: {
|
|
264
216
|
// This will be replaced by the npm package version when bundling
|
|
265
|
-
sdkVersion: "3.3.22
|
|
217
|
+
sdkVersion: "3.3.22"
|
|
266
218
|
}
|
|
267
219
|
})
|
|
268
220
|
}));
|
|
@@ -274,16 +226,16 @@ const createWrapper = stripeConnect => {
|
|
|
274
226
|
|
|
275
227
|
// Execute our own script injection after a tick to give users time to do their
|
|
276
228
|
// own script injection.
|
|
277
|
-
const stripePromise
|
|
229
|
+
const stripePromise = Promise.resolve().then(() => loadScript());
|
|
278
230
|
let loadCalled = false;
|
|
279
|
-
stripePromise
|
|
231
|
+
stripePromise.catch(err => {
|
|
280
232
|
if (!loadCalled) {
|
|
281
233
|
console.warn(err);
|
|
282
234
|
}
|
|
283
235
|
});
|
|
284
236
|
const loadConnectAndInitialize = initParams => {
|
|
285
237
|
loadCalled = true;
|
|
286
|
-
return initStripeConnect(stripePromise
|
|
238
|
+
return initStripeConnect(stripePromise, initParams);
|
|
287
239
|
};
|
|
288
240
|
|
|
289
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,46 +42,12 @@ 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 => {}
|
|
60
|
-
},
|
|
61
|
-
"payment-method-settings": {
|
|
62
|
-
setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
|
|
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 => {}
|
|
75
|
-
},
|
|
76
|
-
"capital-financing-promotion": {
|
|
77
|
-
setLayout: _layout => {},
|
|
78
|
-
setOnApplicationSubmitted: _listener => {},
|
|
79
|
-
setOnEligibleFinancingOfferLoaded: _listener => {},
|
|
80
|
-
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
81
|
-
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
82
|
-
setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {}
|
|
45
|
+
payments: {
|
|
46
|
+
setDefaultFilters: _filters => {}
|
|
83
47
|
},
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
setIntervalEnd: _intervalEnd => {},
|
|
88
|
-
setIntervalType: _intervalType => {}
|
|
48
|
+
"payment-details": {
|
|
49
|
+
setPayment: _payment => {},
|
|
50
|
+
setOnClose: _listener => {}
|
|
89
51
|
},
|
|
90
52
|
"tax-settings": {
|
|
91
53
|
setHideProductTaxCodeSelector: _hidden => {},
|
|
@@ -99,37 +61,27 @@ const ConnectElementCustomMethodConfig = {
|
|
|
99
61
|
};
|
|
100
62
|
|
|
101
63
|
const componentNameMapping = {
|
|
64
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
102
65
|
payments: "stripe-connect-payments",
|
|
103
|
-
payouts: "stripe-connect-payouts",
|
|
104
66
|
"payment-details": "stripe-connect-payment-details",
|
|
105
|
-
|
|
106
|
-
"
|
|
67
|
+
payouts: "stripe-connect-payouts",
|
|
68
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
69
|
+
balances: "stripe-connect-balances",
|
|
107
70
|
"account-management": "stripe-connect-account-management",
|
|
108
71
|
"notification-banner": "stripe-connect-notification-banner",
|
|
109
|
-
"instant-payouts": "stripe-connect-instant-payouts",
|
|
110
72
|
"issuing-card": "stripe-connect-issuing-card",
|
|
111
73
|
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
112
74
|
"financial-account": "stripe-connect-financial-account",
|
|
113
|
-
recipients: "stripe-connect-recipients",
|
|
114
75
|
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
115
|
-
"capital-financing": "stripe-connect-capital-financing",
|
|
116
|
-
"capital-financing-application": "stripe-connect-capital-financing-application",
|
|
117
|
-
"capital-financing-promotion": "stripe-connect-capital-financing-promotion",
|
|
118
|
-
"capital-overview": "stripe-connect-capital-overview",
|
|
119
76
|
documents: "stripe-connect-documents",
|
|
120
77
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
121
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
122
|
-
balances: "stripe-connect-balances",
|
|
123
|
-
"payouts-list": "stripe-connect-payouts-list",
|
|
124
|
-
"app-install": "stripe-connect-app-install",
|
|
125
|
-
"app-viewport": "stripe-connect-app-viewport",
|
|
126
|
-
"reporting-chart": "stripe-connect-reporting-chart"
|
|
78
|
+
"tax-settings": "stripe-connect-tax-settings"
|
|
127
79
|
};
|
|
128
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";
|
|
129
81
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
130
82
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
131
83
|
const findScript = () => {
|
|
132
|
-
return document.querySelectorAll(`script[src="${
|
|
84
|
+
return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
133
85
|
};
|
|
134
86
|
const injectScript = () => {
|
|
135
87
|
const script = document.createElement("script");
|
|
@@ -141,13 +93,13 @@ const injectScript = () => {
|
|
|
141
93
|
document.head.appendChild(script);
|
|
142
94
|
return script;
|
|
143
95
|
};
|
|
144
|
-
let stripePromise = null;
|
|
96
|
+
let stripePromise$1 = null;
|
|
145
97
|
const loadScript = () => {
|
|
146
98
|
// Ensure that we only attempt to load Connect.js at most once
|
|
147
|
-
if (stripePromise !== null) {
|
|
148
|
-
return stripePromise;
|
|
99
|
+
if (stripePromise$1 !== null) {
|
|
100
|
+
return stripePromise$1;
|
|
149
101
|
}
|
|
150
|
-
stripePromise = new Promise((resolve, reject) => {
|
|
102
|
+
stripePromise$1 = new Promise((resolve, reject) => {
|
|
151
103
|
if (typeof window === "undefined") {
|
|
152
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.");
|
|
153
105
|
return;
|
|
@@ -182,7 +134,7 @@ const loadScript = () => {
|
|
|
182
134
|
reject(error);
|
|
183
135
|
}
|
|
184
136
|
});
|
|
185
|
-
return stripePromise;
|
|
137
|
+
return stripePromise$1;
|
|
186
138
|
};
|
|
187
139
|
const hasCustomMethod = tagName => {
|
|
188
140
|
return tagName in ConnectElementCustomMethodConfig;
|
|
@@ -266,7 +218,7 @@ const createWrapper = stripeConnect => {
|
|
|
266
218
|
sdk: true,
|
|
267
219
|
sdkOptions: {
|
|
268
220
|
// This will be replaced by the npm package version when bundling
|
|
269
|
-
sdkVersion: "3.3.22
|
|
221
|
+
sdkVersion: "3.3.22"
|
|
270
222
|
}
|
|
271
223
|
})
|
|
272
224
|
}));
|
|
@@ -278,16 +230,16 @@ const createWrapper = stripeConnect => {
|
|
|
278
230
|
|
|
279
231
|
// Execute our own script injection after a tick to give users time to do their
|
|
280
232
|
// own script injection.
|
|
281
|
-
const stripePromise
|
|
233
|
+
const stripePromise = Promise.resolve().then(() => loadScript());
|
|
282
234
|
let loadCalled = false;
|
|
283
|
-
stripePromise
|
|
235
|
+
stripePromise.catch(err => {
|
|
284
236
|
if (!loadCalled) {
|
|
285
237
|
console.warn(err);
|
|
286
238
|
}
|
|
287
239
|
});
|
|
288
240
|
const loadConnectAndInitialize = initParams => {
|
|
289
241
|
loadCalled = true;
|
|
290
|
-
return initStripeConnect(stripePromise
|
|
242
|
+
return initStripeConnect(stripePromise, initParams);
|
|
291
243
|
};
|
|
292
244
|
|
|
293
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,46 +38,12 @@ 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 => {}
|
|
56
|
-
},
|
|
57
|
-
"payment-method-settings": {
|
|
58
|
-
setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
|
|
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 => {}
|
|
71
|
-
},
|
|
72
|
-
"capital-financing-promotion": {
|
|
73
|
-
setLayout: _layout => {},
|
|
74
|
-
setOnApplicationSubmitted: _listener => {},
|
|
75
|
-
setOnEligibleFinancingOfferLoaded: _listener => {},
|
|
76
|
-
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
77
|
-
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
78
|
-
setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {}
|
|
41
|
+
payments: {
|
|
42
|
+
setDefaultFilters: _filters => {}
|
|
79
43
|
},
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
setIntervalEnd: _intervalEnd => {},
|
|
84
|
-
setIntervalType: _intervalType => {}
|
|
44
|
+
"payment-details": {
|
|
45
|
+
setPayment: _payment => {},
|
|
46
|
+
setOnClose: _listener => {}
|
|
85
47
|
},
|
|
86
48
|
"tax-settings": {
|
|
87
49
|
setHideProductTaxCodeSelector: _hidden => {},
|
|
@@ -95,37 +57,27 @@ const ConnectElementCustomMethodConfig = {
|
|
|
95
57
|
};
|
|
96
58
|
|
|
97
59
|
const componentNameMapping = {
|
|
60
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
98
61
|
payments: "stripe-connect-payments",
|
|
99
|
-
payouts: "stripe-connect-payouts",
|
|
100
62
|
"payment-details": "stripe-connect-payment-details",
|
|
101
|
-
|
|
102
|
-
"
|
|
63
|
+
payouts: "stripe-connect-payouts",
|
|
64
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
65
|
+
balances: "stripe-connect-balances",
|
|
103
66
|
"account-management": "stripe-connect-account-management",
|
|
104
67
|
"notification-banner": "stripe-connect-notification-banner",
|
|
105
|
-
"instant-payouts": "stripe-connect-instant-payouts",
|
|
106
68
|
"issuing-card": "stripe-connect-issuing-card",
|
|
107
69
|
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
108
70
|
"financial-account": "stripe-connect-financial-account",
|
|
109
|
-
recipients: "stripe-connect-recipients",
|
|
110
71
|
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
111
|
-
"capital-financing": "stripe-connect-capital-financing",
|
|
112
|
-
"capital-financing-application": "stripe-connect-capital-financing-application",
|
|
113
|
-
"capital-financing-promotion": "stripe-connect-capital-financing-promotion",
|
|
114
|
-
"capital-overview": "stripe-connect-capital-overview",
|
|
115
72
|
documents: "stripe-connect-documents",
|
|
116
73
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
117
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
118
|
-
balances: "stripe-connect-balances",
|
|
119
|
-
"payouts-list": "stripe-connect-payouts-list",
|
|
120
|
-
"app-install": "stripe-connect-app-install",
|
|
121
|
-
"app-viewport": "stripe-connect-app-viewport",
|
|
122
|
-
"reporting-chart": "stripe-connect-reporting-chart"
|
|
74
|
+
"tax-settings": "stripe-connect-tax-settings"
|
|
123
75
|
};
|
|
124
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";
|
|
125
77
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
126
78
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
127
79
|
const findScript = () => {
|
|
128
|
-
return document.querySelectorAll(`script[src="${
|
|
80
|
+
return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
129
81
|
};
|
|
130
82
|
const injectScript = () => {
|
|
131
83
|
const script = document.createElement("script");
|
|
@@ -262,7 +214,7 @@ const createWrapper = stripeConnect => {
|
|
|
262
214
|
sdk: true,
|
|
263
215
|
sdkOptions: {
|
|
264
216
|
// This will be replaced by the npm package version when bundling
|
|
265
|
-
sdkVersion: "3.3.22
|
|
217
|
+
sdkVersion: "3.3.22"
|
|
266
218
|
}
|
|
267
219
|
})
|
|
268
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,46 +42,12 @@ 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 => {}
|
|
60
|
-
},
|
|
61
|
-
"payment-method-settings": {
|
|
62
|
-
setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
|
|
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 => {}
|
|
75
|
-
},
|
|
76
|
-
"capital-financing-promotion": {
|
|
77
|
-
setLayout: _layout => {},
|
|
78
|
-
setOnApplicationSubmitted: _listener => {},
|
|
79
|
-
setOnEligibleFinancingOfferLoaded: _listener => {},
|
|
80
|
-
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
81
|
-
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
82
|
-
setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {}
|
|
45
|
+
payments: {
|
|
46
|
+
setDefaultFilters: _filters => {}
|
|
83
47
|
},
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
setIntervalEnd: _intervalEnd => {},
|
|
88
|
-
setIntervalType: _intervalType => {}
|
|
48
|
+
"payment-details": {
|
|
49
|
+
setPayment: _payment => {},
|
|
50
|
+
setOnClose: _listener => {}
|
|
89
51
|
},
|
|
90
52
|
"tax-settings": {
|
|
91
53
|
setHideProductTaxCodeSelector: _hidden => {},
|
|
@@ -99,37 +61,27 @@ const ConnectElementCustomMethodConfig = {
|
|
|
99
61
|
};
|
|
100
62
|
|
|
101
63
|
const componentNameMapping = {
|
|
64
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
102
65
|
payments: "stripe-connect-payments",
|
|
103
|
-
payouts: "stripe-connect-payouts",
|
|
104
66
|
"payment-details": "stripe-connect-payment-details",
|
|
105
|
-
|
|
106
|
-
"
|
|
67
|
+
payouts: "stripe-connect-payouts",
|
|
68
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
69
|
+
balances: "stripe-connect-balances",
|
|
107
70
|
"account-management": "stripe-connect-account-management",
|
|
108
71
|
"notification-banner": "stripe-connect-notification-banner",
|
|
109
|
-
"instant-payouts": "stripe-connect-instant-payouts",
|
|
110
72
|
"issuing-card": "stripe-connect-issuing-card",
|
|
111
73
|
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
112
74
|
"financial-account": "stripe-connect-financial-account",
|
|
113
|
-
recipients: "stripe-connect-recipients",
|
|
114
75
|
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
115
|
-
"capital-financing": "stripe-connect-capital-financing",
|
|
116
|
-
"capital-financing-application": "stripe-connect-capital-financing-application",
|
|
117
|
-
"capital-financing-promotion": "stripe-connect-capital-financing-promotion",
|
|
118
|
-
"capital-overview": "stripe-connect-capital-overview",
|
|
119
76
|
documents: "stripe-connect-documents",
|
|
120
77
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
121
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
122
|
-
balances: "stripe-connect-balances",
|
|
123
|
-
"payouts-list": "stripe-connect-payouts-list",
|
|
124
|
-
"app-install": "stripe-connect-app-install",
|
|
125
|
-
"app-viewport": "stripe-connect-app-viewport",
|
|
126
|
-
"reporting-chart": "stripe-connect-reporting-chart"
|
|
78
|
+
"tax-settings": "stripe-connect-tax-settings"
|
|
127
79
|
};
|
|
128
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";
|
|
129
81
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
130
82
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
131
83
|
const findScript = () => {
|
|
132
|
-
return document.querySelectorAll(`script[src="${
|
|
84
|
+
return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
133
85
|
};
|
|
134
86
|
const injectScript = () => {
|
|
135
87
|
const script = document.createElement("script");
|
|
@@ -266,7 +218,7 @@ const createWrapper = stripeConnect => {
|
|
|
266
218
|
sdk: true,
|
|
267
219
|
sdkOptions: {
|
|
268
220
|
// This will be replaced by the npm package version when bundling
|
|
269
|
-
sdkVersion: "3.3.22
|
|
221
|
+
sdkVersion: "3.3.22"
|
|
270
222
|
}
|
|
271
223
|
})
|
|
272
224
|
}));
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { LoadConnectAndInitialize } from "./shared";
|
|
1
|
+
import type { LoadConnectAndInitialize } from "./shared";
|
|
2
2
|
export declare const loadConnectAndInitialize: LoadConnectAndInitialize;
|
package/dist/src/pure.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { LoadConnectAndInitialize } from "./shared";
|
|
1
|
+
import type { LoadConnectAndInitialize } from "./shared";
|
|
2
2
|
export declare const loadConnectAndInitialize: LoadConnectAndInitialize;
|
package/dist/src/shared.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IStripeConnectInitParams, StripeConnectInstance, ConnectElementTagName } from "../types";
|
|
1
|
+
import type { 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>;
|