liqpay-nestjs 0.3.12 → 0.3.13
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.
|
@@ -280,7 +280,7 @@ exports.CheckoutCallbackSchema = exports.RawCheckoutCallbackSchema.transform(raw
|
|
|
280
280
|
/**
|
|
281
281
|
* API version. Current value is `7`
|
|
282
282
|
*/
|
|
283
|
-
version: (0, utils_1.parseOptional)(
|
|
283
|
+
version: (0, utils_1.parseOptional)(camelized.version, enums_1.LiqPayVersionSchema),
|
|
284
284
|
/**
|
|
285
285
|
* Acquirer ID
|
|
286
286
|
*/
|
|
@@ -292,7 +292,7 @@ exports.CheckoutCallbackSchema = exports.RawCheckoutCallbackSchema.transform(raw
|
|
|
292
292
|
* - `subscribe` - creation of a regular payment
|
|
293
293
|
* - `regular` - regular payment
|
|
294
294
|
*/
|
|
295
|
-
action: (0, utils_1.parseOptional)(enums_1.ActionSchema.extract(['pay', 'hold', 'subscribe', 'regular'])
|
|
295
|
+
action: (0, utils_1.parseOptional)(camelized.action, enums_1.ActionSchema.extract(['pay', 'hold', 'subscribe', 'regular'])),
|
|
296
296
|
/**
|
|
297
297
|
* Date of debiting funds
|
|
298
298
|
*/
|
|
@@ -304,15 +304,15 @@ exports.CheckoutCallbackSchema = exports.RawCheckoutCallbackSchema.transform(raw
|
|
|
304
304
|
/**
|
|
305
305
|
* Payment currency
|
|
306
306
|
*/
|
|
307
|
-
currency: (0, utils_1.parseOptional)(
|
|
307
|
+
currency: (0, utils_1.parseOptional)(camelized.currency, enums_1.CurrencySchema),
|
|
308
308
|
/**
|
|
309
309
|
* Transaction currency credit
|
|
310
310
|
*/
|
|
311
|
-
currencyCredit: (0, utils_1.parseOptional)(
|
|
311
|
+
currencyCredit: (0, utils_1.parseOptional)(camelized.currencyCredit, enums_1.CurrencySchema),
|
|
312
312
|
/**
|
|
313
313
|
* Transaction currency debit
|
|
314
314
|
*/
|
|
315
|
-
currencyDebit: (0, utils_1.parseOptional)(
|
|
315
|
+
currencyDebit: (0, utils_1.parseOptional)(camelized.currencyDebit, enums_1.CurrencySchema),
|
|
316
316
|
/**
|
|
317
317
|
* Payment completion/change date
|
|
318
318
|
*/
|
|
@@ -320,7 +320,7 @@ exports.CheckoutCallbackSchema = exports.RawCheckoutCallbackSchema.transform(raw
|
|
|
320
320
|
/**
|
|
321
321
|
* Error code
|
|
322
322
|
*/
|
|
323
|
-
errCode: (0, utils_1.parseOptional)(
|
|
323
|
+
errCode: (0, utils_1.parseOptional)(camelized.errCode, error_1.LiqPayErrorCodeSchema),
|
|
324
324
|
/**
|
|
325
325
|
* Represents whether 3D-Secure verification was performed during payment. Possible values: `true` - the transaction went through with 3DS verification, `false` - the transaction went through without 3DS verification
|
|
326
326
|
*/
|
|
@@ -335,7 +335,7 @@ exports.CheckoutCallbackSchema = exports.RawCheckoutCallbackSchema.transform(raw
|
|
|
335
335
|
* - `6` - the payer's card issuer does not support 3D-Secure technology
|
|
336
336
|
* - `7` - the transaction was completed without 3D-Secure
|
|
337
337
|
*/
|
|
338
|
-
mpiEci: (0, utils_1.parseOptional)(
|
|
338
|
+
mpiEci: (0, utils_1.parseOptional)(String(camelized.mpiEci), enums_1.MpiEciSchema),
|
|
339
339
|
/**
|
|
340
340
|
* Payment `OrderId`
|
|
341
341
|
*/
|
|
@@ -354,7 +354,7 @@ exports.CheckoutCallbackSchema = exports.RawCheckoutCallbackSchema.transform(raw
|
|
|
354
354
|
* - `invoice` - invoice to e-mail
|
|
355
355
|
* - `qr` - by scanning qr code
|
|
356
356
|
*/
|
|
357
|
-
paytype: (0, utils_1.parseOptional)(enums_1.PaytypeSchema.extract([
|
|
357
|
+
paytype: (0, utils_1.parseOptional)(camelized.paytype, enums_1.PaytypeSchema.extract([
|
|
358
358
|
'card',
|
|
359
359
|
'privat24',
|
|
360
360
|
'masterpass',
|
|
@@ -362,7 +362,7 @@ exports.CheckoutCallbackSchema = exports.RawCheckoutCallbackSchema.transform(raw
|
|
|
362
362
|
'cash',
|
|
363
363
|
'invoice',
|
|
364
364
|
'qr',
|
|
365
|
-
])
|
|
365
|
+
])),
|
|
366
366
|
/**
|
|
367
367
|
* Date of last payment refund
|
|
368
368
|
*/
|
|
@@ -370,7 +370,7 @@ exports.CheckoutCallbackSchema = exports.RawCheckoutCallbackSchema.transform(raw
|
|
|
370
370
|
/**
|
|
371
371
|
* Payment status
|
|
372
372
|
*/
|
|
373
|
-
status: (0, utils_1.parseOptional)(
|
|
373
|
+
status: (0, utils_1.parseOptional)(camelized.status, enums_1.PaymentStatusSchema),
|
|
374
374
|
/**
|
|
375
375
|
* An additional payment status indicating that the current payment is reserved for a refund on your store. Possible values: `true` - the payment is reserved for a refund
|
|
376
376
|
*/
|
|
@@ -265,11 +265,11 @@ exports.PaymentStatusResponseSchema = exports.RawPaymentStatusResponseSchema.tra
|
|
|
265
265
|
* - `auth` - card pre-authorization
|
|
266
266
|
* - `regular` - regular payment
|
|
267
267
|
*/
|
|
268
|
-
action: (0, utils_1.parseOptional)(
|
|
268
|
+
action: (0, utils_1.parseOptional)(camelized.action, enums_1.ActionSchema),
|
|
269
269
|
/**
|
|
270
270
|
* Bonus type, possible values: `bonusplus`, `discount_club`, `personal`, `promo`
|
|
271
271
|
*/
|
|
272
|
-
bonusType: (0, utils_1.parseOptional)(
|
|
272
|
+
bonusType: (0, utils_1.parseOptional)(camelized.bonusType, enums_1.BonusTypeSchema),
|
|
273
273
|
/**
|
|
274
274
|
* Payment creation date
|
|
275
275
|
*/
|
|
@@ -277,15 +277,15 @@ exports.PaymentStatusResponseSchema = exports.RawPaymentStatusResponseSchema.tra
|
|
|
277
277
|
/**
|
|
278
278
|
* Payment currency
|
|
279
279
|
*/
|
|
280
|
-
currency: (0, utils_1.parseOptional)(
|
|
280
|
+
currency: (0, utils_1.parseOptional)(camelized.currency, enums_1.CurrencySchema),
|
|
281
281
|
/**
|
|
282
282
|
* Transaction currency credit
|
|
283
283
|
*/
|
|
284
|
-
currencyCredit: (0, utils_1.parseOptional)(
|
|
284
|
+
currencyCredit: (0, utils_1.parseOptional)(camelized.currencyCredit, enums_1.CurrencySchema),
|
|
285
285
|
/**
|
|
286
286
|
* Transaction currency debit
|
|
287
287
|
*/
|
|
288
|
-
currencyDebit: (0, utils_1.parseOptional)(
|
|
288
|
+
currencyDebit: (0, utils_1.parseOptional)(camelized.currencyDebit, enums_1.CurrencySchema),
|
|
289
289
|
/**
|
|
290
290
|
* Payment completion/change date
|
|
291
291
|
*/
|
|
@@ -297,7 +297,7 @@ exports.PaymentStatusResponseSchema = exports.RawPaymentStatusResponseSchema.tra
|
|
|
297
297
|
/**
|
|
298
298
|
* Client language: `uk`, `en`
|
|
299
299
|
*/
|
|
300
|
-
language: (0, utils_1.parseOptional)(
|
|
300
|
+
language: (0, utils_1.parseOptional)(camelized.language, enums_1.LanguageSchema),
|
|
301
301
|
/**
|
|
302
302
|
* `OrderId` of payment in the LiqPay system
|
|
303
303
|
*/
|
|
@@ -312,7 +312,7 @@ exports.PaymentStatusResponseSchema = exports.RawPaymentStatusResponseSchema.tra
|
|
|
312
312
|
* - `6` - the payer's card issuer does not support 3D-Secure technology
|
|
313
313
|
* - `7` - the transaction was completed without 3D-Secure
|
|
314
314
|
*/
|
|
315
|
-
mpiEci: (0, utils_1.parseOptional)(
|
|
315
|
+
mpiEci: (0, utils_1.parseOptional)(String(camelized.mpiEci), enums_1.MpiEciSchema),
|
|
316
316
|
/**
|
|
317
317
|
* Payment `OrderId`
|
|
318
318
|
*/
|
|
@@ -329,15 +329,15 @@ exports.PaymentStatusResponseSchema = exports.RawPaymentStatusResponseSchema.tra
|
|
|
329
329
|
* - `invoice` - invoice to e-mail
|
|
330
330
|
* - `qr` - scan qr code
|
|
331
331
|
*/
|
|
332
|
-
paytype: (0, utils_1.parseOptional)(
|
|
332
|
+
paytype: (0, utils_1.parseOptional)(camelized.paytype, enums_1.PaytypeSchema),
|
|
333
333
|
/**
|
|
334
334
|
* Result of query execution: `ok`, `error`
|
|
335
335
|
*/
|
|
336
|
-
result: (0, utils_1.parseOptional)(
|
|
336
|
+
result: (0, utils_1.parseOptional)(camelized.result, enums_1.RequestResultSchema),
|
|
337
337
|
/**
|
|
338
338
|
* Payment status
|
|
339
339
|
*/
|
|
340
|
-
status: (0, utils_1.parseOptional)(
|
|
340
|
+
status: (0, utils_1.parseOptional)(camelized.status, enums_1.PaymentStatusSchema),
|
|
341
341
|
/**
|
|
342
342
|
* An additional payment status indicating that the current payment is reserved for a refund on your store. Possible values: `true` - the payment is reserved for a refund
|
|
343
343
|
*/
|
|
@@ -349,7 +349,7 @@ exports.PaymentStatusResponseSchema = exports.RawPaymentStatusResponseSchema.tra
|
|
|
349
349
|
/**
|
|
350
350
|
* API version. Current value is `7`
|
|
351
351
|
*/
|
|
352
|
-
version: (0, utils_1.parseOptional)(
|
|
352
|
+
version: (0, utils_1.parseOptional)(camelized.version, enums_1.LiqPayVersionSchema),
|
|
353
353
|
};
|
|
354
354
|
return (0, utils_1.removeUndefined)(transformed);
|
|
355
355
|
});
|
|
@@ -4,7 +4,7 @@ export declare const boolTo: <T extends string>(value: boolean | undefined, true
|
|
|
4
4
|
export declare const dateToIso: (d?: Date) => string | undefined;
|
|
5
5
|
export declare const parseBoolean: (value: string | boolean | undefined) => boolean | undefined;
|
|
6
6
|
export declare const parseDate: (value: Date | number | string | undefined) => Date | undefined;
|
|
7
|
-
export declare const parseOptional: <T>(schema: z.ZodType<T
|
|
7
|
+
export declare const parseOptional: <T>(value: unknown, schema: z.ZodType<T>) => T | undefined;
|
|
8
8
|
export declare const stringify: <T>(v?: T) => string | undefined;
|
|
9
9
|
export declare const join: (arr?: string[]) => string | undefined;
|
|
10
10
|
export declare const parseString: (value: unknown) => string | undefined;
|
|
@@ -18,7 +18,7 @@ const parseDate = (value) => {
|
|
|
18
18
|
return isNaN(date.getTime()) ? undefined : date;
|
|
19
19
|
};
|
|
20
20
|
exports.parseDate = parseDate;
|
|
21
|
-
const parseOptional = (
|
|
21
|
+
const parseOptional = (value, schema) => {
|
|
22
22
|
if (value == null)
|
|
23
23
|
return undefined;
|
|
24
24
|
const result = schema.safeParse(value);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "liqpay-nestjs",
|
|
3
3
|
"description": "LiqPay integration module for NestJS with support for payments, callbacks, and configuration via DI.",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.13",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
7
|
"main": "dist/index.js",
|