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.
- package/README.md +15 -0
- package/dist/core/constants.d.ts +3 -0
- package/dist/core/constants.js +7 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +17 -0
- package/dist/core/liqpay.client.d.ts +65 -0
- package/dist/core/liqpay.client.js +156 -0
- package/dist/core/schemas/base/envelope.schema.d.ts +6 -0
- package/dist/core/schemas/base/envelope.schema.js +11 -0
- package/dist/core/schemas/base/index.d.ts +3 -0
- package/dist/core/schemas/base/index.js +19 -0
- package/dist/core/schemas/base/request.type.d.ts +4 -0
- package/dist/core/schemas/base/request.type.js +2 -0
- package/dist/core/schemas/base/response.type.d.ts +15 -0
- package/dist/core/schemas/base/response.type.js +2 -0
- package/dist/core/schemas/checkout/checkout-callback.schema.d.ts +241 -0
- package/dist/core/schemas/checkout/checkout-callback.schema.js +91 -0
- package/dist/core/schemas/checkout/checkout-request.schema.d.ts +421 -0
- package/dist/core/schemas/checkout/checkout-request.schema.js +70 -0
- package/dist/core/schemas/checkout/index.d.ts +2 -0
- package/dist/core/schemas/checkout/index.js +18 -0
- package/dist/core/schemas/common/detail-addenda.schema.d.ts +11 -0
- package/dist/core/schemas/common/detail-addenda.schema.js +13 -0
- package/dist/core/schemas/common/enums/action.schema.d.ts +12 -0
- package/dist/core/schemas/common/enums/action.schema.js +17 -0
- package/dist/core/schemas/common/enums/bonus-type.schema.d.ts +8 -0
- package/dist/core/schemas/common/enums/bonus-type.schema.js +10 -0
- package/dist/core/schemas/common/enums/commission-payer.schema.d.ts +6 -0
- package/dist/core/schemas/common/enums/commission-payer.schema.js +5 -0
- package/dist/core/schemas/common/enums/currency.schema.d.ts +7 -0
- package/dist/core/schemas/common/enums/currency.schema.js +8 -0
- package/dist/core/schemas/common/enums/error-code.schema.d.ts +117 -0
- package/dist/core/schemas/common/enums/error-code.schema.js +122 -0
- package/dist/core/schemas/common/enums/index.d.ts +13 -0
- package/dist/core/schemas/common/enums/index.js +29 -0
- package/dist/core/schemas/common/enums/language.schema.d.ts +6 -0
- package/dist/core/schemas/common/enums/language.schema.js +5 -0
- package/dist/core/schemas/common/enums/mpi-eci.schema.d.ts +3 -0
- package/dist/core/schemas/common/enums/mpi-eci.schema.js +9 -0
- package/dist/core/schemas/common/enums/payment-status.schema.d.ts +81 -0
- package/dist/core/schemas/common/enums/payment-status.schema.js +48 -0
- package/dist/core/schemas/common/enums/paytype.schema.d.ts +14 -0
- package/dist/core/schemas/common/enums/paytype.schema.js +16 -0
- package/dist/core/schemas/common/enums/request-result.schema.d.ts +6 -0
- package/dist/core/schemas/common/enums/request-result.schema.js +5 -0
- package/dist/core/schemas/common/enums/subscribe-period.schema.d.ts +8 -0
- package/dist/core/schemas/common/enums/subscribe-period.schema.js +10 -0
- package/dist/core/schemas/common/enums/unit.schema.d.ts +55 -0
- package/dist/core/schemas/common/enums/unit.schema.js +58 -0
- package/dist/core/schemas/common/enums/version.schema.d.ts +2 -0
- package/dist/core/schemas/common/enums/version.schema.js +8 -0
- package/dist/core/schemas/common/fiscal-data.schema.d.ts +86 -0
- package/dist/core/schemas/common/fiscal-data.schema.js +41 -0
- package/dist/core/schemas/common/index.d.ts +3 -0
- package/dist/core/schemas/common/index.js +19 -0
- package/dist/core/schemas/common/split-rule.schema.d.ts +36 -0
- package/dist/core/schemas/common/split-rule.schema.js +13 -0
- package/dist/core/schemas/error/error-response.schema.d.ts +121 -0
- package/dist/core/schemas/error/error-response.schema.js +10 -0
- package/dist/core/schemas/error/error.type.d.ts +6 -0
- package/dist/core/schemas/error/error.type.js +2 -0
- package/dist/core/schemas/error/index.d.ts +3 -0
- package/dist/core/schemas/error/index.js +19 -0
- package/dist/core/schemas/payment-status/index.d.ts +2 -0
- package/dist/core/schemas/payment-status/index.js +18 -0
- package/dist/core/schemas/payment-status/payment-status-request.schema.d.ts +43 -0
- package/dist/core/schemas/payment-status/payment-status-request.schema.js +23 -0
- package/dist/core/schemas/payment-status/payment-status-response.schema.d.ts +213 -0
- package/dist/core/schemas/payment-status/payment-status-response.schema.js +85 -0
- package/dist/core/types/documented/checkout.callback.d.ts +250 -0
- package/dist/core/types/documented/checkout.callback.js +2 -0
- package/dist/core/types/documented/checkout.request.d.ts +236 -0
- package/dist/core/types/documented/checkout.request.js +2 -0
- package/dist/core/types/documented/detail-addenda.d.ts +33 -0
- package/dist/core/types/documented/detail-addenda.js +2 -0
- package/dist/core/types/documented/envelope.d.ts +15 -0
- package/dist/core/types/documented/envelope.js +2 -0
- package/dist/core/types/documented/fiscal-data.d.ts +80 -0
- package/dist/core/types/documented/fiscal-data.js +2 -0
- package/dist/core/types/documented/payment-status.request.d.ts +23 -0
- package/dist/core/types/documented/payment-status.request.js +2 -0
- package/dist/core/types/documented/payment-status.response.d.ts +225 -0
- package/dist/core/types/documented/payment-status.response.js +2 -0
- package/dist/core/types/documented/split-rule.d.ts +29 -0
- package/dist/core/types/documented/split-rule.js +2 -0
- package/dist/core/types/documented/types.d.ts +287 -0
- package/dist/core/types/documented/types.js +199 -0
- package/dist/core/types/payloads.d.ts +158 -0
- package/dist/core/types/payloads.js +2 -0
- package/dist/core/types/undocumented/checkout.callback.d.ts +61 -0
- package/dist/core/types/undocumented/checkout.callback.js +2 -0
- package/dist/core/types/undocumented/checkout.request.d.ts +39 -0
- package/dist/core/types/undocumented/checkout.request.js +2 -0
- package/dist/core/types/undocumented/detail-addenda.d.ts +9 -0
- package/dist/core/types/undocumented/detail-addenda.js +2 -0
- package/dist/core/types/undocumented/envelope.d.ts +4 -0
- package/dist/core/types/undocumented/envelope.js +2 -0
- package/dist/core/types/undocumented/fiscal-data.d.ts +23 -0
- package/dist/core/types/undocumented/fiscal-data.js +2 -0
- package/dist/core/types/undocumented/payment-status.request.d.ts +6 -0
- package/dist/core/types/undocumented/payment-status.request.js +2 -0
- package/dist/core/types/undocumented/payment-status.response.d.ts +54 -0
- package/dist/core/types/undocumented/payment-status.response.js +2 -0
- package/dist/core/types/undocumented/split-rule.d.ts +9 -0
- package/dist/core/types/undocumented/split-rule.js +2 -0
- package/dist/core/types/undocumented/types.d.ts +181 -0
- package/dist/core/types/undocumented/types.js +160 -0
- package/dist/core/utils/index.d.ts +2 -0
- package/dist/core/utils/index.js +18 -0
- package/dist/core/utils/is-success.util.d.ts +5 -0
- package/dist/core/utils/is-success.util.js +6 -0
- package/dist/core/utils/parse-boolean.d.ts +2 -0
- package/dist/core/utils/parse-boolean.js +7 -0
- package/dist/core/utils/parse-date.d.ts +1 -0
- package/dist/core/utils/parse-date.js +10 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +21 -0
- package/dist/nest/constants/index.d.ts +1 -0
- package/dist/nest/constants/index.js +17 -0
- package/dist/nest/constants/liqpay.constants.d.ts +1 -0
- package/dist/nest/constants/liqpay.constants.js +4 -0
- package/dist/nest/index.d.ts +3 -0
- package/dist/nest/index.js +19 -0
- package/dist/nest/interfaces/index.d.ts +2 -0
- package/dist/nest/interfaces/index.js +18 -0
- package/dist/nest/interfaces/liqpay-async-options.interface.d.ts +7 -0
- package/dist/nest/interfaces/liqpay-async-options.interface.js +2 -0
- package/dist/nest/interfaces/liqpay-options.interface.d.ts +25 -0
- package/dist/nest/interfaces/liqpay-options.interface.js +2 -0
- package/dist/nest/liqpay.module.d.ts +6 -0
- package/dist/nest/liqpay.module.js +37 -0
- package/dist/nest/liqpay.providers.d.ts +4 -0
- package/dist/nest/liqpay.providers.js +32 -0
- package/dist/nest/liqpay.service.d.ts +66 -0
- package/dist/nest/liqpay.service.js +57 -0
- package/package.json +57 -0
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { LiqPayDetailAddenda } from './detail-addenda';
|
|
2
|
+
import { LiqPayFiscalData } from './fiscal-data';
|
|
3
|
+
import { LiqPaySplitRule } from './split-rule';
|
|
4
|
+
import { LiqPayAction, LiqPayCurrency, LiqPayLanguage, LiqPayPaytype, LiqPaySubscribePeriodicity } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Contract of data that is passed when forming a payment request as `base64` encoded string data when calling the LiqPay API
|
|
7
|
+
*/
|
|
8
|
+
export interface LiqPayCheckoutRequest {
|
|
9
|
+
/**
|
|
10
|
+
* @group shared
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* API version. Current version: `7`
|
|
14
|
+
*/
|
|
15
|
+
version: 7;
|
|
16
|
+
/**
|
|
17
|
+
* Public API key: ID of created company. Example: `i00000000`
|
|
18
|
+
*
|
|
19
|
+
* You can get the key in the store settings.
|
|
20
|
+
*/
|
|
21
|
+
public_key: string;
|
|
22
|
+
/**
|
|
23
|
+
* @group payment core
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Operation type. Possible values:
|
|
27
|
+
* - `pay` - payment
|
|
28
|
+
* - `hold` - blocking of funds on sender's account
|
|
29
|
+
* - `subscribe` - regular payment
|
|
30
|
+
* - `paydonate` - donation
|
|
31
|
+
*/
|
|
32
|
+
action: LiqPayAction;
|
|
33
|
+
/**
|
|
34
|
+
* Payment amount. For example: `5`, `7.34`
|
|
35
|
+
*/
|
|
36
|
+
amount: number;
|
|
37
|
+
/**
|
|
38
|
+
* Payment currency. Possible values: `USD`, `EUR`, `UAH`
|
|
39
|
+
*/
|
|
40
|
+
currency: LiqPayCurrency;
|
|
41
|
+
/**
|
|
42
|
+
* Payment purpose
|
|
43
|
+
*/
|
|
44
|
+
description: string;
|
|
45
|
+
/**
|
|
46
|
+
* Unique purchase ID in your store. Maximum length __255__ characters
|
|
47
|
+
*/
|
|
48
|
+
order_id: string;
|
|
49
|
+
/**
|
|
50
|
+
* @group invoice lifetime
|
|
51
|
+
*/
|
|
52
|
+
/**
|
|
53
|
+
* The time by which the customer can pay the invoice in `UTC`. Transmitted in the format `2016-04-24 00:00:00`
|
|
54
|
+
*/
|
|
55
|
+
expired_date?: string;
|
|
56
|
+
/**
|
|
57
|
+
* @group checkout UI
|
|
58
|
+
*/
|
|
59
|
+
/**
|
|
60
|
+
* Client language: `uk`, `en`
|
|
61
|
+
*/
|
|
62
|
+
language?: LiqPayLanguage;
|
|
63
|
+
/**
|
|
64
|
+
* Parameter that transmits payment methods to be displayed at checkout.
|
|
65
|
+
* If the parameter is not provided, the store settings are applied. Possible values:
|
|
66
|
+
* - `apay` - Apple Pay
|
|
67
|
+
* - `gpay` - Google Pay
|
|
68
|
+
* - `card` - card payment
|
|
69
|
+
* - `privat24` - via Privat24 account
|
|
70
|
+
* - `moment_part` - installments
|
|
71
|
+
* - `paypart` - payment in parts
|
|
72
|
+
* - `cash` - cash
|
|
73
|
+
* - `invoice` - invoice to e-mail
|
|
74
|
+
* - `qr` - scanning a QR code
|
|
75
|
+
*/
|
|
76
|
+
paytypes?: LiqPayPaytype[];
|
|
77
|
+
/**
|
|
78
|
+
* @group checkout flow
|
|
79
|
+
*/
|
|
80
|
+
/**
|
|
81
|
+
* The URL in your store to which the buyer will be redirected after completing the purchase. Maximum length __510__ characters
|
|
82
|
+
*/
|
|
83
|
+
result_url?: string;
|
|
84
|
+
/**
|
|
85
|
+
* API URL in your store for notifications about payment status changes (`server -> server`). Maximum length __510__ characters.
|
|
86
|
+
*/
|
|
87
|
+
server_url?: string;
|
|
88
|
+
/**
|
|
89
|
+
* @group fiscalization
|
|
90
|
+
*/
|
|
91
|
+
/**
|
|
92
|
+
* Data for fiscalization
|
|
93
|
+
*/
|
|
94
|
+
rro_info?: LiqPayFiscalData;
|
|
95
|
+
/**
|
|
96
|
+
* @group sender
|
|
97
|
+
*/
|
|
98
|
+
/**
|
|
99
|
+
* Sender address
|
|
100
|
+
*/
|
|
101
|
+
sender_address?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Sender city
|
|
104
|
+
*/
|
|
105
|
+
sender_city?: string;
|
|
106
|
+
/**
|
|
107
|
+
* Sender country code. Numeric __ISO 3166-1__ code
|
|
108
|
+
*/
|
|
109
|
+
sender_country_code?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Sender first name
|
|
112
|
+
*/
|
|
113
|
+
sender_first_name?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Sender's last name
|
|
116
|
+
*/
|
|
117
|
+
sender_last_name?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Sender's postal code
|
|
120
|
+
*/
|
|
121
|
+
sender_postal_code?: string;
|
|
122
|
+
/**
|
|
123
|
+
* @group subscription
|
|
124
|
+
*/
|
|
125
|
+
/**
|
|
126
|
+
* Regular payment. Possible values: `1`
|
|
127
|
+
*/
|
|
128
|
+
subscribe?: '1';
|
|
129
|
+
/**
|
|
130
|
+
* Date of first payment. The time must be specified in the format `2015-03-31 00:00:00` in `UTC`. If the date is past, the subscription will be activated from the current date of receipt of the request
|
|
131
|
+
*/
|
|
132
|
+
subscribe_date_start?: string;
|
|
133
|
+
/**
|
|
134
|
+
* The frequency of funds write-off. Possible values:
|
|
135
|
+
* - `day` - daily
|
|
136
|
+
* - `week` - weekly
|
|
137
|
+
* - `month` - once a month
|
|
138
|
+
* - `year` - once a year, раз
|
|
139
|
+
*/
|
|
140
|
+
subscribe_periodicity?: LiqPaySubscribePeriodicity;
|
|
141
|
+
/**
|
|
142
|
+
* Payment with splitting the amount into several recipients. This parameter specifies a `JSON` array with payment splitting rules.
|
|
143
|
+
* One debit is made from the client and several credits are made to the recipients. If you need to transfer your purpose for each amount, use the `description` parameter.
|
|
144
|
+
* If you need to fiscalize payments for each recipient, add the `rro_info` object. The acquiring fee is charged for each recipient.
|
|
145
|
+
* @example
|
|
146
|
+
* ```json
|
|
147
|
+
* [
|
|
148
|
+
* {
|
|
149
|
+
* "public_key": "i000000001",
|
|
150
|
+
* "amount": 404,
|
|
151
|
+
* "commission_payer": "sender",
|
|
152
|
+
* "server_url": "https://server1/callback",
|
|
153
|
+
* "rro_info": {
|
|
154
|
+
* "items": [
|
|
155
|
+
* {
|
|
156
|
+
* "amount": 2, // quantity
|
|
157
|
+
* "price": 202, // unit price
|
|
158
|
+
* "cost": 404, // total cost
|
|
159
|
+
* "id": 123456 // product id
|
|
160
|
+
* }
|
|
161
|
+
* ],
|
|
162
|
+
* "delivery_emails": [
|
|
163
|
+
* "email1@email.com",
|
|
164
|
+
* "email2@email.com"
|
|
165
|
+
* ]
|
|
166
|
+
* }
|
|
167
|
+
* },
|
|
168
|
+
* {
|
|
169
|
+
* "public_key": "i000000002",
|
|
170
|
+
* "amount": 200,
|
|
171
|
+
* "commission_payer": "receiver",
|
|
172
|
+
* "server_url": "https://server2/callback"
|
|
173
|
+
* }
|
|
174
|
+
* ]
|
|
175
|
+
* ```
|
|
176
|
+
*/
|
|
177
|
+
split_rules?: LiqPaySplitRule[];
|
|
178
|
+
/**
|
|
179
|
+
* @group one-click payment / tokenization
|
|
180
|
+
*/
|
|
181
|
+
/**
|
|
182
|
+
* Unique client identifier on the merchant's website. When transmitting the parameter, LiqPay remembers the client's payment details and his identifier - further payment can be made in 1 click. Maximum length __100__ characters. (When using the parameter for __Masterpass 1 click__, a valid payer's phone number is transmitted in this field)
|
|
183
|
+
*/
|
|
184
|
+
customer?: string;
|
|
185
|
+
/**
|
|
186
|
+
* Allows you to generate a `card_token` of the payer, which you will receive in a callback request to `server_url`. `card_token` allows you to make payments without entering the payer's card details, using the token payment API - that is, in 1 click. To receive `card_token`, you must pass the value: `1` in the request
|
|
187
|
+
*/
|
|
188
|
+
recurringbytoken?: '1';
|
|
189
|
+
/**
|
|
190
|
+
* User ID in the merchant system, transmitted with each user payment (must not match `customer`, used for payment using the __Masterpass 1 click__ wallet)
|
|
191
|
+
*/
|
|
192
|
+
customer_user_id?: string;
|
|
193
|
+
/**
|
|
194
|
+
* @group product
|
|
195
|
+
*/
|
|
196
|
+
/**
|
|
197
|
+
* Product category. Maximum length `25` characters
|
|
198
|
+
*/
|
|
199
|
+
product_category?: string;
|
|
200
|
+
/**
|
|
201
|
+
* Product description. Maximum length `500` characters.
|
|
202
|
+
*/
|
|
203
|
+
product_description?: string;
|
|
204
|
+
/**
|
|
205
|
+
* Product name. Maximum length `100` characters.
|
|
206
|
+
*/
|
|
207
|
+
product_name?: string;
|
|
208
|
+
/**
|
|
209
|
+
* Product page address. Maximum length `510` characters
|
|
210
|
+
*/
|
|
211
|
+
product_url?: string;
|
|
212
|
+
/**
|
|
213
|
+
* @group metadata
|
|
214
|
+
*/
|
|
215
|
+
/**
|
|
216
|
+
* Information to add data to the payment. For example: `"External information for payments"`
|
|
217
|
+
*/
|
|
218
|
+
info?: string;
|
|
219
|
+
/**
|
|
220
|
+
* @group verification
|
|
221
|
+
*/
|
|
222
|
+
/**
|
|
223
|
+
* Possible value `Y`. Dynamic verification code, generated and returned in `Callback`. Similarly, the generated code will be passed in the verification transaction to be displayed in the client's card statement. Works for `action = auth`
|
|
224
|
+
*/
|
|
225
|
+
verifycode?: 'Y';
|
|
226
|
+
/**
|
|
227
|
+
* @group special (mcc 4511 / airline data)
|
|
228
|
+
*/
|
|
229
|
+
/**
|
|
230
|
+
* Long Detail Addenda entry. __Required for merchants with MCC 4511__.
|
|
231
|
+
*
|
|
232
|
+
* The `dae` parameter is a `JSON` string to which `base64` has been applied.
|
|
233
|
+
* It can contain the parameters given in the example below.
|
|
234
|
+
*/
|
|
235
|
+
dae?: LiqPayDetailAddenda;
|
|
236
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contract of data of Long Detail Addenda entry. __Required for merchants with MCC 4511__.
|
|
3
|
+
*/
|
|
4
|
+
export interface LiqPayDetailAddenda {
|
|
5
|
+
/**
|
|
6
|
+
* Airline abbreviation, max 4 characters
|
|
7
|
+
*/
|
|
8
|
+
airLine: string;
|
|
9
|
+
/**
|
|
10
|
+
* Reservation number (locator), max 15 characters
|
|
11
|
+
*/
|
|
12
|
+
ticketNumber: string;
|
|
13
|
+
/**
|
|
14
|
+
* Passenger name, max 29 characters
|
|
15
|
+
*/
|
|
16
|
+
passengerName: string;
|
|
17
|
+
/**
|
|
18
|
+
* Flight number, max 5 digits
|
|
19
|
+
*/
|
|
20
|
+
flightNumber: string;
|
|
21
|
+
/**
|
|
22
|
+
* Departure city/airport code, max 5 characters
|
|
23
|
+
*/
|
|
24
|
+
originCity: string;
|
|
25
|
+
/**
|
|
26
|
+
* Destination city/airport code, max 5 characters
|
|
27
|
+
*/
|
|
28
|
+
destinationCity: string;
|
|
29
|
+
/**
|
|
30
|
+
* Departure date in YYMMDD format, max 6 digits
|
|
31
|
+
*/
|
|
32
|
+
departureDate: string;
|
|
33
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base LiqPay request/response envelope
|
|
3
|
+
*
|
|
4
|
+
* Contains the payload as a stringified and encrypted JSON (`data`) and a cryptographic `signature`.
|
|
5
|
+
*/
|
|
6
|
+
export interface LiqPayEnvelope {
|
|
7
|
+
/**
|
|
8
|
+
* Stringified and encrypted payload
|
|
9
|
+
*/
|
|
10
|
+
data: string;
|
|
11
|
+
/**
|
|
12
|
+
* Signature for verifying payload integrity
|
|
13
|
+
*/
|
|
14
|
+
signature: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { LiqPayFiscalTax, LiqPayUnit } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Fiscalization data provided by ID contract
|
|
4
|
+
*/
|
|
5
|
+
export interface LiqPayFiscalData {
|
|
6
|
+
/**
|
|
7
|
+
* Data about the goods for which payment is made
|
|
8
|
+
*/
|
|
9
|
+
items?: LiqPayFiscalProductById[] | LiqPayFiscalProductByApi[];
|
|
10
|
+
/**
|
|
11
|
+
* List of e-mails to which receipts should be sent after fiscalization
|
|
12
|
+
*/
|
|
13
|
+
delivery_emails?: string[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Contract of data about the product for which payment is being made provided by ID
|
|
17
|
+
*/
|
|
18
|
+
export interface LiqPayFiscalProductById {
|
|
19
|
+
/**
|
|
20
|
+
* Quantity/volume
|
|
21
|
+
*/
|
|
22
|
+
amount: number;
|
|
23
|
+
/**
|
|
24
|
+
* The cost of all units of the specified product in the check (`quantity * unit_cost`)
|
|
25
|
+
*/
|
|
26
|
+
cost: number;
|
|
27
|
+
/**
|
|
28
|
+
* Product identifier. You can get it in your `Liqpay account - PPO - Cash register - Products`
|
|
29
|
+
*/
|
|
30
|
+
id: number;
|
|
31
|
+
/**
|
|
32
|
+
* Unit price of the product
|
|
33
|
+
*/
|
|
34
|
+
price: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Contract of data about the product for which payment is being made provided by API
|
|
38
|
+
*/
|
|
39
|
+
export interface LiqPayFiscalProductByApi {
|
|
40
|
+
/**
|
|
41
|
+
* Quantity/volume
|
|
42
|
+
*/
|
|
43
|
+
amount: number;
|
|
44
|
+
/**
|
|
45
|
+
* The cost of all units of the specified product in the check (`quantity * unit_cost`)
|
|
46
|
+
*/
|
|
47
|
+
cost: number;
|
|
48
|
+
/**
|
|
49
|
+
* Unit price of the product
|
|
50
|
+
*/
|
|
51
|
+
price: number;
|
|
52
|
+
/**
|
|
53
|
+
* Category name
|
|
54
|
+
*/
|
|
55
|
+
categoryname: string;
|
|
56
|
+
/**
|
|
57
|
+
* Product name
|
|
58
|
+
*/
|
|
59
|
+
name: string;
|
|
60
|
+
/**
|
|
61
|
+
* Unit of measure code
|
|
62
|
+
*/
|
|
63
|
+
unitcode: LiqPayUnit;
|
|
64
|
+
/**
|
|
65
|
+
* Digital value of the product barcode
|
|
66
|
+
*/
|
|
67
|
+
barcode?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Code according to the UKTZED directory
|
|
70
|
+
*/
|
|
71
|
+
codifier?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Internal product code
|
|
74
|
+
*/
|
|
75
|
+
vndcode?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Tax rate for the product
|
|
78
|
+
*/
|
|
79
|
+
taxs?: LiqPayFiscalTax[];
|
|
80
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contract of data that is passed when forming a request to receive payment status as data in `base64` encoded string form when calling the LiqPay API
|
|
3
|
+
*/
|
|
4
|
+
export interface LiqPayPaymentStatusRequest {
|
|
5
|
+
/**
|
|
6
|
+
* API version. Current version: `7`
|
|
7
|
+
*/
|
|
8
|
+
version: 7;
|
|
9
|
+
/**
|
|
10
|
+
* Public API key: ID of created company. Example: `i00000000`
|
|
11
|
+
*
|
|
12
|
+
* You can get the key in the store settings.
|
|
13
|
+
*/
|
|
14
|
+
public_key: string;
|
|
15
|
+
/**
|
|
16
|
+
* Operation type. Possible values: `status`
|
|
17
|
+
*/
|
|
18
|
+
action: 'status';
|
|
19
|
+
/**
|
|
20
|
+
* Unique purchase ID in your store. Maximum length __255__ characters
|
|
21
|
+
*/
|
|
22
|
+
order_id: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { LiqPayAction, LiqPayBonusType, LiqPayCurrency, LiqPayLanguage, LiqPayMpiEci, LiqPayPaymentStatus, LiqPayPaytype, LiqPayRequestResult } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Contract of data that comes in response to a request to get payment status
|
|
4
|
+
*/
|
|
5
|
+
export interface LiqPayPaymentStatusResponse {
|
|
6
|
+
/**
|
|
7
|
+
* Acquirer ID
|
|
8
|
+
*/
|
|
9
|
+
acq_id: number;
|
|
10
|
+
/**
|
|
11
|
+
* Transaction type. Possible values:
|
|
12
|
+
* - `pay` - payment
|
|
13
|
+
* - `hold` - blocking funds on the sender's account
|
|
14
|
+
* - `paysplit` - splitting the payment
|
|
15
|
+
* - `subscribe` - creating a regular payment
|
|
16
|
+
* - `paydonate` - donation
|
|
17
|
+
* - `auth` - card pre-authorization
|
|
18
|
+
* - `regular` - regular payment
|
|
19
|
+
*/
|
|
20
|
+
action: LiqPayAction;
|
|
21
|
+
/**
|
|
22
|
+
* Agent commission in payment currency
|
|
23
|
+
*/
|
|
24
|
+
agent_commission: number;
|
|
25
|
+
/**
|
|
26
|
+
* Payment amount
|
|
27
|
+
*/
|
|
28
|
+
amount: number;
|
|
29
|
+
/**
|
|
30
|
+
* Sender bonus in debit payment currency
|
|
31
|
+
*/
|
|
32
|
+
amount_bonus: number;
|
|
33
|
+
/**
|
|
34
|
+
* Transaction amount credit in currency `currency_credit`
|
|
35
|
+
*/
|
|
36
|
+
amount_credit: number;
|
|
37
|
+
/**
|
|
38
|
+
* Amount of debit transaction in currency `currency_debit`
|
|
39
|
+
*/
|
|
40
|
+
amount_debit: number;
|
|
41
|
+
/**
|
|
42
|
+
* Authorization code for credit transaction
|
|
43
|
+
*/
|
|
44
|
+
authcode_credit: string;
|
|
45
|
+
/**
|
|
46
|
+
* Authorization code for debit transaction
|
|
47
|
+
*/
|
|
48
|
+
authcode_debit: string;
|
|
49
|
+
/**
|
|
50
|
+
* Discount amount in percentage
|
|
51
|
+
*/
|
|
52
|
+
bonus_procent: number;
|
|
53
|
+
/**
|
|
54
|
+
* Bonus type, possible values: `bonusplus`, `discount_club`, `personal`, `promo`
|
|
55
|
+
*/
|
|
56
|
+
bonus_type: LiqPayBonusType;
|
|
57
|
+
/**
|
|
58
|
+
* Sender card token
|
|
59
|
+
*/
|
|
60
|
+
card_token: string;
|
|
61
|
+
/**
|
|
62
|
+
* Recipient fee in `currency_credit` currency
|
|
63
|
+
*/
|
|
64
|
+
commission_credit: number;
|
|
65
|
+
/**
|
|
66
|
+
* Sender fee in `currency_debit`
|
|
67
|
+
*/
|
|
68
|
+
commission_debit: number;
|
|
69
|
+
/**
|
|
70
|
+
* Payer's phone. An OTP payment confirmation password was sent to this number and the payer's LiqPay account was linked. The phone number is indicated in the international format (Ukraine `+380`). For example: +380950000001 (with +) or 380950000001 (without +)
|
|
71
|
+
*/
|
|
72
|
+
confirm_phone: string;
|
|
73
|
+
/**
|
|
74
|
+
* Payment creation date
|
|
75
|
+
*/
|
|
76
|
+
create_date: Date;
|
|
77
|
+
/**
|
|
78
|
+
* Payment currency
|
|
79
|
+
*/
|
|
80
|
+
currency: LiqPayCurrency;
|
|
81
|
+
/**
|
|
82
|
+
* Transaction currency credit
|
|
83
|
+
*/
|
|
84
|
+
currency_credit: LiqPayCurrency;
|
|
85
|
+
/**
|
|
86
|
+
* Transaction currency debit
|
|
87
|
+
*/
|
|
88
|
+
currency_debit: LiqPayCurrency;
|
|
89
|
+
/**
|
|
90
|
+
* Payment comment
|
|
91
|
+
*/
|
|
92
|
+
description: string;
|
|
93
|
+
/**
|
|
94
|
+
* Payment completion/change date
|
|
95
|
+
*/
|
|
96
|
+
end_date: Date;
|
|
97
|
+
/**
|
|
98
|
+
* Additional payment information
|
|
99
|
+
*/
|
|
100
|
+
info: string;
|
|
101
|
+
/**
|
|
102
|
+
* Sender IP address
|
|
103
|
+
*/
|
|
104
|
+
ip: string;
|
|
105
|
+
/**
|
|
106
|
+
* Possible values: `true` - the transaction went through with 3DS verification, `false` - the transaction went through without 3DS verification
|
|
107
|
+
*/
|
|
108
|
+
is_3ds: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Client language: `uk`, `en`
|
|
111
|
+
*/
|
|
112
|
+
language: LiqPayLanguage;
|
|
113
|
+
/**
|
|
114
|
+
* `Order_id` of payment in the LiqPay system
|
|
115
|
+
*/
|
|
116
|
+
liqpay_order_id: string;
|
|
117
|
+
/**
|
|
118
|
+
* Payment in installments sign
|
|
119
|
+
*/
|
|
120
|
+
moment_part: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Represents whether 3D-Secure verification was performed during payment by code value. Possible values:
|
|
123
|
+
* - `5` - the transaction was completed with 3DS (the issuer and acquirer support 3D-Secure technology)
|
|
124
|
+
* - `6` - the payer's card issuer does not support 3D-Secure technology
|
|
125
|
+
* - `7` - the transaction was completed without 3D-Secure
|
|
126
|
+
*/
|
|
127
|
+
mpi_eci: LiqPayMpiEci;
|
|
128
|
+
/**
|
|
129
|
+
* Payment `Order_id`
|
|
130
|
+
*/
|
|
131
|
+
order_id: string;
|
|
132
|
+
/**
|
|
133
|
+
* Payment ID in the LiqPay system
|
|
134
|
+
*/
|
|
135
|
+
payment_id: number;
|
|
136
|
+
/**
|
|
137
|
+
* Payment method. Possible values:
|
|
138
|
+
* - `card` - payment by card
|
|
139
|
+
* - `privat24` - through the Privat24 account
|
|
140
|
+
* - `moment_part` - installment
|
|
141
|
+
* - `invoice` - invoice to e-mail
|
|
142
|
+
* - `qr` - scan qr code
|
|
143
|
+
*/
|
|
144
|
+
paytype: LiqPayPaytype;
|
|
145
|
+
/**
|
|
146
|
+
* Store public key
|
|
147
|
+
*/
|
|
148
|
+
public_key: string;
|
|
149
|
+
/**
|
|
150
|
+
* Recipient fee in payment currency
|
|
151
|
+
*/
|
|
152
|
+
receiver_commission: number;
|
|
153
|
+
/**
|
|
154
|
+
* Result of query execution: `ok`, `error`
|
|
155
|
+
*/
|
|
156
|
+
result: LiqPayRequestResult;
|
|
157
|
+
/**
|
|
158
|
+
* Unique transaction number in the authorization and settlement system of the servicing bank `Retrieval Reference number`
|
|
159
|
+
*/
|
|
160
|
+
rrn_credit: string;
|
|
161
|
+
/**
|
|
162
|
+
* Unique transaction number in the authorization and settlement system of the servicing bank `Retrieval Reference number`
|
|
163
|
+
*/
|
|
164
|
+
rrn_debit: string;
|
|
165
|
+
/**
|
|
166
|
+
* Sender bonus in payment currency
|
|
167
|
+
*/
|
|
168
|
+
sender_bonus: number;
|
|
169
|
+
/**
|
|
170
|
+
* Sender's bank
|
|
171
|
+
*/
|
|
172
|
+
sender_card_bank: string;
|
|
173
|
+
/**
|
|
174
|
+
* Country of the sender's card. Numeric __ISO 3166-1__ code
|
|
175
|
+
*/
|
|
176
|
+
sender_card_country: string;
|
|
177
|
+
/**
|
|
178
|
+
* Sender's card
|
|
179
|
+
*/
|
|
180
|
+
sender_card_mask2: string;
|
|
181
|
+
/**
|
|
182
|
+
* Sender's IBAN
|
|
183
|
+
*/
|
|
184
|
+
sender_iban: string;
|
|
185
|
+
/**
|
|
186
|
+
* Sender's card type MC/Visa
|
|
187
|
+
*/
|
|
188
|
+
sender_card_type: string;
|
|
189
|
+
/**
|
|
190
|
+
* Sender's fee in payment currency
|
|
191
|
+
*/
|
|
192
|
+
sender_commission: number;
|
|
193
|
+
/**
|
|
194
|
+
* Sender's first name
|
|
195
|
+
*/
|
|
196
|
+
sender_first_name: string;
|
|
197
|
+
/**
|
|
198
|
+
* Sender's last name
|
|
199
|
+
*/
|
|
200
|
+
sender_last_name: string;
|
|
201
|
+
/**
|
|
202
|
+
* Sender's phone number
|
|
203
|
+
*/
|
|
204
|
+
sender_phone: string;
|
|
205
|
+
/**
|
|
206
|
+
* Payment status
|
|
207
|
+
*/
|
|
208
|
+
status: LiqPayPaymentStatus;
|
|
209
|
+
/**
|
|
210
|
+
* 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
|
|
211
|
+
*/
|
|
212
|
+
wait_reserve_status?: boolean;
|
|
213
|
+
/**
|
|
214
|
+
* Transaction ID in the LiqPay system
|
|
215
|
+
*/
|
|
216
|
+
transaction_id: number;
|
|
217
|
+
/**
|
|
218
|
+
* Payment type
|
|
219
|
+
*/
|
|
220
|
+
type: string;
|
|
221
|
+
/**
|
|
222
|
+
* API version. Current value is `7`
|
|
223
|
+
*/
|
|
224
|
+
version: 7;
|
|
225
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { LiqPayFiscalData } from './fiscal-data';
|
|
2
|
+
import { LiqPayCommisionPayer } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Payment splitting options contract
|
|
5
|
+
*/
|
|
6
|
+
export interface LiqPaySplitRule {
|
|
7
|
+
/**
|
|
8
|
+
* Public API key: ID of created company. Example: `i00000000`
|
|
9
|
+
*
|
|
10
|
+
* You can get the key in the store settings.
|
|
11
|
+
*/
|
|
12
|
+
public_key: string;
|
|
13
|
+
/**
|
|
14
|
+
* Total payment amount. For example: `5`, `7.34`
|
|
15
|
+
*/
|
|
16
|
+
amount: number;
|
|
17
|
+
/**
|
|
18
|
+
* Payer of the acquiring fee. Possible values: `sender`, `receiver`
|
|
19
|
+
*/
|
|
20
|
+
commission_payer: LiqPayCommisionPayer;
|
|
21
|
+
/**
|
|
22
|
+
* API URL in your store for notifications about payment status changes (`server -> server`). Maximum length __510__ characters.
|
|
23
|
+
*/
|
|
24
|
+
server_url: string;
|
|
25
|
+
/**
|
|
26
|
+
* Data on fiscalization of payments for each recipient
|
|
27
|
+
*/
|
|
28
|
+
rro_info?: LiqPayFiscalData;
|
|
29
|
+
}
|