@hypay/typescript-sdk 1.0.0
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/LICENSE +21 -0
- package/README.md +735 -0
- package/dist/chunk-LKIXYEBZ.mjs +103 -0
- package/dist/helpers-T6ONVODW.mjs +30 -0
- package/dist/index.d.mts +1363 -0
- package/dist/index.d.ts +1363 -0
- package/dist/index.js +1227 -0
- package/dist/index.mjs +1067 -0
- package/package.json +52 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1363 @@
|
|
|
1
|
+
interface HypayConfig {
|
|
2
|
+
/** Terminal number in Hypay (10 digits). Starts with 00100 for test terminals. */
|
|
3
|
+
masof: string;
|
|
4
|
+
/** API key from terminal settings */
|
|
5
|
+
apiKey: string;
|
|
6
|
+
/** Password authentication value */
|
|
7
|
+
passP?: string;
|
|
8
|
+
/** Base URL override (defaults to https://pay.hyp.co.il/p/) */
|
|
9
|
+
baseUrl?: string;
|
|
10
|
+
/** HTTP request timeout in milliseconds (default: 30000) */
|
|
11
|
+
timeout?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Custom fetch implementation. Defaults to globalThis.fetch.
|
|
14
|
+
* Useful for injecting a custom HTTP client (e.g., undici, node-fetch, or test mocks).
|
|
15
|
+
*/
|
|
16
|
+
fetch?: typeof globalThis.fetch;
|
|
17
|
+
/**
|
|
18
|
+
* Lifecycle hooks for logging, metrics, and debugging.
|
|
19
|
+
*/
|
|
20
|
+
hooks?: HypayHooks;
|
|
21
|
+
}
|
|
22
|
+
interface HypayHooks {
|
|
23
|
+
/** Called before every HTTP request */
|
|
24
|
+
onRequest?: (context: RequestContext) => void | Promise<void>;
|
|
25
|
+
/** Called after every HTTP response */
|
|
26
|
+
onResponse?: (context: ResponseContext) => void | Promise<void>;
|
|
27
|
+
/** Called when an error occurs */
|
|
28
|
+
onError?: (error: HypayError, context: RequestContext) => void | Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
interface RequestContext {
|
|
31
|
+
/** The action being performed (e.g., "soft", "getToken", "APISign") */
|
|
32
|
+
action: string;
|
|
33
|
+
/** HTTP method used */
|
|
34
|
+
method: "GET" | "POST";
|
|
35
|
+
/** Full request URL (for GET) or base URL (for POST) */
|
|
36
|
+
url: string;
|
|
37
|
+
/** Request parameters (serialized) */
|
|
38
|
+
params: Record<string, string>;
|
|
39
|
+
}
|
|
40
|
+
interface ResponseContext extends RequestContext {
|
|
41
|
+
/** HTTP status code */
|
|
42
|
+
statusCode: number;
|
|
43
|
+
/** Raw response text */
|
|
44
|
+
raw: string;
|
|
45
|
+
/** Parsed response parameters */
|
|
46
|
+
parsedParams: Record<string, string>;
|
|
47
|
+
/** Request duration in milliseconds */
|
|
48
|
+
durationMs: number;
|
|
49
|
+
}
|
|
50
|
+
declare enum Coin {
|
|
51
|
+
ILS = 1,
|
|
52
|
+
USD = 2,
|
|
53
|
+
EUR = 3,
|
|
54
|
+
GBP = 4
|
|
55
|
+
}
|
|
56
|
+
declare enum PageLang {
|
|
57
|
+
HEB = "HEB",
|
|
58
|
+
ENG = "ENG"
|
|
59
|
+
}
|
|
60
|
+
declare enum TashType {
|
|
61
|
+
Regular = 1,
|
|
62
|
+
Credit = 6
|
|
63
|
+
}
|
|
64
|
+
declare enum Bank {
|
|
65
|
+
Isracard = 1,
|
|
66
|
+
VisaCal = 2,
|
|
67
|
+
Diners = 3,
|
|
68
|
+
Amex = 4,
|
|
69
|
+
MAX = 6,
|
|
70
|
+
BIT = 99
|
|
71
|
+
}
|
|
72
|
+
declare enum Brand {
|
|
73
|
+
PL = 0,
|
|
74
|
+
MasterCard = 1,
|
|
75
|
+
Visa = 2,
|
|
76
|
+
Diners = 3,
|
|
77
|
+
Amex = 4,
|
|
78
|
+
Isracard = 5
|
|
79
|
+
}
|
|
80
|
+
declare enum Issuer {
|
|
81
|
+
Foreign = 0,
|
|
82
|
+
Isracard = 1,
|
|
83
|
+
VisaCal = 2,
|
|
84
|
+
JCB = 5,
|
|
85
|
+
MAX = 6
|
|
86
|
+
}
|
|
87
|
+
declare enum HKNewStatus {
|
|
88
|
+
Terminate = 1,
|
|
89
|
+
Activate = 2
|
|
90
|
+
}
|
|
91
|
+
declare enum SpecialCardType {
|
|
92
|
+
Default = "00",
|
|
93
|
+
Immediate = "01",
|
|
94
|
+
Club = "70",
|
|
95
|
+
PetrolCard = "03",
|
|
96
|
+
DualCard = "04",
|
|
97
|
+
DualClub = "74",
|
|
98
|
+
PetrolClub = "75",
|
|
99
|
+
Chargeable = "06",
|
|
100
|
+
Petrol = "08",
|
|
101
|
+
Tourist = "99"
|
|
102
|
+
}
|
|
103
|
+
interface ClientData {
|
|
104
|
+
/** Client ID (9 digits, send 000000000 if not required) */
|
|
105
|
+
UserId: string;
|
|
106
|
+
/** Client first name */
|
|
107
|
+
ClientName: string;
|
|
108
|
+
/** Client last name */
|
|
109
|
+
ClientLName?: string;
|
|
110
|
+
/** Street name and house number */
|
|
111
|
+
street?: string;
|
|
112
|
+
/** City name */
|
|
113
|
+
city?: string;
|
|
114
|
+
/** Zip code */
|
|
115
|
+
zip?: string;
|
|
116
|
+
/** Phone number */
|
|
117
|
+
phone?: string;
|
|
118
|
+
/** Cell number */
|
|
119
|
+
cell?: string;
|
|
120
|
+
/** Client email */
|
|
121
|
+
email?: string;
|
|
122
|
+
}
|
|
123
|
+
interface InvoiceParams {
|
|
124
|
+
/** Send invoice in email */
|
|
125
|
+
SendHesh?: boolean;
|
|
126
|
+
/** Invoice description or items string */
|
|
127
|
+
heshDesc?: string;
|
|
128
|
+
/** Invoice description contains items */
|
|
129
|
+
Pritim?: boolean;
|
|
130
|
+
/** Block transaction if item totals don't match Amount */
|
|
131
|
+
blockItemValidation?: boolean;
|
|
132
|
+
/** Invoice language: "he" or "en" */
|
|
133
|
+
"EZ.lang"?: string;
|
|
134
|
+
/** Additional text in email body */
|
|
135
|
+
"EZ.email_text"?: string;
|
|
136
|
+
/** Additional text in invoice body */
|
|
137
|
+
"EZ.comment"?: string;
|
|
138
|
+
/** CC emails (comma-separated, max 10) */
|
|
139
|
+
"EZ.cc_emails"?: string;
|
|
140
|
+
/** Invoice VAT rate (default 0.18, 1 = 1.00, 0 = 0.00) */
|
|
141
|
+
"EZ.vat"?: number;
|
|
142
|
+
/** Additional description in invoice header */
|
|
143
|
+
"EZ.description"?: string;
|
|
144
|
+
/** Customer company number/ID (BN Number). Required by law when > 5,000 ILS */
|
|
145
|
+
"EZ.customer_crn"?: string;
|
|
146
|
+
/** Create original documents in English/foreign currency (default 0) */
|
|
147
|
+
"EZ.create_org_as_foreign"?: 0 | 1;
|
|
148
|
+
}
|
|
149
|
+
interface InvoiceItem {
|
|
150
|
+
/** Item code for bookkeeping (use "0" if unavailable) */
|
|
151
|
+
code: string;
|
|
152
|
+
/** Description of the item */
|
|
153
|
+
description: string;
|
|
154
|
+
/** Quantity */
|
|
155
|
+
quantity: number;
|
|
156
|
+
/** Price per item (including VAT) */
|
|
157
|
+
price: number;
|
|
158
|
+
}
|
|
159
|
+
interface PayPageParams extends ClientData, InvoiceParams {
|
|
160
|
+
/** Transaction information (displayed in reports) */
|
|
161
|
+
Info: string;
|
|
162
|
+
/** Purchase amount. If omitted, the client will be asked to type an amount (donations). */
|
|
163
|
+
Amount?: number;
|
|
164
|
+
/** Internal field for the website owner (returned to success page, not saved in Hypay) */
|
|
165
|
+
Order?: string;
|
|
166
|
+
/** Max number of payments selectable by the customer */
|
|
167
|
+
Tash?: number;
|
|
168
|
+
/** Payment type: regular (1) or credit (6) */
|
|
169
|
+
tashType?: TashType;
|
|
170
|
+
/** Fix payments to a fixed number (requires Tash) */
|
|
171
|
+
FixTash?: boolean;
|
|
172
|
+
/** Send payment confirmation by email */
|
|
173
|
+
sendemail?: boolean;
|
|
174
|
+
/** Different first payment amount */
|
|
175
|
+
TashFirstPayment?: number;
|
|
176
|
+
/** Return more data on the transaction (Bank, Brand, Issuer, L4digit, etc.) */
|
|
177
|
+
MoreData?: boolean;
|
|
178
|
+
/** Set 20-minute timeout on payment page (recommended) */
|
|
179
|
+
pageTimeOut?: boolean;
|
|
180
|
+
/** Payment page language */
|
|
181
|
+
PageLang?: PageLang;
|
|
182
|
+
/** Template number (1-15+) */
|
|
183
|
+
tmp?: number;
|
|
184
|
+
/** Billing currency */
|
|
185
|
+
Coin?: Coin;
|
|
186
|
+
/** Delayed transaction - code 800 */
|
|
187
|
+
Postpone?: boolean;
|
|
188
|
+
/**
|
|
189
|
+
* Preserving line of credit.
|
|
190
|
+
* - `true` = J5: preserve credit line for 3 days without cancel option
|
|
191
|
+
* - `"J2"` = check card credibility without checking credit line
|
|
192
|
+
*/
|
|
193
|
+
J5?: boolean | "J2";
|
|
194
|
+
/** Show Tash text in English */
|
|
195
|
+
ShowEngTashText?: boolean;
|
|
196
|
+
/** Data encoded in UTF-8 */
|
|
197
|
+
UTF8?: boolean;
|
|
198
|
+
/** Return answer in UTF-8 */
|
|
199
|
+
UTF8out?: boolean;
|
|
200
|
+
/** Sign sent parameters in the response */
|
|
201
|
+
Sign?: boolean;
|
|
202
|
+
/** Hide payment buttons (Apple Pay, Google Pay, Bit) on the payment page */
|
|
203
|
+
hideBtns?: boolean;
|
|
204
|
+
}
|
|
205
|
+
interface PayPageSubscriptionParams extends PayPageParams {
|
|
206
|
+
/** Pay Page in HK (standing order/subscription) mode */
|
|
207
|
+
HK: true;
|
|
208
|
+
/** Payment frequency in months */
|
|
209
|
+
freq?: number;
|
|
210
|
+
/** First payment date (YYYY-MM-DD) */
|
|
211
|
+
FirstDate?: string;
|
|
212
|
+
/** Number of payments (999 for unlimited) */
|
|
213
|
+
Tash: number;
|
|
214
|
+
/** Only close deal if first payment is approved */
|
|
215
|
+
OnlyOnApprove?: boolean;
|
|
216
|
+
/** Amount of a single initial transaction */
|
|
217
|
+
TashFirstPayment?: number;
|
|
218
|
+
/** Number of charges for the initial single transaction */
|
|
219
|
+
FirstPaymentTash?: number;
|
|
220
|
+
}
|
|
221
|
+
interface APISignResponse {
|
|
222
|
+
/** The full signed query string including the signature parameter */
|
|
223
|
+
raw: string;
|
|
224
|
+
/** The signature value */
|
|
225
|
+
signature: string;
|
|
226
|
+
/** Parsed key-value pairs from the response */
|
|
227
|
+
params: Record<string, string>;
|
|
228
|
+
}
|
|
229
|
+
interface VerifyParams {
|
|
230
|
+
/** Transaction ID */
|
|
231
|
+
Id: string;
|
|
232
|
+
/** Credit card company answer code */
|
|
233
|
+
CCode: string;
|
|
234
|
+
/** Amount charged */
|
|
235
|
+
Amount: string;
|
|
236
|
+
/** Confirmation code */
|
|
237
|
+
ACode: string;
|
|
238
|
+
/** Internal field */
|
|
239
|
+
Order?: string;
|
|
240
|
+
/** Client first and last name */
|
|
241
|
+
Fild1?: string;
|
|
242
|
+
/** Client email */
|
|
243
|
+
Fild2?: string;
|
|
244
|
+
/** Client phone */
|
|
245
|
+
Fild3?: string;
|
|
246
|
+
/** Signature from the success page */
|
|
247
|
+
Sign?: string;
|
|
248
|
+
/** Additional MoreData fields */
|
|
249
|
+
Bank?: string;
|
|
250
|
+
Payments?: string;
|
|
251
|
+
UserId?: string;
|
|
252
|
+
Brand?: string;
|
|
253
|
+
Issuer?: string;
|
|
254
|
+
L4digit?: string;
|
|
255
|
+
street?: string;
|
|
256
|
+
city?: string;
|
|
257
|
+
zip?: string;
|
|
258
|
+
cell?: string;
|
|
259
|
+
Coin?: string;
|
|
260
|
+
Tmonth?: string;
|
|
261
|
+
Tyear?: string;
|
|
262
|
+
Hesh?: string;
|
|
263
|
+
errMsg?: string;
|
|
264
|
+
/** Catch-all for any additional parameters */
|
|
265
|
+
[key: string]: string | undefined;
|
|
266
|
+
}
|
|
267
|
+
interface VerifyResponse {
|
|
268
|
+
/** Whether the verification succeeded (CCode === "0") */
|
|
269
|
+
verified: boolean;
|
|
270
|
+
/** CCode from the verify response */
|
|
271
|
+
CCode: string;
|
|
272
|
+
/** Raw response string */
|
|
273
|
+
raw: string;
|
|
274
|
+
/** Parsed parameters */
|
|
275
|
+
params: Record<string, string>;
|
|
276
|
+
}
|
|
277
|
+
/** Standard Soft request with token/credit card details */
|
|
278
|
+
interface SoftTokenParams extends ClientData, InvoiceParams {
|
|
279
|
+
/** Token number (19 digits) or credit card number */
|
|
280
|
+
CC: string;
|
|
281
|
+
/** Month credit card validity (MM) */
|
|
282
|
+
Tmonth: string;
|
|
283
|
+
/** Year credit card validity (YYYY) */
|
|
284
|
+
Tyear: string;
|
|
285
|
+
/** Transaction information */
|
|
286
|
+
Info: string;
|
|
287
|
+
/** Purchase amount */
|
|
288
|
+
Amount: number;
|
|
289
|
+
/** Number of installments */
|
|
290
|
+
Tash?: number;
|
|
291
|
+
/** Payment type */
|
|
292
|
+
tashType?: TashType;
|
|
293
|
+
/** Different first payment amount */
|
|
294
|
+
TashFirstPayment?: number;
|
|
295
|
+
/** Billing currency */
|
|
296
|
+
Coin?: Coin;
|
|
297
|
+
/** Delayed transaction */
|
|
298
|
+
Postpone?: boolean;
|
|
299
|
+
/** Making a deal with token (required when CC is a token) */
|
|
300
|
+
Token?: boolean;
|
|
301
|
+
/** Terminal owner of the token (requires special authorization) */
|
|
302
|
+
tOwner?: string;
|
|
303
|
+
/** Preserving line of credit */
|
|
304
|
+
J5?: boolean | "J2";
|
|
305
|
+
/** Confirmation number for reuse */
|
|
306
|
+
AuthNum?: string;
|
|
307
|
+
/** CVV (not saved, required if terminal demands it) */
|
|
308
|
+
cvv?: string;
|
|
309
|
+
/** Data encoded in UTF-8 */
|
|
310
|
+
UTF8?: boolean;
|
|
311
|
+
/** Return answer in UTF-8 */
|
|
312
|
+
UTF8out?: boolean;
|
|
313
|
+
/** Return more data */
|
|
314
|
+
MoreData?: boolean;
|
|
315
|
+
/** Send payment confirmation by email */
|
|
316
|
+
sendemail?: boolean;
|
|
317
|
+
/** Send invoice by SMS (requires SMS package) */
|
|
318
|
+
sendHeshSMS?: boolean;
|
|
319
|
+
/** Free text fields (returned, not saved in Hypay) */
|
|
320
|
+
Fild1?: string;
|
|
321
|
+
Fild2?: string;
|
|
322
|
+
Fild3?: string;
|
|
323
|
+
/** Internal field for website owner (not saved in Hypay) */
|
|
324
|
+
Order?: string;
|
|
325
|
+
/** Refund password (for PAYout refund transactions) */
|
|
326
|
+
zPass?: string;
|
|
327
|
+
}
|
|
328
|
+
/** Soft request with WalletToken (Apple Pay / Google Pay) - replaces CC, Tmonth, Tyear */
|
|
329
|
+
interface SoftWalletParams extends ClientData, InvoiceParams {
|
|
330
|
+
/** Wallet token JSON from Apple Pay or Google Pay */
|
|
331
|
+
WalletToken: string;
|
|
332
|
+
/** Transaction information */
|
|
333
|
+
Info: string;
|
|
334
|
+
/** Purchase amount */
|
|
335
|
+
Amount: number;
|
|
336
|
+
/** Number of installments */
|
|
337
|
+
Tash?: number;
|
|
338
|
+
/** Payment type */
|
|
339
|
+
tashType?: TashType;
|
|
340
|
+
/** Different first payment amount */
|
|
341
|
+
TashFirstPayment?: number;
|
|
342
|
+
/** Billing currency */
|
|
343
|
+
Coin?: Coin;
|
|
344
|
+
/** Delayed transaction */
|
|
345
|
+
Postpone?: boolean;
|
|
346
|
+
/** Preserving line of credit */
|
|
347
|
+
J5?: boolean | "J2";
|
|
348
|
+
/** CVV */
|
|
349
|
+
cvv?: string;
|
|
350
|
+
/** Data encoded in UTF-8 */
|
|
351
|
+
UTF8?: boolean;
|
|
352
|
+
/** Return answer in UTF-8 */
|
|
353
|
+
UTF8out?: boolean;
|
|
354
|
+
/** Return more data */
|
|
355
|
+
MoreData?: boolean;
|
|
356
|
+
/** Send payment confirmation by email */
|
|
357
|
+
sendemail?: boolean;
|
|
358
|
+
/** Send invoice by SMS */
|
|
359
|
+
sendHeshSMS?: boolean;
|
|
360
|
+
/** Free text fields */
|
|
361
|
+
Fild1?: string;
|
|
362
|
+
Fild2?: string;
|
|
363
|
+
Fild3?: string;
|
|
364
|
+
/** Internal field */
|
|
365
|
+
Order?: string;
|
|
366
|
+
}
|
|
367
|
+
/** Union type: either token-based or wallet-based soft request */
|
|
368
|
+
type SoftParams = SoftTokenParams | SoftWalletParams;
|
|
369
|
+
interface SoftResponse {
|
|
370
|
+
/** Transaction ID in Hypay */
|
|
371
|
+
Id: string;
|
|
372
|
+
/** Credit card company answer (0 = success) */
|
|
373
|
+
CCode: string;
|
|
374
|
+
/** Amount actually charged */
|
|
375
|
+
Amount: string;
|
|
376
|
+
/** Confirmation code from credit card company */
|
|
377
|
+
ACode: string;
|
|
378
|
+
/** Free text fields */
|
|
379
|
+
Fild1?: string;
|
|
380
|
+
Fild2?: string;
|
|
381
|
+
Fild3?: string;
|
|
382
|
+
/** Invoice number (returns "EZ" for EzCount) */
|
|
383
|
+
Hesh?: string;
|
|
384
|
+
/** UID for binding between transaction steps (e.g., J5 charge) */
|
|
385
|
+
UID?: string;
|
|
386
|
+
/** Error message from credit card company */
|
|
387
|
+
errMsg?: string;
|
|
388
|
+
/** Raw response string */
|
|
389
|
+
raw: string;
|
|
390
|
+
/** All parsed parameters (includes MoreData fields when MoreData=True) */
|
|
391
|
+
params: Record<string, string>;
|
|
392
|
+
}
|
|
393
|
+
/** All additional fields returned when MoreData=True in Soft/Pay responses */
|
|
394
|
+
interface MoreDataFields {
|
|
395
|
+
/** Acquirer: Isracard=1, VisaCal=2, Diners=3, Amex=4, MAX=6, BIT=99 */
|
|
396
|
+
Bank?: string;
|
|
397
|
+
/** Transaction type (Contactless, EMV, ApplePay, GooglePay, etc.) */
|
|
398
|
+
TransType?: string;
|
|
399
|
+
/** Number of payments charged */
|
|
400
|
+
Payments?: string;
|
|
401
|
+
/** Number of regular payments (excluding first) */
|
|
402
|
+
noKPayments?: string;
|
|
403
|
+
/** First payment amount */
|
|
404
|
+
nFirstPayment?: string;
|
|
405
|
+
/** First payment calculated */
|
|
406
|
+
firstPayment?: string;
|
|
407
|
+
/** Client ID */
|
|
408
|
+
UserId?: string;
|
|
409
|
+
/** Brand: PL=0, MasterCard=1, Visa=2, Diners=3, Amex=4, Isracard=5 */
|
|
410
|
+
Brand?: string;
|
|
411
|
+
/** Issuer: Isracard=1, VisaCal=2, JCB=5, MAX=6, Foreign=0 */
|
|
412
|
+
Issuer?: string;
|
|
413
|
+
/** Last 4 digits of credit card */
|
|
414
|
+
L4digit?: string;
|
|
415
|
+
/** Client first name */
|
|
416
|
+
firstname?: string;
|
|
417
|
+
/** Client last name */
|
|
418
|
+
lastname?: string;
|
|
419
|
+
/** Transaction info */
|
|
420
|
+
info?: string;
|
|
421
|
+
/** Street */
|
|
422
|
+
street?: string;
|
|
423
|
+
/** City */
|
|
424
|
+
city?: string;
|
|
425
|
+
/** Zip */
|
|
426
|
+
zip?: string;
|
|
427
|
+
/** Cell */
|
|
428
|
+
cell?: string;
|
|
429
|
+
/** Email */
|
|
430
|
+
email?: string;
|
|
431
|
+
/** Currency: 1=ILS, 2=USD, 3=EUR, 4=GBP */
|
|
432
|
+
Coin?: string;
|
|
433
|
+
/** Month credit card validity (MM) */
|
|
434
|
+
Tmonth?: string;
|
|
435
|
+
/** Year credit card validity (YYYY) */
|
|
436
|
+
Tyear?: string;
|
|
437
|
+
/** Invoice number */
|
|
438
|
+
Hesh?: string;
|
|
439
|
+
/** UID for future bindings */
|
|
440
|
+
UID?: string;
|
|
441
|
+
/** Special card type (00=default, 01=Immediate, 70=Club, etc.) */
|
|
442
|
+
spType?: string;
|
|
443
|
+
/** BIN - first 6 digits of payment card */
|
|
444
|
+
bincard?: string;
|
|
445
|
+
/** Card name (e.g., "(????) Cal") */
|
|
446
|
+
CardName?: string;
|
|
447
|
+
/** Payment type used */
|
|
448
|
+
tashType?: string;
|
|
449
|
+
/** TashFirstPayment returned */
|
|
450
|
+
TashFirstPayment?: string;
|
|
451
|
+
}
|
|
452
|
+
interface GetTokenParams {
|
|
453
|
+
/** Transaction number from a previous Pay/Soft transaction */
|
|
454
|
+
TransId: string;
|
|
455
|
+
/** Free text fields (returned, not saved) */
|
|
456
|
+
Fild1?: string;
|
|
457
|
+
Fild2?: string;
|
|
458
|
+
Fild3?: string;
|
|
459
|
+
/**
|
|
460
|
+
* Allow token from invalid transaction status.
|
|
461
|
+
* Must be True to get token from transactions with non-standard statuses.
|
|
462
|
+
*/
|
|
463
|
+
allowFalse?: boolean;
|
|
464
|
+
}
|
|
465
|
+
interface GetTokenResponse {
|
|
466
|
+
/** Transaction number */
|
|
467
|
+
Id: string;
|
|
468
|
+
/** Status code (0 = success) */
|
|
469
|
+
CCode: string;
|
|
470
|
+
/** Token number (19 digits) */
|
|
471
|
+
Token: string;
|
|
472
|
+
/** Credit card validity in YYMM format (save for future use) */
|
|
473
|
+
Tokef: string;
|
|
474
|
+
/** Parsed month from Tokef (MM) - convenience field */
|
|
475
|
+
Tmonth: string;
|
|
476
|
+
/** Parsed year from Tokef (YYYY) - convenience field */
|
|
477
|
+
Tyear: string;
|
|
478
|
+
/** Free text fields */
|
|
479
|
+
Fild1?: string;
|
|
480
|
+
Fild2?: string;
|
|
481
|
+
Fild3?: string;
|
|
482
|
+
/** Raw response string */
|
|
483
|
+
raw: string;
|
|
484
|
+
/** All parsed parameters */
|
|
485
|
+
params: Record<string, string>;
|
|
486
|
+
}
|
|
487
|
+
interface CommitTransParams {
|
|
488
|
+
/** Transaction ID to commit */
|
|
489
|
+
TransId: string;
|
|
490
|
+
/** Send invoice in email */
|
|
491
|
+
SendHesh?: boolean;
|
|
492
|
+
/** Invoice description */
|
|
493
|
+
heshDesc?: string;
|
|
494
|
+
/** Invoice contains items */
|
|
495
|
+
Pritim?: boolean;
|
|
496
|
+
/** Send invoice by SMS */
|
|
497
|
+
sendHeshSMS?: boolean;
|
|
498
|
+
/** Data encoded in UTF-8 */
|
|
499
|
+
UTF8?: boolean;
|
|
500
|
+
/** Return answer in UTF-8 */
|
|
501
|
+
UTF8out?: boolean;
|
|
502
|
+
}
|
|
503
|
+
interface CommitTransResponse {
|
|
504
|
+
/** Transaction ID */
|
|
505
|
+
Id: string;
|
|
506
|
+
/** Status code (0 = success, 250 = doesn't exist or already committed) */
|
|
507
|
+
CCode: string;
|
|
508
|
+
/** Invoice number created */
|
|
509
|
+
HeshASM?: string;
|
|
510
|
+
/** Free text fields */
|
|
511
|
+
Fild1?: string;
|
|
512
|
+
Fild2?: string;
|
|
513
|
+
Fild3?: string;
|
|
514
|
+
/** Raw response string */
|
|
515
|
+
raw: string;
|
|
516
|
+
/** All parsed parameters */
|
|
517
|
+
params: Record<string, string>;
|
|
518
|
+
}
|
|
519
|
+
interface CancelTransParams {
|
|
520
|
+
/** Transaction ID to cancel */
|
|
521
|
+
TransId: string;
|
|
522
|
+
}
|
|
523
|
+
interface CancelTransResponse {
|
|
524
|
+
/** Transaction ID */
|
|
525
|
+
TransId: string;
|
|
526
|
+
/** Status code (0 = success, 920 = doesn't exist or already committed) */
|
|
527
|
+
CCode: string;
|
|
528
|
+
/** Invoice number (returns "EZ" for EzCount) */
|
|
529
|
+
Hesh?: string;
|
|
530
|
+
/** Raw response string */
|
|
531
|
+
raw: string;
|
|
532
|
+
/** All parsed parameters */
|
|
533
|
+
params: Record<string, string>;
|
|
534
|
+
}
|
|
535
|
+
interface RefundParams {
|
|
536
|
+
/** Original transaction ID to refund */
|
|
537
|
+
TransId: string;
|
|
538
|
+
/** Refund amount (must not exceed original transaction amount) */
|
|
539
|
+
Amount: number;
|
|
540
|
+
/** Number of refund payments */
|
|
541
|
+
Tash?: number;
|
|
542
|
+
/** Send credit invoice in email */
|
|
543
|
+
SendHesh?: boolean;
|
|
544
|
+
/** Data encoded in UTF-8 */
|
|
545
|
+
UTF8?: boolean;
|
|
546
|
+
/** Return answer in UTF-8 */
|
|
547
|
+
UTF8out?: boolean;
|
|
548
|
+
}
|
|
549
|
+
interface RefundResponse {
|
|
550
|
+
/** New refund transaction ID in Hypay */
|
|
551
|
+
Id: string;
|
|
552
|
+
/** Status code (0 = success, 33 = amount exceeds original) */
|
|
553
|
+
CCode: string;
|
|
554
|
+
/** Confirmation code from credit card company */
|
|
555
|
+
ACode?: string;
|
|
556
|
+
/** Invoice number created */
|
|
557
|
+
HeshASM?: string;
|
|
558
|
+
/** Raw response string */
|
|
559
|
+
raw: string;
|
|
560
|
+
/** All parsed parameters */
|
|
561
|
+
params: Record<string, string>;
|
|
562
|
+
}
|
|
563
|
+
interface RefundByTokenParams extends ClientData, InvoiceParams {
|
|
564
|
+
/** Token number (19 digits) */
|
|
565
|
+
CC: string;
|
|
566
|
+
/** Month credit card validity (MM) */
|
|
567
|
+
Tmonth: string;
|
|
568
|
+
/** Year credit card validity (YYYY) */
|
|
569
|
+
Tyear: string;
|
|
570
|
+
/** Refund amount (positive number) */
|
|
571
|
+
Amount: number;
|
|
572
|
+
/** Transaction information */
|
|
573
|
+
Info: string;
|
|
574
|
+
/**
|
|
575
|
+
* Secret refund password (sent to terminal owner's cell phone).
|
|
576
|
+
* Non-interchangeable.
|
|
577
|
+
*/
|
|
578
|
+
zPass: string;
|
|
579
|
+
/** Making a deal with token */
|
|
580
|
+
Token?: boolean;
|
|
581
|
+
/** Internal field */
|
|
582
|
+
Order?: string;
|
|
583
|
+
/** Data encoded in UTF-8 */
|
|
584
|
+
UTF8?: boolean;
|
|
585
|
+
/** Return answer in UTF-8 */
|
|
586
|
+
UTF8out?: boolean;
|
|
587
|
+
/** CVV (if required by terminal) */
|
|
588
|
+
cvv?: string;
|
|
589
|
+
/** Send payment confirmation by email */
|
|
590
|
+
sendemail?: boolean;
|
|
591
|
+
}
|
|
592
|
+
interface HKStatusParams {
|
|
593
|
+
/** Agreement number */
|
|
594
|
+
HKId: string;
|
|
595
|
+
/** New status: 1 = Terminate, 2 = Activate */
|
|
596
|
+
NewStat: HKNewStatus;
|
|
597
|
+
}
|
|
598
|
+
interface HKStatusResponse {
|
|
599
|
+
/** Agreement number */
|
|
600
|
+
HKId: string;
|
|
601
|
+
/** Status code (0 = success, 905 = wrong param, 906 = agreement doesn't exist) */
|
|
602
|
+
CCode: string;
|
|
603
|
+
/** Raw response string */
|
|
604
|
+
raw: string;
|
|
605
|
+
/** All parsed parameters */
|
|
606
|
+
params: Record<string, string>;
|
|
607
|
+
}
|
|
608
|
+
interface PrintInvoiceParams {
|
|
609
|
+
/** Transaction ID of the wanted invoice (if passed, asm is not required) */
|
|
610
|
+
TransId?: string;
|
|
611
|
+
/** Invoice ID for printing */
|
|
612
|
+
asm?: string;
|
|
613
|
+
/**
|
|
614
|
+
* Invoice type:
|
|
615
|
+
* - `HTML`: Returns old-system invoice in HTML format
|
|
616
|
+
* - `PDF`: Returns digitally signed PDF (may take up to 20 min from transaction)
|
|
617
|
+
* - `EZCOUNT`: New EZCount system invoice
|
|
618
|
+
* - `NEW`: Prints all unprinted invoices in HTML
|
|
619
|
+
*/
|
|
620
|
+
type: "HTML" | "PDF" | "EZCOUNT" | "NEW";
|
|
621
|
+
/** True = authentic copy ("נאמן למקור"), False = copy ("העתק") */
|
|
622
|
+
HeshORCopy?: boolean;
|
|
623
|
+
}
|
|
624
|
+
interface OfflineInvoiceBaseParams extends ClientData, InvoiceParams {
|
|
625
|
+
/** Transaction information */
|
|
626
|
+
Info: string;
|
|
627
|
+
/** Total amount */
|
|
628
|
+
Amount: number;
|
|
629
|
+
/** Data encoded in UTF-8 */
|
|
630
|
+
UTF8?: boolean;
|
|
631
|
+
/** Return answer in UTF-8 */
|
|
632
|
+
UTF8out?: boolean;
|
|
633
|
+
}
|
|
634
|
+
interface CashInvoiceParams extends OfflineInvoiceBaseParams {
|
|
635
|
+
/** Transaction type */
|
|
636
|
+
TransType: "Cash";
|
|
637
|
+
}
|
|
638
|
+
interface CheckInvoiceParams extends OfflineInvoiceBaseParams {
|
|
639
|
+
/** Transaction type */
|
|
640
|
+
TransType: "Check";
|
|
641
|
+
/** Bank number */
|
|
642
|
+
Bank: string;
|
|
643
|
+
/** Branch number */
|
|
644
|
+
Snif: string;
|
|
645
|
+
/** Account number */
|
|
646
|
+
PAN: string;
|
|
647
|
+
/** Check number */
|
|
648
|
+
CheckNum: string;
|
|
649
|
+
/** Check date (YYYYMMDD) */
|
|
650
|
+
Date: string;
|
|
651
|
+
}
|
|
652
|
+
interface MultiCheckInvoiceParams extends OfflineInvoiceBaseParams {
|
|
653
|
+
/** Transaction type */
|
|
654
|
+
TransType: "Multi";
|
|
655
|
+
/** Bank numbers (comma-separated, use space for cash entries) */
|
|
656
|
+
Bank: string;
|
|
657
|
+
/** Branch numbers (comma-separated) */
|
|
658
|
+
Snif: string;
|
|
659
|
+
/** Account numbers (comma-separated) */
|
|
660
|
+
PAN: string;
|
|
661
|
+
/** Check numbers (comma-separated) */
|
|
662
|
+
CheckNum: string;
|
|
663
|
+
/** Check dates (comma-separated, YYYYMMDD format) */
|
|
664
|
+
Date: string;
|
|
665
|
+
/** Amounts per check (comma-separated) */
|
|
666
|
+
Amount: number;
|
|
667
|
+
}
|
|
668
|
+
type OfflineInvoiceParams = CashInvoiceParams | CheckInvoiceParams | MultiCheckInvoiceParams;
|
|
669
|
+
interface PaymentPageResponse {
|
|
670
|
+
/** Transaction ID in Hypay */
|
|
671
|
+
Id: string;
|
|
672
|
+
/** Credit card company answer (0 = success, 902 = verification error) */
|
|
673
|
+
CCode: string;
|
|
674
|
+
/** Amount charged */
|
|
675
|
+
Amount: string;
|
|
676
|
+
/** Confirmation code */
|
|
677
|
+
ACode: string;
|
|
678
|
+
/** Internal field (returned, not saved) */
|
|
679
|
+
Order?: string;
|
|
680
|
+
/** Client first and last name */
|
|
681
|
+
Fild1?: string;
|
|
682
|
+
/** Client email */
|
|
683
|
+
Fild2?: string;
|
|
684
|
+
/** Client phone */
|
|
685
|
+
Fild3?: string;
|
|
686
|
+
/** Signature (only when Sign=True was sent) */
|
|
687
|
+
Sign?: string;
|
|
688
|
+
/** HK agreement ID (only for subscription payments) */
|
|
689
|
+
HKId?: string;
|
|
690
|
+
/** Error message */
|
|
691
|
+
errMsg?: string;
|
|
692
|
+
/** All MoreData fields (when MoreData=True was sent) */
|
|
693
|
+
Bank?: string;
|
|
694
|
+
TransType?: string;
|
|
695
|
+
Payments?: string;
|
|
696
|
+
UserId?: string;
|
|
697
|
+
Brand?: string;
|
|
698
|
+
Issuer?: string;
|
|
699
|
+
L4digit?: string;
|
|
700
|
+
street?: string;
|
|
701
|
+
city?: string;
|
|
702
|
+
zip?: string;
|
|
703
|
+
cell?: string;
|
|
704
|
+
Coin?: string;
|
|
705
|
+
Tmonth?: string;
|
|
706
|
+
Tyear?: string;
|
|
707
|
+
Hesh?: string;
|
|
708
|
+
UID?: string;
|
|
709
|
+
spType?: string;
|
|
710
|
+
bincard?: string;
|
|
711
|
+
/** Catch-all */
|
|
712
|
+
[key: string]: string | undefined;
|
|
713
|
+
}
|
|
714
|
+
interface J5ChargeParams {
|
|
715
|
+
/** UID from the original J5 transaction response (MoreData=True required) */
|
|
716
|
+
"inputObj.originalUid": string;
|
|
717
|
+
/**
|
|
718
|
+
* Amount to charge in agorot (100 agorot = 1 ILS).
|
|
719
|
+
* Must be equal to or less than the original J5 transaction amount.
|
|
720
|
+
* Example: 500 = 5 ILS
|
|
721
|
+
*/
|
|
722
|
+
"inputObj.originalAmount": number;
|
|
723
|
+
/** ACode from the original J5 transaction response */
|
|
724
|
+
AuthNum: string;
|
|
725
|
+
/** Static SHVA parameter, always 7 */
|
|
726
|
+
"inputObj.authorizationCodeManpik": 7;
|
|
727
|
+
}
|
|
728
|
+
declare class HypayError extends Error {
|
|
729
|
+
/** CCode error number */
|
|
730
|
+
readonly code: string;
|
|
731
|
+
/** Full raw response */
|
|
732
|
+
readonly raw: string;
|
|
733
|
+
/** All parsed response parameters */
|
|
734
|
+
readonly params: Record<string, string>;
|
|
735
|
+
constructor(message: string, code: string, raw: string, params: Record<string, string>);
|
|
736
|
+
}
|
|
737
|
+
declare class HypayNetworkError extends Error {
|
|
738
|
+
/** The original cause */
|
|
739
|
+
readonly cause: unknown;
|
|
740
|
+
constructor(message: string, cause: unknown);
|
|
741
|
+
}
|
|
742
|
+
declare class HypayTimeoutError extends Error {
|
|
743
|
+
/** Timeout in milliseconds */
|
|
744
|
+
readonly timeoutMs: number;
|
|
745
|
+
constructor(timeoutMs: number);
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* The main client class for interacting with the Hypay API.
|
|
750
|
+
*
|
|
751
|
+
* @example
|
|
752
|
+
* ```ts
|
|
753
|
+
* const client = new HypayClient({
|
|
754
|
+
* masof: "your-masof",
|
|
755
|
+
* apiKey: "your-api-key",
|
|
756
|
+
* passP: "your-passp",
|
|
757
|
+
* });
|
|
758
|
+
* ```
|
|
759
|
+
*/
|
|
760
|
+
declare class HypayClient {
|
|
761
|
+
private readonly masof;
|
|
762
|
+
private readonly apiKey;
|
|
763
|
+
private readonly passP?;
|
|
764
|
+
private readonly baseUrl;
|
|
765
|
+
private readonly timeout;
|
|
766
|
+
private readonly fetchFn;
|
|
767
|
+
private readonly hooks;
|
|
768
|
+
constructor(config: HypayConfig);
|
|
769
|
+
/**
|
|
770
|
+
* Make a GET request to the Hypay API.
|
|
771
|
+
* All API calls use GET by default, which is the most common method for Hypay.
|
|
772
|
+
*/
|
|
773
|
+
private requestGet;
|
|
774
|
+
/**
|
|
775
|
+
* Make a POST request to the Hypay API.
|
|
776
|
+
* Use for actions that send large payloads (e.g., WalletToken with Apple Pay).
|
|
777
|
+
*/
|
|
778
|
+
private requestPost;
|
|
779
|
+
/**
|
|
780
|
+
* Unified request method. Defaults to GET, uses POST for wallet/large payloads.
|
|
781
|
+
*/
|
|
782
|
+
private request;
|
|
783
|
+
private authParams;
|
|
784
|
+
private throwIfError;
|
|
785
|
+
/**
|
|
786
|
+
* **Step 1** — Sign payment page parameters (APISign + What=SIGN).
|
|
787
|
+
*
|
|
788
|
+
* This generates a `signature` that must be appended to the payment page URL.
|
|
789
|
+
* The signature prevents parameter tampering on the client side.
|
|
790
|
+
*
|
|
791
|
+
* Requires "Verify by signature in the payment page" enabled in terminal settings.
|
|
792
|
+
*
|
|
793
|
+
* @example
|
|
794
|
+
* ```ts
|
|
795
|
+
* const result = await client.sign({
|
|
796
|
+
* Info: "Order #123",
|
|
797
|
+
* Amount: 100,
|
|
798
|
+
* UserId: "203269535",
|
|
799
|
+
* ClientName: "Israel",
|
|
800
|
+
* Coin: Coin.ILS,
|
|
801
|
+
* Sign: true,
|
|
802
|
+
* UTF8: true,
|
|
803
|
+
* UTF8out: true,
|
|
804
|
+
* MoreData: true,
|
|
805
|
+
* });
|
|
806
|
+
* console.log(result.signature);
|
|
807
|
+
* ```
|
|
808
|
+
*/
|
|
809
|
+
sign(params: PayPageParams | PayPageSubscriptionParams): Promise<APISignResponse>;
|
|
810
|
+
/**
|
|
811
|
+
* **Step 2** — Build the full payment page URL from a signed query string.
|
|
812
|
+
*
|
|
813
|
+
* @param signedQueryString - The raw result from `sign()`.
|
|
814
|
+
*/
|
|
815
|
+
buildPaymentPageUrl(signedQueryString: string): string;
|
|
816
|
+
/**
|
|
817
|
+
* **Steps 1 + 2 combined** — Sign parameters and return the full payment page URL.
|
|
818
|
+
*
|
|
819
|
+
* @example
|
|
820
|
+
* ```ts
|
|
821
|
+
* const url = await client.createPaymentPageUrl({
|
|
822
|
+
* Info: "Order #123",
|
|
823
|
+
* Amount: 100,
|
|
824
|
+
* UserId: "203269535",
|
|
825
|
+
* ClientName: "Israel",
|
|
826
|
+
* Coin: Coin.ILS,
|
|
827
|
+
* Sign: true,
|
|
828
|
+
* UTF8: true,
|
|
829
|
+
* UTF8out: true,
|
|
830
|
+
* });
|
|
831
|
+
* // Redirect the customer to `url`
|
|
832
|
+
* ```
|
|
833
|
+
*/
|
|
834
|
+
createPaymentPageUrl(params: PayPageParams | PayPageSubscriptionParams): Promise<string>;
|
|
835
|
+
/**
|
|
836
|
+
* **Step 4** — Verify a transaction using parameters from the success page.
|
|
837
|
+
*
|
|
838
|
+
* Takes the query parameters from the success/failure redirect URL and verifies
|
|
839
|
+
* them against the Hypay server. Returns `verified: true` when `CCode === "0"`,
|
|
840
|
+
* `CCode === "902"` means verification failed.
|
|
841
|
+
*
|
|
842
|
+
* Requires "Verify by signature in the payment page" enabled in terminal settings.
|
|
843
|
+
*
|
|
844
|
+
* @example
|
|
845
|
+
* ```ts
|
|
846
|
+
* import { parseRedirectUrl } from "@hypay/typescript-sdk";
|
|
847
|
+
*
|
|
848
|
+
* const successParams = parseRedirectUrl(req.url);
|
|
849
|
+
* const result = await client.verify(successParams);
|
|
850
|
+
*
|
|
851
|
+
* if (result.verified) {
|
|
852
|
+
* // Transaction is legitimate — process the order
|
|
853
|
+
* } else {
|
|
854
|
+
* // Verification failed — do not process
|
|
855
|
+
* }
|
|
856
|
+
* ```
|
|
857
|
+
*/
|
|
858
|
+
verify(params: VerifyParams): Promise<VerifyResponse>;
|
|
859
|
+
/**
|
|
860
|
+
* Convenience method: parse a success page URL and verify it in one call.
|
|
861
|
+
*
|
|
862
|
+
* @example
|
|
863
|
+
* ```ts
|
|
864
|
+
* const result = await client.verifyRedirectUrl(
|
|
865
|
+
* "https://yoursite.com/success?Id=123&CCode=0&Amount=10&..."
|
|
866
|
+
* );
|
|
867
|
+
* if (result.verified) { /* OK *\/ }
|
|
868
|
+
* ```
|
|
869
|
+
*/
|
|
870
|
+
verifyRedirectUrl(redirectUrl: string): Promise<VerifyResponse>;
|
|
871
|
+
/**
|
|
872
|
+
* Execute a server-side transaction using the Soft protocol.
|
|
873
|
+
*
|
|
874
|
+
* Used for:
|
|
875
|
+
* - Token-based charges (after obtaining a token via `getToken()`)
|
|
876
|
+
* - Apple Pay / Google Pay via WalletToken
|
|
877
|
+
* - Direct credit card charges (PCI-compliant environments)
|
|
878
|
+
*
|
|
879
|
+
* Automatically uses POST for WalletToken requests (large payload).
|
|
880
|
+
*
|
|
881
|
+
* @throws {HypayError} When CCode indicates an error
|
|
882
|
+
*
|
|
883
|
+
* @example
|
|
884
|
+
* ```ts
|
|
885
|
+
* // Token-based transaction
|
|
886
|
+
* const result = await client.soft({
|
|
887
|
+
* CC: "1315872608557940000",
|
|
888
|
+
* Tmonth: "04",
|
|
889
|
+
* Tyear: "2025",
|
|
890
|
+
* Amount: 50,
|
|
891
|
+
* Info: "Subscription renewal",
|
|
892
|
+
* UserId: "203269535",
|
|
893
|
+
* ClientName: "Israel",
|
|
894
|
+
* Token: true,
|
|
895
|
+
* MoreData: true,
|
|
896
|
+
* UTF8: true,
|
|
897
|
+
* UTF8out: true,
|
|
898
|
+
* });
|
|
899
|
+
* ```
|
|
900
|
+
*
|
|
901
|
+
* @example
|
|
902
|
+
* ```ts
|
|
903
|
+
* // Apple Pay / Google Pay
|
|
904
|
+
* const result = await client.soft({
|
|
905
|
+
* WalletToken: walletTokenJson,
|
|
906
|
+
* Amount: 100,
|
|
907
|
+
* Info: "Purchase",
|
|
908
|
+
* UserId: "203269535",
|
|
909
|
+
* ClientName: "Israel",
|
|
910
|
+
* });
|
|
911
|
+
* ```
|
|
912
|
+
*/
|
|
913
|
+
soft(params: SoftParams): Promise<SoftResponse>;
|
|
914
|
+
/**
|
|
915
|
+
* Obtain a token for a previously completed transaction.
|
|
916
|
+
*
|
|
917
|
+
* The token (19 digits) replaces credit card information for future Soft transactions.
|
|
918
|
+
* The transaction must be in one of these statuses: Approved (0), 600, 700, 800, 998.
|
|
919
|
+
*
|
|
920
|
+
* **Important:** Save the Tokef (card validity) and customer details (UserId, etc.)
|
|
921
|
+
* as they are NOT stored in Hypay servers.
|
|
922
|
+
*
|
|
923
|
+
* The response includes convenience fields `Tmonth` and `Tyear` parsed from `Tokef`.
|
|
924
|
+
*
|
|
925
|
+
* @throws {HypayError} When CCode indicates an error (901, 902, 910, 990)
|
|
926
|
+
*
|
|
927
|
+
* @example
|
|
928
|
+
* ```ts
|
|
929
|
+
* const token = await client.getToken({ TransId: "12788261" });
|
|
930
|
+
*
|
|
931
|
+
* // Save for future charges:
|
|
932
|
+
* // token.Token = "1315872608557940000"
|
|
933
|
+
* // token.Tmonth = "04"
|
|
934
|
+
* // token.Tyear = "2025"
|
|
935
|
+
*
|
|
936
|
+
* // Use in a soft transaction:
|
|
937
|
+
* await client.soft({
|
|
938
|
+
* CC: token.Token,
|
|
939
|
+
* Tmonth: token.Tmonth,
|
|
940
|
+
* Tyear: token.Tyear,
|
|
941
|
+
* Token: true,
|
|
942
|
+
* Amount: 50,
|
|
943
|
+
* Info: "Charge via token",
|
|
944
|
+
* UserId: "203269535",
|
|
945
|
+
* ClientName: "Israel",
|
|
946
|
+
* });
|
|
947
|
+
* ```
|
|
948
|
+
*/
|
|
949
|
+
getToken(params: GetTokenParams): Promise<GetTokenResponse>;
|
|
950
|
+
/**
|
|
951
|
+
* Charge a J5 (credit line reservation) transaction.
|
|
952
|
+
*
|
|
953
|
+
* When a Pay/Soft request was made with `J5=True` and `MoreData=True`,
|
|
954
|
+
* you can later charge the reserved amount using the UID and ACode from the response.
|
|
955
|
+
*
|
|
956
|
+
* **If charge amount <= original J5 amount:** use this method (soft + additional params).
|
|
957
|
+
* **If charge amount > original J5 amount:** use the regular token flow instead.
|
|
958
|
+
*
|
|
959
|
+
* @param tokenParams - Standard Soft token parameters (CC, Tmonth, Tyear, etc.)
|
|
960
|
+
* @param j5Params - J5-specific parameters (originalUid, originalAmount, AuthNum)
|
|
961
|
+
*
|
|
962
|
+
* @throws {HypayError} When CCode indicates an error
|
|
963
|
+
*
|
|
964
|
+
* @example
|
|
965
|
+
* ```ts
|
|
966
|
+
* const result = await client.chargeJ5(
|
|
967
|
+
* {
|
|
968
|
+
* CC: token.Token,
|
|
969
|
+
* Tmonth: token.Tmonth,
|
|
970
|
+
* Tyear: token.Tyear,
|
|
971
|
+
* Token: true,
|
|
972
|
+
* Amount: 50,
|
|
973
|
+
* Info: "J5 charge",
|
|
974
|
+
* UserId: "203269535",
|
|
975
|
+
* ClientName: "Israel",
|
|
976
|
+
* },
|
|
977
|
+
* {
|
|
978
|
+
* "inputObj.originalUid": originalResponse.UID,
|
|
979
|
+
* "inputObj.originalAmount": 5000, // 50 ILS in agorot
|
|
980
|
+
* AuthNum: originalResponse.ACode,
|
|
981
|
+
* "inputObj.authorizationCodeManpik": 7,
|
|
982
|
+
* }
|
|
983
|
+
* );
|
|
984
|
+
* ```
|
|
985
|
+
*/
|
|
986
|
+
chargeJ5(tokenParams: SoftTokenParams, j5Params: J5ChargeParams): Promise<SoftResponse>;
|
|
987
|
+
/**
|
|
988
|
+
* Commit a postponed transaction (CCode 800).
|
|
989
|
+
*
|
|
990
|
+
* Postponed transactions should be committed within 72 hours.
|
|
991
|
+
* If not committed, leave at status 800 (do not cancel).
|
|
992
|
+
*
|
|
993
|
+
* @throws {HypayError} When CCode indicates an error (250 = doesn't exist / already committed)
|
|
994
|
+
*
|
|
995
|
+
* @example
|
|
996
|
+
* ```ts
|
|
997
|
+
* const result = await client.commitTransaction({
|
|
998
|
+
* TransId: "5343635",
|
|
999
|
+
* SendHesh: true,
|
|
1000
|
+
* heshDesc: "Payment for order 1234",
|
|
1001
|
+
* UTF8: true,
|
|
1002
|
+
* UTF8out: true,
|
|
1003
|
+
* });
|
|
1004
|
+
* console.log(result.HeshASM); // Invoice number
|
|
1005
|
+
* ```
|
|
1006
|
+
*/
|
|
1007
|
+
commitTransaction(params: CommitTransParams): Promise<CommitTransResponse>;
|
|
1008
|
+
/**
|
|
1009
|
+
* Cancel a transaction.
|
|
1010
|
+
*
|
|
1011
|
+
* **Rules:**
|
|
1012
|
+
* - Only on the same day, before 23:20 (before SHVA deposit)
|
|
1013
|
+
* - Cancelled transactions CANNOT be restored
|
|
1014
|
+
* - No cost to the business (transaction won't be presented to credit card companies)
|
|
1015
|
+
* - If invoice module is active, a credit memo will be issued
|
|
1016
|
+
*
|
|
1017
|
+
* @throws {HypayError} When CCode indicates an error (920 = doesn't exist / already committed)
|
|
1018
|
+
*
|
|
1019
|
+
* @example
|
|
1020
|
+
* ```ts
|
|
1021
|
+
* const result = await client.cancelTransaction({ TransId: "5890796" });
|
|
1022
|
+
* console.log(result.CCode); // "0" = success
|
|
1023
|
+
* ```
|
|
1024
|
+
*/
|
|
1025
|
+
cancelTransaction(params: CancelTransParams): Promise<CancelTransResponse>;
|
|
1026
|
+
/**
|
|
1027
|
+
* Refund a transaction by its original transaction ID (zikoyAPI).
|
|
1028
|
+
*
|
|
1029
|
+
* **Rules:**
|
|
1030
|
+
* - Refund amount must not exceed the original transaction amount
|
|
1031
|
+
* - Can be done at any stage, even after 23:00
|
|
1032
|
+
* - A credit refund is like a new deal for the credit card company
|
|
1033
|
+
* - Does NOT require a token or the secret refund password
|
|
1034
|
+
*
|
|
1035
|
+
* @throws {HypayError} When CCode indicates an error (33 = amount exceeds original)
|
|
1036
|
+
*
|
|
1037
|
+
* @example
|
|
1038
|
+
* ```ts
|
|
1039
|
+
* const result = await client.refund({
|
|
1040
|
+
* TransId: "12290620",
|
|
1041
|
+
* Amount: 10,
|
|
1042
|
+
* Tash: 1,
|
|
1043
|
+
* SendHesh: true,
|
|
1044
|
+
* UTF8: true,
|
|
1045
|
+
* UTF8out: true,
|
|
1046
|
+
* });
|
|
1047
|
+
* console.log(`Refund ID: ${result.Id}`);
|
|
1048
|
+
* ```
|
|
1049
|
+
*/
|
|
1050
|
+
refund(params: RefundParams): Promise<RefundResponse>;
|
|
1051
|
+
/**
|
|
1052
|
+
* Refund a transaction using a token and the secret refund password (PAYout).
|
|
1053
|
+
*
|
|
1054
|
+
* This uses the Soft protocol with the `zPass` parameter.
|
|
1055
|
+
* The refund password is sent to the terminal owner's cell phone and is non-interchangeable.
|
|
1056
|
+
*
|
|
1057
|
+
* @throws {HypayError} When CCode indicates an error
|
|
1058
|
+
*
|
|
1059
|
+
* @example
|
|
1060
|
+
* ```ts
|
|
1061
|
+
* const result = await client.refundByToken({
|
|
1062
|
+
* CC: "6907500685494032346",
|
|
1063
|
+
* Tmonth: "04",
|
|
1064
|
+
* Tyear: "2023",
|
|
1065
|
+
* Amount: 2,
|
|
1066
|
+
* Info: "Refund for order 123",
|
|
1067
|
+
* zPass: "1234",
|
|
1068
|
+
* Token: true,
|
|
1069
|
+
* UserId: "000000000",
|
|
1070
|
+
* ClientName: "Israel",
|
|
1071
|
+
* SendHesh: true,
|
|
1072
|
+
* sendemail: true,
|
|
1073
|
+
* });
|
|
1074
|
+
* ```
|
|
1075
|
+
*/
|
|
1076
|
+
refundByToken(params: RefundByTokenParams): Promise<SoftResponse>;
|
|
1077
|
+
/**
|
|
1078
|
+
* Create a subscription (HK / standing order) payment page URL.
|
|
1079
|
+
*
|
|
1080
|
+
* This is a convenience wrapper around `createPaymentPageUrl` with HK-specific params.
|
|
1081
|
+
*
|
|
1082
|
+
* @example
|
|
1083
|
+
* ```ts
|
|
1084
|
+
* const url = await client.createSubscriptionUrl({
|
|
1085
|
+
* Info: "Monthly subscription",
|
|
1086
|
+
* Amount: 120,
|
|
1087
|
+
* HK: true,
|
|
1088
|
+
* Tash: 999, // Unlimited payments
|
|
1089
|
+
* freq: 1, // Monthly
|
|
1090
|
+
* FirstDate: "2025-06-01",
|
|
1091
|
+
* OnlyOnApprove: true,
|
|
1092
|
+
* UserId: "203269535",
|
|
1093
|
+
* ClientName: "Israel",
|
|
1094
|
+
* email: "customer@example.com",
|
|
1095
|
+
* Coin: Coin.ILS,
|
|
1096
|
+
* UTF8: true,
|
|
1097
|
+
* UTF8out: true,
|
|
1098
|
+
* Sign: true,
|
|
1099
|
+
* MoreData: true,
|
|
1100
|
+
* });
|
|
1101
|
+
* ```
|
|
1102
|
+
*/
|
|
1103
|
+
createSubscriptionUrl(params: PayPageSubscriptionParams): Promise<string>;
|
|
1104
|
+
/**
|
|
1105
|
+
* Create a subscription with an initial transaction of a different amount.
|
|
1106
|
+
*
|
|
1107
|
+
* @example
|
|
1108
|
+
* ```ts
|
|
1109
|
+
* const url = await client.createSubscriptionWithInitialPayment({
|
|
1110
|
+
* Info: "Plan with setup fee",
|
|
1111
|
+
* Amount: 120, // Monthly amount
|
|
1112
|
+
* HK: true,
|
|
1113
|
+
* Tash: 999,
|
|
1114
|
+
* freq: 1,
|
|
1115
|
+
* TashFirstPayment: 50, // Setup fee
|
|
1116
|
+
* FirstPaymentTash: 3, // Charge setup fee for 3 months
|
|
1117
|
+
* FixTash: true,
|
|
1118
|
+
* OnlyOnApprove: true,
|
|
1119
|
+
* UserId: "203269535",
|
|
1120
|
+
* ClientName: "Israel",
|
|
1121
|
+
* Coin: Coin.ILS,
|
|
1122
|
+
* UTF8: true,
|
|
1123
|
+
* UTF8out: true,
|
|
1124
|
+
* Sign: true,
|
|
1125
|
+
* MoreData: true,
|
|
1126
|
+
* });
|
|
1127
|
+
* ```
|
|
1128
|
+
*/
|
|
1129
|
+
createSubscriptionWithInitialPayment(params: PayPageSubscriptionParams): Promise<string>;
|
|
1130
|
+
/**
|
|
1131
|
+
* Change the status of a standing order (HK) agreement.
|
|
1132
|
+
*
|
|
1133
|
+
* @throws {HypayError} When CCode indicates an error (905 = wrong param, 906 = not found)
|
|
1134
|
+
*
|
|
1135
|
+
* @example
|
|
1136
|
+
* ```ts
|
|
1137
|
+
* // Terminate
|
|
1138
|
+
* await client.updateHKStatus({
|
|
1139
|
+
* HKId: "64239",
|
|
1140
|
+
* NewStat: HKNewStatus.Terminate,
|
|
1141
|
+
* });
|
|
1142
|
+
*
|
|
1143
|
+
* // Reactivate
|
|
1144
|
+
* await client.updateHKStatus({
|
|
1145
|
+
* HKId: "64239",
|
|
1146
|
+
* NewStat: HKNewStatus.Activate,
|
|
1147
|
+
* });
|
|
1148
|
+
* ```
|
|
1149
|
+
*/
|
|
1150
|
+
updateHKStatus(params: HKStatusParams): Promise<HKStatusResponse>;
|
|
1151
|
+
/**
|
|
1152
|
+
* Terminate a standing order agreement. Shorthand for `updateHKStatus`.
|
|
1153
|
+
*/
|
|
1154
|
+
terminateSubscription(hkId: string): Promise<HKStatusResponse>;
|
|
1155
|
+
/**
|
|
1156
|
+
* Activate a standing order agreement. Shorthand for `updateHKStatus`.
|
|
1157
|
+
*/
|
|
1158
|
+
activateSubscription(hkId: string): Promise<HKStatusResponse>;
|
|
1159
|
+
/**
|
|
1160
|
+
* Generate a signed URL for printing/viewing an EzCount invoice.
|
|
1161
|
+
*
|
|
1162
|
+
* Uses a two-step process:
|
|
1163
|
+
* 1. Sign the request with APISign (What=SIGN, ACTION=PrintHesh)
|
|
1164
|
+
* 2. Build the final URL from the signed response
|
|
1165
|
+
*
|
|
1166
|
+
* **Note:** `ACTION=PrintHesh` is uppercase, `action=APISign` is lowercase.
|
|
1167
|
+
*
|
|
1168
|
+
* @example
|
|
1169
|
+
* ```ts
|
|
1170
|
+
* const url = await client.getInvoiceUrl({
|
|
1171
|
+
* TransId: "55373520",
|
|
1172
|
+
* type: "EZCOUNT",
|
|
1173
|
+
* });
|
|
1174
|
+
* // Redirect user or fetch the invoice PDF
|
|
1175
|
+
* ```
|
|
1176
|
+
*/
|
|
1177
|
+
getInvoiceUrl(params: PrintInvoiceParams): Promise<string>;
|
|
1178
|
+
/**
|
|
1179
|
+
* Create an invoice for an offline transaction (Cash, Check, or Multi-check).
|
|
1180
|
+
*
|
|
1181
|
+
* Uses the Soft protocol with the `TransType` parameter.
|
|
1182
|
+
*
|
|
1183
|
+
* @throws {HypayError} When CCode indicates an error
|
|
1184
|
+
*
|
|
1185
|
+
* @example
|
|
1186
|
+
* ```ts
|
|
1187
|
+
* // Cash invoice
|
|
1188
|
+
* const result = await client.createOfflineInvoice({
|
|
1189
|
+
* TransType: "Cash",
|
|
1190
|
+
* Info: "Cash payment",
|
|
1191
|
+
* Amount: 200,
|
|
1192
|
+
* UserId: "203269535",
|
|
1193
|
+
* ClientName: "Israel",
|
|
1194
|
+
* email: "customer@example.com",
|
|
1195
|
+
* Pritim: true,
|
|
1196
|
+
* heshDesc: "[001~Product A~2~50][002~Product B~1~100]",
|
|
1197
|
+
* SendHesh: true,
|
|
1198
|
+
* UTF8: true,
|
|
1199
|
+
* UTF8out: true,
|
|
1200
|
+
* });
|
|
1201
|
+
* ```
|
|
1202
|
+
*
|
|
1203
|
+
* @example
|
|
1204
|
+
* ```ts
|
|
1205
|
+
* // Check invoice
|
|
1206
|
+
* const result = await client.createOfflineInvoice({
|
|
1207
|
+
* TransType: "Check",
|
|
1208
|
+
* Info: "Check payment",
|
|
1209
|
+
* Amount: 200,
|
|
1210
|
+
* Bank: "10",
|
|
1211
|
+
* Snif: "912",
|
|
1212
|
+
* PAN: "1234456",
|
|
1213
|
+
* CheckNum: "11111111",
|
|
1214
|
+
* Date: "20250211",
|
|
1215
|
+
* UserId: "203269535",
|
|
1216
|
+
* ClientName: "Israel",
|
|
1217
|
+
* SendHesh: true,
|
|
1218
|
+
* UTF8: true,
|
|
1219
|
+
* UTF8out: true,
|
|
1220
|
+
* });
|
|
1221
|
+
* ```
|
|
1222
|
+
*/
|
|
1223
|
+
createOfflineInvoice(params: OfflineInvoiceParams): Promise<SoftResponse>;
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
/**
|
|
1227
|
+
* Parse a URL-encoded query string (key=value&key2=value2) into a Record.
|
|
1228
|
+
* Handles edge cases: empty strings, missing values, encoded characters.
|
|
1229
|
+
*/
|
|
1230
|
+
declare function parseQueryString(qs: string): Record<string, string>;
|
|
1231
|
+
/**
|
|
1232
|
+
* Convert a Record to a URL-encoded query string.
|
|
1233
|
+
* Skips undefined values.
|
|
1234
|
+
*/
|
|
1235
|
+
declare function toQueryString(params: Record<string, string | number | boolean | undefined>): string;
|
|
1236
|
+
/**
|
|
1237
|
+
* Convert boolean values to "True"/"False" strings as expected by the Hypay API.
|
|
1238
|
+
* Passes through strings and numbers unchanged. Filters undefined.
|
|
1239
|
+
*/
|
|
1240
|
+
declare function serializeParams(params: Record<string, unknown>): Record<string, string | number | boolean | undefined>;
|
|
1241
|
+
/**
|
|
1242
|
+
* Parse a success/failure page redirect URL into its query parameters.
|
|
1243
|
+
*
|
|
1244
|
+
* @example
|
|
1245
|
+
* const params = parseRedirectUrl(
|
|
1246
|
+
* "https://example.com/success?Id=123&CCode=0&Amount=10&ACode=0012345"
|
|
1247
|
+
* );
|
|
1248
|
+
* // { Id: "123", CCode: "0", Amount: "10", ACode: "0012345" }
|
|
1249
|
+
*/
|
|
1250
|
+
declare function parseRedirectUrl(url: string): Record<string, string>;
|
|
1251
|
+
/**
|
|
1252
|
+
* Parse a success/failure page redirect URL into a typed PaymentPageResponse.
|
|
1253
|
+
*
|
|
1254
|
+
* @example
|
|
1255
|
+
* const response = parsePaymentPageResponse(
|
|
1256
|
+
* "https://example.com/success?Id=123&CCode=0&Amount=10&ACode=0012345&Fild1=John"
|
|
1257
|
+
* );
|
|
1258
|
+
* console.log(response.Id); // "123"
|
|
1259
|
+
* console.log(response.CCode); // "0"
|
|
1260
|
+
*/
|
|
1261
|
+
declare function parsePaymentPageResponse(url: string): PaymentPageResponse;
|
|
1262
|
+
/**
|
|
1263
|
+
* Parse a Tokef value (YYMM format) into separate Tmonth and Tyear values
|
|
1264
|
+
* as required by the Soft protocol.
|
|
1265
|
+
*
|
|
1266
|
+
* @example
|
|
1267
|
+
* parseTokef("2504"); // { Tmonth: "04", Tyear: "2025" }
|
|
1268
|
+
* parseTokef("3112"); // { Tmonth: "12", Tyear: "2031" }
|
|
1269
|
+
*/
|
|
1270
|
+
declare function parseTokef(tokef: string): {
|
|
1271
|
+
Tmonth: string;
|
|
1272
|
+
Tyear: string;
|
|
1273
|
+
};
|
|
1274
|
+
/**
|
|
1275
|
+
* Build the heshDesc items string for EzCount invoices.
|
|
1276
|
+
*
|
|
1277
|
+
* Each item is formatted as: [code~description~quantity~price]
|
|
1278
|
+
*
|
|
1279
|
+
* **Important:** The total (sum of quantity * price for each item) must match
|
|
1280
|
+
* the Amount parameter, otherwise CCode=16 is returned. If blockItemValidation=True
|
|
1281
|
+
* is set, CCode=400 is returned instead.
|
|
1282
|
+
*
|
|
1283
|
+
* @example
|
|
1284
|
+
* buildItemsString([
|
|
1285
|
+
* { code: "0", description: "Item 1", quantity: 1, price: 8 },
|
|
1286
|
+
* { code: "0", description: "Item 2", quantity: 2, price: 1 },
|
|
1287
|
+
* ]);
|
|
1288
|
+
* // "[0~Item 1~1~8][0~Item 2~2~1]" (total = 10)
|
|
1289
|
+
*/
|
|
1290
|
+
declare function buildItemsString(items: InvoiceItem[]): string;
|
|
1291
|
+
/**
|
|
1292
|
+
* Calculate the total amount from a list of invoice items.
|
|
1293
|
+
* Useful for validating that items match the Amount parameter before sending.
|
|
1294
|
+
*
|
|
1295
|
+
* @example
|
|
1296
|
+
* calculateItemsTotal([
|
|
1297
|
+
* { code: "0", description: "Item 1", quantity: 1, price: 8 },
|
|
1298
|
+
* { code: "0", description: "Item 2", quantity: 2, price: 1 },
|
|
1299
|
+
* ]);
|
|
1300
|
+
* // 10
|
|
1301
|
+
*/
|
|
1302
|
+
declare function calculateItemsTotal(items: InvoiceItem[]): number;
|
|
1303
|
+
/**
|
|
1304
|
+
* Validate a Masof (terminal number) format.
|
|
1305
|
+
* Must be exactly 10 digits. Starts with 00100 for test terminals.
|
|
1306
|
+
*/
|
|
1307
|
+
declare function isValidMasof(masof: string): boolean;
|
|
1308
|
+
/**
|
|
1309
|
+
* Check if a Masof is a test terminal (starts with 00100).
|
|
1310
|
+
*/
|
|
1311
|
+
declare function isTestMasof(masof: string): boolean;
|
|
1312
|
+
/**
|
|
1313
|
+
* Validate a token format. Must be exactly 19 digits.
|
|
1314
|
+
*/
|
|
1315
|
+
declare function isValidToken(token: string): boolean;
|
|
1316
|
+
/**
|
|
1317
|
+
* Validate an email format (basic check).
|
|
1318
|
+
* Note: The Hypay API does NOT validate email format.
|
|
1319
|
+
*/
|
|
1320
|
+
declare function isValidEmail(email: string): boolean;
|
|
1321
|
+
/**
|
|
1322
|
+
* Validate Israeli ID number (Teudat Zehut) using the Luhn-like algorithm.
|
|
1323
|
+
* Returns true for valid IDs, or for the special test values (000000000, 890108558).
|
|
1324
|
+
*/
|
|
1325
|
+
declare function isValidIsraeliId(id: string): boolean;
|
|
1326
|
+
|
|
1327
|
+
/**
|
|
1328
|
+
* Mapping of Hypay-specific error codes (201-999) to their English descriptions.
|
|
1329
|
+
*/
|
|
1330
|
+
declare const HYPAY_ERROR_CODES: Record<string, string>;
|
|
1331
|
+
/**
|
|
1332
|
+
* Shva EMV error codes (000-777).
|
|
1333
|
+
* Errors 0-200 are from Shva (the Israeli credit card clearing house).
|
|
1334
|
+
*/
|
|
1335
|
+
declare const SHVA_ERROR_CODES: Record<string, string>;
|
|
1336
|
+
/**
|
|
1337
|
+
* Combined error codes lookup (Hypay + Shva).
|
|
1338
|
+
*/
|
|
1339
|
+
declare const ALL_ERROR_CODES: Record<string, string>;
|
|
1340
|
+
/**
|
|
1341
|
+
* Look up the description for a CCode value from all known error codes.
|
|
1342
|
+
* Returns the description if known, or a generic message.
|
|
1343
|
+
*/
|
|
1344
|
+
declare function getErrorMessage(ccode: string): string;
|
|
1345
|
+
/**
|
|
1346
|
+
* Check whether a CCode indicates a successful/valid response.
|
|
1347
|
+
* Codes 0, 600, 700, and 800 are considered non-error statuses:
|
|
1348
|
+
* - 0: Approved
|
|
1349
|
+
* - 600: Checking card number (J2)
|
|
1350
|
+
* - 700: Approved without charge (J5)
|
|
1351
|
+
* - 800: Postpone transaction
|
|
1352
|
+
*/
|
|
1353
|
+
declare function isSuccessCode(ccode: string): boolean;
|
|
1354
|
+
/**
|
|
1355
|
+
* Check whether a CCode is a Shva error (0-200 range, excluding success codes).
|
|
1356
|
+
*/
|
|
1357
|
+
declare function isShvaError(ccode: string): boolean;
|
|
1358
|
+
/**
|
|
1359
|
+
* Check whether a CCode is a Hypay server error (201-999 range, excluding valid codes).
|
|
1360
|
+
*/
|
|
1361
|
+
declare function isHypayError(ccode: string): boolean;
|
|
1362
|
+
|
|
1363
|
+
export { ALL_ERROR_CODES, type APISignResponse, Bank, Brand, type CancelTransParams, type CancelTransResponse, type CashInvoiceParams, type CheckInvoiceParams, type ClientData, Coin, type CommitTransParams, type CommitTransResponse, type GetTokenParams, type GetTokenResponse, HKNewStatus, type HKStatusParams, type HKStatusResponse, HYPAY_ERROR_CODES, HypayClient, type HypayConfig, HypayError, type HypayHooks, HypayNetworkError, HypayTimeoutError, type InvoiceItem, type InvoiceParams, Issuer, type J5ChargeParams, type MoreDataFields, type MultiCheckInvoiceParams, type OfflineInvoiceBaseParams, type OfflineInvoiceParams, PageLang, type PayPageParams, type PayPageSubscriptionParams, type PaymentPageResponse, type PrintInvoiceParams, type RefundByTokenParams, type RefundParams, type RefundResponse, type RequestContext, type ResponseContext, SHVA_ERROR_CODES, type SoftParams, type SoftResponse, type SoftTokenParams, type SoftWalletParams, SpecialCardType, TashType, type VerifyParams, type VerifyResponse, buildItemsString, calculateItemsTotal, getErrorMessage, isHypayError, isShvaError, isSuccessCode, isTestMasof, isValidEmail, isValidIsraeliId, isValidMasof, isValidToken, parsePaymentPageResponse, parseQueryString, parseRedirectUrl, parseTokef, serializeParams, toQueryString };
|