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

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/types/config.ts CHANGED
@@ -15,16 +15,125 @@ export type CollectionOptions = {
15
15
  futureRequirements?: "omit" | "include";
16
16
  };
17
17
 
18
+ export type Status =
19
+ | "blocked"
20
+ | "canceled"
21
+ | "disputed"
22
+ | "early_fraud_warning"
23
+ | "failed"
24
+ | "incomplete"
25
+ | "partially_refunded"
26
+ | "pending"
27
+ | "refund_pending"
28
+ | "refunded"
29
+ | "successful"
30
+ | "uncaptured";
31
+
32
+ export type PaymentMethod =
33
+ | "ach_credit_transfer"
34
+ | "ach_debit"
35
+ | "acss_debit"
36
+ | "affirm"
37
+ | "afterpay_clearpay"
38
+ | "alipay"
39
+ | "alma"
40
+ | "amazon_pay"
41
+ | "amex_express_checkout"
42
+ | "android_pay"
43
+ | "apple_pay"
44
+ | "au_becs_debit"
45
+ | "nz_bank_account"
46
+ | "bancontact"
47
+ | "bacs_debit"
48
+ | "bitcoin_source"
49
+ | "bitcoin"
50
+ | "blik"
51
+ | "boleto"
52
+ | "boleto_pilot"
53
+ | "card_present"
54
+ | "card"
55
+ | "cashapp"
56
+ | "crypto"
57
+ | "customer_balance"
58
+ | "demo_pay"
59
+ | "dummy_passthrough_card"
60
+ | "gbp_credit_transfer"
61
+ | "google_pay"
62
+ | "eps"
63
+ | "fpx"
64
+ | "giropay"
65
+ | "grabpay"
66
+ | "ideal"
67
+ | "id_bank_transfer"
68
+ | "id_credit_transfer"
69
+ | "jp_credit_transfer"
70
+ | "interac_present"
71
+ | "kakao_pay"
72
+ | "klarna"
73
+ | "konbini"
74
+ | "kr_card"
75
+ | "kr_market"
76
+ | "link"
77
+ | "masterpass"
78
+ | "mb_way"
79
+ | "meta_pay"
80
+ | "multibanco"
81
+ | "mobilepay"
82
+ | "naver_pay"
83
+ | "netbanking"
84
+ | "ng_bank"
85
+ | "ng_bank_transfer"
86
+ | "ng_card"
87
+ | "ng_market"
88
+ | "ng_ussd"
89
+ | "vipps"
90
+ | "oxxo"
91
+ | "p24"
92
+ | "payto"
93
+ | "pay_by_bank"
94
+ | "paper_check"
95
+ | "payco"
96
+ | "paynow"
97
+ | "paypal"
98
+ | "pix"
99
+ | "promptpay"
100
+ | "revolut_pay"
101
+ | "samsung_pay"
102
+ | "sepa_credit_transfer"
103
+ | "sepa_debit"
104
+ | "sofort"
105
+ | "south_korea_market"
106
+ | "swish"
107
+ | "three_d_secure"
108
+ | "three_d_secure_2"
109
+ | "three_d_secure_2_eap"
110
+ | "twint"
111
+ | "upi"
112
+ | "us_bank_account"
113
+ | "visa_checkout"
114
+ | "wechat"
115
+ | "wechat_pay"
116
+ | "zip";
117
+
118
+ export type PaymentsListDefaultFilters = {
119
+ amount?:
120
+ | { equals: number }
121
+ | { greaterThan: number }
122
+ | { lessThan: number }
123
+ | { between: { lowerBound: number; upperBound: number } };
124
+ date?:
125
+ | { before: Date }
126
+ | { after: Date }
127
+ | { between: { start: Date; end: Date } };
128
+ status?: Array<Status>;
129
+ paymentMethod?: PaymentMethod;
130
+ };
131
+
18
132
  export type NotificationCount = {
19
133
  total: number;
20
134
  actionRequired: number;
21
135
  };
22
136
 
23
- export type InstallState = {
24
- appId: string;
25
- state: "INSTALLED" | "UNINSTALLED";
26
- };
27
-
28
137
  export type LoaderStart = {
29
138
  elementTagName: string;
30
139
  };
@@ -43,18 +152,6 @@ export type EmbeddedError = {
43
152
  message?: string;
44
153
  };
45
154
 
46
- export type FinancingProductType = {
47
- productType: "standard" | "refill" | "none";
48
- };
49
-
50
- export type FinancingPromotionLayoutType = "full" | "banner";
51
-
52
- export type IntervalType = "day" | "week" | "month" | "quarter" | "year";
53
-
54
- export type ReportName = "gross_volume" | "net_volume";
55
-
56
- export type RecipientDataSource = "customers";
57
-
58
155
  export type EmbeddedErrorType =
59
156
  /**
60
157
  * Failure to connect to Stripe's API.
@@ -87,14 +184,10 @@ export const ConnectElementCommonMethodConfig = {
87
184
  ): void => {},
88
185
  setOnLoaderStart: (
89
186
  _listener: (({ elementTagName }: LoaderStart) => void) | undefined
90
- ): void => {}
187
+ ): void => {},
91
188
  };
92
189
 
93
190
  export const ConnectElementCustomMethodConfig = {
94
- "payment-details": {
95
- setPayment: (_payment: string | undefined): void => {},
96
- setOnClose: (_listener: (() => void) | undefined): void => {}
97
- },
98
191
  "account-onboarding": {
99
192
  setFullTermsOfServiceUrl: (
100
193
  _termOfServiceUrl: string | undefined
@@ -112,12 +205,12 @@ export const ConnectElementCustomMethodConfig = {
112
205
  setOnExit: (_listener: (() => void) | undefined): void => {},
113
206
  setOnStepChange: (
114
207
  _listener: (({ step }: StepChange) => void) | undefined
115
- ): void => {}
208
+ ): void => {},
116
209
  },
117
210
  "account-management": {
118
211
  setCollectionOptions: (
119
212
  _collectionOptions: CollectionOptions | undefined
120
- ): void => {}
213
+ ): void => {},
121
214
  },
122
215
  "notification-banner": {
123
216
  setCollectionOptions: (
@@ -127,7 +220,7 @@ export const ConnectElementCustomMethodConfig = {
127
220
  _listener:
128
221
  | (({ total, actionRequired }: NotificationCount) => void)
129
222
  | undefined
130
- ): void => {}
223
+ ): void => {},
131
224
  },
132
225
  "issuing-card": {
133
226
  setDefaultCard: (_defaultCard: string | undefined): void => {},
@@ -135,85 +228,29 @@ export const ConnectElementCustomMethodConfig = {
135
228
  setFetchEphemeralKey: (
136
229
  _fetchEphemeralKey: FetchEphemeralKeyFunction | undefined
137
230
  ): void => {},
138
- setShowSpendControls: (_showSpendControls: boolean | undefined): void => {}
231
+ setShowSpendControls: (_showSpendControls: boolean | undefined): void => {},
139
232
  },
140
233
  "issuing-cards-list": {
141
234
  setFetchEphemeralKey: (
142
235
  _fetchEphemeralKey: FetchEphemeralKeyFunction | undefined
143
236
  ): void => {},
144
237
  setShowSpendControls: (_showSpendControls: boolean | undefined): void => {},
145
- setIssuingProgram: (_issuingProgram: string | undefined): void => {}
238
+ setIssuingProgram: (_issuingProgram: string | undefined): void => {},
146
239
  },
147
240
  "financial-account": {
148
- setFinancialAccount: (_financialAccount: string): void => {}
241
+ setFinancialAccount: (_financialAccount: string): void => {},
149
242
  },
150
243
  "financial-account-transactions": {
151
- setFinancialAccount: (_financialAccount: string): void => {}
244
+ setFinancialAccount: (_financialAccount: string): void => {},
152
245
  },
153
- recipients: {
154
- setDataSource: (_dataSource: RecipientDataSource): void => {}
155
- },
156
- "app-install": {
157
- setApp: (_app: string | undefined): void => {},
158
- setOnAppInstallStateFetched: (
159
- _listener: (({ appId, state }: InstallState) => void) | undefined
160
- ): void => {},
161
- setOnAppInstallStateChanged: (
162
- _listener: (({ appId, state }: InstallState) => void) | undefined
163
- ): void => {}
164
- },
165
- "app-viewport": {
166
- setApp: (_app: string | undefined): void => {},
167
- setAppData: (_appData: Record<string, string> | undefined): void => {}
168
- },
169
- "payment-method-settings": {
170
- setPaymentMethodConfiguration: (
171
- _paymentMethodConfiguration: string | undefined
172
- ): void => {}
173
- },
174
- "capital-financing": {
175
- setDefaultFinancingOffer: (
176
- _defaultFinancingOffer: string | undefined
246
+ payments: {
247
+ setDefaultFilters: (
248
+ _filters: PaymentsListDefaultFilters | undefined
177
249
  ): void => {},
178
- setShowFinancingSelector: (
179
- _showFinancingSelector: boolean | undefined
180
- ): void => {},
181
- setHowCapitalWorksUrl: (
182
- _howCapitalWorksUrl: string | undefined
183
- ): void => {},
184
- setSupportUrl: (_supportUrl: string | undefined): void => {},
185
- setOnFinancingsLoaded: (
186
- _listener: (({ total }: { total: number }) => void) | undefined
187
- ): void => {}
188
- },
189
- "capital-financing-application": {
190
- setOnApplicationSubmitted: (
191
- _listener: (() => void) | undefined
192
- ): void => {},
193
- setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined): void => {},
194
- setHowCapitalWorksUrl: (_howCapitalWorksUrl: string | undefined): void => {}
195
250
  },
196
- "capital-financing-promotion": {
197
- setLayout: (_layout: FinancingPromotionLayoutType | undefined): void => {},
198
- setOnApplicationSubmitted: (
199
- _listener: (() => void) | undefined
200
- ): void => {},
201
- setOnEligibleFinancingOfferLoaded: (
202
- _listener: (({ productType }: FinancingProductType) => void) | undefined
203
- ): void => {},
204
- setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined): void => {},
205
- setHowCapitalWorksUrl: (
206
- _howCapitalWorksUrl: string | undefined
207
- ): void => {},
208
- setEligibilityCriteriaUrl: (
209
- _eligibilityCriteriaUrl: string | undefined
210
- ): void => {}
211
- },
212
- "reporting-chart": {
213
- setReportName: (_reportName: ReportName): void => {},
214
- setIntervalStart: (_intervalStart: Date | undefined): void => {},
215
- setIntervalEnd: (_intervalEnd: Date | undefined): void => {},
216
- setIntervalType: (_intervalType: IntervalType | undefined): void => {}
251
+ "payment-details": {
252
+ setPayment: (_payment: string | undefined): void => {},
253
+ setOnClose: (_listener: (() => void) | undefined): void => {},
217
254
  },
218
255
  "tax-settings": {
219
256
  setHideProductTaxCodeSelector: (_hidden: boolean | undefined): void => {},
@@ -222,12 +259,12 @@ export const ConnectElementCustomMethodConfig = {
222
259
  ): void => {},
223
260
  setOnTaxSettingsUpdated: (
224
261
  _listener: (({ id }: { id: string }) => void) | undefined
225
- ): void => {}
262
+ ): void => {},
226
263
  },
227
264
  "tax-registrations": {
228
265
  setOnAfterTaxRegistrationAdded: (
229
266
  _listener: (({ id }: { id: string }) => void) | undefined
230
267
  ): void => {},
231
- setDisplayCountries: (_countries: string[] | undefined): void => {}
232
- }
268
+ setDisplayCountries: (_countries: string[] | undefined): void => {},
269
+ },
233
270
  };
package/types/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { IStripeConnectInitParams, StripeConnectInstance } from "../types";
1
+ import type { IStripeConnectInitParams, StripeConnectInstance } from "../types";
2
2
 
3
3
  export declare const loadConnectAndInitialize: (
4
4
  initParams: IStripeConnectInitParams
package/types/shared.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import {
1
+ import type {
2
2
  ConnectElementCustomMethodConfig,
3
- ConnectElementCommonMethodConfig
3
+ ConnectElementCommonMethodConfig,
4
4
  } from "./config";
5
+
5
6
  export declare type LoadConnectAndInitialize = (
6
7
  initParams: IStripeConnectInitParams
7
8
  ) => StripeConnectInstance;
@@ -487,28 +488,18 @@ export interface StripeConnectInstance {
487
488
  * Tagnames to be used with the `create` method of the Connect instance.
488
489
  */
489
490
  export type ConnectElementTagName =
491
+ | "account-onboarding"
490
492
  | "payments"
491
- | "payouts"
492
493
  | "payment-details"
493
- | "account-onboarding"
494
- | "payment-method-settings"
495
494
  | "account-management"
496
495
  | "notification-banner"
497
- | "instant-payouts"
498
496
  | "issuing-card"
499
497
  | "issuing-cards-list"
500
498
  | "financial-account"
501
499
  | "financial-account-transactions"
502
- | "recipients"
503
- | "capital-financing"
504
- | "capital-financing-application"
505
- | "capital-financing-promotion"
506
- | "capital-overview"
500
+ | "payouts"
501
+ | "payouts-list"
502
+ | "balances"
507
503
  | "documents"
508
504
  | "tax-registrations"
509
- | "tax-settings"
510
- | "balances"
511
- | "payouts-list"
512
- | "app-install"
513
- | "app-viewport"
514
- | "reporting-chart";
505
+ | "tax-settings";