@stripe/connect-js 3.3.12 → 3.3.14-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 +44 -10
- package/dist/connect.js +44 -10
- package/dist/pure.esm.js +44 -10
- package/dist/pure.js +44 -10
- package/dist/src/shared.d.ts +1 -1
- package/dist/types/config.d.ts +40 -3
- package/package.json +1 -1
- package/src/shared.ts +32 -13
- package/types/config.ts +50 -3
- package/types/shared.d.ts +14 -6
package/dist/connect.esm.js
CHANGED
|
@@ -5,6 +5,10 @@ const ConnectElementCommonMethodConfig = {
|
|
|
5
5
|
setOnLoaderStart: _listener => {}
|
|
6
6
|
};
|
|
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 => {},
|
|
@@ -20,30 +24,60 @@ const ConnectElementCustomMethodConfig = {
|
|
|
20
24
|
setCollectionOptions: _collectionOptions => {},
|
|
21
25
|
setOnNotificationsChange: _listener => {}
|
|
22
26
|
},
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
"issuing-card": {
|
|
28
|
+
setDefaultCard: _defaultCard => {},
|
|
29
|
+
setCardArtFileLink: _cardArtFileLink => {},
|
|
30
|
+
setCardSwitching: _cardSwitching => {},
|
|
31
|
+
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
32
|
+
},
|
|
33
|
+
"issuing-cards-list": {
|
|
34
|
+
setCardArtFileLink: _cardArtFileLink => {},
|
|
35
|
+
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
36
|
+
},
|
|
37
|
+
"financial-account": {
|
|
38
|
+
setFinancialAccount: _financialAccount => {}
|
|
39
|
+
},
|
|
40
|
+
"financial-account-transactions": {
|
|
41
|
+
setFinancialAccount: _financialAccount => {}
|
|
42
|
+
},
|
|
43
|
+
"app-install": {
|
|
44
|
+
setApp: _app => {},
|
|
45
|
+
setOnAppInstallStateFetched: _listener => {},
|
|
46
|
+
setOnAppInstallStateChanged: _listener => {}
|
|
47
|
+
},
|
|
48
|
+
"app-viewport": {
|
|
49
|
+
setApp: _app => {},
|
|
50
|
+
setAppData: _appData => {}
|
|
26
51
|
}
|
|
27
52
|
};
|
|
28
53
|
|
|
29
54
|
const componentNameMapping = {
|
|
30
|
-
"account-onboarding": "stripe-connect-account-onboarding",
|
|
31
55
|
payments: "stripe-connect-payments",
|
|
32
|
-
"payment-details": "stripe-connect-payment-details",
|
|
33
56
|
payouts: "stripe-connect-payouts",
|
|
34
|
-
"
|
|
35
|
-
|
|
57
|
+
"payment-details": "stripe-connect-payment-details",
|
|
58
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
59
|
+
"payment-method-settings": "stripe-connect-payment-method-settings",
|
|
36
60
|
"account-management": "stripe-connect-account-management",
|
|
37
61
|
"notification-banner": "stripe-connect-notification-banner",
|
|
62
|
+
"instant-payouts": "stripe-connect-instant-payouts",
|
|
63
|
+
"issuing-card": "stripe-connect-issuing-card",
|
|
64
|
+
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
65
|
+
"financial-account": "stripe-connect-financial-account",
|
|
66
|
+
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
67
|
+
"capital-overview": "stripe-connect-capital-overview",
|
|
38
68
|
documents: "stripe-connect-documents",
|
|
39
69
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
40
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
70
|
+
"tax-settings": "stripe-connect-tax-settings",
|
|
71
|
+
balances: "stripe-connect-balances",
|
|
72
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
73
|
+
"app-install": "stripe-connect-app-install",
|
|
74
|
+
"app-viewport": "stripe-connect-app-viewport"
|
|
41
75
|
};
|
|
42
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";
|
|
43
77
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
44
78
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
45
79
|
const findScript = () => {
|
|
46
|
-
return document.querySelectorAll(`script[src="${
|
|
80
|
+
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || null;
|
|
47
81
|
};
|
|
48
82
|
const injectScript = () => {
|
|
49
83
|
const script = document.createElement("script");
|
|
@@ -180,7 +214,7 @@ const createWrapper = stripeConnect => {
|
|
|
180
214
|
sdk: true,
|
|
181
215
|
sdkOptions: {
|
|
182
216
|
// This will be replaced by the npm package version when bundling
|
|
183
|
-
sdkVersion: "3.3.
|
|
217
|
+
sdkVersion: "3.3.14-beta-1"
|
|
184
218
|
}
|
|
185
219
|
})
|
|
186
220
|
}));
|
package/dist/connect.js
CHANGED
|
@@ -9,6 +9,10 @@ const ConnectElementCommonMethodConfig = {
|
|
|
9
9
|
setOnLoaderStart: _listener => {}
|
|
10
10
|
};
|
|
11
11
|
const ConnectElementCustomMethodConfig = {
|
|
12
|
+
"payment-details": {
|
|
13
|
+
setPayment: _payment => {},
|
|
14
|
+
setOnClose: _listener => {}
|
|
15
|
+
},
|
|
12
16
|
"account-onboarding": {
|
|
13
17
|
setFullTermsOfServiceUrl: _termOfServiceUrl => {},
|
|
14
18
|
setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
|
|
@@ -24,30 +28,60 @@ const ConnectElementCustomMethodConfig = {
|
|
|
24
28
|
setCollectionOptions: _collectionOptions => {},
|
|
25
29
|
setOnNotificationsChange: _listener => {}
|
|
26
30
|
},
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
"issuing-card": {
|
|
32
|
+
setDefaultCard: _defaultCard => {},
|
|
33
|
+
setCardArtFileLink: _cardArtFileLink => {},
|
|
34
|
+
setCardSwitching: _cardSwitching => {},
|
|
35
|
+
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
36
|
+
},
|
|
37
|
+
"issuing-cards-list": {
|
|
38
|
+
setCardArtFileLink: _cardArtFileLink => {},
|
|
39
|
+
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
40
|
+
},
|
|
41
|
+
"financial-account": {
|
|
42
|
+
setFinancialAccount: _financialAccount => {}
|
|
43
|
+
},
|
|
44
|
+
"financial-account-transactions": {
|
|
45
|
+
setFinancialAccount: _financialAccount => {}
|
|
46
|
+
},
|
|
47
|
+
"app-install": {
|
|
48
|
+
setApp: _app => {},
|
|
49
|
+
setOnAppInstallStateFetched: _listener => {},
|
|
50
|
+
setOnAppInstallStateChanged: _listener => {}
|
|
51
|
+
},
|
|
52
|
+
"app-viewport": {
|
|
53
|
+
setApp: _app => {},
|
|
54
|
+
setAppData: _appData => {}
|
|
30
55
|
}
|
|
31
56
|
};
|
|
32
57
|
|
|
33
58
|
const componentNameMapping = {
|
|
34
|
-
"account-onboarding": "stripe-connect-account-onboarding",
|
|
35
59
|
payments: "stripe-connect-payments",
|
|
36
|
-
"payment-details": "stripe-connect-payment-details",
|
|
37
60
|
payouts: "stripe-connect-payouts",
|
|
38
|
-
"
|
|
39
|
-
|
|
61
|
+
"payment-details": "stripe-connect-payment-details",
|
|
62
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
63
|
+
"payment-method-settings": "stripe-connect-payment-method-settings",
|
|
40
64
|
"account-management": "stripe-connect-account-management",
|
|
41
65
|
"notification-banner": "stripe-connect-notification-banner",
|
|
66
|
+
"instant-payouts": "stripe-connect-instant-payouts",
|
|
67
|
+
"issuing-card": "stripe-connect-issuing-card",
|
|
68
|
+
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
69
|
+
"financial-account": "stripe-connect-financial-account",
|
|
70
|
+
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
71
|
+
"capital-overview": "stripe-connect-capital-overview",
|
|
42
72
|
documents: "stripe-connect-documents",
|
|
43
73
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
44
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
74
|
+
"tax-settings": "stripe-connect-tax-settings",
|
|
75
|
+
balances: "stripe-connect-balances",
|
|
76
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
77
|
+
"app-install": "stripe-connect-app-install",
|
|
78
|
+
"app-viewport": "stripe-connect-app-viewport"
|
|
45
79
|
};
|
|
46
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";
|
|
47
81
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
48
82
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
49
83
|
const findScript = () => {
|
|
50
|
-
return document.querySelectorAll(`script[src="${
|
|
84
|
+
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || null;
|
|
51
85
|
};
|
|
52
86
|
const injectScript = () => {
|
|
53
87
|
const script = document.createElement("script");
|
|
@@ -184,7 +218,7 @@ const createWrapper = stripeConnect => {
|
|
|
184
218
|
sdk: true,
|
|
185
219
|
sdkOptions: {
|
|
186
220
|
// This will be replaced by the npm package version when bundling
|
|
187
|
-
sdkVersion: "3.3.
|
|
221
|
+
sdkVersion: "3.3.14-beta-1"
|
|
188
222
|
}
|
|
189
223
|
})
|
|
190
224
|
}));
|
package/dist/pure.esm.js
CHANGED
|
@@ -5,6 +5,10 @@ const ConnectElementCommonMethodConfig = {
|
|
|
5
5
|
setOnLoaderStart: _listener => {}
|
|
6
6
|
};
|
|
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 => {},
|
|
@@ -20,30 +24,60 @@ const ConnectElementCustomMethodConfig = {
|
|
|
20
24
|
setCollectionOptions: _collectionOptions => {},
|
|
21
25
|
setOnNotificationsChange: _listener => {}
|
|
22
26
|
},
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
"issuing-card": {
|
|
28
|
+
setDefaultCard: _defaultCard => {},
|
|
29
|
+
setCardArtFileLink: _cardArtFileLink => {},
|
|
30
|
+
setCardSwitching: _cardSwitching => {},
|
|
31
|
+
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
32
|
+
},
|
|
33
|
+
"issuing-cards-list": {
|
|
34
|
+
setCardArtFileLink: _cardArtFileLink => {},
|
|
35
|
+
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
36
|
+
},
|
|
37
|
+
"financial-account": {
|
|
38
|
+
setFinancialAccount: _financialAccount => {}
|
|
39
|
+
},
|
|
40
|
+
"financial-account-transactions": {
|
|
41
|
+
setFinancialAccount: _financialAccount => {}
|
|
42
|
+
},
|
|
43
|
+
"app-install": {
|
|
44
|
+
setApp: _app => {},
|
|
45
|
+
setOnAppInstallStateFetched: _listener => {},
|
|
46
|
+
setOnAppInstallStateChanged: _listener => {}
|
|
47
|
+
},
|
|
48
|
+
"app-viewport": {
|
|
49
|
+
setApp: _app => {},
|
|
50
|
+
setAppData: _appData => {}
|
|
26
51
|
}
|
|
27
52
|
};
|
|
28
53
|
|
|
29
54
|
const componentNameMapping = {
|
|
30
|
-
"account-onboarding": "stripe-connect-account-onboarding",
|
|
31
55
|
payments: "stripe-connect-payments",
|
|
32
|
-
"payment-details": "stripe-connect-payment-details",
|
|
33
56
|
payouts: "stripe-connect-payouts",
|
|
34
|
-
"
|
|
35
|
-
|
|
57
|
+
"payment-details": "stripe-connect-payment-details",
|
|
58
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
59
|
+
"payment-method-settings": "stripe-connect-payment-method-settings",
|
|
36
60
|
"account-management": "stripe-connect-account-management",
|
|
37
61
|
"notification-banner": "stripe-connect-notification-banner",
|
|
62
|
+
"instant-payouts": "stripe-connect-instant-payouts",
|
|
63
|
+
"issuing-card": "stripe-connect-issuing-card",
|
|
64
|
+
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
65
|
+
"financial-account": "stripe-connect-financial-account",
|
|
66
|
+
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
67
|
+
"capital-overview": "stripe-connect-capital-overview",
|
|
38
68
|
documents: "stripe-connect-documents",
|
|
39
69
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
40
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
70
|
+
"tax-settings": "stripe-connect-tax-settings",
|
|
71
|
+
balances: "stripe-connect-balances",
|
|
72
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
73
|
+
"app-install": "stripe-connect-app-install",
|
|
74
|
+
"app-viewport": "stripe-connect-app-viewport"
|
|
41
75
|
};
|
|
42
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";
|
|
43
77
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
44
78
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
45
79
|
const findScript = () => {
|
|
46
|
-
return document.querySelectorAll(`script[src="${
|
|
80
|
+
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || null;
|
|
47
81
|
};
|
|
48
82
|
const injectScript = () => {
|
|
49
83
|
const script = document.createElement("script");
|
|
@@ -180,7 +214,7 @@ const createWrapper = stripeConnect => {
|
|
|
180
214
|
sdk: true,
|
|
181
215
|
sdkOptions: {
|
|
182
216
|
// This will be replaced by the npm package version when bundling
|
|
183
|
-
sdkVersion: "3.3.
|
|
217
|
+
sdkVersion: "3.3.14-beta-1"
|
|
184
218
|
}
|
|
185
219
|
})
|
|
186
220
|
}));
|
package/dist/pure.js
CHANGED
|
@@ -9,6 +9,10 @@ const ConnectElementCommonMethodConfig = {
|
|
|
9
9
|
setOnLoaderStart: _listener => {}
|
|
10
10
|
};
|
|
11
11
|
const ConnectElementCustomMethodConfig = {
|
|
12
|
+
"payment-details": {
|
|
13
|
+
setPayment: _payment => {},
|
|
14
|
+
setOnClose: _listener => {}
|
|
15
|
+
},
|
|
12
16
|
"account-onboarding": {
|
|
13
17
|
setFullTermsOfServiceUrl: _termOfServiceUrl => {},
|
|
14
18
|
setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
|
|
@@ -24,30 +28,60 @@ const ConnectElementCustomMethodConfig = {
|
|
|
24
28
|
setCollectionOptions: _collectionOptions => {},
|
|
25
29
|
setOnNotificationsChange: _listener => {}
|
|
26
30
|
},
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
"issuing-card": {
|
|
32
|
+
setDefaultCard: _defaultCard => {},
|
|
33
|
+
setCardArtFileLink: _cardArtFileLink => {},
|
|
34
|
+
setCardSwitching: _cardSwitching => {},
|
|
35
|
+
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
36
|
+
},
|
|
37
|
+
"issuing-cards-list": {
|
|
38
|
+
setCardArtFileLink: _cardArtFileLink => {},
|
|
39
|
+
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
40
|
+
},
|
|
41
|
+
"financial-account": {
|
|
42
|
+
setFinancialAccount: _financialAccount => {}
|
|
43
|
+
},
|
|
44
|
+
"financial-account-transactions": {
|
|
45
|
+
setFinancialAccount: _financialAccount => {}
|
|
46
|
+
},
|
|
47
|
+
"app-install": {
|
|
48
|
+
setApp: _app => {},
|
|
49
|
+
setOnAppInstallStateFetched: _listener => {},
|
|
50
|
+
setOnAppInstallStateChanged: _listener => {}
|
|
51
|
+
},
|
|
52
|
+
"app-viewport": {
|
|
53
|
+
setApp: _app => {},
|
|
54
|
+
setAppData: _appData => {}
|
|
30
55
|
}
|
|
31
56
|
};
|
|
32
57
|
|
|
33
58
|
const componentNameMapping = {
|
|
34
|
-
"account-onboarding": "stripe-connect-account-onboarding",
|
|
35
59
|
payments: "stripe-connect-payments",
|
|
36
|
-
"payment-details": "stripe-connect-payment-details",
|
|
37
60
|
payouts: "stripe-connect-payouts",
|
|
38
|
-
"
|
|
39
|
-
|
|
61
|
+
"payment-details": "stripe-connect-payment-details",
|
|
62
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
63
|
+
"payment-method-settings": "stripe-connect-payment-method-settings",
|
|
40
64
|
"account-management": "stripe-connect-account-management",
|
|
41
65
|
"notification-banner": "stripe-connect-notification-banner",
|
|
66
|
+
"instant-payouts": "stripe-connect-instant-payouts",
|
|
67
|
+
"issuing-card": "stripe-connect-issuing-card",
|
|
68
|
+
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
69
|
+
"financial-account": "stripe-connect-financial-account",
|
|
70
|
+
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
71
|
+
"capital-overview": "stripe-connect-capital-overview",
|
|
42
72
|
documents: "stripe-connect-documents",
|
|
43
73
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
44
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
74
|
+
"tax-settings": "stripe-connect-tax-settings",
|
|
75
|
+
balances: "stripe-connect-balances",
|
|
76
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
77
|
+
"app-install": "stripe-connect-app-install",
|
|
78
|
+
"app-viewport": "stripe-connect-app-viewport"
|
|
45
79
|
};
|
|
46
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";
|
|
47
81
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
48
82
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
49
83
|
const findScript = () => {
|
|
50
|
-
return document.querySelectorAll(`script[src="${
|
|
84
|
+
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || null;
|
|
51
85
|
};
|
|
52
86
|
const injectScript = () => {
|
|
53
87
|
const script = document.createElement("script");
|
|
@@ -184,7 +218,7 @@ const createWrapper = stripeConnect => {
|
|
|
184
218
|
sdk: true,
|
|
185
219
|
sdkOptions: {
|
|
186
220
|
// This will be replaced by the npm package version when bundling
|
|
187
|
-
sdkVersion: "3.3.
|
|
221
|
+
sdkVersion: "3.3.14-beta-1"
|
|
188
222
|
}
|
|
189
223
|
})
|
|
190
224
|
}));
|
package/dist/src/shared.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IStripeConnectInitParams, StripeConnectInstance, ConnectElementTagName } from "../types";
|
|
2
2
|
export type LoadConnectAndInitialize = (initParams: IStripeConnectInitParams) => StripeConnectInstance;
|
|
3
|
-
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>;
|
package/dist/types/config.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
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";
|
|
@@ -6,6 +14,10 @@ export type NotificationCount = {
|
|
|
6
14
|
total: number;
|
|
7
15
|
actionRequired: number;
|
|
8
16
|
};
|
|
17
|
+
export type InstallState = {
|
|
18
|
+
appId: string;
|
|
19
|
+
state: "INSTALLED" | "UNINSTALLED";
|
|
20
|
+
};
|
|
9
21
|
export type LoaderStart = {
|
|
10
22
|
elementTagName: string;
|
|
11
23
|
};
|
|
@@ -47,6 +59,10 @@ export declare const ConnectElementCommonMethodConfig: {
|
|
|
47
59
|
setOnLoaderStart: (_listener: (({ elementTagName }: LoaderStart) => void) | undefined) => void;
|
|
48
60
|
};
|
|
49
61
|
export declare const ConnectElementCustomMethodConfig: {
|
|
62
|
+
"payment-details": {
|
|
63
|
+
setPayment: (_payment: string | undefined) => void;
|
|
64
|
+
setOnClose: (_listener: (() => void) | undefined) => void;
|
|
65
|
+
};
|
|
50
66
|
"account-onboarding": {
|
|
51
67
|
setFullTermsOfServiceUrl: (_termOfServiceUrl: string | undefined) => void;
|
|
52
68
|
setRecipientTermsOfServiceUrl: (_recipientTermsOfServiceUrl: string | undefined) => void;
|
|
@@ -62,8 +78,29 @@ export declare const ConnectElementCustomMethodConfig: {
|
|
|
62
78
|
setCollectionOptions: (_collectionOptions: CollectionOptions | undefined) => void;
|
|
63
79
|
setOnNotificationsChange: (_listener: (({ total, actionRequired }: NotificationCount) => void) | undefined) => void;
|
|
64
80
|
};
|
|
65
|
-
"
|
|
66
|
-
|
|
67
|
-
|
|
81
|
+
"issuing-card": {
|
|
82
|
+
setDefaultCard: (_defaultCard: string | undefined) => void;
|
|
83
|
+
setCardArtFileLink: (_cardArtFileLink: string | undefined) => void;
|
|
84
|
+
setCardSwitching: (_cardSwitching: boolean | undefined) => void;
|
|
85
|
+
setFetchEphemeralKey: (_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined) => void;
|
|
86
|
+
};
|
|
87
|
+
"issuing-cards-list": {
|
|
88
|
+
setCardArtFileLink: (_cardArtFileLink: string | undefined) => void;
|
|
89
|
+
setFetchEphemeralKey: (_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined) => void;
|
|
90
|
+
};
|
|
91
|
+
"financial-account": {
|
|
92
|
+
setFinancialAccount: (_financialAccount: string) => void;
|
|
93
|
+
};
|
|
94
|
+
"financial-account-transactions": {
|
|
95
|
+
setFinancialAccount: (_financialAccount: string) => void;
|
|
96
|
+
};
|
|
97
|
+
"app-install": {
|
|
98
|
+
setApp: (_app: string | undefined) => void;
|
|
99
|
+
setOnAppInstallStateFetched: (_listener: (({ appId, state }: InstallState) => void) | undefined) => void;
|
|
100
|
+
setOnAppInstallStateChanged: (_listener: (({ appId, state }: InstallState) => void) | undefined) => void;
|
|
101
|
+
};
|
|
102
|
+
"app-viewport": {
|
|
103
|
+
setApp: (_app: string | undefined) => void;
|
|
104
|
+
setAppData: (_appData: Record<string, string> | undefined) => void;
|
|
68
105
|
};
|
|
69
106
|
};
|
package/package.json
CHANGED
package/src/shared.ts
CHANGED
|
@@ -13,34 +13,53 @@ export type LoadConnectAndInitialize = (
|
|
|
13
13
|
initParams: IStripeConnectInitParams
|
|
14
14
|
) => StripeConnectInstance;
|
|
15
15
|
|
|
16
|
-
type ConnectElementHTMLName =
|
|
17
|
-
| "stripe-connect-account-onboarding"
|
|
16
|
+
export type ConnectElementHTMLName =
|
|
18
17
|
| "stripe-connect-payments"
|
|
18
|
+
| "stripe-connect-payouts"
|
|
19
19
|
| "stripe-connect-payment-details"
|
|
20
|
+
| "stripe-connect-account-onboarding"
|
|
21
|
+
| "stripe-connect-payment-method-settings"
|
|
20
22
|
| "stripe-connect-account-management"
|
|
21
23
|
| "stripe-connect-notification-banner"
|
|
22
|
-
| "stripe-connect-payouts"
|
|
23
|
-
| "stripe-connect-
|
|
24
|
-
| "stripe-connect-
|
|
24
|
+
| "stripe-connect-instant-payouts"
|
|
25
|
+
| "stripe-connect-issuing-card"
|
|
26
|
+
| "stripe-connect-issuing-cards-list"
|
|
27
|
+
| "stripe-connect-financial-account"
|
|
28
|
+
| "stripe-connect-financial-account-transactions"
|
|
29
|
+
| "stripe-connect-capital-overview"
|
|
25
30
|
| "stripe-connect-documents"
|
|
26
31
|
| "stripe-connect-tax-registrations"
|
|
27
|
-
| "stripe-connect-tax-settings"
|
|
32
|
+
| "stripe-connect-tax-settings"
|
|
33
|
+
| "stripe-connect-balances"
|
|
34
|
+
| "stripe-connect-payouts-list"
|
|
35
|
+
| "stripe-connect-app-install"
|
|
36
|
+
| "stripe-connect-app-viewport";
|
|
28
37
|
|
|
29
38
|
export const componentNameMapping: Record<
|
|
30
39
|
ConnectElementTagName,
|
|
31
40
|
ConnectElementHTMLName
|
|
32
41
|
> = {
|
|
33
|
-
"account-onboarding": "stripe-connect-account-onboarding",
|
|
34
42
|
payments: "stripe-connect-payments",
|
|
35
|
-
"payment-details": "stripe-connect-payment-details",
|
|
36
43
|
payouts: "stripe-connect-payouts",
|
|
37
|
-
"
|
|
38
|
-
|
|
44
|
+
"payment-details": "stripe-connect-payment-details",
|
|
45
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
46
|
+
"payment-method-settings": "stripe-connect-payment-method-settings",
|
|
39
47
|
"account-management": "stripe-connect-account-management",
|
|
40
48
|
"notification-banner": "stripe-connect-notification-banner",
|
|
49
|
+
"instant-payouts": "stripe-connect-instant-payouts",
|
|
50
|
+
"issuing-card": "stripe-connect-issuing-card",
|
|
51
|
+
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
52
|
+
"financial-account": "stripe-connect-financial-account",
|
|
53
|
+
"financial-account-transactions":
|
|
54
|
+
"stripe-connect-financial-account-transactions",
|
|
55
|
+
"capital-overview": "stripe-connect-capital-overview",
|
|
41
56
|
documents: "stripe-connect-documents",
|
|
42
57
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
43
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
58
|
+
"tax-settings": "stripe-connect-tax-settings",
|
|
59
|
+
balances: "stripe-connect-balances",
|
|
60
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
61
|
+
"app-install": "stripe-connect-app-install",
|
|
62
|
+
"app-viewport": "stripe-connect-app-viewport"
|
|
44
63
|
};
|
|
45
64
|
|
|
46
65
|
type StripeConnectInstanceExtended = StripeConnectInstance & {
|
|
@@ -59,10 +78,10 @@ const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
|
59
78
|
export const findScript = (): HTMLScriptElement | null => {
|
|
60
79
|
return (
|
|
61
80
|
document.querySelectorAll<HTMLScriptElement>(
|
|
62
|
-
`script[src="${
|
|
81
|
+
`script[src="${V0_URL}"]`
|
|
63
82
|
)[0] ||
|
|
64
83
|
document.querySelectorAll<HTMLScriptElement>(
|
|
65
|
-
`script[src="${
|
|
84
|
+
`script[src="${V1_URL}"]`
|
|
66
85
|
)[0] ||
|
|
67
86
|
null
|
|
68
87
|
);
|
package/types/config.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
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";
|
|
@@ -11,6 +20,11 @@ export type NotificationCount = {
|
|
|
11
20
|
actionRequired: number;
|
|
12
21
|
};
|
|
13
22
|
|
|
23
|
+
export type InstallState = {
|
|
24
|
+
appId: string;
|
|
25
|
+
state: "INSTALLED" | "UNINSTALLED";
|
|
26
|
+
};
|
|
27
|
+
|
|
14
28
|
export type LoaderStart = {
|
|
15
29
|
elementTagName: string;
|
|
16
30
|
};
|
|
@@ -61,6 +75,10 @@ export const ConnectElementCommonMethodConfig = {
|
|
|
61
75
|
};
|
|
62
76
|
|
|
63
77
|
export const ConnectElementCustomMethodConfig = {
|
|
78
|
+
"payment-details": {
|
|
79
|
+
setPayment: (_payment: string | undefined): void => {},
|
|
80
|
+
setOnClose: (_listener: (() => void) | undefined): void => {}
|
|
81
|
+
},
|
|
64
82
|
"account-onboarding": {
|
|
65
83
|
setFullTermsOfServiceUrl: (
|
|
66
84
|
_termOfServiceUrl: string | undefined
|
|
@@ -92,8 +110,37 @@ export const ConnectElementCustomMethodConfig = {
|
|
|
92
110
|
| undefined
|
|
93
111
|
): void => {}
|
|
94
112
|
},
|
|
95
|
-
"
|
|
96
|
-
|
|
97
|
-
|
|
113
|
+
"issuing-card": {
|
|
114
|
+
setDefaultCard: (_defaultCard: string | undefined): void => {},
|
|
115
|
+
setCardArtFileLink: (_cardArtFileLink: string | undefined): void => {},
|
|
116
|
+
setCardSwitching: (_cardSwitching: boolean | undefined): void => {},
|
|
117
|
+
setFetchEphemeralKey: (
|
|
118
|
+
_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined
|
|
119
|
+
): void => {}
|
|
120
|
+
},
|
|
121
|
+
"issuing-cards-list": {
|
|
122
|
+
setCardArtFileLink: (_cardArtFileLink: string | undefined): void => {},
|
|
123
|
+
setFetchEphemeralKey: (
|
|
124
|
+
_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined
|
|
125
|
+
): void => {}
|
|
126
|
+
},
|
|
127
|
+
"financial-account": {
|
|
128
|
+
setFinancialAccount: (_financialAccount: string): void => {}
|
|
129
|
+
},
|
|
130
|
+
"financial-account-transactions": {
|
|
131
|
+
setFinancialAccount: (_financialAccount: string): void => {}
|
|
132
|
+
},
|
|
133
|
+
"app-install": {
|
|
134
|
+
setApp: (_app: string | undefined): void => {},
|
|
135
|
+
setOnAppInstallStateFetched: (
|
|
136
|
+
_listener: (({ appId, state }: InstallState) => void) | undefined
|
|
137
|
+
): void => {},
|
|
138
|
+
setOnAppInstallStateChanged: (
|
|
139
|
+
_listener: (({ appId, state }: InstallState) => void) | undefined
|
|
140
|
+
): void => {}
|
|
141
|
+
},
|
|
142
|
+
"app-viewport": {
|
|
143
|
+
setApp: (_app: string | undefined): void => {},
|
|
144
|
+
setAppData: (_appData: Record<string, string> | undefined): void => {}
|
|
98
145
|
}
|
|
99
146
|
};
|
package/types/shared.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import {
|
|
|
2
2
|
ConnectElementCustomMethodConfig,
|
|
3
3
|
ConnectElementCommonMethodConfig
|
|
4
4
|
} from "./config";
|
|
5
|
-
|
|
6
5
|
export declare type LoadConnectAndInitialize = (
|
|
7
6
|
initParams: IStripeConnectInitParams
|
|
8
7
|
) => StripeConnectInstance;
|
|
@@ -452,14 +451,23 @@ export interface StripeConnectInstance {
|
|
|
452
451
|
* Tagnames to be used with the `create` method of the Connect instance.
|
|
453
452
|
*/
|
|
454
453
|
export type ConnectElementTagName =
|
|
455
|
-
| "account-onboarding"
|
|
456
454
|
| "payments"
|
|
455
|
+
| "payouts"
|
|
457
456
|
| "payment-details"
|
|
457
|
+
| "account-onboarding"
|
|
458
|
+
| "payment-method-settings"
|
|
458
459
|
| "account-management"
|
|
459
460
|
| "notification-banner"
|
|
460
|
-
| "payouts"
|
|
461
|
-
| "
|
|
462
|
-
| "
|
|
461
|
+
| "instant-payouts"
|
|
462
|
+
| "issuing-card"
|
|
463
|
+
| "issuing-cards-list"
|
|
464
|
+
| "financial-account"
|
|
465
|
+
| "financial-account-transactions"
|
|
466
|
+
| "capital-overview"
|
|
463
467
|
| "documents"
|
|
464
468
|
| "tax-registrations"
|
|
465
|
-
| "tax-settings"
|
|
469
|
+
| "tax-settings"
|
|
470
|
+
| "balances"
|
|
471
|
+
| "payouts-list"
|
|
472
|
+
| "app-install"
|
|
473
|
+
| "app-viewport";
|