@stripe/connect-js 3.3.10-beta-1 → 3.3.10
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 +12 -38
- package/dist/connect.js +12 -38
- package/dist/pure.esm.js +12 -38
- package/dist/pure.js +12 -38
- package/dist/src/shared.d.ts +1 -1
- package/dist/src/utils/jestHelpers.d.ts +1 -1
- package/dist/types/config.d.ts +8 -28
- package/package.json +1 -1
- package/src/shared.ts +17 -35
- package/src/utils/jestHelpers.ts +1 -1
- package/types/config.ts +12 -32
- package/types/shared.d.ts +4 -15
package/dist/connect.esm.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
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
|
-
},
|
|
8
4
|
"account-onboarding": {
|
|
9
5
|
setFullTermsOfServiceUrl: _termOfServiceUrl => {},
|
|
10
6
|
setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
|
|
@@ -20,54 +16,32 @@ const ConnectElementCustomMethodConfig = {
|
|
|
20
16
|
setCollectionOptions: _collectionOptions => {},
|
|
21
17
|
setOnNotificationsChange: _listener => {}
|
|
22
18
|
},
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
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 => {}
|
|
19
|
+
"payment-details": {
|
|
20
|
+
setPayment: _payment => {},
|
|
21
|
+
setOnClose: _listener => {}
|
|
38
22
|
}
|
|
39
23
|
};
|
|
40
24
|
|
|
41
25
|
const componentNameMapping = {
|
|
26
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
42
27
|
payments: "stripe-connect-payments",
|
|
43
|
-
payouts: "stripe-connect-payouts",
|
|
44
28
|
"payment-details": "stripe-connect-payment-details",
|
|
45
|
-
|
|
46
|
-
"
|
|
29
|
+
payouts: "stripe-connect-payouts",
|
|
30
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
31
|
+
balances: "stripe-connect-balances",
|
|
47
32
|
"account-management": "stripe-connect-account-management",
|
|
48
33
|
"notification-banner": "stripe-connect-notification-banner",
|
|
49
|
-
|
|
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"
|
|
34
|
+
documents: "stripe-connect-documents"
|
|
62
35
|
};
|
|
63
36
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
64
37
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
38
|
+
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
65
39
|
const findScript = () => {
|
|
66
|
-
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
40
|
+
return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
67
41
|
};
|
|
68
42
|
const injectScript = () => {
|
|
69
43
|
const script = document.createElement("script");
|
|
70
|
-
script.src =
|
|
44
|
+
script.src = V1_URL;
|
|
71
45
|
const head = document.head;
|
|
72
46
|
if (!head) {
|
|
73
47
|
throw new Error("Expected document.head not to be null. Connect.js requires a <head> element.");
|
|
@@ -201,7 +175,7 @@ const createWrapper = stripeConnect => {
|
|
|
201
175
|
sdk: true,
|
|
202
176
|
sdkOptions: {
|
|
203
177
|
// This will be replaced by the npm package version when bundling
|
|
204
|
-
sdkVersion: "3.3.10
|
|
178
|
+
sdkVersion: "3.3.10"
|
|
205
179
|
}
|
|
206
180
|
})
|
|
207
181
|
}));
|
package/dist/connect.js
CHANGED
|
@@ -5,10 +5,6 @@ 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
|
-
},
|
|
12
8
|
"account-onboarding": {
|
|
13
9
|
setFullTermsOfServiceUrl: _termOfServiceUrl => {},
|
|
14
10
|
setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
|
|
@@ -24,54 +20,32 @@ const ConnectElementCustomMethodConfig = {
|
|
|
24
20
|
setCollectionOptions: _collectionOptions => {},
|
|
25
21
|
setOnNotificationsChange: _listener => {}
|
|
26
22
|
},
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
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 => {}
|
|
23
|
+
"payment-details": {
|
|
24
|
+
setPayment: _payment => {},
|
|
25
|
+
setOnClose: _listener => {}
|
|
42
26
|
}
|
|
43
27
|
};
|
|
44
28
|
|
|
45
29
|
const componentNameMapping = {
|
|
30
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
46
31
|
payments: "stripe-connect-payments",
|
|
47
|
-
payouts: "stripe-connect-payouts",
|
|
48
32
|
"payment-details": "stripe-connect-payment-details",
|
|
49
|
-
|
|
50
|
-
"
|
|
33
|
+
payouts: "stripe-connect-payouts",
|
|
34
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
35
|
+
balances: "stripe-connect-balances",
|
|
51
36
|
"account-management": "stripe-connect-account-management",
|
|
52
37
|
"notification-banner": "stripe-connect-notification-banner",
|
|
53
|
-
|
|
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"
|
|
38
|
+
documents: "stripe-connect-documents"
|
|
66
39
|
};
|
|
67
40
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
68
41
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
42
|
+
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
69
43
|
const findScript = () => {
|
|
70
|
-
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
44
|
+
return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
71
45
|
};
|
|
72
46
|
const injectScript = () => {
|
|
73
47
|
const script = document.createElement("script");
|
|
74
|
-
script.src =
|
|
48
|
+
script.src = V1_URL;
|
|
75
49
|
const head = document.head;
|
|
76
50
|
if (!head) {
|
|
77
51
|
throw new Error("Expected document.head not to be null. Connect.js requires a <head> element.");
|
|
@@ -205,7 +179,7 @@ const createWrapper = stripeConnect => {
|
|
|
205
179
|
sdk: true,
|
|
206
180
|
sdkOptions: {
|
|
207
181
|
// This will be replaced by the npm package version when bundling
|
|
208
|
-
sdkVersion: "3.3.10
|
|
182
|
+
sdkVersion: "3.3.10"
|
|
209
183
|
}
|
|
210
184
|
})
|
|
211
185
|
}));
|
package/dist/pure.esm.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
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
|
-
},
|
|
8
4
|
"account-onboarding": {
|
|
9
5
|
setFullTermsOfServiceUrl: _termOfServiceUrl => {},
|
|
10
6
|
setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
|
|
@@ -20,54 +16,32 @@ const ConnectElementCustomMethodConfig = {
|
|
|
20
16
|
setCollectionOptions: _collectionOptions => {},
|
|
21
17
|
setOnNotificationsChange: _listener => {}
|
|
22
18
|
},
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
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 => {}
|
|
19
|
+
"payment-details": {
|
|
20
|
+
setPayment: _payment => {},
|
|
21
|
+
setOnClose: _listener => {}
|
|
38
22
|
}
|
|
39
23
|
};
|
|
40
24
|
|
|
41
25
|
const componentNameMapping = {
|
|
26
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
42
27
|
payments: "stripe-connect-payments",
|
|
43
|
-
payouts: "stripe-connect-payouts",
|
|
44
28
|
"payment-details": "stripe-connect-payment-details",
|
|
45
|
-
|
|
46
|
-
"
|
|
29
|
+
payouts: "stripe-connect-payouts",
|
|
30
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
31
|
+
balances: "stripe-connect-balances",
|
|
47
32
|
"account-management": "stripe-connect-account-management",
|
|
48
33
|
"notification-banner": "stripe-connect-notification-banner",
|
|
49
|
-
|
|
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"
|
|
34
|
+
documents: "stripe-connect-documents"
|
|
62
35
|
};
|
|
63
36
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
64
37
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
38
|
+
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
65
39
|
const findScript = () => {
|
|
66
|
-
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
40
|
+
return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
67
41
|
};
|
|
68
42
|
const injectScript = () => {
|
|
69
43
|
const script = document.createElement("script");
|
|
70
|
-
script.src =
|
|
44
|
+
script.src = V1_URL;
|
|
71
45
|
const head = document.head;
|
|
72
46
|
if (!head) {
|
|
73
47
|
throw new Error("Expected document.head not to be null. Connect.js requires a <head> element.");
|
|
@@ -201,7 +175,7 @@ const createWrapper = stripeConnect => {
|
|
|
201
175
|
sdk: true,
|
|
202
176
|
sdkOptions: {
|
|
203
177
|
// This will be replaced by the npm package version when bundling
|
|
204
|
-
sdkVersion: "3.3.10
|
|
178
|
+
sdkVersion: "3.3.10"
|
|
205
179
|
}
|
|
206
180
|
})
|
|
207
181
|
}));
|
package/dist/pure.js
CHANGED
|
@@ -5,10 +5,6 @@ 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
|
-
},
|
|
12
8
|
"account-onboarding": {
|
|
13
9
|
setFullTermsOfServiceUrl: _termOfServiceUrl => {},
|
|
14
10
|
setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
|
|
@@ -24,54 +20,32 @@ const ConnectElementCustomMethodConfig = {
|
|
|
24
20
|
setCollectionOptions: _collectionOptions => {},
|
|
25
21
|
setOnNotificationsChange: _listener => {}
|
|
26
22
|
},
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
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 => {}
|
|
23
|
+
"payment-details": {
|
|
24
|
+
setPayment: _payment => {},
|
|
25
|
+
setOnClose: _listener => {}
|
|
42
26
|
}
|
|
43
27
|
};
|
|
44
28
|
|
|
45
29
|
const componentNameMapping = {
|
|
30
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
46
31
|
payments: "stripe-connect-payments",
|
|
47
|
-
payouts: "stripe-connect-payouts",
|
|
48
32
|
"payment-details": "stripe-connect-payment-details",
|
|
49
|
-
|
|
50
|
-
"
|
|
33
|
+
payouts: "stripe-connect-payouts",
|
|
34
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
35
|
+
balances: "stripe-connect-balances",
|
|
51
36
|
"account-management": "stripe-connect-account-management",
|
|
52
37
|
"notification-banner": "stripe-connect-notification-banner",
|
|
53
|
-
|
|
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"
|
|
38
|
+
documents: "stripe-connect-documents"
|
|
66
39
|
};
|
|
67
40
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
68
41
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
42
|
+
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
69
43
|
const findScript = () => {
|
|
70
|
-
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
44
|
+
return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
71
45
|
};
|
|
72
46
|
const injectScript = () => {
|
|
73
47
|
const script = document.createElement("script");
|
|
74
|
-
script.src =
|
|
48
|
+
script.src = V1_URL;
|
|
75
49
|
const head = document.head;
|
|
76
50
|
if (!head) {
|
|
77
51
|
throw new Error("Expected document.head not to be null. Connect.js requires a <head> element.");
|
|
@@ -205,7 +179,7 @@ const createWrapper = stripeConnect => {
|
|
|
205
179
|
sdk: true,
|
|
206
180
|
sdkOptions: {
|
|
207
181
|
// This will be replaced by the npm package version when bundling
|
|
208
|
-
sdkVersion: "3.3.10
|
|
182
|
+
sdkVersion: "3.3.10"
|
|
209
183
|
}
|
|
210
184
|
})
|
|
211
185
|
}));
|
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
|
-
|
|
3
|
+
type ConnectElementHTMLName = "stripe-connect-account-onboarding" | "stripe-connect-payments" | "stripe-connect-payment-details" | "stripe-connect-account-management" | "stripe-connect-notification-banner" | "stripe-connect-payouts" | "stripe-connect-payouts-list" | "stripe-connect-balances" | "stripe-connect-documents";
|
|
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/v1.0/connect.js\"]";
|
|
2
2
|
export {};
|
package/dist/types/config.d.ts
CHANGED
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
export type FetchEphemeralKeyFunction = (fetchParams: {
|
|
2
|
-
issuingCard: string;
|
|
3
|
-
nonce: string;
|
|
4
|
-
}) => Promise<{
|
|
5
|
-
issuingCard: string;
|
|
6
|
-
nonce: string;
|
|
7
|
-
ephemeralKeySecret: string;
|
|
8
|
-
}>;
|
|
9
1
|
export type CollectionOptions = {
|
|
10
2
|
fields: "currently_due" | "eventually_due";
|
|
11
3
|
futureRequirements?: "omit" | "include";
|
|
12
4
|
};
|
|
5
|
+
export type NotificationCount = {
|
|
6
|
+
total: number;
|
|
7
|
+
actionRequired: number;
|
|
8
|
+
};
|
|
13
9
|
export declare const ConnectElementCustomMethodConfig: {
|
|
14
|
-
"payment-details": {
|
|
15
|
-
setPayment: (_payment: string | undefined) => void;
|
|
16
|
-
setOnClose: (_listener: (() => void) | undefined) => void;
|
|
17
|
-
};
|
|
18
10
|
"account-onboarding": {
|
|
19
11
|
setFullTermsOfServiceUrl: (_termOfServiceUrl: string | undefined) => void;
|
|
20
12
|
setRecipientTermsOfServiceUrl: (_recipientTermsOfServiceUrl: string | undefined) => void;
|
|
@@ -28,22 +20,10 @@ export declare const ConnectElementCustomMethodConfig: {
|
|
|
28
20
|
};
|
|
29
21
|
"notification-banner": {
|
|
30
22
|
setCollectionOptions: (_collectionOptions: CollectionOptions | undefined) => void;
|
|
31
|
-
setOnNotificationsChange: (_listener: (() => void) | undefined) => void;
|
|
32
|
-
};
|
|
33
|
-
"issuing-card": {
|
|
34
|
-
setDefaultCard: (_defaultCard: string | undefined) => void;
|
|
35
|
-
setCardArtFileLink: (_cardArtFileLink: string | undefined) => void;
|
|
36
|
-
setCardSwitching: (_cardSwitching: boolean | undefined) => void;
|
|
37
|
-
setFetchEphemeralKey: (_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined) => void;
|
|
23
|
+
setOnNotificationsChange: (_listener: (({ total, actionRequired }: NotificationCount) => void) | undefined) => void;
|
|
38
24
|
};
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
};
|
|
43
|
-
"financial-account": {
|
|
44
|
-
setFinancialAccount: (_financialAccount: string) => void;
|
|
45
|
-
};
|
|
46
|
-
"financial-account-transactions": {
|
|
47
|
-
setFinancialAccount: (_financialAccount: string) => void;
|
|
25
|
+
"payment-details": {
|
|
26
|
+
setPayment: (_payment: string | undefined) => void;
|
|
27
|
+
setOnClose: (_listener: (() => void) | undefined) => void;
|
|
48
28
|
};
|
|
49
29
|
};
|
package/package.json
CHANGED
package/src/shared.ts
CHANGED
|
@@ -10,53 +10,30 @@ export type LoadConnectAndInitialize = (
|
|
|
10
10
|
initParams: IStripeConnectInitParams
|
|
11
11
|
) => StripeConnectInstance;
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
type ConnectElementHTMLName =
|
|
14
|
+
| "stripe-connect-account-onboarding"
|
|
14
15
|
| "stripe-connect-payments"
|
|
15
|
-
| "stripe-connect-payouts"
|
|
16
16
|
| "stripe-connect-payment-details"
|
|
17
|
-
| "stripe-connect-account-onboarding"
|
|
18
|
-
| "stripe-connect-payment-method-settings"
|
|
19
17
|
| "stripe-connect-account-management"
|
|
20
18
|
| "stripe-connect-notification-banner"
|
|
21
|
-
| "stripe-connect-
|
|
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"
|
|
30
|
-
| "stripe-connect-balances"
|
|
19
|
+
| "stripe-connect-payouts"
|
|
31
20
|
| "stripe-connect-payouts-list"
|
|
32
|
-
| "stripe-connect-
|
|
33
|
-
| "stripe-connect-
|
|
21
|
+
| "stripe-connect-balances"
|
|
22
|
+
| "stripe-connect-documents";
|
|
34
23
|
|
|
35
24
|
export const componentNameMapping: Record<
|
|
36
25
|
ConnectElementTagName,
|
|
37
26
|
ConnectElementHTMLName
|
|
38
27
|
> = {
|
|
28
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
39
29
|
payments: "stripe-connect-payments",
|
|
40
|
-
payouts: "stripe-connect-payouts",
|
|
41
30
|
"payment-details": "stripe-connect-payment-details",
|
|
42
|
-
|
|
43
|
-
"
|
|
31
|
+
payouts: "stripe-connect-payouts",
|
|
32
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
33
|
+
balances: "stripe-connect-balances",
|
|
44
34
|
"account-management": "stripe-connect-account-management",
|
|
45
35
|
"notification-banner": "stripe-connect-notification-banner",
|
|
46
|
-
|
|
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"
|
|
36
|
+
documents: "stripe-connect-documents"
|
|
60
37
|
};
|
|
61
38
|
|
|
62
39
|
type StripeConnectInstanceExtended = StripeConnectInstance & {
|
|
@@ -70,18 +47,23 @@ interface StripeConnectWrapper {
|
|
|
70
47
|
const EXISTING_SCRIPT_MESSAGE =
|
|
71
48
|
"loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
72
49
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
50
|
+
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
73
51
|
|
|
74
52
|
export const findScript = (): HTMLScriptElement | null => {
|
|
75
53
|
return (
|
|
54
|
+
document.querySelectorAll<HTMLScriptElement>(
|
|
55
|
+
`script[src="${V1_URL}"]`
|
|
56
|
+
)[0] ||
|
|
76
57
|
document.querySelectorAll<HTMLScriptElement>(
|
|
77
58
|
`script[src="${V0_URL}"]`
|
|
78
|
-
)[0] ||
|
|
59
|
+
)[0] ||
|
|
60
|
+
null
|
|
79
61
|
);
|
|
80
62
|
};
|
|
81
63
|
|
|
82
64
|
const injectScript = (): HTMLScriptElement => {
|
|
83
65
|
const script = document.createElement("script");
|
|
84
|
-
script.src =
|
|
66
|
+
script.src = V1_URL;
|
|
85
67
|
|
|
86
68
|
const head = document.head;
|
|
87
69
|
|
package/src/utils/jestHelpers.ts
CHANGED
package/types/config.ts
CHANGED
|
@@ -1,25 +1,17 @@
|
|
|
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
|
-
|
|
13
4
|
export type CollectionOptions = {
|
|
14
5
|
fields: "currently_due" | "eventually_due";
|
|
15
6
|
futureRequirements?: "omit" | "include";
|
|
16
7
|
};
|
|
17
8
|
|
|
9
|
+
export type NotificationCount = {
|
|
10
|
+
total: number;
|
|
11
|
+
actionRequired: number;
|
|
12
|
+
};
|
|
13
|
+
|
|
18
14
|
export const ConnectElementCustomMethodConfig = {
|
|
19
|
-
"payment-details": {
|
|
20
|
-
setPayment: (_payment: string | undefined): void => {},
|
|
21
|
-
setOnClose: (_listener: (() => void) | undefined): void => {}
|
|
22
|
-
},
|
|
23
15
|
"account-onboarding": {
|
|
24
16
|
setFullTermsOfServiceUrl: (
|
|
25
17
|
_termOfServiceUrl: string | undefined
|
|
@@ -45,26 +37,14 @@ export const ConnectElementCustomMethodConfig = {
|
|
|
45
37
|
setCollectionOptions: (
|
|
46
38
|
_collectionOptions: CollectionOptions | undefined
|
|
47
39
|
): void => {},
|
|
48
|
-
setOnNotificationsChange: (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
setCardArtFileLink: (_cardArtFileLink: string | undefined): void => {},
|
|
53
|
-
setCardSwitching: (_cardSwitching: boolean | undefined): void => {},
|
|
54
|
-
setFetchEphemeralKey: (
|
|
55
|
-
_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined
|
|
56
|
-
): void => {}
|
|
57
|
-
},
|
|
58
|
-
"issuing-cards-list": {
|
|
59
|
-
setCardArtFileLink: (_cardArtFileLink: string | undefined): void => {},
|
|
60
|
-
setFetchEphemeralKey: (
|
|
61
|
-
_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined
|
|
40
|
+
setOnNotificationsChange: (
|
|
41
|
+
_listener:
|
|
42
|
+
| (({ total, actionRequired }: NotificationCount) => void)
|
|
43
|
+
| undefined
|
|
62
44
|
): void => {}
|
|
63
45
|
},
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"financial-account-transactions": {
|
|
68
|
-
setFinancialAccount: (_financialAccount: string): void => {}
|
|
46
|
+
"payment-details": {
|
|
47
|
+
setPayment: (_payment: string | undefined): void => {},
|
|
48
|
+
setOnClose: (_listener: (() => void) | undefined): void => {}
|
|
69
49
|
}
|
|
70
50
|
};
|
package/types/shared.d.ts
CHANGED
|
@@ -447,23 +447,12 @@ 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"
|
|
450
451
|
| "payments"
|
|
451
|
-
| "payouts"
|
|
452
452
|
| "payment-details"
|
|
453
|
-
| "account-onboarding"
|
|
454
|
-
| "payment-method-settings"
|
|
455
453
|
| "account-management"
|
|
456
454
|
| "notification-banner"
|
|
457
|
-
| "
|
|
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"
|
|
466
|
-
| "balances"
|
|
455
|
+
| "payouts"
|
|
467
456
|
| "payouts-list"
|
|
468
|
-
| "
|
|
469
|
-
| "
|
|
457
|
+
| "balances"
|
|
458
|
+
| "documents";
|