@stripe/connect-js 3.4.6 → 3.4.8-preview.0

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 ADDED
@@ -0,0 +1,80 @@
1
+ # Connect.js ES Module
2
+
3
+ The [Connect.js library](https://stripe.com/docs/connect/get-started-connect-embedded-components) and its supporting API allows you to add connected account dashboard functionality to your website.
4
+ This NPM package contains initialization logic for Connect embedded components along with related types.
5
+
6
+ Calling `loadConnectAndInitialize` always loads the latest version of Connect.js, regardless of which version of `@stripe/connect-js` you use. Updates for this package only impact tooling around the `loadConnectAndInitialize` helper itself and the TypeScript type definitions provided for Connect.js. Updates do not affect runtime availability of features of Connect.js.
7
+
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
+
10
+ Note: Some Connect embedded components are 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
+
12
+ ## Installation
13
+
14
+ Use `npm` to install the Connect.js module:
15
+
16
+ ```sh
17
+ npm install @stripe/connect-js
18
+ ```
19
+
20
+ ## Documentation
21
+
22
+ - [Connect embedded components](https://stripe.com/docs/connect/get-started-connect-embedded-components)
23
+ - [Quickstart guide](https://stripe.com/docs/connect/connect-embedded-components/quickstart)
24
+
25
+ ## Usage
26
+
27
+ ### `loadConnectAndInitialize`
28
+
29
+ This synchronous function takes in a publishable key, a function to retrieve the client secret returned from the [Account Session API](https://stripe.com/docs/api/account_sessions/create), and other [initialization parameters](https://stripe.com/docs/connect/get-started-connect-embedded-components#configuring-connect-js). It returns a `StripeConnectInstance`. If necessary, it will load Connect.js for you by inserting the Connect.js script tag.
30
+
31
+ ```js
32
+ import { loadConnectAndInitialize } from "@stripe/connect-js";
33
+ const fetchClientSecret = async () => {
34
+ // Fetch the AccountSession client secret by making an API call to your service
35
+ };
36
+
37
+ const instance = loadConnectAndInitialize({
38
+ publishableKey: "{{pk test123}}",
39
+ fetchClientSecret: fetchClientSecret,
40
+ });
41
+ ```
42
+
43
+ We’ve placed a random API key in this example. Replace it with your
44
+ [actual publishable API keys](https://dashboard.stripe.com/account/apikeys) to
45
+ test this code through your Connect account.
46
+
47
+ If you have deployed a
48
+ [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/Security/CSP),
49
+ make sure to
50
+ [include Connect.js in your directives](https://stripe.com/docs/connect/get-started-connect-embedded-components?platform=web#csp-and-http-header-requirements).
51
+
52
+ ### Import as a side effect
53
+
54
+ Import `@stripe/connect-js` as a side effect in code that will be included
55
+ throughout your site (e.g. your root module). This will make sure the Connect.js
56
+ script tag is inserted immediately upon page load.
57
+
58
+ ```js
59
+ import "@stripe/connect-js";
60
+ ```
61
+
62
+ ### Importing `loadConnectAndInitialize` without side effects
63
+
64
+ If you would like to use `loadConnectAndInitialize` in your application, but defer loading the
65
+ Connect.js script until `loadConnectAndInitialize` is first called, use the alternative
66
+ `@stripe/connect-js/pure` import path:
67
+
68
+ ```js
69
+ import { loadConnectAndInitialize } from "@stripe/connect-js/pure";
70
+
71
+ // Connect.js will not be loaded until `loadConnect` is called
72
+ const instance = loadConnectAndInitialize({
73
+ publishableKey: "{{pk test123}}",
74
+ fetchClientSecret: fetchClientSecret,
75
+ });
76
+ ```
77
+
78
+ ## Preview/GA
79
+
80
+ To work with the [preview](https://docs.stripe.com/connect/supported-embedded-components) version of embedded components, use the [preview](/preview) folder. For the stable GA version, use [/ga](/ga).
@@ -1,4 +1,4 @@
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"];
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-rewards", "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", "bills"];
2
2
  export type FetchEphemeralKeyFunction = (fetchParams: {
3
3
  issuingCard: string;
4
4
  nonce: string;
@@ -48,6 +48,10 @@ 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
+ };
51
55
  export type LoaderStart = {
52
56
  elementTagName: string;
53
57
  };
@@ -65,6 +69,14 @@ export type EmbeddedError = {
65
69
  type: EmbeddedErrorType;
66
70
  message?: string;
67
71
  };
72
+ export type FinancingProductType = {
73
+ productType: "standard" | "refill" | "none";
74
+ activeFinancingCount: number;
75
+ };
76
+ export type FinancingPromotionLayoutType = "full" | "banner";
77
+ export type IntervalType = "day" | "week" | "month" | "quarter" | "year";
78
+ export type ReportName = "gross_volume" | "net_volume";
79
+ export type RecipientDataSource = "customers";
68
80
  export type EmbeddedErrorType =
69
81
  /**
70
82
  * Failure to connect to Stripe's API.
@@ -99,6 +111,19 @@ export declare const ConnectElementCommonMethodConfig: {
99
111
  setOnLoaderStart: (_listener: (({ elementTagName }: LoaderStart) => void) | undefined) => void;
100
112
  };
101
113
  export declare const ConnectElementCustomMethodConfig: {
114
+ payments: {
115
+ setDefaultFilters: (_filters: PaymentsListDefaultFilters | undefined) => void;
116
+ };
117
+ "payment-details": {
118
+ setPayment: (_payment: string | undefined) => void;
119
+ setOnClose: (_listener: (() => void) | undefined) => void;
120
+ };
121
+ "payment-disputes": {
122
+ setPayment: (_payment: string | undefined) => void;
123
+ setOnDisputesLoaded: (_listener: (({ total }: {
124
+ total: number;
125
+ }) => void) | undefined) => void;
126
+ };
102
127
  "account-onboarding": {
103
128
  setFullTermsOfServiceUrl: (_termOfServiceUrl: string | undefined) => void;
104
129
  setRecipientTermsOfServiceUrl: (_recipientTermsOfServiceUrl: string | undefined) => void;
@@ -138,22 +163,62 @@ export declare const ConnectElementCustomMethodConfig: {
138
163
  "financial-account": {
139
164
  setFinancialAccount: (_financialAccount: string) => void;
140
165
  };
166
+ "financial-account-rewards": {
167
+ setFinancialAccount: (_financialAccount: string) => void;
168
+ };
141
169
  "financial-account-transactions": {
142
170
  setFinancialAccount: (_financialAccount: string) => void;
143
171
  };
144
- payments: {
145
- setDefaultFilters: (_filters: PaymentsListDefaultFilters | undefined) => void;
172
+ recipients: {
173
+ setDataSource: (_dataSource: RecipientDataSource) => void;
146
174
  };
147
- "payment-details": {
148
- setPayment: (_payment: string | undefined) => void;
149
- setOnClose: (_listener: (() => void) | undefined) => void;
175
+ "app-install": {
176
+ setApp: (_app: string | undefined) => void;
177
+ setOnAppInstallStateFetched: (_listener: (({ appId, state }: InstallState) => void) | undefined) => void;
178
+ setOnAppInstallStateChanged: (_listener: (({ appId, state }: InstallState) => void) | undefined) => void;
150
179
  };
151
- "payment-disputes": {
152
- setPayment: (_payment: string | undefined) => void;
153
- setOnDisputesLoaded: (_listener: (({ total }: {
180
+ "app-viewport": {
181
+ setApp: (_app: string | undefined) => void;
182
+ setAppData: (_appData: Record<string, string> | undefined) => void;
183
+ };
184
+ "payment-method-settings": {
185
+ setPaymentMethodConfiguration: (_paymentMethodConfiguration: string | undefined) => void;
186
+ };
187
+ "capital-financing": {
188
+ setDefaultFinancingOffer: (_defaultFinancingOffer: string | undefined) => void;
189
+ setShowFinancingSelector: (_showFinancingSelector: boolean | undefined) => void;
190
+ setHowCapitalWorksUrl: (_howCapitalWorksUrl: string | undefined) => void;
191
+ setSupportUrl: (_supportUrl: string | undefined) => void;
192
+ setOnFinancingsLoaded: (_listener: (({ total }: {
154
193
  total: number;
155
194
  }) => void) | undefined) => void;
156
195
  };
196
+ "capital-financing-application": {
197
+ setOnApplicationSubmitted: (_listener: (() => void) | undefined) => void;
198
+ setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined) => void;
199
+ setHowCapitalWorksUrl: (_howCapitalWorksUrl: string | undefined) => void;
200
+ setOnApplicationStepChange: (_listener: (({ step }: StepChange) => void) | undefined) => void;
201
+ setDefaultFinancingOffer: (_defaultFinancingOffer: string | undefined) => void;
202
+ setOnApplicationInitiated: (_listener: (() => void) | undefined) => void;
203
+ setResumeInitiatedApplication: (_resumeInitiatedApplication: boolean | undefined) => void;
204
+ };
205
+ "capital-financing-promotion": {
206
+ setLayout: (_layout: FinancingPromotionLayoutType | undefined) => void;
207
+ setOnApplicationSubmitted: (_listener: (() => void) | undefined) => void;
208
+ setOnEligibleFinancingOfferLoaded: (_listener: (({ productType, activeFinancingCount, }: FinancingProductType) => void) | undefined) => void;
209
+ setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined) => void;
210
+ setHowCapitalWorksUrl: (_howCapitalWorksUrl: string | undefined) => void;
211
+ setEligibilityCriteriaUrl: (_eligibilityCriteriaUrl: string | undefined) => void;
212
+ setOnApplicationStepChange: (_listener: (({ step }: StepChange) => void) | undefined) => void;
213
+ setOnAdvanceToCapitalFinancingApplication: (_listener: (() => void) | undefined) => void;
214
+ setDisableNestedCapitalFinancingApplication: (_disableNestedCapitalFinancingApplication: boolean | undefined) => void;
215
+ };
216
+ "reporting-chart": {
217
+ setReportName: (_reportName: ReportName) => void;
218
+ setIntervalStart: (_intervalStart: Date | undefined) => void;
219
+ setIntervalEnd: (_intervalEnd: Date | undefined) => void;
220
+ setIntervalType: (_intervalType: IntervalType | undefined) => void;
221
+ };
157
222
  "tax-settings": {
158
223
  setHideProductTaxCodeSelector: (_hidden: boolean | undefined) => void;
159
224
  setDisplayHeadOfficeCountries: (_countries: string[] | undefined) => void;
@@ -170,10 +235,35 @@ export declare const ConnectElementCustomMethodConfig: {
170
235
  id: string;
171
236
  }) => void) | undefined) => void;
172
237
  };
238
+ "tax-threshold-monitoring": {
239
+ setDisplayCountries: (_countries: string[] | undefined) => void;
240
+ };
241
+ "product-tax-code-selector": {
242
+ setOnTaxCodeSelect: (_listener: ((taxCode: string | null, _: {
243
+ analyticsName: string;
244
+ } | null) => void) | undefined) => void;
245
+ setHideDescription: (_hideDescription: boolean | undefined) => void;
246
+ setDisabled: (_disabled: boolean | undefined) => void;
247
+ setInitialTaxCode: (_initialTaxCode: string | undefined) => void;
248
+ };
249
+ "export-tax-transactions": {};
173
250
  "payout-details": {
174
251
  setPayout: (_payout: string | undefined) => void;
175
252
  setOnClose: (_listener: (() => void) | undefined) => void;
176
253
  };
254
+ "check-scanning": {
255
+ setHandleCheckScanSubmitted: (_handleCheckScanSubmitted: ({ checkScanToken, }: {
256
+ checkScanToken: string;
257
+ }) => Promise<void>) => void;
258
+ };
259
+ "agentic-commerce-settings": {
260
+ setOnAgreementUpdated: (_listener: (({ agreementId }: {
261
+ agreementId: string;
262
+ }) => void) | undefined) => void;
263
+ };
264
+ "terminal-hardware-shop": {
265
+ setOnCheckoutFinished: (_listener: (() => void) | undefined) => void;
266
+ };
177
267
  "payout-reconciliation-report": {
178
268
  setOnReportAvailabilityLoaded: (_listener: (({ isReportAvailable }: {
179
269
  isReportAvailable: boolean;
@@ -1,11 +1,22 @@
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 = ["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"];
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-rewards", "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", "bills"];
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
+ },
9
20
  "account-onboarding": {
10
21
  setFullTermsOfServiceUrl: _termOfServiceUrl => {},
11
22
  setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
@@ -41,19 +52,59 @@ const ConnectElementCustomMethodConfig = {
41
52
  "financial-account": {
42
53
  setFinancialAccount: _financialAccount => {}
43
54
  },
55
+ "financial-account-rewards": {
56
+ setFinancialAccount: _financialAccount => {}
57
+ },
44
58
  "financial-account-transactions": {
45
59
  setFinancialAccount: _financialAccount => {}
46
60
  },
47
- payments: {
48
- setDefaultFilters: _filters => {}
61
+ recipients: {
62
+ setDataSource: _dataSource => {}
49
63
  },
50
- "payment-details": {
51
- setPayment: _payment => {},
52
- setOnClose: _listener => {}
64
+ "app-install": {
65
+ setApp: _app => {},
66
+ setOnAppInstallStateFetched: _listener => {},
67
+ setOnAppInstallStateChanged: _listener => {}
53
68
  },
54
- "payment-disputes": {
55
- setPayment: _payment => {},
56
- setOnDisputesLoaded: _listener => {}
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 => {},
89
+ setOnApplicationInitiated: _listener => {},
90
+ setResumeInitiatedApplication: _resumeInitiatedApplication => {}
91
+ },
92
+ "capital-financing-promotion": {
93
+ setLayout: _layout => {},
94
+ setOnApplicationSubmitted: _listener => {},
95
+ setOnEligibleFinancingOfferLoaded: _listener => {},
96
+ setPrivacyPolicyUrl: _privacyPolicyUrl => {},
97
+ setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
98
+ setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {},
99
+ setOnApplicationStepChange: _listener => {},
100
+ setOnAdvanceToCapitalFinancingApplication: _listener => {},
101
+ setDisableNestedCapitalFinancingApplication: _disableNestedCapitalFinancingApplication => {}
102
+ },
103
+ "reporting-chart": {
104
+ setReportName: _reportName => {},
105
+ setIntervalStart: _intervalStart => {},
106
+ setIntervalEnd: _intervalEnd => {},
107
+ setIntervalType: _intervalType => {}
57
108
  },
58
109
  "tax-settings": {
59
110
  setHideProductTaxCodeSelector: _hidden => {},
@@ -65,10 +116,29 @@ const ConnectElementCustomMethodConfig = {
65
116
  setDisplayCountries: _countries => {},
66
117
  setOnAfterTaxRegistrationExpired: _listener => {}
67
118
  },
119
+ "tax-threshold-monitoring": {
120
+ setDisplayCountries: _countries => {}
121
+ },
122
+ "product-tax-code-selector": {
123
+ setOnTaxCodeSelect: _listener => {},
124
+ setHideDescription: _hideDescription => {},
125
+ setDisabled: _disabled => {},
126
+ setInitialTaxCode: _initialTaxCode => {}
127
+ },
128
+ "export-tax-transactions": {},
68
129
  "payout-details": {
69
130
  setPayout: _payout => {},
70
131
  setOnClose: _listener => {}
71
132
  },
133
+ "check-scanning": {
134
+ setHandleCheckScanSubmitted: _handleCheckScanSubmitted => {}
135
+ },
136
+ "agentic-commerce-settings": {
137
+ setOnAgreementUpdated: _listener => {}
138
+ },
139
+ "terminal-hardware-shop": {
140
+ setOnCheckoutFinished: _listener => {}
141
+ },
72
142
  "payout-reconciliation-report": {
73
143
  setOnReportAvailabilityLoaded: _listener => {}
74
144
  }
@@ -174,7 +244,7 @@ const initStripeConnect = (stripePromise, initParams) => {
174
244
  element[method] = function (value) {
175
245
  stripeConnectInstance.then(() => {
176
246
  if (!this[`${method}InternalOnly`]) {
177
- 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.6`);
247
+ 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.8-preview.0`);
178
248
  }
179
249
  this[`${method}InternalOnly`](value);
180
250
  });
@@ -228,7 +298,7 @@ const createWrapper = stripeConnect => {
228
298
  sdk: true,
229
299
  sdkOptions: {
230
300
  // This will be replaced by the npm package version when bundling
231
- sdkVersion: "3.4.6"
301
+ sdkVersion: "3.4.8-preview.0"
232
302
  }
233
303
  })
234
304
  }));
package/dist/connect.js CHANGED
@@ -4,12 +4,23 @@ 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 = ["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"];
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-rewards", "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", "bills"];
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
+ },
13
24
  "account-onboarding": {
14
25
  setFullTermsOfServiceUrl: _termOfServiceUrl => {},
15
26
  setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
@@ -45,19 +56,59 @@ const ConnectElementCustomMethodConfig = {
45
56
  "financial-account": {
46
57
  setFinancialAccount: _financialAccount => {}
47
58
  },
59
+ "financial-account-rewards": {
60
+ setFinancialAccount: _financialAccount => {}
61
+ },
48
62
  "financial-account-transactions": {
49
63
  setFinancialAccount: _financialAccount => {}
50
64
  },
51
- payments: {
52
- setDefaultFilters: _filters => {}
65
+ recipients: {
66
+ setDataSource: _dataSource => {}
53
67
  },
54
- "payment-details": {
55
- setPayment: _payment => {},
56
- setOnClose: _listener => {}
68
+ "app-install": {
69
+ setApp: _app => {},
70
+ setOnAppInstallStateFetched: _listener => {},
71
+ setOnAppInstallStateChanged: _listener => {}
57
72
  },
58
- "payment-disputes": {
59
- setPayment: _payment => {},
60
- setOnDisputesLoaded: _listener => {}
73
+ "app-viewport": {
74
+ setApp: _app => {},
75
+ setAppData: _appData => {}
76
+ },
77
+ "payment-method-settings": {
78
+ setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
79
+ },
80
+ "capital-financing": {
81
+ setDefaultFinancingOffer: _defaultFinancingOffer => {},
82
+ setShowFinancingSelector: _showFinancingSelector => {},
83
+ setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
84
+ setSupportUrl: _supportUrl => {},
85
+ setOnFinancingsLoaded: _listener => {}
86
+ },
87
+ "capital-financing-application": {
88
+ setOnApplicationSubmitted: _listener => {},
89
+ setPrivacyPolicyUrl: _privacyPolicyUrl => {},
90
+ setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
91
+ setOnApplicationStepChange: _listener => {},
92
+ setDefaultFinancingOffer: _defaultFinancingOffer => {},
93
+ setOnApplicationInitiated: _listener => {},
94
+ setResumeInitiatedApplication: _resumeInitiatedApplication => {}
95
+ },
96
+ "capital-financing-promotion": {
97
+ setLayout: _layout => {},
98
+ setOnApplicationSubmitted: _listener => {},
99
+ setOnEligibleFinancingOfferLoaded: _listener => {},
100
+ setPrivacyPolicyUrl: _privacyPolicyUrl => {},
101
+ setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
102
+ setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {},
103
+ setOnApplicationStepChange: _listener => {},
104
+ setOnAdvanceToCapitalFinancingApplication: _listener => {},
105
+ setDisableNestedCapitalFinancingApplication: _disableNestedCapitalFinancingApplication => {}
106
+ },
107
+ "reporting-chart": {
108
+ setReportName: _reportName => {},
109
+ setIntervalStart: _intervalStart => {},
110
+ setIntervalEnd: _intervalEnd => {},
111
+ setIntervalType: _intervalType => {}
61
112
  },
62
113
  "tax-settings": {
63
114
  setHideProductTaxCodeSelector: _hidden => {},
@@ -69,10 +120,29 @@ const ConnectElementCustomMethodConfig = {
69
120
  setDisplayCountries: _countries => {},
70
121
  setOnAfterTaxRegistrationExpired: _listener => {}
71
122
  },
123
+ "tax-threshold-monitoring": {
124
+ setDisplayCountries: _countries => {}
125
+ },
126
+ "product-tax-code-selector": {
127
+ setOnTaxCodeSelect: _listener => {},
128
+ setHideDescription: _hideDescription => {},
129
+ setDisabled: _disabled => {},
130
+ setInitialTaxCode: _initialTaxCode => {}
131
+ },
132
+ "export-tax-transactions": {},
72
133
  "payout-details": {
73
134
  setPayout: _payout => {},
74
135
  setOnClose: _listener => {}
75
136
  },
137
+ "check-scanning": {
138
+ setHandleCheckScanSubmitted: _handleCheckScanSubmitted => {}
139
+ },
140
+ "agentic-commerce-settings": {
141
+ setOnAgreementUpdated: _listener => {}
142
+ },
143
+ "terminal-hardware-shop": {
144
+ setOnCheckoutFinished: _listener => {}
145
+ },
76
146
  "payout-reconciliation-report": {
77
147
  setOnReportAvailabilityLoaded: _listener => {}
78
148
  }
@@ -178,7 +248,7 @@ const initStripeConnect = (stripePromise, initParams) => {
178
248
  element[method] = function (value) {
179
249
  stripeConnectInstance.then(() => {
180
250
  if (!this[`${method}InternalOnly`]) {
181
- 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.6`);
251
+ 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.8-preview.0`);
182
252
  }
183
253
  this[`${method}InternalOnly`](value);
184
254
  });
@@ -232,7 +302,7 @@ const createWrapper = stripeConnect => {
232
302
  sdk: true,
233
303
  sdkOptions: {
234
304
  // This will be replaced by the npm package version when bundling
235
- sdkVersion: "3.4.6"
305
+ sdkVersion: "3.4.8-preview.0"
236
306
  }
237
307
  })
238
308
  }));
@@ -1,4 +1,4 @@
1
- import type { ConnectElementCommonMethodConfig, ConnectElementCustomMethodConfig, connectElementTagNames } from "../components/componentsAndSetters";
1
+ import type { ConnectElementCommonMethodConfig, ConnectElementCustomMethodConfig, connectElementTagNames, EmbeddedError, EmbeddedErrorType } from "../components/componentsAndSetters";
2
2
  export type LoadConnectAndInitialize = (initParams: IStripeConnectInitParams) => StripeConnectInstance;
3
3
  export interface StripeConnectWrapper {
4
4
  initialize: (params: IStripeConnectInitParams) => StripeConnectInstance;
@@ -435,6 +435,68 @@ export type IStripeConnectUpdateParams = {
435
435
  */
436
436
  displayOptions?: IStripeConnectDisplayOptions;
437
437
  };
438
+ /**
439
+ * Reasons why risk signals collection was skipped.
440
+ */
441
+ export type RiskSignalsCollectionSkippedReason =
442
+ /**
443
+ * Required component (account_onboarding) not enabled.
444
+ */
445
+ "required_component_not_enabled"
446
+ /**
447
+ * The account doesn't have a risk signals collection requirement.
448
+ */
449
+ | "not_required"
450
+ /**
451
+ * The risk signals collection requirement has already been fulfilled.
452
+ */
453
+ | "requirement_fulfilled";
454
+ /**
455
+ * Error types that can occur during risk signals collection.
456
+ */
457
+ export type RiskSignalsCollectionErrorType = Extract<EmbeddedErrorType, "api_connection_error" | "invalid_request_error" | "rate_limit_error" | "api_error">;
458
+ /**
459
+ * Errors that can occur during risk signals collection.
460
+ */
461
+ export type RiskSignalsCollectionError =
462
+ /**
463
+ * Error occurred during general Connect.js loading.
464
+ */
465
+ {
466
+ type: "load_error";
467
+ loadError: EmbeddedError;
468
+ }
469
+ /**
470
+ * Error occurred during risk signals collection.
471
+ */
472
+ | {
473
+ type: RiskSignalsCollectionErrorType;
474
+ message?: string;
475
+ };
476
+ /**
477
+ * Event emitted during risk signals collection.
478
+ */
479
+ export declare type RiskSignalsCollectionEvent =
480
+ /**
481
+ * Risk signals collection completed and successfully received by Stripe.
482
+ */
483
+ {
484
+ status: "completed";
485
+ }
486
+ /**
487
+ * Risk signals collection skipped with reason.
488
+ */
489
+ | {
490
+ status: "skipped";
491
+ skippedReason: RiskSignalsCollectionSkippedReason;
492
+ }
493
+ /**
494
+ * Risk signals collection failed due to error and was not sent to Stripe server.
495
+ */
496
+ | {
497
+ status: "failed";
498
+ error: RiskSignalsCollectionError;
499
+ };
438
500
  export interface IStripeConnectDisplayOptions {
439
501
  /**
440
502
  * Whether embedded components should show object id's in the UI
@@ -467,6 +529,11 @@ export interface IStripeConnectInitParams {
467
529
  * An array of custom fonts, which embedded components created from a ConnectInstance can use.
468
530
  */
469
531
  fonts?: Array<CssFontSource | CustomFontSource>;
532
+ /**
533
+ * Callback for risk signals collection event
534
+ * @param {RiskSignalsCollectionEvent} event - The risk signals collection event containing status and additional details.
535
+ */
536
+ onRiskSignalsCollection?: (event: RiskSignalsCollectionEvent) => void;
470
537
  /**
471
538
  * Options that affect how all embedded components under this instance render
472
539
  */
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<"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">;
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-rewards" | "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" | "bills", "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-rewards" | "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" | "stripe-connect-bills">;
4
4
  type StripeConnectInstanceExtended = StripeConnectInstance & {
5
5
  debugInstance: () => Promise<StripeConnectInstance>;
6
6
  };
package/dist/pure.esm.js CHANGED
@@ -1,11 +1,22 @@
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 = ["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"];
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-rewards", "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", "bills"];
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
+ },
9
20
  "account-onboarding": {
10
21
  setFullTermsOfServiceUrl: _termOfServiceUrl => {},
11
22
  setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
@@ -41,19 +52,59 @@ const ConnectElementCustomMethodConfig = {
41
52
  "financial-account": {
42
53
  setFinancialAccount: _financialAccount => {}
43
54
  },
55
+ "financial-account-rewards": {
56
+ setFinancialAccount: _financialAccount => {}
57
+ },
44
58
  "financial-account-transactions": {
45
59
  setFinancialAccount: _financialAccount => {}
46
60
  },
47
- payments: {
48
- setDefaultFilters: _filters => {}
61
+ recipients: {
62
+ setDataSource: _dataSource => {}
49
63
  },
50
- "payment-details": {
51
- setPayment: _payment => {},
52
- setOnClose: _listener => {}
64
+ "app-install": {
65
+ setApp: _app => {},
66
+ setOnAppInstallStateFetched: _listener => {},
67
+ setOnAppInstallStateChanged: _listener => {}
53
68
  },
54
- "payment-disputes": {
55
- setPayment: _payment => {},
56
- setOnDisputesLoaded: _listener => {}
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 => {},
89
+ setOnApplicationInitiated: _listener => {},
90
+ setResumeInitiatedApplication: _resumeInitiatedApplication => {}
91
+ },
92
+ "capital-financing-promotion": {
93
+ setLayout: _layout => {},
94
+ setOnApplicationSubmitted: _listener => {},
95
+ setOnEligibleFinancingOfferLoaded: _listener => {},
96
+ setPrivacyPolicyUrl: _privacyPolicyUrl => {},
97
+ setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
98
+ setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {},
99
+ setOnApplicationStepChange: _listener => {},
100
+ setOnAdvanceToCapitalFinancingApplication: _listener => {},
101
+ setDisableNestedCapitalFinancingApplication: _disableNestedCapitalFinancingApplication => {}
102
+ },
103
+ "reporting-chart": {
104
+ setReportName: _reportName => {},
105
+ setIntervalStart: _intervalStart => {},
106
+ setIntervalEnd: _intervalEnd => {},
107
+ setIntervalType: _intervalType => {}
57
108
  },
58
109
  "tax-settings": {
59
110
  setHideProductTaxCodeSelector: _hidden => {},
@@ -65,10 +116,29 @@ const ConnectElementCustomMethodConfig = {
65
116
  setDisplayCountries: _countries => {},
66
117
  setOnAfterTaxRegistrationExpired: _listener => {}
67
118
  },
119
+ "tax-threshold-monitoring": {
120
+ setDisplayCountries: _countries => {}
121
+ },
122
+ "product-tax-code-selector": {
123
+ setOnTaxCodeSelect: _listener => {},
124
+ setHideDescription: _hideDescription => {},
125
+ setDisabled: _disabled => {},
126
+ setInitialTaxCode: _initialTaxCode => {}
127
+ },
128
+ "export-tax-transactions": {},
68
129
  "payout-details": {
69
130
  setPayout: _payout => {},
70
131
  setOnClose: _listener => {}
71
132
  },
133
+ "check-scanning": {
134
+ setHandleCheckScanSubmitted: _handleCheckScanSubmitted => {}
135
+ },
136
+ "agentic-commerce-settings": {
137
+ setOnAgreementUpdated: _listener => {}
138
+ },
139
+ "terminal-hardware-shop": {
140
+ setOnCheckoutFinished: _listener => {}
141
+ },
72
142
  "payout-reconciliation-report": {
73
143
  setOnReportAvailabilityLoaded: _listener => {}
74
144
  }
@@ -174,7 +244,7 @@ const initStripeConnect = (stripePromise, initParams) => {
174
244
  element[method] = function (value) {
175
245
  stripeConnectInstance.then(() => {
176
246
  if (!this[`${method}InternalOnly`]) {
177
- 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.6`);
247
+ 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.8-preview.0`);
178
248
  }
179
249
  this[`${method}InternalOnly`](value);
180
250
  });
@@ -228,7 +298,7 @@ const createWrapper = stripeConnect => {
228
298
  sdk: true,
229
299
  sdkOptions: {
230
300
  // This will be replaced by the npm package version when bundling
231
- sdkVersion: "3.4.6"
301
+ sdkVersion: "3.4.8-preview.0"
232
302
  }
233
303
  })
234
304
  }));
package/dist/pure.js CHANGED
@@ -4,12 +4,23 @@ 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 = ["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"];
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-rewards", "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", "bills"];
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
+ },
13
24
  "account-onboarding": {
14
25
  setFullTermsOfServiceUrl: _termOfServiceUrl => {},
15
26
  setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
@@ -45,19 +56,59 @@ const ConnectElementCustomMethodConfig = {
45
56
  "financial-account": {
46
57
  setFinancialAccount: _financialAccount => {}
47
58
  },
59
+ "financial-account-rewards": {
60
+ setFinancialAccount: _financialAccount => {}
61
+ },
48
62
  "financial-account-transactions": {
49
63
  setFinancialAccount: _financialAccount => {}
50
64
  },
51
- payments: {
52
- setDefaultFilters: _filters => {}
65
+ recipients: {
66
+ setDataSource: _dataSource => {}
53
67
  },
54
- "payment-details": {
55
- setPayment: _payment => {},
56
- setOnClose: _listener => {}
68
+ "app-install": {
69
+ setApp: _app => {},
70
+ setOnAppInstallStateFetched: _listener => {},
71
+ setOnAppInstallStateChanged: _listener => {}
57
72
  },
58
- "payment-disputes": {
59
- setPayment: _payment => {},
60
- setOnDisputesLoaded: _listener => {}
73
+ "app-viewport": {
74
+ setApp: _app => {},
75
+ setAppData: _appData => {}
76
+ },
77
+ "payment-method-settings": {
78
+ setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
79
+ },
80
+ "capital-financing": {
81
+ setDefaultFinancingOffer: _defaultFinancingOffer => {},
82
+ setShowFinancingSelector: _showFinancingSelector => {},
83
+ setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
84
+ setSupportUrl: _supportUrl => {},
85
+ setOnFinancingsLoaded: _listener => {}
86
+ },
87
+ "capital-financing-application": {
88
+ setOnApplicationSubmitted: _listener => {},
89
+ setPrivacyPolicyUrl: _privacyPolicyUrl => {},
90
+ setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
91
+ setOnApplicationStepChange: _listener => {},
92
+ setDefaultFinancingOffer: _defaultFinancingOffer => {},
93
+ setOnApplicationInitiated: _listener => {},
94
+ setResumeInitiatedApplication: _resumeInitiatedApplication => {}
95
+ },
96
+ "capital-financing-promotion": {
97
+ setLayout: _layout => {},
98
+ setOnApplicationSubmitted: _listener => {},
99
+ setOnEligibleFinancingOfferLoaded: _listener => {},
100
+ setPrivacyPolicyUrl: _privacyPolicyUrl => {},
101
+ setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
102
+ setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {},
103
+ setOnApplicationStepChange: _listener => {},
104
+ setOnAdvanceToCapitalFinancingApplication: _listener => {},
105
+ setDisableNestedCapitalFinancingApplication: _disableNestedCapitalFinancingApplication => {}
106
+ },
107
+ "reporting-chart": {
108
+ setReportName: _reportName => {},
109
+ setIntervalStart: _intervalStart => {},
110
+ setIntervalEnd: _intervalEnd => {},
111
+ setIntervalType: _intervalType => {}
61
112
  },
62
113
  "tax-settings": {
63
114
  setHideProductTaxCodeSelector: _hidden => {},
@@ -69,10 +120,29 @@ const ConnectElementCustomMethodConfig = {
69
120
  setDisplayCountries: _countries => {},
70
121
  setOnAfterTaxRegistrationExpired: _listener => {}
71
122
  },
123
+ "tax-threshold-monitoring": {
124
+ setDisplayCountries: _countries => {}
125
+ },
126
+ "product-tax-code-selector": {
127
+ setOnTaxCodeSelect: _listener => {},
128
+ setHideDescription: _hideDescription => {},
129
+ setDisabled: _disabled => {},
130
+ setInitialTaxCode: _initialTaxCode => {}
131
+ },
132
+ "export-tax-transactions": {},
72
133
  "payout-details": {
73
134
  setPayout: _payout => {},
74
135
  setOnClose: _listener => {}
75
136
  },
137
+ "check-scanning": {
138
+ setHandleCheckScanSubmitted: _handleCheckScanSubmitted => {}
139
+ },
140
+ "agentic-commerce-settings": {
141
+ setOnAgreementUpdated: _listener => {}
142
+ },
143
+ "terminal-hardware-shop": {
144
+ setOnCheckoutFinished: _listener => {}
145
+ },
76
146
  "payout-reconciliation-report": {
77
147
  setOnReportAvailabilityLoaded: _listener => {}
78
148
  }
@@ -178,7 +248,7 @@ const initStripeConnect = (stripePromise, initParams) => {
178
248
  element[method] = function (value) {
179
249
  stripeConnectInstance.then(() => {
180
250
  if (!this[`${method}InternalOnly`]) {
181
- 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.6`);
251
+ 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.8-preview.0`);
182
252
  }
183
253
  this[`${method}InternalOnly`](value);
184
254
  });
@@ -232,7 +302,7 @@ const createWrapper = stripeConnect => {
232
302
  sdk: true,
233
303
  sdkOptions: {
234
304
  // This will be replaced by the npm package version when bundling
235
- sdkVersion: "3.4.6"
305
+ sdkVersion: "3.4.8-preview.0"
236
306
  }
237
307
  })
238
308
  }));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stripe/connect-js",
3
- "version": "3.4.6",
4
- "description": "Connect.js loading utility package (GA version)",
3
+ "version": "3.4.8-preview.0",
4
+ "description": "Connect.js loading utility package (preview version)",
5
5
  "main": "dist/connect.js",
6
6
  "module": "dist/connect.esm.js",
7
7
  "types": "dist/index.d.ts",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "repository": {
23
23
  "type": "git",
24
- "url": "https://github.com/stripe/connect-js.git"
24
+ "url": "git+https://github.com/stripe/connect-js.git"
25
25
  },
26
26
  "keywords": [
27
27
  "Stripe",
@@ -63,7 +63,7 @@
63
63
  "jest-environment-jsdom": "^29.5.0",
64
64
  "prettier": "2.8.8",
65
65
  "rimraf": "^2.6.2",
66
- "rollup": "^2.79.2",
66
+ "rollup": "^2.80.0",
67
67
  "rollup-plugin-babel": "^4.4.0",
68
68
  "rollup-plugin-typescript2": "^0.25.3",
69
69
  "ts-jest": "^29.1.0",
@@ -2,30 +2,54 @@
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",
7
5
  "payments",
6
+ "payouts",
8
7
  "payment-details",
9
8
  "payment-disputes",
10
- "payouts",
11
- "payouts-list",
12
- "payout-details",
13
- "balances",
9
+ "disputes-list",
10
+ "account-onboarding",
11
+ "payment-method-settings",
14
12
  "account-management",
15
13
  "notification-banner",
14
+ "instant-payouts",
16
15
  "instant-payouts-promotion",
17
16
  "issuing-card",
18
17
  "issuing-cards-list",
19
18
  "financial-account",
19
+ "financial-account-rewards",
20
20
  "financial-account-transactions",
21
+ "recipients",
22
+ "capital-financing",
23
+ "capital-financing-application",
24
+ "capital-financing-promotion",
25
+ "capital-overview",
21
26
  "documents",
27
+ "product-tax-code-selector",
28
+ "export-tax-transactions",
22
29
  "tax-registrations",
23
30
  "tax-settings",
31
+ "tax-threshold-monitoring",
32
+ "balances",
33
+ "payouts-list",
34
+ "payout-details",
35
+ "app-install",
36
+ "app-viewport",
37
+ "reporting-chart",
38
+ "check-scanning",
39
+ "agentic-commerce-settings",
40
+ "terminal-hardware-orders",
41
+ "terminal-hardware-shop",
42
+ "network-cost-passthrough-report",
24
43
  "balance-report",
25
44
  "payout-reconciliation-report",
45
+ "recipients-list",
46
+ "financial-accounts",
47
+ "financial-accounts-transactions",
48
+ "bills",
26
49
  ] as const;
27
50
 
28
51
  // 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.
52
+
29
53
  export type FetchEphemeralKeyFunction = (fetchParams: {
30
54
  issuingCard: string;
31
55
  nonce: string;
@@ -166,6 +190,11 @@ export type NotificationCount = {
166
190
  actionRequired: number;
167
191
  };
168
192
 
193
+ export type InstallState = {
194
+ appId: string;
195
+ state: "INSTALLED" | "UNINSTALLED";
196
+ };
197
+
169
198
  export type LoaderStart = {
170
199
  elementTagName: string;
171
200
  };
@@ -188,6 +217,19 @@ export type EmbeddedError = {
188
217
  message?: string;
189
218
  };
190
219
 
220
+ export type FinancingProductType = {
221
+ productType: "standard" | "refill" | "none";
222
+ activeFinancingCount: number;
223
+ };
224
+
225
+ export type FinancingPromotionLayoutType = "full" | "banner";
226
+
227
+ export type IntervalType = "day" | "week" | "month" | "quarter" | "year";
228
+
229
+ export type ReportName = "gross_volume" | "net_volume";
230
+
231
+ export type RecipientDataSource = "customers";
232
+
191
233
  export type EmbeddedErrorType =
192
234
  /**
193
235
  * Failure to connect to Stripe's API.
@@ -228,6 +270,21 @@ export const ConnectElementCommonMethodConfig = {
228
270
  };
229
271
 
230
272
  export const ConnectElementCustomMethodConfig = {
273
+ payments: {
274
+ setDefaultFilters: (
275
+ _filters: PaymentsListDefaultFilters | undefined
276
+ ): void => {},
277
+ },
278
+ "payment-details": {
279
+ setPayment: (_payment: string | undefined): void => {},
280
+ setOnClose: (_listener: (() => void) | undefined): void => {},
281
+ },
282
+ "payment-disputes": {
283
+ setPayment: (_payment: string | undefined): void => {},
284
+ setOnDisputesLoaded: (
285
+ _listener: (({ total }: { total: number }) => void) | undefined
286
+ ): void => {},
287
+ },
231
288
  "account-onboarding": {
232
289
  setFullTermsOfServiceUrl: (
233
290
  _termOfServiceUrl: string | undefined
@@ -293,24 +350,105 @@ export const ConnectElementCustomMethodConfig = {
293
350
  "financial-account": {
294
351
  setFinancialAccount: (_financialAccount: string): void => {},
295
352
  },
353
+ "financial-account-rewards": {
354
+ setFinancialAccount: (_financialAccount: string): void => {},
355
+ },
296
356
  "financial-account-transactions": {
297
357
  setFinancialAccount: (_financialAccount: string): void => {},
298
358
  },
299
- payments: {
300
- setDefaultFilters: (
301
- _filters: PaymentsListDefaultFilters | undefined
359
+ recipients: {
360
+ setDataSource: (_dataSource: RecipientDataSource): void => {},
361
+ },
362
+ "app-install": {
363
+ setApp: (_app: string | undefined): void => {},
364
+ setOnAppInstallStateFetched: (
365
+ _listener: (({ appId, state }: InstallState) => void) | undefined
366
+ ): void => {},
367
+ setOnAppInstallStateChanged: (
368
+ _listener: (({ appId, state }: InstallState) => void) | undefined
302
369
  ): void => {},
303
370
  },
304
- "payment-details": {
305
- setPayment: (_payment: string | undefined): void => {},
306
- setOnClose: (_listener: (() => void) | undefined): void => {},
371
+ "app-viewport": {
372
+ setApp: (_app: string | undefined): void => {},
373
+ setAppData: (_appData: Record<string, string> | undefined): void => {},
307
374
  },
308
- "payment-disputes": {
309
- setPayment: (_payment: string | undefined): void => {},
310
- setOnDisputesLoaded: (
375
+ "payment-method-settings": {
376
+ setPaymentMethodConfiguration: (
377
+ _paymentMethodConfiguration: string | undefined
378
+ ): void => {},
379
+ },
380
+ "capital-financing": {
381
+ setDefaultFinancingOffer: (
382
+ _defaultFinancingOffer: string | undefined
383
+ ): void => {},
384
+ setShowFinancingSelector: (
385
+ _showFinancingSelector: boolean | undefined
386
+ ): void => {},
387
+ setHowCapitalWorksUrl: (
388
+ _howCapitalWorksUrl: string | undefined
389
+ ): void => {},
390
+ setSupportUrl: (_supportUrl: string | undefined): void => {},
391
+ setOnFinancingsLoaded: (
311
392
  _listener: (({ total }: { total: number }) => void) | undefined
312
393
  ): void => {},
313
394
  },
395
+ "capital-financing-application": {
396
+ setOnApplicationSubmitted: (
397
+ _listener: (() => void) | undefined
398
+ ): void => {},
399
+ setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined): void => {},
400
+ setHowCapitalWorksUrl: (
401
+ _howCapitalWorksUrl: string | undefined
402
+ ): void => {},
403
+ setOnApplicationStepChange: (
404
+ _listener: (({ step }: StepChange) => void) | undefined
405
+ ): void => {},
406
+ setDefaultFinancingOffer: (
407
+ _defaultFinancingOffer: string | undefined
408
+ ): void => {},
409
+ setOnApplicationInitiated: (
410
+ _listener: (() => void) | undefined
411
+ ): void => {},
412
+ setResumeInitiatedApplication: (
413
+ _resumeInitiatedApplication: boolean | undefined
414
+ ): void => {},
415
+ },
416
+ "capital-financing-promotion": {
417
+ setLayout: (_layout: FinancingPromotionLayoutType | undefined): void => {},
418
+ setOnApplicationSubmitted: (
419
+ _listener: (() => void) | undefined
420
+ ): void => {},
421
+ setOnEligibleFinancingOfferLoaded: (
422
+ _listener:
423
+ | (({
424
+ productType,
425
+ activeFinancingCount,
426
+ }: FinancingProductType) => void)
427
+ | undefined
428
+ ): void => {},
429
+ setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined): void => {},
430
+ setHowCapitalWorksUrl: (
431
+ _howCapitalWorksUrl: string | undefined
432
+ ): void => {},
433
+ setEligibilityCriteriaUrl: (
434
+ _eligibilityCriteriaUrl: string | undefined
435
+ ): void => {},
436
+ setOnApplicationStepChange: (
437
+ _listener: (({ step }: StepChange) => void) | undefined
438
+ ): void => {},
439
+ setOnAdvanceToCapitalFinancingApplication: (
440
+ _listener: (() => void) | undefined
441
+ ): void => {},
442
+ setDisableNestedCapitalFinancingApplication: (
443
+ _disableNestedCapitalFinancingApplication: boolean | undefined
444
+ ): void => {},
445
+ },
446
+ "reporting-chart": {
447
+ setReportName: (_reportName: ReportName): void => {},
448
+ setIntervalStart: (_intervalStart: Date | undefined): void => {},
449
+ setIntervalEnd: (_intervalEnd: Date | undefined): void => {},
450
+ setIntervalType: (_intervalType: IntervalType | undefined): void => {},
451
+ },
314
452
  "tax-settings": {
315
453
  setHideProductTaxCodeSelector: (_hidden: boolean | undefined): void => {},
316
454
  setDisplayHeadOfficeCountries: (
@@ -329,10 +467,46 @@ export const ConnectElementCustomMethodConfig = {
329
467
  _listener: (({ id }: { id: string }) => void) | undefined
330
468
  ): void => {},
331
469
  },
470
+ "tax-threshold-monitoring": {
471
+ setDisplayCountries: (_countries: string[] | undefined): void => {},
472
+ },
473
+ "product-tax-code-selector": {
474
+ setOnTaxCodeSelect: (
475
+ _listener:
476
+ | ((
477
+ taxCode: string | null,
478
+ _: { analyticsName: string } | null
479
+ ) => void)
480
+ | undefined
481
+ ): void => {},
482
+ setHideDescription: (_hideDescription: boolean | undefined): void => {},
483
+ setDisabled: (_disabled: boolean | undefined): void => {},
484
+ setInitialTaxCode: (_initialTaxCode: string | undefined): void => {},
485
+ },
486
+ "export-tax-transactions": {},
332
487
  "payout-details": {
333
488
  setPayout: (_payout: string | undefined): void => {},
334
489
  setOnClose: (_listener: (() => void) | undefined): void => {},
335
490
  },
491
+ "check-scanning": {
492
+ setHandleCheckScanSubmitted: (
493
+ _handleCheckScanSubmitted: ({
494
+ checkScanToken,
495
+ }: {
496
+ checkScanToken: string;
497
+ }) => Promise<void>
498
+ ): void => {},
499
+ },
500
+ "agentic-commerce-settings": {
501
+ setOnAgreementUpdated: (
502
+ _listener:
503
+ | (({ agreementId }: { agreementId: string }) => void)
504
+ | undefined
505
+ ): void => {},
506
+ },
507
+ "terminal-hardware-shop": {
508
+ setOnCheckoutFinished: (_listener: (() => void) | undefined): void => {},
509
+ },
336
510
  "payout-reconciliation-report": {
337
511
  setOnReportAvailabilityLoaded: (
338
512
  _listener:
@@ -2,6 +2,8 @@ import type {
2
2
  ConnectElementCommonMethodConfig,
3
3
  ConnectElementCustomMethodConfig,
4
4
  connectElementTagNames,
5
+ EmbeddedError,
6
+ EmbeddedErrorType,
5
7
  } from "../components/componentsAndSetters";
6
8
 
7
9
  export type LoadConnectAndInitialize = (
@@ -516,6 +518,67 @@ export type IStripeConnectUpdateParams = {
516
518
  displayOptions?: IStripeConnectDisplayOptions;
517
519
  };
518
520
 
521
+ /**
522
+ * Reasons why risk signals collection was skipped.
523
+ */
524
+ export type RiskSignalsCollectionSkippedReason =
525
+ /**
526
+ * Required component (account_onboarding) not enabled.
527
+ */
528
+ | "required_component_not_enabled"
529
+ /**
530
+ * The account doesn't have a risk signals collection requirement.
531
+ */
532
+ | "not_required"
533
+ /**
534
+ * The risk signals collection requirement has already been fulfilled.
535
+ */
536
+ | "requirement_fulfilled";
537
+
538
+ /**
539
+ * Error types that can occur during risk signals collection.
540
+ */
541
+ export type RiskSignalsCollectionErrorType = Extract<
542
+ EmbeddedErrorType,
543
+ | "api_connection_error"
544
+ | "invalid_request_error"
545
+ | "rate_limit_error"
546
+ | "api_error"
547
+ >;
548
+
549
+ /**
550
+ * Errors that can occur during risk signals collection.
551
+ */
552
+ export type RiskSignalsCollectionError =
553
+ /**
554
+ * Error occurred during general Connect.js loading.
555
+ */
556
+ | { type: "load_error"; loadError: EmbeddedError }
557
+
558
+ /**
559
+ * Error occurred during risk signals collection.
560
+ */
561
+ | { type: RiskSignalsCollectionErrorType; message?: string };
562
+
563
+ /**
564
+ * Event emitted during risk signals collection.
565
+ */
566
+ export declare type RiskSignalsCollectionEvent =
567
+ /**
568
+ * Risk signals collection completed and successfully received by Stripe.
569
+ */
570
+ | { status: "completed" }
571
+
572
+ /**
573
+ * Risk signals collection skipped with reason.
574
+ */
575
+ | { status: "skipped"; skippedReason: RiskSignalsCollectionSkippedReason }
576
+
577
+ /**
578
+ * Risk signals collection failed due to error and was not sent to Stripe server.
579
+ */
580
+ | { status: "failed"; error: RiskSignalsCollectionError };
581
+
519
582
  export interface IStripeConnectDisplayOptions {
520
583
  /**
521
584
  * Whether embedded components should show object id's in the UI
@@ -554,6 +617,12 @@ export interface IStripeConnectInitParams {
554
617
  */
555
618
  fonts?: Array<CssFontSource | CustomFontSource>;
556
619
 
620
+ /**
621
+ * Callback for risk signals collection event
622
+ * @param {RiskSignalsCollectionEvent} event - The risk signals collection event containing status and additional details.
623
+ */
624
+ onRiskSignalsCollection?: (event: RiskSignalsCollectionEvent) => void;
625
+
557
626
  /**
558
627
  * Options that affect how all embedded components under this instance render
559
628
  */