@stripe/connect-js 3.4.6 → 3.4.7-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 +80 -0
- package/dist/components/componentsAndSetters.d.ts +96 -9
- package/dist/connect.esm.js +78 -11
- package/dist/connect.js +78 -11
- package/dist/exportedTypes/shared.d.ts +68 -1
- package/dist/init.d.ts +1 -1
- package/dist/pure.esm.js +78 -11
- package/dist/pure.js +78 -11
- package/package.json +4 -4
- package/src/components/componentsAndSetters.ts +185 -15
- package/src/exportedTypes/shared.ts +69 -0
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 ["
|
|
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
|
};
|
|
@@ -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;
|
|
@@ -141,19 +166,56 @@ export declare const ConnectElementCustomMethodConfig: {
|
|
|
141
166
|
"financial-account-transactions": {
|
|
142
167
|
setFinancialAccount: (_financialAccount: string) => void;
|
|
143
168
|
};
|
|
144
|
-
|
|
145
|
-
|
|
169
|
+
recipients: {
|
|
170
|
+
setDataSource: (_dataSource: RecipientDataSource) => void;
|
|
146
171
|
};
|
|
147
|
-
"
|
|
148
|
-
|
|
149
|
-
|
|
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;
|
|
150
176
|
};
|
|
151
|
-
"
|
|
152
|
-
|
|
153
|
-
|
|
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 }: {
|
|
154
190
|
total: number;
|
|
155
191
|
}) => void) | undefined) => void;
|
|
156
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
|
+
setOnApplicationInitiated: (_listener: (() => void) | undefined) => void;
|
|
200
|
+
setResumeInitiatedApplication: (_resumeInitiatedApplication: boolean | undefined) => void;
|
|
201
|
+
};
|
|
202
|
+
"capital-financing-promotion": {
|
|
203
|
+
setLayout: (_layout: FinancingPromotionLayoutType | undefined) => void;
|
|
204
|
+
setOnApplicationSubmitted: (_listener: (() => void) | undefined) => void;
|
|
205
|
+
setOnEligibleFinancingOfferLoaded: (_listener: (({ productType, activeFinancingCount, }: FinancingProductType) => void) | undefined) => void;
|
|
206
|
+
setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined) => void;
|
|
207
|
+
setHowCapitalWorksUrl: (_howCapitalWorksUrl: string | undefined) => void;
|
|
208
|
+
setEligibilityCriteriaUrl: (_eligibilityCriteriaUrl: string | undefined) => void;
|
|
209
|
+
setOnApplicationStepChange: (_listener: (({ step }: StepChange) => void) | undefined) => void;
|
|
210
|
+
setOnAdvanceToCapitalFinancingApplication: (_listener: (() => void) | undefined) => void;
|
|
211
|
+
setDisableNestedCapitalFinancingApplication: (_disableNestedCapitalFinancingApplication: boolean | undefined) => void;
|
|
212
|
+
};
|
|
213
|
+
"reporting-chart": {
|
|
214
|
+
setReportName: (_reportName: ReportName) => void;
|
|
215
|
+
setIntervalStart: (_intervalStart: Date | undefined) => void;
|
|
216
|
+
setIntervalEnd: (_intervalEnd: Date | undefined) => void;
|
|
217
|
+
setIntervalType: (_intervalType: IntervalType | undefined) => void;
|
|
218
|
+
};
|
|
157
219
|
"tax-settings": {
|
|
158
220
|
setHideProductTaxCodeSelector: (_hidden: boolean | undefined) => void;
|
|
159
221
|
setDisplayHeadOfficeCountries: (_countries: string[] | undefined) => void;
|
|
@@ -170,10 +232,35 @@ export declare const ConnectElementCustomMethodConfig: {
|
|
|
170
232
|
id: string;
|
|
171
233
|
}) => void) | undefined) => void;
|
|
172
234
|
};
|
|
235
|
+
"tax-threshold-monitoring": {
|
|
236
|
+
setDisplayCountries: (_countries: string[] | undefined) => void;
|
|
237
|
+
};
|
|
238
|
+
"product-tax-code-selector": {
|
|
239
|
+
setOnTaxCodeSelect: (_listener: ((taxCode: string | null, _: {
|
|
240
|
+
analyticsName: string;
|
|
241
|
+
} | null) => void) | undefined) => void;
|
|
242
|
+
setHideDescription: (_hideDescription: boolean | undefined) => void;
|
|
243
|
+
setDisabled: (_disabled: boolean | undefined) => void;
|
|
244
|
+
setInitialTaxCode: (_initialTaxCode: string | undefined) => void;
|
|
245
|
+
};
|
|
246
|
+
"export-tax-transactions": {};
|
|
173
247
|
"payout-details": {
|
|
174
248
|
setPayout: (_payout: string | undefined) => void;
|
|
175
249
|
setOnClose: (_listener: (() => void) | undefined) => void;
|
|
176
250
|
};
|
|
251
|
+
"check-scanning": {
|
|
252
|
+
setHandleCheckScanSubmitted: (_handleCheckScanSubmitted: ({ checkScanToken, }: {
|
|
253
|
+
checkScanToken: string;
|
|
254
|
+
}) => Promise<void>) => void;
|
|
255
|
+
};
|
|
256
|
+
"agentic-commerce-settings": {
|
|
257
|
+
setOnAgreementUpdated: (_listener: (({ agreementId }: {
|
|
258
|
+
agreementId: string;
|
|
259
|
+
}) => void) | undefined) => void;
|
|
260
|
+
};
|
|
261
|
+
"terminal-hardware-shop": {
|
|
262
|
+
setOnCheckoutFinished: (_listener: (() => void) | undefined) => void;
|
|
263
|
+
};
|
|
177
264
|
"payout-reconciliation-report": {
|
|
178
265
|
setOnReportAvailabilityLoaded: (_listener: (({ isReportAvailable }: {
|
|
179
266
|
isReportAvailable: boolean;
|
package/dist/connect.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 = ["
|
|
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 => {},
|
|
@@ -44,16 +55,53 @@ const ConnectElementCustomMethodConfig = {
|
|
|
44
55
|
"financial-account-transactions": {
|
|
45
56
|
setFinancialAccount: _financialAccount => {}
|
|
46
57
|
},
|
|
47
|
-
|
|
48
|
-
|
|
58
|
+
recipients: {
|
|
59
|
+
setDataSource: _dataSource => {}
|
|
49
60
|
},
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
61
|
+
"app-install": {
|
|
62
|
+
setApp: _app => {},
|
|
63
|
+
setOnAppInstallStateFetched: _listener => {},
|
|
64
|
+
setOnAppInstallStateChanged: _listener => {}
|
|
53
65
|
},
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
|
|
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
|
+
setOnApplicationInitiated: _listener => {},
|
|
87
|
+
setResumeInitiatedApplication: _resumeInitiatedApplication => {}
|
|
88
|
+
},
|
|
89
|
+
"capital-financing-promotion": {
|
|
90
|
+
setLayout: _layout => {},
|
|
91
|
+
setOnApplicationSubmitted: _listener => {},
|
|
92
|
+
setOnEligibleFinancingOfferLoaded: _listener => {},
|
|
93
|
+
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
94
|
+
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
95
|
+
setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {},
|
|
96
|
+
setOnApplicationStepChange: _listener => {},
|
|
97
|
+
setOnAdvanceToCapitalFinancingApplication: _listener => {},
|
|
98
|
+
setDisableNestedCapitalFinancingApplication: _disableNestedCapitalFinancingApplication => {}
|
|
99
|
+
},
|
|
100
|
+
"reporting-chart": {
|
|
101
|
+
setReportName: _reportName => {},
|
|
102
|
+
setIntervalStart: _intervalStart => {},
|
|
103
|
+
setIntervalEnd: _intervalEnd => {},
|
|
104
|
+
setIntervalType: _intervalType => {}
|
|
57
105
|
},
|
|
58
106
|
"tax-settings": {
|
|
59
107
|
setHideProductTaxCodeSelector: _hidden => {},
|
|
@@ -65,10 +113,29 @@ const ConnectElementCustomMethodConfig = {
|
|
|
65
113
|
setDisplayCountries: _countries => {},
|
|
66
114
|
setOnAfterTaxRegistrationExpired: _listener => {}
|
|
67
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": {},
|
|
68
126
|
"payout-details": {
|
|
69
127
|
setPayout: _payout => {},
|
|
70
128
|
setOnClose: _listener => {}
|
|
71
129
|
},
|
|
130
|
+
"check-scanning": {
|
|
131
|
+
setHandleCheckScanSubmitted: _handleCheckScanSubmitted => {}
|
|
132
|
+
},
|
|
133
|
+
"agentic-commerce-settings": {
|
|
134
|
+
setOnAgreementUpdated: _listener => {}
|
|
135
|
+
},
|
|
136
|
+
"terminal-hardware-shop": {
|
|
137
|
+
setOnCheckoutFinished: _listener => {}
|
|
138
|
+
},
|
|
72
139
|
"payout-reconciliation-report": {
|
|
73
140
|
setOnReportAvailabilityLoaded: _listener => {}
|
|
74
141
|
}
|
|
@@ -174,7 +241,7 @@ const initStripeConnect = (stripePromise, initParams) => {
|
|
|
174
241
|
element[method] = function (value) {
|
|
175
242
|
stripeConnectInstance.then(() => {
|
|
176
243
|
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.
|
|
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.7-preview.0`);
|
|
178
245
|
}
|
|
179
246
|
this[`${method}InternalOnly`](value);
|
|
180
247
|
});
|
|
@@ -228,7 +295,7 @@ const createWrapper = stripeConnect => {
|
|
|
228
295
|
sdk: true,
|
|
229
296
|
sdkOptions: {
|
|
230
297
|
// This will be replaced by the npm package version when bundling
|
|
231
|
-
sdkVersion: "3.4.
|
|
298
|
+
sdkVersion: "3.4.7-preview.0"
|
|
232
299
|
}
|
|
233
300
|
})
|
|
234
301
|
}));
|
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 = ["
|
|
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 => {},
|
|
@@ -48,16 +59,53 @@ const ConnectElementCustomMethodConfig = {
|
|
|
48
59
|
"financial-account-transactions": {
|
|
49
60
|
setFinancialAccount: _financialAccount => {}
|
|
50
61
|
},
|
|
51
|
-
|
|
52
|
-
|
|
62
|
+
recipients: {
|
|
63
|
+
setDataSource: _dataSource => {}
|
|
53
64
|
},
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
|
|
65
|
+
"app-install": {
|
|
66
|
+
setApp: _app => {},
|
|
67
|
+
setOnAppInstallStateFetched: _listener => {},
|
|
68
|
+
setOnAppInstallStateChanged: _listener => {}
|
|
57
69
|
},
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
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
|
+
setOnApplicationInitiated: _listener => {},
|
|
91
|
+
setResumeInitiatedApplication: _resumeInitiatedApplication => {}
|
|
92
|
+
},
|
|
93
|
+
"capital-financing-promotion": {
|
|
94
|
+
setLayout: _layout => {},
|
|
95
|
+
setOnApplicationSubmitted: _listener => {},
|
|
96
|
+
setOnEligibleFinancingOfferLoaded: _listener => {},
|
|
97
|
+
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
98
|
+
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
99
|
+
setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {},
|
|
100
|
+
setOnApplicationStepChange: _listener => {},
|
|
101
|
+
setOnAdvanceToCapitalFinancingApplication: _listener => {},
|
|
102
|
+
setDisableNestedCapitalFinancingApplication: _disableNestedCapitalFinancingApplication => {}
|
|
103
|
+
},
|
|
104
|
+
"reporting-chart": {
|
|
105
|
+
setReportName: _reportName => {},
|
|
106
|
+
setIntervalStart: _intervalStart => {},
|
|
107
|
+
setIntervalEnd: _intervalEnd => {},
|
|
108
|
+
setIntervalType: _intervalType => {}
|
|
61
109
|
},
|
|
62
110
|
"tax-settings": {
|
|
63
111
|
setHideProductTaxCodeSelector: _hidden => {},
|
|
@@ -69,10 +117,29 @@ const ConnectElementCustomMethodConfig = {
|
|
|
69
117
|
setDisplayCountries: _countries => {},
|
|
70
118
|
setOnAfterTaxRegistrationExpired: _listener => {}
|
|
71
119
|
},
|
|
120
|
+
"tax-threshold-monitoring": {
|
|
121
|
+
setDisplayCountries: _countries => {}
|
|
122
|
+
},
|
|
123
|
+
"product-tax-code-selector": {
|
|
124
|
+
setOnTaxCodeSelect: _listener => {},
|
|
125
|
+
setHideDescription: _hideDescription => {},
|
|
126
|
+
setDisabled: _disabled => {},
|
|
127
|
+
setInitialTaxCode: _initialTaxCode => {}
|
|
128
|
+
},
|
|
129
|
+
"export-tax-transactions": {},
|
|
72
130
|
"payout-details": {
|
|
73
131
|
setPayout: _payout => {},
|
|
74
132
|
setOnClose: _listener => {}
|
|
75
133
|
},
|
|
134
|
+
"check-scanning": {
|
|
135
|
+
setHandleCheckScanSubmitted: _handleCheckScanSubmitted => {}
|
|
136
|
+
},
|
|
137
|
+
"agentic-commerce-settings": {
|
|
138
|
+
setOnAgreementUpdated: _listener => {}
|
|
139
|
+
},
|
|
140
|
+
"terminal-hardware-shop": {
|
|
141
|
+
setOnCheckoutFinished: _listener => {}
|
|
142
|
+
},
|
|
76
143
|
"payout-reconciliation-report": {
|
|
77
144
|
setOnReportAvailabilityLoaded: _listener => {}
|
|
78
145
|
}
|
|
@@ -178,7 +245,7 @@ const initStripeConnect = (stripePromise, initParams) => {
|
|
|
178
245
|
element[method] = function (value) {
|
|
179
246
|
stripeConnectInstance.then(() => {
|
|
180
247
|
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.
|
|
248
|
+
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.7-preview.0`);
|
|
182
249
|
}
|
|
183
250
|
this[`${method}InternalOnly`](value);
|
|
184
251
|
});
|
|
@@ -232,7 +299,7 @@ const createWrapper = stripeConnect => {
|
|
|
232
299
|
sdk: true,
|
|
233
300
|
sdkOptions: {
|
|
234
301
|
// This will be replaced by the npm package version when bundling
|
|
235
|
-
sdkVersion: "3.4.
|
|
302
|
+
sdkVersion: "3.4.7-preview.0"
|
|
236
303
|
}
|
|
237
304
|
})
|
|
238
305
|
}));
|
|
@@ -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<"
|
|
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 = ["
|
|
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 => {},
|
|
@@ -44,16 +55,53 @@ const ConnectElementCustomMethodConfig = {
|
|
|
44
55
|
"financial-account-transactions": {
|
|
45
56
|
setFinancialAccount: _financialAccount => {}
|
|
46
57
|
},
|
|
47
|
-
|
|
48
|
-
|
|
58
|
+
recipients: {
|
|
59
|
+
setDataSource: _dataSource => {}
|
|
49
60
|
},
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
61
|
+
"app-install": {
|
|
62
|
+
setApp: _app => {},
|
|
63
|
+
setOnAppInstallStateFetched: _listener => {},
|
|
64
|
+
setOnAppInstallStateChanged: _listener => {}
|
|
53
65
|
},
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
|
|
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
|
+
setOnApplicationInitiated: _listener => {},
|
|
87
|
+
setResumeInitiatedApplication: _resumeInitiatedApplication => {}
|
|
88
|
+
},
|
|
89
|
+
"capital-financing-promotion": {
|
|
90
|
+
setLayout: _layout => {},
|
|
91
|
+
setOnApplicationSubmitted: _listener => {},
|
|
92
|
+
setOnEligibleFinancingOfferLoaded: _listener => {},
|
|
93
|
+
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
94
|
+
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
95
|
+
setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {},
|
|
96
|
+
setOnApplicationStepChange: _listener => {},
|
|
97
|
+
setOnAdvanceToCapitalFinancingApplication: _listener => {},
|
|
98
|
+
setDisableNestedCapitalFinancingApplication: _disableNestedCapitalFinancingApplication => {}
|
|
99
|
+
},
|
|
100
|
+
"reporting-chart": {
|
|
101
|
+
setReportName: _reportName => {},
|
|
102
|
+
setIntervalStart: _intervalStart => {},
|
|
103
|
+
setIntervalEnd: _intervalEnd => {},
|
|
104
|
+
setIntervalType: _intervalType => {}
|
|
57
105
|
},
|
|
58
106
|
"tax-settings": {
|
|
59
107
|
setHideProductTaxCodeSelector: _hidden => {},
|
|
@@ -65,10 +113,29 @@ const ConnectElementCustomMethodConfig = {
|
|
|
65
113
|
setDisplayCountries: _countries => {},
|
|
66
114
|
setOnAfterTaxRegistrationExpired: _listener => {}
|
|
67
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": {},
|
|
68
126
|
"payout-details": {
|
|
69
127
|
setPayout: _payout => {},
|
|
70
128
|
setOnClose: _listener => {}
|
|
71
129
|
},
|
|
130
|
+
"check-scanning": {
|
|
131
|
+
setHandleCheckScanSubmitted: _handleCheckScanSubmitted => {}
|
|
132
|
+
},
|
|
133
|
+
"agentic-commerce-settings": {
|
|
134
|
+
setOnAgreementUpdated: _listener => {}
|
|
135
|
+
},
|
|
136
|
+
"terminal-hardware-shop": {
|
|
137
|
+
setOnCheckoutFinished: _listener => {}
|
|
138
|
+
},
|
|
72
139
|
"payout-reconciliation-report": {
|
|
73
140
|
setOnReportAvailabilityLoaded: _listener => {}
|
|
74
141
|
}
|
|
@@ -174,7 +241,7 @@ const initStripeConnect = (stripePromise, initParams) => {
|
|
|
174
241
|
element[method] = function (value) {
|
|
175
242
|
stripeConnectInstance.then(() => {
|
|
176
243
|
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.
|
|
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.7-preview.0`);
|
|
178
245
|
}
|
|
179
246
|
this[`${method}InternalOnly`](value);
|
|
180
247
|
});
|
|
@@ -228,7 +295,7 @@ const createWrapper = stripeConnect => {
|
|
|
228
295
|
sdk: true,
|
|
229
296
|
sdkOptions: {
|
|
230
297
|
// This will be replaced by the npm package version when bundling
|
|
231
|
-
sdkVersion: "3.4.
|
|
298
|
+
sdkVersion: "3.4.7-preview.0"
|
|
232
299
|
}
|
|
233
300
|
})
|
|
234
301
|
}));
|
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 = ["
|
|
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 => {},
|
|
@@ -48,16 +59,53 @@ const ConnectElementCustomMethodConfig = {
|
|
|
48
59
|
"financial-account-transactions": {
|
|
49
60
|
setFinancialAccount: _financialAccount => {}
|
|
50
61
|
},
|
|
51
|
-
|
|
52
|
-
|
|
62
|
+
recipients: {
|
|
63
|
+
setDataSource: _dataSource => {}
|
|
53
64
|
},
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
|
|
65
|
+
"app-install": {
|
|
66
|
+
setApp: _app => {},
|
|
67
|
+
setOnAppInstallStateFetched: _listener => {},
|
|
68
|
+
setOnAppInstallStateChanged: _listener => {}
|
|
57
69
|
},
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
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
|
+
setOnApplicationInitiated: _listener => {},
|
|
91
|
+
setResumeInitiatedApplication: _resumeInitiatedApplication => {}
|
|
92
|
+
},
|
|
93
|
+
"capital-financing-promotion": {
|
|
94
|
+
setLayout: _layout => {},
|
|
95
|
+
setOnApplicationSubmitted: _listener => {},
|
|
96
|
+
setOnEligibleFinancingOfferLoaded: _listener => {},
|
|
97
|
+
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
98
|
+
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
99
|
+
setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {},
|
|
100
|
+
setOnApplicationStepChange: _listener => {},
|
|
101
|
+
setOnAdvanceToCapitalFinancingApplication: _listener => {},
|
|
102
|
+
setDisableNestedCapitalFinancingApplication: _disableNestedCapitalFinancingApplication => {}
|
|
103
|
+
},
|
|
104
|
+
"reporting-chart": {
|
|
105
|
+
setReportName: _reportName => {},
|
|
106
|
+
setIntervalStart: _intervalStart => {},
|
|
107
|
+
setIntervalEnd: _intervalEnd => {},
|
|
108
|
+
setIntervalType: _intervalType => {}
|
|
61
109
|
},
|
|
62
110
|
"tax-settings": {
|
|
63
111
|
setHideProductTaxCodeSelector: _hidden => {},
|
|
@@ -69,10 +117,29 @@ const ConnectElementCustomMethodConfig = {
|
|
|
69
117
|
setDisplayCountries: _countries => {},
|
|
70
118
|
setOnAfterTaxRegistrationExpired: _listener => {}
|
|
71
119
|
},
|
|
120
|
+
"tax-threshold-monitoring": {
|
|
121
|
+
setDisplayCountries: _countries => {}
|
|
122
|
+
},
|
|
123
|
+
"product-tax-code-selector": {
|
|
124
|
+
setOnTaxCodeSelect: _listener => {},
|
|
125
|
+
setHideDescription: _hideDescription => {},
|
|
126
|
+
setDisabled: _disabled => {},
|
|
127
|
+
setInitialTaxCode: _initialTaxCode => {}
|
|
128
|
+
},
|
|
129
|
+
"export-tax-transactions": {},
|
|
72
130
|
"payout-details": {
|
|
73
131
|
setPayout: _payout => {},
|
|
74
132
|
setOnClose: _listener => {}
|
|
75
133
|
},
|
|
134
|
+
"check-scanning": {
|
|
135
|
+
setHandleCheckScanSubmitted: _handleCheckScanSubmitted => {}
|
|
136
|
+
},
|
|
137
|
+
"agentic-commerce-settings": {
|
|
138
|
+
setOnAgreementUpdated: _listener => {}
|
|
139
|
+
},
|
|
140
|
+
"terminal-hardware-shop": {
|
|
141
|
+
setOnCheckoutFinished: _listener => {}
|
|
142
|
+
},
|
|
76
143
|
"payout-reconciliation-report": {
|
|
77
144
|
setOnReportAvailabilityLoaded: _listener => {}
|
|
78
145
|
}
|
|
@@ -178,7 +245,7 @@ const initStripeConnect = (stripePromise, initParams) => {
|
|
|
178
245
|
element[method] = function (value) {
|
|
179
246
|
stripeConnectInstance.then(() => {
|
|
180
247
|
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.
|
|
248
|
+
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.7-preview.0`);
|
|
182
249
|
}
|
|
183
250
|
this[`${method}InternalOnly`](value);
|
|
184
251
|
});
|
|
@@ -232,7 +299,7 @@ const createWrapper = stripeConnect => {
|
|
|
232
299
|
sdk: true,
|
|
233
300
|
sdkOptions: {
|
|
234
301
|
// This will be replaced by the npm package version when bundling
|
|
235
|
-
sdkVersion: "3.4.
|
|
302
|
+
sdkVersion: "3.4.7-preview.0"
|
|
236
303
|
}
|
|
237
304
|
})
|
|
238
305
|
}));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stripe/connect-js",
|
|
3
|
-
"version": "3.4.
|
|
4
|
-
"description": "Connect.js loading utility package (
|
|
3
|
+
"version": "3.4.7-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.
|
|
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
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
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
|
};
|
|
@@ -188,6 +216,19 @@ export type EmbeddedError = {
|
|
|
188
216
|
message?: string;
|
|
189
217
|
};
|
|
190
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
|
+
|
|
191
232
|
export type EmbeddedErrorType =
|
|
192
233
|
/**
|
|
193
234
|
* Failure to connect to Stripe's API.
|
|
@@ -228,6 +269,21 @@ export const ConnectElementCommonMethodConfig = {
|
|
|
228
269
|
};
|
|
229
270
|
|
|
230
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
|
+
},
|
|
231
287
|
"account-onboarding": {
|
|
232
288
|
setFullTermsOfServiceUrl: (
|
|
233
289
|
_termOfServiceUrl: string | undefined
|
|
@@ -296,21 +352,99 @@ export const ConnectElementCustomMethodConfig = {
|
|
|
296
352
|
"financial-account-transactions": {
|
|
297
353
|
setFinancialAccount: (_financialAccount: string): void => {},
|
|
298
354
|
},
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
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
|
|
302
365
|
): void => {},
|
|
303
366
|
},
|
|
304
|
-
"
|
|
305
|
-
|
|
306
|
-
|
|
367
|
+
"app-viewport": {
|
|
368
|
+
setApp: (_app: string | undefined): void => {},
|
|
369
|
+
setAppData: (_appData: Record<string, string> | undefined): void => {},
|
|
307
370
|
},
|
|
308
|
-
"payment-
|
|
309
|
-
|
|
310
|
-
|
|
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: (
|
|
311
388
|
_listener: (({ total }: { total: number }) => void) | undefined
|
|
312
389
|
): void => {},
|
|
313
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
|
+
setOnApplicationInitiated: (
|
|
406
|
+
_listener: (() => void) | undefined
|
|
407
|
+
): void => {},
|
|
408
|
+
setResumeInitiatedApplication: (
|
|
409
|
+
_resumeInitiatedApplication: boolean | undefined
|
|
410
|
+
): void => {},
|
|
411
|
+
},
|
|
412
|
+
"capital-financing-promotion": {
|
|
413
|
+
setLayout: (_layout: FinancingPromotionLayoutType | undefined): void => {},
|
|
414
|
+
setOnApplicationSubmitted: (
|
|
415
|
+
_listener: (() => void) | undefined
|
|
416
|
+
): void => {},
|
|
417
|
+
setOnEligibleFinancingOfferLoaded: (
|
|
418
|
+
_listener:
|
|
419
|
+
| (({
|
|
420
|
+
productType,
|
|
421
|
+
activeFinancingCount,
|
|
422
|
+
}: FinancingProductType) => void)
|
|
423
|
+
| undefined
|
|
424
|
+
): void => {},
|
|
425
|
+
setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined): void => {},
|
|
426
|
+
setHowCapitalWorksUrl: (
|
|
427
|
+
_howCapitalWorksUrl: string | undefined
|
|
428
|
+
): void => {},
|
|
429
|
+
setEligibilityCriteriaUrl: (
|
|
430
|
+
_eligibilityCriteriaUrl: string | undefined
|
|
431
|
+
): void => {},
|
|
432
|
+
setOnApplicationStepChange: (
|
|
433
|
+
_listener: (({ step }: StepChange) => void) | undefined
|
|
434
|
+
): void => {},
|
|
435
|
+
setOnAdvanceToCapitalFinancingApplication: (
|
|
436
|
+
_listener: (() => void) | undefined
|
|
437
|
+
): void => {},
|
|
438
|
+
setDisableNestedCapitalFinancingApplication: (
|
|
439
|
+
_disableNestedCapitalFinancingApplication: boolean | undefined
|
|
440
|
+
): void => {},
|
|
441
|
+
},
|
|
442
|
+
"reporting-chart": {
|
|
443
|
+
setReportName: (_reportName: ReportName): void => {},
|
|
444
|
+
setIntervalStart: (_intervalStart: Date | undefined): void => {},
|
|
445
|
+
setIntervalEnd: (_intervalEnd: Date | undefined): void => {},
|
|
446
|
+
setIntervalType: (_intervalType: IntervalType | undefined): void => {},
|
|
447
|
+
},
|
|
314
448
|
"tax-settings": {
|
|
315
449
|
setHideProductTaxCodeSelector: (_hidden: boolean | undefined): void => {},
|
|
316
450
|
setDisplayHeadOfficeCountries: (
|
|
@@ -329,10 +463,46 @@ export const ConnectElementCustomMethodConfig = {
|
|
|
329
463
|
_listener: (({ id }: { id: string }) => void) | undefined
|
|
330
464
|
): void => {},
|
|
331
465
|
},
|
|
466
|
+
"tax-threshold-monitoring": {
|
|
467
|
+
setDisplayCountries: (_countries: string[] | undefined): void => {},
|
|
468
|
+
},
|
|
469
|
+
"product-tax-code-selector": {
|
|
470
|
+
setOnTaxCodeSelect: (
|
|
471
|
+
_listener:
|
|
472
|
+
| ((
|
|
473
|
+
taxCode: string | null,
|
|
474
|
+
_: { analyticsName: string } | null
|
|
475
|
+
) => void)
|
|
476
|
+
| undefined
|
|
477
|
+
): void => {},
|
|
478
|
+
setHideDescription: (_hideDescription: boolean | undefined): void => {},
|
|
479
|
+
setDisabled: (_disabled: boolean | undefined): void => {},
|
|
480
|
+
setInitialTaxCode: (_initialTaxCode: string | undefined): void => {},
|
|
481
|
+
},
|
|
482
|
+
"export-tax-transactions": {},
|
|
332
483
|
"payout-details": {
|
|
333
484
|
setPayout: (_payout: string | undefined): void => {},
|
|
334
485
|
setOnClose: (_listener: (() => void) | undefined): void => {},
|
|
335
486
|
},
|
|
487
|
+
"check-scanning": {
|
|
488
|
+
setHandleCheckScanSubmitted: (
|
|
489
|
+
_handleCheckScanSubmitted: ({
|
|
490
|
+
checkScanToken,
|
|
491
|
+
}: {
|
|
492
|
+
checkScanToken: string;
|
|
493
|
+
}) => Promise<void>
|
|
494
|
+
): void => {},
|
|
495
|
+
},
|
|
496
|
+
"agentic-commerce-settings": {
|
|
497
|
+
setOnAgreementUpdated: (
|
|
498
|
+
_listener:
|
|
499
|
+
| (({ agreementId }: { agreementId: string }) => void)
|
|
500
|
+
| undefined
|
|
501
|
+
): void => {},
|
|
502
|
+
},
|
|
503
|
+
"terminal-hardware-shop": {
|
|
504
|
+
setOnCheckoutFinished: (_listener: (() => void) | undefined): void => {},
|
|
505
|
+
},
|
|
336
506
|
"payout-reconciliation-report": {
|
|
337
507
|
setOnReportAvailabilityLoaded: (
|
|
338
508
|
_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
|
*/
|