liqpay-nestjs 0.3.11 → 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.
@@ -23,7 +23,7 @@ export declare const RawCheckoutCallbackSchema: z.ZodObject<{
23
23
  card_token: z.ZodOptional<z.ZodString>;
24
24
  commission_credit: z.ZodOptional<z.ZodNumber>;
25
25
  commission_debit: z.ZodOptional<z.ZodNumber>;
26
- completion_date: z.ZodOptional<z.ZodString>;
26
+ completion_date: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
27
27
  create_date: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
28
28
  currency: z.ZodOptional<z.ZodString>;
29
29
  currency_credit: z.ZodOptional<z.ZodString>;
@@ -43,7 +43,7 @@ export declare const RawCheckoutCallbackSchema: z.ZodObject<{
43
43
  paytype: z.ZodOptional<z.ZodString>;
44
44
  receiver_commission: z.ZodOptional<z.ZodNumber>;
45
45
  redirect_to: z.ZodOptional<z.ZodString>;
46
- refund_date_last: z.ZodOptional<z.ZodString>;
46
+ refund_date_last: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
47
47
  rrn_credit: z.ZodOptional<z.ZodString>;
48
48
  rrn_debit: z.ZodOptional<z.ZodString>;
49
49
  sender_bonus: z.ZodOptional<z.ZodNumber>;
@@ -98,7 +98,7 @@ export declare const CheckoutCallbackSchema: z.ZodPipe<z.ZodObject<{
98
98
  card_token: z.ZodOptional<z.ZodString>;
99
99
  commission_credit: z.ZodOptional<z.ZodNumber>;
100
100
  commission_debit: z.ZodOptional<z.ZodNumber>;
101
- completion_date: z.ZodOptional<z.ZodString>;
101
+ completion_date: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
102
102
  create_date: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
103
103
  currency: z.ZodOptional<z.ZodString>;
104
104
  currency_credit: z.ZodOptional<z.ZodString>;
@@ -118,7 +118,7 @@ export declare const CheckoutCallbackSchema: z.ZodPipe<z.ZodObject<{
118
118
  paytype: z.ZodOptional<z.ZodString>;
119
119
  receiver_commission: z.ZodOptional<z.ZodNumber>;
120
120
  redirect_to: z.ZodOptional<z.ZodString>;
121
- refund_date_last: z.ZodOptional<z.ZodString>;
121
+ refund_date_last: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
122
122
  rrn_credit: z.ZodOptional<z.ZodString>;
123
123
  rrn_debit: z.ZodOptional<z.ZodString>;
124
124
  sender_bonus: z.ZodOptional<z.ZodNumber>;
@@ -287,7 +287,7 @@ export declare const CheckoutCallbackSchema: z.ZodPipe<z.ZodObject<{
287
287
  card_token?: string | undefined;
288
288
  commission_credit?: number | undefined;
289
289
  commission_debit?: number | undefined;
290
- completion_date?: string | undefined;
290
+ completion_date?: string | number | undefined;
291
291
  create_date?: string | number | undefined;
292
292
  currency?: string | undefined;
293
293
  currency_credit?: string | undefined;
@@ -307,7 +307,7 @@ export declare const CheckoutCallbackSchema: z.ZodPipe<z.ZodObject<{
307
307
  paytype?: string | undefined;
308
308
  receiver_commission?: number | undefined;
309
309
  redirect_to?: string | undefined;
310
- refund_date_last?: string | undefined;
310
+ refund_date_last?: string | number | undefined;
311
311
  rrn_credit?: string | undefined;
312
312
  rrn_debit?: string | undefined;
313
313
  sender_bonus?: number | undefined;
@@ -80,7 +80,7 @@ exports.RawCheckoutCallbackSchema = zod_1.z.object({
80
80
  /**
81
81
  * Date of debiting funds
82
82
  */
83
- completion_date: zod_1.z.string().optional(),
83
+ completion_date: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]).optional(),
84
84
  /**
85
85
  * Payment creation date
86
86
  */
@@ -168,7 +168,7 @@ exports.RawCheckoutCallbackSchema = zod_1.z.object({
168
168
  /**
169
169
  * Date of last payment refund
170
170
  */
171
- refund_date_last: zod_1.z.string().optional(),
171
+ refund_date_last: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]).optional(),
172
172
  /**
173
173
  * Unique transaction number in the authorization and settlement system of the servicing bank `Retrieval Reference number`
174
174
  */
@@ -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)(enums_1.LiqPayVersionSchema, camelized.version),
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']), camelized.action),
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)(enums_1.CurrencySchema, camelized.currency),
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)(enums_1.CurrencySchema, camelized.currencyCredit),
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)(enums_1.CurrencySchema, camelized.currencyDebit),
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)(error_1.LiqPayErrorCodeSchema, camelized.errCode),
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)(enums_1.MpiEciSchema, String(camelized.mpiEci)),
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
- ]), camelized.paytype),
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)(enums_1.PaymentStatusSchema, camelized.status),
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)(enums_1.ActionSchema, camelized.action),
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)(enums_1.BonusTypeSchema, camelized.bonusType),
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)(enums_1.CurrencySchema, camelized.currency),
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)(enums_1.CurrencySchema, camelized.currencyCredit),
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)(enums_1.CurrencySchema, camelized.currencyDebit),
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)(enums_1.LanguageSchema, camelized.language),
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)(enums_1.MpiEciSchema, String(camelized.mpiEci)),
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)(enums_1.PaytypeSchema, camelized.paytype),
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)(enums_1.RequestResultSchema, camelized.result),
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)(enums_1.PaymentStatusSchema, camelized.status),
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)(enums_1.LiqPayVersionSchema, camelized.version),
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>, value: unknown) => T | undefined;
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 = (schema, value) => {
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.11",
4
+ "version": "0.3.13",
5
5
  "type": "commonjs",
6
6
  "module": "dist/index.js",
7
7
  "main": "dist/index.js",