@stripe/connect-js 3.3.7 → 3.3.9-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 +38 -11
- package/dist/connect.js +38 -11
- package/dist/pure.esm.js +38 -11
- package/dist/pure.js +38 -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 +35 -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 => {},
|
|
@@ -16,31 +20,54 @@ 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
|
-
const V0_URL = "https://connect-js.stripe.com/
|
|
64
|
+
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
38
65
|
const findScript = () => {
|
|
39
66
|
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
40
67
|
};
|
|
41
68
|
const injectScript = () => {
|
|
42
69
|
const script = document.createElement("script");
|
|
43
|
-
script.src = "https://connect-js.stripe.com/
|
|
70
|
+
script.src = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
44
71
|
const head = document.head;
|
|
45
72
|
if (!head) {
|
|
46
73
|
throw new Error("Expected document.head not to be null. Connect.js requires a <head> element.");
|
|
@@ -161,7 +188,7 @@ const createWrapper = stripeConnect => {
|
|
|
161
188
|
sdk: true,
|
|
162
189
|
sdkOptions: {
|
|
163
190
|
// This will be replaced by the npm package version when bundling
|
|
164
|
-
sdkVersion: "3.3.7"
|
|
191
|
+
sdkVersion: "3.3.7-beta-1"
|
|
165
192
|
}
|
|
166
193
|
})
|
|
167
194
|
}));
|
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,31 +24,54 @@ 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
|
-
const V0_URL = "https://connect-js.stripe.com/
|
|
68
|
+
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
42
69
|
const findScript = () => {
|
|
43
70
|
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
44
71
|
};
|
|
45
72
|
const injectScript = () => {
|
|
46
73
|
const script = document.createElement("script");
|
|
47
|
-
script.src = "https://connect-js.stripe.com/
|
|
74
|
+
script.src = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
48
75
|
const head = document.head;
|
|
49
76
|
if (!head) {
|
|
50
77
|
throw new Error("Expected document.head not to be null. Connect.js requires a <head> element.");
|
|
@@ -165,7 +192,7 @@ const createWrapper = stripeConnect => {
|
|
|
165
192
|
sdk: true,
|
|
166
193
|
sdkOptions: {
|
|
167
194
|
// This will be replaced by the npm package version when bundling
|
|
168
|
-
sdkVersion: "3.3.7"
|
|
195
|
+
sdkVersion: "3.3.7-beta-1"
|
|
169
196
|
}
|
|
170
197
|
})
|
|
171
198
|
}));
|
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,31 +20,54 @@ 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
|
-
const V0_URL = "https://connect-js.stripe.com/
|
|
64
|
+
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
38
65
|
const findScript = () => {
|
|
39
66
|
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
40
67
|
};
|
|
41
68
|
const injectScript = () => {
|
|
42
69
|
const script = document.createElement("script");
|
|
43
|
-
script.src = "https://connect-js.stripe.com/
|
|
70
|
+
script.src = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
44
71
|
const head = document.head;
|
|
45
72
|
if (!head) {
|
|
46
73
|
throw new Error("Expected document.head not to be null. Connect.js requires a <head> element.");
|
|
@@ -161,7 +188,7 @@ const createWrapper = stripeConnect => {
|
|
|
161
188
|
sdk: true,
|
|
162
189
|
sdkOptions: {
|
|
163
190
|
// This will be replaced by the npm package version when bundling
|
|
164
|
-
sdkVersion: "3.3.7"
|
|
191
|
+
sdkVersion: "3.3.7-beta-1"
|
|
165
192
|
}
|
|
166
193
|
})
|
|
167
194
|
}));
|
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,31 +24,54 @@ 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
|
-
const V0_URL = "https://connect-js.stripe.com/
|
|
68
|
+
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
42
69
|
const findScript = () => {
|
|
43
70
|
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
44
71
|
};
|
|
45
72
|
const injectScript = () => {
|
|
46
73
|
const script = document.createElement("script");
|
|
47
|
-
script.src = "https://connect-js.stripe.com/
|
|
74
|
+
script.src = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
48
75
|
const head = document.head;
|
|
49
76
|
if (!head) {
|
|
50
77
|
throw new Error("Expected document.head not to be null. Connect.js requires a <head> element.");
|
|
@@ -165,7 +192,7 @@ const createWrapper = stripeConnect => {
|
|
|
165
192
|
sdk: true,
|
|
166
193
|
sdkOptions: {
|
|
167
194
|
// This will be replaced by the npm package version when bundling
|
|
168
|
-
sdkVersion: "3.3.7"
|
|
195
|
+
sdkVersion: "3.3.7-beta-1"
|
|
169
196
|
}
|
|
170
197
|
})
|
|
171
198
|
}));
|
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;
|
|
@@ -18,8 +30,20 @@ export declare const ConnectElementCustomMethodConfig: {
|
|
|
18
30
|
setCollectionOptions: (_collectionOptions: CollectionOptions | undefined) => void;
|
|
19
31
|
setOnNotificationsChange: (_listener: (() => void) | undefined) => void;
|
|
20
32
|
};
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
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;
|
|
38
|
+
};
|
|
39
|
+
"issuing-cards-list": {
|
|
40
|
+
setCardArtFileLink: (_cardArtFileLink: string | undefined) => void;
|
|
41
|
+
setFetchEphemeralKey: (_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined) => void;
|
|
42
|
+
};
|
|
43
|
+
"financial-account": {
|
|
44
|
+
setFinancialAccount: (_financialAccount: string) => void;
|
|
45
|
+
};
|
|
46
|
+
"financial-account-transactions": {
|
|
47
|
+
setFinancialAccount: (_financialAccount: string) => void;
|
|
24
48
|
};
|
|
25
49
|
};
|
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
|
|
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
|
|
@@ -34,8 +47,24 @@ export const ConnectElementCustomMethodConfig = {
|
|
|
34
47
|
): void => {},
|
|
35
48
|
setOnNotificationsChange: (_listener: (() => void) | undefined): void => {}
|
|
36
49
|
},
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
50
|
+
"issuing-card": {
|
|
51
|
+
setDefaultCard: (_defaultCard: string | undefined): void => {},
|
|
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
|
|
62
|
+
): void => {}
|
|
63
|
+
},
|
|
64
|
+
"financial-account": {
|
|
65
|
+
setFinancialAccount: (_financialAccount: string): void => {}
|
|
66
|
+
},
|
|
67
|
+
"financial-account-transactions": {
|
|
68
|
+
setFinancialAccount: (_financialAccount: string): void => {}
|
|
40
69
|
}
|
|
41
70
|
};
|
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";
|