liqpay-nestjs 0.3.13 → 0.3.15

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,5 +1,5 @@
1
1
  import { Result } from '../types/base';
2
- import { CheckoutInput, type CheckoutRequest } from '../types/checkout';
2
+ import { CheckoutCallback, CheckoutInput, type CheckoutRequest } from '../types/checkout';
3
3
  import { PaymentStatusInput, PaymentStatusResponse } from '../types/payment-status';
4
4
  import { UtilsClient } from './utils.client';
5
5
  export declare class PaymentsClient {
@@ -14,6 +14,14 @@ export declare class PaymentsClient {
14
14
  signature: string;
15
15
  url: string;
16
16
  };
17
+ getCheckoutUrlServer(payload: CheckoutInput): Promise<Result<CheckoutCallback>>;
18
+ getAuthUrl(payload: CheckoutInput): {
19
+ request: CheckoutRequest;
20
+ data: string;
21
+ signature: string;
22
+ url: string;
23
+ };
24
+ getAuthUrlServer(payload: CheckoutInput): Promise<Result<CheckoutCallback>>;
17
25
  hold(payload: CheckoutInput): {
18
26
  request: CheckoutRequest;
19
27
  data: string;
@@ -43,6 +43,33 @@ class PaymentsClient {
43
43
  url: this.buildUrl(data, signature),
44
44
  };
45
45
  }
46
+ async getCheckoutUrlServer(payload) {
47
+ const request = {
48
+ ...payload,
49
+ action: 'pay',
50
+ version: 7,
51
+ publicKey: this.utils.publicKey,
52
+ };
53
+ return await this.utils.call(request, checkout_1.RawCheckoutRequestSchema, checkout_1.CheckoutCallbackSchema);
54
+ }
55
+ getAuthUrl(payload) {
56
+ const { request, data, signature } = this.prepare(payload, 'auth');
57
+ return {
58
+ request,
59
+ data,
60
+ signature,
61
+ url: this.buildUrl(data, signature),
62
+ };
63
+ }
64
+ async getAuthUrlServer(payload) {
65
+ const request = {
66
+ ...payload,
67
+ action: 'auth',
68
+ version: 7,
69
+ publicKey: this.utils.publicKey,
70
+ };
71
+ return await this.utils.call(request, checkout_1.RawCheckoutRequestSchema, checkout_1.CheckoutCallbackSchema);
72
+ }
46
73
  // TODO: implement
47
74
  hold(payload) {
48
75
  const { request, data, signature } = this.prepare(payload, 'hold');
@@ -41,7 +41,7 @@ export declare const ActionSchema: z.ZodEnum<{
41
41
  regular: "regular";
42
42
  }>;
43
43
  export type Action = z.infer<typeof ActionSchema>;
44
- export type CheckoutAction = Extract<Action, 'pay' | 'hold' | 'subscribe' | 'paydonate'>;
44
+ export type CheckoutAction = Extract<Action, 'pay' | 'hold' | 'subscribe' | 'paydonate' | 'auth'>;
45
45
  export type PaymentStatusAction = Extract<Action, 'status'>;
46
46
  export type RefundAction = Extract<Action, 'refund'>;
47
47
  export type VerificationAction = Extract<Action, 'confirm' | 'mpi' | 'cardverification'>;
@@ -10,6 +10,132 @@ export declare class PaymentsService {
10
10
  signature: string;
11
11
  url: string;
12
12
  };
13
+ getCheckoutUrlServer(payload: CheckoutInput): Promise<import("../..").Result<Partial<{
14
+ version: 7 | undefined;
15
+ acqId: string | undefined;
16
+ action: "pay" | "hold" | "subscribe" | "regular" | undefined;
17
+ completionDate: Date | undefined;
18
+ createDate: Date | undefined;
19
+ currency: "USD" | "EUR" | "UAH" | undefined;
20
+ currencyCredit: "USD" | "EUR" | "UAH" | undefined;
21
+ currencyDebit: "USD" | "EUR" | "UAH" | undefined;
22
+ endDate: Date | undefined;
23
+ 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;
24
+ is3ds: boolean | undefined;
25
+ liqpayOrderId: string | undefined;
26
+ mpiEci: "5" | "6" | "7" | undefined;
27
+ orderId: string | undefined;
28
+ paymentId: string | undefined;
29
+ paytype: "card" | "privat24" | "masterpass" | "moment_part" | "cash" | "invoice" | "qr" | undefined;
30
+ refundDateLast: Date | undefined;
31
+ 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;
32
+ waitReserveStatus: boolean | undefined;
33
+ publicKey?: string | undefined;
34
+ agentCommission?: number | undefined;
35
+ amount?: number | undefined;
36
+ amountBonus?: number | undefined;
37
+ amountCredit?: number | undefined;
38
+ amountDebit?: number | undefined;
39
+ authcodeCredit?: string | undefined;
40
+ authcodeDebit?: string | undefined;
41
+ cardToken?: string | undefined;
42
+ commissionCredit?: number | undefined;
43
+ commissionDebit?: number | undefined;
44
+ customer?: string | undefined;
45
+ description?: string | undefined;
46
+ errDescription?: string | undefined;
47
+ info?: string | undefined;
48
+ ip?: string | undefined;
49
+ receiverCommission?: number | undefined;
50
+ redirectTo?: string | undefined;
51
+ rrnCredit?: string | undefined;
52
+ rrnDebit?: string | undefined;
53
+ senderBonus?: number | undefined;
54
+ senderCardBank?: string | undefined;
55
+ senderCardCountry?: string | number | undefined;
56
+ senderCardMask2?: string | undefined;
57
+ senderIban?: string | undefined;
58
+ senderCardType?: string | undefined;
59
+ senderCommission?: number | undefined;
60
+ senderFirstName?: string | undefined;
61
+ senderLastName?: string | undefined;
62
+ senderPhone?: string | undefined;
63
+ token?: string | undefined;
64
+ type?: string | undefined;
65
+ errErc?: string | undefined;
66
+ productCategory?: string | undefined;
67
+ productDescription?: string | undefined;
68
+ productName?: string | undefined;
69
+ productUrl?: string | undefined;
70
+ refundAmount?: number | undefined;
71
+ verifycode?: string | undefined;
72
+ }>>>;
73
+ getAuthUrl(payload: CheckoutInput): {
74
+ request: import("../../core/types/checkout").CheckoutRequest;
75
+ data: string;
76
+ signature: string;
77
+ url: string;
78
+ };
79
+ getAuthUrlServer(payload: CheckoutInput): Promise<import("../..").Result<Partial<{
80
+ version: 7 | undefined;
81
+ acqId: string | undefined;
82
+ action: "pay" | "hold" | "subscribe" | "regular" | undefined;
83
+ completionDate: Date | undefined;
84
+ createDate: Date | undefined;
85
+ currency: "USD" | "EUR" | "UAH" | undefined;
86
+ currencyCredit: "USD" | "EUR" | "UAH" | undefined;
87
+ currencyDebit: "USD" | "EUR" | "UAH" | undefined;
88
+ endDate: Date | undefined;
89
+ 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;
90
+ is3ds: boolean | undefined;
91
+ liqpayOrderId: string | undefined;
92
+ mpiEci: "5" | "6" | "7" | undefined;
93
+ orderId: string | undefined;
94
+ paymentId: string | undefined;
95
+ paytype: "card" | "privat24" | "masterpass" | "moment_part" | "cash" | "invoice" | "qr" | undefined;
96
+ refundDateLast: Date | undefined;
97
+ 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;
98
+ waitReserveStatus: boolean | undefined;
99
+ publicKey?: string | undefined;
100
+ agentCommission?: number | undefined;
101
+ amount?: number | undefined;
102
+ amountBonus?: number | undefined;
103
+ amountCredit?: number | undefined;
104
+ amountDebit?: number | undefined;
105
+ authcodeCredit?: string | undefined;
106
+ authcodeDebit?: string | undefined;
107
+ cardToken?: string | undefined;
108
+ commissionCredit?: number | undefined;
109
+ commissionDebit?: number | undefined;
110
+ customer?: string | undefined;
111
+ description?: string | undefined;
112
+ errDescription?: string | undefined;
113
+ info?: string | undefined;
114
+ ip?: string | undefined;
115
+ receiverCommission?: number | undefined;
116
+ redirectTo?: string | undefined;
117
+ rrnCredit?: string | undefined;
118
+ rrnDebit?: string | undefined;
119
+ senderBonus?: number | undefined;
120
+ senderCardBank?: string | undefined;
121
+ senderCardCountry?: string | number | undefined;
122
+ senderCardMask2?: string | undefined;
123
+ senderIban?: string | undefined;
124
+ senderCardType?: string | undefined;
125
+ senderCommission?: number | undefined;
126
+ senderFirstName?: string | undefined;
127
+ senderLastName?: string | undefined;
128
+ senderPhone?: string | undefined;
129
+ token?: string | undefined;
130
+ type?: string | undefined;
131
+ errErc?: string | undefined;
132
+ productCategory?: string | undefined;
133
+ productDescription?: string | undefined;
134
+ productName?: string | undefined;
135
+ productUrl?: string | undefined;
136
+ refundAmount?: number | undefined;
137
+ verifycode?: string | undefined;
138
+ }>>>;
13
139
  hold(payload: CheckoutInput): {
14
140
  request: import("../../core/types/checkout").CheckoutRequest;
15
141
  data: string;
@@ -9,6 +9,15 @@ class PaymentsService {
9
9
  getCheckoutUrl(payload) {
10
10
  return this.client.payments.getCheckoutUrl(payload);
11
11
  }
12
+ getCheckoutUrlServer(payload) {
13
+ return this.client.payments.getCheckoutUrlServer(payload);
14
+ }
15
+ getAuthUrl(payload) {
16
+ return this.client.payments.getAuthUrl(payload);
17
+ }
18
+ getAuthUrlServer(payload) {
19
+ return this.client.payments.getAuthUrlServer(payload);
20
+ }
12
21
  hold(payload) {
13
22
  return this.client.payments.hold(payload);
14
23
  }
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.13",
4
+ "version": "0.3.15",
5
5
  "type": "commonjs",
6
6
  "module": "dist/index.js",
7
7
  "main": "dist/index.js",