@stripe/connect-js 3.4.1-preview-1 → 3.4.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.
@@ -1,4 +1,4 @@
1
- export declare const connectElementTagNames: readonly ["payments", "payouts", "payment-details", "payment-disputes", "disputes-list", "account-onboarding", "payment-method-settings", "account-management", "notification-banner", "instant-payouts", "instant-payouts-promotion", "issuing-card", "issuing-cards-list", "financial-account", "financial-account-transactions", "recipients", "capital-financing", "capital-financing-application", "capital-financing-promotion", "capital-overview", "documents", "product-tax-code-selector", "export-tax-transactions", "tax-registrations", "tax-settings", "tax-threshold-monitoring", "balances", "payouts-list", "payout-details", "app-install", "app-viewport", "reporting-chart", "check-scanning", "agentic-commerce-settings", "terminal-hardware-orders", "terminal-hardware-shop", "network-cost-passthrough-report", "balance-report", "payout-reconciliation-report", "recipients-list", "financial-accounts", "financial-accounts-transactions"];
1
+ export declare const connectElementTagNames: readonly ["account-onboarding", "disputes-list", "payments", "payment-details", "payment-disputes", "payouts", "payouts-list", "payout-details", "balances", "account-management", "notification-banner", "instant-payouts-promotion", "issuing-card", "issuing-cards-list", "financial-account", "financial-account-transactions", "documents", "tax-registrations", "tax-settings", "balance-report", "payout-reconciliation-report"];
2
2
  export type FetchEphemeralKeyFunction = (fetchParams: {
3
3
  issuingCard: string;
4
4
  nonce: string;
@@ -48,10 +48,6 @@ export type NotificationCount = {
48
48
  total: number;
49
49
  actionRequired: number;
50
50
  };
51
- export type InstallState = {
52
- appId: string;
53
- state: "INSTALLED" | "UNINSTALLED";
54
- };
55
51
  export type LoaderStart = {
56
52
  elementTagName: string;
57
53
  };
@@ -66,14 +62,6 @@ export type EmbeddedError = {
66
62
  type: EmbeddedErrorType;
67
63
  message?: string;
68
64
  };
69
- export type FinancingProductType = {
70
- productType: "standard" | "refill" | "none";
71
- activeFinancingCount: number;
72
- };
73
- export type FinancingPromotionLayoutType = "full" | "banner";
74
- export type IntervalType = "day" | "week" | "month" | "quarter" | "year";
75
- export type ReportName = "gross_volume" | "net_volume";
76
- export type RecipientDataSource = "customers";
77
65
  export type EmbeddedErrorType =
78
66
  /**
79
67
  * Failure to connect to Stripe's API.
@@ -108,19 +96,6 @@ export declare const ConnectElementCommonMethodConfig: {
108
96
  setOnLoaderStart: (_listener: (({ elementTagName }: LoaderStart) => void) | undefined) => void;
109
97
  };
110
98
  export declare const ConnectElementCustomMethodConfig: {
111
- payments: {
112
- setDefaultFilters: (_filters: PaymentsListDefaultFilters | undefined) => void;
113
- };
114
- "payment-details": {
115
- setPayment: (_payment: string | undefined) => void;
116
- setOnClose: (_listener: (() => void) | undefined) => void;
117
- };
118
- "payment-disputes": {
119
- setPayment: (_payment: string | undefined) => void;
120
- setOnDisputesLoaded: (_listener: (({ total }: {
121
- total: number;
122
- }) => void) | undefined) => void;
123
- };
124
99
  "account-onboarding": {
125
100
  setFullTermsOfServiceUrl: (_termOfServiceUrl: string | undefined) => void;
126
101
  setRecipientTermsOfServiceUrl: (_recipientTermsOfServiceUrl: string | undefined) => void;
@@ -162,52 +137,19 @@ export declare const ConnectElementCustomMethodConfig: {
162
137
  "financial-account-transactions": {
163
138
  setFinancialAccount: (_financialAccount: string) => void;
164
139
  };
165
- recipients: {
166
- setDataSource: (_dataSource: RecipientDataSource) => void;
167
- };
168
- "app-install": {
169
- setApp: (_app: string | undefined) => void;
170
- setOnAppInstallStateFetched: (_listener: (({ appId, state }: InstallState) => void) | undefined) => void;
171
- setOnAppInstallStateChanged: (_listener: (({ appId, state }: InstallState) => void) | undefined) => void;
172
- };
173
- "app-viewport": {
174
- setApp: (_app: string | undefined) => void;
175
- setAppData: (_appData: Record<string, string> | undefined) => void;
140
+ payments: {
141
+ setDefaultFilters: (_filters: PaymentsListDefaultFilters | undefined) => void;
176
142
  };
177
- "payment-method-settings": {
178
- setPaymentMethodConfiguration: (_paymentMethodConfiguration: string | undefined) => void;
143
+ "payment-details": {
144
+ setPayment: (_payment: string | undefined) => void;
145
+ setOnClose: (_listener: (() => void) | undefined) => void;
179
146
  };
180
- "capital-financing": {
181
- setDefaultFinancingOffer: (_defaultFinancingOffer: string | undefined) => void;
182
- setShowFinancingSelector: (_showFinancingSelector: boolean | undefined) => void;
183
- setHowCapitalWorksUrl: (_howCapitalWorksUrl: string | undefined) => void;
184
- setSupportUrl: (_supportUrl: string | undefined) => void;
185
- setOnFinancingsLoaded: (_listener: (({ total }: {
147
+ "payment-disputes": {
148
+ setPayment: (_payment: string | undefined) => void;
149
+ setOnDisputesLoaded: (_listener: (({ total }: {
186
150
  total: number;
187
151
  }) => void) | undefined) => void;
188
152
  };
189
- "capital-financing-application": {
190
- setOnApplicationSubmitted: (_listener: (() => void) | undefined) => void;
191
- setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined) => void;
192
- setHowCapitalWorksUrl: (_howCapitalWorksUrl: string | undefined) => void;
193
- setOnApplicationStepChange: (_listener: (({ step }: StepChange) => void) | undefined) => void;
194
- setDefaultFinancingOffer: (_defaultFinancingOffer: string | undefined) => void;
195
- };
196
- "capital-financing-promotion": {
197
- setLayout: (_layout: FinancingPromotionLayoutType | undefined) => void;
198
- setOnApplicationSubmitted: (_listener: (() => void) | undefined) => void;
199
- setOnEligibleFinancingOfferLoaded: (_listener: (({ productType, activeFinancingCount, }: FinancingProductType) => void) | undefined) => void;
200
- setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined) => void;
201
- setHowCapitalWorksUrl: (_howCapitalWorksUrl: string | undefined) => void;
202
- setEligibilityCriteriaUrl: (_eligibilityCriteriaUrl: string | undefined) => void;
203
- setOnApplicationStepChange: (_listener: (({ step }: StepChange) => void) | undefined) => void;
204
- };
205
- "reporting-chart": {
206
- setReportName: (_reportName: ReportName) => void;
207
- setIntervalStart: (_intervalStart: Date | undefined) => void;
208
- setIntervalEnd: (_intervalEnd: Date | undefined) => void;
209
- setIntervalType: (_intervalType: IntervalType | undefined) => void;
210
- };
211
153
  "tax-settings": {
212
154
  setHideProductTaxCodeSelector: (_hidden: boolean | undefined) => void;
213
155
  setDisplayHeadOfficeCountries: (_countries: string[] | undefined) => void;
@@ -224,35 +166,10 @@ export declare const ConnectElementCustomMethodConfig: {
224
166
  id: string;
225
167
  }) => void) | undefined) => void;
226
168
  };
227
- "tax-threshold-monitoring": {
228
- setDisplayCountries: (_countries: string[] | undefined) => void;
229
- };
230
- "product-tax-code-selector": {
231
- setOnTaxCodeSelect: (_listener: ((taxCode: string | null, _: {
232
- analyticsName: string;
233
- } | null) => void) | undefined) => void;
234
- setHideDescription: (_hideDescription: boolean | undefined) => void;
235
- setDisabled: (_disabled: boolean | undefined) => void;
236
- setInitialTaxCode: (_initialTaxCode: string | undefined) => void;
237
- };
238
- "export-tax-transactions": {};
239
169
  "payout-details": {
240
170
  setPayout: (_payout: string | undefined) => void;
241
171
  setOnClose: (_listener: (() => void) | undefined) => void;
242
172
  };
243
- "check-scanning": {
244
- setHandleCheckScanSubmitted: (_handleCheckScanSubmitted: ({ checkScanToken, }: {
245
- checkScanToken: string;
246
- }) => Promise<void>) => void;
247
- };
248
- "agentic-commerce-settings": {
249
- setOnAgreementUpdated: (_listener: (({ agreementId }: {
250
- agreementId: string;
251
- }) => void) | undefined) => void;
252
- };
253
- "terminal-hardware-shop": {
254
- setOnCheckoutFinished: (_listener: (() => void) | undefined) => void;
255
- };
256
173
  "payout-reconciliation-report": {
257
174
  setOnReportAvailabilityLoaded: (_listener: (({ isReportAvailable }: {
258
175
  isReportAvailable: boolean;
@@ -1,22 +1,11 @@
1
1
  /* eslint-disable @typescript-eslint/no-unused-vars */
2
2
  // Source of truth for the entire list of components. When you add a new component, it should be added here.
3
- const connectElementTagNames = ["payments", "payouts", "payment-details", "payment-disputes", "disputes-list", "account-onboarding", "payment-method-settings", "account-management", "notification-banner", "instant-payouts", "instant-payouts-promotion", "issuing-card", "issuing-cards-list", "financial-account", "financial-account-transactions", "recipients", "capital-financing", "capital-financing-application", "capital-financing-promotion", "capital-overview", "documents", "product-tax-code-selector", "export-tax-transactions", "tax-registrations", "tax-settings", "tax-threshold-monitoring", "balances", "payouts-list", "payout-details", "app-install", "app-viewport", "reporting-chart", "check-scanning", "agentic-commerce-settings", "terminal-hardware-orders", "terminal-hardware-shop", "network-cost-passthrough-report", "balance-report", "payout-reconciliation-report", "recipients-list", "financial-accounts", "financial-accounts-transactions"];
3
+ const connectElementTagNames = ["account-onboarding", "disputes-list", "payments", "payment-details", "payment-disputes", "payouts", "payouts-list", "payout-details", "balances", "account-management", "notification-banner", "instant-payouts-promotion", "issuing-card", "issuing-cards-list", "financial-account", "financial-account-transactions", "documents", "tax-registrations", "tax-settings", "balance-report", "payout-reconciliation-report"];
4
4
  const ConnectElementCommonMethodConfig = {
5
5
  setOnLoadError: _listener => {},
6
6
  setOnLoaderStart: _listener => {}
7
7
  };
8
8
  const ConnectElementCustomMethodConfig = {
9
- payments: {
10
- setDefaultFilters: _filters => {}
11
- },
12
- "payment-details": {
13
- setPayment: _payment => {},
14
- setOnClose: _listener => {}
15
- },
16
- "payment-disputes": {
17
- setPayment: _payment => {},
18
- setOnDisputesLoaded: _listener => {}
19
- },
20
9
  "account-onboarding": {
21
10
  setFullTermsOfServiceUrl: _termOfServiceUrl => {},
22
11
  setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
@@ -54,49 +43,16 @@ const ConnectElementCustomMethodConfig = {
54
43
  "financial-account-transactions": {
55
44
  setFinancialAccount: _financialAccount => {}
56
45
  },
57
- recipients: {
58
- setDataSource: _dataSource => {}
59
- },
60
- "app-install": {
61
- setApp: _app => {},
62
- setOnAppInstallStateFetched: _listener => {},
63
- setOnAppInstallStateChanged: _listener => {}
64
- },
65
- "app-viewport": {
66
- setApp: _app => {},
67
- setAppData: _appData => {}
68
- },
69
- "payment-method-settings": {
70
- setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
71
- },
72
- "capital-financing": {
73
- setDefaultFinancingOffer: _defaultFinancingOffer => {},
74
- setShowFinancingSelector: _showFinancingSelector => {},
75
- setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
76
- setSupportUrl: _supportUrl => {},
77
- setOnFinancingsLoaded: _listener => {}
78
- },
79
- "capital-financing-application": {
80
- setOnApplicationSubmitted: _listener => {},
81
- setPrivacyPolicyUrl: _privacyPolicyUrl => {},
82
- setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
83
- setOnApplicationStepChange: _listener => {},
84
- setDefaultFinancingOffer: _defaultFinancingOffer => {}
46
+ payments: {
47
+ setDefaultFilters: _filters => {}
85
48
  },
86
- "capital-financing-promotion": {
87
- setLayout: _layout => {},
88
- setOnApplicationSubmitted: _listener => {},
89
- setOnEligibleFinancingOfferLoaded: _listener => {},
90
- setPrivacyPolicyUrl: _privacyPolicyUrl => {},
91
- setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
92
- setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {},
93
- setOnApplicationStepChange: _listener => {}
49
+ "payment-details": {
50
+ setPayment: _payment => {},
51
+ setOnClose: _listener => {}
94
52
  },
95
- "reporting-chart": {
96
- setReportName: _reportName => {},
97
- setIntervalStart: _intervalStart => {},
98
- setIntervalEnd: _intervalEnd => {},
99
- setIntervalType: _intervalType => {}
53
+ "payment-disputes": {
54
+ setPayment: _payment => {},
55
+ setOnDisputesLoaded: _listener => {}
100
56
  },
101
57
  "tax-settings": {
102
58
  setHideProductTaxCodeSelector: _hidden => {},
@@ -108,29 +64,10 @@ const ConnectElementCustomMethodConfig = {
108
64
  setDisplayCountries: _countries => {},
109
65
  setOnAfterTaxRegistrationExpired: _listener => {}
110
66
  },
111
- "tax-threshold-monitoring": {
112
- setDisplayCountries: _countries => {}
113
- },
114
- "product-tax-code-selector": {
115
- setOnTaxCodeSelect: _listener => {},
116
- setHideDescription: _hideDescription => {},
117
- setDisabled: _disabled => {},
118
- setInitialTaxCode: _initialTaxCode => {}
119
- },
120
- "export-tax-transactions": {},
121
67
  "payout-details": {
122
68
  setPayout: _payout => {},
123
69
  setOnClose: _listener => {}
124
70
  },
125
- "check-scanning": {
126
- setHandleCheckScanSubmitted: _handleCheckScanSubmitted => {}
127
- },
128
- "agentic-commerce-settings": {
129
- setOnAgreementUpdated: _listener => {}
130
- },
131
- "terminal-hardware-shop": {
132
- setOnCheckoutFinished: _listener => {}
133
- },
134
71
  "payout-reconciliation-report": {
135
72
  setOnReportAvailabilityLoaded: _listener => {}
136
73
  }
@@ -157,7 +94,7 @@ const componentNameMapping = connectElementTagNames.reduce((acc, name) => {
157
94
  acc[name] = `stripe-connect-${name}`;
158
95
  return acc;
159
96
  }, {});
160
- let stripePromise = null;
97
+ let stripePromise$1 = null;
161
98
  const isWindowStripeConnectDefined = stripeConnect => {
162
99
  // We only consider `StripeConnect` defined if `init` is a function
163
100
  // Why? HTML markup like:
@@ -167,10 +104,10 @@ const isWindowStripeConnectDefined = stripeConnect => {
167
104
  };
168
105
  const loadScript = () => {
169
106
  // Ensure that we only attempt to load Connect.js at most once
170
- if (stripePromise !== null) {
171
- return stripePromise;
107
+ if (stripePromise$1 !== null) {
108
+ return stripePromise$1;
172
109
  }
173
- stripePromise = new Promise((resolve, reject) => {
110
+ stripePromise$1 = new Promise((resolve, reject) => {
174
111
  if (typeof window === "undefined") {
175
112
  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.");
176
113
  return;
@@ -203,7 +140,7 @@ const loadScript = () => {
203
140
  reject(error);
204
141
  }
205
142
  });
206
- return stripePromise;
143
+ return stripePromise$1;
207
144
  };
208
145
  const hasCustomMethod = tagName => {
209
146
  return tagName in ConnectElementCustomMethodConfig;
@@ -236,7 +173,7 @@ const initStripeConnect = (stripePromise, initParams) => {
236
173
  element[method] = function (value) {
237
174
  stripeConnectInstance.then(() => {
238
175
  if (!this[`${method}InternalOnly`]) {
239
- throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.4.1-preview-1`);
176
+ throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.4.1`);
240
177
  }
241
178
  this[`${method}InternalOnly`](value);
242
179
  });
@@ -290,7 +227,7 @@ const createWrapper = stripeConnect => {
290
227
  sdk: true,
291
228
  sdkOptions: {
292
229
  // This will be replaced by the npm package version when bundling
293
- sdkVersion: "3.4.1-preview-1"
230
+ sdkVersion: "3.4.1"
294
231
  }
295
232
  })
296
233
  }));
@@ -302,16 +239,16 @@ const createWrapper = stripeConnect => {
302
239
 
303
240
  // Execute our own script injection after a tick to give users time to do their
304
241
  // own script injection.
305
- const stripePromise$1 = Promise.resolve().then(() => loadScript());
242
+ const stripePromise = Promise.resolve().then(() => loadScript());
306
243
  let loadCalled = false;
307
- stripePromise$1.catch(err => {
244
+ stripePromise.catch(err => {
308
245
  if (!loadCalled) {
309
246
  console.warn(err);
310
247
  }
311
248
  });
312
249
  const loadConnectAndInitialize = initParams => {
313
250
  loadCalled = true;
314
- return initStripeConnect(stripePromise$1, initParams);
251
+ return initStripeConnect(stripePromise, initParams);
315
252
  };
316
253
 
317
254
  export { ConnectElementCommonMethodConfig, ConnectElementCustomMethodConfig, connectElementTagNames, loadConnectAndInitialize };
package/dist/connect.js CHANGED
@@ -4,23 +4,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  /* eslint-disable @typescript-eslint/no-unused-vars */
6
6
  // Source of truth for the entire list of components. When you add a new component, it should be added here.
7
- const connectElementTagNames = ["payments", "payouts", "payment-details", "payment-disputes", "disputes-list", "account-onboarding", "payment-method-settings", "account-management", "notification-banner", "instant-payouts", "instant-payouts-promotion", "issuing-card", "issuing-cards-list", "financial-account", "financial-account-transactions", "recipients", "capital-financing", "capital-financing-application", "capital-financing-promotion", "capital-overview", "documents", "product-tax-code-selector", "export-tax-transactions", "tax-registrations", "tax-settings", "tax-threshold-monitoring", "balances", "payouts-list", "payout-details", "app-install", "app-viewport", "reporting-chart", "check-scanning", "agentic-commerce-settings", "terminal-hardware-orders", "terminal-hardware-shop", "network-cost-passthrough-report", "balance-report", "payout-reconciliation-report", "recipients-list", "financial-accounts", "financial-accounts-transactions"];
7
+ const connectElementTagNames = ["account-onboarding", "disputes-list", "payments", "payment-details", "payment-disputes", "payouts", "payouts-list", "payout-details", "balances", "account-management", "notification-banner", "instant-payouts-promotion", "issuing-card", "issuing-cards-list", "financial-account", "financial-account-transactions", "documents", "tax-registrations", "tax-settings", "balance-report", "payout-reconciliation-report"];
8
8
  const ConnectElementCommonMethodConfig = {
9
9
  setOnLoadError: _listener => {},
10
10
  setOnLoaderStart: _listener => {}
11
11
  };
12
12
  const ConnectElementCustomMethodConfig = {
13
- payments: {
14
- setDefaultFilters: _filters => {}
15
- },
16
- "payment-details": {
17
- setPayment: _payment => {},
18
- setOnClose: _listener => {}
19
- },
20
- "payment-disputes": {
21
- setPayment: _payment => {},
22
- setOnDisputesLoaded: _listener => {}
23
- },
24
13
  "account-onboarding": {
25
14
  setFullTermsOfServiceUrl: _termOfServiceUrl => {},
26
15
  setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
@@ -58,49 +47,16 @@ const ConnectElementCustomMethodConfig = {
58
47
  "financial-account-transactions": {
59
48
  setFinancialAccount: _financialAccount => {}
60
49
  },
61
- recipients: {
62
- setDataSource: _dataSource => {}
63
- },
64
- "app-install": {
65
- setApp: _app => {},
66
- setOnAppInstallStateFetched: _listener => {},
67
- setOnAppInstallStateChanged: _listener => {}
68
- },
69
- "app-viewport": {
70
- setApp: _app => {},
71
- setAppData: _appData => {}
72
- },
73
- "payment-method-settings": {
74
- setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
75
- },
76
- "capital-financing": {
77
- setDefaultFinancingOffer: _defaultFinancingOffer => {},
78
- setShowFinancingSelector: _showFinancingSelector => {},
79
- setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
80
- setSupportUrl: _supportUrl => {},
81
- setOnFinancingsLoaded: _listener => {}
82
- },
83
- "capital-financing-application": {
84
- setOnApplicationSubmitted: _listener => {},
85
- setPrivacyPolicyUrl: _privacyPolicyUrl => {},
86
- setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
87
- setOnApplicationStepChange: _listener => {},
88
- setDefaultFinancingOffer: _defaultFinancingOffer => {}
50
+ payments: {
51
+ setDefaultFilters: _filters => {}
89
52
  },
90
- "capital-financing-promotion": {
91
- setLayout: _layout => {},
92
- setOnApplicationSubmitted: _listener => {},
93
- setOnEligibleFinancingOfferLoaded: _listener => {},
94
- setPrivacyPolicyUrl: _privacyPolicyUrl => {},
95
- setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
96
- setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {},
97
- setOnApplicationStepChange: _listener => {}
53
+ "payment-details": {
54
+ setPayment: _payment => {},
55
+ setOnClose: _listener => {}
98
56
  },
99
- "reporting-chart": {
100
- setReportName: _reportName => {},
101
- setIntervalStart: _intervalStart => {},
102
- setIntervalEnd: _intervalEnd => {},
103
- setIntervalType: _intervalType => {}
57
+ "payment-disputes": {
58
+ setPayment: _payment => {},
59
+ setOnDisputesLoaded: _listener => {}
104
60
  },
105
61
  "tax-settings": {
106
62
  setHideProductTaxCodeSelector: _hidden => {},
@@ -112,29 +68,10 @@ const ConnectElementCustomMethodConfig = {
112
68
  setDisplayCountries: _countries => {},
113
69
  setOnAfterTaxRegistrationExpired: _listener => {}
114
70
  },
115
- "tax-threshold-monitoring": {
116
- setDisplayCountries: _countries => {}
117
- },
118
- "product-tax-code-selector": {
119
- setOnTaxCodeSelect: _listener => {},
120
- setHideDescription: _hideDescription => {},
121
- setDisabled: _disabled => {},
122
- setInitialTaxCode: _initialTaxCode => {}
123
- },
124
- "export-tax-transactions": {},
125
71
  "payout-details": {
126
72
  setPayout: _payout => {},
127
73
  setOnClose: _listener => {}
128
74
  },
129
- "check-scanning": {
130
- setHandleCheckScanSubmitted: _handleCheckScanSubmitted => {}
131
- },
132
- "agentic-commerce-settings": {
133
- setOnAgreementUpdated: _listener => {}
134
- },
135
- "terminal-hardware-shop": {
136
- setOnCheckoutFinished: _listener => {}
137
- },
138
75
  "payout-reconciliation-report": {
139
76
  setOnReportAvailabilityLoaded: _listener => {}
140
77
  }
@@ -161,7 +98,7 @@ const componentNameMapping = connectElementTagNames.reduce((acc, name) => {
161
98
  acc[name] = `stripe-connect-${name}`;
162
99
  return acc;
163
100
  }, {});
164
- let stripePromise = null;
101
+ let stripePromise$1 = null;
165
102
  const isWindowStripeConnectDefined = stripeConnect => {
166
103
  // We only consider `StripeConnect` defined if `init` is a function
167
104
  // Why? HTML markup like:
@@ -171,10 +108,10 @@ const isWindowStripeConnectDefined = stripeConnect => {
171
108
  };
172
109
  const loadScript = () => {
173
110
  // Ensure that we only attempt to load Connect.js at most once
174
- if (stripePromise !== null) {
175
- return stripePromise;
111
+ if (stripePromise$1 !== null) {
112
+ return stripePromise$1;
176
113
  }
177
- stripePromise = new Promise((resolve, reject) => {
114
+ stripePromise$1 = new Promise((resolve, reject) => {
178
115
  if (typeof window === "undefined") {
179
116
  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.");
180
117
  return;
@@ -207,7 +144,7 @@ const loadScript = () => {
207
144
  reject(error);
208
145
  }
209
146
  });
210
- return stripePromise;
147
+ return stripePromise$1;
211
148
  };
212
149
  const hasCustomMethod = tagName => {
213
150
  return tagName in ConnectElementCustomMethodConfig;
@@ -240,7 +177,7 @@ const initStripeConnect = (stripePromise, initParams) => {
240
177
  element[method] = function (value) {
241
178
  stripeConnectInstance.then(() => {
242
179
  if (!this[`${method}InternalOnly`]) {
243
- throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.4.1-preview-1`);
180
+ throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.4.1`);
244
181
  }
245
182
  this[`${method}InternalOnly`](value);
246
183
  });
@@ -294,7 +231,7 @@ const createWrapper = stripeConnect => {
294
231
  sdk: true,
295
232
  sdkOptions: {
296
233
  // This will be replaced by the npm package version when bundling
297
- sdkVersion: "3.4.1-preview-1"
234
+ sdkVersion: "3.4.1"
298
235
  }
299
236
  })
300
237
  }));
@@ -306,16 +243,16 @@ const createWrapper = stripeConnect => {
306
243
 
307
244
  // Execute our own script injection after a tick to give users time to do their
308
245
  // own script injection.
309
- const stripePromise$1 = Promise.resolve().then(() => loadScript());
246
+ const stripePromise = Promise.resolve().then(() => loadScript());
310
247
  let loadCalled = false;
311
- stripePromise$1.catch(err => {
248
+ stripePromise.catch(err => {
312
249
  if (!loadCalled) {
313
250
  console.warn(err);
314
251
  }
315
252
  });
316
253
  const loadConnectAndInitialize = initParams => {
317
254
  loadCalled = true;
318
- return initStripeConnect(stripePromise$1, initParams);
255
+ return initStripeConnect(stripePromise, initParams);
319
256
  };
320
257
 
321
258
  exports.ConnectElementCommonMethodConfig = ConnectElementCommonMethodConfig;
@@ -1,4 +1,4 @@
1
- import type { ConnectElementCommonMethodConfig, ConnectElementCustomMethodConfig, connectElementTagNames, EmbeddedError, EmbeddedErrorType } from "../components/componentsAndSetters";
1
+ import type { ConnectElementCommonMethodConfig, ConnectElementCustomMethodConfig, connectElementTagNames } from "../components/componentsAndSetters";
2
2
  export type LoadConnectAndInitialize = (initParams: IStripeConnectInitParams) => StripeConnectInstance;
3
3
  export interface StripeConnectWrapper {
4
4
  initialize: (params: IStripeConnectInitParams) => StripeConnectInstance;
@@ -431,68 +431,6 @@ export type IStripeConnectUpdateParams = {
431
431
  */
432
432
  locale?: string;
433
433
  };
434
- /**
435
- * Reasons why risk signals collection was skipped.
436
- */
437
- export type RiskSignalsCollectionSkippedReason =
438
- /**
439
- * Required component (account_onboarding) not enabled.
440
- */
441
- "required_component_not_enabled"
442
- /**
443
- * The account doesn't have a risk signals collection requirement.
444
- */
445
- | "not_required"
446
- /**
447
- * The risk signals collection requirement has already been fulfilled.
448
- */
449
- | "requirement_fulfilled";
450
- /**
451
- * Error types that can occur during risk signals collection.
452
- */
453
- export type RiskSignalsCollectionErrorType = Extract<EmbeddedErrorType, "api_connection_error" | "invalid_request_error" | "rate_limit_error" | "api_error">;
454
- /**
455
- * Errors that can occur during risk signals collection.
456
- */
457
- export type RiskSignalsCollectionError =
458
- /**
459
- * Error occurred during general Connect.js loading.
460
- */
461
- {
462
- type: "load_error";
463
- loadError: EmbeddedError;
464
- }
465
- /**
466
- * Error occurred during risk signals collection.
467
- */
468
- | {
469
- type: RiskSignalsCollectionErrorType;
470
- message?: string;
471
- };
472
- /**
473
- * Event emitted during risk signals collection.
474
- */
475
- export declare type RiskSignalsCollectionEvent =
476
- /**
477
- * Risk signals collection completed and successfully received by Stripe.
478
- */
479
- {
480
- status: "completed";
481
- }
482
- /**
483
- * Risk signals collection skipped with reason.
484
- */
485
- | {
486
- status: "skipped";
487
- skippedReason: RiskSignalsCollectionSkippedReason;
488
- }
489
- /**
490
- * Risk signals collection failed due to error and was not sent to Stripe server.
491
- */
492
- | {
493
- status: "failed";
494
- error: RiskSignalsCollectionError;
495
- };
496
434
  /**
497
435
  * Initialization parameters for Connect JS. See https://stripe.com/docs/connect/get-started-connect-embedded-components#configuring-connect-js for more details.
498
436
  */
@@ -519,11 +457,6 @@ export interface IStripeConnectInitParams {
519
457
  * An array of custom fonts, which embedded components created from a ConnectInstance can use.
520
458
  */
521
459
  fonts?: Array<CssFontSource | CustomFontSource>;
522
- /**
523
- * Callback for risk signals collection event
524
- * @param {RiskSignalsCollectionEvent} event - The risk signals collection event containing status and additional details.
525
- */
526
- onRiskSignalsCollection?: (event: RiskSignalsCollectionEvent) => void;
527
460
  }
528
461
  type ConnectElementCustomMethods = typeof ConnectElementCustomMethodConfig;
529
462
  type ConnectElementCommonMethods = typeof ConnectElementCommonMethodConfig;
package/dist/init.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { ConnectElementTagName, IStripeConnectInitParams, StripeConnectInstance, StripeConnectWrapper } from "./exportedTypes/shared";
2
2
  export type ConnectElementHTMLName = `stripe-connect-${ConnectElementTagName}`;
3
- export declare const componentNameMapping: Record<"payments" | "payouts" | "payment-details" | "payment-disputes" | "disputes-list" | "account-onboarding" | "payment-method-settings" | "account-management" | "notification-banner" | "instant-payouts" | "instant-payouts-promotion" | "issuing-card" | "issuing-cards-list" | "financial-account" | "financial-account-transactions" | "recipients" | "capital-financing" | "capital-financing-application" | "capital-financing-promotion" | "capital-overview" | "documents" | "product-tax-code-selector" | "export-tax-transactions" | "tax-registrations" | "tax-settings" | "tax-threshold-monitoring" | "balances" | "payouts-list" | "payout-details" | "app-install" | "app-viewport" | "reporting-chart" | "check-scanning" | "agentic-commerce-settings" | "terminal-hardware-orders" | "terminal-hardware-shop" | "network-cost-passthrough-report" | "balance-report" | "payout-reconciliation-report" | "recipients-list" | "financial-accounts" | "financial-accounts-transactions", "stripe-connect-payments" | "stripe-connect-payouts" | "stripe-connect-payment-details" | "stripe-connect-payment-disputes" | "stripe-connect-disputes-list" | "stripe-connect-account-onboarding" | "stripe-connect-payment-method-settings" | "stripe-connect-account-management" | "stripe-connect-notification-banner" | "stripe-connect-instant-payouts" | "stripe-connect-instant-payouts-promotion" | "stripe-connect-issuing-card" | "stripe-connect-issuing-cards-list" | "stripe-connect-financial-account" | "stripe-connect-financial-account-transactions" | "stripe-connect-recipients" | "stripe-connect-capital-financing" | "stripe-connect-capital-financing-application" | "stripe-connect-capital-financing-promotion" | "stripe-connect-capital-overview" | "stripe-connect-documents" | "stripe-connect-product-tax-code-selector" | "stripe-connect-export-tax-transactions" | "stripe-connect-tax-registrations" | "stripe-connect-tax-settings" | "stripe-connect-tax-threshold-monitoring" | "stripe-connect-balances" | "stripe-connect-payouts-list" | "stripe-connect-payout-details" | "stripe-connect-app-install" | "stripe-connect-app-viewport" | "stripe-connect-reporting-chart" | "stripe-connect-check-scanning" | "stripe-connect-agentic-commerce-settings" | "stripe-connect-terminal-hardware-orders" | "stripe-connect-terminal-hardware-shop" | "stripe-connect-network-cost-passthrough-report" | "stripe-connect-balance-report" | "stripe-connect-payout-reconciliation-report" | "stripe-connect-recipients-list" | "stripe-connect-financial-accounts" | "stripe-connect-financial-accounts-transactions">;
3
+ export declare const componentNameMapping: Record<"account-onboarding" | "disputes-list" | "payments" | "payment-details" | "payment-disputes" | "payouts" | "payouts-list" | "payout-details" | "balances" | "account-management" | "notification-banner" | "instant-payouts-promotion" | "issuing-card" | "issuing-cards-list" | "financial-account" | "financial-account-transactions" | "documents" | "tax-registrations" | "tax-settings" | "balance-report" | "payout-reconciliation-report", "stripe-connect-account-onboarding" | "stripe-connect-disputes-list" | "stripe-connect-payments" | "stripe-connect-payment-details" | "stripe-connect-payment-disputes" | "stripe-connect-payouts" | "stripe-connect-payouts-list" | "stripe-connect-payout-details" | "stripe-connect-balances" | "stripe-connect-account-management" | "stripe-connect-notification-banner" | "stripe-connect-instant-payouts-promotion" | "stripe-connect-issuing-card" | "stripe-connect-issuing-cards-list" | "stripe-connect-financial-account" | "stripe-connect-financial-account-transactions" | "stripe-connect-documents" | "stripe-connect-tax-registrations" | "stripe-connect-tax-settings" | "stripe-connect-balance-report" | "stripe-connect-payout-reconciliation-report">;
4
4
  type StripeConnectInstanceExtended = StripeConnectInstance & {
5
5
  debugInstance: () => Promise<StripeConnectInstance>;
6
6
  };
package/dist/pure.esm.js CHANGED
@@ -1,22 +1,11 @@
1
1
  /* eslint-disable @typescript-eslint/no-unused-vars */
2
2
  // Source of truth for the entire list of components. When you add a new component, it should be added here.
3
- const connectElementTagNames = ["payments", "payouts", "payment-details", "payment-disputes", "disputes-list", "account-onboarding", "payment-method-settings", "account-management", "notification-banner", "instant-payouts", "instant-payouts-promotion", "issuing-card", "issuing-cards-list", "financial-account", "financial-account-transactions", "recipients", "capital-financing", "capital-financing-application", "capital-financing-promotion", "capital-overview", "documents", "product-tax-code-selector", "export-tax-transactions", "tax-registrations", "tax-settings", "tax-threshold-monitoring", "balances", "payouts-list", "payout-details", "app-install", "app-viewport", "reporting-chart", "check-scanning", "agentic-commerce-settings", "terminal-hardware-orders", "terminal-hardware-shop", "network-cost-passthrough-report", "balance-report", "payout-reconciliation-report", "recipients-list", "financial-accounts", "financial-accounts-transactions"];
3
+ const connectElementTagNames = ["account-onboarding", "disputes-list", "payments", "payment-details", "payment-disputes", "payouts", "payouts-list", "payout-details", "balances", "account-management", "notification-banner", "instant-payouts-promotion", "issuing-card", "issuing-cards-list", "financial-account", "financial-account-transactions", "documents", "tax-registrations", "tax-settings", "balance-report", "payout-reconciliation-report"];
4
4
  const ConnectElementCommonMethodConfig = {
5
5
  setOnLoadError: _listener => {},
6
6
  setOnLoaderStart: _listener => {}
7
7
  };
8
8
  const ConnectElementCustomMethodConfig = {
9
- payments: {
10
- setDefaultFilters: _filters => {}
11
- },
12
- "payment-details": {
13
- setPayment: _payment => {},
14
- setOnClose: _listener => {}
15
- },
16
- "payment-disputes": {
17
- setPayment: _payment => {},
18
- setOnDisputesLoaded: _listener => {}
19
- },
20
9
  "account-onboarding": {
21
10
  setFullTermsOfServiceUrl: _termOfServiceUrl => {},
22
11
  setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
@@ -54,49 +43,16 @@ const ConnectElementCustomMethodConfig = {
54
43
  "financial-account-transactions": {
55
44
  setFinancialAccount: _financialAccount => {}
56
45
  },
57
- recipients: {
58
- setDataSource: _dataSource => {}
59
- },
60
- "app-install": {
61
- setApp: _app => {},
62
- setOnAppInstallStateFetched: _listener => {},
63
- setOnAppInstallStateChanged: _listener => {}
64
- },
65
- "app-viewport": {
66
- setApp: _app => {},
67
- setAppData: _appData => {}
68
- },
69
- "payment-method-settings": {
70
- setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
71
- },
72
- "capital-financing": {
73
- setDefaultFinancingOffer: _defaultFinancingOffer => {},
74
- setShowFinancingSelector: _showFinancingSelector => {},
75
- setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
76
- setSupportUrl: _supportUrl => {},
77
- setOnFinancingsLoaded: _listener => {}
78
- },
79
- "capital-financing-application": {
80
- setOnApplicationSubmitted: _listener => {},
81
- setPrivacyPolicyUrl: _privacyPolicyUrl => {},
82
- setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
83
- setOnApplicationStepChange: _listener => {},
84
- setDefaultFinancingOffer: _defaultFinancingOffer => {}
46
+ payments: {
47
+ setDefaultFilters: _filters => {}
85
48
  },
86
- "capital-financing-promotion": {
87
- setLayout: _layout => {},
88
- setOnApplicationSubmitted: _listener => {},
89
- setOnEligibleFinancingOfferLoaded: _listener => {},
90
- setPrivacyPolicyUrl: _privacyPolicyUrl => {},
91
- setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
92
- setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {},
93
- setOnApplicationStepChange: _listener => {}
49
+ "payment-details": {
50
+ setPayment: _payment => {},
51
+ setOnClose: _listener => {}
94
52
  },
95
- "reporting-chart": {
96
- setReportName: _reportName => {},
97
- setIntervalStart: _intervalStart => {},
98
- setIntervalEnd: _intervalEnd => {},
99
- setIntervalType: _intervalType => {}
53
+ "payment-disputes": {
54
+ setPayment: _payment => {},
55
+ setOnDisputesLoaded: _listener => {}
100
56
  },
101
57
  "tax-settings": {
102
58
  setHideProductTaxCodeSelector: _hidden => {},
@@ -108,29 +64,10 @@ const ConnectElementCustomMethodConfig = {
108
64
  setDisplayCountries: _countries => {},
109
65
  setOnAfterTaxRegistrationExpired: _listener => {}
110
66
  },
111
- "tax-threshold-monitoring": {
112
- setDisplayCountries: _countries => {}
113
- },
114
- "product-tax-code-selector": {
115
- setOnTaxCodeSelect: _listener => {},
116
- setHideDescription: _hideDescription => {},
117
- setDisabled: _disabled => {},
118
- setInitialTaxCode: _initialTaxCode => {}
119
- },
120
- "export-tax-transactions": {},
121
67
  "payout-details": {
122
68
  setPayout: _payout => {},
123
69
  setOnClose: _listener => {}
124
70
  },
125
- "check-scanning": {
126
- setHandleCheckScanSubmitted: _handleCheckScanSubmitted => {}
127
- },
128
- "agentic-commerce-settings": {
129
- setOnAgreementUpdated: _listener => {}
130
- },
131
- "terminal-hardware-shop": {
132
- setOnCheckoutFinished: _listener => {}
133
- },
134
71
  "payout-reconciliation-report": {
135
72
  setOnReportAvailabilityLoaded: _listener => {}
136
73
  }
@@ -236,7 +173,7 @@ const initStripeConnect = (stripePromise, initParams) => {
236
173
  element[method] = function (value) {
237
174
  stripeConnectInstance.then(() => {
238
175
  if (!this[`${method}InternalOnly`]) {
239
- throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.4.1-preview-1`);
176
+ throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.4.1`);
240
177
  }
241
178
  this[`${method}InternalOnly`](value);
242
179
  });
@@ -290,7 +227,7 @@ const createWrapper = stripeConnect => {
290
227
  sdk: true,
291
228
  sdkOptions: {
292
229
  // This will be replaced by the npm package version when bundling
293
- sdkVersion: "3.4.1-preview-1"
230
+ sdkVersion: "3.4.1"
294
231
  }
295
232
  })
296
233
  }));
package/dist/pure.js CHANGED
@@ -4,23 +4,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  /* eslint-disable @typescript-eslint/no-unused-vars */
6
6
  // Source of truth for the entire list of components. When you add a new component, it should be added here.
7
- const connectElementTagNames = ["payments", "payouts", "payment-details", "payment-disputes", "disputes-list", "account-onboarding", "payment-method-settings", "account-management", "notification-banner", "instant-payouts", "instant-payouts-promotion", "issuing-card", "issuing-cards-list", "financial-account", "financial-account-transactions", "recipients", "capital-financing", "capital-financing-application", "capital-financing-promotion", "capital-overview", "documents", "product-tax-code-selector", "export-tax-transactions", "tax-registrations", "tax-settings", "tax-threshold-monitoring", "balances", "payouts-list", "payout-details", "app-install", "app-viewport", "reporting-chart", "check-scanning", "agentic-commerce-settings", "terminal-hardware-orders", "terminal-hardware-shop", "network-cost-passthrough-report", "balance-report", "payout-reconciliation-report", "recipients-list", "financial-accounts", "financial-accounts-transactions"];
7
+ const connectElementTagNames = ["account-onboarding", "disputes-list", "payments", "payment-details", "payment-disputes", "payouts", "payouts-list", "payout-details", "balances", "account-management", "notification-banner", "instant-payouts-promotion", "issuing-card", "issuing-cards-list", "financial-account", "financial-account-transactions", "documents", "tax-registrations", "tax-settings", "balance-report", "payout-reconciliation-report"];
8
8
  const ConnectElementCommonMethodConfig = {
9
9
  setOnLoadError: _listener => {},
10
10
  setOnLoaderStart: _listener => {}
11
11
  };
12
12
  const ConnectElementCustomMethodConfig = {
13
- payments: {
14
- setDefaultFilters: _filters => {}
15
- },
16
- "payment-details": {
17
- setPayment: _payment => {},
18
- setOnClose: _listener => {}
19
- },
20
- "payment-disputes": {
21
- setPayment: _payment => {},
22
- setOnDisputesLoaded: _listener => {}
23
- },
24
13
  "account-onboarding": {
25
14
  setFullTermsOfServiceUrl: _termOfServiceUrl => {},
26
15
  setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
@@ -58,49 +47,16 @@ const ConnectElementCustomMethodConfig = {
58
47
  "financial-account-transactions": {
59
48
  setFinancialAccount: _financialAccount => {}
60
49
  },
61
- recipients: {
62
- setDataSource: _dataSource => {}
63
- },
64
- "app-install": {
65
- setApp: _app => {},
66
- setOnAppInstallStateFetched: _listener => {},
67
- setOnAppInstallStateChanged: _listener => {}
68
- },
69
- "app-viewport": {
70
- setApp: _app => {},
71
- setAppData: _appData => {}
72
- },
73
- "payment-method-settings": {
74
- setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
75
- },
76
- "capital-financing": {
77
- setDefaultFinancingOffer: _defaultFinancingOffer => {},
78
- setShowFinancingSelector: _showFinancingSelector => {},
79
- setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
80
- setSupportUrl: _supportUrl => {},
81
- setOnFinancingsLoaded: _listener => {}
82
- },
83
- "capital-financing-application": {
84
- setOnApplicationSubmitted: _listener => {},
85
- setPrivacyPolicyUrl: _privacyPolicyUrl => {},
86
- setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
87
- setOnApplicationStepChange: _listener => {},
88
- setDefaultFinancingOffer: _defaultFinancingOffer => {}
50
+ payments: {
51
+ setDefaultFilters: _filters => {}
89
52
  },
90
- "capital-financing-promotion": {
91
- setLayout: _layout => {},
92
- setOnApplicationSubmitted: _listener => {},
93
- setOnEligibleFinancingOfferLoaded: _listener => {},
94
- setPrivacyPolicyUrl: _privacyPolicyUrl => {},
95
- setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
96
- setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {},
97
- setOnApplicationStepChange: _listener => {}
53
+ "payment-details": {
54
+ setPayment: _payment => {},
55
+ setOnClose: _listener => {}
98
56
  },
99
- "reporting-chart": {
100
- setReportName: _reportName => {},
101
- setIntervalStart: _intervalStart => {},
102
- setIntervalEnd: _intervalEnd => {},
103
- setIntervalType: _intervalType => {}
57
+ "payment-disputes": {
58
+ setPayment: _payment => {},
59
+ setOnDisputesLoaded: _listener => {}
104
60
  },
105
61
  "tax-settings": {
106
62
  setHideProductTaxCodeSelector: _hidden => {},
@@ -112,29 +68,10 @@ const ConnectElementCustomMethodConfig = {
112
68
  setDisplayCountries: _countries => {},
113
69
  setOnAfterTaxRegistrationExpired: _listener => {}
114
70
  },
115
- "tax-threshold-monitoring": {
116
- setDisplayCountries: _countries => {}
117
- },
118
- "product-tax-code-selector": {
119
- setOnTaxCodeSelect: _listener => {},
120
- setHideDescription: _hideDescription => {},
121
- setDisabled: _disabled => {},
122
- setInitialTaxCode: _initialTaxCode => {}
123
- },
124
- "export-tax-transactions": {},
125
71
  "payout-details": {
126
72
  setPayout: _payout => {},
127
73
  setOnClose: _listener => {}
128
74
  },
129
- "check-scanning": {
130
- setHandleCheckScanSubmitted: _handleCheckScanSubmitted => {}
131
- },
132
- "agentic-commerce-settings": {
133
- setOnAgreementUpdated: _listener => {}
134
- },
135
- "terminal-hardware-shop": {
136
- setOnCheckoutFinished: _listener => {}
137
- },
138
75
  "payout-reconciliation-report": {
139
76
  setOnReportAvailabilityLoaded: _listener => {}
140
77
  }
@@ -240,7 +177,7 @@ const initStripeConnect = (stripePromise, initParams) => {
240
177
  element[method] = function (value) {
241
178
  stripeConnectInstance.then(() => {
242
179
  if (!this[`${method}InternalOnly`]) {
243
- throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.4.1-preview-1`);
180
+ throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: 3.4.1`);
244
181
  }
245
182
  this[`${method}InternalOnly`](value);
246
183
  });
@@ -294,7 +231,7 @@ const createWrapper = stripeConnect => {
294
231
  sdk: true,
295
232
  sdkOptions: {
296
233
  // This will be replaced by the npm package version when bundling
297
- sdkVersion: "3.4.1-preview-1"
234
+ sdkVersion: "3.4.1"
298
235
  }
299
236
  })
300
237
  }));
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@stripe/connect-js",
3
- "version": "3.4.1-preview-1",
3
+ "version": "3.4.1",
4
4
  "description": "Connect.js loading utility package (preview version)",
5
5
  "main": "dist/connect.js",
6
6
  "module": "dist/connect.esm.js",
7
- "types": "dist/index.d.ts",
8
- "typings": "dist/index.d.ts",
7
+ "types": "types/index.d.ts",
8
+ "typings": "types/index.d.ts",
9
9
  "scripts": {
10
10
  "test": "yarn lint && yarn test:unit --passWithNoTests && yarn typecheck && yarn build",
11
11
  "test:unit": "jest",
@@ -63,13 +63,13 @@
63
63
  "jest-environment-jsdom": "^29.5.0",
64
64
  "prettier": "2.8.8",
65
65
  "rimraf": "^2.6.2",
66
- "rollup": "^1.29.0",
66
+ "rollup": "^2.79.2",
67
67
  "rollup-plugin-babel": "^4.4.0",
68
68
  "rollup-plugin-typescript2": "^0.25.3",
69
69
  "ts-jest": "^29.1.0",
70
70
  "typescript": "^4.1.2",
71
71
  "yalc": "^1.0.0-pre.53",
72
- "zx": "^4.2.0"
72
+ "zx": "^8.8.5"
73
73
  },
74
74
  "dependencies": {}
75
75
  }
@@ -2,52 +2,30 @@
2
2
 
3
3
  // Source of truth for the entire list of components. When you add a new component, it should be added here.
4
4
  export const connectElementTagNames = [
5
+ "account-onboarding",
6
+ "disputes-list",
5
7
  "payments",
6
- "payouts",
7
8
  "payment-details",
8
9
  "payment-disputes",
9
- "disputes-list",
10
- "account-onboarding",
11
- "payment-method-settings",
10
+ "payouts",
11
+ "payouts-list",
12
+ "payout-details",
13
+ "balances",
12
14
  "account-management",
13
15
  "notification-banner",
14
- "instant-payouts",
15
16
  "instant-payouts-promotion",
16
17
  "issuing-card",
17
18
  "issuing-cards-list",
18
19
  "financial-account",
19
20
  "financial-account-transactions",
20
- "recipients",
21
- "capital-financing",
22
- "capital-financing-application",
23
- "capital-financing-promotion",
24
- "capital-overview",
25
21
  "documents",
26
- "product-tax-code-selector",
27
- "export-tax-transactions",
28
22
  "tax-registrations",
29
23
  "tax-settings",
30
- "tax-threshold-monitoring",
31
- "balances",
32
- "payouts-list",
33
- "payout-details",
34
- "app-install",
35
- "app-viewport",
36
- "reporting-chart",
37
- "check-scanning",
38
- "agentic-commerce-settings",
39
- "terminal-hardware-orders",
40
- "terminal-hardware-shop",
41
- "network-cost-passthrough-report",
42
24
  "balance-report",
43
25
  "payout-reconciliation-report",
44
- "recipients-list",
45
- "financial-accounts",
46
- "financial-accounts-transactions",
47
26
  ] as const;
48
27
 
49
28
  // BEGIN: Setter definitions. All setters and their associated types are defined here. When adding a new component, if it has setters, they should be added here as well.
50
-
51
29
  export type FetchEphemeralKeyFunction = (fetchParams: {
52
30
  issuingCard: string;
53
31
  nonce: string;
@@ -188,11 +166,6 @@ export type NotificationCount = {
188
166
  actionRequired: number;
189
167
  };
190
168
 
191
- export type InstallState = {
192
- appId: string;
193
- state: "INSTALLED" | "UNINSTALLED";
194
- };
195
-
196
169
  export type LoaderStart = {
197
170
  elementTagName: string;
198
171
  };
@@ -211,19 +184,6 @@ export type EmbeddedError = {
211
184
  message?: string;
212
185
  };
213
186
 
214
- export type FinancingProductType = {
215
- productType: "standard" | "refill" | "none";
216
- activeFinancingCount: number;
217
- };
218
-
219
- export type FinancingPromotionLayoutType = "full" | "banner";
220
-
221
- export type IntervalType = "day" | "week" | "month" | "quarter" | "year";
222
-
223
- export type ReportName = "gross_volume" | "net_volume";
224
-
225
- export type RecipientDataSource = "customers";
226
-
227
187
  export type EmbeddedErrorType =
228
188
  /**
229
189
  * Failure to connect to Stripe's API.
@@ -264,21 +224,6 @@ export const ConnectElementCommonMethodConfig = {
264
224
  };
265
225
 
266
226
  export const ConnectElementCustomMethodConfig = {
267
- payments: {
268
- setDefaultFilters: (
269
- _filters: PaymentsListDefaultFilters | undefined
270
- ): void => {},
271
- },
272
- "payment-details": {
273
- setPayment: (_payment: string | undefined): void => {},
274
- setOnClose: (_listener: (() => void) | undefined): void => {},
275
- },
276
- "payment-disputes": {
277
- setPayment: (_payment: string | undefined): void => {},
278
- setOnDisputesLoaded: (
279
- _listener: (({ total }: { total: number }) => void) | undefined
280
- ): void => {},
281
- },
282
227
  "account-onboarding": {
283
228
  setFullTermsOfServiceUrl: (
284
229
  _termOfServiceUrl: string | undefined
@@ -344,87 +289,21 @@ export const ConnectElementCustomMethodConfig = {
344
289
  "financial-account-transactions": {
345
290
  setFinancialAccount: (_financialAccount: string): void => {},
346
291
  },
347
- recipients: {
348
- setDataSource: (_dataSource: RecipientDataSource): void => {},
349
- },
350
- "app-install": {
351
- setApp: (_app: string | undefined): void => {},
352
- setOnAppInstallStateFetched: (
353
- _listener: (({ appId, state }: InstallState) => void) | undefined
354
- ): void => {},
355
- setOnAppInstallStateChanged: (
356
- _listener: (({ appId, state }: InstallState) => void) | undefined
292
+ payments: {
293
+ setDefaultFilters: (
294
+ _filters: PaymentsListDefaultFilters | undefined
357
295
  ): void => {},
358
296
  },
359
- "app-viewport": {
360
- setApp: (_app: string | undefined): void => {},
361
- setAppData: (_appData: Record<string, string> | undefined): void => {},
362
- },
363
- "payment-method-settings": {
364
- setPaymentMethodConfiguration: (
365
- _paymentMethodConfiguration: string | undefined
366
- ): void => {},
297
+ "payment-details": {
298
+ setPayment: (_payment: string | undefined): void => {},
299
+ setOnClose: (_listener: (() => void) | undefined): void => {},
367
300
  },
368
- "capital-financing": {
369
- setDefaultFinancingOffer: (
370
- _defaultFinancingOffer: string | undefined
371
- ): void => {},
372
- setShowFinancingSelector: (
373
- _showFinancingSelector: boolean | undefined
374
- ): void => {},
375
- setHowCapitalWorksUrl: (
376
- _howCapitalWorksUrl: string | undefined
377
- ): void => {},
378
- setSupportUrl: (_supportUrl: string | undefined): void => {},
379
- setOnFinancingsLoaded: (
301
+ "payment-disputes": {
302
+ setPayment: (_payment: string | undefined): void => {},
303
+ setOnDisputesLoaded: (
380
304
  _listener: (({ total }: { total: number }) => void) | undefined
381
305
  ): void => {},
382
306
  },
383
- "capital-financing-application": {
384
- setOnApplicationSubmitted: (
385
- _listener: (() => void) | undefined
386
- ): void => {},
387
- setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined): void => {},
388
- setHowCapitalWorksUrl: (
389
- _howCapitalWorksUrl: string | undefined
390
- ): void => {},
391
- setOnApplicationStepChange: (
392
- _listener: (({ step }: StepChange) => void) | undefined
393
- ): void => {},
394
- setDefaultFinancingOffer: (
395
- _defaultFinancingOffer: string | undefined
396
- ): void => {},
397
- },
398
- "capital-financing-promotion": {
399
- setLayout: (_layout: FinancingPromotionLayoutType | undefined): void => {},
400
- setOnApplicationSubmitted: (
401
- _listener: (() => void) | undefined
402
- ): void => {},
403
- setOnEligibleFinancingOfferLoaded: (
404
- _listener:
405
- | (({
406
- productType,
407
- activeFinancingCount,
408
- }: FinancingProductType) => void)
409
- | undefined
410
- ): void => {},
411
- setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined): void => {},
412
- setHowCapitalWorksUrl: (
413
- _howCapitalWorksUrl: string | undefined
414
- ): void => {},
415
- setEligibilityCriteriaUrl: (
416
- _eligibilityCriteriaUrl: string | undefined
417
- ): void => {},
418
- setOnApplicationStepChange: (
419
- _listener: (({ step }: StepChange) => void) | undefined
420
- ): void => {},
421
- },
422
- "reporting-chart": {
423
- setReportName: (_reportName: ReportName): void => {},
424
- setIntervalStart: (_intervalStart: Date | undefined): void => {},
425
- setIntervalEnd: (_intervalEnd: Date | undefined): void => {},
426
- setIntervalType: (_intervalType: IntervalType | undefined): void => {},
427
- },
428
307
  "tax-settings": {
429
308
  setHideProductTaxCodeSelector: (_hidden: boolean | undefined): void => {},
430
309
  setDisplayHeadOfficeCountries: (
@@ -443,46 +322,10 @@ export const ConnectElementCustomMethodConfig = {
443
322
  _listener: (({ id }: { id: string }) => void) | undefined
444
323
  ): void => {},
445
324
  },
446
- "tax-threshold-monitoring": {
447
- setDisplayCountries: (_countries: string[] | undefined): void => {},
448
- },
449
- "product-tax-code-selector": {
450
- setOnTaxCodeSelect: (
451
- _listener:
452
- | ((
453
- taxCode: string | null,
454
- _: { analyticsName: string } | null
455
- ) => void)
456
- | undefined
457
- ): void => {},
458
- setHideDescription: (_hideDescription: boolean | undefined): void => {},
459
- setDisabled: (_disabled: boolean | undefined): void => {},
460
- setInitialTaxCode: (_initialTaxCode: string | undefined): void => {},
461
- },
462
- "export-tax-transactions": {},
463
325
  "payout-details": {
464
326
  setPayout: (_payout: string | undefined): void => {},
465
327
  setOnClose: (_listener: (() => void) | undefined): void => {},
466
328
  },
467
- "check-scanning": {
468
- setHandleCheckScanSubmitted: (
469
- _handleCheckScanSubmitted: ({
470
- checkScanToken,
471
- }: {
472
- checkScanToken: string;
473
- }) => Promise<void>
474
- ): void => {},
475
- },
476
- "agentic-commerce-settings": {
477
- setOnAgreementUpdated: (
478
- _listener:
479
- | (({ agreementId }: { agreementId: string }) => void)
480
- | undefined
481
- ): void => {},
482
- },
483
- "terminal-hardware-shop": {
484
- setOnCheckoutFinished: (_listener: (() => void) | undefined): void => {},
485
- },
486
329
  "payout-reconciliation-report": {
487
330
  setOnReportAvailabilityLoaded: (
488
331
  _listener:
@@ -2,8 +2,6 @@ import type {
2
2
  ConnectElementCommonMethodConfig,
3
3
  ConnectElementCustomMethodConfig,
4
4
  connectElementTagNames,
5
- EmbeddedError,
6
- EmbeddedErrorType,
7
5
  } from "../components/componentsAndSetters";
8
6
 
9
7
  export type LoadConnectAndInitialize = (
@@ -513,67 +511,6 @@ export type IStripeConnectUpdateParams = {
513
511
  locale?: string;
514
512
  };
515
513
 
516
- /**
517
- * Reasons why risk signals collection was skipped.
518
- */
519
- export type RiskSignalsCollectionSkippedReason =
520
- /**
521
- * Required component (account_onboarding) not enabled.
522
- */
523
- | "required_component_not_enabled"
524
- /**
525
- * The account doesn't have a risk signals collection requirement.
526
- */
527
- | "not_required"
528
- /**
529
- * The risk signals collection requirement has already been fulfilled.
530
- */
531
- | "requirement_fulfilled";
532
-
533
- /**
534
- * Error types that can occur during risk signals collection.
535
- */
536
- export type RiskSignalsCollectionErrorType = Extract<
537
- EmbeddedErrorType,
538
- | "api_connection_error"
539
- | "invalid_request_error"
540
- | "rate_limit_error"
541
- | "api_error"
542
- >;
543
-
544
- /**
545
- * Errors that can occur during risk signals collection.
546
- */
547
- export type RiskSignalsCollectionError =
548
- /**
549
- * Error occurred during general Connect.js loading.
550
- */
551
- | { type: "load_error"; loadError: EmbeddedError }
552
-
553
- /**
554
- * Error occurred during risk signals collection.
555
- */
556
- | { type: RiskSignalsCollectionErrorType; message?: string };
557
-
558
- /**
559
- * Event emitted during risk signals collection.
560
- */
561
- export declare type RiskSignalsCollectionEvent =
562
- /**
563
- * Risk signals collection completed and successfully received by Stripe.
564
- */
565
- | { status: "completed" }
566
-
567
- /**
568
- * Risk signals collection skipped with reason.
569
- */
570
- | { status: "skipped"; skippedReason: RiskSignalsCollectionSkippedReason }
571
-
572
- /**
573
- * Risk signals collection failed due to error and was not sent to Stripe server.
574
- */
575
- | { status: "failed"; error: RiskSignalsCollectionError };
576
-
577
514
  /**
578
515
  * Initialization parameters for Connect JS. See https://stripe.com/docs/connect/get-started-connect-embedded-components#configuring-connect-js for more details.
579
516
  */
@@ -604,12 +541,6 @@ export interface IStripeConnectInitParams {
604
541
  * An array of custom fonts, which embedded components created from a ConnectInstance can use.
605
542
  */
606
543
  fonts?: Array<CssFontSource | CustomFontSource>;
607
-
608
- /**
609
- * Callback for risk signals collection event
610
- * @param {RiskSignalsCollectionEvent} event - The risk signals collection event containing status and additional details.
611
- */
612
- onRiskSignalsCollection?: (event: RiskSignalsCollectionEvent) => void;
613
544
  }
614
545
 
615
546
  type ConnectElementCustomMethods = typeof ConnectElementCustomMethodConfig;