@stripe/connect-js 3.3.39-preview-1 → 3.3.39

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/dist/pure.js CHANGED
@@ -9,17 +9,6 @@ const ConnectElementCommonMethodConfig = {
9
9
  setOnLoaderStart: _listener => {}
10
10
  };
11
11
  const ConnectElementCustomMethodConfig = {
12
- payments: {
13
- setDefaultFilters: _filters => {}
14
- },
15
- "payment-details": {
16
- setPayment: _payment => {},
17
- setOnClose: _listener => {}
18
- },
19
- "payment-disputes": {
20
- setPayment: _payment => {},
21
- setOnDisputesLoaded: _listener => {}
22
- },
23
12
  "account-onboarding": {
24
13
  setFullTermsOfServiceUrl: _termOfServiceUrl => {},
25
14
  setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
@@ -57,48 +46,16 @@ const ConnectElementCustomMethodConfig = {
57
46
  "financial-account-transactions": {
58
47
  setFinancialAccount: _financialAccount => {}
59
48
  },
60
- recipients: {
61
- setDataSource: _dataSource => {}
62
- },
63
- "app-install": {
64
- setApp: _app => {},
65
- setOnAppInstallStateFetched: _listener => {},
66
- setOnAppInstallStateChanged: _listener => {}
67
- },
68
- "app-viewport": {
69
- setApp: _app => {},
70
- setAppData: _appData => {}
71
- },
72
- "payment-method-settings": {
73
- setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
74
- },
75
- "capital-financing": {
76
- setDefaultFinancingOffer: _defaultFinancingOffer => {},
77
- setShowFinancingSelector: _showFinancingSelector => {},
78
- setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
79
- setSupportUrl: _supportUrl => {},
80
- setOnFinancingsLoaded: _listener => {}
81
- },
82
- "capital-financing-application": {
83
- setOnApplicationSubmitted: _listener => {},
84
- setPrivacyPolicyUrl: _privacyPolicyUrl => {},
85
- setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
86
- setOnApplicationStepChange: _listener => {}
49
+ payments: {
50
+ setDefaultFilters: _filters => {}
87
51
  },
88
- "capital-financing-promotion": {
89
- setLayout: _layout => {},
90
- setOnApplicationSubmitted: _listener => {},
91
- setOnEligibleFinancingOfferLoaded: _listener => {},
92
- setPrivacyPolicyUrl: _privacyPolicyUrl => {},
93
- setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
94
- setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {},
95
- setOnApplicationStepChange: _listener => {}
52
+ "payment-details": {
53
+ setPayment: _payment => {},
54
+ setOnClose: _listener => {}
96
55
  },
97
- "reporting-chart": {
98
- setReportName: _reportName => {},
99
- setIntervalStart: _intervalStart => {},
100
- setIntervalEnd: _intervalEnd => {},
101
- setIntervalType: _intervalType => {}
56
+ "payment-disputes": {
57
+ setPayment: _payment => {},
58
+ setOnDisputesLoaded: _listener => {}
102
59
  },
103
60
  "tax-settings": {
104
61
  setHideProductTaxCodeSelector: _hidden => {},
@@ -107,63 +64,46 @@ const ConnectElementCustomMethodConfig = {
107
64
  },
108
65
  "tax-registrations": {
109
66
  setOnAfterTaxRegistrationAdded: _listener => {},
110
- setDisplayCountries: _countries => {}
67
+ setDisplayCountries: _countries => {},
68
+ setOnAfterTaxRegistrationExpired: _listener => {}
111
69
  },
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": {},
122
70
  "payout-details": {
123
71
  setPayout: _payout => {},
124
72
  setOnClose: _listener => {}
73
+ },
74
+ "payout-reconciliation-report": {
75
+ setOnReportAvailabilityLoaded: _listener => {}
125
76
  }
126
77
  };
127
78
 
128
79
  const componentNameMapping = {
80
+ "account-onboarding": "stripe-connect-account-onboarding",
81
+ "disputes-list": "stripe-connect-disputes-list",
129
82
  payments: "stripe-connect-payments",
130
- payouts: "stripe-connect-payouts",
131
83
  "payment-details": "stripe-connect-payment-details",
132
84
  "payment-disputes": "stripe-connect-payment-disputes",
133
- "disputes-list": "stripe-connect-disputes-list",
134
- "account-onboarding": "stripe-connect-account-onboarding",
135
- "payment-method-settings": "stripe-connect-payment-method-settings",
85
+ payouts: "stripe-connect-payouts",
86
+ "payouts-list": "stripe-connect-payouts-list",
87
+ "payout-details": "stripe-connect-payout-details",
88
+ balances: "stripe-connect-balances",
136
89
  "account-management": "stripe-connect-account-management",
137
90
  "notification-banner": "stripe-connect-notification-banner",
138
- "instant-payouts": "stripe-connect-instant-payouts",
139
91
  "instant-payouts-promotion": "stripe-connect-instant-payouts-promotion",
140
92
  "issuing-card": "stripe-connect-issuing-card",
141
93
  "issuing-cards-list": "stripe-connect-issuing-cards-list",
142
94
  "financial-account": "stripe-connect-financial-account",
143
- recipients: "stripe-connect-recipients",
144
95
  "financial-account-transactions": "stripe-connect-financial-account-transactions",
145
- "capital-financing": "stripe-connect-capital-financing",
146
- "capital-financing-application": "stripe-connect-capital-financing-application",
147
- "capital-financing-promotion": "stripe-connect-capital-financing-promotion",
148
- "capital-overview": "stripe-connect-capital-overview",
149
96
  documents: "stripe-connect-documents",
150
- "product-tax-code-selector": "stripe-connect-product-tax-code-selector",
151
- "export-tax-transactions": "stripe-connect-export-tax-transactions",
152
97
  "tax-registrations": "stripe-connect-tax-registrations",
153
98
  "tax-settings": "stripe-connect-tax-settings",
154
- "tax-threshold-monitoring": "stripe-connect-tax-threshold-monitoring",
155
- balances: "stripe-connect-balances",
156
- "payouts-list": "stripe-connect-payouts-list",
157
- "payout-details": "stripe-connect-payout-details",
158
- "app-install": "stripe-connect-app-install",
159
- "app-viewport": "stripe-connect-app-viewport",
160
- "reporting-chart": "stripe-connect-reporting-chart"
99
+ "balance-report": "stripe-connect-balance-report",
100
+ "payout-reconciliation-report": "stripe-connect-payout-reconciliation-report"
161
101
  };
162
102
  const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
163
103
  const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
164
104
  const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
165
105
  const findScript = () => {
166
- return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || null;
106
+ return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
167
107
  };
168
108
  const injectScript = () => {
169
109
  const script = document.createElement("script");
@@ -253,6 +193,9 @@ const initStripeConnect = (stripePromise, initParams) => {
253
193
  for (const method in methods) {
254
194
  element[method] = function (value) {
255
195
  stripeConnectInstance.then(() => {
196
+ if (!this[`${method}InternalOnly`]) {
197
+ 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.3.39`);
198
+ }
256
199
  this[`${method}InternalOnly`](value);
257
200
  });
258
201
  };
@@ -305,7 +248,7 @@ const createWrapper = stripeConnect => {
305
248
  sdk: true,
306
249
  sdkOptions: {
307
250
  // This will be replaced by the npm package version when bundling
308
- sdkVersion: "3.3.39-preview-1"
251
+ sdkVersion: "3.3.39"
309
252
  }
310
253
  })
311
254
  }));
@@ -1,6 +1,6 @@
1
1
  import type { IStripeConnectInitParams, StripeConnectInstance, ConnectElementTagName } from "../types";
2
2
  export type LoadConnectAndInitialize = (initParams: IStripeConnectInitParams) => StripeConnectInstance;
3
- export type ConnectElementHTMLName = "stripe-connect-payments" | "stripe-connect-payouts" | "stripe-connect-payment-details" | "stripe-connect-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";
3
+ type ConnectElementHTMLName = "stripe-connect-account-onboarding" | "stripe-connect-disputes-list" | "stripe-connect-payments" | "stripe-connect-payment-details" | "stripe-connect-payment-disputes" | "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-payouts" | "stripe-connect-payouts-list" | "stripe-connect-payout-details" | "stripe-connect-balances" | "stripe-connect-documents" | "stripe-connect-tax-registrations" | "stripe-connect-tax-settings" | "stripe-connect-balance-report" | "stripe-connect-payout-reconciliation-report";
4
4
  export declare const componentNameMapping: Record<ConnectElementTagName, ConnectElementHTMLName>;
5
5
  type StripeConnectInstanceExtended = StripeConnectInstance & {
6
6
  debugInstance: () => Promise<StripeConnectInstance>;
@@ -47,10 +47,6 @@ export type NotificationCount = {
47
47
  total: number;
48
48
  actionRequired: number;
49
49
  };
50
- export type InstallState = {
51
- appId: string;
52
- state: "INSTALLED" | "UNINSTALLED";
53
- };
54
50
  export type LoaderStart = {
55
51
  elementTagName: string;
56
52
  };
@@ -65,14 +61,6 @@ export type EmbeddedError = {
65
61
  type: EmbeddedErrorType;
66
62
  message?: string;
67
63
  };
68
- export type FinancingProductType = {
69
- productType: "standard" | "refill" | "none";
70
- activeFinancingCount: number;
71
- };
72
- export type FinancingPromotionLayoutType = "full" | "banner";
73
- export type IntervalType = "day" | "week" | "month" | "quarter" | "year";
74
- export type ReportName = "gross_volume" | "net_volume";
75
- export type RecipientDataSource = "customers";
76
64
  export type EmbeddedErrorType =
77
65
  /**
78
66
  * Failure to connect to Stripe's API.
@@ -94,6 +82,10 @@ export type EmbeddedErrorType =
94
82
  * Too many requests hit the API too quickly.
95
83
  */
96
84
  | "rate_limit_error"
85
+ /**
86
+ * Failure to render the component, typically caused by browser extensions or network issues
87
+ */
88
+ | "render_error"
97
89
  /**
98
90
  * API errors covering any other type of problem (e.g., a temporary problem with Stripe's servers), and are extremely uncommon.
99
91
  */
@@ -103,19 +95,6 @@ export declare const ConnectElementCommonMethodConfig: {
103
95
  setOnLoaderStart: (_listener: (({ elementTagName }: LoaderStart) => void) | undefined) => void;
104
96
  };
105
97
  export declare const ConnectElementCustomMethodConfig: {
106
- payments: {
107
- setDefaultFilters: (_filters: PaymentsListDefaultFilters | undefined) => void;
108
- };
109
- "payment-details": {
110
- setPayment: (_payment: string | undefined) => void;
111
- setOnClose: (_listener: (() => void) | undefined) => void;
112
- };
113
- "payment-disputes": {
114
- setPayment: (_payment: string | undefined) => void;
115
- setOnDisputesLoaded: (_listener: (({ total }: {
116
- total: number;
117
- }) => void) | undefined) => void;
118
- };
119
98
  "account-onboarding": {
120
99
  setFullTermsOfServiceUrl: (_termOfServiceUrl: string | undefined) => void;
121
100
  setRecipientTermsOfServiceUrl: (_recipientTermsOfServiceUrl: string | undefined) => void;
@@ -157,51 +136,19 @@ export declare const ConnectElementCustomMethodConfig: {
157
136
  "financial-account-transactions": {
158
137
  setFinancialAccount: (_financialAccount: string) => void;
159
138
  };
160
- recipients: {
161
- setDataSource: (_dataSource: RecipientDataSource) => void;
162
- };
163
- "app-install": {
164
- setApp: (_app: string | undefined) => void;
165
- setOnAppInstallStateFetched: (_listener: (({ appId, state }: InstallState) => void) | undefined) => void;
166
- setOnAppInstallStateChanged: (_listener: (({ appId, state }: InstallState) => void) | undefined) => void;
167
- };
168
- "app-viewport": {
169
- setApp: (_app: string | undefined) => void;
170
- setAppData: (_appData: Record<string, string> | undefined) => void;
139
+ payments: {
140
+ setDefaultFilters: (_filters: PaymentsListDefaultFilters | undefined) => void;
171
141
  };
172
- "payment-method-settings": {
173
- setPaymentMethodConfiguration: (_paymentMethodConfiguration: string | undefined) => void;
142
+ "payment-details": {
143
+ setPayment: (_payment: string | undefined) => void;
144
+ setOnClose: (_listener: (() => void) | undefined) => void;
174
145
  };
175
- "capital-financing": {
176
- setDefaultFinancingOffer: (_defaultFinancingOffer: string | undefined) => void;
177
- setShowFinancingSelector: (_showFinancingSelector: boolean | undefined) => void;
178
- setHowCapitalWorksUrl: (_howCapitalWorksUrl: string | undefined) => void;
179
- setSupportUrl: (_supportUrl: string | undefined) => void;
180
- setOnFinancingsLoaded: (_listener: (({ total }: {
146
+ "payment-disputes": {
147
+ setPayment: (_payment: string | undefined) => void;
148
+ setOnDisputesLoaded: (_listener: (({ total }: {
181
149
  total: number;
182
150
  }) => void) | undefined) => void;
183
151
  };
184
- "capital-financing-application": {
185
- setOnApplicationSubmitted: (_listener: (() => void) | undefined) => void;
186
- setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined) => void;
187
- setHowCapitalWorksUrl: (_howCapitalWorksUrl: string | undefined) => void;
188
- setOnApplicationStepChange: (_listener: (({ step }: StepChange) => void) | undefined) => void;
189
- };
190
- "capital-financing-promotion": {
191
- setLayout: (_layout: FinancingPromotionLayoutType | undefined) => void;
192
- setOnApplicationSubmitted: (_listener: (() => void) | undefined) => void;
193
- setOnEligibleFinancingOfferLoaded: (_listener: (({ productType, activeFinancingCount, }: FinancingProductType) => void) | undefined) => void;
194
- setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined) => void;
195
- setHowCapitalWorksUrl: (_howCapitalWorksUrl: string | undefined) => void;
196
- setEligibilityCriteriaUrl: (_eligibilityCriteriaUrl: string | undefined) => void;
197
- setOnApplicationStepChange: (_listener: (({ step }: StepChange) => void) | undefined) => void;
198
- };
199
- "reporting-chart": {
200
- setReportName: (_reportName: ReportName) => void;
201
- setIntervalStart: (_intervalStart: Date | undefined) => void;
202
- setIntervalEnd: (_intervalEnd: Date | undefined) => void;
203
- setIntervalType: (_intervalType: IntervalType | undefined) => void;
204
- };
205
152
  "tax-settings": {
206
153
  setHideProductTaxCodeSelector: (_hidden: boolean | undefined) => void;
207
154
  setDisplayHeadOfficeCountries: (_countries: string[] | undefined) => void;
@@ -214,21 +161,17 @@ export declare const ConnectElementCustomMethodConfig: {
214
161
  id: string;
215
162
  }) => void) | undefined) => void;
216
163
  setDisplayCountries: (_countries: string[] | undefined) => void;
217
- };
218
- "tax-threshold-monitoring": {
219
- setDisplayCountries: (_countries: string[] | undefined) => void;
220
- };
221
- "product-tax-code-selector": {
222
- setOnTaxCodeSelect: (_listener: ((taxCode: string, { analyticsName }: {
223
- analyticsName: string;
164
+ setOnAfterTaxRegistrationExpired: (_listener: (({ id }: {
165
+ id: string;
224
166
  }) => void) | undefined) => void;
225
- setHideDescription: (_hideDescription: boolean | undefined) => void;
226
- setDisabled: (_disabled: boolean | undefined) => void;
227
- setInitialTaxCode: (_initialTaxCode: string | undefined) => void;
228
167
  };
229
- "export-tax-transactions": {};
230
168
  "payout-details": {
231
169
  setPayout: (_payout: string | undefined) => void;
232
170
  setOnClose: (_listener: (() => void) | undefined) => void;
233
171
  };
172
+ "payout-reconciliation-report": {
173
+ setOnReportAvailabilityLoaded: (_listener: (({ isReportAvailable }: {
174
+ isReportAvailable: boolean;
175
+ }) => void) | undefined) => void;
176
+ };
234
177
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stripe/connect-js",
3
- "version": "3.3.39-preview-1",
4
- "description": "Connect.js loading utility package",
3
+ "version": "3.3.39",
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": "types/index.d.ts",
@@ -63,13 +63,13 @@
63
63
  "jest-environment-jsdom": "^29.5.0",
64
64
  "prettier": "2.8.8",
65
65
  "rimraf": "^2.6.2",
66
- "rollup": "^1.29.0",
66
+ "rollup": "^2.79.2",
67
67
  "rollup-plugin-babel": "^4.4.0",
68
68
  "rollup-plugin-typescript2": "^0.25.3",
69
69
  "ts-jest": "^29.1.0",
70
70
  "typescript": "^4.1.2",
71
71
  "yalc": "^1.0.0-pre.53",
72
- "zx": "^4.2.0"
72
+ "zx": "^8.8.5"
73
73
  },
74
74
  "dependencies": {}
75
75
  }
package/src/shared.ts CHANGED
@@ -13,78 +13,55 @@ export type LoadConnectAndInitialize = (
13
13
  initParams: IStripeConnectInitParams
14
14
  ) => StripeConnectInstance;
15
15
 
16
- export type ConnectElementHTMLName =
16
+ type ConnectElementHTMLName =
17
+ | "stripe-connect-account-onboarding"
18
+ | "stripe-connect-disputes-list"
17
19
  | "stripe-connect-payments"
18
- | "stripe-connect-payouts"
19
20
  | "stripe-connect-payment-details"
20
21
  | "stripe-connect-payment-disputes"
21
- | "stripe-connect-disputes-list"
22
- | "stripe-connect-account-onboarding"
23
- | "stripe-connect-payment-method-settings"
24
22
  | "stripe-connect-account-management"
25
23
  | "stripe-connect-notification-banner"
26
- | "stripe-connect-instant-payouts"
27
24
  | "stripe-connect-instant-payouts-promotion"
28
25
  | "stripe-connect-issuing-card"
29
26
  | "stripe-connect-issuing-cards-list"
30
27
  | "stripe-connect-financial-account"
31
28
  | "stripe-connect-financial-account-transactions"
32
- | "stripe-connect-recipients"
33
- | "stripe-connect-capital-financing"
34
- | "stripe-connect-capital-financing-application"
35
- | "stripe-connect-capital-financing-promotion"
36
- | "stripe-connect-capital-overview"
29
+ | "stripe-connect-payouts"
30
+ | "stripe-connect-payouts-list"
31
+ | "stripe-connect-payout-details"
32
+ | "stripe-connect-balances"
37
33
  | "stripe-connect-documents"
38
- | "stripe-connect-product-tax-code-selector"
39
- | "stripe-connect-export-tax-transactions"
40
34
  | "stripe-connect-tax-registrations"
41
35
  | "stripe-connect-tax-settings"
42
- | "stripe-connect-tax-threshold-monitoring"
43
- | "stripe-connect-balances"
44
- | "stripe-connect-payouts-list"
45
- | "stripe-connect-payout-details"
46
- | "stripe-connect-app-install"
47
- | "stripe-connect-app-viewport"
48
- | "stripe-connect-reporting-chart";
36
+ | "stripe-connect-balance-report"
37
+ | "stripe-connect-payout-reconciliation-report";
49
38
 
50
39
  export const componentNameMapping: Record<
51
40
  ConnectElementTagName,
52
41
  ConnectElementHTMLName
53
42
  > = {
43
+ "account-onboarding": "stripe-connect-account-onboarding",
44
+ "disputes-list": "stripe-connect-disputes-list",
54
45
  payments: "stripe-connect-payments",
55
- payouts: "stripe-connect-payouts",
56
46
  "payment-details": "stripe-connect-payment-details",
57
47
  "payment-disputes": "stripe-connect-payment-disputes",
58
- "disputes-list": "stripe-connect-disputes-list",
59
- "account-onboarding": "stripe-connect-account-onboarding",
60
- "payment-method-settings": "stripe-connect-payment-method-settings",
48
+ payouts: "stripe-connect-payouts",
49
+ "payouts-list": "stripe-connect-payouts-list",
50
+ "payout-details": "stripe-connect-payout-details",
51
+ balances: "stripe-connect-balances",
61
52
  "account-management": "stripe-connect-account-management",
62
53
  "notification-banner": "stripe-connect-notification-banner",
63
- "instant-payouts": "stripe-connect-instant-payouts",
64
54
  "instant-payouts-promotion": "stripe-connect-instant-payouts-promotion",
65
55
  "issuing-card": "stripe-connect-issuing-card",
66
56
  "issuing-cards-list": "stripe-connect-issuing-cards-list",
67
57
  "financial-account": "stripe-connect-financial-account",
68
- recipients: "stripe-connect-recipients",
69
58
  "financial-account-transactions":
70
59
  "stripe-connect-financial-account-transactions",
71
- "capital-financing": "stripe-connect-capital-financing",
72
- "capital-financing-application":
73
- "stripe-connect-capital-financing-application",
74
- "capital-financing-promotion": "stripe-connect-capital-financing-promotion",
75
- "capital-overview": "stripe-connect-capital-overview",
76
60
  documents: "stripe-connect-documents",
77
- "product-tax-code-selector": "stripe-connect-product-tax-code-selector",
78
- "export-tax-transactions": "stripe-connect-export-tax-transactions",
79
61
  "tax-registrations": "stripe-connect-tax-registrations",
80
62
  "tax-settings": "stripe-connect-tax-settings",
81
- "tax-threshold-monitoring": "stripe-connect-tax-threshold-monitoring",
82
- balances: "stripe-connect-balances",
83
- "payouts-list": "stripe-connect-payouts-list",
84
- "payout-details": "stripe-connect-payout-details",
85
- "app-install": "stripe-connect-app-install",
86
- "app-viewport": "stripe-connect-app-viewport",
87
- "reporting-chart": "stripe-connect-reporting-chart",
63
+ "balance-report": "stripe-connect-balance-report",
64
+ "payout-reconciliation-report": "stripe-connect-payout-reconciliation-report",
88
65
  };
89
66
 
90
67
  type StripeConnectInstanceExtended = StripeConnectInstance & {
@@ -103,10 +80,10 @@ const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
103
80
  export const findScript = (): HTMLScriptElement | null => {
104
81
  return (
105
82
  document.querySelectorAll<HTMLScriptElement>(
106
- `script[src="${V0_URL}"]`
83
+ `script[src="${V1_URL}"]`
107
84
  )[0] ||
108
85
  document.querySelectorAll<HTMLScriptElement>(
109
- `script[src="${V1_URL}"]`
86
+ `script[src="${V0_URL}"]`
110
87
  )[0] ||
111
88
  null
112
89
  );
@@ -235,6 +212,12 @@ export const initStripeConnect = (
235
212
  for (const method in methods) {
236
213
  (element as any)[method] = function (value: any) {
237
214
  stripeConnectInstance.then(() => {
215
+ if (!this[`${method}InternalOnly`]) {
216
+ throw new Error(
217
+ `Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the "@stripe/connect-js" package? Using version: _NPM_PACKAGE_VERSION_`
218
+ );
219
+ }
220
+
238
221
  this[`${method}InternalOnly`](value);
239
222
  });
240
223
  };
package/types/config.ts CHANGED
@@ -141,11 +141,6 @@ export type NotificationCount = {
141
141
  actionRequired: number;
142
142
  };
143
143
 
144
- export type InstallState = {
145
- appId: string;
146
- state: "INSTALLED" | "UNINSTALLED";
147
- };
148
-
149
144
  export type LoaderStart = {
150
145
  elementTagName: string;
151
146
  };
@@ -164,19 +159,6 @@ export type EmbeddedError = {
164
159
  message?: string;
165
160
  };
166
161
 
167
- export type FinancingProductType = {
168
- productType: "standard" | "refill" | "none";
169
- activeFinancingCount: number;
170
- };
171
-
172
- export type FinancingPromotionLayoutType = "full" | "banner";
173
-
174
- export type IntervalType = "day" | "week" | "month" | "quarter" | "year";
175
-
176
- export type ReportName = "gross_volume" | "net_volume";
177
-
178
- export type RecipientDataSource = "customers";
179
-
180
162
  export type EmbeddedErrorType =
181
163
  /**
182
164
  * Failure to connect to Stripe's API.
@@ -198,6 +180,10 @@ export type EmbeddedErrorType =
198
180
  * Too many requests hit the API too quickly.
199
181
  */
200
182
  | "rate_limit_error"
183
+ /**
184
+ * Failure to render the component, typically caused by browser extensions or network issues
185
+ */
186
+ | "render_error"
201
187
  /**
202
188
  * API errors covering any other type of problem (e.g., a temporary problem with Stripe's servers), and are extremely uncommon.
203
189
  */
@@ -213,21 +199,6 @@ export const ConnectElementCommonMethodConfig = {
213
199
  };
214
200
 
215
201
  export const ConnectElementCustomMethodConfig = {
216
- payments: {
217
- setDefaultFilters: (
218
- _filters: PaymentsListDefaultFilters | undefined
219
- ): void => {},
220
- },
221
- "payment-details": {
222
- setPayment: (_payment: string | undefined): void => {},
223
- setOnClose: (_listener: (() => void) | undefined): void => {},
224
- },
225
- "payment-disputes": {
226
- setPayment: (_payment: string | undefined): void => {},
227
- setOnDisputesLoaded: (
228
- _listener: (({ total }: { total: number }) => void) | undefined
229
- ): void => {},
230
- },
231
202
  "account-onboarding": {
232
203
  setFullTermsOfServiceUrl: (
233
204
  _termOfServiceUrl: string | undefined
@@ -293,84 +264,21 @@ export const ConnectElementCustomMethodConfig = {
293
264
  "financial-account-transactions": {
294
265
  setFinancialAccount: (_financialAccount: string): void => {},
295
266
  },
296
- recipients: {
297
- setDataSource: (_dataSource: RecipientDataSource): void => {},
298
- },
299
- "app-install": {
300
- setApp: (_app: string | undefined): void => {},
301
- setOnAppInstallStateFetched: (
302
- _listener: (({ appId, state }: InstallState) => void) | undefined
303
- ): void => {},
304
- setOnAppInstallStateChanged: (
305
- _listener: (({ appId, state }: InstallState) => void) | undefined
267
+ payments: {
268
+ setDefaultFilters: (
269
+ _filters: PaymentsListDefaultFilters | undefined
306
270
  ): void => {},
307
271
  },
308
- "app-viewport": {
309
- setApp: (_app: string | undefined): void => {},
310
- setAppData: (_appData: Record<string, string> | undefined): void => {},
311
- },
312
- "payment-method-settings": {
313
- setPaymentMethodConfiguration: (
314
- _paymentMethodConfiguration: string | undefined
315
- ): void => {},
272
+ "payment-details": {
273
+ setPayment: (_payment: string | undefined): void => {},
274
+ setOnClose: (_listener: (() => void) | undefined): void => {},
316
275
  },
317
- "capital-financing": {
318
- setDefaultFinancingOffer: (
319
- _defaultFinancingOffer: string | undefined
320
- ): void => {},
321
- setShowFinancingSelector: (
322
- _showFinancingSelector: boolean | undefined
323
- ): void => {},
324
- setHowCapitalWorksUrl: (
325
- _howCapitalWorksUrl: string | undefined
326
- ): void => {},
327
- setSupportUrl: (_supportUrl: string | undefined): void => {},
328
- setOnFinancingsLoaded: (
276
+ "payment-disputes": {
277
+ setPayment: (_payment: string | undefined): void => {},
278
+ setOnDisputesLoaded: (
329
279
  _listener: (({ total }: { total: number }) => void) | undefined
330
280
  ): void => {},
331
281
  },
332
- "capital-financing-application": {
333
- setOnApplicationSubmitted: (
334
- _listener: (() => void) | undefined
335
- ): void => {},
336
- setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined): void => {},
337
- setHowCapitalWorksUrl: (
338
- _howCapitalWorksUrl: string | undefined
339
- ): void => {},
340
- setOnApplicationStepChange: (
341
- _listener: (({ step }: StepChange) => void) | undefined
342
- ): void => {},
343
- },
344
- "capital-financing-promotion": {
345
- setLayout: (_layout: FinancingPromotionLayoutType | undefined): void => {},
346
- setOnApplicationSubmitted: (
347
- _listener: (() => void) | undefined
348
- ): void => {},
349
- setOnEligibleFinancingOfferLoaded: (
350
- _listener:
351
- | (({
352
- productType,
353
- activeFinancingCount,
354
- }: FinancingProductType) => void)
355
- | undefined
356
- ): void => {},
357
- setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined): void => {},
358
- setHowCapitalWorksUrl: (
359
- _howCapitalWorksUrl: string | undefined
360
- ): void => {},
361
- setEligibilityCriteriaUrl: (
362
- _eligibilityCriteriaUrl: string | undefined
363
- ): void => {},
364
- setOnApplicationStepChange: (
365
- _listener: (({ step }: StepChange) => void) | undefined
366
- ): void => {},
367
- },
368
- "reporting-chart": {
369
- setReportName: (_reportName: ReportName): void => {},
370
- setIntervalStart: (_intervalStart: Date | undefined): void => {},
371
- setIntervalEnd: (_intervalEnd: Date | undefined): void => {},
372
- setIntervalType: (_intervalType: IntervalType | undefined): void => {},
373
- },
374
282
  "tax-settings": {
375
283
  setHideProductTaxCodeSelector: (_hidden: boolean | undefined): void => {},
376
284
  setDisplayHeadOfficeCountries: (
@@ -385,26 +293,19 @@ export const ConnectElementCustomMethodConfig = {
385
293
  _listener: (({ id }: { id: string }) => void) | undefined
386
294
  ): void => {},
387
295
  setDisplayCountries: (_countries: string[] | undefined): void => {},
388
- },
389
- "tax-threshold-monitoring": {
390
- setDisplayCountries: (_countries: string[] | undefined): void => {},
391
- },
392
- "product-tax-code-selector": {
393
- setOnTaxCodeSelect: (
394
- _listener:
395
- | ((
396
- taxCode: string,
397
- { analyticsName }: { analyticsName: string }
398
- ) => void)
399
- | undefined
296
+ setOnAfterTaxRegistrationExpired: (
297
+ _listener: (({ id }: { id: string }) => void) | undefined
400
298
  ): void => {},
401
- setHideDescription: (_hideDescription: boolean | undefined): void => {},
402
- setDisabled: (_disabled: boolean | undefined): void => {},
403
- setInitialTaxCode: (_initialTaxCode: string | undefined): void => {},
404
299
  },
405
- "export-tax-transactions": {},
406
300
  "payout-details": {
407
301
  setPayout: (_payout: string | undefined): void => {},
408
302
  setOnClose: (_listener: (() => void) | undefined): void => {},
409
303
  },
304
+ "payout-reconciliation-report": {
305
+ setOnReportAvailabilityLoaded: (
306
+ _listener:
307
+ | (({ isReportAvailable }: { isReportAvailable: boolean }) => void)
308
+ | undefined
309
+ ): void => {},
310
+ },
410
311
  };