@stripe/connect-js 3.4.5 → 3.4.6-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.
@@ -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-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
  };
@@ -58,10 +62,21 @@ export type LoadError = {
58
62
  export type StepChange = {
59
63
  step: string;
60
64
  };
65
+ export type SectionOpen = {
66
+ sectionName: string;
67
+ };
61
68
  export type EmbeddedError = {
62
69
  type: EmbeddedErrorType;
63
70
  message?: string;
64
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";
65
80
  export type EmbeddedErrorType =
66
81
  /**
67
82
  * Failure to connect to Stripe's API.
@@ -96,6 +111,19 @@ export declare const ConnectElementCommonMethodConfig: {
96
111
  setOnLoaderStart: (_listener: (({ elementTagName }: LoaderStart) => void) | undefined) => void;
97
112
  };
98
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
+ };
99
127
  "account-onboarding": {
100
128
  setFullTermsOfServiceUrl: (_termOfServiceUrl: string | undefined) => void;
101
129
  setRecipientTermsOfServiceUrl: (_recipientTermsOfServiceUrl: string | undefined) => void;
@@ -107,6 +135,7 @@ export declare const ConnectElementCustomMethodConfig: {
107
135
  };
108
136
  "account-management": {
109
137
  setCollectionOptions: (_collectionOptions: CollectionOptions | undefined) => void;
138
+ setOnSectionOpen: (_listener: (({ sectionName }: SectionOpen) => void) | undefined) => void;
110
139
  };
111
140
  "notification-banner": {
112
141
  setCollectionOptions: (_collectionOptions: CollectionOptions | undefined) => void;
@@ -137,19 +166,52 @@ export declare const ConnectElementCustomMethodConfig: {
137
166
  "financial-account-transactions": {
138
167
  setFinancialAccount: (_financialAccount: string) => void;
139
168
  };
140
- payments: {
141
- setDefaultFilters: (_filters: PaymentsListDefaultFilters | undefined) => void;
169
+ recipients: {
170
+ setDataSource: (_dataSource: RecipientDataSource) => void;
142
171
  };
143
- "payment-details": {
144
- setPayment: (_payment: string | undefined) => void;
145
- setOnClose: (_listener: (() => void) | undefined) => void;
172
+ "app-install": {
173
+ setApp: (_app: string | undefined) => void;
174
+ setOnAppInstallStateFetched: (_listener: (({ appId, state }: InstallState) => void) | undefined) => void;
175
+ setOnAppInstallStateChanged: (_listener: (({ appId, state }: InstallState) => void) | undefined) => void;
146
176
  };
147
- "payment-disputes": {
148
- setPayment: (_payment: string | undefined) => void;
149
- setOnDisputesLoaded: (_listener: (({ total }: {
177
+ "app-viewport": {
178
+ setApp: (_app: string | undefined) => void;
179
+ setAppData: (_appData: Record<string, string> | undefined) => void;
180
+ };
181
+ "payment-method-settings": {
182
+ setPaymentMethodConfiguration: (_paymentMethodConfiguration: string | undefined) => void;
183
+ };
184
+ "capital-financing": {
185
+ setDefaultFinancingOffer: (_defaultFinancingOffer: string | undefined) => void;
186
+ setShowFinancingSelector: (_showFinancingSelector: boolean | undefined) => void;
187
+ setHowCapitalWorksUrl: (_howCapitalWorksUrl: string | undefined) => void;
188
+ setSupportUrl: (_supportUrl: string | undefined) => void;
189
+ setOnFinancingsLoaded: (_listener: (({ total }: {
150
190
  total: number;
151
191
  }) => void) | undefined) => void;
152
192
  };
193
+ "capital-financing-application": {
194
+ setOnApplicationSubmitted: (_listener: (() => void) | undefined) => void;
195
+ setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined) => void;
196
+ setHowCapitalWorksUrl: (_howCapitalWorksUrl: string | undefined) => void;
197
+ setOnApplicationStepChange: (_listener: (({ step }: StepChange) => void) | undefined) => void;
198
+ setDefaultFinancingOffer: (_defaultFinancingOffer: string | undefined) => void;
199
+ };
200
+ "capital-financing-promotion": {
201
+ setLayout: (_layout: FinancingPromotionLayoutType | undefined) => void;
202
+ setOnApplicationSubmitted: (_listener: (() => void) | undefined) => void;
203
+ setOnEligibleFinancingOfferLoaded: (_listener: (({ productType, activeFinancingCount, }: FinancingProductType) => void) | undefined) => void;
204
+ setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined) => void;
205
+ setHowCapitalWorksUrl: (_howCapitalWorksUrl: string | undefined) => void;
206
+ setEligibilityCriteriaUrl: (_eligibilityCriteriaUrl: string | undefined) => void;
207
+ setOnApplicationStepChange: (_listener: (({ step }: StepChange) => void) | undefined) => void;
208
+ };
209
+ "reporting-chart": {
210
+ setReportName: (_reportName: ReportName) => void;
211
+ setIntervalStart: (_intervalStart: Date | undefined) => void;
212
+ setIntervalEnd: (_intervalEnd: Date | undefined) => void;
213
+ setIntervalType: (_intervalType: IntervalType | undefined) => void;
214
+ };
153
215
  "tax-settings": {
154
216
  setHideProductTaxCodeSelector: (_hidden: boolean | undefined) => void;
155
217
  setDisplayHeadOfficeCountries: (_countries: string[] | undefined) => void;
@@ -166,10 +228,35 @@ export declare const ConnectElementCustomMethodConfig: {
166
228
  id: string;
167
229
  }) => void) | undefined) => void;
168
230
  };
231
+ "tax-threshold-monitoring": {
232
+ setDisplayCountries: (_countries: string[] | undefined) => void;
233
+ };
234
+ "product-tax-code-selector": {
235
+ setOnTaxCodeSelect: (_listener: ((taxCode: string | null, _: {
236
+ analyticsName: string;
237
+ } | null) => void) | undefined) => void;
238
+ setHideDescription: (_hideDescription: boolean | undefined) => void;
239
+ setDisabled: (_disabled: boolean | undefined) => void;
240
+ setInitialTaxCode: (_initialTaxCode: string | undefined) => void;
241
+ };
242
+ "export-tax-transactions": {};
169
243
  "payout-details": {
170
244
  setPayout: (_payout: string | undefined) => void;
171
245
  setOnClose: (_listener: (() => void) | undefined) => void;
172
246
  };
247
+ "check-scanning": {
248
+ setHandleCheckScanSubmitted: (_handleCheckScanSubmitted: ({ checkScanToken, }: {
249
+ checkScanToken: string;
250
+ }) => Promise<void>) => void;
251
+ };
252
+ "agentic-commerce-settings": {
253
+ setOnAgreementUpdated: (_listener: (({ agreementId }: {
254
+ agreementId: string;
255
+ }) => void) | undefined) => void;
256
+ };
257
+ "terminal-hardware-shop": {
258
+ setOnCheckoutFinished: (_listener: (() => void) | undefined) => void;
259
+ };
173
260
  "payout-reconciliation-report": {
174
261
  setOnReportAvailabilityLoaded: (_listener: (({ isReportAvailable }: {
175
262
  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-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 => {},
@@ -16,7 +27,8 @@ const ConnectElementCustomMethodConfig = {
16
27
  setOnStepChange: _listener => {}
17
28
  },
18
29
  "account-management": {
19
- setCollectionOptions: _collectionOptions => {}
30
+ setCollectionOptions: _collectionOptions => {},
31
+ setOnSectionOpen: _listener => {}
20
32
  },
21
33
  "notification-banner": {
22
34
  setCollectionOptions: _collectionOptions => {},
@@ -43,16 +55,49 @@ const ConnectElementCustomMethodConfig = {
43
55
  "financial-account-transactions": {
44
56
  setFinancialAccount: _financialAccount => {}
45
57
  },
46
- payments: {
47
- setDefaultFilters: _filters => {}
58
+ recipients: {
59
+ setDataSource: _dataSource => {}
48
60
  },
49
- "payment-details": {
50
- setPayment: _payment => {},
51
- setOnClose: _listener => {}
61
+ "app-install": {
62
+ setApp: _app => {},
63
+ setOnAppInstallStateFetched: _listener => {},
64
+ setOnAppInstallStateChanged: _listener => {}
52
65
  },
53
- "payment-disputes": {
54
- setPayment: _payment => {},
55
- setOnDisputesLoaded: _listener => {}
66
+ "app-viewport": {
67
+ setApp: _app => {},
68
+ setAppData: _appData => {}
69
+ },
70
+ "payment-method-settings": {
71
+ setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
72
+ },
73
+ "capital-financing": {
74
+ setDefaultFinancingOffer: _defaultFinancingOffer => {},
75
+ setShowFinancingSelector: _showFinancingSelector => {},
76
+ setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
77
+ setSupportUrl: _supportUrl => {},
78
+ setOnFinancingsLoaded: _listener => {}
79
+ },
80
+ "capital-financing-application": {
81
+ setOnApplicationSubmitted: _listener => {},
82
+ setPrivacyPolicyUrl: _privacyPolicyUrl => {},
83
+ setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
84
+ setOnApplicationStepChange: _listener => {},
85
+ setDefaultFinancingOffer: _defaultFinancingOffer => {}
86
+ },
87
+ "capital-financing-promotion": {
88
+ setLayout: _layout => {},
89
+ setOnApplicationSubmitted: _listener => {},
90
+ setOnEligibleFinancingOfferLoaded: _listener => {},
91
+ setPrivacyPolicyUrl: _privacyPolicyUrl => {},
92
+ setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
93
+ setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {},
94
+ setOnApplicationStepChange: _listener => {}
95
+ },
96
+ "reporting-chart": {
97
+ setReportName: _reportName => {},
98
+ setIntervalStart: _intervalStart => {},
99
+ setIntervalEnd: _intervalEnd => {},
100
+ setIntervalType: _intervalType => {}
56
101
  },
57
102
  "tax-settings": {
58
103
  setHideProductTaxCodeSelector: _hidden => {},
@@ -64,10 +109,29 @@ const ConnectElementCustomMethodConfig = {
64
109
  setDisplayCountries: _countries => {},
65
110
  setOnAfterTaxRegistrationExpired: _listener => {}
66
111
  },
112
+ "tax-threshold-monitoring": {
113
+ setDisplayCountries: _countries => {}
114
+ },
115
+ "product-tax-code-selector": {
116
+ setOnTaxCodeSelect: _listener => {},
117
+ setHideDescription: _hideDescription => {},
118
+ setDisabled: _disabled => {},
119
+ setInitialTaxCode: _initialTaxCode => {}
120
+ },
121
+ "export-tax-transactions": {},
67
122
  "payout-details": {
68
123
  setPayout: _payout => {},
69
124
  setOnClose: _listener => {}
70
125
  },
126
+ "check-scanning": {
127
+ setHandleCheckScanSubmitted: _handleCheckScanSubmitted => {}
128
+ },
129
+ "agentic-commerce-settings": {
130
+ setOnAgreementUpdated: _listener => {}
131
+ },
132
+ "terminal-hardware-shop": {
133
+ setOnCheckoutFinished: _listener => {}
134
+ },
71
135
  "payout-reconciliation-report": {
72
136
  setOnReportAvailabilityLoaded: _listener => {}
73
137
  }
@@ -173,7 +237,7 @@ const initStripeConnect = (stripePromise, initParams) => {
173
237
  element[method] = function (value) {
174
238
  stripeConnectInstance.then(() => {
175
239
  if (!this[`${method}InternalOnly`]) {
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.5`);
240
+ 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-preview.0`);
177
241
  }
178
242
  this[`${method}InternalOnly`](value);
179
243
  });
@@ -227,7 +291,7 @@ const createWrapper = stripeConnect => {
227
291
  sdk: true,
228
292
  sdkOptions: {
229
293
  // This will be replaced by the npm package version when bundling
230
- sdkVersion: "3.4.5"
294
+ sdkVersion: "3.4.6-preview.0"
231
295
  }
232
296
  })
233
297
  }));
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-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 => {},
@@ -20,7 +31,8 @@ const ConnectElementCustomMethodConfig = {
20
31
  setOnStepChange: _listener => {}
21
32
  },
22
33
  "account-management": {
23
- setCollectionOptions: _collectionOptions => {}
34
+ setCollectionOptions: _collectionOptions => {},
35
+ setOnSectionOpen: _listener => {}
24
36
  },
25
37
  "notification-banner": {
26
38
  setCollectionOptions: _collectionOptions => {},
@@ -47,16 +59,49 @@ const ConnectElementCustomMethodConfig = {
47
59
  "financial-account-transactions": {
48
60
  setFinancialAccount: _financialAccount => {}
49
61
  },
50
- payments: {
51
- setDefaultFilters: _filters => {}
62
+ recipients: {
63
+ setDataSource: _dataSource => {}
52
64
  },
53
- "payment-details": {
54
- setPayment: _payment => {},
55
- setOnClose: _listener => {}
65
+ "app-install": {
66
+ setApp: _app => {},
67
+ setOnAppInstallStateFetched: _listener => {},
68
+ setOnAppInstallStateChanged: _listener => {}
56
69
  },
57
- "payment-disputes": {
58
- setPayment: _payment => {},
59
- setOnDisputesLoaded: _listener => {}
70
+ "app-viewport": {
71
+ setApp: _app => {},
72
+ setAppData: _appData => {}
73
+ },
74
+ "payment-method-settings": {
75
+ setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
76
+ },
77
+ "capital-financing": {
78
+ setDefaultFinancingOffer: _defaultFinancingOffer => {},
79
+ setShowFinancingSelector: _showFinancingSelector => {},
80
+ setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
81
+ setSupportUrl: _supportUrl => {},
82
+ setOnFinancingsLoaded: _listener => {}
83
+ },
84
+ "capital-financing-application": {
85
+ setOnApplicationSubmitted: _listener => {},
86
+ setPrivacyPolicyUrl: _privacyPolicyUrl => {},
87
+ setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
88
+ setOnApplicationStepChange: _listener => {},
89
+ setDefaultFinancingOffer: _defaultFinancingOffer => {}
90
+ },
91
+ "capital-financing-promotion": {
92
+ setLayout: _layout => {},
93
+ setOnApplicationSubmitted: _listener => {},
94
+ setOnEligibleFinancingOfferLoaded: _listener => {},
95
+ setPrivacyPolicyUrl: _privacyPolicyUrl => {},
96
+ setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
97
+ setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {},
98
+ setOnApplicationStepChange: _listener => {}
99
+ },
100
+ "reporting-chart": {
101
+ setReportName: _reportName => {},
102
+ setIntervalStart: _intervalStart => {},
103
+ setIntervalEnd: _intervalEnd => {},
104
+ setIntervalType: _intervalType => {}
60
105
  },
61
106
  "tax-settings": {
62
107
  setHideProductTaxCodeSelector: _hidden => {},
@@ -68,10 +113,29 @@ const ConnectElementCustomMethodConfig = {
68
113
  setDisplayCountries: _countries => {},
69
114
  setOnAfterTaxRegistrationExpired: _listener => {}
70
115
  },
116
+ "tax-threshold-monitoring": {
117
+ setDisplayCountries: _countries => {}
118
+ },
119
+ "product-tax-code-selector": {
120
+ setOnTaxCodeSelect: _listener => {},
121
+ setHideDescription: _hideDescription => {},
122
+ setDisabled: _disabled => {},
123
+ setInitialTaxCode: _initialTaxCode => {}
124
+ },
125
+ "export-tax-transactions": {},
71
126
  "payout-details": {
72
127
  setPayout: _payout => {},
73
128
  setOnClose: _listener => {}
74
129
  },
130
+ "check-scanning": {
131
+ setHandleCheckScanSubmitted: _handleCheckScanSubmitted => {}
132
+ },
133
+ "agentic-commerce-settings": {
134
+ setOnAgreementUpdated: _listener => {}
135
+ },
136
+ "terminal-hardware-shop": {
137
+ setOnCheckoutFinished: _listener => {}
138
+ },
75
139
  "payout-reconciliation-report": {
76
140
  setOnReportAvailabilityLoaded: _listener => {}
77
141
  }
@@ -177,7 +241,7 @@ const initStripeConnect = (stripePromise, initParams) => {
177
241
  element[method] = function (value) {
178
242
  stripeConnectInstance.then(() => {
179
243
  if (!this[`${method}InternalOnly`]) {
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.5`);
244
+ 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-preview.0`);
181
245
  }
182
246
  this[`${method}InternalOnly`](value);
183
247
  });
@@ -231,7 +295,7 @@ const createWrapper = stripeConnect => {
231
295
  sdk: true,
232
296
  sdkOptions: {
233
297
  // This will be replaced by the npm package version when bundling
234
- sdkVersion: "3.4.5"
298
+ sdkVersion: "3.4.6-preview.0"
235
299
  }
236
300
  })
237
301
  }));
@@ -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-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-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-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 => {},
@@ -16,7 +27,8 @@ const ConnectElementCustomMethodConfig = {
16
27
  setOnStepChange: _listener => {}
17
28
  },
18
29
  "account-management": {
19
- setCollectionOptions: _collectionOptions => {}
30
+ setCollectionOptions: _collectionOptions => {},
31
+ setOnSectionOpen: _listener => {}
20
32
  },
21
33
  "notification-banner": {
22
34
  setCollectionOptions: _collectionOptions => {},
@@ -43,16 +55,49 @@ const ConnectElementCustomMethodConfig = {
43
55
  "financial-account-transactions": {
44
56
  setFinancialAccount: _financialAccount => {}
45
57
  },
46
- payments: {
47
- setDefaultFilters: _filters => {}
58
+ recipients: {
59
+ setDataSource: _dataSource => {}
48
60
  },
49
- "payment-details": {
50
- setPayment: _payment => {},
51
- setOnClose: _listener => {}
61
+ "app-install": {
62
+ setApp: _app => {},
63
+ setOnAppInstallStateFetched: _listener => {},
64
+ setOnAppInstallStateChanged: _listener => {}
52
65
  },
53
- "payment-disputes": {
54
- setPayment: _payment => {},
55
- setOnDisputesLoaded: _listener => {}
66
+ "app-viewport": {
67
+ setApp: _app => {},
68
+ setAppData: _appData => {}
69
+ },
70
+ "payment-method-settings": {
71
+ setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
72
+ },
73
+ "capital-financing": {
74
+ setDefaultFinancingOffer: _defaultFinancingOffer => {},
75
+ setShowFinancingSelector: _showFinancingSelector => {},
76
+ setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
77
+ setSupportUrl: _supportUrl => {},
78
+ setOnFinancingsLoaded: _listener => {}
79
+ },
80
+ "capital-financing-application": {
81
+ setOnApplicationSubmitted: _listener => {},
82
+ setPrivacyPolicyUrl: _privacyPolicyUrl => {},
83
+ setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
84
+ setOnApplicationStepChange: _listener => {},
85
+ setDefaultFinancingOffer: _defaultFinancingOffer => {}
86
+ },
87
+ "capital-financing-promotion": {
88
+ setLayout: _layout => {},
89
+ setOnApplicationSubmitted: _listener => {},
90
+ setOnEligibleFinancingOfferLoaded: _listener => {},
91
+ setPrivacyPolicyUrl: _privacyPolicyUrl => {},
92
+ setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
93
+ setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {},
94
+ setOnApplicationStepChange: _listener => {}
95
+ },
96
+ "reporting-chart": {
97
+ setReportName: _reportName => {},
98
+ setIntervalStart: _intervalStart => {},
99
+ setIntervalEnd: _intervalEnd => {},
100
+ setIntervalType: _intervalType => {}
56
101
  },
57
102
  "tax-settings": {
58
103
  setHideProductTaxCodeSelector: _hidden => {},
@@ -64,10 +109,29 @@ const ConnectElementCustomMethodConfig = {
64
109
  setDisplayCountries: _countries => {},
65
110
  setOnAfterTaxRegistrationExpired: _listener => {}
66
111
  },
112
+ "tax-threshold-monitoring": {
113
+ setDisplayCountries: _countries => {}
114
+ },
115
+ "product-tax-code-selector": {
116
+ setOnTaxCodeSelect: _listener => {},
117
+ setHideDescription: _hideDescription => {},
118
+ setDisabled: _disabled => {},
119
+ setInitialTaxCode: _initialTaxCode => {}
120
+ },
121
+ "export-tax-transactions": {},
67
122
  "payout-details": {
68
123
  setPayout: _payout => {},
69
124
  setOnClose: _listener => {}
70
125
  },
126
+ "check-scanning": {
127
+ setHandleCheckScanSubmitted: _handleCheckScanSubmitted => {}
128
+ },
129
+ "agentic-commerce-settings": {
130
+ setOnAgreementUpdated: _listener => {}
131
+ },
132
+ "terminal-hardware-shop": {
133
+ setOnCheckoutFinished: _listener => {}
134
+ },
71
135
  "payout-reconciliation-report": {
72
136
  setOnReportAvailabilityLoaded: _listener => {}
73
137
  }
@@ -173,7 +237,7 @@ const initStripeConnect = (stripePromise, initParams) => {
173
237
  element[method] = function (value) {
174
238
  stripeConnectInstance.then(() => {
175
239
  if (!this[`${method}InternalOnly`]) {
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.5`);
240
+ 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-preview.0`);
177
241
  }
178
242
  this[`${method}InternalOnly`](value);
179
243
  });
@@ -227,7 +291,7 @@ const createWrapper = stripeConnect => {
227
291
  sdk: true,
228
292
  sdkOptions: {
229
293
  // This will be replaced by the npm package version when bundling
230
- sdkVersion: "3.4.5"
294
+ sdkVersion: "3.4.6-preview.0"
231
295
  }
232
296
  })
233
297
  }));
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-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 => {},
@@ -20,7 +31,8 @@ const ConnectElementCustomMethodConfig = {
20
31
  setOnStepChange: _listener => {}
21
32
  },
22
33
  "account-management": {
23
- setCollectionOptions: _collectionOptions => {}
34
+ setCollectionOptions: _collectionOptions => {},
35
+ setOnSectionOpen: _listener => {}
24
36
  },
25
37
  "notification-banner": {
26
38
  setCollectionOptions: _collectionOptions => {},
@@ -47,16 +59,49 @@ const ConnectElementCustomMethodConfig = {
47
59
  "financial-account-transactions": {
48
60
  setFinancialAccount: _financialAccount => {}
49
61
  },
50
- payments: {
51
- setDefaultFilters: _filters => {}
62
+ recipients: {
63
+ setDataSource: _dataSource => {}
52
64
  },
53
- "payment-details": {
54
- setPayment: _payment => {},
55
- setOnClose: _listener => {}
65
+ "app-install": {
66
+ setApp: _app => {},
67
+ setOnAppInstallStateFetched: _listener => {},
68
+ setOnAppInstallStateChanged: _listener => {}
56
69
  },
57
- "payment-disputes": {
58
- setPayment: _payment => {},
59
- setOnDisputesLoaded: _listener => {}
70
+ "app-viewport": {
71
+ setApp: _app => {},
72
+ setAppData: _appData => {}
73
+ },
74
+ "payment-method-settings": {
75
+ setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
76
+ },
77
+ "capital-financing": {
78
+ setDefaultFinancingOffer: _defaultFinancingOffer => {},
79
+ setShowFinancingSelector: _showFinancingSelector => {},
80
+ setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
81
+ setSupportUrl: _supportUrl => {},
82
+ setOnFinancingsLoaded: _listener => {}
83
+ },
84
+ "capital-financing-application": {
85
+ setOnApplicationSubmitted: _listener => {},
86
+ setPrivacyPolicyUrl: _privacyPolicyUrl => {},
87
+ setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
88
+ setOnApplicationStepChange: _listener => {},
89
+ setDefaultFinancingOffer: _defaultFinancingOffer => {}
90
+ },
91
+ "capital-financing-promotion": {
92
+ setLayout: _layout => {},
93
+ setOnApplicationSubmitted: _listener => {},
94
+ setOnEligibleFinancingOfferLoaded: _listener => {},
95
+ setPrivacyPolicyUrl: _privacyPolicyUrl => {},
96
+ setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
97
+ setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {},
98
+ setOnApplicationStepChange: _listener => {}
99
+ },
100
+ "reporting-chart": {
101
+ setReportName: _reportName => {},
102
+ setIntervalStart: _intervalStart => {},
103
+ setIntervalEnd: _intervalEnd => {},
104
+ setIntervalType: _intervalType => {}
60
105
  },
61
106
  "tax-settings": {
62
107
  setHideProductTaxCodeSelector: _hidden => {},
@@ -68,10 +113,29 @@ const ConnectElementCustomMethodConfig = {
68
113
  setDisplayCountries: _countries => {},
69
114
  setOnAfterTaxRegistrationExpired: _listener => {}
70
115
  },
116
+ "tax-threshold-monitoring": {
117
+ setDisplayCountries: _countries => {}
118
+ },
119
+ "product-tax-code-selector": {
120
+ setOnTaxCodeSelect: _listener => {},
121
+ setHideDescription: _hideDescription => {},
122
+ setDisabled: _disabled => {},
123
+ setInitialTaxCode: _initialTaxCode => {}
124
+ },
125
+ "export-tax-transactions": {},
71
126
  "payout-details": {
72
127
  setPayout: _payout => {},
73
128
  setOnClose: _listener => {}
74
129
  },
130
+ "check-scanning": {
131
+ setHandleCheckScanSubmitted: _handleCheckScanSubmitted => {}
132
+ },
133
+ "agentic-commerce-settings": {
134
+ setOnAgreementUpdated: _listener => {}
135
+ },
136
+ "terminal-hardware-shop": {
137
+ setOnCheckoutFinished: _listener => {}
138
+ },
75
139
  "payout-reconciliation-report": {
76
140
  setOnReportAvailabilityLoaded: _listener => {}
77
141
  }
@@ -177,7 +241,7 @@ const initStripeConnect = (stripePromise, initParams) => {
177
241
  element[method] = function (value) {
178
242
  stripeConnectInstance.then(() => {
179
243
  if (!this[`${method}InternalOnly`]) {
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.5`);
244
+ 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-preview.0`);
181
245
  }
182
246
  this[`${method}InternalOnly`](value);
183
247
  });
@@ -231,7 +295,7 @@ const createWrapper = stripeConnect => {
231
295
  sdk: true,
232
296
  sdkOptions: {
233
297
  // This will be replaced by the npm package version when bundling
234
- sdkVersion: "3.4.5"
298
+ sdkVersion: "3.4.6-preview.0"
235
299
  }
236
300
  })
237
301
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/connect-js",
3
- "version": "3.4.5",
3
+ "version": "3.4.6-preview.0",
4
4
  "description": "Connect.js loading utility package (preview version)",
5
5
  "main": "dist/connect.js",
6
6
  "module": "dist/connect.esm.js",
@@ -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,53 @@
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",
20
19
  "financial-account-transactions",
20
+ "recipients",
21
+ "capital-financing",
22
+ "capital-financing-application",
23
+ "capital-financing-promotion",
24
+ "capital-overview",
21
25
  "documents",
26
+ "product-tax-code-selector",
27
+ "export-tax-transactions",
22
28
  "tax-registrations",
23
29
  "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",
24
42
  "balance-report",
25
43
  "payout-reconciliation-report",
44
+ "recipients-list",
45
+ "financial-accounts",
46
+ "financial-accounts-transactions",
47
+ "bills",
26
48
  ] as const;
27
49
 
28
50
  // 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.
51
+
29
52
  export type FetchEphemeralKeyFunction = (fetchParams: {
30
53
  issuingCard: string;
31
54
  nonce: string;
@@ -166,6 +189,11 @@ export type NotificationCount = {
166
189
  actionRequired: number;
167
190
  };
168
191
 
192
+ export type InstallState = {
193
+ appId: string;
194
+ state: "INSTALLED" | "UNINSTALLED";
195
+ };
196
+
169
197
  export type LoaderStart = {
170
198
  elementTagName: string;
171
199
  };
@@ -179,11 +207,28 @@ export type StepChange = {
179
207
  step: string;
180
208
  };
181
209
 
210
+ export type SectionOpen = {
211
+ sectionName: string;
212
+ };
213
+
182
214
  export type EmbeddedError = {
183
215
  type: EmbeddedErrorType;
184
216
  message?: string;
185
217
  };
186
218
 
219
+ export type FinancingProductType = {
220
+ productType: "standard" | "refill" | "none";
221
+ activeFinancingCount: number;
222
+ };
223
+
224
+ export type FinancingPromotionLayoutType = "full" | "banner";
225
+
226
+ export type IntervalType = "day" | "week" | "month" | "quarter" | "year";
227
+
228
+ export type ReportName = "gross_volume" | "net_volume";
229
+
230
+ export type RecipientDataSource = "customers";
231
+
187
232
  export type EmbeddedErrorType =
188
233
  /**
189
234
  * Failure to connect to Stripe's API.
@@ -224,6 +269,21 @@ export const ConnectElementCommonMethodConfig = {
224
269
  };
225
270
 
226
271
  export const ConnectElementCustomMethodConfig = {
272
+ payments: {
273
+ setDefaultFilters: (
274
+ _filters: PaymentsListDefaultFilters | undefined
275
+ ): void => {},
276
+ },
277
+ "payment-details": {
278
+ setPayment: (_payment: string | undefined): void => {},
279
+ setOnClose: (_listener: (() => void) | undefined): void => {},
280
+ },
281
+ "payment-disputes": {
282
+ setPayment: (_payment: string | undefined): void => {},
283
+ setOnDisputesLoaded: (
284
+ _listener: (({ total }: { total: number }) => void) | undefined
285
+ ): void => {},
286
+ },
227
287
  "account-onboarding": {
228
288
  setFullTermsOfServiceUrl: (
229
289
  _termOfServiceUrl: string | undefined
@@ -247,6 +307,9 @@ export const ConnectElementCustomMethodConfig = {
247
307
  setCollectionOptions: (
248
308
  _collectionOptions: CollectionOptions | undefined
249
309
  ): void => {},
310
+ setOnSectionOpen: (
311
+ _listener: (({ sectionName }: SectionOpen) => void) | undefined
312
+ ): void => {},
250
313
  },
251
314
  "notification-banner": {
252
315
  setCollectionOptions: (
@@ -289,21 +352,87 @@ export const ConnectElementCustomMethodConfig = {
289
352
  "financial-account-transactions": {
290
353
  setFinancialAccount: (_financialAccount: string): void => {},
291
354
  },
292
- payments: {
293
- setDefaultFilters: (
294
- _filters: PaymentsListDefaultFilters | undefined
355
+ recipients: {
356
+ setDataSource: (_dataSource: RecipientDataSource): void => {},
357
+ },
358
+ "app-install": {
359
+ setApp: (_app: string | undefined): void => {},
360
+ setOnAppInstallStateFetched: (
361
+ _listener: (({ appId, state }: InstallState) => void) | undefined
362
+ ): void => {},
363
+ setOnAppInstallStateChanged: (
364
+ _listener: (({ appId, state }: InstallState) => void) | undefined
295
365
  ): void => {},
296
366
  },
297
- "payment-details": {
298
- setPayment: (_payment: string | undefined): void => {},
299
- setOnClose: (_listener: (() => void) | undefined): void => {},
367
+ "app-viewport": {
368
+ setApp: (_app: string | undefined): void => {},
369
+ setAppData: (_appData: Record<string, string> | undefined): void => {},
300
370
  },
301
- "payment-disputes": {
302
- setPayment: (_payment: string | undefined): void => {},
303
- setOnDisputesLoaded: (
371
+ "payment-method-settings": {
372
+ setPaymentMethodConfiguration: (
373
+ _paymentMethodConfiguration: string | undefined
374
+ ): void => {},
375
+ },
376
+ "capital-financing": {
377
+ setDefaultFinancingOffer: (
378
+ _defaultFinancingOffer: string | undefined
379
+ ): void => {},
380
+ setShowFinancingSelector: (
381
+ _showFinancingSelector: boolean | undefined
382
+ ): void => {},
383
+ setHowCapitalWorksUrl: (
384
+ _howCapitalWorksUrl: string | undefined
385
+ ): void => {},
386
+ setSupportUrl: (_supportUrl: string | undefined): void => {},
387
+ setOnFinancingsLoaded: (
304
388
  _listener: (({ total }: { total: number }) => void) | undefined
305
389
  ): void => {},
306
390
  },
391
+ "capital-financing-application": {
392
+ setOnApplicationSubmitted: (
393
+ _listener: (() => void) | undefined
394
+ ): void => {},
395
+ setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined): void => {},
396
+ setHowCapitalWorksUrl: (
397
+ _howCapitalWorksUrl: string | undefined
398
+ ): void => {},
399
+ setOnApplicationStepChange: (
400
+ _listener: (({ step }: StepChange) => void) | undefined
401
+ ): void => {},
402
+ setDefaultFinancingOffer: (
403
+ _defaultFinancingOffer: string | undefined
404
+ ): void => {},
405
+ },
406
+ "capital-financing-promotion": {
407
+ setLayout: (_layout: FinancingPromotionLayoutType | undefined): void => {},
408
+ setOnApplicationSubmitted: (
409
+ _listener: (() => void) | undefined
410
+ ): void => {},
411
+ setOnEligibleFinancingOfferLoaded: (
412
+ _listener:
413
+ | (({
414
+ productType,
415
+ activeFinancingCount,
416
+ }: FinancingProductType) => void)
417
+ | undefined
418
+ ): void => {},
419
+ setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined): void => {},
420
+ setHowCapitalWorksUrl: (
421
+ _howCapitalWorksUrl: string | undefined
422
+ ): void => {},
423
+ setEligibilityCriteriaUrl: (
424
+ _eligibilityCriteriaUrl: string | undefined
425
+ ): void => {},
426
+ setOnApplicationStepChange: (
427
+ _listener: (({ step }: StepChange) => void) | undefined
428
+ ): void => {},
429
+ },
430
+ "reporting-chart": {
431
+ setReportName: (_reportName: ReportName): void => {},
432
+ setIntervalStart: (_intervalStart: Date | undefined): void => {},
433
+ setIntervalEnd: (_intervalEnd: Date | undefined): void => {},
434
+ setIntervalType: (_intervalType: IntervalType | undefined): void => {},
435
+ },
307
436
  "tax-settings": {
308
437
  setHideProductTaxCodeSelector: (_hidden: boolean | undefined): void => {},
309
438
  setDisplayHeadOfficeCountries: (
@@ -322,10 +451,46 @@ export const ConnectElementCustomMethodConfig = {
322
451
  _listener: (({ id }: { id: string }) => void) | undefined
323
452
  ): void => {},
324
453
  },
454
+ "tax-threshold-monitoring": {
455
+ setDisplayCountries: (_countries: string[] | undefined): void => {},
456
+ },
457
+ "product-tax-code-selector": {
458
+ setOnTaxCodeSelect: (
459
+ _listener:
460
+ | ((
461
+ taxCode: string | null,
462
+ _: { analyticsName: string } | null
463
+ ) => void)
464
+ | undefined
465
+ ): void => {},
466
+ setHideDescription: (_hideDescription: boolean | undefined): void => {},
467
+ setDisabled: (_disabled: boolean | undefined): void => {},
468
+ setInitialTaxCode: (_initialTaxCode: string | undefined): void => {},
469
+ },
470
+ "export-tax-transactions": {},
325
471
  "payout-details": {
326
472
  setPayout: (_payout: string | undefined): void => {},
327
473
  setOnClose: (_listener: (() => void) | undefined): void => {},
328
474
  },
475
+ "check-scanning": {
476
+ setHandleCheckScanSubmitted: (
477
+ _handleCheckScanSubmitted: ({
478
+ checkScanToken,
479
+ }: {
480
+ checkScanToken: string;
481
+ }) => Promise<void>
482
+ ): void => {},
483
+ },
484
+ "agentic-commerce-settings": {
485
+ setOnAgreementUpdated: (
486
+ _listener:
487
+ | (({ agreementId }: { agreementId: string }) => void)
488
+ | undefined
489
+ ): void => {},
490
+ },
491
+ "terminal-hardware-shop": {
492
+ setOnCheckoutFinished: (_listener: (() => void) | undefined): void => {},
493
+ },
329
494
  "payout-reconciliation-report": {
330
495
  setOnReportAvailabilityLoaded: (
331
496
  _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
  */