@stripe/connect-js 3.3.38-preview-1 → 3.3.38
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/connect.esm.js +34 -91
- package/dist/connect.js +34 -91
- package/dist/pure.esm.js +26 -83
- package/dist/pure.js +26 -83
- package/dist/src/shared.d.ts +1 -1
- package/dist/types/config.d.ts +24 -76
- package/package.json +3 -3
- package/src/shared.ts +25 -42
- package/types/config.ts +29 -121
- package/types/shared.d.ts +97 -19
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
|
-
|
|
61
|
-
|
|
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
|
-
"
|
|
89
|
-
|
|
90
|
-
|
|
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
|
-
"
|
|
98
|
-
|
|
99
|
-
|
|
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
|
-
|
|
134
|
-
"
|
|
135
|
-
"
|
|
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
|
-
"
|
|
155
|
-
|
|
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="${
|
|
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.38`);
|
|
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.38
|
|
251
|
+
sdkVersion: "3.3.38"
|
|
309
252
|
}
|
|
310
253
|
})
|
|
311
254
|
}));
|
package/dist/src/shared.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IStripeConnectInitParams, StripeConnectInstance, ConnectElementTagName } from "../types";
|
|
2
2
|
export type LoadConnectAndInitialize = (initParams: IStripeConnectInitParams) => StripeConnectInstance;
|
|
3
|
-
|
|
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>;
|
package/dist/types/config.d.ts
CHANGED
|
@@ -9,6 +9,11 @@ export type FetchEphemeralKeyFunction = (fetchParams: {
|
|
|
9
9
|
export type CollectionOptions = {
|
|
10
10
|
fields: "currently_due" | "eventually_due";
|
|
11
11
|
futureRequirements?: "omit" | "include";
|
|
12
|
+
requirements?: {
|
|
13
|
+
only: string[];
|
|
14
|
+
} | {
|
|
15
|
+
exclude: string[];
|
|
16
|
+
};
|
|
12
17
|
};
|
|
13
18
|
export type Status = "blocked" | "canceled" | "disputed" | "early_fraud_warning" | "failed" | "incomplete" | "partially_refunded" | "pending" | "refund_pending" | "refunded" | "successful" | "uncaptured";
|
|
14
19
|
export type PaymentMethod = "ach_credit_transfer" | "ach_debit" | "acss_debit" | "affirm" | "afterpay_clearpay" | "alipay" | "alma" | "amazon_pay" | "amex_express_checkout" | "android_pay" | "apple_pay" | "au_becs_debit" | "nz_bank_account" | "bancontact" | "bacs_debit" | "bitcoin_source" | "bitcoin" | "blik" | "boleto" | "boleto_pilot" | "card_present" | "card" | "cashapp" | "crypto" | "customer_balance" | "demo_pay" | "dummy_passthrough_card" | "gbp_credit_transfer" | "google_pay" | "eps" | "fpx" | "giropay" | "grabpay" | "ideal" | "id_bank_transfer" | "id_credit_transfer" | "jp_credit_transfer" | "interac_present" | "kakao_pay" | "klarna" | "konbini" | "kr_card" | "kr_market" | "link" | "masterpass" | "mb_way" | "meta_pay" | "multibanco" | "mobilepay" | "naver_pay" | "netbanking" | "ng_bank" | "ng_bank_transfer" | "ng_card" | "ng_market" | "ng_ussd" | "vipps" | "oxxo" | "p24" | "payto" | "pay_by_bank" | "paper_check" | "payco" | "paynow" | "paypal" | "pix" | "promptpay" | "revolut_pay" | "samsung_pay" | "sepa_credit_transfer" | "sepa_debit" | "sofort" | "south_korea_market" | "swish" | "three_d_secure" | "three_d_secure_2" | "three_d_secure_2_eap" | "twint" | "upi" | "us_bank_account" | "visa_checkout" | "wechat" | "wechat_pay" | "zip";
|
|
@@ -42,10 +47,6 @@ export type NotificationCount = {
|
|
|
42
47
|
total: number;
|
|
43
48
|
actionRequired: number;
|
|
44
49
|
};
|
|
45
|
-
export type InstallState = {
|
|
46
|
-
appId: string;
|
|
47
|
-
state: "INSTALLED" | "UNINSTALLED";
|
|
48
|
-
};
|
|
49
50
|
export type LoaderStart = {
|
|
50
51
|
elementTagName: string;
|
|
51
52
|
};
|
|
@@ -60,14 +61,6 @@ export type EmbeddedError = {
|
|
|
60
61
|
type: EmbeddedErrorType;
|
|
61
62
|
message?: string;
|
|
62
63
|
};
|
|
63
|
-
export type FinancingProductType = {
|
|
64
|
-
productType: "standard" | "refill" | "none";
|
|
65
|
-
activeFinancingCount: number;
|
|
66
|
-
};
|
|
67
|
-
export type FinancingPromotionLayoutType = "full" | "banner";
|
|
68
|
-
export type IntervalType = "day" | "week" | "month" | "quarter" | "year";
|
|
69
|
-
export type ReportName = "gross_volume" | "net_volume";
|
|
70
|
-
export type RecipientDataSource = "customers";
|
|
71
64
|
export type EmbeddedErrorType =
|
|
72
65
|
/**
|
|
73
66
|
* Failure to connect to Stripe's API.
|
|
@@ -89,6 +82,10 @@ export type EmbeddedErrorType =
|
|
|
89
82
|
* Too many requests hit the API too quickly.
|
|
90
83
|
*/
|
|
91
84
|
| "rate_limit_error"
|
|
85
|
+
/**
|
|
86
|
+
* Failure to render the component, typically caused by browser extensions or network issues
|
|
87
|
+
*/
|
|
88
|
+
| "render_error"
|
|
92
89
|
/**
|
|
93
90
|
* API errors covering any other type of problem (e.g., a temporary problem with Stripe's servers), and are extremely uncommon.
|
|
94
91
|
*/
|
|
@@ -98,19 +95,6 @@ export declare const ConnectElementCommonMethodConfig: {
|
|
|
98
95
|
setOnLoaderStart: (_listener: (({ elementTagName }: LoaderStart) => void) | undefined) => void;
|
|
99
96
|
};
|
|
100
97
|
export declare const ConnectElementCustomMethodConfig: {
|
|
101
|
-
payments: {
|
|
102
|
-
setDefaultFilters: (_filters: PaymentsListDefaultFilters | undefined) => void;
|
|
103
|
-
};
|
|
104
|
-
"payment-details": {
|
|
105
|
-
setPayment: (_payment: string | undefined) => void;
|
|
106
|
-
setOnClose: (_listener: (() => void) | undefined) => void;
|
|
107
|
-
};
|
|
108
|
-
"payment-disputes": {
|
|
109
|
-
setPayment: (_payment: string | undefined) => void;
|
|
110
|
-
setOnDisputesLoaded: (_listener: (({ total }: {
|
|
111
|
-
total: number;
|
|
112
|
-
}) => void) | undefined) => void;
|
|
113
|
-
};
|
|
114
98
|
"account-onboarding": {
|
|
115
99
|
setFullTermsOfServiceUrl: (_termOfServiceUrl: string | undefined) => void;
|
|
116
100
|
setRecipientTermsOfServiceUrl: (_recipientTermsOfServiceUrl: string | undefined) => void;
|
|
@@ -152,51 +136,19 @@ export declare const ConnectElementCustomMethodConfig: {
|
|
|
152
136
|
"financial-account-transactions": {
|
|
153
137
|
setFinancialAccount: (_financialAccount: string) => void;
|
|
154
138
|
};
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
};
|
|
158
|
-
"app-install": {
|
|
159
|
-
setApp: (_app: string | undefined) => void;
|
|
160
|
-
setOnAppInstallStateFetched: (_listener: (({ appId, state }: InstallState) => void) | undefined) => void;
|
|
161
|
-
setOnAppInstallStateChanged: (_listener: (({ appId, state }: InstallState) => void) | undefined) => void;
|
|
162
|
-
};
|
|
163
|
-
"app-viewport": {
|
|
164
|
-
setApp: (_app: string | undefined) => void;
|
|
165
|
-
setAppData: (_appData: Record<string, string> | undefined) => void;
|
|
139
|
+
payments: {
|
|
140
|
+
setDefaultFilters: (_filters: PaymentsListDefaultFilters | undefined) => void;
|
|
166
141
|
};
|
|
167
|
-
"payment-
|
|
168
|
-
|
|
142
|
+
"payment-details": {
|
|
143
|
+
setPayment: (_payment: string | undefined) => void;
|
|
144
|
+
setOnClose: (_listener: (() => void) | undefined) => void;
|
|
169
145
|
};
|
|
170
|
-
"
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
setHowCapitalWorksUrl: (_howCapitalWorksUrl: string | undefined) => void;
|
|
174
|
-
setSupportUrl: (_supportUrl: string | undefined) => void;
|
|
175
|
-
setOnFinancingsLoaded: (_listener: (({ total }: {
|
|
146
|
+
"payment-disputes": {
|
|
147
|
+
setPayment: (_payment: string | undefined) => void;
|
|
148
|
+
setOnDisputesLoaded: (_listener: (({ total }: {
|
|
176
149
|
total: number;
|
|
177
150
|
}) => void) | undefined) => void;
|
|
178
151
|
};
|
|
179
|
-
"capital-financing-application": {
|
|
180
|
-
setOnApplicationSubmitted: (_listener: (() => void) | undefined) => void;
|
|
181
|
-
setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined) => void;
|
|
182
|
-
setHowCapitalWorksUrl: (_howCapitalWorksUrl: string | undefined) => void;
|
|
183
|
-
setOnApplicationStepChange: (_listener: (({ step }: StepChange) => void) | undefined) => void;
|
|
184
|
-
};
|
|
185
|
-
"capital-financing-promotion": {
|
|
186
|
-
setLayout: (_layout: FinancingPromotionLayoutType | undefined) => void;
|
|
187
|
-
setOnApplicationSubmitted: (_listener: (() => void) | undefined) => void;
|
|
188
|
-
setOnEligibleFinancingOfferLoaded: (_listener: (({ productType, activeFinancingCount, }: FinancingProductType) => void) | undefined) => void;
|
|
189
|
-
setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined) => void;
|
|
190
|
-
setHowCapitalWorksUrl: (_howCapitalWorksUrl: string | undefined) => void;
|
|
191
|
-
setEligibilityCriteriaUrl: (_eligibilityCriteriaUrl: string | undefined) => void;
|
|
192
|
-
setOnApplicationStepChange: (_listener: (({ step }: StepChange) => void) | undefined) => void;
|
|
193
|
-
};
|
|
194
|
-
"reporting-chart": {
|
|
195
|
-
setReportName: (_reportName: ReportName) => void;
|
|
196
|
-
setIntervalStart: (_intervalStart: Date | undefined) => void;
|
|
197
|
-
setIntervalEnd: (_intervalEnd: Date | undefined) => void;
|
|
198
|
-
setIntervalType: (_intervalType: IntervalType | undefined) => void;
|
|
199
|
-
};
|
|
200
152
|
"tax-settings": {
|
|
201
153
|
setHideProductTaxCodeSelector: (_hidden: boolean | undefined) => void;
|
|
202
154
|
setDisplayHeadOfficeCountries: (_countries: string[] | undefined) => void;
|
|
@@ -209,21 +161,17 @@ export declare const ConnectElementCustomMethodConfig: {
|
|
|
209
161
|
id: string;
|
|
210
162
|
}) => void) | undefined) => void;
|
|
211
163
|
setDisplayCountries: (_countries: string[] | undefined) => void;
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
setDisplayCountries: (_countries: string[] | undefined) => void;
|
|
215
|
-
};
|
|
216
|
-
"product-tax-code-selector": {
|
|
217
|
-
setOnTaxCodeSelect: (_listener: ((taxCode: string, { analyticsName }: {
|
|
218
|
-
analyticsName: string;
|
|
164
|
+
setOnAfterTaxRegistrationExpired: (_listener: (({ id }: {
|
|
165
|
+
id: string;
|
|
219
166
|
}) => void) | undefined) => void;
|
|
220
|
-
setHideDescription: (_hideDescription: boolean | undefined) => void;
|
|
221
|
-
setDisabled: (_disabled: boolean | undefined) => void;
|
|
222
|
-
setInitialTaxCode: (_initialTaxCode: string | undefined) => void;
|
|
223
167
|
};
|
|
224
|
-
"export-tax-transactions": {};
|
|
225
168
|
"payout-details": {
|
|
226
169
|
setPayout: (_payout: string | undefined) => void;
|
|
227
170
|
setOnClose: (_listener: (() => void) | undefined) => void;
|
|
228
171
|
};
|
|
172
|
+
"payout-reconciliation-report": {
|
|
173
|
+
setOnReportAvailabilityLoaded: (_listener: (({ isReportAvailable }: {
|
|
174
|
+
isReportAvailable: boolean;
|
|
175
|
+
}) => void) | undefined) => void;
|
|
176
|
+
};
|
|
229
177
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stripe/connect-js",
|
|
3
|
-
"version": "3.3.38
|
|
3
|
+
"version": "3.3.38",
|
|
4
4
|
"description": "Connect.js loading utility package",
|
|
5
5
|
"main": "dist/connect.js",
|
|
6
6
|
"module": "dist/connect.esm.js",
|
|
@@ -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": "^
|
|
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": "^
|
|
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
|
-
|
|
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-
|
|
33
|
-
| "stripe-connect-
|
|
34
|
-
| "stripe-connect-
|
|
35
|
-
| "stripe-connect-
|
|
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-
|
|
43
|
-
| "stripe-connect-
|
|
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
|
-
|
|
59
|
-
"
|
|
60
|
-
"
|
|
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
|
-
"
|
|
82
|
-
|
|
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="${
|
|
83
|
+
`script[src="${V1_URL}"]`
|
|
107
84
|
)[0] ||
|
|
108
85
|
document.querySelectorAll<HTMLScriptElement>(
|
|
109
|
-
`script[src="${
|
|
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
|
};
|