@stripe/connect-js 3.3.10 → 3.3.12-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 +37 -10
- package/dist/connect.js +37 -10
- package/dist/pure.esm.js +37 -10
- package/dist/pure.js +37 -10
- package/dist/src/shared.d.ts +1 -1
- package/dist/types/config.d.ts +27 -3
- package/package.json +1 -1
- package/src/shared.ts +35 -12
- 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 => {},
|
|
@@ -16,28 +20,51 @@ const ConnectElementCustomMethodConfig = {
|
|
|
16
20
|
setCollectionOptions: _collectionOptions => {},
|
|
17
21
|
setOnNotificationsChange: _listener => {}
|
|
18
22
|
},
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
"issuing-card": {
|
|
24
|
+
setDefaultCard: _defaultCard => {},
|
|
25
|
+
setCardArtFileLink: _cardArtFileLink => {},
|
|
26
|
+
setCardSwitching: _cardSwitching => {},
|
|
27
|
+
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
28
|
+
},
|
|
29
|
+
"issuing-cards-list": {
|
|
30
|
+
setCardArtFileLink: _cardArtFileLink => {},
|
|
31
|
+
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
32
|
+
},
|
|
33
|
+
"financial-account": {
|
|
34
|
+
setFinancialAccount: _financialAccount => {}
|
|
35
|
+
},
|
|
36
|
+
"financial-account-transactions": {
|
|
37
|
+
setFinancialAccount: _financialAccount => {}
|
|
22
38
|
}
|
|
23
39
|
};
|
|
24
40
|
|
|
25
41
|
const componentNameMapping = {
|
|
26
|
-
"account-onboarding": "stripe-connect-account-onboarding",
|
|
27
42
|
payments: "stripe-connect-payments",
|
|
28
|
-
"payment-details": "stripe-connect-payment-details",
|
|
29
43
|
payouts: "stripe-connect-payouts",
|
|
30
|
-
"
|
|
31
|
-
|
|
44
|
+
"payment-details": "stripe-connect-payment-details",
|
|
45
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
46
|
+
"payment-method-settings": "stripe-connect-payment-method-settings",
|
|
32
47
|
"account-management": "stripe-connect-account-management",
|
|
33
48
|
"notification-banner": "stripe-connect-notification-banner",
|
|
34
|
-
|
|
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": "stripe-connect-financial-account-transactions",
|
|
54
|
+
"capital-overview": "stripe-connect-capital-overview",
|
|
55
|
+
documents: "stripe-connect-documents",
|
|
56
|
+
"tax-registrations": "stripe-connect-tax-registrations",
|
|
57
|
+
"tax-settings": "stripe-connect-tax-settings",
|
|
58
|
+
balances: "stripe-connect-balances",
|
|
59
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
60
|
+
"app-install": "stripe-connect-app-install",
|
|
61
|
+
"app-viewport": "stripe-connect-app-viewport"
|
|
35
62
|
};
|
|
36
63
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
37
64
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
38
65
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
39
66
|
const findScript = () => {
|
|
40
|
-
return document.querySelectorAll(`script[src="${
|
|
67
|
+
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || null;
|
|
41
68
|
};
|
|
42
69
|
const injectScript = () => {
|
|
43
70
|
const script = document.createElement("script");
|
|
@@ -175,7 +202,7 @@ const createWrapper = stripeConnect => {
|
|
|
175
202
|
sdk: true,
|
|
176
203
|
sdkOptions: {
|
|
177
204
|
// This will be replaced by the npm package version when bundling
|
|
178
|
-
sdkVersion: "3.3.
|
|
205
|
+
sdkVersion: "3.3.12-beta-1"
|
|
179
206
|
}
|
|
180
207
|
})
|
|
181
208
|
}));
|
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 => {},
|
|
@@ -20,28 +24,51 @@ 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 => {}
|
|
26
42
|
}
|
|
27
43
|
};
|
|
28
44
|
|
|
29
45
|
const componentNameMapping = {
|
|
30
|
-
"account-onboarding": "stripe-connect-account-onboarding",
|
|
31
46
|
payments: "stripe-connect-payments",
|
|
32
|
-
"payment-details": "stripe-connect-payment-details",
|
|
33
47
|
payouts: "stripe-connect-payouts",
|
|
34
|
-
"
|
|
35
|
-
|
|
48
|
+
"payment-details": "stripe-connect-payment-details",
|
|
49
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
50
|
+
"payment-method-settings": "stripe-connect-payment-method-settings",
|
|
36
51
|
"account-management": "stripe-connect-account-management",
|
|
37
52
|
"notification-banner": "stripe-connect-notification-banner",
|
|
38
|
-
|
|
53
|
+
"instant-payouts": "stripe-connect-instant-payouts",
|
|
54
|
+
"issuing-card": "stripe-connect-issuing-card",
|
|
55
|
+
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
56
|
+
"financial-account": "stripe-connect-financial-account",
|
|
57
|
+
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
58
|
+
"capital-overview": "stripe-connect-capital-overview",
|
|
59
|
+
documents: "stripe-connect-documents",
|
|
60
|
+
"tax-registrations": "stripe-connect-tax-registrations",
|
|
61
|
+
"tax-settings": "stripe-connect-tax-settings",
|
|
62
|
+
balances: "stripe-connect-balances",
|
|
63
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
64
|
+
"app-install": "stripe-connect-app-install",
|
|
65
|
+
"app-viewport": "stripe-connect-app-viewport"
|
|
39
66
|
};
|
|
40
67
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
41
68
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
42
69
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
43
70
|
const findScript = () => {
|
|
44
|
-
return document.querySelectorAll(`script[src="${
|
|
71
|
+
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || null;
|
|
45
72
|
};
|
|
46
73
|
const injectScript = () => {
|
|
47
74
|
const script = document.createElement("script");
|
|
@@ -179,7 +206,7 @@ const createWrapper = stripeConnect => {
|
|
|
179
206
|
sdk: true,
|
|
180
207
|
sdkOptions: {
|
|
181
208
|
// This will be replaced by the npm package version when bundling
|
|
182
|
-
sdkVersion: "3.3.
|
|
209
|
+
sdkVersion: "3.3.12-beta-1"
|
|
183
210
|
}
|
|
184
211
|
})
|
|
185
212
|
}));
|
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 => {},
|
|
@@ -16,28 +20,51 @@ const ConnectElementCustomMethodConfig = {
|
|
|
16
20
|
setCollectionOptions: _collectionOptions => {},
|
|
17
21
|
setOnNotificationsChange: _listener => {}
|
|
18
22
|
},
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
"issuing-card": {
|
|
24
|
+
setDefaultCard: _defaultCard => {},
|
|
25
|
+
setCardArtFileLink: _cardArtFileLink => {},
|
|
26
|
+
setCardSwitching: _cardSwitching => {},
|
|
27
|
+
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
28
|
+
},
|
|
29
|
+
"issuing-cards-list": {
|
|
30
|
+
setCardArtFileLink: _cardArtFileLink => {},
|
|
31
|
+
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
32
|
+
},
|
|
33
|
+
"financial-account": {
|
|
34
|
+
setFinancialAccount: _financialAccount => {}
|
|
35
|
+
},
|
|
36
|
+
"financial-account-transactions": {
|
|
37
|
+
setFinancialAccount: _financialAccount => {}
|
|
22
38
|
}
|
|
23
39
|
};
|
|
24
40
|
|
|
25
41
|
const componentNameMapping = {
|
|
26
|
-
"account-onboarding": "stripe-connect-account-onboarding",
|
|
27
42
|
payments: "stripe-connect-payments",
|
|
28
|
-
"payment-details": "stripe-connect-payment-details",
|
|
29
43
|
payouts: "stripe-connect-payouts",
|
|
30
|
-
"
|
|
31
|
-
|
|
44
|
+
"payment-details": "stripe-connect-payment-details",
|
|
45
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
46
|
+
"payment-method-settings": "stripe-connect-payment-method-settings",
|
|
32
47
|
"account-management": "stripe-connect-account-management",
|
|
33
48
|
"notification-banner": "stripe-connect-notification-banner",
|
|
34
|
-
|
|
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": "stripe-connect-financial-account-transactions",
|
|
54
|
+
"capital-overview": "stripe-connect-capital-overview",
|
|
55
|
+
documents: "stripe-connect-documents",
|
|
56
|
+
"tax-registrations": "stripe-connect-tax-registrations",
|
|
57
|
+
"tax-settings": "stripe-connect-tax-settings",
|
|
58
|
+
balances: "stripe-connect-balances",
|
|
59
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
60
|
+
"app-install": "stripe-connect-app-install",
|
|
61
|
+
"app-viewport": "stripe-connect-app-viewport"
|
|
35
62
|
};
|
|
36
63
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
37
64
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
38
65
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
39
66
|
const findScript = () => {
|
|
40
|
-
return document.querySelectorAll(`script[src="${
|
|
67
|
+
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || null;
|
|
41
68
|
};
|
|
42
69
|
const injectScript = () => {
|
|
43
70
|
const script = document.createElement("script");
|
|
@@ -175,7 +202,7 @@ const createWrapper = stripeConnect => {
|
|
|
175
202
|
sdk: true,
|
|
176
203
|
sdkOptions: {
|
|
177
204
|
// This will be replaced by the npm package version when bundling
|
|
178
|
-
sdkVersion: "3.3.
|
|
205
|
+
sdkVersion: "3.3.12-beta-1"
|
|
179
206
|
}
|
|
180
207
|
})
|
|
181
208
|
}));
|
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 => {},
|
|
@@ -20,28 +24,51 @@ 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 => {}
|
|
26
42
|
}
|
|
27
43
|
};
|
|
28
44
|
|
|
29
45
|
const componentNameMapping = {
|
|
30
|
-
"account-onboarding": "stripe-connect-account-onboarding",
|
|
31
46
|
payments: "stripe-connect-payments",
|
|
32
|
-
"payment-details": "stripe-connect-payment-details",
|
|
33
47
|
payouts: "stripe-connect-payouts",
|
|
34
|
-
"
|
|
35
|
-
|
|
48
|
+
"payment-details": "stripe-connect-payment-details",
|
|
49
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
50
|
+
"payment-method-settings": "stripe-connect-payment-method-settings",
|
|
36
51
|
"account-management": "stripe-connect-account-management",
|
|
37
52
|
"notification-banner": "stripe-connect-notification-banner",
|
|
38
|
-
|
|
53
|
+
"instant-payouts": "stripe-connect-instant-payouts",
|
|
54
|
+
"issuing-card": "stripe-connect-issuing-card",
|
|
55
|
+
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
56
|
+
"financial-account": "stripe-connect-financial-account",
|
|
57
|
+
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
58
|
+
"capital-overview": "stripe-connect-capital-overview",
|
|
59
|
+
documents: "stripe-connect-documents",
|
|
60
|
+
"tax-registrations": "stripe-connect-tax-registrations",
|
|
61
|
+
"tax-settings": "stripe-connect-tax-settings",
|
|
62
|
+
balances: "stripe-connect-balances",
|
|
63
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
64
|
+
"app-install": "stripe-connect-app-install",
|
|
65
|
+
"app-viewport": "stripe-connect-app-viewport"
|
|
39
66
|
};
|
|
40
67
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
41
68
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
42
69
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
43
70
|
const findScript = () => {
|
|
44
|
-
return document.querySelectorAll(`script[src="${
|
|
71
|
+
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || null;
|
|
45
72
|
};
|
|
46
73
|
const injectScript = () => {
|
|
47
74
|
const script = document.createElement("script");
|
|
@@ -179,7 +206,7 @@ const createWrapper = stripeConnect => {
|
|
|
179
206
|
sdk: true,
|
|
180
207
|
sdkOptions: {
|
|
181
208
|
// This will be replaced by the npm package version when bundling
|
|
182
|
-
sdkVersion: "3.3.
|
|
209
|
+
sdkVersion: "3.3.12-beta-1"
|
|
183
210
|
}
|
|
184
211
|
})
|
|
185
212
|
}));
|
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";
|
|
@@ -7,6 +15,10 @@ export type NotificationCount = {
|
|
|
7
15
|
actionRequired: number;
|
|
8
16
|
};
|
|
9
17
|
export declare const ConnectElementCustomMethodConfig: {
|
|
18
|
+
"payment-details": {
|
|
19
|
+
setPayment: (_payment: string | undefined) => void;
|
|
20
|
+
setOnClose: (_listener: (() => void) | undefined) => void;
|
|
21
|
+
};
|
|
10
22
|
"account-onboarding": {
|
|
11
23
|
setFullTermsOfServiceUrl: (_termOfServiceUrl: string | undefined) => void;
|
|
12
24
|
setRecipientTermsOfServiceUrl: (_recipientTermsOfServiceUrl: string | undefined) => void;
|
|
@@ -22,8 +34,20 @@ export declare const ConnectElementCustomMethodConfig: {
|
|
|
22
34
|
setCollectionOptions: (_collectionOptions: CollectionOptions | undefined) => void;
|
|
23
35
|
setOnNotificationsChange: (_listener: (({ total, actionRequired }: NotificationCount) => void) | undefined) => void;
|
|
24
36
|
};
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
37
|
+
"issuing-card": {
|
|
38
|
+
setDefaultCard: (_defaultCard: string | undefined) => void;
|
|
39
|
+
setCardArtFileLink: (_cardArtFileLink: string | undefined) => void;
|
|
40
|
+
setCardSwitching: (_cardSwitching: boolean | undefined) => void;
|
|
41
|
+
setFetchEphemeralKey: (_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined) => void;
|
|
42
|
+
};
|
|
43
|
+
"issuing-cards-list": {
|
|
44
|
+
setCardArtFileLink: (_cardArtFileLink: string | undefined) => void;
|
|
45
|
+
setFetchEphemeralKey: (_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined) => void;
|
|
46
|
+
};
|
|
47
|
+
"financial-account": {
|
|
48
|
+
setFinancialAccount: (_financialAccount: string) => void;
|
|
49
|
+
};
|
|
50
|
+
"financial-account-transactions": {
|
|
51
|
+
setFinancialAccount: (_financialAccount: string) => void;
|
|
28
52
|
};
|
|
29
53
|
};
|
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 & {
|
|
@@ -52,10 +75,10 @@ const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
|
52
75
|
export const findScript = (): HTMLScriptElement | null => {
|
|
53
76
|
return (
|
|
54
77
|
document.querySelectorAll<HTMLScriptElement>(
|
|
55
|
-
`script[src="${
|
|
78
|
+
`script[src="${V0_URL}"]`
|
|
56
79
|
)[0] ||
|
|
57
80
|
document.querySelectorAll<HTMLScriptElement>(
|
|
58
|
-
`script[src="${
|
|
81
|
+
`script[src="${V1_URL}"]`
|
|
59
82
|
)[0] ||
|
|
60
83
|
null
|
|
61
84
|
);
|
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";
|
|
@@ -12,6 +21,10 @@ export type NotificationCount = {
|
|
|
12
21
|
};
|
|
13
22
|
|
|
14
23
|
export const ConnectElementCustomMethodConfig = {
|
|
24
|
+
"payment-details": {
|
|
25
|
+
setPayment: (_payment: string | undefined): void => {},
|
|
26
|
+
setOnClose: (_listener: (() => void) | undefined): void => {}
|
|
27
|
+
},
|
|
15
28
|
"account-onboarding": {
|
|
16
29
|
setFullTermsOfServiceUrl: (
|
|
17
30
|
_termOfServiceUrl: string | undefined
|
|
@@ -43,8 +56,24 @@ export const ConnectElementCustomMethodConfig = {
|
|
|
43
56
|
| undefined
|
|
44
57
|
): void => {}
|
|
45
58
|
},
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
59
|
+
"issuing-card": {
|
|
60
|
+
setDefaultCard: (_defaultCard: string | undefined): void => {},
|
|
61
|
+
setCardArtFileLink: (_cardArtFileLink: string | undefined): void => {},
|
|
62
|
+
setCardSwitching: (_cardSwitching: boolean | undefined): void => {},
|
|
63
|
+
setFetchEphemeralKey: (
|
|
64
|
+
_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined
|
|
65
|
+
): void => {}
|
|
66
|
+
},
|
|
67
|
+
"issuing-cards-list": {
|
|
68
|
+
setCardArtFileLink: (_cardArtFileLink: string | undefined): void => {},
|
|
69
|
+
setFetchEphemeralKey: (
|
|
70
|
+
_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined
|
|
71
|
+
): void => {}
|
|
72
|
+
},
|
|
73
|
+
"financial-account": {
|
|
74
|
+
setFinancialAccount: (_financialAccount: string): void => {}
|
|
75
|
+
},
|
|
76
|
+
"financial-account-transactions": {
|
|
77
|
+
setFinancialAccount: (_financialAccount: string): void => {}
|
|
49
78
|
}
|
|
50
79
|
};
|
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";
|