@stripe/connect-js 3.3.15-beta-1 → 3.3.15

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/README.md CHANGED
@@ -7,7 +7,7 @@ Calling `loadConnectAndInitialize` always loads the latest version of Connect.js
7
7
 
8
8
  The embedded onboarding component is generally available now. Please refer to our [documentation](https://stripe.com/docs/connect/supported-embedded-components#account-onboarding) for more information.
9
9
 
10
- Note: Majority of Connect embedded components are currently still in beta. Please [contact us](https://stripe.com/docs/connect/get-started-connect-embedded-components#access) to request beta access.
10
+ Note: Some Connect embedded components are currently still in preview. These can be [viewed on our doc site](https://docs.stripe.com/connect/supported-embedded-components), where you can also request preview access.
11
11
 
12
12
  ## Installation
13
13
 
@@ -20,8 +20,7 @@ npm install @stripe/connect-js
20
20
  ## Documentation
21
21
 
22
22
  - [Connect embedded components](https://stripe.com/docs/connect/get-started-connect-embedded-components)
23
- - [Quickstart guide for GA](https://stripe.com/docs/connect/connect-embedded-components/quickstart)
24
- - [Quickstart guide for beta](https://stripe.com/docs/connect/connect-embedded-components/beta-quickstart)
23
+ - [Quickstart guide](https://stripe.com/docs/connect/connect-embedded-components/quickstart)
25
24
 
26
25
  ## Usage
27
26
 
@@ -5,17 +5,14 @@ const ConnectElementCommonMethodConfig = {
5
5
  setOnLoaderStart: _listener => {}
6
6
  };
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 => {},
15
11
  setPrivacyPolicyUrl: _privacyPolicyUrl => {},
16
12
  setSkipTermsOfServiceCollection: _skipTermsOfServiceCollection => {},
17
13
  setCollectionOptions: _collectionOptions => {},
18
- setOnExit: _listener => {}
14
+ setOnExit: _listener => {},
15
+ setOnStepChange: _listener => {}
19
16
  },
20
17
  "account-management": {
21
18
  setCollectionOptions: _collectionOptions => {}
@@ -24,63 +21,39 @@ const ConnectElementCustomMethodConfig = {
24
21
  setCollectionOptions: _collectionOptions => {},
25
22
  setOnNotificationsChange: _listener => {}
26
23
  },
27
- "issuing-card": {
28
- setDefaultCard: _defaultCard => {},
29
- setCardArtFileLink: _cardArtFileLink => {},
30
- setCardSwitching: _cardSwitching => {},
31
- setFetchEphemeralKey: _fetchEphemeralKey => {}
32
- },
33
- "issuing-cards-list": {
34
- setCardArtFileLink: _cardArtFileLink => {},
35
- setFetchEphemeralKey: _fetchEphemeralKey => {}
36
- },
37
- "financial-account": {
38
- setFinancialAccount: _financialAccount => {}
39
- },
40
- "financial-account-transactions": {
41
- setFinancialAccount: _financialAccount => {}
42
- },
43
- "app-install": {
44
- setApp: _app => {},
45
- setOnAppInstallStateFetched: _listener => {},
46
- setOnAppInstallStateChanged: _listener => {}
24
+ "payment-details": {
25
+ setPayment: _payment => {},
26
+ setOnClose: _listener => {}
47
27
  },
48
- "app-viewport": {
49
- setApp: _app => {},
50
- setAppData: _appData => {}
28
+ "tax-settings": {
29
+ setHideProductTaxCodeSelector: _hidden => {},
30
+ setDisplayHeadOfficeCountries: _countries => {},
31
+ setOnTaxSettingsUpdated: _listener => {}
51
32
  },
52
- "payment-method-settings": {
53
- setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
33
+ "tax-registrations": {
34
+ setOnAfterTaxRegistrationAdded: _listener => {},
35
+ setDisplayCountries: _countries => {}
54
36
  }
55
37
  };
56
38
 
57
39
  const componentNameMapping = {
40
+ "account-onboarding": "stripe-connect-account-onboarding",
58
41
  payments: "stripe-connect-payments",
59
- payouts: "stripe-connect-payouts",
60
42
  "payment-details": "stripe-connect-payment-details",
61
- "account-onboarding": "stripe-connect-account-onboarding",
62
- "payment-method-settings": "stripe-connect-payment-method-settings",
43
+ payouts: "stripe-connect-payouts",
44
+ "payouts-list": "stripe-connect-payouts-list",
45
+ balances: "stripe-connect-balances",
63
46
  "account-management": "stripe-connect-account-management",
64
47
  "notification-banner": "stripe-connect-notification-banner",
65
- "instant-payouts": "stripe-connect-instant-payouts",
66
- "issuing-card": "stripe-connect-issuing-card",
67
- "issuing-cards-list": "stripe-connect-issuing-cards-list",
68
- "financial-account": "stripe-connect-financial-account",
69
- "financial-account-transactions": "stripe-connect-financial-account-transactions",
70
- "capital-overview": "stripe-connect-capital-overview",
71
48
  documents: "stripe-connect-documents",
72
49
  "tax-registrations": "stripe-connect-tax-registrations",
73
- "tax-settings": "stripe-connect-tax-settings",
74
- balances: "stripe-connect-balances",
75
- "payouts-list": "stripe-connect-payouts-list",
76
- "app-install": "stripe-connect-app-install",
77
- "app-viewport": "stripe-connect-app-viewport"
50
+ "tax-settings": "stripe-connect-tax-settings"
78
51
  };
79
52
  const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
80
53
  const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
81
54
  const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
82
55
  const findScript = () => {
83
- return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || null;
56
+ return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
84
57
  };
85
58
  const injectScript = () => {
86
59
  const script = document.createElement("script");
@@ -92,13 +65,13 @@ const injectScript = () => {
92
65
  document.head.appendChild(script);
93
66
  return script;
94
67
  };
95
- let stripePromise = null;
68
+ let stripePromise$1 = null;
96
69
  const loadScript = () => {
97
70
  // Ensure that we only attempt to load Connect.js at most once
98
- if (stripePromise !== null) {
99
- return stripePromise;
71
+ if (stripePromise$1 !== null) {
72
+ return stripePromise$1;
100
73
  }
101
- stripePromise = new Promise((resolve, reject) => {
74
+ stripePromise$1 = new Promise((resolve, reject) => {
102
75
  if (typeof window === "undefined") {
103
76
  reject("ConnectJS won't load when rendering code in the server - it can only be loaded on a browser. This error is expected when loading ConnectJS in SSR environments, like NextJS. It will have no impact in the UI, however if you wish to avoid it, you can switch to the `pure` version of the connect.js loader: https://github.com/stripe/connect-js#importing-loadconnect-without-side-effects.");
104
77
  return;
@@ -133,7 +106,7 @@ const loadScript = () => {
133
106
  reject(error);
134
107
  }
135
108
  });
136
- return stripePromise;
109
+ return stripePromise$1;
137
110
  };
138
111
  const hasCustomMethod = tagName => {
139
112
  return tagName in ConnectElementCustomMethodConfig;
@@ -217,7 +190,7 @@ const createWrapper = stripeConnect => {
217
190
  sdk: true,
218
191
  sdkOptions: {
219
192
  // This will be replaced by the npm package version when bundling
220
- sdkVersion: "3.3.14-beta-1"
193
+ sdkVersion: "3.3.15"
221
194
  }
222
195
  })
223
196
  }));
@@ -229,16 +202,16 @@ const createWrapper = stripeConnect => {
229
202
 
230
203
  // Execute our own script injection after a tick to give users time to do their
231
204
  // own script injection.
232
- const stripePromise$1 = Promise.resolve().then(() => loadScript());
205
+ const stripePromise = Promise.resolve().then(() => loadScript());
233
206
  let loadCalled = false;
234
- stripePromise$1.catch(err => {
207
+ stripePromise.catch(err => {
235
208
  if (!loadCalled) {
236
209
  console.warn(err);
237
210
  }
238
211
  });
239
212
  const loadConnectAndInitialize = initParams => {
240
213
  loadCalled = true;
241
- return initStripeConnect(stripePromise$1, initParams);
214
+ return initStripeConnect(stripePromise, initParams);
242
215
  };
243
216
 
244
217
  export { loadConnectAndInitialize };
package/dist/connect.js CHANGED
@@ -9,17 +9,14 @@ const ConnectElementCommonMethodConfig = {
9
9
  setOnLoaderStart: _listener => {}
10
10
  };
11
11
  const ConnectElementCustomMethodConfig = {
12
- "payment-details": {
13
- setPayment: _payment => {},
14
- setOnClose: _listener => {}
15
- },
16
12
  "account-onboarding": {
17
13
  setFullTermsOfServiceUrl: _termOfServiceUrl => {},
18
14
  setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
19
15
  setPrivacyPolicyUrl: _privacyPolicyUrl => {},
20
16
  setSkipTermsOfServiceCollection: _skipTermsOfServiceCollection => {},
21
17
  setCollectionOptions: _collectionOptions => {},
22
- setOnExit: _listener => {}
18
+ setOnExit: _listener => {},
19
+ setOnStepChange: _listener => {}
23
20
  },
24
21
  "account-management": {
25
22
  setCollectionOptions: _collectionOptions => {}
@@ -28,63 +25,39 @@ const ConnectElementCustomMethodConfig = {
28
25
  setCollectionOptions: _collectionOptions => {},
29
26
  setOnNotificationsChange: _listener => {}
30
27
  },
31
- "issuing-card": {
32
- setDefaultCard: _defaultCard => {},
33
- setCardArtFileLink: _cardArtFileLink => {},
34
- setCardSwitching: _cardSwitching => {},
35
- setFetchEphemeralKey: _fetchEphemeralKey => {}
36
- },
37
- "issuing-cards-list": {
38
- setCardArtFileLink: _cardArtFileLink => {},
39
- setFetchEphemeralKey: _fetchEphemeralKey => {}
40
- },
41
- "financial-account": {
42
- setFinancialAccount: _financialAccount => {}
43
- },
44
- "financial-account-transactions": {
45
- setFinancialAccount: _financialAccount => {}
46
- },
47
- "app-install": {
48
- setApp: _app => {},
49
- setOnAppInstallStateFetched: _listener => {},
50
- setOnAppInstallStateChanged: _listener => {}
28
+ "payment-details": {
29
+ setPayment: _payment => {},
30
+ setOnClose: _listener => {}
51
31
  },
52
- "app-viewport": {
53
- setApp: _app => {},
54
- setAppData: _appData => {}
32
+ "tax-settings": {
33
+ setHideProductTaxCodeSelector: _hidden => {},
34
+ setDisplayHeadOfficeCountries: _countries => {},
35
+ setOnTaxSettingsUpdated: _listener => {}
55
36
  },
56
- "payment-method-settings": {
57
- setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
37
+ "tax-registrations": {
38
+ setOnAfterTaxRegistrationAdded: _listener => {},
39
+ setDisplayCountries: _countries => {}
58
40
  }
59
41
  };
60
42
 
61
43
  const componentNameMapping = {
44
+ "account-onboarding": "stripe-connect-account-onboarding",
62
45
  payments: "stripe-connect-payments",
63
- payouts: "stripe-connect-payouts",
64
46
  "payment-details": "stripe-connect-payment-details",
65
- "account-onboarding": "stripe-connect-account-onboarding",
66
- "payment-method-settings": "stripe-connect-payment-method-settings",
47
+ payouts: "stripe-connect-payouts",
48
+ "payouts-list": "stripe-connect-payouts-list",
49
+ balances: "stripe-connect-balances",
67
50
  "account-management": "stripe-connect-account-management",
68
51
  "notification-banner": "stripe-connect-notification-banner",
69
- "instant-payouts": "stripe-connect-instant-payouts",
70
- "issuing-card": "stripe-connect-issuing-card",
71
- "issuing-cards-list": "stripe-connect-issuing-cards-list",
72
- "financial-account": "stripe-connect-financial-account",
73
- "financial-account-transactions": "stripe-connect-financial-account-transactions",
74
- "capital-overview": "stripe-connect-capital-overview",
75
52
  documents: "stripe-connect-documents",
76
53
  "tax-registrations": "stripe-connect-tax-registrations",
77
- "tax-settings": "stripe-connect-tax-settings",
78
- balances: "stripe-connect-balances",
79
- "payouts-list": "stripe-connect-payouts-list",
80
- "app-install": "stripe-connect-app-install",
81
- "app-viewport": "stripe-connect-app-viewport"
54
+ "tax-settings": "stripe-connect-tax-settings"
82
55
  };
83
56
  const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
84
57
  const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
85
58
  const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
86
59
  const findScript = () => {
87
- return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || null;
60
+ return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
88
61
  };
89
62
  const injectScript = () => {
90
63
  const script = document.createElement("script");
@@ -96,13 +69,13 @@ const injectScript = () => {
96
69
  document.head.appendChild(script);
97
70
  return script;
98
71
  };
99
- let stripePromise = null;
72
+ let stripePromise$1 = null;
100
73
  const loadScript = () => {
101
74
  // Ensure that we only attempt to load Connect.js at most once
102
- if (stripePromise !== null) {
103
- return stripePromise;
75
+ if (stripePromise$1 !== null) {
76
+ return stripePromise$1;
104
77
  }
105
- stripePromise = new Promise((resolve, reject) => {
78
+ stripePromise$1 = new Promise((resolve, reject) => {
106
79
  if (typeof window === "undefined") {
107
80
  reject("ConnectJS won't load when rendering code in the server - it can only be loaded on a browser. This error is expected when loading ConnectJS in SSR environments, like NextJS. It will have no impact in the UI, however if you wish to avoid it, you can switch to the `pure` version of the connect.js loader: https://github.com/stripe/connect-js#importing-loadconnect-without-side-effects.");
108
81
  return;
@@ -137,7 +110,7 @@ const loadScript = () => {
137
110
  reject(error);
138
111
  }
139
112
  });
140
- return stripePromise;
113
+ return stripePromise$1;
141
114
  };
142
115
  const hasCustomMethod = tagName => {
143
116
  return tagName in ConnectElementCustomMethodConfig;
@@ -221,7 +194,7 @@ const createWrapper = stripeConnect => {
221
194
  sdk: true,
222
195
  sdkOptions: {
223
196
  // This will be replaced by the npm package version when bundling
224
- sdkVersion: "3.3.14-beta-1"
197
+ sdkVersion: "3.3.15"
225
198
  }
226
199
  })
227
200
  }));
@@ -233,16 +206,16 @@ const createWrapper = stripeConnect => {
233
206
 
234
207
  // Execute our own script injection after a tick to give users time to do their
235
208
  // own script injection.
236
- const stripePromise$1 = Promise.resolve().then(() => loadScript());
209
+ const stripePromise = Promise.resolve().then(() => loadScript());
237
210
  let loadCalled = false;
238
- stripePromise$1.catch(err => {
211
+ stripePromise.catch(err => {
239
212
  if (!loadCalled) {
240
213
  console.warn(err);
241
214
  }
242
215
  });
243
216
  const loadConnectAndInitialize = initParams => {
244
217
  loadCalled = true;
245
- return initStripeConnect(stripePromise$1, initParams);
218
+ return initStripeConnect(stripePromise, initParams);
246
219
  };
247
220
 
248
221
  exports.loadConnectAndInitialize = loadConnectAndInitialize;
package/dist/pure.esm.js CHANGED
@@ -5,17 +5,14 @@ const ConnectElementCommonMethodConfig = {
5
5
  setOnLoaderStart: _listener => {}
6
6
  };
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 => {},
15
11
  setPrivacyPolicyUrl: _privacyPolicyUrl => {},
16
12
  setSkipTermsOfServiceCollection: _skipTermsOfServiceCollection => {},
17
13
  setCollectionOptions: _collectionOptions => {},
18
- setOnExit: _listener => {}
14
+ setOnExit: _listener => {},
15
+ setOnStepChange: _listener => {}
19
16
  },
20
17
  "account-management": {
21
18
  setCollectionOptions: _collectionOptions => {}
@@ -24,63 +21,39 @@ const ConnectElementCustomMethodConfig = {
24
21
  setCollectionOptions: _collectionOptions => {},
25
22
  setOnNotificationsChange: _listener => {}
26
23
  },
27
- "issuing-card": {
28
- setDefaultCard: _defaultCard => {},
29
- setCardArtFileLink: _cardArtFileLink => {},
30
- setCardSwitching: _cardSwitching => {},
31
- setFetchEphemeralKey: _fetchEphemeralKey => {}
32
- },
33
- "issuing-cards-list": {
34
- setCardArtFileLink: _cardArtFileLink => {},
35
- setFetchEphemeralKey: _fetchEphemeralKey => {}
36
- },
37
- "financial-account": {
38
- setFinancialAccount: _financialAccount => {}
39
- },
40
- "financial-account-transactions": {
41
- setFinancialAccount: _financialAccount => {}
42
- },
43
- "app-install": {
44
- setApp: _app => {},
45
- setOnAppInstallStateFetched: _listener => {},
46
- setOnAppInstallStateChanged: _listener => {}
24
+ "payment-details": {
25
+ setPayment: _payment => {},
26
+ setOnClose: _listener => {}
47
27
  },
48
- "app-viewport": {
49
- setApp: _app => {},
50
- setAppData: _appData => {}
28
+ "tax-settings": {
29
+ setHideProductTaxCodeSelector: _hidden => {},
30
+ setDisplayHeadOfficeCountries: _countries => {},
31
+ setOnTaxSettingsUpdated: _listener => {}
51
32
  },
52
- "payment-method-settings": {
53
- setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
33
+ "tax-registrations": {
34
+ setOnAfterTaxRegistrationAdded: _listener => {},
35
+ setDisplayCountries: _countries => {}
54
36
  }
55
37
  };
56
38
 
57
39
  const componentNameMapping = {
40
+ "account-onboarding": "stripe-connect-account-onboarding",
58
41
  payments: "stripe-connect-payments",
59
- payouts: "stripe-connect-payouts",
60
42
  "payment-details": "stripe-connect-payment-details",
61
- "account-onboarding": "stripe-connect-account-onboarding",
62
- "payment-method-settings": "stripe-connect-payment-method-settings",
43
+ payouts: "stripe-connect-payouts",
44
+ "payouts-list": "stripe-connect-payouts-list",
45
+ balances: "stripe-connect-balances",
63
46
  "account-management": "stripe-connect-account-management",
64
47
  "notification-banner": "stripe-connect-notification-banner",
65
- "instant-payouts": "stripe-connect-instant-payouts",
66
- "issuing-card": "stripe-connect-issuing-card",
67
- "issuing-cards-list": "stripe-connect-issuing-cards-list",
68
- "financial-account": "stripe-connect-financial-account",
69
- "financial-account-transactions": "stripe-connect-financial-account-transactions",
70
- "capital-overview": "stripe-connect-capital-overview",
71
48
  documents: "stripe-connect-documents",
72
49
  "tax-registrations": "stripe-connect-tax-registrations",
73
- "tax-settings": "stripe-connect-tax-settings",
74
- balances: "stripe-connect-balances",
75
- "payouts-list": "stripe-connect-payouts-list",
76
- "app-install": "stripe-connect-app-install",
77
- "app-viewport": "stripe-connect-app-viewport"
50
+ "tax-settings": "stripe-connect-tax-settings"
78
51
  };
79
52
  const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
80
53
  const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
81
54
  const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
82
55
  const findScript = () => {
83
- return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || null;
56
+ return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
84
57
  };
85
58
  const injectScript = () => {
86
59
  const script = document.createElement("script");
@@ -217,7 +190,7 @@ const createWrapper = stripeConnect => {
217
190
  sdk: true,
218
191
  sdkOptions: {
219
192
  // This will be replaced by the npm package version when bundling
220
- sdkVersion: "3.3.14-beta-1"
193
+ sdkVersion: "3.3.15"
221
194
  }
222
195
  })
223
196
  }));
package/dist/pure.js CHANGED
@@ -9,17 +9,14 @@ const ConnectElementCommonMethodConfig = {
9
9
  setOnLoaderStart: _listener => {}
10
10
  };
11
11
  const ConnectElementCustomMethodConfig = {
12
- "payment-details": {
13
- setPayment: _payment => {},
14
- setOnClose: _listener => {}
15
- },
16
12
  "account-onboarding": {
17
13
  setFullTermsOfServiceUrl: _termOfServiceUrl => {},
18
14
  setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
19
15
  setPrivacyPolicyUrl: _privacyPolicyUrl => {},
20
16
  setSkipTermsOfServiceCollection: _skipTermsOfServiceCollection => {},
21
17
  setCollectionOptions: _collectionOptions => {},
22
- setOnExit: _listener => {}
18
+ setOnExit: _listener => {},
19
+ setOnStepChange: _listener => {}
23
20
  },
24
21
  "account-management": {
25
22
  setCollectionOptions: _collectionOptions => {}
@@ -28,63 +25,39 @@ const ConnectElementCustomMethodConfig = {
28
25
  setCollectionOptions: _collectionOptions => {},
29
26
  setOnNotificationsChange: _listener => {}
30
27
  },
31
- "issuing-card": {
32
- setDefaultCard: _defaultCard => {},
33
- setCardArtFileLink: _cardArtFileLink => {},
34
- setCardSwitching: _cardSwitching => {},
35
- setFetchEphemeralKey: _fetchEphemeralKey => {}
36
- },
37
- "issuing-cards-list": {
38
- setCardArtFileLink: _cardArtFileLink => {},
39
- setFetchEphemeralKey: _fetchEphemeralKey => {}
40
- },
41
- "financial-account": {
42
- setFinancialAccount: _financialAccount => {}
43
- },
44
- "financial-account-transactions": {
45
- setFinancialAccount: _financialAccount => {}
46
- },
47
- "app-install": {
48
- setApp: _app => {},
49
- setOnAppInstallStateFetched: _listener => {},
50
- setOnAppInstallStateChanged: _listener => {}
28
+ "payment-details": {
29
+ setPayment: _payment => {},
30
+ setOnClose: _listener => {}
51
31
  },
52
- "app-viewport": {
53
- setApp: _app => {},
54
- setAppData: _appData => {}
32
+ "tax-settings": {
33
+ setHideProductTaxCodeSelector: _hidden => {},
34
+ setDisplayHeadOfficeCountries: _countries => {},
35
+ setOnTaxSettingsUpdated: _listener => {}
55
36
  },
56
- "payment-method-settings": {
57
- setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
37
+ "tax-registrations": {
38
+ setOnAfterTaxRegistrationAdded: _listener => {},
39
+ setDisplayCountries: _countries => {}
58
40
  }
59
41
  };
60
42
 
61
43
  const componentNameMapping = {
44
+ "account-onboarding": "stripe-connect-account-onboarding",
62
45
  payments: "stripe-connect-payments",
63
- payouts: "stripe-connect-payouts",
64
46
  "payment-details": "stripe-connect-payment-details",
65
- "account-onboarding": "stripe-connect-account-onboarding",
66
- "payment-method-settings": "stripe-connect-payment-method-settings",
47
+ payouts: "stripe-connect-payouts",
48
+ "payouts-list": "stripe-connect-payouts-list",
49
+ balances: "stripe-connect-balances",
67
50
  "account-management": "stripe-connect-account-management",
68
51
  "notification-banner": "stripe-connect-notification-banner",
69
- "instant-payouts": "stripe-connect-instant-payouts",
70
- "issuing-card": "stripe-connect-issuing-card",
71
- "issuing-cards-list": "stripe-connect-issuing-cards-list",
72
- "financial-account": "stripe-connect-financial-account",
73
- "financial-account-transactions": "stripe-connect-financial-account-transactions",
74
- "capital-overview": "stripe-connect-capital-overview",
75
52
  documents: "stripe-connect-documents",
76
53
  "tax-registrations": "stripe-connect-tax-registrations",
77
- "tax-settings": "stripe-connect-tax-settings",
78
- balances: "stripe-connect-balances",
79
- "payouts-list": "stripe-connect-payouts-list",
80
- "app-install": "stripe-connect-app-install",
81
- "app-viewport": "stripe-connect-app-viewport"
54
+ "tax-settings": "stripe-connect-tax-settings"
82
55
  };
83
56
  const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
84
57
  const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
85
58
  const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
86
59
  const findScript = () => {
87
- return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || null;
60
+ return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
88
61
  };
89
62
  const injectScript = () => {
90
63
  const script = document.createElement("script");
@@ -221,7 +194,7 @@ const createWrapper = stripeConnect => {
221
194
  sdk: true,
222
195
  sdkOptions: {
223
196
  // This will be replaced by the npm package version when bundling
224
- sdkVersion: "3.3.14-beta-1"
197
+ sdkVersion: "3.3.15"
225
198
  }
226
199
  })
227
200
  }));
@@ -1,6 +1,6 @@
1
1
  import { IStripeConnectInitParams, StripeConnectInstance, ConnectElementTagName } from "../types";
2
2
  export type LoadConnectAndInitialize = (initParams: IStripeConnectInitParams) => StripeConnectInstance;
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";
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" | "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,11 +1,3 @@
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";
@@ -14,10 +6,6 @@ export type NotificationCount = {
14
6
  total: number;
15
7
  actionRequired: number;
16
8
  };
17
- export type InstallState = {
18
- appId: string;
19
- state: "INSTALLED" | "UNINSTALLED";
20
- };
21
9
  export type LoaderStart = {
22
10
  elementTagName: string;
23
11
  };
@@ -25,6 +13,9 @@ export type LoadError = {
25
13
  elementTagName: string;
26
14
  error: EmbeddedError;
27
15
  };
16
+ export type StepChange = {
17
+ step: string;
18
+ };
28
19
  export type EmbeddedError = {
29
20
  type: EmbeddedErrorType;
30
21
  message?: string;
@@ -59,10 +50,6 @@ export declare const ConnectElementCommonMethodConfig: {
59
50
  setOnLoaderStart: (_listener: (({ elementTagName }: LoaderStart) => void) | undefined) => void;
60
51
  };
61
52
  export declare const ConnectElementCustomMethodConfig: {
62
- "payment-details": {
63
- setPayment: (_payment: string | undefined) => void;
64
- setOnClose: (_listener: (() => void) | undefined) => void;
65
- };
66
53
  "account-onboarding": {
67
54
  setFullTermsOfServiceUrl: (_termOfServiceUrl: string | undefined) => void;
68
55
  setRecipientTermsOfServiceUrl: (_recipientTermsOfServiceUrl: string | undefined) => void;
@@ -70,6 +57,7 @@ export declare const ConnectElementCustomMethodConfig: {
70
57
  setSkipTermsOfServiceCollection: (_skipTermsOfServiceCollection: boolean | undefined) => void;
71
58
  setCollectionOptions: (_collectionOptions: CollectionOptions | undefined) => void;
72
59
  setOnExit: (_listener: (() => void) | undefined) => void;
60
+ setOnStepChange: (_listener: (({ step }: StepChange) => void) | undefined) => void;
73
61
  };
74
62
  "account-management": {
75
63
  setCollectionOptions: (_collectionOptions: CollectionOptions | undefined) => void;
@@ -78,32 +66,21 @@ export declare const ConnectElementCustomMethodConfig: {
78
66
  setCollectionOptions: (_collectionOptions: CollectionOptions | undefined) => void;
79
67
  setOnNotificationsChange: (_listener: (({ total, actionRequired }: NotificationCount) => void) | undefined) => void;
80
68
  };
81
- "issuing-card": {
82
- setDefaultCard: (_defaultCard: string | undefined) => void;
83
- setCardArtFileLink: (_cardArtFileLink: string | undefined) => void;
84
- setCardSwitching: (_cardSwitching: boolean | undefined) => void;
85
- setFetchEphemeralKey: (_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined) => void;
86
- };
87
- "issuing-cards-list": {
88
- setCardArtFileLink: (_cardArtFileLink: string | undefined) => void;
89
- setFetchEphemeralKey: (_fetchEphemeralKey: FetchEphemeralKeyFunction | undefined) => void;
90
- };
91
- "financial-account": {
92
- setFinancialAccount: (_financialAccount: string) => void;
93
- };
94
- "financial-account-transactions": {
95
- setFinancialAccount: (_financialAccount: string) => void;
96
- };
97
- "app-install": {
98
- setApp: (_app: string | undefined) => void;
99
- setOnAppInstallStateFetched: (_listener: (({ appId, state }: InstallState) => void) | undefined) => void;
100
- setOnAppInstallStateChanged: (_listener: (({ appId, state }: InstallState) => void) | undefined) => void;
69
+ "payment-details": {
70
+ setPayment: (_payment: string | undefined) => void;
71
+ setOnClose: (_listener: (() => void) | undefined) => void;
101
72
  };
102
- "app-viewport": {
103
- setApp: (_app: string | undefined) => void;
104
- setAppData: (_appData: Record<string, string> | undefined) => void;
73
+ "tax-settings": {
74
+ setHideProductTaxCodeSelector: (_hidden: boolean | undefined) => void;
75
+ setDisplayHeadOfficeCountries: (_countries: string[] | undefined) => void;
76
+ setOnTaxSettingsUpdated: (_listener: (({ id }: {
77
+ id: string;
78
+ }) => void) | undefined) => void;
105
79
  };
106
- "payment-method-settings": {
107
- setPaymentMethodConfiguration: (_paymentMethodConfiguration: string | undefined) => void;
80
+ "tax-registrations": {
81
+ setOnAfterTaxRegistrationAdded: (_listener: (({ id }: {
82
+ id: string;
83
+ }) => void) | undefined) => void;
84
+ setDisplayCountries: (_countries: string[] | undefined) => void;
108
85
  };
109
86
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/connect-js",
3
- "version": "3.3.15-beta-1",
3
+ "version": "3.3.15",
4
4
  "description": "Connect.js loading utility package",
5
5
  "main": "dist/connect.js",
6
6
  "module": "dist/connect.esm.js",
@@ -59,7 +59,7 @@
59
59
  "jest-environment-jsdom": "^29.5.0",
60
60
  "prettier": "^1.19.1",
61
61
  "rimraf": "^2.6.2",
62
- "rollup": "^1.29.0",
62
+ "rollup": "^2.79.2",
63
63
  "rollup-plugin-babel": "^4.4.0",
64
64
  "rollup-plugin-typescript2": "^0.25.3",
65
65
  "ts-jest": "^29.1.0",
package/src/shared.ts CHANGED
@@ -13,53 +13,34 @@ export type LoadConnectAndInitialize = (
13
13
  initParams: IStripeConnectInitParams
14
14
  ) => StripeConnectInstance;
15
15
 
16
- export type ConnectElementHTMLName =
16
+ type ConnectElementHTMLName =
17
+ | "stripe-connect-account-onboarding"
17
18
  | "stripe-connect-payments"
18
- | "stripe-connect-payouts"
19
19
  | "stripe-connect-payment-details"
20
- | "stripe-connect-account-onboarding"
21
- | "stripe-connect-payment-method-settings"
22
20
  | "stripe-connect-account-management"
23
21
  | "stripe-connect-notification-banner"
24
- | "stripe-connect-instant-payouts"
25
- | "stripe-connect-issuing-card"
26
- | "stripe-connect-issuing-cards-list"
27
- | "stripe-connect-financial-account"
28
- | "stripe-connect-financial-account-transactions"
29
- | "stripe-connect-capital-overview"
22
+ | "stripe-connect-payouts"
23
+ | "stripe-connect-payouts-list"
24
+ | "stripe-connect-balances"
30
25
  | "stripe-connect-documents"
31
26
  | "stripe-connect-tax-registrations"
32
- | "stripe-connect-tax-settings"
33
- | "stripe-connect-balances"
34
- | "stripe-connect-payouts-list"
35
- | "stripe-connect-app-install"
36
- | "stripe-connect-app-viewport";
27
+ | "stripe-connect-tax-settings";
37
28
 
38
29
  export const componentNameMapping: Record<
39
30
  ConnectElementTagName,
40
31
  ConnectElementHTMLName
41
32
  > = {
33
+ "account-onboarding": "stripe-connect-account-onboarding",
42
34
  payments: "stripe-connect-payments",
43
- payouts: "stripe-connect-payouts",
44
35
  "payment-details": "stripe-connect-payment-details",
45
- "account-onboarding": "stripe-connect-account-onboarding",
46
- "payment-method-settings": "stripe-connect-payment-method-settings",
36
+ payouts: "stripe-connect-payouts",
37
+ "payouts-list": "stripe-connect-payouts-list",
38
+ balances: "stripe-connect-balances",
47
39
  "account-management": "stripe-connect-account-management",
48
40
  "notification-banner": "stripe-connect-notification-banner",
49
- "instant-payouts": "stripe-connect-instant-payouts",
50
- "issuing-card": "stripe-connect-issuing-card",
51
- "issuing-cards-list": "stripe-connect-issuing-cards-list",
52
- "financial-account": "stripe-connect-financial-account",
53
- "financial-account-transactions":
54
- "stripe-connect-financial-account-transactions",
55
- "capital-overview": "stripe-connect-capital-overview",
56
41
  documents: "stripe-connect-documents",
57
42
  "tax-registrations": "stripe-connect-tax-registrations",
58
- "tax-settings": "stripe-connect-tax-settings",
59
- balances: "stripe-connect-balances",
60
- "payouts-list": "stripe-connect-payouts-list",
61
- "app-install": "stripe-connect-app-install",
62
- "app-viewport": "stripe-connect-app-viewport"
43
+ "tax-settings": "stripe-connect-tax-settings"
63
44
  };
64
45
 
65
46
  type StripeConnectInstanceExtended = StripeConnectInstance & {
@@ -78,10 +59,10 @@ const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
78
59
  export const findScript = (): HTMLScriptElement | null => {
79
60
  return (
80
61
  document.querySelectorAll<HTMLScriptElement>(
81
- `script[src="${V0_URL}"]`
62
+ `script[src="${V1_URL}"]`
82
63
  )[0] ||
83
64
  document.querySelectorAll<HTMLScriptElement>(
84
- `script[src="${V1_URL}"]`
65
+ `script[src="${V0_URL}"]`
85
66
  )[0] ||
86
67
  null
87
68
  );
package/types/config.ts CHANGED
@@ -1,15 +1,6 @@
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";
@@ -20,11 +11,6 @@ export type NotificationCount = {
20
11
  actionRequired: number;
21
12
  };
22
13
 
23
- export type InstallState = {
24
- appId: string;
25
- state: "INSTALLED" | "UNINSTALLED";
26
- };
27
-
28
14
  export type LoaderStart = {
29
15
  elementTagName: string;
30
16
  };
@@ -34,6 +20,10 @@ export type LoadError = {
34
20
  error: EmbeddedError;
35
21
  };
36
22
 
23
+ export type StepChange = {
24
+ step: string;
25
+ };
26
+
37
27
  export type EmbeddedError = {
38
28
  type: EmbeddedErrorType;
39
29
  message?: string;
@@ -75,10 +65,6 @@ export const ConnectElementCommonMethodConfig = {
75
65
  };
76
66
 
77
67
  export const ConnectElementCustomMethodConfig = {
78
- "payment-details": {
79
- setPayment: (_payment: string | undefined): void => {},
80
- setOnClose: (_listener: (() => void) | undefined): void => {}
81
- },
82
68
  "account-onboarding": {
83
69
  setFullTermsOfServiceUrl: (
84
70
  _termOfServiceUrl: string | undefined
@@ -93,7 +79,10 @@ export const ConnectElementCustomMethodConfig = {
93
79
  setCollectionOptions: (
94
80
  _collectionOptions: CollectionOptions | undefined
95
81
  ): void => {},
96
- setOnExit: (_listener: (() => void) | undefined): void => {}
82
+ setOnExit: (_listener: (() => void) | undefined): void => {},
83
+ setOnStepChange: (
84
+ _listener: (({ step }: StepChange) => void) | undefined
85
+ ): void => {}
97
86
  },
98
87
  "account-management": {
99
88
  setCollectionOptions: (
@@ -110,42 +99,23 @@ export const ConnectElementCustomMethodConfig = {
110
99
  | undefined
111
100
  ): void => {}
112
101
  },
113
- "issuing-card": {
114
- setDefaultCard: (_defaultCard: string | undefined): void => {},
115
- setCardArtFileLink: (_cardArtFileLink: string | undefined): void => {},
116
- setCardSwitching: (_cardSwitching: boolean | undefined): void => {},
117
- setFetchEphemeralKey: (
118
- _fetchEphemeralKey: FetchEphemeralKeyFunction | undefined
119
- ): void => {}
120
- },
121
- "issuing-cards-list": {
122
- setCardArtFileLink: (_cardArtFileLink: string | undefined): void => {},
123
- setFetchEphemeralKey: (
124
- _fetchEphemeralKey: FetchEphemeralKeyFunction | undefined
125
- ): void => {}
126
- },
127
- "financial-account": {
128
- setFinancialAccount: (_financialAccount: string): void => {}
129
- },
130
- "financial-account-transactions": {
131
- setFinancialAccount: (_financialAccount: string): void => {}
102
+ "payment-details": {
103
+ setPayment: (_payment: string | undefined): void => {},
104
+ setOnClose: (_listener: (() => void) | undefined): void => {}
132
105
  },
133
- "app-install": {
134
- setApp: (_app: string | undefined): void => {},
135
- setOnAppInstallStateFetched: (
136
- _listener: (({ appId, state }: InstallState) => void) | undefined
106
+ "tax-settings": {
107
+ setHideProductTaxCodeSelector: (_hidden: boolean | undefined): void => {},
108
+ setDisplayHeadOfficeCountries: (
109
+ _countries: string[] | undefined
137
110
  ): void => {},
138
- setOnAppInstallStateChanged: (
139
- _listener: (({ appId, state }: InstallState) => void) | undefined
111
+ setOnTaxSettingsUpdated: (
112
+ _listener: (({ id }: { id: string }) => void) | undefined
140
113
  ): void => {}
141
114
  },
142
- "app-viewport": {
143
- setApp: (_app: string | undefined): void => {},
144
- setAppData: (_appData: Record<string, string> | undefined): void => {}
145
- },
146
- "payment-method-settings": {
147
- setPaymentMethodConfiguration: (
148
- _paymentMethodConfiguration: string | undefined
149
- ): void => {}
115
+ "tax-registrations": {
116
+ setOnAfterTaxRegistrationAdded: (
117
+ _listener: (({ id }: { id: string }) => void) | undefined
118
+ ): void => {},
119
+ setDisplayCountries: (_countries: string[] | undefined): void => {}
150
120
  }
151
121
  };
package/types/shared.d.ts CHANGED
@@ -2,6 +2,7 @@ import {
2
2
  ConnectElementCustomMethodConfig,
3
3
  ConnectElementCommonMethodConfig
4
4
  } from "./config";
5
+
5
6
  export declare type LoadConnectAndInitialize = (
6
7
  initParams: IStripeConnectInitParams
7
8
  ) => StripeConnectInstance;
@@ -150,10 +151,42 @@ export declare type AppearanceVariables = {
150
151
  * The color used for primary actions and links. This accepts hex values or RGB/HSL strings.
151
152
  */
152
153
  actionPrimaryColorText?: string;
154
+ /**
155
+ * The line type used for text decoration of primary actions and links. This accepts a valid text decoration line value.
156
+ */
157
+ actionPrimaryTextDecorationLine?: string;
158
+ /**
159
+ * The color used for text decoration of primary actions and links. This accepts hex values or RGB/HSL strings.
160
+ */
161
+ actionPrimaryTextDecorationColor?: string;
162
+ /**
163
+ * The style of text decoration of primary actions and links. This accepts a valid text decoration style value.
164
+ */
165
+ actionPrimaryTextDecorationStyle?: string;
166
+ /**
167
+ * The thickness of text decoration of primary actions and links. This accepts a valid text decoration thickness value.
168
+ */
169
+ actionPrimaryTextDecorationThickness?: string;
153
170
  /**
154
171
  * The color used for secondary actions and links. This accepts hex values or RGB/HSL strings.
155
172
  */
156
173
  actionSecondaryColorText?: string;
174
+ /**
175
+ * The line type used for text decoration of secondary actions and links. This accepts a valid text decoration line value.
176
+ */
177
+ actionSecondaryTextDecorationLine?: string;
178
+ /**
179
+ * The color used for text decoration of secondary actions and links. This accepts hex values or RGB/HSL strings.
180
+ */
181
+ actionSecondaryTextDecorationColor?: string;
182
+ /**
183
+ * The style of text decoration of secondary actions and links. This accepts a valid text decoration style value.
184
+ */
185
+ actionSecondaryTextDecorationStyle?: string;
186
+ /**
187
+ * The thickness of text decoration of secondary actions and links. This accepts a valid text decoration thickness value.
188
+ */
189
+ actionSecondaryTextDecorationThickness?: string;
157
190
 
158
191
  // Neutral Badge Colors
159
192
  /**
@@ -261,6 +294,10 @@ export declare type AppearanceVariables = {
261
294
  * A z-index to use for the overlay throughout embedded components. Set this number to control the z-order of the overlay.
262
295
  */
263
296
  overlayZIndex?: number;
297
+ /**
298
+ * The backdrop color when an overlay is opened. This accepts hex values or RGB/RGBA/HSL strings.
299
+ */
300
+ overlayBackdropColor?: string;
264
301
 
265
302
  // Body Typography
266
303
  /**
@@ -451,23 +488,14 @@ export interface StripeConnectInstance {
451
488
  * Tagnames to be used with the `create` method of the Connect instance.
452
489
  */
453
490
  export type ConnectElementTagName =
491
+ | "account-onboarding"
454
492
  | "payments"
455
- | "payouts"
456
493
  | "payment-details"
457
- | "account-onboarding"
458
- | "payment-method-settings"
459
494
  | "account-management"
460
495
  | "notification-banner"
461
- | "instant-payouts"
462
- | "issuing-card"
463
- | "issuing-cards-list"
464
- | "financial-account"
465
- | "financial-account-transactions"
466
- | "capital-overview"
496
+ | "payouts"
497
+ | "payouts-list"
498
+ | "balances"
467
499
  | "documents"
468
500
  | "tax-registrations"
469
- | "tax-settings"
470
- | "balances"
471
- | "payouts-list"
472
- | "app-install"
473
- | "app-viewport";
501
+ | "tax-settings";