liqpay-nestjs 0.2.1

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.
Files changed (136) hide show
  1. package/README.md +15 -0
  2. package/dist/core/constants.d.ts +3 -0
  3. package/dist/core/constants.js +7 -0
  4. package/dist/core/index.d.ts +1 -0
  5. package/dist/core/index.js +17 -0
  6. package/dist/core/liqpay.client.d.ts +65 -0
  7. package/dist/core/liqpay.client.js +156 -0
  8. package/dist/core/schemas/base/envelope.schema.d.ts +6 -0
  9. package/dist/core/schemas/base/envelope.schema.js +11 -0
  10. package/dist/core/schemas/base/index.d.ts +3 -0
  11. package/dist/core/schemas/base/index.js +19 -0
  12. package/dist/core/schemas/base/request.type.d.ts +4 -0
  13. package/dist/core/schemas/base/request.type.js +2 -0
  14. package/dist/core/schemas/base/response.type.d.ts +15 -0
  15. package/dist/core/schemas/base/response.type.js +2 -0
  16. package/dist/core/schemas/checkout/checkout-callback.schema.d.ts +241 -0
  17. package/dist/core/schemas/checkout/checkout-callback.schema.js +91 -0
  18. package/dist/core/schemas/checkout/checkout-request.schema.d.ts +421 -0
  19. package/dist/core/schemas/checkout/checkout-request.schema.js +70 -0
  20. package/dist/core/schemas/checkout/index.d.ts +2 -0
  21. package/dist/core/schemas/checkout/index.js +18 -0
  22. package/dist/core/schemas/common/detail-addenda.schema.d.ts +11 -0
  23. package/dist/core/schemas/common/detail-addenda.schema.js +13 -0
  24. package/dist/core/schemas/common/enums/action.schema.d.ts +12 -0
  25. package/dist/core/schemas/common/enums/action.schema.js +17 -0
  26. package/dist/core/schemas/common/enums/bonus-type.schema.d.ts +8 -0
  27. package/dist/core/schemas/common/enums/bonus-type.schema.js +10 -0
  28. package/dist/core/schemas/common/enums/commission-payer.schema.d.ts +6 -0
  29. package/dist/core/schemas/common/enums/commission-payer.schema.js +5 -0
  30. package/dist/core/schemas/common/enums/currency.schema.d.ts +7 -0
  31. package/dist/core/schemas/common/enums/currency.schema.js +8 -0
  32. package/dist/core/schemas/common/enums/error-code.schema.d.ts +117 -0
  33. package/dist/core/schemas/common/enums/error-code.schema.js +122 -0
  34. package/dist/core/schemas/common/enums/index.d.ts +13 -0
  35. package/dist/core/schemas/common/enums/index.js +29 -0
  36. package/dist/core/schemas/common/enums/language.schema.d.ts +6 -0
  37. package/dist/core/schemas/common/enums/language.schema.js +5 -0
  38. package/dist/core/schemas/common/enums/mpi-eci.schema.d.ts +3 -0
  39. package/dist/core/schemas/common/enums/mpi-eci.schema.js +9 -0
  40. package/dist/core/schemas/common/enums/payment-status.schema.d.ts +81 -0
  41. package/dist/core/schemas/common/enums/payment-status.schema.js +48 -0
  42. package/dist/core/schemas/common/enums/paytype.schema.d.ts +14 -0
  43. package/dist/core/schemas/common/enums/paytype.schema.js +16 -0
  44. package/dist/core/schemas/common/enums/request-result.schema.d.ts +6 -0
  45. package/dist/core/schemas/common/enums/request-result.schema.js +5 -0
  46. package/dist/core/schemas/common/enums/subscribe-period.schema.d.ts +8 -0
  47. package/dist/core/schemas/common/enums/subscribe-period.schema.js +10 -0
  48. package/dist/core/schemas/common/enums/unit.schema.d.ts +55 -0
  49. package/dist/core/schemas/common/enums/unit.schema.js +58 -0
  50. package/dist/core/schemas/common/enums/version.schema.d.ts +2 -0
  51. package/dist/core/schemas/common/enums/version.schema.js +8 -0
  52. package/dist/core/schemas/common/fiscal-data.schema.d.ts +86 -0
  53. package/dist/core/schemas/common/fiscal-data.schema.js +41 -0
  54. package/dist/core/schemas/common/index.d.ts +3 -0
  55. package/dist/core/schemas/common/index.js +19 -0
  56. package/dist/core/schemas/common/split-rule.schema.d.ts +36 -0
  57. package/dist/core/schemas/common/split-rule.schema.js +13 -0
  58. package/dist/core/schemas/error/error-response.schema.d.ts +121 -0
  59. package/dist/core/schemas/error/error-response.schema.js +10 -0
  60. package/dist/core/schemas/error/error.type.d.ts +6 -0
  61. package/dist/core/schemas/error/error.type.js +2 -0
  62. package/dist/core/schemas/error/index.d.ts +3 -0
  63. package/dist/core/schemas/error/index.js +19 -0
  64. package/dist/core/schemas/payment-status/index.d.ts +2 -0
  65. package/dist/core/schemas/payment-status/index.js +18 -0
  66. package/dist/core/schemas/payment-status/payment-status-request.schema.d.ts +43 -0
  67. package/dist/core/schemas/payment-status/payment-status-request.schema.js +23 -0
  68. package/dist/core/schemas/payment-status/payment-status-response.schema.d.ts +213 -0
  69. package/dist/core/schemas/payment-status/payment-status-response.schema.js +85 -0
  70. package/dist/core/types/documented/checkout.callback.d.ts +250 -0
  71. package/dist/core/types/documented/checkout.callback.js +2 -0
  72. package/dist/core/types/documented/checkout.request.d.ts +236 -0
  73. package/dist/core/types/documented/checkout.request.js +2 -0
  74. package/dist/core/types/documented/detail-addenda.d.ts +33 -0
  75. package/dist/core/types/documented/detail-addenda.js +2 -0
  76. package/dist/core/types/documented/envelope.d.ts +15 -0
  77. package/dist/core/types/documented/envelope.js +2 -0
  78. package/dist/core/types/documented/fiscal-data.d.ts +80 -0
  79. package/dist/core/types/documented/fiscal-data.js +2 -0
  80. package/dist/core/types/documented/payment-status.request.d.ts +23 -0
  81. package/dist/core/types/documented/payment-status.request.js +2 -0
  82. package/dist/core/types/documented/payment-status.response.d.ts +225 -0
  83. package/dist/core/types/documented/payment-status.response.js +2 -0
  84. package/dist/core/types/documented/split-rule.d.ts +29 -0
  85. package/dist/core/types/documented/split-rule.js +2 -0
  86. package/dist/core/types/documented/types.d.ts +287 -0
  87. package/dist/core/types/documented/types.js +199 -0
  88. package/dist/core/types/payloads.d.ts +158 -0
  89. package/dist/core/types/payloads.js +2 -0
  90. package/dist/core/types/undocumented/checkout.callback.d.ts +61 -0
  91. package/dist/core/types/undocumented/checkout.callback.js +2 -0
  92. package/dist/core/types/undocumented/checkout.request.d.ts +39 -0
  93. package/dist/core/types/undocumented/checkout.request.js +2 -0
  94. package/dist/core/types/undocumented/detail-addenda.d.ts +9 -0
  95. package/dist/core/types/undocumented/detail-addenda.js +2 -0
  96. package/dist/core/types/undocumented/envelope.d.ts +4 -0
  97. package/dist/core/types/undocumented/envelope.js +2 -0
  98. package/dist/core/types/undocumented/fiscal-data.d.ts +23 -0
  99. package/dist/core/types/undocumented/fiscal-data.js +2 -0
  100. package/dist/core/types/undocumented/payment-status.request.d.ts +6 -0
  101. package/dist/core/types/undocumented/payment-status.request.js +2 -0
  102. package/dist/core/types/undocumented/payment-status.response.d.ts +54 -0
  103. package/dist/core/types/undocumented/payment-status.response.js +2 -0
  104. package/dist/core/types/undocumented/split-rule.d.ts +9 -0
  105. package/dist/core/types/undocumented/split-rule.js +2 -0
  106. package/dist/core/types/undocumented/types.d.ts +181 -0
  107. package/dist/core/types/undocumented/types.js +160 -0
  108. package/dist/core/utils/index.d.ts +2 -0
  109. package/dist/core/utils/index.js +18 -0
  110. package/dist/core/utils/is-success.util.d.ts +5 -0
  111. package/dist/core/utils/is-success.util.js +6 -0
  112. package/dist/core/utils/parse-boolean.d.ts +2 -0
  113. package/dist/core/utils/parse-boolean.js +7 -0
  114. package/dist/core/utils/parse-date.d.ts +1 -0
  115. package/dist/core/utils/parse-date.js +10 -0
  116. package/dist/index.d.ts +5 -0
  117. package/dist/index.js +21 -0
  118. package/dist/nest/constants/index.d.ts +1 -0
  119. package/dist/nest/constants/index.js +17 -0
  120. package/dist/nest/constants/liqpay.constants.d.ts +1 -0
  121. package/dist/nest/constants/liqpay.constants.js +4 -0
  122. package/dist/nest/index.d.ts +3 -0
  123. package/dist/nest/index.js +19 -0
  124. package/dist/nest/interfaces/index.d.ts +2 -0
  125. package/dist/nest/interfaces/index.js +18 -0
  126. package/dist/nest/interfaces/liqpay-async-options.interface.d.ts +7 -0
  127. package/dist/nest/interfaces/liqpay-async-options.interface.js +2 -0
  128. package/dist/nest/interfaces/liqpay-options.interface.d.ts +25 -0
  129. package/dist/nest/interfaces/liqpay-options.interface.js +2 -0
  130. package/dist/nest/liqpay.module.d.ts +6 -0
  131. package/dist/nest/liqpay.module.js +37 -0
  132. package/dist/nest/liqpay.providers.d.ts +4 -0
  133. package/dist/nest/liqpay.providers.js +32 -0
  134. package/dist/nest/liqpay.service.d.ts +66 -0
  135. package/dist/nest/liqpay.service.js +57 -0
  136. package/package.json +57 -0
@@ -0,0 +1,213 @@
1
+ import { z } from 'zod';
2
+ export declare const LiqPayRawPaymentStatusResponseSchema: z.ZodObject<{
3
+ acq_id: z.ZodOptional<z.ZodNumber>;
4
+ action: z.ZodOptional<z.ZodString>;
5
+ agent_commission: z.ZodOptional<z.ZodNumber>;
6
+ amount: z.ZodOptional<z.ZodNumber>;
7
+ amount_bonus: z.ZodOptional<z.ZodNumber>;
8
+ amount_credit: z.ZodOptional<z.ZodNumber>;
9
+ amount_debit: z.ZodOptional<z.ZodNumber>;
10
+ authcode_credit: z.ZodOptional<z.ZodString>;
11
+ authcode_debit: z.ZodOptional<z.ZodString>;
12
+ bonus_procent: z.ZodOptional<z.ZodNumber>;
13
+ bonus_type: z.ZodOptional<z.ZodString>;
14
+ card_token: z.ZodOptional<z.ZodString>;
15
+ commission_credit: z.ZodOptional<z.ZodNumber>;
16
+ commission_debit: z.ZodOptional<z.ZodNumber>;
17
+ confirm_phone: z.ZodOptional<z.ZodString>;
18
+ create_date: z.ZodOptional<z.ZodString>;
19
+ currency: z.ZodOptional<z.ZodString>;
20
+ currency_credit: z.ZodOptional<z.ZodString>;
21
+ currency_debit: z.ZodOptional<z.ZodString>;
22
+ description: z.ZodOptional<z.ZodString>;
23
+ end_date: z.ZodOptional<z.ZodString>;
24
+ info: z.ZodOptional<z.ZodString>;
25
+ ip: z.ZodOptional<z.ZodString>;
26
+ is_3ds: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>;
27
+ language: z.ZodOptional<z.ZodString>;
28
+ liqpay_order_id: z.ZodOptional<z.ZodString>;
29
+ moment_part: z.ZodOptional<z.ZodString>;
30
+ mpi_eci: z.ZodOptional<z.ZodNumber>;
31
+ order_id: z.ZodOptional<z.ZodString>;
32
+ payment_id: z.ZodOptional<z.ZodNumber>;
33
+ paytype: z.ZodOptional<z.ZodString>;
34
+ public_key: z.ZodOptional<z.ZodString>;
35
+ receiver_commission: z.ZodOptional<z.ZodNumber>;
36
+ result: z.ZodOptional<z.ZodString>;
37
+ rrn_credit: z.ZodOptional<z.ZodString>;
38
+ rrn_debit: z.ZodOptional<z.ZodString>;
39
+ sender_bonus: z.ZodOptional<z.ZodNumber>;
40
+ sender_card_bank: z.ZodOptional<z.ZodString>;
41
+ sender_card_country: z.ZodOptional<z.ZodString>;
42
+ sender_card_mask2: z.ZodOptional<z.ZodString>;
43
+ sender_iban: z.ZodOptional<z.ZodString>;
44
+ sender_card_type: z.ZodOptional<z.ZodString>;
45
+ sender_commission: z.ZodOptional<z.ZodNumber>;
46
+ sender_first_name: z.ZodOptional<z.ZodString>;
47
+ sender_last_name: z.ZodOptional<z.ZodString>;
48
+ sender_phone: z.ZodOptional<z.ZodString>;
49
+ status: z.ZodOptional<z.ZodString>;
50
+ wait_reserve_status: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>;
51
+ transaction_id: z.ZodOptional<z.ZodNumber>;
52
+ type: z.ZodOptional<z.ZodString>;
53
+ version: z.ZodOptional<z.ZodNumber>;
54
+ }, z.core.$strip>;
55
+ export type LiqPayRawPaymentStatusResponse = z.infer<typeof LiqPayRawPaymentStatusResponseSchema>;
56
+ export declare const LiqPayPaymentStatusResponseSchema: z.ZodPipe<z.ZodObject<{
57
+ acq_id: z.ZodOptional<z.ZodNumber>;
58
+ action: z.ZodOptional<z.ZodString>;
59
+ agent_commission: z.ZodOptional<z.ZodNumber>;
60
+ amount: z.ZodOptional<z.ZodNumber>;
61
+ amount_bonus: z.ZodOptional<z.ZodNumber>;
62
+ amount_credit: z.ZodOptional<z.ZodNumber>;
63
+ amount_debit: z.ZodOptional<z.ZodNumber>;
64
+ authcode_credit: z.ZodOptional<z.ZodString>;
65
+ authcode_debit: z.ZodOptional<z.ZodString>;
66
+ bonus_procent: z.ZodOptional<z.ZodNumber>;
67
+ bonus_type: z.ZodOptional<z.ZodString>;
68
+ card_token: z.ZodOptional<z.ZodString>;
69
+ commission_credit: z.ZodOptional<z.ZodNumber>;
70
+ commission_debit: z.ZodOptional<z.ZodNumber>;
71
+ confirm_phone: z.ZodOptional<z.ZodString>;
72
+ create_date: z.ZodOptional<z.ZodString>;
73
+ currency: z.ZodOptional<z.ZodString>;
74
+ currency_credit: z.ZodOptional<z.ZodString>;
75
+ currency_debit: z.ZodOptional<z.ZodString>;
76
+ description: z.ZodOptional<z.ZodString>;
77
+ end_date: z.ZodOptional<z.ZodString>;
78
+ info: z.ZodOptional<z.ZodString>;
79
+ ip: z.ZodOptional<z.ZodString>;
80
+ is_3ds: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>;
81
+ language: z.ZodOptional<z.ZodString>;
82
+ liqpay_order_id: z.ZodOptional<z.ZodString>;
83
+ moment_part: z.ZodOptional<z.ZodString>;
84
+ mpi_eci: z.ZodOptional<z.ZodNumber>;
85
+ order_id: z.ZodOptional<z.ZodString>;
86
+ payment_id: z.ZodOptional<z.ZodNumber>;
87
+ paytype: z.ZodOptional<z.ZodString>;
88
+ public_key: z.ZodOptional<z.ZodString>;
89
+ receiver_commission: z.ZodOptional<z.ZodNumber>;
90
+ result: z.ZodOptional<z.ZodString>;
91
+ rrn_credit: z.ZodOptional<z.ZodString>;
92
+ rrn_debit: z.ZodOptional<z.ZodString>;
93
+ sender_bonus: z.ZodOptional<z.ZodNumber>;
94
+ sender_card_bank: z.ZodOptional<z.ZodString>;
95
+ sender_card_country: z.ZodOptional<z.ZodString>;
96
+ sender_card_mask2: z.ZodOptional<z.ZodString>;
97
+ sender_iban: z.ZodOptional<z.ZodString>;
98
+ sender_card_type: z.ZodOptional<z.ZodString>;
99
+ sender_commission: z.ZodOptional<z.ZodNumber>;
100
+ sender_first_name: z.ZodOptional<z.ZodString>;
101
+ sender_last_name: z.ZodOptional<z.ZodString>;
102
+ sender_phone: z.ZodOptional<z.ZodString>;
103
+ status: z.ZodOptional<z.ZodString>;
104
+ wait_reserve_status: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>;
105
+ transaction_id: z.ZodOptional<z.ZodNumber>;
106
+ type: z.ZodOptional<z.ZodString>;
107
+ version: z.ZodOptional<z.ZodNumber>;
108
+ }, z.core.$strip>, z.ZodTransform<{
109
+ action: "" | "pay" | "hold" | "paysplit" | "subscribe" | "paydonate" | "auth" | "regular" | "status" | undefined;
110
+ bonusType: "" | "bonusplus" | "discount_club" | "personal" | "promo" | undefined;
111
+ createDate: Date | undefined;
112
+ currency: "" | "USD" | "EUR" | "UAH" | undefined;
113
+ currencyCredit: "" | "USD" | "EUR" | "UAH" | undefined;
114
+ currencyDebit: "" | "USD" | "EUR" | "UAH" | undefined;
115
+ endDate: Date | undefined;
116
+ is3ds: boolean | undefined;
117
+ language: "" | "uk" | "en" | undefined;
118
+ momentPart: boolean | undefined;
119
+ mpiEci: 0 | 5 | 6 | 7 | undefined;
120
+ paytype: "" | "apay" | "gpay" | "card" | "privat24" | "masterpass" | "moment_part" | "paypart" | "cash" | "invoice" | "qr" | undefined;
121
+ result: "" | "error" | "ok" | undefined;
122
+ status: "" | "success" | "error" | "failure" | "reversed" | "subscribed" | "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;
123
+ waitReserveStatus: boolean | undefined;
124
+ version: 0 | 7 | undefined;
125
+ acqId?: number | undefined;
126
+ agentCommission?: number | undefined;
127
+ amount?: number | undefined;
128
+ amountBonus?: number | undefined;
129
+ amountCredit?: number | undefined;
130
+ amountDebit?: number | undefined;
131
+ authcodeCredit?: string | undefined;
132
+ authcodeDebit?: string | undefined;
133
+ bonusProcent?: number | undefined;
134
+ cardToken?: string | undefined;
135
+ commissionCredit?: number | undefined;
136
+ commissionDebit?: number | undefined;
137
+ confirmPhone?: string | undefined;
138
+ description?: string | undefined;
139
+ info?: string | undefined;
140
+ ip?: string | undefined;
141
+ liqpayOrderId?: string | undefined;
142
+ orderId?: string | undefined;
143
+ paymentId?: number | undefined;
144
+ publicKey?: string | undefined;
145
+ receiverCommission?: number | undefined;
146
+ rrnCredit?: string | undefined;
147
+ rrnDebit?: string | undefined;
148
+ senderBonus?: number | undefined;
149
+ senderCardBank?: string | undefined;
150
+ senderCardCountry?: string | undefined;
151
+ senderCardMask2?: string | undefined;
152
+ senderIban?: string | undefined;
153
+ senderCardType?: string | undefined;
154
+ senderCommission?: number | undefined;
155
+ senderFirstName?: string | undefined;
156
+ senderLastName?: string | undefined;
157
+ senderPhone?: string | undefined;
158
+ transactionId?: number | undefined;
159
+ type?: string | undefined;
160
+ }, {
161
+ acq_id?: number | undefined;
162
+ action?: string | undefined;
163
+ agent_commission?: number | undefined;
164
+ amount?: number | undefined;
165
+ amount_bonus?: number | undefined;
166
+ amount_credit?: number | undefined;
167
+ amount_debit?: number | undefined;
168
+ authcode_credit?: string | undefined;
169
+ authcode_debit?: string | undefined;
170
+ bonus_procent?: number | undefined;
171
+ bonus_type?: string | undefined;
172
+ card_token?: string | undefined;
173
+ commission_credit?: number | undefined;
174
+ commission_debit?: number | undefined;
175
+ confirm_phone?: string | undefined;
176
+ create_date?: string | undefined;
177
+ currency?: string | undefined;
178
+ currency_credit?: string | undefined;
179
+ currency_debit?: string | undefined;
180
+ description?: string | undefined;
181
+ end_date?: string | undefined;
182
+ info?: string | undefined;
183
+ ip?: string | undefined;
184
+ is_3ds?: string | boolean | undefined;
185
+ language?: string | undefined;
186
+ liqpay_order_id?: string | undefined;
187
+ moment_part?: string | undefined;
188
+ mpi_eci?: number | undefined;
189
+ order_id?: string | undefined;
190
+ payment_id?: number | undefined;
191
+ paytype?: string | undefined;
192
+ public_key?: string | undefined;
193
+ receiver_commission?: number | undefined;
194
+ result?: string | undefined;
195
+ rrn_credit?: string | undefined;
196
+ rrn_debit?: string | undefined;
197
+ sender_bonus?: number | undefined;
198
+ sender_card_bank?: string | undefined;
199
+ sender_card_country?: string | undefined;
200
+ sender_card_mask2?: string | undefined;
201
+ sender_iban?: string | undefined;
202
+ sender_card_type?: string | undefined;
203
+ sender_commission?: number | undefined;
204
+ sender_first_name?: string | undefined;
205
+ sender_last_name?: string | undefined;
206
+ sender_phone?: string | undefined;
207
+ status?: string | undefined;
208
+ wait_reserve_status?: string | boolean | undefined;
209
+ transaction_id?: number | undefined;
210
+ type?: string | undefined;
211
+ version?: number | undefined;
212
+ }>>;
213
+ export type LiqPayPaymentStatusResponse = z.infer<typeof LiqPayPaymentStatusResponseSchema>;
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LiqPayPaymentStatusResponseSchema = exports.LiqPayRawPaymentStatusResponseSchema = void 0;
4
+ const ts_case_convert_1 = require("ts-case-convert");
5
+ const zod_1 = require("zod");
6
+ const utils_1 = require("../../utils");
7
+ const enums_1 = require("../common/enums");
8
+ // TODO: check for optional fields on real api responses
9
+ exports.LiqPayRawPaymentStatusResponseSchema = zod_1.z.object({
10
+ acq_id: zod_1.z.number().optional(),
11
+ action: zod_1.z.string().optional(),
12
+ agent_commission: zod_1.z.number().optional(),
13
+ amount: zod_1.z.number().optional(),
14
+ amount_bonus: zod_1.z.number().optional(),
15
+ amount_credit: zod_1.z.number().optional(),
16
+ amount_debit: zod_1.z.number().optional(),
17
+ authcode_credit: zod_1.z.string().optional(),
18
+ authcode_debit: zod_1.z.string().optional(),
19
+ bonus_procent: zod_1.z.number().optional(),
20
+ bonus_type: zod_1.z.string().optional(),
21
+ card_token: zod_1.z.string().optional(),
22
+ commission_credit: zod_1.z.number().optional(),
23
+ commission_debit: zod_1.z.number().optional(),
24
+ confirm_phone: zod_1.z.string().optional(),
25
+ create_date: zod_1.z.string().optional(),
26
+ currency: zod_1.z.string().optional(),
27
+ currency_credit: zod_1.z.string().optional(),
28
+ currency_debit: zod_1.z.string().optional(),
29
+ description: zod_1.z.string().optional(),
30
+ end_date: zod_1.z.string().optional(),
31
+ info: zod_1.z.string().optional(),
32
+ ip: zod_1.z.string().optional(),
33
+ is_3ds: zod_1.z.union([zod_1.z.string(), zod_1.z.boolean()]).optional(),
34
+ language: zod_1.z.string().optional(),
35
+ liqpay_order_id: zod_1.z.string().optional(),
36
+ moment_part: zod_1.z.string().optional(),
37
+ mpi_eci: zod_1.z.number().optional(),
38
+ order_id: zod_1.z.string().optional(),
39
+ payment_id: zod_1.z.number().optional(),
40
+ paytype: zod_1.z.string().optional(),
41
+ public_key: zod_1.z.string().optional(),
42
+ receiver_commission: zod_1.z.number().optional(),
43
+ result: zod_1.z.string().optional(),
44
+ rrn_credit: zod_1.z.string().optional(),
45
+ rrn_debit: zod_1.z.string().optional(),
46
+ sender_bonus: zod_1.z.number().optional(),
47
+ sender_card_bank: zod_1.z.string().optional(),
48
+ sender_card_country: zod_1.z.string().optional(),
49
+ sender_card_mask2: zod_1.z.string().optional(),
50
+ sender_iban: zod_1.z.string().optional(),
51
+ sender_card_type: zod_1.z.string().optional(),
52
+ sender_commission: zod_1.z.number().optional(),
53
+ sender_first_name: zod_1.z.string().optional(),
54
+ sender_last_name: zod_1.z.string().optional(),
55
+ sender_phone: zod_1.z.string().optional(),
56
+ status: zod_1.z.string().optional(),
57
+ wait_reserve_status: zod_1.z.union([zod_1.z.string(), zod_1.z.boolean()]).optional(),
58
+ transaction_id: zod_1.z.number().optional(),
59
+ type: zod_1.z.string().optional(),
60
+ version: zod_1.z.number().optional(),
61
+ });
62
+ exports.LiqPayPaymentStatusResponseSchema = exports.LiqPayRawPaymentStatusResponseSchema.transform(raw => {
63
+ const camelized = (0, ts_case_convert_1.objectToCamel)(raw);
64
+ return {
65
+ ...camelized,
66
+ action: camelized.action && enums_1.LiqPayActionSchema.parse(camelized.action),
67
+ bonusType: camelized.bonusType && enums_1.LiqPayBonusTypeSchema.parse(camelized.bonusType),
68
+ createDate: (0, utils_1.parseDate)(camelized.createDate),
69
+ currency: camelized.currency && enums_1.LiqPayCurrencySchema.parse(camelized.currency),
70
+ currencyCredit: camelized.currencyCredit &&
71
+ enums_1.LiqPayCurrencySchema.parse(camelized.currencyCredit),
72
+ currencyDebit: camelized.currencyDebit &&
73
+ enums_1.LiqPayCurrencySchema.parse(camelized.currencyDebit),
74
+ endDate: (0, utils_1.parseDate)(camelized.endDate),
75
+ is3ds: (0, utils_1.parseBool)(camelized.is3ds),
76
+ language: camelized.language && enums_1.LiqPayLanguageSchema.parse(camelized.language),
77
+ momentPart: (0, utils_1.parseBool)(camelized.momentPart),
78
+ mpiEci: camelized.mpiEci && enums_1.LiqPayMpiEciSchema.parse(camelized.mpiEci),
79
+ paytype: camelized.paytype && enums_1.LiqPayPaytypeSchema.parse(camelized.paytype),
80
+ result: camelized.result && enums_1.LiqPayRequestResultSchema.parse(camelized.result),
81
+ status: camelized.status && enums_1.LiqPayPaymentStatusSchema.parse(camelized.status),
82
+ waitReserveStatus: (0, utils_1.parseBool)(camelized.waitReserveStatus),
83
+ version: camelized.version && enums_1.LiqPayVersionSchema.parse(camelized.version),
84
+ };
85
+ });
@@ -0,0 +1,250 @@
1
+ import { LiqPayAction, LiqPayCurrency, LiqPayMpiEci, LiqPayPaymentStatus, LiqPayPaytype } from './types';
2
+ /**
3
+ * Contract of decoded format of API parameters received in a request from LiqPay after payment
4
+ */
5
+ export interface LiqPayCheckoutCallback {
6
+ /**
7
+ * Acquirer ID
8
+ */
9
+ acq_id: number;
10
+ /**
11
+ * Operation type. Possible values:
12
+ * - `pay` - payment
13
+ * - `hold` - blocking of funds on the sender's account
14
+ * - `subscribe` - creation of a regular payment
15
+ * - `regular` - regular payment
16
+ */
17
+ action: LiqPayAction;
18
+ /**
19
+ * Agent commission in payment currency
20
+ */
21
+ agent_commission: number;
22
+ /**
23
+ * Payment amount
24
+ */
25
+ amount: number;
26
+ /**
27
+ * Sender bonus in debit payment currency
28
+ */
29
+ amount_bonus: number;
30
+ /**
31
+ * Transaction amount credit in currency `currency_credit`
32
+ */
33
+ amount_credit: number;
34
+ /**
35
+ * Transaction amount debit in currency `currency_debit`
36
+ */
37
+ amount_debit: number;
38
+ /**
39
+ * Authorization code for credit transaction
40
+ */
41
+ authcode_credit: string;
42
+ /**
43
+ * Authorization code for debit transaction
44
+ */
45
+ authcode_debit: string;
46
+ /**
47
+ * Sender card token
48
+ */
49
+ card_token: string;
50
+ /**
51
+ * Recipient fee in `currency_credit` currency
52
+ */
53
+ commission_credit: number;
54
+ /**
55
+ * Sender fee in `currency_debit`
56
+ */
57
+ commission_debit: number;
58
+ /**
59
+ * Date of debiting funds
60
+ */
61
+ completion_date: Date;
62
+ /**
63
+ * Payment creation date
64
+ */
65
+ create_date: Date;
66
+ /**
67
+ * Payment currency
68
+ */
69
+ currency: LiqPayCurrency;
70
+ /**
71
+ * Transaction currency credit
72
+ */
73
+ currency_credit: LiqPayCurrency;
74
+ /**
75
+ * Transaction currency debit
76
+ */
77
+ currency_debit: LiqPayCurrency;
78
+ /**
79
+ * A unique user identifier on the merchant's website. Maximum length __100__ characters.
80
+ */
81
+ customer: string;
82
+ /**
83
+ * Payment comment
84
+ */
85
+ description: string;
86
+ /**
87
+ * Payment completion/change date
88
+ */
89
+ end_date: Date;
90
+ /**
91
+ * Error code
92
+ */
93
+ err_code: string;
94
+ /**
95
+ * Error description
96
+ */
97
+ err_description: string;
98
+ /**
99
+ * Additional payment information
100
+ */
101
+ info: string;
102
+ /**
103
+ * Sender IP address
104
+ */
105
+ ip: string;
106
+ /**
107
+ * 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
108
+ */
109
+ is_3ds: boolean;
110
+ /**
111
+ * `Order_id` of payment in the LiqPay system
112
+ */
113
+ liqpay_order_id: string;
114
+ /**
115
+ * Code that represents whether 3D-Secure verification was performed during payment. Possible values:
116
+ * - `5` - the transaction was completed with 3DS (the issuer and acquirer support 3D-Secure technology)
117
+ * - `6` - the payer's card issuer does not support 3D-Secure technology
118
+ * - `7` - the transaction was completed without 3D-Secure
119
+ */
120
+ mpi_eci: LiqPayMpiEci;
121
+ /**
122
+ * Payment `Order_id`
123
+ */
124
+ order_id: string;
125
+ /**
126
+ * Payment ID in the LiqPay system
127
+ */
128
+ payment_id: number;
129
+ /**
130
+ * Payment method. Possible values:
131
+ * - card - payment by card
132
+ * - privat24 - through the Privat24 account
133
+ * - moment_part - installment
134
+ * - invoice - invoice to e-mail
135
+ * - qr - scan qr code
136
+ */
137
+ paytype: LiqPayPaytype;
138
+ /**
139
+ * Store public key
140
+ */
141
+ public_key: string;
142
+ /**
143
+ * Recipient fee in payment currency
144
+ */
145
+ receiver_commission: number;
146
+ /**
147
+ * Link to which the client must be redirected to complete 3DS verification
148
+ */
149
+ redirect_to: string;
150
+ /**
151
+ * Date of last payment refund
152
+ */
153
+ refund_date_last: Date;
154
+ /**
155
+ * Unique transaction number in the authorization and settlement system of the servicing bank `Retrieval Reference number`
156
+ */
157
+ rrn_credit: string;
158
+ /**
159
+ * Unique transaction number in the authorization and settlement system of the servicing bank `Retrieval Reference number`
160
+ */
161
+ rrn_debit: string;
162
+ /**
163
+ * Sender bonus in payment currency
164
+ */
165
+ sender_bonus: number;
166
+ /**
167
+ * Sender's bank
168
+ */
169
+ sender_card_bank: string;
170
+ /**
171
+ * Country of the sender's card. Numeric __ISO 3166-1__ code
172
+ */
173
+ sender_card_country: string;
174
+ /**
175
+ * Sender's card
176
+ */
177
+ sender_card_mask2: string;
178
+ /**
179
+ * Sender's IBAN
180
+ */
181
+ sender_iban: string;
182
+ /**
183
+ * Sender's card type MC/Visa
184
+ */
185
+ sender_card_type: string;
186
+ /**
187
+ * Sender's fee in payment currency
188
+ */
189
+ sender_commission: number;
190
+ /**
191
+ * Sender's first name
192
+ */
193
+ sender_first_name: string;
194
+ /**
195
+ * Sender's last name
196
+ */
197
+ sender_last_name: string;
198
+ /**
199
+ * Sender's phone number
200
+ */
201
+ sender_phone: string;
202
+ /**
203
+ * Payment status
204
+ */
205
+ status: LiqPayPaymentStatus;
206
+ /**
207
+ * 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
208
+ */
209
+ wait_reserve_status?: boolean;
210
+ /**
211
+ * Payment Token
212
+ */
213
+ token: string;
214
+ /**
215
+ * Payment type
216
+ */
217
+ type: string;
218
+ /**
219
+ * API version. Current value is `7`
220
+ */
221
+ version: 7;
222
+ /**
223
+ * Error code
224
+ */
225
+ err_erc: string;
226
+ /**
227
+ * Product category
228
+ */
229
+ product_category: string;
230
+ /**
231
+ * Product description
232
+ */
233
+ product_description: string;
234
+ /**
235
+ * Product name
236
+ */
237
+ product_name: string;
238
+ /**
239
+ * Product page address
240
+ */
241
+ product_url: string;
242
+ /**
243
+ * Refund amount
244
+ */
245
+ refund_amount: number;
246
+ /**
247
+ * Verification code
248
+ */
249
+ verifycode?: string;
250
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });