@stripe/connect-js 3.3.6 → 3.3.7-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 +34 -11
- package/dist/connect.js +34 -11
- package/dist/pure.esm.js +34 -11
- package/dist/pure.js +34 -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 +28 -13
- package/src/utils/jestHelpers.ts +1 -1
- package/types/config.ts +32 -3
- package/types/shared.d.ts +12 -5
package/dist/connect.esm.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
3
3
|
const ConnectElementCustomMethodConfig = {
|
|
4
|
+
"payment-details": {
|
|
5
|
+
setPayment: _payment => {},
|
|
6
|
+
setOnClose: _listener => {}
|
|
7
|
+
},
|
|
4
8
|
"account-onboarding": {
|
|
5
9
|
setFullTermsOfServiceUrl: _termOfServiceUrl => {},
|
|
6
10
|
setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
|
|
@@ -15,31 +19,50 @@ const ConnectElementCustomMethodConfig = {
|
|
|
15
19
|
"notification-banner": {
|
|
16
20
|
setCollectionOptions: _collectionOptions => {}
|
|
17
21
|
},
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
"issuing-card": {
|
|
23
|
+
setDefaultCard: _defaultCard => {},
|
|
24
|
+
setCardArtFileLink: _cardArtFileLink => {},
|
|
25
|
+
setCardSwitching: _cardSwitching => {},
|
|
26
|
+
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
27
|
+
},
|
|
28
|
+
"issuing-cards-list": {
|
|
29
|
+
setCardArtFileLink: _cardArtFileLink => {},
|
|
30
|
+
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
31
|
+
},
|
|
32
|
+
"financial-account": {
|
|
33
|
+
setFinancialAccount: _financialAccount => {}
|
|
34
|
+
},
|
|
35
|
+
"financial-account-transactions": {
|
|
36
|
+
setFinancialAccount: _financialAccount => {}
|
|
21
37
|
}
|
|
22
38
|
};
|
|
23
39
|
|
|
24
40
|
const componentNameMapping = {
|
|
25
|
-
"account-onboarding": "stripe-connect-account-onboarding",
|
|
26
41
|
payments: "stripe-connect-payments",
|
|
27
|
-
"payment-details": "stripe-connect-payment-details",
|
|
28
42
|
payouts: "stripe-connect-payouts",
|
|
29
|
-
"
|
|
30
|
-
|
|
43
|
+
"payment-details": "stripe-connect-payment-details",
|
|
44
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
45
|
+
"payment-method-settings": "stripe-connect-payment-method-settings",
|
|
31
46
|
"account-management": "stripe-connect-account-management",
|
|
32
47
|
"notification-banner": "stripe-connect-notification-banner",
|
|
33
|
-
|
|
48
|
+
"instant-payouts": "stripe-connect-instant-payouts",
|
|
49
|
+
"issuing-card": "stripe-connect-issuing-card",
|
|
50
|
+
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
51
|
+
"financial-account": "stripe-connect-financial-account",
|
|
52
|
+
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
53
|
+
"capital-overview": "stripe-connect-capital-overview",
|
|
54
|
+
documents: "stripe-connect-documents",
|
|
55
|
+
"tax-registrations": "stripe-connect-tax-registrations",
|
|
56
|
+
"tax-settings": "stripe-connect-tax-settings"
|
|
34
57
|
};
|
|
35
58
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
36
|
-
const V0_URL = "https://connect-js.stripe.com/
|
|
59
|
+
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
37
60
|
const findScript = () => {
|
|
38
61
|
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
39
62
|
};
|
|
40
63
|
const injectScript = () => {
|
|
41
64
|
const script = document.createElement("script");
|
|
42
|
-
script.src = "https://connect-js.stripe.com/
|
|
65
|
+
script.src = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
43
66
|
const head = document.head;
|
|
44
67
|
if (!head) {
|
|
45
68
|
throw new Error("Expected document.head not to be null. Connect.js requires a <head> element.");
|
|
@@ -157,7 +180,7 @@ const createWrapper = stripeConnect => {
|
|
|
157
180
|
sdk: true,
|
|
158
181
|
sdkOptions: {
|
|
159
182
|
// This will be replaced by the npm package version when bundling
|
|
160
|
-
sdkVersion: "3.3.
|
|
183
|
+
sdkVersion: "3.3.7-beta-1"
|
|
161
184
|
}
|
|
162
185
|
})
|
|
163
186
|
}));
|
package/dist/connect.js
CHANGED
|
@@ -5,6 +5,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
6
6
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
7
7
|
const ConnectElementCustomMethodConfig = {
|
|
8
|
+
"payment-details": {
|
|
9
|
+
setPayment: _payment => {},
|
|
10
|
+
setOnClose: _listener => {}
|
|
11
|
+
},
|
|
8
12
|
"account-onboarding": {
|
|
9
13
|
setFullTermsOfServiceUrl: _termOfServiceUrl => {},
|
|
10
14
|
setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
|
|
@@ -19,31 +23,50 @@ const ConnectElementCustomMethodConfig = {
|
|
|
19
23
|
"notification-banner": {
|
|
20
24
|
setCollectionOptions: _collectionOptions => {}
|
|
21
25
|
},
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
"issuing-card": {
|
|
27
|
+
setDefaultCard: _defaultCard => {},
|
|
28
|
+
setCardArtFileLink: _cardArtFileLink => {},
|
|
29
|
+
setCardSwitching: _cardSwitching => {},
|
|
30
|
+
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
31
|
+
},
|
|
32
|
+
"issuing-cards-list": {
|
|
33
|
+
setCardArtFileLink: _cardArtFileLink => {},
|
|
34
|
+
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
35
|
+
},
|
|
36
|
+
"financial-account": {
|
|
37
|
+
setFinancialAccount: _financialAccount => {}
|
|
38
|
+
},
|
|
39
|
+
"financial-account-transactions": {
|
|
40
|
+
setFinancialAccount: _financialAccount => {}
|
|
25
41
|
}
|
|
26
42
|
};
|
|
27
43
|
|
|
28
44
|
const componentNameMapping = {
|
|
29
|
-
"account-onboarding": "stripe-connect-account-onboarding",
|
|
30
45
|
payments: "stripe-connect-payments",
|
|
31
|
-
"payment-details": "stripe-connect-payment-details",
|
|
32
46
|
payouts: "stripe-connect-payouts",
|
|
33
|
-
"
|
|
34
|
-
|
|
47
|
+
"payment-details": "stripe-connect-payment-details",
|
|
48
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
49
|
+
"payment-method-settings": "stripe-connect-payment-method-settings",
|
|
35
50
|
"account-management": "stripe-connect-account-management",
|
|
36
51
|
"notification-banner": "stripe-connect-notification-banner",
|
|
37
|
-
|
|
52
|
+
"instant-payouts": "stripe-connect-instant-payouts",
|
|
53
|
+
"issuing-card": "stripe-connect-issuing-card",
|
|
54
|
+
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
55
|
+
"financial-account": "stripe-connect-financial-account",
|
|
56
|
+
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
57
|
+
"capital-overview": "stripe-connect-capital-overview",
|
|
58
|
+
documents: "stripe-connect-documents",
|
|
59
|
+
"tax-registrations": "stripe-connect-tax-registrations",
|
|
60
|
+
"tax-settings": "stripe-connect-tax-settings"
|
|
38
61
|
};
|
|
39
62
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
40
|
-
const V0_URL = "https://connect-js.stripe.com/
|
|
63
|
+
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
41
64
|
const findScript = () => {
|
|
42
65
|
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
43
66
|
};
|
|
44
67
|
const injectScript = () => {
|
|
45
68
|
const script = document.createElement("script");
|
|
46
|
-
script.src = "https://connect-js.stripe.com/
|
|
69
|
+
script.src = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
47
70
|
const head = document.head;
|
|
48
71
|
if (!head) {
|
|
49
72
|
throw new Error("Expected document.head not to be null. Connect.js requires a <head> element.");
|
|
@@ -161,7 +184,7 @@ const createWrapper = stripeConnect => {
|
|
|
161
184
|
sdk: true,
|
|
162
185
|
sdkOptions: {
|
|
163
186
|
// This will be replaced by the npm package version when bundling
|
|
164
|
-
sdkVersion: "3.3.
|
|
187
|
+
sdkVersion: "3.3.7-beta-1"
|
|
165
188
|
}
|
|
166
189
|
})
|
|
167
190
|
}));
|
package/dist/pure.esm.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
3
3
|
const ConnectElementCustomMethodConfig = {
|
|
4
|
+
"payment-details": {
|
|
5
|
+
setPayment: _payment => {},
|
|
6
|
+
setOnClose: _listener => {}
|
|
7
|
+
},
|
|
4
8
|
"account-onboarding": {
|
|
5
9
|
setFullTermsOfServiceUrl: _termOfServiceUrl => {},
|
|
6
10
|
setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
|
|
@@ -15,31 +19,50 @@ const ConnectElementCustomMethodConfig = {
|
|
|
15
19
|
"notification-banner": {
|
|
16
20
|
setCollectionOptions: _collectionOptions => {}
|
|
17
21
|
},
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
"issuing-card": {
|
|
23
|
+
setDefaultCard: _defaultCard => {},
|
|
24
|
+
setCardArtFileLink: _cardArtFileLink => {},
|
|
25
|
+
setCardSwitching: _cardSwitching => {},
|
|
26
|
+
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
27
|
+
},
|
|
28
|
+
"issuing-cards-list": {
|
|
29
|
+
setCardArtFileLink: _cardArtFileLink => {},
|
|
30
|
+
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
31
|
+
},
|
|
32
|
+
"financial-account": {
|
|
33
|
+
setFinancialAccount: _financialAccount => {}
|
|
34
|
+
},
|
|
35
|
+
"financial-account-transactions": {
|
|
36
|
+
setFinancialAccount: _financialAccount => {}
|
|
21
37
|
}
|
|
22
38
|
};
|
|
23
39
|
|
|
24
40
|
const componentNameMapping = {
|
|
25
|
-
"account-onboarding": "stripe-connect-account-onboarding",
|
|
26
41
|
payments: "stripe-connect-payments",
|
|
27
|
-
"payment-details": "stripe-connect-payment-details",
|
|
28
42
|
payouts: "stripe-connect-payouts",
|
|
29
|
-
"
|
|
30
|
-
|
|
43
|
+
"payment-details": "stripe-connect-payment-details",
|
|
44
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
45
|
+
"payment-method-settings": "stripe-connect-payment-method-settings",
|
|
31
46
|
"account-management": "stripe-connect-account-management",
|
|
32
47
|
"notification-banner": "stripe-connect-notification-banner",
|
|
33
|
-
|
|
48
|
+
"instant-payouts": "stripe-connect-instant-payouts",
|
|
49
|
+
"issuing-card": "stripe-connect-issuing-card",
|
|
50
|
+
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
51
|
+
"financial-account": "stripe-connect-financial-account",
|
|
52
|
+
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
53
|
+
"capital-overview": "stripe-connect-capital-overview",
|
|
54
|
+
documents: "stripe-connect-documents",
|
|
55
|
+
"tax-registrations": "stripe-connect-tax-registrations",
|
|
56
|
+
"tax-settings": "stripe-connect-tax-settings"
|
|
34
57
|
};
|
|
35
58
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
36
|
-
const V0_URL = "https://connect-js.stripe.com/
|
|
59
|
+
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
37
60
|
const findScript = () => {
|
|
38
61
|
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
39
62
|
};
|
|
40
63
|
const injectScript = () => {
|
|
41
64
|
const script = document.createElement("script");
|
|
42
|
-
script.src = "https://connect-js.stripe.com/
|
|
65
|
+
script.src = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
43
66
|
const head = document.head;
|
|
44
67
|
if (!head) {
|
|
45
68
|
throw new Error("Expected document.head not to be null. Connect.js requires a <head> element.");
|
|
@@ -157,7 +180,7 @@ const createWrapper = stripeConnect => {
|
|
|
157
180
|
sdk: true,
|
|
158
181
|
sdkOptions: {
|
|
159
182
|
// This will be replaced by the npm package version when bundling
|
|
160
|
-
sdkVersion: "3.3.
|
|
183
|
+
sdkVersion: "3.3.7-beta-1"
|
|
161
184
|
}
|
|
162
185
|
})
|
|
163
186
|
}));
|
package/dist/pure.js
CHANGED
|
@@ -5,6 +5,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
6
6
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
7
7
|
const ConnectElementCustomMethodConfig = {
|
|
8
|
+
"payment-details": {
|
|
9
|
+
setPayment: _payment => {},
|
|
10
|
+
setOnClose: _listener => {}
|
|
11
|
+
},
|
|
8
12
|
"account-onboarding": {
|
|
9
13
|
setFullTermsOfServiceUrl: _termOfServiceUrl => {},
|
|
10
14
|
setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
|
|
@@ -19,31 +23,50 @@ const ConnectElementCustomMethodConfig = {
|
|
|
19
23
|
"notification-banner": {
|
|
20
24
|
setCollectionOptions: _collectionOptions => {}
|
|
21
25
|
},
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
"issuing-card": {
|
|
27
|
+
setDefaultCard: _defaultCard => {},
|
|
28
|
+
setCardArtFileLink: _cardArtFileLink => {},
|
|
29
|
+
setCardSwitching: _cardSwitching => {},
|
|
30
|
+
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
31
|
+
},
|
|
32
|
+
"issuing-cards-list": {
|
|
33
|
+
setCardArtFileLink: _cardArtFileLink => {},
|
|
34
|
+
setFetchEphemeralKey: _fetchEphemeralKey => {}
|
|
35
|
+
},
|
|
36
|
+
"financial-account": {
|
|
37
|
+
setFinancialAccount: _financialAccount => {}
|
|
38
|
+
},
|
|
39
|
+
"financial-account-transactions": {
|
|
40
|
+
setFinancialAccount: _financialAccount => {}
|
|
25
41
|
}
|
|
26
42
|
};
|
|
27
43
|
|
|
28
44
|
const componentNameMapping = {
|
|
29
|
-
"account-onboarding": "stripe-connect-account-onboarding",
|
|
30
45
|
payments: "stripe-connect-payments",
|
|
31
|
-
"payment-details": "stripe-connect-payment-details",
|
|
32
46
|
payouts: "stripe-connect-payouts",
|
|
33
|
-
"
|
|
34
|
-
|
|
47
|
+
"payment-details": "stripe-connect-payment-details",
|
|
48
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
49
|
+
"payment-method-settings": "stripe-connect-payment-method-settings",
|
|
35
50
|
"account-management": "stripe-connect-account-management",
|
|
36
51
|
"notification-banner": "stripe-connect-notification-banner",
|
|
37
|
-
|
|
52
|
+
"instant-payouts": "stripe-connect-instant-payouts",
|
|
53
|
+
"issuing-card": "stripe-connect-issuing-card",
|
|
54
|
+
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
55
|
+
"financial-account": "stripe-connect-financial-account",
|
|
56
|
+
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
57
|
+
"capital-overview": "stripe-connect-capital-overview",
|
|
58
|
+
documents: "stripe-connect-documents",
|
|
59
|
+
"tax-registrations": "stripe-connect-tax-registrations",
|
|
60
|
+
"tax-settings": "stripe-connect-tax-settings"
|
|
38
61
|
};
|
|
39
62
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
40
|
-
const V0_URL = "https://connect-js.stripe.com/
|
|
63
|
+
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
41
64
|
const findScript = () => {
|
|
42
65
|
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
43
66
|
};
|
|
44
67
|
const injectScript = () => {
|
|
45
68
|
const script = document.createElement("script");
|
|
46
|
-
script.src = "https://connect-js.stripe.com/
|
|
69
|
+
script.src = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
47
70
|
const head = document.head;
|
|
48
71
|
if (!head) {
|
|
49
72
|
throw new Error("Expected document.head not to be null. Connect.js requires a <head> element.");
|
|
@@ -161,7 +184,7 @@ const createWrapper = stripeConnect => {
|
|
|
161
184
|
sdk: true,
|
|
162
185
|
sdkOptions: {
|
|
163
186
|
// This will be replaced by the npm package version when bundling
|
|
164
|
-
sdkVersion: "3.3.
|
|
187
|
+
sdkVersion: "3.3.7-beta-1"
|
|
165
188
|
}
|
|
166
189
|
})
|
|
167
190
|
}));
|
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";
|
|
4
4
|
export declare const componentNameMapping: Record<ConnectElementTagName, ConnectElementHTMLName>;
|
|
5
5
|
type StripeConnectInstanceExtended = StripeConnectInstance & {
|
|
6
6
|
debugInstance: () => Promise<StripeConnectInstance>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SCRIPT_SELECTOR = "script[src^=\"https://connect-js.stripe.com/
|
|
1
|
+
export declare const SCRIPT_SELECTOR = "script[src^=\"https://connect-js.stripe.com/v0.1/connect.js\"]";
|
|
2
2
|
export {};
|
package/dist/types/config.d.ts
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
|
+
export type FetchEphemeralKeyFunction = (fetchParams: {
|
|
2
|
+
issuingCard: string;
|
|
3
|
+
nonce: string;
|
|
4
|
+
}) => Promise<{
|
|
5
|
+
issuingCard: string;
|
|
6
|
+
nonce: string;
|
|
7
|
+
ephemeralKeySecret: string;
|
|
8
|
+
}>;
|
|
1
9
|
export type CollectionOptions = {
|
|
2
10
|
fields: "currently_due" | "eventually_due";
|
|
3
11
|
futureRequirements?: "omit" | "include";
|
|
4
12
|
};
|
|
5
13
|
export declare const ConnectElementCustomMethodConfig: {
|
|
14
|
+
"payment-details": {
|
|
15
|
+
setPayment: (_payment: string | undefined) => void;
|
|
16
|
+
setOnClose: (_listener: (() => void) | undefined) => void;
|
|
17
|
+
};
|
|
6
18
|
"account-onboarding": {
|
|
7
19
|
setFullTermsOfServiceUrl: (_termOfServiceUrl: string | undefined) => void;
|
|
8
20
|
setRecipientTermsOfServiceUrl: (_recipientTermsOfServiceUrl: string | undefined) => void;
|
|
@@ -17,8 +29,20 @@ export declare const ConnectElementCustomMethodConfig: {
|
|
|
17
29
|
"notification-banner": {
|
|
18
30
|
setCollectionOptions: (_collectionOptions: CollectionOptions | undefined) => void;
|
|
19
31
|
};
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
32
|
+
"issuing-card": {
|
|
33
|
+
setDefaultCard: (_defaultCard: string | undefined) => void;
|
|
34
|
+
setCardArtFileLink: (_cardArtFileLink: string | undefined) => void;
|
|
35
|
+
setCardSwitching: (_cardSwitching: boolean | undefined) => void;
|
|
36
|
+
setFetchEphemeralKey: (_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined) => void;
|
|
37
|
+
};
|
|
38
|
+
"issuing-cards-list": {
|
|
39
|
+
setCardArtFileLink: (_cardArtFileLink: string | undefined) => void;
|
|
40
|
+
setFetchEphemeralKey: (_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined) => void;
|
|
41
|
+
};
|
|
42
|
+
"financial-account": {
|
|
43
|
+
setFinancialAccount: (_financialAccount: string) => void;
|
|
44
|
+
};
|
|
45
|
+
"financial-account-transactions": {
|
|
46
|
+
setFinancialAccount: (_financialAccount: string) => void;
|
|
23
47
|
};
|
|
24
48
|
};
|
package/package.json
CHANGED
package/src/shared.ts
CHANGED
|
@@ -10,30 +10,45 @@ 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-
|
|
22
|
-
| "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";
|
|
23
30
|
|
|
24
31
|
export const componentNameMapping: Record<
|
|
25
32
|
ConnectElementTagName,
|
|
26
33
|
ConnectElementHTMLName
|
|
27
34
|
> = {
|
|
28
|
-
"account-onboarding": "stripe-connect-account-onboarding",
|
|
29
35
|
payments: "stripe-connect-payments",
|
|
30
|
-
"payment-details": "stripe-connect-payment-details",
|
|
31
36
|
payouts: "stripe-connect-payouts",
|
|
32
|
-
"
|
|
33
|
-
|
|
37
|
+
"payment-details": "stripe-connect-payment-details",
|
|
38
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
39
|
+
"payment-method-settings": "stripe-connect-payment-method-settings",
|
|
34
40
|
"account-management": "stripe-connect-account-management",
|
|
35
41
|
"notification-banner": "stripe-connect-notification-banner",
|
|
36
|
-
|
|
42
|
+
"instant-payouts": "stripe-connect-instant-payouts",
|
|
43
|
+
"issuing-card": "stripe-connect-issuing-card",
|
|
44
|
+
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
45
|
+
"financial-account": "stripe-connect-financial-account",
|
|
46
|
+
"financial-account-transactions":
|
|
47
|
+
"stripe-connect-financial-account-transactions",
|
|
48
|
+
"capital-overview": "stripe-connect-capital-overview",
|
|
49
|
+
documents: "stripe-connect-documents",
|
|
50
|
+
"tax-registrations": "stripe-connect-tax-registrations",
|
|
51
|
+
"tax-settings": "stripe-connect-tax-settings"
|
|
37
52
|
};
|
|
38
53
|
|
|
39
54
|
type StripeConnectInstanceExtended = StripeConnectInstance & {
|
|
@@ -46,7 +61,7 @@ interface StripeConnectWrapper {
|
|
|
46
61
|
|
|
47
62
|
const EXISTING_SCRIPT_MESSAGE =
|
|
48
63
|
"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/
|
|
64
|
+
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
50
65
|
|
|
51
66
|
export const findScript = (): HTMLScriptElement | null => {
|
|
52
67
|
return (
|
|
@@ -58,7 +73,7 @@ export const findScript = (): HTMLScriptElement | null => {
|
|
|
58
73
|
|
|
59
74
|
const injectScript = (): HTMLScriptElement => {
|
|
60
75
|
const script = document.createElement("script");
|
|
61
|
-
script.src = "https://connect-js.stripe.com/
|
|
76
|
+
script.src = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
62
77
|
|
|
63
78
|
const head = document.head;
|
|
64
79
|
|
package/src/utils/jestHelpers.ts
CHANGED
package/types/config.ts
CHANGED
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
3
3
|
|
|
4
|
+
export type FetchEphemeralKeyFunction = (fetchParams: {
|
|
5
|
+
issuingCard: string;
|
|
6
|
+
nonce: string;
|
|
7
|
+
}) => Promise<{
|
|
8
|
+
issuingCard: string;
|
|
9
|
+
nonce: string;
|
|
10
|
+
ephemeralKeySecret: string;
|
|
11
|
+
}>;
|
|
12
|
+
|
|
4
13
|
export type CollectionOptions = {
|
|
5
14
|
fields: "currently_due" | "eventually_due";
|
|
6
15
|
futureRequirements?: "omit" | "include";
|
|
7
16
|
};
|
|
8
17
|
|
|
9
18
|
export const ConnectElementCustomMethodConfig = {
|
|
19
|
+
"payment-details": {
|
|
20
|
+
setPayment: (_payment: string | undefined): void => {},
|
|
21
|
+
setOnClose: (_listener: (() => void) | undefined): void => {}
|
|
22
|
+
},
|
|
10
23
|
"account-onboarding": {
|
|
11
24
|
setFullTermsOfServiceUrl: (
|
|
12
25
|
_termOfServiceUrl: string | undefined
|
|
@@ -33,8 +46,24 @@ export const ConnectElementCustomMethodConfig = {
|
|
|
33
46
|
_collectionOptions: CollectionOptions | undefined
|
|
34
47
|
): void => {}
|
|
35
48
|
},
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
49
|
+
"issuing-card": {
|
|
50
|
+
setDefaultCard: (_defaultCard: string | undefined): void => {},
|
|
51
|
+
setCardArtFileLink: (_cardArtFileLink: string | undefined): void => {},
|
|
52
|
+
setCardSwitching: (_cardSwitching: boolean | undefined): void => {},
|
|
53
|
+
setFetchEphemeralKey: (
|
|
54
|
+
_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined
|
|
55
|
+
): void => {}
|
|
56
|
+
},
|
|
57
|
+
"issuing-cards-list": {
|
|
58
|
+
setCardArtFileLink: (_cardArtFileLink: string | undefined): void => {},
|
|
59
|
+
setFetchEphemeralKey: (
|
|
60
|
+
_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined
|
|
61
|
+
): void => {}
|
|
62
|
+
},
|
|
63
|
+
"financial-account": {
|
|
64
|
+
setFinancialAccount: (_financialAccount: string): void => {}
|
|
65
|
+
},
|
|
66
|
+
"financial-account-transactions": {
|
|
67
|
+
setFinancialAccount: (_financialAccount: string): void => {}
|
|
39
68
|
}
|
|
40
69
|
};
|
package/types/shared.d.ts
CHANGED
|
@@ -447,12 +447,19 @@ 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
|
-
| "
|
|
458
|
-
| "
|
|
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";
|