liqpay-nestjs 0.3.2 → 0.3.3

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.
@@ -8,7 +8,8 @@ export declare class PaymentsClient {
8
8
  constructor(utils: UtilsClient);
9
9
  private prepare;
10
10
  private buildUrl;
11
- pay(payload: CheckoutInput): {
11
+ private checkout;
12
+ getCheckoutUrl(payload: CheckoutInput): {
12
13
  url: string;
13
14
  data: string;
14
15
  signature: string;
@@ -25,7 +25,16 @@ class PaymentsClient {
25
25
  buildUrl(data, signature) {
26
26
  return `${url_type_1.CHECKOUT_URL}?data=${data}&signature=${signature}`;
27
27
  }
28
- pay(payload) {
28
+ checkout(payload, action) {
29
+ const { fullfilled, data, signature } = this.prepare(payload, action);
30
+ return {
31
+ ...fullfilled,
32
+ url: this.buildUrl(data, signature),
33
+ data,
34
+ signature,
35
+ };
36
+ }
37
+ getCheckoutUrl(payload) {
29
38
  const { fullfilled, data, signature } = this.prepare(payload, 'pay');
30
39
  return {
31
40
  ...fullfilled,
@@ -122,7 +122,7 @@ export declare const CheckoutCallbackSchema: z.ZodPipe<z.ZodObject<{
122
122
  }, z.core.$strip>, z.ZodTransform<Partial<{
123
123
  version: 7 | undefined;
124
124
  acqId: string | undefined;
125
- action: "pay" | "paytoken" | "hold" | "paysplit" | "subscribe" | "paydonate" | "auth" | "regular" | "status" | undefined;
125
+ action: "data" | "pay" | "hold" | "subscribe" | "paydonate" | "auth" | "refund" | "payment_prepare" | "unsubscribe" | "subscribe_update" | "payqr" | "staticQrCreate" | "paytoken" | "paycash" | "hold_completion" | "paysplit" | "invoice_send" | "invoice_cancel" | "p2pcredit" | "p2pdebit" | "token_create" | "token_create_unique" | "token_update" | "confirm" | "mpi" | "cardverification" | "reports" | "reports_compensation" | "register" | "reports_compensation_file" | "reports_compensation_file_status" | "ticket" | "status" | "agent_shop_create" | "agent_shop_register" | "agent_shop_edit" | "agent_info_merchant" | "agent_info_user" | "regular" | undefined;
126
126
  completionDate: Date | undefined;
127
127
  createDate: Date | undefined;
128
128
  currency: "USD" | "EUR" | "UAH" | undefined;
@@ -1,13 +1,43 @@
1
1
  import z from 'zod';
2
2
  export declare const ActionSchema: z.ZodEnum<{
3
+ data: "data";
3
4
  pay: "pay";
4
- paytoken: "paytoken";
5
5
  hold: "hold";
6
- paysplit: "paysplit";
7
6
  subscribe: "subscribe";
8
7
  paydonate: "paydonate";
9
8
  auth: "auth";
10
- regular: "regular";
9
+ refund: "refund";
10
+ payment_prepare: "payment_prepare";
11
+ unsubscribe: "unsubscribe";
12
+ subscribe_update: "subscribe_update";
13
+ payqr: "payqr";
14
+ staticQrCreate: "staticQrCreate";
15
+ paytoken: "paytoken";
16
+ paycash: "paycash";
17
+ hold_completion: "hold_completion";
18
+ paysplit: "paysplit";
19
+ invoice_send: "invoice_send";
20
+ invoice_cancel: "invoice_cancel";
21
+ p2pcredit: "p2pcredit";
22
+ p2pdebit: "p2pdebit";
23
+ token_create: "token_create";
24
+ token_create_unique: "token_create_unique";
25
+ token_update: "token_update";
26
+ confirm: "confirm";
27
+ mpi: "mpi";
28
+ cardverification: "cardverification";
29
+ reports: "reports";
30
+ reports_compensation: "reports_compensation";
31
+ register: "register";
32
+ reports_compensation_file: "reports_compensation_file";
33
+ reports_compensation_file_status: "reports_compensation_file_status";
34
+ ticket: "ticket";
11
35
  status: "status";
36
+ agent_shop_create: "agent_shop_create";
37
+ agent_shop_register: "agent_shop_register";
38
+ agent_shop_edit: "agent_shop_edit";
39
+ agent_info_merchant: "agent_info_merchant";
40
+ agent_info_user: "agent_info_user";
41
+ regular: "regular";
12
42
  }>;
13
43
  export type Action = z.infer<typeof ActionSchema>;
@@ -6,13 +6,124 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ActionSchema = void 0;
7
7
  const zod_1 = __importDefault(require("zod"));
8
8
  exports.ActionSchema = zod_1.default.enum([
9
+ // checkout
10
+ // payments.pay()
9
11
  'pay',
12
+ // payments.hold()
13
+ 'hold',
14
+ // payments.subscribe()
15
+ 'subscribe',
16
+ // payments.donate()
17
+ 'paydonate',
18
+ // for creating dynamic verification code - did not found where it used
19
+ // payments.auth()
20
+ 'auth',
21
+ // refunds.refund()
22
+ 'refund',
23
+ // payments.payBycard()
24
+ 'pay',
25
+ // payments.payByPrivatPay()
26
+ 'payment_prepare',
27
+ // payments.payByApplePay()
28
+ 'pay',
29
+ // payments.holdByApplePay()
30
+ 'hold',
31
+ // payments.payByGooglePay()
32
+ 'pay',
33
+ // payments.holdByGooglePay()
34
+ 'hold',
35
+ // subscription
36
+ // subscriptions.subscribe()
37
+ 'subscribe',
38
+ // subscriptions.unsubscribe()
39
+ 'unsubscribe',
40
+ // subscriptions.update()
41
+ 'subscribe_update',
42
+ // payments.payByQr()
43
+ 'payqr',
44
+ // payments.createStaticQr()
45
+ 'staticQrCreate',
46
+ // payments.payByToken()
10
47
  'paytoken',
48
+ // payments.payByCash()
49
+ 'paycash',
50
+ // payments.invoke2Factor()
51
+ 'hold',
52
+ // payments.complete2Factor()
53
+ 'hold_completion',
54
+ // available in checkout, payment widget, pay2Factor, payByCard, payByQr, payByToken
55
+ 'paysplit',
56
+ // invoices.send()
57
+ 'invoice_send',
58
+ // invoices.cancel()
59
+ 'invoice_cancel',
60
+ // DCC - payments.payWithCardCurrency()
61
+ 'pay',
62
+ // transferring funds from account to card - transfers.toCard()
63
+ 'p2pcredit',
64
+ // transferring funds from card to account - transfers.toAccount()
65
+ 'p2pdebit',
66
+ // token (without payment)
67
+ // tokens.create()
68
+ 'token_create',
69
+ // tokens.createUnique()
70
+ 'token_create_unique',
71
+ // tokens.update()
72
+ 'token_update',
73
+ // 3D Secure verification
74
+ // verifications.3DSecure()
75
+ 'confirm',
76
+ // OTP verification
77
+ // verifications.OTP()
78
+ 'confirm',
79
+ // check sender card for 3D Secure
80
+ // verifications.checkFor3DSecure()
81
+ 'mpi',
82
+ // CVV verification
83
+ // verifications.CVV()
84
+ 'confirm',
85
+ // card verification (is card valid)
86
+ // verifications.isCardValid()
87
+ 'cardverification',
88
+ // get archive of all accepted payments
89
+ // information.getPaymentsReport()
90
+ 'reports',
91
+ // get register of accepted payments for enterprises (check more)
92
+ // information.getCompensationsReportByDay()
93
+ 'reports_compensation',
94
+ // information.getCompensationsReportByDate()
95
+ 'register',
96
+ // information.getFullCompensationsReport() and information.getCompensationsReportByP2POperation()
97
+ 'reports_compensation_file',
98
+ // information.getFullCompensationsReportStatus() and information.getCompensationsReportByP2POperationStatus()
99
+ 'reports_compensation_file_status',
100
+ // payments.addData()
101
+ 'data',
102
+ // payments.sendTicket()
103
+ 'ticket',
104
+ // payments.getStatus()
105
+ 'status',
106
+ // company creation (check more)
107
+ // companies.create()
108
+ 'agent_shop_create',
109
+ // companies.register()
110
+ 'agent_shop_register',
111
+ // company edit
112
+ // companies.update()
113
+ 'agent_shop_edit',
114
+ // company info
115
+ // companies.getInfo()
116
+ 'agent_info_merchant',
117
+ // partner info
118
+ // companies.getUserInfo()
119
+ 'agent_info_user',
120
+ // + exchange rates and currency exchange rate archive (public API - don't need action)
121
+ // can be in responses/callback
122
+ 'pay',
11
123
  'hold',
12
124
  'paysplit',
13
125
  'subscribe',
14
126
  'paydonate',
15
127
  'auth',
16
128
  'regular',
17
- 'status',
18
129
  ]);
@@ -0,0 +1,7 @@
1
+ import z from 'zod';
2
+ export declare const CardTokenActionSchema: z.ZodEnum<{
3
+ SUSPEND: "SUSPEND";
4
+ UNSUSPEND: "UNSUSPEND";
5
+ DELETE: "DELETE";
6
+ }>;
7
+ export type CardTokenAction = z.infer<typeof CardTokenActionSchema>;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CardTokenActionSchema = void 0;
7
+ const zod_1 = __importDefault(require("zod"));
8
+ exports.CardTokenActionSchema = zod_1.default.enum(['SUSPEND', 'UNSUSPEND', 'DELETE']);
@@ -0,0 +1,6 @@
1
+ import z from 'zod';
2
+ export declare const InvoiceUnitsActionSchema: z.ZodEnum<{
3
+ invoice_units_get_list: "invoice_units_get_list";
4
+ invoice_units_get_list_by_lang: "invoice_units_get_list_by_lang";
5
+ }>;
6
+ export type InvoiceUnitsAction = z.infer<typeof InvoiceUnitsActionSchema>;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.InvoiceUnitsActionSchema = void 0;
7
+ const zod_1 = __importDefault(require("zod"));
8
+ exports.InvoiceUnitsActionSchema = zod_1.default.enum([
9
+ 'invoice_units_get_list',
10
+ 'invoice_units_get_list_by_lang',
11
+ ]);
@@ -3,15 +3,45 @@ export declare const PaymentStatusRequestSchema: z.ZodObject<{
3
3
  version: z.ZodOptional<z.ZodLiteral<7>>;
4
4
  publicKey: z.ZodOptional<z.ZodString>;
5
5
  action: z.ZodEnum<{
6
+ data: "data";
6
7
  pay: "pay";
7
- paytoken: "paytoken";
8
8
  hold: "hold";
9
- paysplit: "paysplit";
10
9
  subscribe: "subscribe";
11
10
  paydonate: "paydonate";
12
11
  auth: "auth";
13
- regular: "regular";
12
+ refund: "refund";
13
+ payment_prepare: "payment_prepare";
14
+ unsubscribe: "unsubscribe";
15
+ subscribe_update: "subscribe_update";
16
+ payqr: "payqr";
17
+ staticQrCreate: "staticQrCreate";
18
+ paytoken: "paytoken";
19
+ paycash: "paycash";
20
+ hold_completion: "hold_completion";
21
+ paysplit: "paysplit";
22
+ invoice_send: "invoice_send";
23
+ invoice_cancel: "invoice_cancel";
24
+ p2pcredit: "p2pcredit";
25
+ p2pdebit: "p2pdebit";
26
+ token_create: "token_create";
27
+ token_create_unique: "token_create_unique";
28
+ token_update: "token_update";
29
+ confirm: "confirm";
30
+ mpi: "mpi";
31
+ cardverification: "cardverification";
32
+ reports: "reports";
33
+ reports_compensation: "reports_compensation";
34
+ register: "register";
35
+ reports_compensation_file: "reports_compensation_file";
36
+ reports_compensation_file_status: "reports_compensation_file_status";
37
+ ticket: "ticket";
14
38
  status: "status";
39
+ agent_shop_create: "agent_shop_create";
40
+ agent_shop_register: "agent_shop_register";
41
+ agent_shop_edit: "agent_shop_edit";
42
+ agent_info_merchant: "agent_info_merchant";
43
+ agent_info_user: "agent_info_user";
44
+ regular: "regular";
15
45
  }>;
16
46
  orderId: z.ZodString;
17
47
  }, z.core.$strip>;
@@ -20,24 +50,54 @@ export declare const RawPaymentStatusRequestSchema: z.ZodPipe<z.ZodObject<{
20
50
  version: z.ZodOptional<z.ZodLiteral<7>>;
21
51
  publicKey: z.ZodOptional<z.ZodString>;
22
52
  action: z.ZodEnum<{
53
+ data: "data";
23
54
  pay: "pay";
24
- paytoken: "paytoken";
25
55
  hold: "hold";
26
- paysplit: "paysplit";
27
56
  subscribe: "subscribe";
28
57
  paydonate: "paydonate";
29
58
  auth: "auth";
30
- regular: "regular";
59
+ refund: "refund";
60
+ payment_prepare: "payment_prepare";
61
+ unsubscribe: "unsubscribe";
62
+ subscribe_update: "subscribe_update";
63
+ payqr: "payqr";
64
+ staticQrCreate: "staticQrCreate";
65
+ paytoken: "paytoken";
66
+ paycash: "paycash";
67
+ hold_completion: "hold_completion";
68
+ paysplit: "paysplit";
69
+ invoice_send: "invoice_send";
70
+ invoice_cancel: "invoice_cancel";
71
+ p2pcredit: "p2pcredit";
72
+ p2pdebit: "p2pdebit";
73
+ token_create: "token_create";
74
+ token_create_unique: "token_create_unique";
75
+ token_update: "token_update";
76
+ confirm: "confirm";
77
+ mpi: "mpi";
78
+ cardverification: "cardverification";
79
+ reports: "reports";
80
+ reports_compensation: "reports_compensation";
81
+ register: "register";
82
+ reports_compensation_file: "reports_compensation_file";
83
+ reports_compensation_file_status: "reports_compensation_file_status";
84
+ ticket: "ticket";
31
85
  status: "status";
86
+ agent_shop_create: "agent_shop_create";
87
+ agent_shop_register: "agent_shop_register";
88
+ agent_shop_edit: "agent_shop_edit";
89
+ agent_info_merchant: "agent_info_merchant";
90
+ agent_info_user: "agent_info_user";
91
+ regular: "regular";
32
92
  }>;
33
93
  orderId: z.ZodString;
34
94
  }, z.core.$strip>, z.ZodTransform<{
35
- action: "pay" | "paytoken" | "hold" | "paysplit" | "subscribe" | "paydonate" | "auth" | "regular" | "status";
95
+ action: "data" | "pay" | "hold" | "subscribe" | "paydonate" | "auth" | "refund" | "payment_prepare" | "unsubscribe" | "subscribe_update" | "payqr" | "staticQrCreate" | "paytoken" | "paycash" | "hold_completion" | "paysplit" | "invoice_send" | "invoice_cancel" | "p2pcredit" | "p2pdebit" | "token_create" | "token_create_unique" | "token_update" | "confirm" | "mpi" | "cardverification" | "reports" | "reports_compensation" | "register" | "reports_compensation_file" | "reports_compensation_file_status" | "ticket" | "status" | "agent_shop_create" | "agent_shop_register" | "agent_shop_edit" | "agent_info_merchant" | "agent_info_user" | "regular";
36
96
  order_id: string;
37
97
  version?: 7 | undefined;
38
98
  public_key?: string | undefined;
39
99
  }, {
40
- action: "pay" | "paytoken" | "hold" | "paysplit" | "subscribe" | "paydonate" | "auth" | "regular" | "status";
100
+ action: "data" | "pay" | "hold" | "subscribe" | "paydonate" | "auth" | "refund" | "payment_prepare" | "unsubscribe" | "subscribe_update" | "payqr" | "staticQrCreate" | "paytoken" | "paycash" | "hold_completion" | "paysplit" | "invoice_send" | "invoice_cancel" | "p2pcredit" | "p2pdebit" | "token_create" | "token_create_unique" | "token_update" | "confirm" | "mpi" | "cardverification" | "reports" | "reports_compensation" | "register" | "reports_compensation_file" | "reports_compensation_file_status" | "ticket" | "status" | "agent_shop_create" | "agent_shop_register" | "agent_shop_edit" | "agent_info_merchant" | "agent_info_user" | "regular";
41
101
  orderId: string;
42
102
  version?: 7 | undefined;
43
103
  publicKey?: string | undefined;
@@ -107,7 +107,7 @@ export declare const PaymentStatusResponseSchema: z.ZodPipe<z.ZodObject<{
107
107
  version: z.ZodOptional<z.ZodNumber>;
108
108
  }, z.core.$strip>, z.ZodTransform<Partial<{
109
109
  acqId: string | undefined;
110
- action: "pay" | "paytoken" | "hold" | "paysplit" | "subscribe" | "paydonate" | "auth" | "regular" | "status" | undefined;
110
+ action: "data" | "pay" | "hold" | "subscribe" | "paydonate" | "auth" | "refund" | "payment_prepare" | "unsubscribe" | "subscribe_update" | "payqr" | "staticQrCreate" | "paytoken" | "paycash" | "hold_completion" | "paysplit" | "invoice_send" | "invoice_cancel" | "p2pcredit" | "p2pdebit" | "token_create" | "token_create_unique" | "token_update" | "confirm" | "mpi" | "cardverification" | "reports" | "reports_compensation" | "register" | "reports_compensation_file" | "reports_compensation_file_status" | "ticket" | "status" | "agent_shop_create" | "agent_shop_register" | "agent_shop_edit" | "agent_info_merchant" | "agent_info_user" | "regular" | undefined;
111
111
  bonusType: "bonusplus" | "discount_club" | "personal" | "promo" | undefined;
112
112
  createDate: Date | undefined;
113
113
  currency: "USD" | "EUR" | "UAH" | undefined;
@@ -310,9 +310,9 @@ export declare class PaymentsService {
310
310
  action: import("../..").Action;
311
311
  };
312
312
  getPayButton(payload: CheckoutInput, buttonText?: string, buttonColor?: string): string;
313
- getPaymentStatus(orderId: string): Promise<import("../..").Result<Partial<{
313
+ getStatus(orderId: string): Promise<import("../..").Result<Partial<{
314
314
  acqId: string | undefined;
315
- action: "pay" | "paytoken" | "hold" | "paysplit" | "subscribe" | "paydonate" | "auth" | "regular" | "status" | undefined;
315
+ action: "data" | "pay" | "hold" | "subscribe" | "paydonate" | "auth" | "refund" | "payment_prepare" | "unsubscribe" | "subscribe_update" | "payqr" | "staticQrCreate" | "paytoken" | "paycash" | "hold_completion" | "paysplit" | "invoice_send" | "invoice_cancel" | "p2pcredit" | "p2pdebit" | "token_create" | "token_create_unique" | "token_update" | "confirm" | "mpi" | "cardverification" | "reports" | "reports_compensation" | "register" | "reports_compensation_file" | "reports_compensation_file_status" | "ticket" | "status" | "agent_shop_create" | "agent_shop_register" | "agent_shop_edit" | "agent_info_merchant" | "agent_info_user" | "regular" | undefined;
316
316
  bonusType: "bonusplus" | "discount_club" | "personal" | "promo" | undefined;
317
317
  createDate: Date | undefined;
318
318
  currency: "USD" | "EUR" | "UAH" | undefined;
@@ -7,7 +7,7 @@ class PaymentsService {
7
7
  this.client = client;
8
8
  }
9
9
  pay(payload) {
10
- return this.client.payments.pay(payload);
10
+ return this.client.payments.getCheckoutUrl(payload);
11
11
  }
12
12
  hold(payload) {
13
13
  return this.client.payments.hold(payload);
@@ -18,7 +18,7 @@ class PaymentsService {
18
18
  getPayButton(payload, buttonText, buttonColor) {
19
19
  return this.client.payments.getPayButton(payload, buttonText, buttonColor);
20
20
  }
21
- async getPaymentStatus(orderId) {
21
+ async getStatus(orderId) {
22
22
  return this.client.payments.getStatus(orderId);
23
23
  }
24
24
  }
@@ -6,7 +6,7 @@ export declare class WebhooksService {
6
6
  parseCheckoutCallback(envelope: LiqPayEnvelope): Promise<import("../../core/types/base").Result<Partial<{
7
7
  version: 7 | undefined;
8
8
  acqId: string | undefined;
9
- action: "pay" | "paytoken" | "hold" | "paysplit" | "subscribe" | "paydonate" | "auth" | "regular" | "status" | undefined;
9
+ action: "data" | "pay" | "hold" | "subscribe" | "paydonate" | "auth" | "refund" | "payment_prepare" | "unsubscribe" | "subscribe_update" | "payqr" | "staticQrCreate" | "paytoken" | "paycash" | "hold_completion" | "paysplit" | "invoice_send" | "invoice_cancel" | "p2pcredit" | "p2pdebit" | "token_create" | "token_create_unique" | "token_update" | "confirm" | "mpi" | "cardverification" | "reports" | "reports_compensation" | "register" | "reports_compensation_file" | "reports_compensation_file_status" | "ticket" | "status" | "agent_shop_create" | "agent_shop_register" | "agent_shop_edit" | "agent_info_merchant" | "agent_info_user" | "regular" | undefined;
10
10
  completionDate: Date | undefined;
11
11
  createDate: Date | undefined;
12
12
  currency: "USD" | "EUR" | "UAH" | undefined;
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.2",
4
+ "version": "0.3.3",
5
5
  "type": "commonjs",
6
6
  "module": "dist/index.js",
7
7
  "main": "dist/index.js",