liqpay-nestjs 0.3.16 → 0.3.17

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.
@@ -1,6 +1,6 @@
1
1
  import { Result } from '../types/base';
2
- import { CheckoutInput, type CheckoutRequest } from '../types/checkout';
3
- import { PaymentStatusInput, PaymentStatusResponse } from '../types/payment-status';
2
+ import { type CheckoutInput, type CheckoutRequest } from '../types/checkout';
3
+ import { type PaymentStatusInput, type PaymentStatusResponse } from '../types/payment-status';
4
4
  import { UtilsClient } from './utils.client';
5
5
  export declare class PaymentsClient {
6
6
  private readonly utils;
@@ -1,5 +1,6 @@
1
1
  import z from 'zod';
2
2
  import { LiqPayEnvelope, LiqPayRawRequest, LiqPayRequest, LiqPayResponse, Result } from '../types/base';
3
+ import { LiqPayApiPath } from '../types/common';
3
4
  import { LiqPayError } from '../types/error';
4
5
  export declare class UtilsClient {
5
6
  readonly publicKey: string;
@@ -16,5 +17,7 @@ export declare class UtilsClient {
16
17
  parseData<T>(schema: z.ZodType<T>, data: unknown): Result<T>;
17
18
  parseError(data: unknown): Result<never> | null;
18
19
  parseEnvelope<TResponse extends LiqPayResponse>(envelope: LiqPayEnvelope, schema: z.ZodType<TResponse>): Result<TResponse>;
19
- call<TRequest extends LiqPayRequest, TRawRequest extends LiqPayRawRequest, TResponse extends LiqPayResponse>(payload: TRequest, rawSchema: z.ZodType<TRawRequest>, responseSchema: z.ZodType<TResponse>, url?: string): Promise<Result<TResponse>>;
20
+ /** testing version without signature validation */
21
+ parseEnvelopeTest<TResponse extends LiqPayResponse>(envelope: LiqPayEnvelope, schema: z.ZodType<TResponse>): Result<TResponse>;
22
+ call<TRequest extends LiqPayRequest, TRawRequest extends LiqPayRawRequest, TResponse extends LiqPayResponse>(payload: TRequest, rawSchema: z.ZodType<TRawRequest>, responseSchema: z.ZodType<TResponse>, url?: LiqPayApiPath): Promise<Result<TResponse>>;
20
23
  }
@@ -71,6 +71,12 @@ class UtilsClient {
71
71
  }
72
72
  return this.parseData(schema, rawData);
73
73
  }
74
+ /** testing version without signature validation */
75
+ parseEnvelopeTest(envelope, schema) {
76
+ const rawData = this.decodeData(envelope.data);
77
+ console.log('RAW DATA: ', rawData);
78
+ return this.parseData(schema, rawData);
79
+ }
74
80
  async call(payload, rawSchema, responseSchema, url = common_1.REQUEST_URL) {
75
81
  const raw = rawSchema.parse(payload);
76
82
  const envelope = this.toEnvelope(raw);
@@ -88,6 +94,8 @@ class UtilsClient {
88
94
  catch {
89
95
  return this.createError('invalid_response', 'Failed to parse JSON response');
90
96
  }
97
+ /** testing */
98
+ console.log('RAW DATA: ', rawData);
91
99
  return this.parseData(responseSchema, rawData);
92
100
  }
93
101
  }
@@ -5,4 +5,5 @@ export declare class WebhooksClient {
5
5
  private readonly utils;
6
6
  constructor(utils: UtilsClient);
7
7
  parseCheckoutCallback(envelope: LiqPayEnvelope): Result<CheckoutCallback>;
8
+ parseCheckoutCallbackTest(envelope: LiqPayEnvelope): Result<CheckoutCallback>;
8
9
  }
@@ -10,5 +10,8 @@ class WebhooksClient {
10
10
  parseCheckoutCallback(envelope) {
11
11
  return this.utils.parseEnvelope(envelope, checkout_1.CheckoutCallbackSchema);
12
12
  }
13
+ parseCheckoutCallbackTest(envelope) {
14
+ return this.utils.parseEnvelopeTest(envelope, checkout_1.CheckoutCallbackSchema);
15
+ }
13
16
  }
14
17
  exports.WebhooksClient = WebhooksClient;
@@ -63,4 +63,64 @@ export declare class WebhooksService {
63
63
  refundAmount?: number | undefined;
64
64
  verifycode?: string | undefined;
65
65
  }>>>;
66
+ parseCheckoutCallbackTest(envelope: LiqPayEnvelope): Promise<import("../../core/types/base").Result<Partial<{
67
+ version: 7 | undefined;
68
+ acqId: string | undefined;
69
+ action: "pay" | "hold" | "subscribe" | "regular" | undefined;
70
+ completionDate: Date | undefined;
71
+ createDate: Date | undefined;
72
+ currency: "USD" | "EUR" | "UAH" | undefined;
73
+ currencyCredit: "USD" | "EUR" | "UAH" | undefined;
74
+ currencyDebit: "USD" | "EUR" | "UAH" | undefined;
75
+ endDate: Date | undefined;
76
+ errCode: "5" | "limit" | "frod" | "decline" | "err_auth" | "err_cache" | "user_not_found" | "err_sms_send" | "err_sms_otp" | "shop_blocked" | "shop_not_active" | "invalid_signature" | "order_id_empty" | "err_shop_not_agent" | "err_card_def_notfound" | "err_no_card_token" | "err_card_liqpay_def" | "err_card_type" | "err_card_country" | "err_limit_amount" | "err_payment_amount_limit" | "amount_limit" | "payment_err_sender_card" | "payment_processing" | "err_payment_discount" | "err_wallet" | "err_get_verify_code" | "err_verify_code" | "wait_info" | "err_path" | "err_payment_cash_acq" | "err_split_amount" | "err_card_receiver_def" | "payment_err_status" | "public_key_not_found" | "payment_not_found" | "payment_not_subscribed" | "wrong_amount_currency" | "err_amount_hold" | "err_access" | "order_id_duplicate" | "err_blocked" | "err_empty" | "err_empty_phone" | "err_missing" | "err_wrong" | "err_wrong_currency" | "err_phone" | "err_card" | "err_card_bin" | "err_terminal_notfound" | "err_commission_notfound" | "err_payment_create" | "err_mpi" | "err_currency_is_not_allowed" | "err_look" | "err_mods_empty" | "payment_err_type" | "err_payment_currency" | "err_payment_exchangerates" | "err_signature" | "err_api_action" | "err_api_callback" | "err_api_ip" | "expired_phone" | "expired_3ds" | "expired_otp" | "expired_cvv" | "expired_p24" | "expired_sender" | "expired_pin" | "expired_ivr" | "expired_captcha" | "expired_password" | "expired_senderapp" | "expired_prepared" | "expired_mp" | "expired_qr" | "90" | "101" | "102" | "103" | "104" | "105" | "106" | "107" | "108" | "109" | "110" | "111" | "112" | "113" | "114" | "115" | "2903" | "2915" | "3914" | "9851" | "9852" | "9854" | "9855" | "9857" | "9859" | "9860" | "9861" | "9863" | "9867" | "9868" | "9872" | "9882" | "9886" | "9961" | "9989" | undefined;
77
+ is3ds: boolean | undefined;
78
+ liqpayOrderId: string | undefined;
79
+ mpiEci: "5" | "6" | "7" | undefined;
80
+ orderId: string | undefined;
81
+ paymentId: string | undefined;
82
+ paytype: "card" | "privat24" | "masterpass" | "moment_part" | "cash" | "invoice" | "qr" | undefined;
83
+ refundDateLast: Date | undefined;
84
+ status: "error" | "failure" | "reversed" | "subscribed" | "success" | "unsubscribed" | "3ds_verify" | "captcha_verify" | "cvv_verify" | "ivr_verify" | "otp_verify" | "password_verify" | "phone_verify" | "pin_verify" | "receiver_verify" | "sender_verify" | "senderapp_verify" | "wait_qr" | "wait_sender" | "p24_verify" | "mp_verify" | "cash_wait" | "hold_wait" | "invoice_wait" | "prepared" | "processing" | "wait_accept" | "wait_card" | "wait_compensation" | "wait_lc" | "wait_reserve" | "wait_secure" | "try_again" | undefined;
85
+ waitReserveStatus: boolean | undefined;
86
+ publicKey?: string | undefined;
87
+ agentCommission?: number | undefined;
88
+ amount?: number | undefined;
89
+ amountBonus?: number | undefined;
90
+ amountCredit?: number | undefined;
91
+ amountDebit?: number | undefined;
92
+ authcodeCredit?: string | undefined;
93
+ authcodeDebit?: string | undefined;
94
+ cardToken?: string | undefined;
95
+ commissionCredit?: number | undefined;
96
+ commissionDebit?: number | undefined;
97
+ customer?: string | undefined;
98
+ description?: string | undefined;
99
+ errDescription?: string | undefined;
100
+ info?: string | undefined;
101
+ ip?: string | undefined;
102
+ receiverCommission?: number | undefined;
103
+ redirectTo?: string | undefined;
104
+ rrnCredit?: string | undefined;
105
+ rrnDebit?: string | undefined;
106
+ senderBonus?: number | undefined;
107
+ senderCardBank?: string | undefined;
108
+ senderCardCountry?: string | number | undefined;
109
+ senderCardMask2?: string | undefined;
110
+ senderIban?: string | undefined;
111
+ senderCardType?: string | undefined;
112
+ senderCommission?: number | undefined;
113
+ senderFirstName?: string | undefined;
114
+ senderLastName?: string | undefined;
115
+ senderPhone?: string | undefined;
116
+ token?: string | undefined;
117
+ type?: string | undefined;
118
+ errErc?: string | undefined;
119
+ productCategory?: string | undefined;
120
+ productDescription?: string | undefined;
121
+ productName?: string | undefined;
122
+ productUrl?: string | undefined;
123
+ refundAmount?: number | undefined;
124
+ verifycode?: string | undefined;
125
+ }>>>;
66
126
  }
@@ -9,5 +9,8 @@ class WebhooksService {
9
9
  async parseCheckoutCallback(envelope) {
10
10
  return this.client.webhooks.parseCheckoutCallback(envelope);
11
11
  }
12
+ async parseCheckoutCallbackTest(envelope) {
13
+ return this.client.webhooks.parseCheckoutCallbackTest(envelope);
14
+ }
12
15
  }
13
16
  exports.WebhooksService = WebhooksService;
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.16",
4
+ "version": "0.3.17",
5
5
  "type": "commonjs",
6
6
  "module": "dist/index.js",
7
7
  "main": "dist/index.js",