@stripe/connect-js 3.3.31 → 3.3.32
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 +96 -26
- package/dist/connect.js +96 -26
- package/dist/pure.esm.js +88 -18
- package/dist/pure.js +88 -18
- package/dist/src/shared.d.ts +1 -1
- package/dist/types/config.d.ts +86 -8
- package/package.json +2 -2
- package/types/config.ts +4 -0
package/dist/connect.esm.js
CHANGED
|
@@ -5,6 +5,17 @@ const ConnectElementCommonMethodConfig = {
|
|
|
5
5
|
setOnLoaderStart: _listener => {}
|
|
6
6
|
};
|
|
7
7
|
const ConnectElementCustomMethodConfig = {
|
|
8
|
+
payments: {
|
|
9
|
+
setDefaultFilters: _filters => {}
|
|
10
|
+
},
|
|
11
|
+
"payment-details": {
|
|
12
|
+
setPayment: _payment => {},
|
|
13
|
+
setOnClose: _listener => {}
|
|
14
|
+
},
|
|
15
|
+
"payment-disputes": {
|
|
16
|
+
setPayment: _payment => {},
|
|
17
|
+
setOnDisputesLoaded: _listener => {}
|
|
18
|
+
},
|
|
8
19
|
"account-onboarding": {
|
|
9
20
|
setFullTermsOfServiceUrl: _termOfServiceUrl => {},
|
|
10
21
|
setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
|
|
@@ -42,16 +53,48 @@ const ConnectElementCustomMethodConfig = {
|
|
|
42
53
|
"financial-account-transactions": {
|
|
43
54
|
setFinancialAccount: _financialAccount => {}
|
|
44
55
|
},
|
|
45
|
-
|
|
46
|
-
|
|
56
|
+
recipients: {
|
|
57
|
+
setDataSource: _dataSource => {}
|
|
47
58
|
},
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
59
|
+
"app-install": {
|
|
60
|
+
setApp: _app => {},
|
|
61
|
+
setOnAppInstallStateFetched: _listener => {},
|
|
62
|
+
setOnAppInstallStateChanged: _listener => {}
|
|
51
63
|
},
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
64
|
+
"app-viewport": {
|
|
65
|
+
setApp: _app => {},
|
|
66
|
+
setAppData: _appData => {}
|
|
67
|
+
},
|
|
68
|
+
"payment-method-settings": {
|
|
69
|
+
setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
|
|
70
|
+
},
|
|
71
|
+
"capital-financing": {
|
|
72
|
+
setDefaultFinancingOffer: _defaultFinancingOffer => {},
|
|
73
|
+
setShowFinancingSelector: _showFinancingSelector => {},
|
|
74
|
+
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
75
|
+
setSupportUrl: _supportUrl => {},
|
|
76
|
+
setOnFinancingsLoaded: _listener => {}
|
|
77
|
+
},
|
|
78
|
+
"capital-financing-application": {
|
|
79
|
+
setOnApplicationSubmitted: _listener => {},
|
|
80
|
+
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
81
|
+
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
82
|
+
setOnApplicationStepChange: _listener => {}
|
|
83
|
+
},
|
|
84
|
+
"capital-financing-promotion": {
|
|
85
|
+
setLayout: _layout => {},
|
|
86
|
+
setOnApplicationSubmitted: _listener => {},
|
|
87
|
+
setOnEligibleFinancingOfferLoaded: _listener => {},
|
|
88
|
+
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
89
|
+
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
90
|
+
setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {},
|
|
91
|
+
setOnApplicationStepChange: _listener => {}
|
|
92
|
+
},
|
|
93
|
+
"reporting-chart": {
|
|
94
|
+
setReportName: _reportName => {},
|
|
95
|
+
setIntervalStart: _intervalStart => {},
|
|
96
|
+
setIntervalEnd: _intervalEnd => {},
|
|
97
|
+
setIntervalType: _intervalType => {}
|
|
55
98
|
},
|
|
56
99
|
"tax-settings": {
|
|
57
100
|
setHideProductTaxCodeSelector: _hidden => {},
|
|
@@ -63,38 +106,65 @@ const ConnectElementCustomMethodConfig = {
|
|
|
63
106
|
setDisplayCountries: _countries => {},
|
|
64
107
|
setOnAfterTaxRegistrationExpired: _listener => {}
|
|
65
108
|
},
|
|
109
|
+
"tax-threshold-monitoring": {
|
|
110
|
+
setDisplayCountries: _countries => {}
|
|
111
|
+
},
|
|
112
|
+
"product-tax-code-selector": {
|
|
113
|
+
setOnTaxCodeSelect: _listener => {},
|
|
114
|
+
setHideDescription: _hideDescription => {},
|
|
115
|
+
setDisabled: _disabled => {},
|
|
116
|
+
setInitialTaxCode: _initialTaxCode => {}
|
|
117
|
+
},
|
|
118
|
+
"export-tax-transactions": {},
|
|
66
119
|
"payout-details": {
|
|
67
120
|
setPayout: _payout => {},
|
|
68
121
|
setOnClose: _listener => {}
|
|
122
|
+
},
|
|
123
|
+
"check-scanning": {
|
|
124
|
+
setHandleCheckScanSubmitted: _handleCheckScanSubmitted => {}
|
|
69
125
|
}
|
|
70
126
|
};
|
|
71
127
|
|
|
72
128
|
const componentNameMapping = {
|
|
73
|
-
"account-onboarding": "stripe-connect-account-onboarding",
|
|
74
|
-
"disputes-list": "stripe-connect-disputes-list",
|
|
75
129
|
payments: "stripe-connect-payments",
|
|
130
|
+
payouts: "stripe-connect-payouts",
|
|
76
131
|
"payment-details": "stripe-connect-payment-details",
|
|
77
132
|
"payment-disputes": "stripe-connect-payment-disputes",
|
|
78
|
-
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
balances: "stripe-connect-balances",
|
|
133
|
+
"disputes-list": "stripe-connect-disputes-list",
|
|
134
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
135
|
+
"payment-method-settings": "stripe-connect-payment-method-settings",
|
|
82
136
|
"account-management": "stripe-connect-account-management",
|
|
83
137
|
"notification-banner": "stripe-connect-notification-banner",
|
|
138
|
+
"instant-payouts": "stripe-connect-instant-payouts",
|
|
84
139
|
"instant-payouts-promotion": "stripe-connect-instant-payouts-promotion",
|
|
85
140
|
"issuing-card": "stripe-connect-issuing-card",
|
|
86
141
|
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
87
142
|
"financial-account": "stripe-connect-financial-account",
|
|
143
|
+
recipients: "stripe-connect-recipients",
|
|
88
144
|
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
145
|
+
"capital-financing": "stripe-connect-capital-financing",
|
|
146
|
+
"capital-financing-application": "stripe-connect-capital-financing-application",
|
|
147
|
+
"capital-financing-promotion": "stripe-connect-capital-financing-promotion",
|
|
148
|
+
"capital-overview": "stripe-connect-capital-overview",
|
|
89
149
|
documents: "stripe-connect-documents",
|
|
150
|
+
"product-tax-code-selector": "stripe-connect-product-tax-code-selector",
|
|
151
|
+
"export-tax-transactions": "stripe-connect-export-tax-transactions",
|
|
90
152
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
91
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
153
|
+
"tax-settings": "stripe-connect-tax-settings",
|
|
154
|
+
"tax-threshold-monitoring": "stripe-connect-tax-threshold-monitoring",
|
|
155
|
+
balances: "stripe-connect-balances",
|
|
156
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
157
|
+
"payout-details": "stripe-connect-payout-details",
|
|
158
|
+
"app-install": "stripe-connect-app-install",
|
|
159
|
+
"app-viewport": "stripe-connect-app-viewport",
|
|
160
|
+
"reporting-chart": "stripe-connect-reporting-chart",
|
|
161
|
+
"check-scanning": "stripe-connect-check-scanning"
|
|
92
162
|
};
|
|
93
163
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
94
164
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
95
165
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
96
166
|
const findScript = () => {
|
|
97
|
-
return document.querySelectorAll(`script[src="${
|
|
167
|
+
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || null;
|
|
98
168
|
};
|
|
99
169
|
const injectScript = () => {
|
|
100
170
|
const script = document.createElement("script");
|
|
@@ -106,7 +176,7 @@ const injectScript = () => {
|
|
|
106
176
|
document.head.appendChild(script);
|
|
107
177
|
return script;
|
|
108
178
|
};
|
|
109
|
-
let stripePromise
|
|
179
|
+
let stripePromise = null;
|
|
110
180
|
const isWindowStripeConnectDefined = stripeConnect => {
|
|
111
181
|
// We only consider `StripeConnect` defined if `init` is a function
|
|
112
182
|
// Why? HTML markup like:
|
|
@@ -116,10 +186,10 @@ const isWindowStripeConnectDefined = stripeConnect => {
|
|
|
116
186
|
};
|
|
117
187
|
const loadScript = () => {
|
|
118
188
|
// Ensure that we only attempt to load Connect.js at most once
|
|
119
|
-
if (stripePromise
|
|
120
|
-
return stripePromise
|
|
189
|
+
if (stripePromise !== null) {
|
|
190
|
+
return stripePromise;
|
|
121
191
|
}
|
|
122
|
-
stripePromise
|
|
192
|
+
stripePromise = new Promise((resolve, reject) => {
|
|
123
193
|
if (typeof window === "undefined") {
|
|
124
194
|
reject("ConnectJS won't load when rendering code in the server - it can only be loaded on a browser. This error is expected when loading ConnectJS in SSR environments, like NextJS. It will have no impact in the UI, however if you wish to avoid it, you can switch to the `pure` version of the connect.js loader: https://github.com/stripe/connect-js#importing-loadconnect-without-side-effects.");
|
|
125
195
|
return;
|
|
@@ -152,7 +222,7 @@ const loadScript = () => {
|
|
|
152
222
|
reject(error);
|
|
153
223
|
}
|
|
154
224
|
});
|
|
155
|
-
return stripePromise
|
|
225
|
+
return stripePromise;
|
|
156
226
|
};
|
|
157
227
|
const hasCustomMethod = tagName => {
|
|
158
228
|
return tagName in ConnectElementCustomMethodConfig;
|
|
@@ -185,7 +255,7 @@ const initStripeConnect = (stripePromise, initParams) => {
|
|
|
185
255
|
element[method] = function (value) {
|
|
186
256
|
stripeConnectInstance.then(() => {
|
|
187
257
|
if (!this[`${method}InternalOnly`]) {
|
|
188
|
-
throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.3.
|
|
258
|
+
throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.3.45-preview-1`);
|
|
189
259
|
}
|
|
190
260
|
this[`${method}InternalOnly`](value);
|
|
191
261
|
});
|
|
@@ -239,7 +309,7 @@ const createWrapper = stripeConnect => {
|
|
|
239
309
|
sdk: true,
|
|
240
310
|
sdkOptions: {
|
|
241
311
|
// This will be replaced by the npm package version when bundling
|
|
242
|
-
sdkVersion: "3.3.
|
|
312
|
+
sdkVersion: "3.3.45-preview-1"
|
|
243
313
|
}
|
|
244
314
|
})
|
|
245
315
|
}));
|
|
@@ -251,16 +321,16 @@ const createWrapper = stripeConnect => {
|
|
|
251
321
|
|
|
252
322
|
// Execute our own script injection after a tick to give users time to do their
|
|
253
323
|
// own script injection.
|
|
254
|
-
const stripePromise = Promise.resolve().then(() => loadScript());
|
|
324
|
+
const stripePromise$1 = Promise.resolve().then(() => loadScript());
|
|
255
325
|
let loadCalled = false;
|
|
256
|
-
stripePromise.catch(err => {
|
|
326
|
+
stripePromise$1.catch(err => {
|
|
257
327
|
if (!loadCalled) {
|
|
258
328
|
console.warn(err);
|
|
259
329
|
}
|
|
260
330
|
});
|
|
261
331
|
const loadConnectAndInitialize = initParams => {
|
|
262
332
|
loadCalled = true;
|
|
263
|
-
return initStripeConnect(stripePromise, initParams);
|
|
333
|
+
return initStripeConnect(stripePromise$1, initParams);
|
|
264
334
|
};
|
|
265
335
|
|
|
266
336
|
export { loadConnectAndInitialize };
|
package/dist/connect.js
CHANGED
|
@@ -9,6 +9,17 @@ const ConnectElementCommonMethodConfig = {
|
|
|
9
9
|
setOnLoaderStart: _listener => {}
|
|
10
10
|
};
|
|
11
11
|
const ConnectElementCustomMethodConfig = {
|
|
12
|
+
payments: {
|
|
13
|
+
setDefaultFilters: _filters => {}
|
|
14
|
+
},
|
|
15
|
+
"payment-details": {
|
|
16
|
+
setPayment: _payment => {},
|
|
17
|
+
setOnClose: _listener => {}
|
|
18
|
+
},
|
|
19
|
+
"payment-disputes": {
|
|
20
|
+
setPayment: _payment => {},
|
|
21
|
+
setOnDisputesLoaded: _listener => {}
|
|
22
|
+
},
|
|
12
23
|
"account-onboarding": {
|
|
13
24
|
setFullTermsOfServiceUrl: _termOfServiceUrl => {},
|
|
14
25
|
setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
|
|
@@ -46,16 +57,48 @@ const ConnectElementCustomMethodConfig = {
|
|
|
46
57
|
"financial-account-transactions": {
|
|
47
58
|
setFinancialAccount: _financialAccount => {}
|
|
48
59
|
},
|
|
49
|
-
|
|
50
|
-
|
|
60
|
+
recipients: {
|
|
61
|
+
setDataSource: _dataSource => {}
|
|
51
62
|
},
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
63
|
+
"app-install": {
|
|
64
|
+
setApp: _app => {},
|
|
65
|
+
setOnAppInstallStateFetched: _listener => {},
|
|
66
|
+
setOnAppInstallStateChanged: _listener => {}
|
|
55
67
|
},
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
68
|
+
"app-viewport": {
|
|
69
|
+
setApp: _app => {},
|
|
70
|
+
setAppData: _appData => {}
|
|
71
|
+
},
|
|
72
|
+
"payment-method-settings": {
|
|
73
|
+
setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
|
|
74
|
+
},
|
|
75
|
+
"capital-financing": {
|
|
76
|
+
setDefaultFinancingOffer: _defaultFinancingOffer => {},
|
|
77
|
+
setShowFinancingSelector: _showFinancingSelector => {},
|
|
78
|
+
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
79
|
+
setSupportUrl: _supportUrl => {},
|
|
80
|
+
setOnFinancingsLoaded: _listener => {}
|
|
81
|
+
},
|
|
82
|
+
"capital-financing-application": {
|
|
83
|
+
setOnApplicationSubmitted: _listener => {},
|
|
84
|
+
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
85
|
+
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
86
|
+
setOnApplicationStepChange: _listener => {}
|
|
87
|
+
},
|
|
88
|
+
"capital-financing-promotion": {
|
|
89
|
+
setLayout: _layout => {},
|
|
90
|
+
setOnApplicationSubmitted: _listener => {},
|
|
91
|
+
setOnEligibleFinancingOfferLoaded: _listener => {},
|
|
92
|
+
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
93
|
+
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
94
|
+
setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {},
|
|
95
|
+
setOnApplicationStepChange: _listener => {}
|
|
96
|
+
},
|
|
97
|
+
"reporting-chart": {
|
|
98
|
+
setReportName: _reportName => {},
|
|
99
|
+
setIntervalStart: _intervalStart => {},
|
|
100
|
+
setIntervalEnd: _intervalEnd => {},
|
|
101
|
+
setIntervalType: _intervalType => {}
|
|
59
102
|
},
|
|
60
103
|
"tax-settings": {
|
|
61
104
|
setHideProductTaxCodeSelector: _hidden => {},
|
|
@@ -67,38 +110,65 @@ const ConnectElementCustomMethodConfig = {
|
|
|
67
110
|
setDisplayCountries: _countries => {},
|
|
68
111
|
setOnAfterTaxRegistrationExpired: _listener => {}
|
|
69
112
|
},
|
|
113
|
+
"tax-threshold-monitoring": {
|
|
114
|
+
setDisplayCountries: _countries => {}
|
|
115
|
+
},
|
|
116
|
+
"product-tax-code-selector": {
|
|
117
|
+
setOnTaxCodeSelect: _listener => {},
|
|
118
|
+
setHideDescription: _hideDescription => {},
|
|
119
|
+
setDisabled: _disabled => {},
|
|
120
|
+
setInitialTaxCode: _initialTaxCode => {}
|
|
121
|
+
},
|
|
122
|
+
"export-tax-transactions": {},
|
|
70
123
|
"payout-details": {
|
|
71
124
|
setPayout: _payout => {},
|
|
72
125
|
setOnClose: _listener => {}
|
|
126
|
+
},
|
|
127
|
+
"check-scanning": {
|
|
128
|
+
setHandleCheckScanSubmitted: _handleCheckScanSubmitted => {}
|
|
73
129
|
}
|
|
74
130
|
};
|
|
75
131
|
|
|
76
132
|
const componentNameMapping = {
|
|
77
|
-
"account-onboarding": "stripe-connect-account-onboarding",
|
|
78
|
-
"disputes-list": "stripe-connect-disputes-list",
|
|
79
133
|
payments: "stripe-connect-payments",
|
|
134
|
+
payouts: "stripe-connect-payouts",
|
|
80
135
|
"payment-details": "stripe-connect-payment-details",
|
|
81
136
|
"payment-disputes": "stripe-connect-payment-disputes",
|
|
82
|
-
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
balances: "stripe-connect-balances",
|
|
137
|
+
"disputes-list": "stripe-connect-disputes-list",
|
|
138
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
139
|
+
"payment-method-settings": "stripe-connect-payment-method-settings",
|
|
86
140
|
"account-management": "stripe-connect-account-management",
|
|
87
141
|
"notification-banner": "stripe-connect-notification-banner",
|
|
142
|
+
"instant-payouts": "stripe-connect-instant-payouts",
|
|
88
143
|
"instant-payouts-promotion": "stripe-connect-instant-payouts-promotion",
|
|
89
144
|
"issuing-card": "stripe-connect-issuing-card",
|
|
90
145
|
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
91
146
|
"financial-account": "stripe-connect-financial-account",
|
|
147
|
+
recipients: "stripe-connect-recipients",
|
|
92
148
|
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
149
|
+
"capital-financing": "stripe-connect-capital-financing",
|
|
150
|
+
"capital-financing-application": "stripe-connect-capital-financing-application",
|
|
151
|
+
"capital-financing-promotion": "stripe-connect-capital-financing-promotion",
|
|
152
|
+
"capital-overview": "stripe-connect-capital-overview",
|
|
93
153
|
documents: "stripe-connect-documents",
|
|
154
|
+
"product-tax-code-selector": "stripe-connect-product-tax-code-selector",
|
|
155
|
+
"export-tax-transactions": "stripe-connect-export-tax-transactions",
|
|
94
156
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
95
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
157
|
+
"tax-settings": "stripe-connect-tax-settings",
|
|
158
|
+
"tax-threshold-monitoring": "stripe-connect-tax-threshold-monitoring",
|
|
159
|
+
balances: "stripe-connect-balances",
|
|
160
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
161
|
+
"payout-details": "stripe-connect-payout-details",
|
|
162
|
+
"app-install": "stripe-connect-app-install",
|
|
163
|
+
"app-viewport": "stripe-connect-app-viewport",
|
|
164
|
+
"reporting-chart": "stripe-connect-reporting-chart",
|
|
165
|
+
"check-scanning": "stripe-connect-check-scanning"
|
|
96
166
|
};
|
|
97
167
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
98
168
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
99
169
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
100
170
|
const findScript = () => {
|
|
101
|
-
return document.querySelectorAll(`script[src="${
|
|
171
|
+
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || null;
|
|
102
172
|
};
|
|
103
173
|
const injectScript = () => {
|
|
104
174
|
const script = document.createElement("script");
|
|
@@ -110,7 +180,7 @@ const injectScript = () => {
|
|
|
110
180
|
document.head.appendChild(script);
|
|
111
181
|
return script;
|
|
112
182
|
};
|
|
113
|
-
let stripePromise
|
|
183
|
+
let stripePromise = null;
|
|
114
184
|
const isWindowStripeConnectDefined = stripeConnect => {
|
|
115
185
|
// We only consider `StripeConnect` defined if `init` is a function
|
|
116
186
|
// Why? HTML markup like:
|
|
@@ -120,10 +190,10 @@ const isWindowStripeConnectDefined = stripeConnect => {
|
|
|
120
190
|
};
|
|
121
191
|
const loadScript = () => {
|
|
122
192
|
// Ensure that we only attempt to load Connect.js at most once
|
|
123
|
-
if (stripePromise
|
|
124
|
-
return stripePromise
|
|
193
|
+
if (stripePromise !== null) {
|
|
194
|
+
return stripePromise;
|
|
125
195
|
}
|
|
126
|
-
stripePromise
|
|
196
|
+
stripePromise = new Promise((resolve, reject) => {
|
|
127
197
|
if (typeof window === "undefined") {
|
|
128
198
|
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.");
|
|
129
199
|
return;
|
|
@@ -156,7 +226,7 @@ const loadScript = () => {
|
|
|
156
226
|
reject(error);
|
|
157
227
|
}
|
|
158
228
|
});
|
|
159
|
-
return stripePromise
|
|
229
|
+
return stripePromise;
|
|
160
230
|
};
|
|
161
231
|
const hasCustomMethod = tagName => {
|
|
162
232
|
return tagName in ConnectElementCustomMethodConfig;
|
|
@@ -189,7 +259,7 @@ const initStripeConnect = (stripePromise, initParams) => {
|
|
|
189
259
|
element[method] = function (value) {
|
|
190
260
|
stripeConnectInstance.then(() => {
|
|
191
261
|
if (!this[`${method}InternalOnly`]) {
|
|
192
|
-
throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.3.
|
|
262
|
+
throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.3.45-preview-1`);
|
|
193
263
|
}
|
|
194
264
|
this[`${method}InternalOnly`](value);
|
|
195
265
|
});
|
|
@@ -243,7 +313,7 @@ const createWrapper = stripeConnect => {
|
|
|
243
313
|
sdk: true,
|
|
244
314
|
sdkOptions: {
|
|
245
315
|
// This will be replaced by the npm package version when bundling
|
|
246
|
-
sdkVersion: "3.3.
|
|
316
|
+
sdkVersion: "3.3.45-preview-1"
|
|
247
317
|
}
|
|
248
318
|
})
|
|
249
319
|
}));
|
|
@@ -255,16 +325,16 @@ const createWrapper = stripeConnect => {
|
|
|
255
325
|
|
|
256
326
|
// Execute our own script injection after a tick to give users time to do their
|
|
257
327
|
// own script injection.
|
|
258
|
-
const stripePromise = Promise.resolve().then(() => loadScript());
|
|
328
|
+
const stripePromise$1 = Promise.resolve().then(() => loadScript());
|
|
259
329
|
let loadCalled = false;
|
|
260
|
-
stripePromise.catch(err => {
|
|
330
|
+
stripePromise$1.catch(err => {
|
|
261
331
|
if (!loadCalled) {
|
|
262
332
|
console.warn(err);
|
|
263
333
|
}
|
|
264
334
|
});
|
|
265
335
|
const loadConnectAndInitialize = initParams => {
|
|
266
336
|
loadCalled = true;
|
|
267
|
-
return initStripeConnect(stripePromise, initParams);
|
|
337
|
+
return initStripeConnect(stripePromise$1, initParams);
|
|
268
338
|
};
|
|
269
339
|
|
|
270
340
|
exports.loadConnectAndInitialize = loadConnectAndInitialize;
|
package/dist/pure.esm.js
CHANGED
|
@@ -5,6 +5,17 @@ const ConnectElementCommonMethodConfig = {
|
|
|
5
5
|
setOnLoaderStart: _listener => {}
|
|
6
6
|
};
|
|
7
7
|
const ConnectElementCustomMethodConfig = {
|
|
8
|
+
payments: {
|
|
9
|
+
setDefaultFilters: _filters => {}
|
|
10
|
+
},
|
|
11
|
+
"payment-details": {
|
|
12
|
+
setPayment: _payment => {},
|
|
13
|
+
setOnClose: _listener => {}
|
|
14
|
+
},
|
|
15
|
+
"payment-disputes": {
|
|
16
|
+
setPayment: _payment => {},
|
|
17
|
+
setOnDisputesLoaded: _listener => {}
|
|
18
|
+
},
|
|
8
19
|
"account-onboarding": {
|
|
9
20
|
setFullTermsOfServiceUrl: _termOfServiceUrl => {},
|
|
10
21
|
setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
|
|
@@ -42,16 +53,48 @@ const ConnectElementCustomMethodConfig = {
|
|
|
42
53
|
"financial-account-transactions": {
|
|
43
54
|
setFinancialAccount: _financialAccount => {}
|
|
44
55
|
},
|
|
45
|
-
|
|
46
|
-
|
|
56
|
+
recipients: {
|
|
57
|
+
setDataSource: _dataSource => {}
|
|
47
58
|
},
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
59
|
+
"app-install": {
|
|
60
|
+
setApp: _app => {},
|
|
61
|
+
setOnAppInstallStateFetched: _listener => {},
|
|
62
|
+
setOnAppInstallStateChanged: _listener => {}
|
|
51
63
|
},
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
64
|
+
"app-viewport": {
|
|
65
|
+
setApp: _app => {},
|
|
66
|
+
setAppData: _appData => {}
|
|
67
|
+
},
|
|
68
|
+
"payment-method-settings": {
|
|
69
|
+
setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
|
|
70
|
+
},
|
|
71
|
+
"capital-financing": {
|
|
72
|
+
setDefaultFinancingOffer: _defaultFinancingOffer => {},
|
|
73
|
+
setShowFinancingSelector: _showFinancingSelector => {},
|
|
74
|
+
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
75
|
+
setSupportUrl: _supportUrl => {},
|
|
76
|
+
setOnFinancingsLoaded: _listener => {}
|
|
77
|
+
},
|
|
78
|
+
"capital-financing-application": {
|
|
79
|
+
setOnApplicationSubmitted: _listener => {},
|
|
80
|
+
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
81
|
+
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
82
|
+
setOnApplicationStepChange: _listener => {}
|
|
83
|
+
},
|
|
84
|
+
"capital-financing-promotion": {
|
|
85
|
+
setLayout: _layout => {},
|
|
86
|
+
setOnApplicationSubmitted: _listener => {},
|
|
87
|
+
setOnEligibleFinancingOfferLoaded: _listener => {},
|
|
88
|
+
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
89
|
+
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
90
|
+
setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {},
|
|
91
|
+
setOnApplicationStepChange: _listener => {}
|
|
92
|
+
},
|
|
93
|
+
"reporting-chart": {
|
|
94
|
+
setReportName: _reportName => {},
|
|
95
|
+
setIntervalStart: _intervalStart => {},
|
|
96
|
+
setIntervalEnd: _intervalEnd => {},
|
|
97
|
+
setIntervalType: _intervalType => {}
|
|
55
98
|
},
|
|
56
99
|
"tax-settings": {
|
|
57
100
|
setHideProductTaxCodeSelector: _hidden => {},
|
|
@@ -63,38 +106,65 @@ const ConnectElementCustomMethodConfig = {
|
|
|
63
106
|
setDisplayCountries: _countries => {},
|
|
64
107
|
setOnAfterTaxRegistrationExpired: _listener => {}
|
|
65
108
|
},
|
|
109
|
+
"tax-threshold-monitoring": {
|
|
110
|
+
setDisplayCountries: _countries => {}
|
|
111
|
+
},
|
|
112
|
+
"product-tax-code-selector": {
|
|
113
|
+
setOnTaxCodeSelect: _listener => {},
|
|
114
|
+
setHideDescription: _hideDescription => {},
|
|
115
|
+
setDisabled: _disabled => {},
|
|
116
|
+
setInitialTaxCode: _initialTaxCode => {}
|
|
117
|
+
},
|
|
118
|
+
"export-tax-transactions": {},
|
|
66
119
|
"payout-details": {
|
|
67
120
|
setPayout: _payout => {},
|
|
68
121
|
setOnClose: _listener => {}
|
|
122
|
+
},
|
|
123
|
+
"check-scanning": {
|
|
124
|
+
setHandleCheckScanSubmitted: _handleCheckScanSubmitted => {}
|
|
69
125
|
}
|
|
70
126
|
};
|
|
71
127
|
|
|
72
128
|
const componentNameMapping = {
|
|
73
|
-
"account-onboarding": "stripe-connect-account-onboarding",
|
|
74
|
-
"disputes-list": "stripe-connect-disputes-list",
|
|
75
129
|
payments: "stripe-connect-payments",
|
|
130
|
+
payouts: "stripe-connect-payouts",
|
|
76
131
|
"payment-details": "stripe-connect-payment-details",
|
|
77
132
|
"payment-disputes": "stripe-connect-payment-disputes",
|
|
78
|
-
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
balances: "stripe-connect-balances",
|
|
133
|
+
"disputes-list": "stripe-connect-disputes-list",
|
|
134
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
135
|
+
"payment-method-settings": "stripe-connect-payment-method-settings",
|
|
82
136
|
"account-management": "stripe-connect-account-management",
|
|
83
137
|
"notification-banner": "stripe-connect-notification-banner",
|
|
138
|
+
"instant-payouts": "stripe-connect-instant-payouts",
|
|
84
139
|
"instant-payouts-promotion": "stripe-connect-instant-payouts-promotion",
|
|
85
140
|
"issuing-card": "stripe-connect-issuing-card",
|
|
86
141
|
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
87
142
|
"financial-account": "stripe-connect-financial-account",
|
|
143
|
+
recipients: "stripe-connect-recipients",
|
|
88
144
|
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
145
|
+
"capital-financing": "stripe-connect-capital-financing",
|
|
146
|
+
"capital-financing-application": "stripe-connect-capital-financing-application",
|
|
147
|
+
"capital-financing-promotion": "stripe-connect-capital-financing-promotion",
|
|
148
|
+
"capital-overview": "stripe-connect-capital-overview",
|
|
89
149
|
documents: "stripe-connect-documents",
|
|
150
|
+
"product-tax-code-selector": "stripe-connect-product-tax-code-selector",
|
|
151
|
+
"export-tax-transactions": "stripe-connect-export-tax-transactions",
|
|
90
152
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
91
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
153
|
+
"tax-settings": "stripe-connect-tax-settings",
|
|
154
|
+
"tax-threshold-monitoring": "stripe-connect-tax-threshold-monitoring",
|
|
155
|
+
balances: "stripe-connect-balances",
|
|
156
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
157
|
+
"payout-details": "stripe-connect-payout-details",
|
|
158
|
+
"app-install": "stripe-connect-app-install",
|
|
159
|
+
"app-viewport": "stripe-connect-app-viewport",
|
|
160
|
+
"reporting-chart": "stripe-connect-reporting-chart",
|
|
161
|
+
"check-scanning": "stripe-connect-check-scanning"
|
|
92
162
|
};
|
|
93
163
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
94
164
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
95
165
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
96
166
|
const findScript = () => {
|
|
97
|
-
return document.querySelectorAll(`script[src="${
|
|
167
|
+
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || null;
|
|
98
168
|
};
|
|
99
169
|
const injectScript = () => {
|
|
100
170
|
const script = document.createElement("script");
|
|
@@ -185,7 +255,7 @@ const initStripeConnect = (stripePromise, initParams) => {
|
|
|
185
255
|
element[method] = function (value) {
|
|
186
256
|
stripeConnectInstance.then(() => {
|
|
187
257
|
if (!this[`${method}InternalOnly`]) {
|
|
188
|
-
throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.3.
|
|
258
|
+
throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.3.45-preview-1`);
|
|
189
259
|
}
|
|
190
260
|
this[`${method}InternalOnly`](value);
|
|
191
261
|
});
|
|
@@ -239,7 +309,7 @@ const createWrapper = stripeConnect => {
|
|
|
239
309
|
sdk: true,
|
|
240
310
|
sdkOptions: {
|
|
241
311
|
// This will be replaced by the npm package version when bundling
|
|
242
|
-
sdkVersion: "3.3.
|
|
312
|
+
sdkVersion: "3.3.45-preview-1"
|
|
243
313
|
}
|
|
244
314
|
})
|
|
245
315
|
}));
|
package/dist/pure.js
CHANGED
|
@@ -9,6 +9,17 @@ const ConnectElementCommonMethodConfig = {
|
|
|
9
9
|
setOnLoaderStart: _listener => {}
|
|
10
10
|
};
|
|
11
11
|
const ConnectElementCustomMethodConfig = {
|
|
12
|
+
payments: {
|
|
13
|
+
setDefaultFilters: _filters => {}
|
|
14
|
+
},
|
|
15
|
+
"payment-details": {
|
|
16
|
+
setPayment: _payment => {},
|
|
17
|
+
setOnClose: _listener => {}
|
|
18
|
+
},
|
|
19
|
+
"payment-disputes": {
|
|
20
|
+
setPayment: _payment => {},
|
|
21
|
+
setOnDisputesLoaded: _listener => {}
|
|
22
|
+
},
|
|
12
23
|
"account-onboarding": {
|
|
13
24
|
setFullTermsOfServiceUrl: _termOfServiceUrl => {},
|
|
14
25
|
setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
|
|
@@ -46,16 +57,48 @@ const ConnectElementCustomMethodConfig = {
|
|
|
46
57
|
"financial-account-transactions": {
|
|
47
58
|
setFinancialAccount: _financialAccount => {}
|
|
48
59
|
},
|
|
49
|
-
|
|
50
|
-
|
|
60
|
+
recipients: {
|
|
61
|
+
setDataSource: _dataSource => {}
|
|
51
62
|
},
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
63
|
+
"app-install": {
|
|
64
|
+
setApp: _app => {},
|
|
65
|
+
setOnAppInstallStateFetched: _listener => {},
|
|
66
|
+
setOnAppInstallStateChanged: _listener => {}
|
|
55
67
|
},
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
68
|
+
"app-viewport": {
|
|
69
|
+
setApp: _app => {},
|
|
70
|
+
setAppData: _appData => {}
|
|
71
|
+
},
|
|
72
|
+
"payment-method-settings": {
|
|
73
|
+
setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
|
|
74
|
+
},
|
|
75
|
+
"capital-financing": {
|
|
76
|
+
setDefaultFinancingOffer: _defaultFinancingOffer => {},
|
|
77
|
+
setShowFinancingSelector: _showFinancingSelector => {},
|
|
78
|
+
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
79
|
+
setSupportUrl: _supportUrl => {},
|
|
80
|
+
setOnFinancingsLoaded: _listener => {}
|
|
81
|
+
},
|
|
82
|
+
"capital-financing-application": {
|
|
83
|
+
setOnApplicationSubmitted: _listener => {},
|
|
84
|
+
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
85
|
+
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
86
|
+
setOnApplicationStepChange: _listener => {}
|
|
87
|
+
},
|
|
88
|
+
"capital-financing-promotion": {
|
|
89
|
+
setLayout: _layout => {},
|
|
90
|
+
setOnApplicationSubmitted: _listener => {},
|
|
91
|
+
setOnEligibleFinancingOfferLoaded: _listener => {},
|
|
92
|
+
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
93
|
+
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
94
|
+
setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {},
|
|
95
|
+
setOnApplicationStepChange: _listener => {}
|
|
96
|
+
},
|
|
97
|
+
"reporting-chart": {
|
|
98
|
+
setReportName: _reportName => {},
|
|
99
|
+
setIntervalStart: _intervalStart => {},
|
|
100
|
+
setIntervalEnd: _intervalEnd => {},
|
|
101
|
+
setIntervalType: _intervalType => {}
|
|
59
102
|
},
|
|
60
103
|
"tax-settings": {
|
|
61
104
|
setHideProductTaxCodeSelector: _hidden => {},
|
|
@@ -67,38 +110,65 @@ const ConnectElementCustomMethodConfig = {
|
|
|
67
110
|
setDisplayCountries: _countries => {},
|
|
68
111
|
setOnAfterTaxRegistrationExpired: _listener => {}
|
|
69
112
|
},
|
|
113
|
+
"tax-threshold-monitoring": {
|
|
114
|
+
setDisplayCountries: _countries => {}
|
|
115
|
+
},
|
|
116
|
+
"product-tax-code-selector": {
|
|
117
|
+
setOnTaxCodeSelect: _listener => {},
|
|
118
|
+
setHideDescription: _hideDescription => {},
|
|
119
|
+
setDisabled: _disabled => {},
|
|
120
|
+
setInitialTaxCode: _initialTaxCode => {}
|
|
121
|
+
},
|
|
122
|
+
"export-tax-transactions": {},
|
|
70
123
|
"payout-details": {
|
|
71
124
|
setPayout: _payout => {},
|
|
72
125
|
setOnClose: _listener => {}
|
|
126
|
+
},
|
|
127
|
+
"check-scanning": {
|
|
128
|
+
setHandleCheckScanSubmitted: _handleCheckScanSubmitted => {}
|
|
73
129
|
}
|
|
74
130
|
};
|
|
75
131
|
|
|
76
132
|
const componentNameMapping = {
|
|
77
|
-
"account-onboarding": "stripe-connect-account-onboarding",
|
|
78
|
-
"disputes-list": "stripe-connect-disputes-list",
|
|
79
133
|
payments: "stripe-connect-payments",
|
|
134
|
+
payouts: "stripe-connect-payouts",
|
|
80
135
|
"payment-details": "stripe-connect-payment-details",
|
|
81
136
|
"payment-disputes": "stripe-connect-payment-disputes",
|
|
82
|
-
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
balances: "stripe-connect-balances",
|
|
137
|
+
"disputes-list": "stripe-connect-disputes-list",
|
|
138
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
139
|
+
"payment-method-settings": "stripe-connect-payment-method-settings",
|
|
86
140
|
"account-management": "stripe-connect-account-management",
|
|
87
141
|
"notification-banner": "stripe-connect-notification-banner",
|
|
142
|
+
"instant-payouts": "stripe-connect-instant-payouts",
|
|
88
143
|
"instant-payouts-promotion": "stripe-connect-instant-payouts-promotion",
|
|
89
144
|
"issuing-card": "stripe-connect-issuing-card",
|
|
90
145
|
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
91
146
|
"financial-account": "stripe-connect-financial-account",
|
|
147
|
+
recipients: "stripe-connect-recipients",
|
|
92
148
|
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
149
|
+
"capital-financing": "stripe-connect-capital-financing",
|
|
150
|
+
"capital-financing-application": "stripe-connect-capital-financing-application",
|
|
151
|
+
"capital-financing-promotion": "stripe-connect-capital-financing-promotion",
|
|
152
|
+
"capital-overview": "stripe-connect-capital-overview",
|
|
93
153
|
documents: "stripe-connect-documents",
|
|
154
|
+
"product-tax-code-selector": "stripe-connect-product-tax-code-selector",
|
|
155
|
+
"export-tax-transactions": "stripe-connect-export-tax-transactions",
|
|
94
156
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
95
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
157
|
+
"tax-settings": "stripe-connect-tax-settings",
|
|
158
|
+
"tax-threshold-monitoring": "stripe-connect-tax-threshold-monitoring",
|
|
159
|
+
balances: "stripe-connect-balances",
|
|
160
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
161
|
+
"payout-details": "stripe-connect-payout-details",
|
|
162
|
+
"app-install": "stripe-connect-app-install",
|
|
163
|
+
"app-viewport": "stripe-connect-app-viewport",
|
|
164
|
+
"reporting-chart": "stripe-connect-reporting-chart",
|
|
165
|
+
"check-scanning": "stripe-connect-check-scanning"
|
|
96
166
|
};
|
|
97
167
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
98
168
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
99
169
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
100
170
|
const findScript = () => {
|
|
101
|
-
return document.querySelectorAll(`script[src="${
|
|
171
|
+
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || null;
|
|
102
172
|
};
|
|
103
173
|
const injectScript = () => {
|
|
104
174
|
const script = document.createElement("script");
|
|
@@ -189,7 +259,7 @@ const initStripeConnect = (stripePromise, initParams) => {
|
|
|
189
259
|
element[method] = function (value) {
|
|
190
260
|
stripeConnectInstance.then(() => {
|
|
191
261
|
if (!this[`${method}InternalOnly`]) {
|
|
192
|
-
throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.3.
|
|
262
|
+
throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.3.45-preview-1`);
|
|
193
263
|
}
|
|
194
264
|
this[`${method}InternalOnly`](value);
|
|
195
265
|
});
|
|
@@ -243,7 +313,7 @@ const createWrapper = stripeConnect => {
|
|
|
243
313
|
sdk: true,
|
|
244
314
|
sdkOptions: {
|
|
245
315
|
// This will be replaced by the npm package version when bundling
|
|
246
|
-
sdkVersion: "3.3.
|
|
316
|
+
sdkVersion: "3.3.45-preview-1"
|
|
247
317
|
}
|
|
248
318
|
})
|
|
249
319
|
}));
|
package/dist/src/shared.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IStripeConnectInitParams, StripeConnectInstance, ConnectElementTagName } from "../types";
|
|
2
2
|
export type LoadConnectAndInitialize = (initParams: IStripeConnectInitParams) => StripeConnectInstance;
|
|
3
|
-
type ConnectElementHTMLName = "stripe-connect-
|
|
3
|
+
export type ConnectElementHTMLName = "stripe-connect-payments" | "stripe-connect-payouts" | "stripe-connect-payment-details" | "stripe-connect-payment-disputes" | "stripe-connect-disputes-list" | "stripe-connect-account-onboarding" | "stripe-connect-payment-method-settings" | "stripe-connect-account-management" | "stripe-connect-notification-banner" | "stripe-connect-instant-payouts" | "stripe-connect-instant-payouts-promotion" | "stripe-connect-issuing-card" | "stripe-connect-issuing-cards-list" | "stripe-connect-financial-account" | "stripe-connect-financial-account-transactions" | "stripe-connect-recipients" | "stripe-connect-capital-financing" | "stripe-connect-capital-financing-application" | "stripe-connect-capital-financing-promotion" | "stripe-connect-capital-overview" | "stripe-connect-documents" | "stripe-connect-product-tax-code-selector" | "stripe-connect-export-tax-transactions" | "stripe-connect-tax-registrations" | "stripe-connect-tax-settings" | "stripe-connect-tax-threshold-monitoring" | "stripe-connect-balances" | "stripe-connect-payouts-list" | "stripe-connect-payout-details" | "stripe-connect-app-install" | "stripe-connect-app-viewport" | "stripe-connect-reporting-chart" | "stripe-connect-check-scanning";
|
|
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
|
@@ -47,6 +47,10 @@ export type NotificationCount = {
|
|
|
47
47
|
total: number;
|
|
48
48
|
actionRequired: number;
|
|
49
49
|
};
|
|
50
|
+
export type InstallState = {
|
|
51
|
+
appId: string;
|
|
52
|
+
state: "INSTALLED" | "UNINSTALLED";
|
|
53
|
+
};
|
|
50
54
|
export type LoaderStart = {
|
|
51
55
|
elementTagName: string;
|
|
52
56
|
};
|
|
@@ -61,6 +65,14 @@ export type EmbeddedError = {
|
|
|
61
65
|
type: EmbeddedErrorType;
|
|
62
66
|
message?: string;
|
|
63
67
|
};
|
|
68
|
+
export type FinancingProductType = {
|
|
69
|
+
productType: "standard" | "refill" | "none";
|
|
70
|
+
activeFinancingCount: number;
|
|
71
|
+
};
|
|
72
|
+
export type FinancingPromotionLayoutType = "full" | "banner";
|
|
73
|
+
export type IntervalType = "day" | "week" | "month" | "quarter" | "year";
|
|
74
|
+
export type ReportName = "gross_volume" | "net_volume";
|
|
75
|
+
export type RecipientDataSource = "customers";
|
|
64
76
|
export type EmbeddedErrorType =
|
|
65
77
|
/**
|
|
66
78
|
* Failure to connect to Stripe's API.
|
|
@@ -82,6 +94,10 @@ export type EmbeddedErrorType =
|
|
|
82
94
|
* Too many requests hit the API too quickly.
|
|
83
95
|
*/
|
|
84
96
|
| "rate_limit_error"
|
|
97
|
+
/**
|
|
98
|
+
* Failure to render the component, typically caused by browser extensions or network issues
|
|
99
|
+
*/
|
|
100
|
+
| "render_error"
|
|
85
101
|
/**
|
|
86
102
|
* API errors covering any other type of problem (e.g., a temporary problem with Stripe's servers), and are extremely uncommon.
|
|
87
103
|
*/
|
|
@@ -91,6 +107,19 @@ export declare const ConnectElementCommonMethodConfig: {
|
|
|
91
107
|
setOnLoaderStart: (_listener: (({ elementTagName }: LoaderStart) => void) | undefined) => void;
|
|
92
108
|
};
|
|
93
109
|
export declare const ConnectElementCustomMethodConfig: {
|
|
110
|
+
payments: {
|
|
111
|
+
setDefaultFilters: (_filters: PaymentsListDefaultFilters | undefined) => void;
|
|
112
|
+
};
|
|
113
|
+
"payment-details": {
|
|
114
|
+
setPayment: (_payment: string | undefined) => void;
|
|
115
|
+
setOnClose: (_listener: (() => void) | undefined) => void;
|
|
116
|
+
};
|
|
117
|
+
"payment-disputes": {
|
|
118
|
+
setPayment: (_payment: string | undefined) => void;
|
|
119
|
+
setOnDisputesLoaded: (_listener: (({ total }: {
|
|
120
|
+
total: number;
|
|
121
|
+
}) => void) | undefined) => void;
|
|
122
|
+
};
|
|
94
123
|
"account-onboarding": {
|
|
95
124
|
setFullTermsOfServiceUrl: (_termOfServiceUrl: string | undefined) => void;
|
|
96
125
|
setRecipientTermsOfServiceUrl: (_recipientTermsOfServiceUrl: string | undefined) => void;
|
|
@@ -132,19 +161,51 @@ export declare const ConnectElementCustomMethodConfig: {
|
|
|
132
161
|
"financial-account-transactions": {
|
|
133
162
|
setFinancialAccount: (_financialAccount: string) => void;
|
|
134
163
|
};
|
|
135
|
-
|
|
136
|
-
|
|
164
|
+
recipients: {
|
|
165
|
+
setDataSource: (_dataSource: RecipientDataSource) => void;
|
|
137
166
|
};
|
|
138
|
-
"
|
|
139
|
-
|
|
140
|
-
|
|
167
|
+
"app-install": {
|
|
168
|
+
setApp: (_app: string | undefined) => void;
|
|
169
|
+
setOnAppInstallStateFetched: (_listener: (({ appId, state }: InstallState) => void) | undefined) => void;
|
|
170
|
+
setOnAppInstallStateChanged: (_listener: (({ appId, state }: InstallState) => void) | undefined) => void;
|
|
141
171
|
};
|
|
142
|
-
"
|
|
143
|
-
|
|
144
|
-
|
|
172
|
+
"app-viewport": {
|
|
173
|
+
setApp: (_app: string | undefined) => void;
|
|
174
|
+
setAppData: (_appData: Record<string, string> | undefined) => void;
|
|
175
|
+
};
|
|
176
|
+
"payment-method-settings": {
|
|
177
|
+
setPaymentMethodConfiguration: (_paymentMethodConfiguration: string | undefined) => void;
|
|
178
|
+
};
|
|
179
|
+
"capital-financing": {
|
|
180
|
+
setDefaultFinancingOffer: (_defaultFinancingOffer: string | undefined) => void;
|
|
181
|
+
setShowFinancingSelector: (_showFinancingSelector: boolean | undefined) => void;
|
|
182
|
+
setHowCapitalWorksUrl: (_howCapitalWorksUrl: string | undefined) => void;
|
|
183
|
+
setSupportUrl: (_supportUrl: string | undefined) => void;
|
|
184
|
+
setOnFinancingsLoaded: (_listener: (({ total }: {
|
|
145
185
|
total: number;
|
|
146
186
|
}) => void) | undefined) => void;
|
|
147
187
|
};
|
|
188
|
+
"capital-financing-application": {
|
|
189
|
+
setOnApplicationSubmitted: (_listener: (() => void) | undefined) => void;
|
|
190
|
+
setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined) => void;
|
|
191
|
+
setHowCapitalWorksUrl: (_howCapitalWorksUrl: string | undefined) => void;
|
|
192
|
+
setOnApplicationStepChange: (_listener: (({ step }: StepChange) => void) | undefined) => void;
|
|
193
|
+
};
|
|
194
|
+
"capital-financing-promotion": {
|
|
195
|
+
setLayout: (_layout: FinancingPromotionLayoutType | undefined) => void;
|
|
196
|
+
setOnApplicationSubmitted: (_listener: (() => void) | undefined) => void;
|
|
197
|
+
setOnEligibleFinancingOfferLoaded: (_listener: (({ productType, activeFinancingCount, }: FinancingProductType) => void) | undefined) => void;
|
|
198
|
+
setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined) => void;
|
|
199
|
+
setHowCapitalWorksUrl: (_howCapitalWorksUrl: string | undefined) => void;
|
|
200
|
+
setEligibilityCriteriaUrl: (_eligibilityCriteriaUrl: string | undefined) => void;
|
|
201
|
+
setOnApplicationStepChange: (_listener: (({ step }: StepChange) => void) | undefined) => void;
|
|
202
|
+
};
|
|
203
|
+
"reporting-chart": {
|
|
204
|
+
setReportName: (_reportName: ReportName) => void;
|
|
205
|
+
setIntervalStart: (_intervalStart: Date | undefined) => void;
|
|
206
|
+
setIntervalEnd: (_intervalEnd: Date | undefined) => void;
|
|
207
|
+
setIntervalType: (_intervalType: IntervalType | undefined) => void;
|
|
208
|
+
};
|
|
148
209
|
"tax-settings": {
|
|
149
210
|
setHideProductTaxCodeSelector: (_hidden: boolean | undefined) => void;
|
|
150
211
|
setDisplayHeadOfficeCountries: (_countries: string[] | undefined) => void;
|
|
@@ -161,8 +222,25 @@ export declare const ConnectElementCustomMethodConfig: {
|
|
|
161
222
|
id: string;
|
|
162
223
|
}) => void) | undefined) => void;
|
|
163
224
|
};
|
|
225
|
+
"tax-threshold-monitoring": {
|
|
226
|
+
setDisplayCountries: (_countries: string[] | undefined) => void;
|
|
227
|
+
};
|
|
228
|
+
"product-tax-code-selector": {
|
|
229
|
+
setOnTaxCodeSelect: (_listener: ((taxCode: string | null, _: {
|
|
230
|
+
analyticsName: string;
|
|
231
|
+
} | null) => void) | undefined) => void;
|
|
232
|
+
setHideDescription: (_hideDescription: boolean | undefined) => void;
|
|
233
|
+
setDisabled: (_disabled: boolean | undefined) => void;
|
|
234
|
+
setInitialTaxCode: (_initialTaxCode: string | undefined) => void;
|
|
235
|
+
};
|
|
236
|
+
"export-tax-transactions": {};
|
|
164
237
|
"payout-details": {
|
|
165
238
|
setPayout: (_payout: string | undefined) => void;
|
|
166
239
|
setOnClose: (_listener: (() => void) | undefined) => void;
|
|
167
240
|
};
|
|
241
|
+
"check-scanning": {
|
|
242
|
+
setHandleCheckScanSubmitted: (_handleCheckScanSubmitted: ({ checkScanToken, }: {
|
|
243
|
+
checkScanToken: string;
|
|
244
|
+
}) => Promise<void>) => void;
|
|
245
|
+
};
|
|
168
246
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stripe/connect-js",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.32",
|
|
4
4
|
"description": "Connect.js loading utility package",
|
|
5
5
|
"main": "dist/connect.js",
|
|
6
6
|
"module": "dist/connect.esm.js",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"ts-jest": "^29.1.0",
|
|
70
70
|
"typescript": "^4.1.2",
|
|
71
71
|
"yalc": "^1.0.0-pre.53",
|
|
72
|
-
"zx": "^
|
|
72
|
+
"zx": "^8.8.5"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {}
|
|
75
75
|
}
|
package/types/config.ts
CHANGED
|
@@ -180,6 +180,10 @@ export type EmbeddedErrorType =
|
|
|
180
180
|
* Too many requests hit the API too quickly.
|
|
181
181
|
*/
|
|
182
182
|
| "rate_limit_error"
|
|
183
|
+
/**
|
|
184
|
+
* Failure to render the component, typically caused by browser extensions or network issues
|
|
185
|
+
*/
|
|
186
|
+
| "render_error"
|
|
183
187
|
/**
|
|
184
188
|
* API errors covering any other type of problem (e.g., a temporary problem with Stripe's servers), and are extremely uncommon.
|
|
185
189
|
*/
|