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,91 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LiqPayCheckoutCallbackSchema = exports.LiqPayRawCheckoutCallbackSchema = 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 callbacks
9
+ exports.LiqPayRawCheckoutCallbackSchema = zod_1.z.object({
10
+ version: zod_1.z.number().optional(),
11
+ public_key: zod_1.z.string().optional(),
12
+ acq_id: zod_1.z.number().optional(),
13
+ action: zod_1.z.string().optional(),
14
+ agent_commission: zod_1.z.number().optional(),
15
+ amount: zod_1.z.number().optional(),
16
+ amount_bonus: zod_1.z.number().optional(),
17
+ amount_credit: zod_1.z.number().optional(),
18
+ amount_debit: zod_1.z.number().optional(),
19
+ authcode_credit: zod_1.z.string().optional(),
20
+ authcode_debit: 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
+ completion_date: 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
+ customer: zod_1.z.string().max(100).optional(),
30
+ description: zod_1.z.string().optional(),
31
+ end_date: zod_1.z.string().optional(),
32
+ err_code: zod_1.z.string().optional(),
33
+ err_description: zod_1.z.string().optional(),
34
+ info: zod_1.z.string().optional(),
35
+ ip: zod_1.z.string().optional(),
36
+ is_3ds: zod_1.z.union([zod_1.z.string(), zod_1.z.boolean()]).optional(),
37
+ liqpay_order_id: zod_1.z.string().optional(),
38
+ mpi_eci: zod_1.z.number().optional(),
39
+ order_id: zod_1.z.string().optional(),
40
+ payment_id: zod_1.z.number().optional(),
41
+ paytype: zod_1.z.string().optional(),
42
+ receiver_commission: zod_1.z.number().optional(),
43
+ redirect_to: zod_1.z.string().optional(),
44
+ refund_date_last: zod_1.z.string().optional(),
45
+ rrn_credit: zod_1.z.string().optional(),
46
+ rrn_debit: zod_1.z.string().optional(),
47
+ sender_bonus: zod_1.z.number().optional(),
48
+ sender_card_bank: zod_1.z.string().optional(),
49
+ sender_card_country: zod_1.z.string().optional(),
50
+ sender_card_mask2: zod_1.z.string().optional(),
51
+ sender_iban: zod_1.z.string().optional(),
52
+ sender_card_type: zod_1.z.string().optional(),
53
+ sender_commission: zod_1.z.number().optional(),
54
+ sender_first_name: zod_1.z.string().optional(),
55
+ sender_last_name: zod_1.z.string().optional(),
56
+ sender_phone: zod_1.z.string().optional(),
57
+ status: zod_1.z.string().optional(),
58
+ wait_reserve_status: zod_1.z.union([zod_1.z.string(), zod_1.z.boolean()]).optional(),
59
+ token: zod_1.z.string().optional(),
60
+ type: zod_1.z.string().optional(),
61
+ err_erc: zod_1.z.string().optional(),
62
+ product_category: zod_1.z.string().optional(),
63
+ product_description: zod_1.z.string().optional(),
64
+ product_name: zod_1.z.string().optional(),
65
+ product_url: zod_1.z.string().optional(),
66
+ refund_amount: zod_1.z.number().optional(),
67
+ verifycode: zod_1.z.string().optional(),
68
+ });
69
+ exports.LiqPayCheckoutCallbackSchema = exports.LiqPayRawCheckoutCallbackSchema.transform(raw => {
70
+ const camelized = (0, ts_case_convert_1.objectToCamel)(raw);
71
+ return {
72
+ ...camelized,
73
+ version: camelized.version && enums_1.LiqPayVersionSchema.parse(camelized.version),
74
+ action: camelized.action && enums_1.LiqPayActionSchema.parse(camelized.action),
75
+ completionDate: (0, utils_1.parseDate)(camelized.completionDate),
76
+ createDate: (0, utils_1.parseDate)(camelized.createDate),
77
+ currency: camelized.currency && enums_1.LiqPayCurrencySchema.parse(camelized.currency),
78
+ currencyCredit: camelized.currencyCredit &&
79
+ enums_1.LiqPayCurrencySchema.parse(camelized.currencyCredit),
80
+ currencyDebit: camelized.currencyDebit &&
81
+ enums_1.LiqPayCurrencySchema.parse(camelized.currencyDebit),
82
+ endDate: (0, utils_1.parseDate)(camelized.endDate),
83
+ errCode: camelized.errCode && enums_1.LiqPayErrorCodeSchema.parse(camelized.errCode),
84
+ is3ds: (0, utils_1.parseBool)(camelized.is3ds),
85
+ mpiEci: camelized.mpiEci && enums_1.LiqPayMpiEciSchema.parse(camelized.mpiEci),
86
+ paytype: camelized.paytype && enums_1.LiqPayPaytypeSchema.parse(camelized.paytype),
87
+ refundDateLast: (0, utils_1.parseDate)(camelized.refundDateLast),
88
+ status: camelized.status && enums_1.LiqPayPaymentStatusSchema.parse(camelized.status),
89
+ waitReserveStatus: (0, utils_1.parseBool)(camelized.waitReserveStatus),
90
+ };
91
+ });
@@ -0,0 +1,421 @@
1
+ import z from 'zod';
2
+ export declare const LiqPayCheckoutRequestSchema: z.ZodObject<{
3
+ version: z.ZodLiteral<7>;
4
+ publicKey: z.ZodOptional<z.ZodString>;
5
+ action: z.ZodEnum<{
6
+ pay: "pay";
7
+ hold: "hold";
8
+ paysplit: "paysplit";
9
+ subscribe: "subscribe";
10
+ paydonate: "paydonate";
11
+ auth: "auth";
12
+ regular: "regular";
13
+ status: "status";
14
+ }>;
15
+ amount: z.ZodNumber;
16
+ currency: z.ZodEnum<{
17
+ USD: "USD";
18
+ EUR: "EUR";
19
+ UAH: "UAH";
20
+ }>;
21
+ description: z.ZodString;
22
+ orderId: z.ZodString;
23
+ rroInfo: z.ZodOptional<z.ZodObject<{
24
+ items: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
25
+ amount: z.ZodNumber;
26
+ cost: z.ZodNumber;
27
+ id: z.ZodNumber;
28
+ price: z.ZodNumber;
29
+ }, z.core.$strip>, z.ZodObject<{
30
+ amount: z.ZodNumber;
31
+ cost: z.ZodNumber;
32
+ price: z.ZodNumber;
33
+ categoryname: z.ZodString;
34
+ name: z.ZodString;
35
+ unitcode: z.ZodEnum<typeof import("../common/enums").LiqPayUnitEnum>;
36
+ barcode: z.ZodOptional<z.ZodString>;
37
+ codifier: z.ZodOptional<z.ZodString>;
38
+ vndcode: z.ZodOptional<z.ZodString>;
39
+ taxs: z.ZodOptional<z.ZodArray<z.ZodObject<{
40
+ letter: z.ZodString;
41
+ name: z.ZodString;
42
+ type: z.ZodNumber;
43
+ prc: z.ZodNumber;
44
+ }, z.core.$strip>>>;
45
+ }, z.core.$strip>]>>>;
46
+ delivery_emails: z.ZodOptional<z.ZodArray<z.ZodString>>;
47
+ }, z.core.$strip>>;
48
+ expiredDate: z.ZodOptional<z.ZodDate>;
49
+ language: z.ZodOptional<z.ZodEnum<{
50
+ uk: "uk";
51
+ en: "en";
52
+ }>>;
53
+ paytypes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
54
+ apay: "apay";
55
+ gpay: "gpay";
56
+ card: "card";
57
+ privat24: "privat24";
58
+ masterpass: "masterpass";
59
+ moment_part: "moment_part";
60
+ paypart: "paypart";
61
+ cash: "cash";
62
+ invoice: "invoice";
63
+ qr: "qr";
64
+ }>>>;
65
+ resultUrl: z.ZodOptional<z.ZodString>;
66
+ serverUrl: z.ZodOptional<z.ZodString>;
67
+ verifycode: z.ZodOptional<z.ZodLiteral<"Y">>;
68
+ splitRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
69
+ public_key: z.ZodString;
70
+ amount: z.ZodNumber;
71
+ commission_payer: z.ZodEnum<{
72
+ sender: "sender";
73
+ receiver: "receiver";
74
+ }>;
75
+ server_url: z.ZodString;
76
+ rro_info: z.ZodOptional<z.ZodObject<{
77
+ items: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
78
+ amount: z.ZodNumber;
79
+ cost: z.ZodNumber;
80
+ id: z.ZodNumber;
81
+ price: z.ZodNumber;
82
+ }, z.core.$strip>, z.ZodObject<{
83
+ amount: z.ZodNumber;
84
+ cost: z.ZodNumber;
85
+ price: z.ZodNumber;
86
+ categoryname: z.ZodString;
87
+ name: z.ZodString;
88
+ unitcode: z.ZodEnum<typeof import("../common/enums").LiqPayUnitEnum>;
89
+ barcode: z.ZodOptional<z.ZodString>;
90
+ codifier: z.ZodOptional<z.ZodString>;
91
+ vndcode: z.ZodOptional<z.ZodString>;
92
+ taxs: z.ZodOptional<z.ZodArray<z.ZodObject<{
93
+ letter: z.ZodString;
94
+ name: z.ZodString;
95
+ type: z.ZodNumber;
96
+ prc: z.ZodNumber;
97
+ }, z.core.$strip>>>;
98
+ }, z.core.$strip>]>>>;
99
+ delivery_emails: z.ZodOptional<z.ZodArray<z.ZodString>>;
100
+ }, z.core.$strip>>;
101
+ }, z.core.$strip>>>;
102
+ senderAddress: z.ZodOptional<z.ZodString>;
103
+ senderCity: z.ZodOptional<z.ZodString>;
104
+ senderCountryCode: z.ZodOptional<z.ZodString>;
105
+ senderFirstName: z.ZodOptional<z.ZodString>;
106
+ senderLastName: z.ZodOptional<z.ZodString>;
107
+ senderPostalCode: z.ZodOptional<z.ZodString>;
108
+ subscribe: z.ZodOptional<z.ZodLiteral<"1">>;
109
+ subscribeDateStart: z.ZodOptional<z.ZodDate>;
110
+ subscribePeriodicity: z.ZodOptional<z.ZodEnum<{
111
+ day: "day";
112
+ week: "week";
113
+ month: "month";
114
+ year: "year";
115
+ }>>;
116
+ customer: z.ZodOptional<z.ZodString>;
117
+ recurringbytoken: z.ZodOptional<z.ZodLiteral<"1">>;
118
+ customerUserId: z.ZodOptional<z.ZodString>;
119
+ dae: z.ZodOptional<z.ZodObject<{
120
+ airLine: z.ZodString;
121
+ ticketNumber: z.ZodString;
122
+ passengerName: z.ZodString;
123
+ flightNumber: z.ZodString;
124
+ originCity: z.ZodString;
125
+ destinationCity: z.ZodString;
126
+ departureDate: z.ZodString;
127
+ }, z.core.$strip>>;
128
+ info: z.ZodOptional<z.ZodString>;
129
+ productCategory: z.ZodOptional<z.ZodString>;
130
+ productDescription: z.ZodOptional<z.ZodString>;
131
+ productName: z.ZodOptional<z.ZodString>;
132
+ productUrl: z.ZodOptional<z.ZodString>;
133
+ }, z.core.$strip>;
134
+ export type LiqPayCheckoutRequest = z.infer<typeof LiqPayCheckoutRequestSchema>;
135
+ export declare const LiqPayRawCheckoutRequestSchema: z.ZodPipe<z.ZodObject<{
136
+ version: z.ZodLiteral<7>;
137
+ publicKey: z.ZodOptional<z.ZodString>;
138
+ action: z.ZodEnum<{
139
+ pay: "pay";
140
+ hold: "hold";
141
+ paysplit: "paysplit";
142
+ subscribe: "subscribe";
143
+ paydonate: "paydonate";
144
+ auth: "auth";
145
+ regular: "regular";
146
+ status: "status";
147
+ }>;
148
+ amount: z.ZodNumber;
149
+ currency: z.ZodEnum<{
150
+ USD: "USD";
151
+ EUR: "EUR";
152
+ UAH: "UAH";
153
+ }>;
154
+ description: z.ZodString;
155
+ orderId: z.ZodString;
156
+ rroInfo: z.ZodOptional<z.ZodObject<{
157
+ items: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
158
+ amount: z.ZodNumber;
159
+ cost: z.ZodNumber;
160
+ id: z.ZodNumber;
161
+ price: z.ZodNumber;
162
+ }, z.core.$strip>, z.ZodObject<{
163
+ amount: z.ZodNumber;
164
+ cost: z.ZodNumber;
165
+ price: z.ZodNumber;
166
+ categoryname: z.ZodString;
167
+ name: z.ZodString;
168
+ unitcode: z.ZodEnum<typeof import("../common/enums").LiqPayUnitEnum>;
169
+ barcode: z.ZodOptional<z.ZodString>;
170
+ codifier: z.ZodOptional<z.ZodString>;
171
+ vndcode: z.ZodOptional<z.ZodString>;
172
+ taxs: z.ZodOptional<z.ZodArray<z.ZodObject<{
173
+ letter: z.ZodString;
174
+ name: z.ZodString;
175
+ type: z.ZodNumber;
176
+ prc: z.ZodNumber;
177
+ }, z.core.$strip>>>;
178
+ }, z.core.$strip>]>>>;
179
+ delivery_emails: z.ZodOptional<z.ZodArray<z.ZodString>>;
180
+ }, z.core.$strip>>;
181
+ expiredDate: z.ZodOptional<z.ZodDate>;
182
+ language: z.ZodOptional<z.ZodEnum<{
183
+ uk: "uk";
184
+ en: "en";
185
+ }>>;
186
+ paytypes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
187
+ apay: "apay";
188
+ gpay: "gpay";
189
+ card: "card";
190
+ privat24: "privat24";
191
+ masterpass: "masterpass";
192
+ moment_part: "moment_part";
193
+ paypart: "paypart";
194
+ cash: "cash";
195
+ invoice: "invoice";
196
+ qr: "qr";
197
+ }>>>;
198
+ resultUrl: z.ZodOptional<z.ZodString>;
199
+ serverUrl: z.ZodOptional<z.ZodString>;
200
+ verifycode: z.ZodOptional<z.ZodLiteral<"Y">>;
201
+ splitRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
202
+ public_key: z.ZodString;
203
+ amount: z.ZodNumber;
204
+ commission_payer: z.ZodEnum<{
205
+ sender: "sender";
206
+ receiver: "receiver";
207
+ }>;
208
+ server_url: z.ZodString;
209
+ rro_info: z.ZodOptional<z.ZodObject<{
210
+ items: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
211
+ amount: z.ZodNumber;
212
+ cost: z.ZodNumber;
213
+ id: z.ZodNumber;
214
+ price: z.ZodNumber;
215
+ }, z.core.$strip>, z.ZodObject<{
216
+ amount: z.ZodNumber;
217
+ cost: z.ZodNumber;
218
+ price: z.ZodNumber;
219
+ categoryname: z.ZodString;
220
+ name: z.ZodString;
221
+ unitcode: z.ZodEnum<typeof import("../common/enums").LiqPayUnitEnum>;
222
+ barcode: z.ZodOptional<z.ZodString>;
223
+ codifier: z.ZodOptional<z.ZodString>;
224
+ vndcode: z.ZodOptional<z.ZodString>;
225
+ taxs: z.ZodOptional<z.ZodArray<z.ZodObject<{
226
+ letter: z.ZodString;
227
+ name: z.ZodString;
228
+ type: z.ZodNumber;
229
+ prc: z.ZodNumber;
230
+ }, z.core.$strip>>>;
231
+ }, z.core.$strip>]>>>;
232
+ delivery_emails: z.ZodOptional<z.ZodArray<z.ZodString>>;
233
+ }, z.core.$strip>>;
234
+ }, z.core.$strip>>>;
235
+ senderAddress: z.ZodOptional<z.ZodString>;
236
+ senderCity: z.ZodOptional<z.ZodString>;
237
+ senderCountryCode: z.ZodOptional<z.ZodString>;
238
+ senderFirstName: z.ZodOptional<z.ZodString>;
239
+ senderLastName: z.ZodOptional<z.ZodString>;
240
+ senderPostalCode: z.ZodOptional<z.ZodString>;
241
+ subscribe: z.ZodOptional<z.ZodLiteral<"1">>;
242
+ subscribeDateStart: z.ZodOptional<z.ZodDate>;
243
+ subscribePeriodicity: z.ZodOptional<z.ZodEnum<{
244
+ day: "day";
245
+ week: "week";
246
+ month: "month";
247
+ year: "year";
248
+ }>>;
249
+ customer: z.ZodOptional<z.ZodString>;
250
+ recurringbytoken: z.ZodOptional<z.ZodLiteral<"1">>;
251
+ customerUserId: z.ZodOptional<z.ZodString>;
252
+ dae: z.ZodOptional<z.ZodObject<{
253
+ airLine: z.ZodString;
254
+ ticketNumber: z.ZodString;
255
+ passengerName: z.ZodString;
256
+ flightNumber: z.ZodString;
257
+ originCity: z.ZodString;
258
+ destinationCity: z.ZodString;
259
+ departureDate: z.ZodString;
260
+ }, z.core.$strip>>;
261
+ info: z.ZodOptional<z.ZodString>;
262
+ productCategory: z.ZodOptional<z.ZodString>;
263
+ productDescription: z.ZodOptional<z.ZodString>;
264
+ productName: z.ZodOptional<z.ZodString>;
265
+ productUrl: z.ZodOptional<z.ZodString>;
266
+ }, z.core.$strip>, z.ZodTransform<{
267
+ version: number;
268
+ action: string;
269
+ currency: string;
270
+ expired_date: string | undefined;
271
+ language: string | undefined;
272
+ paytypes: string | undefined;
273
+ verifycode: string | undefined;
274
+ split_rules: string | undefined;
275
+ subscribe_date_start: string | undefined;
276
+ subscribe_periodicity: string | undefined;
277
+ recurringbytoken: string | undefined;
278
+ dae: string | undefined;
279
+ amount: number;
280
+ description: string;
281
+ order_id: string;
282
+ public_key?: string | undefined;
283
+ rro_info?: {
284
+ items?: {
285
+ amount: number;
286
+ cost: number;
287
+ id: number;
288
+ price: number;
289
+ }[] | {
290
+ amount: number;
291
+ cost: number;
292
+ price: number;
293
+ categoryname: string;
294
+ name: string;
295
+ unitcode: import("../common/enums").LiqPayUnitEnum;
296
+ barcode?: string | undefined;
297
+ codifier?: string | undefined;
298
+ vndcode?: string | undefined;
299
+ taxs?: {
300
+ letter: string;
301
+ name: string;
302
+ type: number;
303
+ prc: number;
304
+ }[] | undefined;
305
+ }[] | undefined;
306
+ delivery_emails?: string[] | undefined;
307
+ } | undefined;
308
+ result_url?: string | undefined;
309
+ server_url?: string | undefined;
310
+ sender_address?: string | undefined;
311
+ sender_city?: string | undefined;
312
+ sender_country_code?: string | undefined;
313
+ sender_first_name?: string | undefined;
314
+ sender_last_name?: string | undefined;
315
+ sender_postal_code?: string | undefined;
316
+ subscribe?: "1" | undefined;
317
+ customer?: string | undefined;
318
+ customer_user_id?: string | undefined;
319
+ info?: string | undefined;
320
+ product_category?: string | undefined;
321
+ product_description?: string | undefined;
322
+ product_name?: string | undefined;
323
+ product_url?: string | undefined;
324
+ }, {
325
+ version: 7;
326
+ action: "pay" | "hold" | "paysplit" | "subscribe" | "paydonate" | "auth" | "regular" | "status";
327
+ amount: number;
328
+ currency: "USD" | "EUR" | "UAH";
329
+ description: string;
330
+ orderId: string;
331
+ publicKey?: string | undefined;
332
+ rroInfo?: {
333
+ items?: ({
334
+ amount: number;
335
+ cost: number;
336
+ id: number;
337
+ price: number;
338
+ } | {
339
+ amount: number;
340
+ cost: number;
341
+ price: number;
342
+ categoryname: string;
343
+ name: string;
344
+ unitcode: import("../common/enums").LiqPayUnitEnum;
345
+ barcode?: string | undefined;
346
+ codifier?: string | undefined;
347
+ vndcode?: string | undefined;
348
+ taxs?: {
349
+ letter: string;
350
+ name: string;
351
+ type: number;
352
+ prc: number;
353
+ }[] | undefined;
354
+ })[] | undefined;
355
+ delivery_emails?: string[] | undefined;
356
+ } | undefined;
357
+ expiredDate?: Date | undefined;
358
+ language?: "uk" | "en" | undefined;
359
+ paytypes?: ("apay" | "gpay" | "card" | "privat24" | "masterpass" | "moment_part" | "paypart" | "cash" | "invoice" | "qr")[] | undefined;
360
+ resultUrl?: string | undefined;
361
+ serverUrl?: string | undefined;
362
+ verifycode?: "Y" | undefined;
363
+ splitRules?: {
364
+ public_key: string;
365
+ amount: number;
366
+ commission_payer: "sender" | "receiver";
367
+ server_url: string;
368
+ rro_info?: {
369
+ items?: ({
370
+ amount: number;
371
+ cost: number;
372
+ id: number;
373
+ price: number;
374
+ } | {
375
+ amount: number;
376
+ cost: number;
377
+ price: number;
378
+ categoryname: string;
379
+ name: string;
380
+ unitcode: import("../common/enums").LiqPayUnitEnum;
381
+ barcode?: string | undefined;
382
+ codifier?: string | undefined;
383
+ vndcode?: string | undefined;
384
+ taxs?: {
385
+ letter: string;
386
+ name: string;
387
+ type: number;
388
+ prc: number;
389
+ }[] | undefined;
390
+ })[] | undefined;
391
+ delivery_emails?: string[] | undefined;
392
+ } | undefined;
393
+ }[] | undefined;
394
+ senderAddress?: string | undefined;
395
+ senderCity?: string | undefined;
396
+ senderCountryCode?: string | undefined;
397
+ senderFirstName?: string | undefined;
398
+ senderLastName?: string | undefined;
399
+ senderPostalCode?: string | undefined;
400
+ subscribe?: "1" | undefined;
401
+ subscribeDateStart?: Date | undefined;
402
+ subscribePeriodicity?: "day" | "week" | "month" | "year" | undefined;
403
+ customer?: string | undefined;
404
+ recurringbytoken?: "1" | undefined;
405
+ customerUserId?: string | undefined;
406
+ dae?: {
407
+ airLine: string;
408
+ ticketNumber: string;
409
+ passengerName: string;
410
+ flightNumber: string;
411
+ originCity: string;
412
+ destinationCity: string;
413
+ departureDate: string;
414
+ } | undefined;
415
+ info?: string | undefined;
416
+ productCategory?: string | undefined;
417
+ productDescription?: string | undefined;
418
+ productName?: string | undefined;
419
+ productUrl?: string | undefined;
420
+ }>>;
421
+ export type LiqPayRawCheckoutRequest = z.infer<typeof LiqPayRawCheckoutRequestSchema>;
@@ -0,0 +1,70 @@
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.LiqPayRawCheckoutRequestSchema = exports.LiqPayCheckoutRequestSchema = void 0;
7
+ const ts_case_convert_1 = require("ts-case-convert");
8
+ const zod_1 = __importDefault(require("zod"));
9
+ const common_1 = require("../common");
10
+ const enums_1 = require("../common/enums");
11
+ exports.LiqPayCheckoutRequestSchema = zod_1.default.object({
12
+ // MAIN PARAMS
13
+ version: enums_1.LiqPayVersionSchema,
14
+ publicKey: zod_1.default.string().optional(),
15
+ action: enums_1.LiqPayActionSchema,
16
+ amount: zod_1.default.number().positive(),
17
+ currency: enums_1.LiqPayCurrencySchema,
18
+ description: zod_1.default.string(),
19
+ orderId: zod_1.default.string().max(255),
20
+ rroInfo: common_1.LiqPayFiscalDataSchema.optional(),
21
+ expiredDate: zod_1.default.date().optional(),
22
+ language: enums_1.LiqPayLanguageSchema.optional(),
23
+ paytypes: zod_1.default.array(enums_1.LiqPayPaytypeSchema).optional(),
24
+ resultUrl: zod_1.default.string().max(510).optional(),
25
+ serverUrl: zod_1.default.string().max(510).optional(),
26
+ verifycode: zod_1.default.literal('Y').optional(),
27
+ splitRules: zod_1.default.array(common_1.LiqPaySplitRuleSchema).optional(),
28
+ // SENDER PARAMS
29
+ senderAddress: zod_1.default.string().optional(),
30
+ senderCity: zod_1.default.string().optional(),
31
+ senderCountryCode: zod_1.default.string().optional(),
32
+ senderFirstName: zod_1.default.string().optional(),
33
+ senderLastName: zod_1.default.string().optional(),
34
+ senderPostalCode: zod_1.default.string().optional(),
35
+ // SUBSCRIPTION PARAMS
36
+ subscribe: zod_1.default.literal('1').optional(),
37
+ subscribeDateStart: zod_1.default.date().optional(),
38
+ subscribePeriodicity: enums_1.LiqPaySubscribePeriodicitySchema.optional(),
39
+ // ONE CLICK PAYMENT PARAMS
40
+ customer: zod_1.default.string().max(100).optional(),
41
+ recurringbytoken: zod_1.default.literal('1').optional(),
42
+ customerUserId: zod_1.default.string().optional(),
43
+ // OTHER PARAMS
44
+ dae: common_1.LiqPayDetailAddendaSchema.optional(),
45
+ info: zod_1.default.string().optional(),
46
+ productCategory: zod_1.default.string().max(25).optional(),
47
+ productDescription: zod_1.default.string().max(500).optional(),
48
+ productName: zod_1.default.string().max(100).optional(),
49
+ productUrl: zod_1.default.string().max(510).optional(),
50
+ });
51
+ exports.LiqPayRawCheckoutRequestSchema = exports.LiqPayCheckoutRequestSchema.transform(typed => {
52
+ const snakelized = (0, ts_case_convert_1.objectToSnake)(typed);
53
+ return {
54
+ ...snakelized,
55
+ version: Number(snakelized.version),
56
+ action: String(snakelized.action),
57
+ currency: String(snakelized.currency),
58
+ expired_date: snakelized.expired_date && snakelized.expired_date.toISOString(),
59
+ language: snakelized.language && String(snakelized.language),
60
+ paytypes: snakelized.paytypes && snakelized.paytypes.join(','),
61
+ verifycode: snakelized.verifycode && String(snakelized.verifycode),
62
+ split_rules: snakelized.split_rules && JSON.stringify(snakelized.split_rules),
63
+ subscribe_date_start: snakelized.subscribe_date_start &&
64
+ snakelized.subscribe_date_start.toISOString(),
65
+ subscribe_periodicity: snakelized.subscribe_periodicity &&
66
+ String(snakelized.subscribe_periodicity),
67
+ recurringbytoken: snakelized.recurringbytoken && String(snakelized.recurringbytoken),
68
+ dae: snakelized.dae && JSON.stringify(snakelized.dae),
69
+ };
70
+ });
@@ -0,0 +1,2 @@
1
+ export * from './checkout-callback.schema';
2
+ export * from './checkout-request.schema';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./checkout-callback.schema"), exports);
18
+ __exportStar(require("./checkout-request.schema"), exports);
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ export declare const LiqPayDetailAddendaSchema: z.ZodObject<{
3
+ airLine: z.ZodString;
4
+ ticketNumber: z.ZodString;
5
+ passengerName: z.ZodString;
6
+ flightNumber: z.ZodString;
7
+ originCity: z.ZodString;
8
+ destinationCity: z.ZodString;
9
+ departureDate: z.ZodString;
10
+ }, z.core.$strip>;
11
+ export type LiqPayDetailAddenda = z.infer<typeof LiqPayDetailAddendaSchema>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LiqPayDetailAddendaSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.LiqPayDetailAddendaSchema = zod_1.z.object({
6
+ airLine: zod_1.z.string().max(4),
7
+ ticketNumber: zod_1.z.string().max(15),
8
+ passengerName: zod_1.z.string().max(29),
9
+ flightNumber: zod_1.z.string().max(5),
10
+ originCity: zod_1.z.string().max(5),
11
+ destinationCity: zod_1.z.string().max(5),
12
+ departureDate: zod_1.z.string().max(6),
13
+ });
@@ -0,0 +1,12 @@
1
+ import z from 'zod';
2
+ export declare const LiqPayActionSchema: z.ZodEnum<{
3
+ pay: "pay";
4
+ hold: "hold";
5
+ paysplit: "paysplit";
6
+ subscribe: "subscribe";
7
+ paydonate: "paydonate";
8
+ auth: "auth";
9
+ regular: "regular";
10
+ status: "status";
11
+ }>;
12
+ export type LiqPayAction = z.infer<typeof LiqPayActionSchema>;
@@ -0,0 +1,17 @@
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.LiqPayActionSchema = void 0;
7
+ const zod_1 = __importDefault(require("zod"));
8
+ exports.LiqPayActionSchema = zod_1.default.enum([
9
+ 'pay',
10
+ 'hold',
11
+ 'paysplit',
12
+ 'subscribe',
13
+ 'paydonate',
14
+ 'auth',
15
+ 'regular',
16
+ 'status',
17
+ ]);
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+ export declare const LiqPayBonusTypeSchema: z.ZodEnum<{
3
+ bonusplus: "bonusplus";
4
+ discount_club: "discount_club";
5
+ personal: "personal";
6
+ promo: "promo";
7
+ }>;
8
+ export type LiqPayBonusType = z.infer<typeof LiqPayBonusTypeSchema>;