@payfurl/client 4.9.10 → 4.11.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.
Files changed (30) hide show
  1. package/CHANGELOG.md +163 -0
  2. package/README.md +237 -42
  3. package/dist/sdk/{CloseIcon-DhsqodgI.js → CloseIcon-Ejad61tT.js} +377 -363
  4. package/dist/sdk/{DefaultThreeDsProvider-qhlEMnGb.js → DefaultThreeDsProvider-bLoDSnkd.js} +24 -24
  5. package/dist/sdk/{MetricsGlobalThreeDsProvider-BOEA6G5r.js → MetricsGlobalThreeDsProvider-C93ttqbB.js} +17 -17
  6. package/dist/sdk/{PayWayAppleButton-ziK0EEr8.js → PayWayAppleButton-BzAwlGS-.js} +1 -1
  7. package/dist/sdk/{alerts-2ShoA1hc.js → alerts-1YSRy5iI.js} +9 -9
  8. package/dist/sdk/{cxpay-B2_DeDZt.js → cxpay-DblHb5vN.js} +1 -1
  9. package/dist/sdk/{default-2G4dbyeg.js → default-C7f86Fx-.js} +1 -1
  10. package/dist/sdk/{ecentric-kLMDhKl_.js → ecentric-B3UohyO_.js} +18 -17
  11. package/dist/sdk/{epna-p_tBGPK3.js → epna-DwUg2IlB.js} +1 -1
  12. package/dist/sdk/{flashbanc-ChTsnYMc.js → flashbanc-LXs8bahL.js} +1 -1
  13. package/dist/sdk/forter-CLFaJUYa.js +30 -0
  14. package/dist/sdk/{gpayments-Sa7Ek9FT.js → gpayments-DoZug3PV.js} +16 -16
  15. package/dist/sdk/{metrics_global-CxURr43F.js → metrics_global-BM-ooge-.js} +1 -1
  16. package/dist/sdk/{nmi-Bq5IGnP2.js → nmi-BA3ZTdQa.js} +1 -1
  17. package/dist/sdk/{nuvei-BDdU_s1G.js → nuvei-DIWsLlLz.js} +30 -30
  18. package/dist/sdk/{payabli-4-XnuYBw.js → payabli-DgrTI1Et.js} +1 -1
  19. package/dist/sdk/payfurl.d.ts +456 -0
  20. package/dist/sdk/payfurl.es.js +1885 -1601
  21. package/dist/sdk/payfurl.umd.js +8 -8
  22. package/dist/sdk/{payglocal-9n0hrZAf.js → payglocal-ezp0MsaZ.js} +36 -35
  23. package/dist/sdk/{payway_rest-vCmhadiN.js → payway_rest-D8-T-ULx.js} +1 -1
  24. package/dist/sdk/redact-Bn_hfytX.js +46 -0
  25. package/dist/sdk/{skybank-BIJrZVJd.js → skybank-BgDLlFXX.js} +1 -1
  26. package/dist/sdk/{strings-ahZ6LOKg.js → strings-Dp6oE-U1.js} +18 -14
  27. package/dist/sdk/style.css +1 -1
  28. package/dist/sdk/whenRendered-jR4Jls4M.js +12 -0
  29. package/package.json +9 -2
  30. package/dist/sdk/forter-BKH-4F0d.js +0 -26
@@ -0,0 +1,456 @@
1
+ export declare type AddCardLeastCostOptionsType = {
2
+ threeDSEmail?: string;
3
+ clickToPayEnabled?: boolean;
4
+ clickToPayOptions?: ClickToPayOptionsType;
5
+ style?: string;
6
+ tokenAuthenticationEnabled?: boolean;
7
+ createNetworkToken?: boolean;
8
+ networkTokenOptions?: NetworkTokenOptionsType;
9
+ vault?: boolean;
10
+ verifyCard?: boolean;
11
+ metadata?: {
12
+ [key: string]: string;
13
+ };
14
+ };
15
+
16
+ export declare type AddCardOptionsType = {
17
+ threeDSEmail?: string;
18
+ amount?: number;
19
+ currency?: string;
20
+ clickToPayEnabled?: boolean;
21
+ clickToPayOptions?: ClickToPayOptionsType;
22
+ style?: string;
23
+ tokenAuthenticationEnabled?: boolean;
24
+ createNetworkToken?: boolean;
25
+ networkTokenOptions?: NetworkTokenOptionsType;
26
+ vault?: boolean;
27
+ verifyCard?: boolean;
28
+ metadata?: {
29
+ [key: string]: string;
30
+ };
31
+ };
32
+
33
+ export declare type AddressInfoType = {
34
+ firstName: string;
35
+ lastName: string;
36
+ email: string;
37
+ phoneNumber: string;
38
+ streetAddress: string;
39
+ streetAddress2: string;
40
+ city: string;
41
+ country: string;
42
+ region: string;
43
+ postalCode: string;
44
+ state: string;
45
+ };
46
+
47
+ export declare type AddSavedPaymentMethodsOptionsType = {
48
+ amount: number;
49
+ currency: string;
50
+ tokenAuthenticationEnabled?: boolean;
51
+ networkTokenOptions?: NetworkTokenOptionsType;
52
+ };
53
+
54
+ export declare type ApplePayMerchantCapabilityType = "supports3DS" | "supportsCredit" | "supportsDebit" | "supportsEMV";
55
+
56
+ export declare type ApplePayOptionsType = {
57
+ lineItemLabel?: string;
58
+ /** @deprecated Derived server-side from the authenticated account. Ignored; removed next major. */
59
+ merchantIdentifier?: string;
60
+ /** @deprecated Ignored -- the SDK now sends window.location.hostname. Removed next major. */
61
+ domainName?: string;
62
+ /** @deprecated Derived server-side from the authenticated account. Ignored; removed next major. */
63
+ displayName?: string;
64
+ providerId?: string;
65
+ providerType?: string;
66
+ clientParameters?: {
67
+ [key: string]: string;
68
+ };
69
+ metadata?: {
70
+ [key: string]: string;
71
+ };
72
+ countryCode?: string;
73
+ merchantCapabilities?: ApplePayMerchantCapabilityType[];
74
+ supportedNetworks?: string[];
75
+ supportedCountries?: string[];
76
+ applePayVersion?: number;
77
+ };
78
+
79
+ declare enum CardBrandType {
80
+ mastercard = "mastercard",
81
+ maestro = "maestro",
82
+ visa = "visa",
83
+ amex = "amex",
84
+ discover = "discover"
85
+ }
86
+
87
+ export declare type CardDetailsType = {
88
+ bin?: string;
89
+ last4?: string;
90
+ expiryDate?: string;
91
+ cardholder?: string;
92
+ cardType?: string;
93
+ scheme?: string;
94
+ };
95
+
96
+ export declare type CheckoutOptionsType = {
97
+ taxAmount?: number;
98
+ shippingAmount?: number;
99
+ discountAmount?: number;
100
+ orderItems?: OrderItemType[];
101
+ customer?: CustomerInfoType;
102
+ billingAddress?: AddressInfoType;
103
+ metadata?: {
104
+ [key: string]: string;
105
+ };
106
+ };
107
+
108
+ export declare type ClickToPayOptionsType = {
109
+ dpaId: string;
110
+ dpaName?: string;
111
+ useFpan?: boolean;
112
+ cardBrands?: `${CardBrandType}`[];
113
+ dpaBillingPreference?: `${DpaBillingPreferenceType}`;
114
+ confirmPayment?: boolean;
115
+ locale?: string;
116
+ savedCardsOptions?: SavedCardsOptionsType;
117
+ saveCard?: boolean;
118
+ tokenAuthenticationEnabled?: boolean;
119
+ networkTokenOptions?: NetworkTokenOptionsType;
120
+ };
121
+
122
+ export declare type CustomerInfoType = {
123
+ firstName: string;
124
+ lastName: string;
125
+ email: string;
126
+ phoneNumber: string;
127
+ };
128
+
129
+ declare enum DpaBillingPreferenceType {
130
+ NONE = "NONE",
131
+ FULL = "FULL",
132
+ POSTAL_COUNTRY = "POSTAL_COUNTRY"
133
+ }
134
+
135
+ export declare type DropInApplePayOptionsType = {
136
+ providerId?: string;
137
+ providerType?: string;
138
+ lineItemLabel?: string;
139
+ /** @deprecated Derived server-side from the authenticated account. Ignored; removed next major. */
140
+ merchantIdentifier?: string;
141
+ /** @deprecated Ignored -- the SDK now sends window.location.hostname. Removed next major. */
142
+ domainName?: string;
143
+ /** @deprecated Derived server-side from the authenticated account. Ignored; removed next major. */
144
+ displayName?: string;
145
+ clientParameters?: {
146
+ [key: string]: string;
147
+ };
148
+ countryCode?: string;
149
+ merchantCapabilities?: ApplePayMerchantCapabilityType[];
150
+ supportedNetworks?: string[];
151
+ supportedCountries?: string[];
152
+ applePayVersion?: number;
153
+ };
154
+
155
+ export declare type DropInGooglePayOptionsType = {
156
+ providerId?: string;
157
+ gateway?: string;
158
+ googlePayGatewayMerchantId?: string;
159
+ googlePayMerchantId?: string;
160
+ googlePayMerchantName?: string;
161
+ buttonOptions?: GooglePayButtonOptionsType;
162
+ billingDetailsRequired?: boolean;
163
+ };
164
+
165
+ export declare type DropInOptionsType = {
166
+ paypalButtonStyle?: string;
167
+ paypalEnablePayIn4?: boolean;
168
+ cardProviderId?: string;
169
+ paypalProviderId?: string;
170
+ payToProviderId?: string;
171
+ threeDsProviderId?: string;
172
+ threeDSEmail?: string;
173
+ payToMaximumAmount?: number;
174
+ payToDescription?: string;
175
+ upiOptions?: UpiOptionsType;
176
+ googlePayOptions?: DropInGooglePayOptionsType;
177
+ applePayOptions?: DropInApplePayOptionsType;
178
+ clickToPayEnabled?: boolean;
179
+ clickToPayOptions?: ClickToPayOptionsType;
180
+ cardFormStyle?: string;
181
+ tokenAuthenticationEnabled?: boolean;
182
+ createNetworkToken?: boolean;
183
+ networkTokenOptions?: NetworkTokenOptionsType;
184
+ vault?: boolean;
185
+ allowedPaymentTypes?: `${PaymentType}`[];
186
+ metadata?: {
187
+ [key: string]: string;
188
+ };
189
+ verifyCard?: boolean;
190
+ };
191
+
192
+ export declare type DropInPayToOptionsType = {
193
+ providerId: string;
194
+ maximumAmount: number;
195
+ description: string;
196
+ };
197
+
198
+ declare enum Environment {
199
+ LOCAL = "local",
200
+ DEVELOPMENT = "development",
201
+ SANDBOX = "sandbox",
202
+ PRODUCTION = "production"
203
+ }
204
+
205
+ export declare type EnvironmentName = `${Environment}`;
206
+
207
+ export declare type FailureResponseType = {
208
+ error: string;
209
+ errorDetails?: {
210
+ [key: string]: any;
211
+ };
212
+ };
213
+
214
+ declare type FraudCheckResultType = {
215
+ decision: string;
216
+ transactionId: string;
217
+ providerId: string;
218
+ stopPaymentOnFailure: boolean;
219
+ managedOrderToken?: string;
220
+ threeDSServerTransID?: string;
221
+ };
222
+
223
+ declare type GooglePayButtonColor = "default" | "black" | "white";
224
+
225
+ declare type GooglePayButtonOptionsType = {
226
+ buttonColor?: GooglePayButtonColor;
227
+ buttonType?: GooglePayButtonType;
228
+ buttonRadius?: number;
229
+ buttonSizeMode?: GooglePayButtonSizeMode;
230
+ buttonLocale?: string;
231
+ };
232
+
233
+ declare type GooglePayButtonSizeMode = "static" | "fill";
234
+
235
+ declare type GooglePayButtonType = "book" | "buy" | "checkout" | "donate" | "order" | "pay" | "plain" | "subscribe";
236
+
237
+ export declare type GooglePayOptionsType = {
238
+ gateway?: string;
239
+ googlePayGatewayMerchantId?: string;
240
+ googlePayMerchantId?: string;
241
+ googlePayMerchantName?: string;
242
+ metadata?: {
243
+ [key: string]: string;
244
+ };
245
+ buttonOptions?: GooglePayButtonOptionsType;
246
+ billingDetailsRequired?: boolean;
247
+ };
248
+
249
+ export declare type IinDataType = {
250
+ scheme: string;
251
+ country: string;
252
+ issuer: string;
253
+ countryCode: string;
254
+ cardType: string;
255
+ };
256
+
257
+ export declare type NetworkTokenOptionsType = {
258
+ acquirerMerchantId?: string;
259
+ acquirerBIN?: string;
260
+ merchantCategoryCode?: string;
261
+ authenticationReasons?: string[];
262
+ };
263
+
264
+ export declare type OrderInfoType = {
265
+ orderNumber: string;
266
+ taxAmount: number;
267
+ shippingAmount: number;
268
+ discountAmount: number;
269
+ orderItems: OrderItemType[];
270
+ };
271
+
272
+ declare type OrderItemType = {
273
+ name: string;
274
+ quantity: number;
275
+ sku: string;
276
+ unitPrice: number;
277
+ totalAmount: number;
278
+ unitOfMeasure?: string;
279
+ };
280
+
281
+ declare const payfurl: PayfurlInterface;
282
+ export default payfurl;
283
+
284
+ export declare interface PayfurlInterface {
285
+ init(environment: EnvironmentName, publicKey: string, debug?: boolean): PayfurlInterface;
286
+ execute(): void;
287
+ addDropIn(dropinParentId: string, amount: number, currency: string, options?: DropInOptionsType): PayfurlInterface;
288
+ addCard(iframeParentId: string, providerId: string, options?: AddCardOptionsType): PayfurlInterface;
289
+ addCardLeastCost(iframeParentId: string, amount: number, currency: string, options?: AddCardLeastCostOptionsType): PayfurlInterface;
290
+ addThreeDsWithFullParameters(parentId: string, cardNumber: string, expiryDate: string, cardHolderName: string, email: string, amount: number, currency: string, ccv?: string, options?: {
291
+ requireChallenge?: boolean;
292
+ }): PayfurlInterface;
293
+ tokeniseWith3Ds(// +
294
+ parentId: string, providerId: string, cardNumber: string, expiryDate: string, cardHolderName: string, ccv: string, email: string, amount: number, currency: string, metadata?: {
295
+ [key: string]: string;
296
+ }, options?: {
297
+ requireChallenge?: boolean;
298
+ verify?: boolean;
299
+ createNetworkToken?: boolean;
300
+ vault?: boolean;
301
+ }): PayfurlInterface;
302
+ tokeniseCard(providerId: string, cardNumber: string, expiryDate: string, cardHolderName: string, ccv: string, metadata?: {
303
+ [key: string]: string;
304
+ }, threeDsServerTransId?: string, options?: {
305
+ verify?: boolean;
306
+ createNetworkToken?: boolean;
307
+ vault?: boolean;
308
+ amount?: number;
309
+ currency?: string;
310
+ }): PayfurlInterface;
311
+ addThreeDsWithToken(tokenId: string, email: string, amount: number, currency: string, ccv?: string, options?: {
312
+ requireChallenge?: boolean;
313
+ }): PayfurlInterface;
314
+ addPaypal(parentId: string, amount: number, currency: string, providerId?: string, options?: PaypalOptionsType): PayfurlInterface;
315
+ addPayTo(parentId: string, amount: number, providerId?: string, options?: PayToOptionsType): PayfurlInterface;
316
+ addGooglePay(parentId: string, amount: number, currency: string, providerId?: string, options?: GooglePayOptionsType): PayfurlInterface;
317
+ addApplePay(parentId: string, amount: number, currency: string, providerId?: string, options?: ApplePayOptionsType): PayfurlInterface;
318
+ isApplePayAvailable(): Promise<boolean>;
319
+ addCheckout(parentId: string, amount: number, currency: string, providerType: string, providerId: string, options: CheckoutOptionsType, checkoutOptions: {
320
+ [key: string]: string;
321
+ }): PayfurlInterface;
322
+ addUpi(parentId: string, amount: number, providerId: string, options: UpiOptionsType): PayfurlInterface;
323
+ setAmount(amount: number): PayfurlInterface;
324
+ setCurrency(currency: string): PayfurlInterface;
325
+ onSuccess(f: (message: SuccessResponseType) => void): PayfurlInterface;
326
+ onFailure(f: (message: FailureResponseType) => void): PayfurlInterface;
327
+ successMessage(message: string): PayfurlInterface;
328
+ onLoaded(f: () => void): PayfurlInterface;
329
+ onPaymentMethodStatus(f: (status: PaymentMethodStatusType) => void): PayfurlInterface;
330
+ onThreeDsProgress(f: (progress: ThreeDsProgressType) => void): PayfurlInterface;
331
+ onValidationStatusChange(f: (status: string, message: string) => void): PayfurlInterface;
332
+ onValidate(f: () => boolean): PayfurlInterface;
333
+ setBillingAddress(address: AddressInfoType): PayfurlInterface;
334
+ setCustomerInfo(customer: CustomerInfoType): PayfurlInterface;
335
+ setOrderInfo(order: OrderInfoType): PayfurlInterface;
336
+ preloadClickToPay(options?: ClickToPayOptionsType): PayfurlInterface;
337
+ addSavedPaymentMethods(iframeParentId: string, customerId: string, options?: AddSavedPaymentMethodsOptionsType): PayfurlInterface;
338
+ }
339
+
340
+ export declare type PaymentMethodStatusType = {
341
+ paymentMethod: "googlepay" | "applepay" | "paypal" | "payto" | "checkout" | "upi";
342
+ providerType?: string;
343
+ status: "rendered" | "unavailable";
344
+ reason?: "no_provider" | "unsupported" | "error";
345
+ message?: string;
346
+ };
347
+
348
+ declare enum PaymentType {
349
+ card = "card",
350
+ paypal = "paypal",
351
+ applepay = "applepay",
352
+ googlepay = "googlepay",
353
+ upi = "upi",
354
+ payto = "payto",
355
+ payid = "payid",
356
+ shift = "shift",
357
+ pesapal = "pesapal",
358
+ paybyaccount = "paybyaccount",
359
+ payglocal = "payglocal",
360
+ zip = "zip",
361
+ dlocal = "dlocal"
362
+ }
363
+
364
+ export declare type PaypalOptionsType = {
365
+ hideShipping?: boolean;
366
+ paypalButtonStyle?: any;
367
+ paypalEnablePayIn4?: boolean;
368
+ transfer?: {
369
+ account: string;
370
+ amount: number;
371
+ } | null;
372
+ metadata?: {
373
+ [key: string]: string;
374
+ };
375
+ };
376
+
377
+ export declare type PayToOptionsType = {
378
+ maximumAmount: number;
379
+ description: string;
380
+ metadata?: {
381
+ [key: string]: string;
382
+ };
383
+ };
384
+
385
+ declare type SavedCardsOptionsType = {
386
+ align?: "left" | "center";
387
+ };
388
+
389
+ export declare type SuccessResponseType = {
390
+ token?: string;
391
+ transactionId?: string;
392
+ threeDSServerTransID?: string;
393
+ cardDetails?: CardDetailsType;
394
+ iinData?: IinDataType;
395
+ fraudCheckResult?: FraudCheckResultType;
396
+ clickToPayData?: {
397
+ billingAddress: {
398
+ line1: string;
399
+ city: string;
400
+ state: string;
401
+ countryCode: string;
402
+ zip: string;
403
+ };
404
+ panBin: string;
405
+ panLastFour: string;
406
+ scheme: string;
407
+ paymentCardType: string;
408
+ };
409
+ };
410
+
411
+ export declare type ThreeDsProgressType = {
412
+ step: "started" | "challenge" | "completed";
413
+ success?: boolean;
414
+ error?: string;
415
+ };
416
+
417
+ /**
418
+ * The shape of `errorDetails` that the tokenise flow populates on `onFailure` when
419
+ * `POST /token/card` fails during `tokeniseWith3Ds`, the case PAY-4804 was raised for.
420
+ *
421
+ * `onFailure` is a single callback shared across every flow (tokenise, fraud, 3DS, ...),
422
+ * so its `errorDetails` is typed loosely as `{ [key: string]: any }` rather than tied to
423
+ * this shape. This type is exported for consumers who know they are handling a tokenise
424
+ * failure and want the concrete field names, e.g. `errorDetails as TokeniseErrorDetailsType`.
425
+ *
426
+ * Mirrors the whitelisted subset of the API's error envelope (`api/Models/Error.cs`).
427
+ * `code` and `isRetryable` are non-nullable value types in the API and are always
428
+ * serialised, so they are required here. The string fields may be `null` (a 400 from
429
+ * the controller pipeline, which writes nulls) or absent entirely (a 401 from
430
+ * `AuthFilter`, which omits nulls), so they are optional and nullable.
431
+ *
432
+ * `details`, `resource` and `chargeId` are deliberately excluded. See PAY-4804.
433
+ */
434
+ export declare type TokeniseErrorDetailsType = {
435
+ code: number;
436
+ isRetryable: boolean;
437
+ message?: string | null;
438
+ gatewayCode?: string | null;
439
+ gatewayMessage?: string | null;
440
+ type?: string | null;
441
+ };
442
+
443
+ export declare type UpiOptionsType = {
444
+ documentId: string;
445
+ name: string;
446
+ email: string;
447
+ subscriptionFrequencyUnit: string;
448
+ subscriptionFrequency: number;
449
+ subscriptionStartAt: string;
450
+ subscriptionEndAt: string;
451
+ metadata?: {
452
+ [key: string]: string;
453
+ };
454
+ };
455
+
456
+ export { }