@stripe/connect-js 3.3.6 → 3.3.8-beta-1
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 +41 -11
- package/dist/connect.js +41 -11
- package/dist/pure.esm.js +41 -11
- package/dist/pure.js +41 -11
- package/dist/src/shared.d.ts +1 -1
- package/dist/src/utils/jestHelpers.d.ts +1 -1
- package/dist/types/config.d.ts +27 -3
- package/package.json +1 -1
- package/src/shared.ts +41 -12
- package/src/utils/jestHelpers.ts +1 -1
- package/types/config.ts +32 -3
- package/types/shared.d.ts +15 -4
package/dist/connect.esm.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
3
3
|
const ConnectElementCustomMethodConfig = {
|
|
4
|
+
"payment-details": {
|
|
5
|
+
setPayment: _payment => {},
|
|
6
|
+
setOnClose: _listener => {}
|
|
7
|
+
},
|
|
4
8
|
"account-onboarding": {
|
|
5
9
|
setFullTermsOfServiceUrl: _termOfServiceUrl => {},
|
|
6
10
|
setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
|
|
@@ -15,31 +19,54 @@ const ConnectElementCustomMethodConfig = {
|
|
|
15
19
|
"notification-banner": {
|
|
16
20
|
setCollectionOptions: _collectionOptions => {}
|
|
17
21
|
},
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
"issuing-card": {
|
|
23
|
+
setDefaultCard: _defaultCard => {},
|
|
24
|
+
setCardArtFileLink: _cardArtFileLink => {},
|
|
25
|
+
setCardSwitching: _cardSwitching => {},
|
|
26
|
+
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
27
|
+
},
|
|
28
|
+
"issuing-cards-list": {
|
|
29
|
+
setCardArtFileLink: _cardArtFileLink => {},
|
|
30
|
+
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
31
|
+
},
|
|
32
|
+
"financial-account": {
|
|
33
|
+
setFinancialAccount: _financialAccount => {}
|
|
34
|
+
},
|
|
35
|
+
"financial-account-transactions": {
|
|
36
|
+
setFinancialAccount: _financialAccount => {}
|
|
21
37
|
}
|
|
22
38
|
};
|
|
23
39
|
|
|
24
40
|
const componentNameMapping = {
|
|
25
|
-
"account-onboarding": "stripe-connect-account-onboarding",
|
|
26
41
|
payments: "stripe-connect-payments",
|
|
27
|
-
"payment-details": "stripe-connect-payment-details",
|
|
28
42
|
payouts: "stripe-connect-payouts",
|
|
29
|
-
"
|
|
30
|
-
|
|
43
|
+
"payment-details": "stripe-connect-payment-details",
|
|
44
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
45
|
+
"payment-method-settings": "stripe-connect-payment-method-settings",
|
|
31
46
|
"account-management": "stripe-connect-account-management",
|
|
32
47
|
"notification-banner": "stripe-connect-notification-banner",
|
|
33
|
-
|
|
48
|
+
"instant-payouts": "stripe-connect-instant-payouts",
|
|
49
|
+
"issuing-card": "stripe-connect-issuing-card",
|
|
50
|
+
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
51
|
+
"financial-account": "stripe-connect-financial-account",
|
|
52
|
+
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
53
|
+
"capital-overview": "stripe-connect-capital-overview",
|
|
54
|
+
documents: "stripe-connect-documents",
|
|
55
|
+
"tax-registrations": "stripe-connect-tax-registrations",
|
|
56
|
+
"tax-settings": "stripe-connect-tax-settings",
|
|
57
|
+
balances: "stripe-connect-balances",
|
|
58
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
59
|
+
"app-install": "stripe-connect-app-install",
|
|
60
|
+
"app-viewport": "stripe-connect-app-viewport"
|
|
34
61
|
};
|
|
35
62
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
36
|
-
const V0_URL = "https://connect-js.stripe.com/
|
|
63
|
+
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
37
64
|
const findScript = () => {
|
|
38
65
|
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
39
66
|
};
|
|
40
67
|
const injectScript = () => {
|
|
41
68
|
const script = document.createElement("script");
|
|
42
|
-
script.src = "https://connect-js.stripe.com/
|
|
69
|
+
script.src = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
43
70
|
const head = document.head;
|
|
44
71
|
if (!head) {
|
|
45
72
|
throw new Error("Expected document.head not to be null. Connect.js requires a <head> element.");
|
|
@@ -126,6 +153,9 @@ const initStripeConnect = (stripePromise, initParams) => {
|
|
|
126
153
|
document.body.removeChild(element);
|
|
127
154
|
element.style.display = oldDisplay;
|
|
128
155
|
}
|
|
156
|
+
if (!element || !element.setConnector) {
|
|
157
|
+
throw new Error(`Element ${tagName} was not transformed into a custom element. Are you using a documented component? See https://docs.stripe.com/connect/supported-embedded-components for a list of supported components`);
|
|
158
|
+
}
|
|
129
159
|
element.setConnector(instance.connect);
|
|
130
160
|
});
|
|
131
161
|
return element;
|
|
@@ -157,7 +187,7 @@ const createWrapper = stripeConnect => {
|
|
|
157
187
|
sdk: true,
|
|
158
188
|
sdkOptions: {
|
|
159
189
|
// This will be replaced by the npm package version when bundling
|
|
160
|
-
sdkVersion: "3.3.
|
|
190
|
+
sdkVersion: "3.3.8-beta-1"
|
|
161
191
|
}
|
|
162
192
|
})
|
|
163
193
|
}));
|
package/dist/connect.js
CHANGED
|
@@ -5,6 +5,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
6
6
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
7
7
|
const ConnectElementCustomMethodConfig = {
|
|
8
|
+
"payment-details": {
|
|
9
|
+
setPayment: _payment => {},
|
|
10
|
+
setOnClose: _listener => {}
|
|
11
|
+
},
|
|
8
12
|
"account-onboarding": {
|
|
9
13
|
setFullTermsOfServiceUrl: _termOfServiceUrl => {},
|
|
10
14
|
setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
|
|
@@ -19,31 +23,54 @@ const ConnectElementCustomMethodConfig = {
|
|
|
19
23
|
"notification-banner": {
|
|
20
24
|
setCollectionOptions: _collectionOptions => {}
|
|
21
25
|
},
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
"issuing-card": {
|
|
27
|
+
setDefaultCard: _defaultCard => {},
|
|
28
|
+
setCardArtFileLink: _cardArtFileLink => {},
|
|
29
|
+
setCardSwitching: _cardSwitching => {},
|
|
30
|
+
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
31
|
+
},
|
|
32
|
+
"issuing-cards-list": {
|
|
33
|
+
setCardArtFileLink: _cardArtFileLink => {},
|
|
34
|
+
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
35
|
+
},
|
|
36
|
+
"financial-account": {
|
|
37
|
+
setFinancialAccount: _financialAccount => {}
|
|
38
|
+
},
|
|
39
|
+
"financial-account-transactions": {
|
|
40
|
+
setFinancialAccount: _financialAccount => {}
|
|
25
41
|
}
|
|
26
42
|
};
|
|
27
43
|
|
|
28
44
|
const componentNameMapping = {
|
|
29
|
-
"account-onboarding": "stripe-connect-account-onboarding",
|
|
30
45
|
payments: "stripe-connect-payments",
|
|
31
|
-
"payment-details": "stripe-connect-payment-details",
|
|
32
46
|
payouts: "stripe-connect-payouts",
|
|
33
|
-
"
|
|
34
|
-
|
|
47
|
+
"payment-details": "stripe-connect-payment-details",
|
|
48
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
49
|
+
"payment-method-settings": "stripe-connect-payment-method-settings",
|
|
35
50
|
"account-management": "stripe-connect-account-management",
|
|
36
51
|
"notification-banner": "stripe-connect-notification-banner",
|
|
37
|
-
|
|
52
|
+
"instant-payouts": "stripe-connect-instant-payouts",
|
|
53
|
+
"issuing-card": "stripe-connect-issuing-card",
|
|
54
|
+
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
55
|
+
"financial-account": "stripe-connect-financial-account",
|
|
56
|
+
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
57
|
+
"capital-overview": "stripe-connect-capital-overview",
|
|
58
|
+
documents: "stripe-connect-documents",
|
|
59
|
+
"tax-registrations": "stripe-connect-tax-registrations",
|
|
60
|
+
"tax-settings": "stripe-connect-tax-settings",
|
|
61
|
+
balances: "stripe-connect-balances",
|
|
62
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
63
|
+
"app-install": "stripe-connect-app-install",
|
|
64
|
+
"app-viewport": "stripe-connect-app-viewport"
|
|
38
65
|
};
|
|
39
66
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
40
|
-
const V0_URL = "https://connect-js.stripe.com/
|
|
67
|
+
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
41
68
|
const findScript = () => {
|
|
42
69
|
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
43
70
|
};
|
|
44
71
|
const injectScript = () => {
|
|
45
72
|
const script = document.createElement("script");
|
|
46
|
-
script.src = "https://connect-js.stripe.com/
|
|
73
|
+
script.src = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
47
74
|
const head = document.head;
|
|
48
75
|
if (!head) {
|
|
49
76
|
throw new Error("Expected document.head not to be null. Connect.js requires a <head> element.");
|
|
@@ -130,6 +157,9 @@ const initStripeConnect = (stripePromise, initParams) => {
|
|
|
130
157
|
document.body.removeChild(element);
|
|
131
158
|
element.style.display = oldDisplay;
|
|
132
159
|
}
|
|
160
|
+
if (!element || !element.setConnector) {
|
|
161
|
+
throw new Error(`Element ${tagName} was not transformed into a custom element. Are you using a documented component? See https://docs.stripe.com/connect/supported-embedded-components for a list of supported components`);
|
|
162
|
+
}
|
|
133
163
|
element.setConnector(instance.connect);
|
|
134
164
|
});
|
|
135
165
|
return element;
|
|
@@ -161,7 +191,7 @@ const createWrapper = stripeConnect => {
|
|
|
161
191
|
sdk: true,
|
|
162
192
|
sdkOptions: {
|
|
163
193
|
// This will be replaced by the npm package version when bundling
|
|
164
|
-
sdkVersion: "3.3.
|
|
194
|
+
sdkVersion: "3.3.8-beta-1"
|
|
165
195
|
}
|
|
166
196
|
})
|
|
167
197
|
}));
|
package/dist/pure.esm.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
3
3
|
const ConnectElementCustomMethodConfig = {
|
|
4
|
+
"payment-details": {
|
|
5
|
+
setPayment: _payment => {},
|
|
6
|
+
setOnClose: _listener => {}
|
|
7
|
+
},
|
|
4
8
|
"account-onboarding": {
|
|
5
9
|
setFullTermsOfServiceUrl: _termOfServiceUrl => {},
|
|
6
10
|
setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
|
|
@@ -15,31 +19,54 @@ const ConnectElementCustomMethodConfig = {
|
|
|
15
19
|
"notification-banner": {
|
|
16
20
|
setCollectionOptions: _collectionOptions => {}
|
|
17
21
|
},
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
"issuing-card": {
|
|
23
|
+
setDefaultCard: _defaultCard => {},
|
|
24
|
+
setCardArtFileLink: _cardArtFileLink => {},
|
|
25
|
+
setCardSwitching: _cardSwitching => {},
|
|
26
|
+
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
27
|
+
},
|
|
28
|
+
"issuing-cards-list": {
|
|
29
|
+
setCardArtFileLink: _cardArtFileLink => {},
|
|
30
|
+
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
31
|
+
},
|
|
32
|
+
"financial-account": {
|
|
33
|
+
setFinancialAccount: _financialAccount => {}
|
|
34
|
+
},
|
|
35
|
+
"financial-account-transactions": {
|
|
36
|
+
setFinancialAccount: _financialAccount => {}
|
|
21
37
|
}
|
|
22
38
|
};
|
|
23
39
|
|
|
24
40
|
const componentNameMapping = {
|
|
25
|
-
"account-onboarding": "stripe-connect-account-onboarding",
|
|
26
41
|
payments: "stripe-connect-payments",
|
|
27
|
-
"payment-details": "stripe-connect-payment-details",
|
|
28
42
|
payouts: "stripe-connect-payouts",
|
|
29
|
-
"
|
|
30
|
-
|
|
43
|
+
"payment-details": "stripe-connect-payment-details",
|
|
44
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
45
|
+
"payment-method-settings": "stripe-connect-payment-method-settings",
|
|
31
46
|
"account-management": "stripe-connect-account-management",
|
|
32
47
|
"notification-banner": "stripe-connect-notification-banner",
|
|
33
|
-
|
|
48
|
+
"instant-payouts": "stripe-connect-instant-payouts",
|
|
49
|
+
"issuing-card": "stripe-connect-issuing-card",
|
|
50
|
+
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
51
|
+
"financial-account": "stripe-connect-financial-account",
|
|
52
|
+
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
53
|
+
"capital-overview": "stripe-connect-capital-overview",
|
|
54
|
+
documents: "stripe-connect-documents",
|
|
55
|
+
"tax-registrations": "stripe-connect-tax-registrations",
|
|
56
|
+
"tax-settings": "stripe-connect-tax-settings",
|
|
57
|
+
balances: "stripe-connect-balances",
|
|
58
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
59
|
+
"app-install": "stripe-connect-app-install",
|
|
60
|
+
"app-viewport": "stripe-connect-app-viewport"
|
|
34
61
|
};
|
|
35
62
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
36
|
-
const V0_URL = "https://connect-js.stripe.com/
|
|
63
|
+
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
37
64
|
const findScript = () => {
|
|
38
65
|
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
39
66
|
};
|
|
40
67
|
const injectScript = () => {
|
|
41
68
|
const script = document.createElement("script");
|
|
42
|
-
script.src = "https://connect-js.stripe.com/
|
|
69
|
+
script.src = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
43
70
|
const head = document.head;
|
|
44
71
|
if (!head) {
|
|
45
72
|
throw new Error("Expected document.head not to be null. Connect.js requires a <head> element.");
|
|
@@ -126,6 +153,9 @@ const initStripeConnect = (stripePromise, initParams) => {
|
|
|
126
153
|
document.body.removeChild(element);
|
|
127
154
|
element.style.display = oldDisplay;
|
|
128
155
|
}
|
|
156
|
+
if (!element || !element.setConnector) {
|
|
157
|
+
throw new Error(`Element ${tagName} was not transformed into a custom element. Are you using a documented component? See https://docs.stripe.com/connect/supported-embedded-components for a list of supported components`);
|
|
158
|
+
}
|
|
129
159
|
element.setConnector(instance.connect);
|
|
130
160
|
});
|
|
131
161
|
return element;
|
|
@@ -157,7 +187,7 @@ const createWrapper = stripeConnect => {
|
|
|
157
187
|
sdk: true,
|
|
158
188
|
sdkOptions: {
|
|
159
189
|
// This will be replaced by the npm package version when bundling
|
|
160
|
-
sdkVersion: "3.3.
|
|
190
|
+
sdkVersion: "3.3.8-beta-1"
|
|
161
191
|
}
|
|
162
192
|
})
|
|
163
193
|
}));
|
package/dist/pure.js
CHANGED
|
@@ -5,6 +5,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
6
6
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
7
7
|
const ConnectElementCustomMethodConfig = {
|
|
8
|
+
"payment-details": {
|
|
9
|
+
setPayment: _payment => {},
|
|
10
|
+
setOnClose: _listener => {}
|
|
11
|
+
},
|
|
8
12
|
"account-onboarding": {
|
|
9
13
|
setFullTermsOfServiceUrl: _termOfServiceUrl => {},
|
|
10
14
|
setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
|
|
@@ -19,31 +23,54 @@ const ConnectElementCustomMethodConfig = {
|
|
|
19
23
|
"notification-banner": {
|
|
20
24
|
setCollectionOptions: _collectionOptions => {}
|
|
21
25
|
},
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
"issuing-card": {
|
|
27
|
+
setDefaultCard: _defaultCard => {},
|
|
28
|
+
setCardArtFileLink: _cardArtFileLink => {},
|
|
29
|
+
setCardSwitching: _cardSwitching => {},
|
|
30
|
+
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
31
|
+
},
|
|
32
|
+
"issuing-cards-list": {
|
|
33
|
+
setCardArtFileLink: _cardArtFileLink => {},
|
|
34
|
+
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
35
|
+
},
|
|
36
|
+
"financial-account": {
|
|
37
|
+
setFinancialAccount: _financialAccount => {}
|
|
38
|
+
},
|
|
39
|
+
"financial-account-transactions": {
|
|
40
|
+
setFinancialAccount: _financialAccount => {}
|
|
25
41
|
}
|
|
26
42
|
};
|
|
27
43
|
|
|
28
44
|
const componentNameMapping = {
|
|
29
|
-
"account-onboarding": "stripe-connect-account-onboarding",
|
|
30
45
|
payments: "stripe-connect-payments",
|
|
31
|
-
"payment-details": "stripe-connect-payment-details",
|
|
32
46
|
payouts: "stripe-connect-payouts",
|
|
33
|
-
"
|
|
34
|
-
|
|
47
|
+
"payment-details": "stripe-connect-payment-details",
|
|
48
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
49
|
+
"payment-method-settings": "stripe-connect-payment-method-settings",
|
|
35
50
|
"account-management": "stripe-connect-account-management",
|
|
36
51
|
"notification-banner": "stripe-connect-notification-banner",
|
|
37
|
-
|
|
52
|
+
"instant-payouts": "stripe-connect-instant-payouts",
|
|
53
|
+
"issuing-card": "stripe-connect-issuing-card",
|
|
54
|
+
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
55
|
+
"financial-account": "stripe-connect-financial-account",
|
|
56
|
+
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
57
|
+
"capital-overview": "stripe-connect-capital-overview",
|
|
58
|
+
documents: "stripe-connect-documents",
|
|
59
|
+
"tax-registrations": "stripe-connect-tax-registrations",
|
|
60
|
+
"tax-settings": "stripe-connect-tax-settings",
|
|
61
|
+
balances: "stripe-connect-balances",
|
|
62
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
63
|
+
"app-install": "stripe-connect-app-install",
|
|
64
|
+
"app-viewport": "stripe-connect-app-viewport"
|
|
38
65
|
};
|
|
39
66
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
40
|
-
const V0_URL = "https://connect-js.stripe.com/
|
|
67
|
+
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
41
68
|
const findScript = () => {
|
|
42
69
|
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
43
70
|
};
|
|
44
71
|
const injectScript = () => {
|
|
45
72
|
const script = document.createElement("script");
|
|
46
|
-
script.src = "https://connect-js.stripe.com/
|
|
73
|
+
script.src = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
47
74
|
const head = document.head;
|
|
48
75
|
if (!head) {
|
|
49
76
|
throw new Error("Expected document.head not to be null. Connect.js requires a <head> element.");
|
|
@@ -130,6 +157,9 @@ const initStripeConnect = (stripePromise, initParams) => {
|
|
|
130
157
|
document.body.removeChild(element);
|
|
131
158
|
element.style.display = oldDisplay;
|
|
132
159
|
}
|
|
160
|
+
if (!element || !element.setConnector) {
|
|
161
|
+
throw new Error(`Element ${tagName} was not transformed into a custom element. Are you using a documented component? See https://docs.stripe.com/connect/supported-embedded-components for a list of supported components`);
|
|
162
|
+
}
|
|
133
163
|
element.setConnector(instance.connect);
|
|
134
164
|
});
|
|
135
165
|
return element;
|
|
@@ -161,7 +191,7 @@ const createWrapper = stripeConnect => {
|
|
|
161
191
|
sdk: true,
|
|
162
192
|
sdkOptions: {
|
|
163
193
|
// This will be replaced by the npm package version when bundling
|
|
164
|
-
sdkVersion: "3.3.
|
|
194
|
+
sdkVersion: "3.3.8-beta-1"
|
|
165
195
|
}
|
|
166
196
|
})
|
|
167
197
|
}));
|
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
|
-
type ConnectElementHTMLName = "stripe-connect-
|
|
3
|
+
export type ConnectElementHTMLName = "stripe-connect-payments" | "stripe-connect-payouts" | "stripe-connect-payment-details" | "stripe-connect-account-onboarding" | "stripe-connect-payment-method-settings" | "stripe-connect-account-management" | "stripe-connect-notification-banner" | "stripe-connect-instant-payouts" | "stripe-connect-issuing-card" | "stripe-connect-issuing-cards-list" | "stripe-connect-financial-account" | "stripe-connect-financial-account-transactions" | "stripe-connect-capital-overview" | "stripe-connect-documents" | "stripe-connect-tax-registrations" | "stripe-connect-tax-settings" | "stripe-connect-balances" | "stripe-connect-payouts-list" | "stripe-connect-app-install" | "stripe-connect-app-viewport";
|
|
4
4
|
export declare const componentNameMapping: Record<ConnectElementTagName, ConnectElementHTMLName>;
|
|
5
5
|
type StripeConnectInstanceExtended = StripeConnectInstance & {
|
|
6
6
|
debugInstance: () => Promise<StripeConnectInstance>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SCRIPT_SELECTOR = "script[src^=\"https://connect-js.stripe.com/
|
|
1
|
+
export declare const SCRIPT_SELECTOR = "script[src^=\"https://connect-js.stripe.com/v0.1/connect.js\"]";
|
|
2
2
|
export {};
|
package/dist/types/config.d.ts
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
|
+
export type FetchEphemeralKeyFunction = (fetchParams: {
|
|
2
|
+
issuingCard: string;
|
|
3
|
+
nonce: string;
|
|
4
|
+
}) => Promise<{
|
|
5
|
+
issuingCard: string;
|
|
6
|
+
nonce: string;
|
|
7
|
+
ephemeralKeySecret: string;
|
|
8
|
+
}>;
|
|
1
9
|
export type CollectionOptions = {
|
|
2
10
|
fields: "currently_due" | "eventually_due";
|
|
3
11
|
futureRequirements?: "omit" | "include";
|
|
4
12
|
};
|
|
5
13
|
export declare const ConnectElementCustomMethodConfig: {
|
|
14
|
+
"payment-details": {
|
|
15
|
+
setPayment: (_payment: string | undefined) => void;
|
|
16
|
+
setOnClose: (_listener: (() => void) | undefined) => void;
|
|
17
|
+
};
|
|
6
18
|
"account-onboarding": {
|
|
7
19
|
setFullTermsOfServiceUrl: (_termOfServiceUrl: string | undefined) => void;
|
|
8
20
|
setRecipientTermsOfServiceUrl: (_recipientTermsOfServiceUrl: string | undefined) => void;
|
|
@@ -17,8 +29,20 @@ export declare const ConnectElementCustomMethodConfig: {
|
|
|
17
29
|
"notification-banner": {
|
|
18
30
|
setCollectionOptions: (_collectionOptions: CollectionOptions | undefined) => void;
|
|
19
31
|
};
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
32
|
+
"issuing-card": {
|
|
33
|
+
setDefaultCard: (_defaultCard: string | undefined) => void;
|
|
34
|
+
setCardArtFileLink: (_cardArtFileLink: string | undefined) => void;
|
|
35
|
+
setCardSwitching: (_cardSwitching: boolean | undefined) => void;
|
|
36
|
+
setFetchEphemeralKey: (_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined) => void;
|
|
37
|
+
};
|
|
38
|
+
"issuing-cards-list": {
|
|
39
|
+
setCardArtFileLink: (_cardArtFileLink: string | undefined) => void;
|
|
40
|
+
setFetchEphemeralKey: (_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined) => void;
|
|
41
|
+
};
|
|
42
|
+
"financial-account": {
|
|
43
|
+
setFinancialAccount: (_financialAccount: string) => void;
|
|
44
|
+
};
|
|
45
|
+
"financial-account-transactions": {
|
|
46
|
+
setFinancialAccount: (_financialAccount: string) => void;
|
|
23
47
|
};
|
|
24
48
|
};
|
package/package.json
CHANGED
package/src/shared.ts
CHANGED
|
@@ -10,30 +10,53 @@ export type LoadConnectAndInitialize = (
|
|
|
10
10
|
initParams: IStripeConnectInitParams
|
|
11
11
|
) => StripeConnectInstance;
|
|
12
12
|
|
|
13
|
-
type ConnectElementHTMLName =
|
|
14
|
-
| "stripe-connect-account-onboarding"
|
|
13
|
+
export type ConnectElementHTMLName =
|
|
15
14
|
| "stripe-connect-payments"
|
|
15
|
+
| "stripe-connect-payouts"
|
|
16
16
|
| "stripe-connect-payment-details"
|
|
17
|
+
| "stripe-connect-account-onboarding"
|
|
18
|
+
| "stripe-connect-payment-method-settings"
|
|
17
19
|
| "stripe-connect-account-management"
|
|
18
20
|
| "stripe-connect-notification-banner"
|
|
19
|
-
| "stripe-connect-payouts"
|
|
20
|
-
| "stripe-connect-
|
|
21
|
+
| "stripe-connect-instant-payouts"
|
|
22
|
+
| "stripe-connect-issuing-card"
|
|
23
|
+
| "stripe-connect-issuing-cards-list"
|
|
24
|
+
| "stripe-connect-financial-account"
|
|
25
|
+
| "stripe-connect-financial-account-transactions"
|
|
26
|
+
| "stripe-connect-capital-overview"
|
|
27
|
+
| "stripe-connect-documents"
|
|
28
|
+
| "stripe-connect-tax-registrations"
|
|
29
|
+
| "stripe-connect-tax-settings"
|
|
21
30
|
| "stripe-connect-balances"
|
|
22
|
-
| "stripe-connect-
|
|
31
|
+
| "stripe-connect-payouts-list"
|
|
32
|
+
| "stripe-connect-app-install"
|
|
33
|
+
| "stripe-connect-app-viewport";
|
|
23
34
|
|
|
24
35
|
export const componentNameMapping: Record<
|
|
25
36
|
ConnectElementTagName,
|
|
26
37
|
ConnectElementHTMLName
|
|
27
38
|
> = {
|
|
28
|
-
"account-onboarding": "stripe-connect-account-onboarding",
|
|
29
39
|
payments: "stripe-connect-payments",
|
|
30
|
-
"payment-details": "stripe-connect-payment-details",
|
|
31
40
|
payouts: "stripe-connect-payouts",
|
|
32
|
-
"
|
|
33
|
-
|
|
41
|
+
"payment-details": "stripe-connect-payment-details",
|
|
42
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
43
|
+
"payment-method-settings": "stripe-connect-payment-method-settings",
|
|
34
44
|
"account-management": "stripe-connect-account-management",
|
|
35
45
|
"notification-banner": "stripe-connect-notification-banner",
|
|
36
|
-
|
|
46
|
+
"instant-payouts": "stripe-connect-instant-payouts",
|
|
47
|
+
"issuing-card": "stripe-connect-issuing-card",
|
|
48
|
+
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
49
|
+
"financial-account": "stripe-connect-financial-account",
|
|
50
|
+
"financial-account-transactions":
|
|
51
|
+
"stripe-connect-financial-account-transactions",
|
|
52
|
+
"capital-overview": "stripe-connect-capital-overview",
|
|
53
|
+
documents: "stripe-connect-documents",
|
|
54
|
+
"tax-registrations": "stripe-connect-tax-registrations",
|
|
55
|
+
"tax-settings": "stripe-connect-tax-settings",
|
|
56
|
+
balances: "stripe-connect-balances",
|
|
57
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
58
|
+
"app-install": "stripe-connect-app-install",
|
|
59
|
+
"app-viewport": "stripe-connect-app-viewport"
|
|
37
60
|
};
|
|
38
61
|
|
|
39
62
|
type StripeConnectInstanceExtended = StripeConnectInstance & {
|
|
@@ -46,7 +69,7 @@ interface StripeConnectWrapper {
|
|
|
46
69
|
|
|
47
70
|
const EXISTING_SCRIPT_MESSAGE =
|
|
48
71
|
"loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
49
|
-
const V0_URL = "https://connect-js.stripe.com/
|
|
72
|
+
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
50
73
|
|
|
51
74
|
export const findScript = (): HTMLScriptElement | null => {
|
|
52
75
|
return (
|
|
@@ -58,7 +81,7 @@ export const findScript = (): HTMLScriptElement | null => {
|
|
|
58
81
|
|
|
59
82
|
const injectScript = (): HTMLScriptElement => {
|
|
60
83
|
const script = document.createElement("script");
|
|
61
|
-
script.src = "https://connect-js.stripe.com/
|
|
84
|
+
script.src = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
62
85
|
|
|
63
86
|
const head = document.head;
|
|
64
87
|
|
|
@@ -178,6 +201,12 @@ export const initStripeConnect = (
|
|
|
178
201
|
element.style.display = oldDisplay;
|
|
179
202
|
}
|
|
180
203
|
|
|
204
|
+
if (!element || !(element as any).setConnector) {
|
|
205
|
+
throw new Error(
|
|
206
|
+
`Element ${tagName} was not transformed into a custom element. Are you using a documented component? See https://docs.stripe.com/connect/supported-embedded-components for a list of supported components`
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
|
|
181
210
|
(element as any).setConnector((instance as any).connect);
|
|
182
211
|
});
|
|
183
212
|
|
package/src/utils/jestHelpers.ts
CHANGED
package/types/config.ts
CHANGED
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
3
3
|
|
|
4
|
+
export type FetchEphemeralKeyFunction = (fetchParams: {
|
|
5
|
+
issuingCard: string;
|
|
6
|
+
nonce: string;
|
|
7
|
+
}) => Promise<{
|
|
8
|
+
issuingCard: string;
|
|
9
|
+
nonce: string;
|
|
10
|
+
ephemeralKeySecret: string;
|
|
11
|
+
}>;
|
|
12
|
+
|
|
4
13
|
export type CollectionOptions = {
|
|
5
14
|
fields: "currently_due" | "eventually_due";
|
|
6
15
|
futureRequirements?: "omit" | "include";
|
|
7
16
|
};
|
|
8
17
|
|
|
9
18
|
export const ConnectElementCustomMethodConfig = {
|
|
19
|
+
"payment-details": {
|
|
20
|
+
setPayment: (_payment: string | undefined): void => {},
|
|
21
|
+
setOnClose: (_listener: (() => void) | undefined): void => {}
|
|
22
|
+
},
|
|
10
23
|
"account-onboarding": {
|
|
11
24
|
setFullTermsOfServiceUrl: (
|
|
12
25
|
_termOfServiceUrl: string | undefined
|
|
@@ -33,8 +46,24 @@ export const ConnectElementCustomMethodConfig = {
|
|
|
33
46
|
_collectionOptions: CollectionOptions | undefined
|
|
34
47
|
): void => {}
|
|
35
48
|
},
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
49
|
+
"issuing-card": {
|
|
50
|
+
setDefaultCard: (_defaultCard: string | undefined): void => {},
|
|
51
|
+
setCardArtFileLink: (_cardArtFileLink: string | undefined): void => {},
|
|
52
|
+
setCardSwitching: (_cardSwitching: boolean | undefined): void => {},
|
|
53
|
+
setFetchEphemeralKey: (
|
|
54
|
+
_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined
|
|
55
|
+
): void => {}
|
|
56
|
+
},
|
|
57
|
+
"issuing-cards-list": {
|
|
58
|
+
setCardArtFileLink: (_cardArtFileLink: string | undefined): void => {},
|
|
59
|
+
setFetchEphemeralKey: (
|
|
60
|
+
_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined
|
|
61
|
+
): void => {}
|
|
62
|
+
},
|
|
63
|
+
"financial-account": {
|
|
64
|
+
setFinancialAccount: (_financialAccount: string): void => {}
|
|
65
|
+
},
|
|
66
|
+
"financial-account-transactions": {
|
|
67
|
+
setFinancialAccount: (_financialAccount: string): void => {}
|
|
39
68
|
}
|
|
40
69
|
};
|
package/types/shared.d.ts
CHANGED
|
@@ -447,12 +447,23 @@ export interface StripeConnectInstance {
|
|
|
447
447
|
* Tagnames to be used with the `create` method of the Connect instance.
|
|
448
448
|
*/
|
|
449
449
|
export type ConnectElementTagName =
|
|
450
|
-
| "account-onboarding"
|
|
451
450
|
| "payments"
|
|
451
|
+
| "payouts"
|
|
452
452
|
| "payment-details"
|
|
453
|
+
| "account-onboarding"
|
|
454
|
+
| "payment-method-settings"
|
|
453
455
|
| "account-management"
|
|
454
456
|
| "notification-banner"
|
|
455
|
-
| "payouts"
|
|
456
|
-
| "
|
|
457
|
+
| "instant-payouts"
|
|
458
|
+
| "issuing-card"
|
|
459
|
+
| "issuing-cards-list"
|
|
460
|
+
| "financial-account"
|
|
461
|
+
| "financial-account-transactions"
|
|
462
|
+
| "capital-overview"
|
|
463
|
+
| "documents"
|
|
464
|
+
| "tax-registrations"
|
|
465
|
+
| "tax-settings"
|
|
457
466
|
| "balances"
|
|
458
|
-
| "
|
|
467
|
+
| "payouts-list"
|
|
468
|
+
| "app-install"
|
|
469
|
+
| "app-viewport";
|