@technova-tech/olive-proto-lib 1.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/accounts/accounts.js +11606 -0
  2. package/admin/admin.js +4926 -0
  3. package/bills/bills.js +2323 -0
  4. package/business/business.js +16229 -0
  5. package/image/recognition.js +456 -0
  6. package/index.js +44 -0
  7. package/package.json +31 -0
  8. package/pos/transactions.js +2084 -0
  9. package/pos.v1/auth.js +1179 -0
  10. package/pos.v1/card-transactions.js +2473 -0
  11. package/pos.v1/eod.js +2416 -0
  12. package/pos.v1/merchants.js +1552 -0
  13. package/pos.v1/terminal-transactions.js +3752 -0
  14. package/pos.v1/terminal-types.js +3888 -0
  15. package/pos.v1/terminals.js +30668 -0
  16. package/pos.v1/transactions.js +2918 -0
  17. package/shared/response.js +233 -0
  18. package/storage/storage.js +476 -0
  19. package/terminal/terminal.js +12263 -0
  20. package/transfer/transfer.js +3609 -0
  21. package/types/accounts/accounts.d.ts +3909 -0
  22. package/types/admin/admin.d.ts +1724 -0
  23. package/types/bills/bills.d.ts +721 -0
  24. package/types/business/business.d.ts +7569 -0
  25. package/types/image/recognition.d.ts +147 -0
  26. package/types/index.d.ts +41 -0
  27. package/types/pos/transactions.d.ts +667 -0
  28. package/types/pos.v1/auth.d.ts +374 -0
  29. package/types/pos.v1/card-transactions.d.ts +808 -0
  30. package/types/pos.v1/eod.d.ts +819 -0
  31. package/types/pos.v1/merchants.d.ts +566 -0
  32. package/types/pos.v1/terminal-transactions.d.ts +1332 -0
  33. package/types/pos.v1/terminal-types.d.ts +1215 -0
  34. package/types/pos.v1/terminals.d.ts +10546 -0
  35. package/types/pos.v1/transactions.d.ts +1057 -0
  36. package/types/shared/response.d.ts +65 -0
  37. package/types/storage/storage.d.ts +153 -0
  38. package/types/terminal/terminal.d.ts +5384 -0
  39. package/types/transfer/transfer.d.ts +1148 -0
  40. package/types/users/users.d.ts +4086 -0
  41. package/types/verifications/verifications.d.ts +2892 -0
  42. package/users/users.js +11870 -0
  43. package/verifications/verifications.js +7989 -0
@@ -0,0 +1,2473 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.com = void 0;
27
+ const pb_1 = __importStar(require("google-protobuf"));
28
+ const grpc_1 = __importStar(require("@grpc/grpc-js"));
29
+ var com;
30
+ (function (com) {
31
+ var pkg;
32
+ (function (pkg) {
33
+ var posv1;
34
+ (function (posv1) {
35
+ var terminalCardTransactions;
36
+ (function (terminalCardTransactions) {
37
+ let POSTransactionType;
38
+ (function (POSTransactionType) {
39
+ POSTransactionType[POSTransactionType["PURCHASE"] = 0] = "PURCHASE";
40
+ POSTransactionType[POSTransactionType["REFUND"] = 1] = "REFUND";
41
+ POSTransactionType[POSTransactionType["CASH_ADVANCE"] = 2] = "CASH_ADVANCE";
42
+ POSTransactionType[POSTransactionType["CASH_BACK"] = 3] = "CASH_BACK";
43
+ POSTransactionType[POSTransactionType["REVERSAL"] = 4] = "REVERSAL";
44
+ POSTransactionType[POSTransactionType["BALANCE"] = 5] = "BALANCE";
45
+ POSTransactionType[POSTransactionType["SALES_COMPLETE"] = 6] = "SALES_COMPLETE";
46
+ POSTransactionType[POSTransactionType["PREAUTH"] = 7] = "PREAUTH";
47
+ POSTransactionType[POSTransactionType["WITHDRAWAL"] = 8] = "WITHDRAWAL";
48
+ })(POSTransactionType = terminalCardTransactions.POSTransactionType || (terminalCardTransactions.POSTransactionType = {}));
49
+ let POSTransactionStatus;
50
+ (function (POSTransactionStatus) {
51
+ POSTransactionStatus[POSTransactionStatus["PENDING"] = 0] = "PENDING";
52
+ POSTransactionStatus[POSTransactionStatus["SUCCESSFUL"] = 1] = "SUCCESSFUL";
53
+ POSTransactionStatus[POSTransactionStatus["FAILED"] = 2] = "FAILED";
54
+ POSTransactionStatus[POSTransactionStatus["REVERSED"] = 3] = "REVERSED";
55
+ })(POSTransactionStatus = terminalCardTransactions.POSTransactionStatus || (terminalCardTransactions.POSTransactionStatus = {}));
56
+ let ServiceProvider;
57
+ (function (ServiceProvider) {
58
+ ServiceProvider[ServiceProvider["NIBSS"] = 0] = "NIBSS";
59
+ ServiceProvider[ServiceProvider["INTERSWITCH"] = 1] = "INTERSWITCH";
60
+ ServiceProvider[ServiceProvider["FLUTTERWAVE"] = 2] = "FLUTTERWAVE";
61
+ ServiceProvider[ServiceProvider["PAYSTACK"] = 3] = "PAYSTACK";
62
+ })(ServiceProvider = terminalCardTransactions.ServiceProvider || (terminalCardTransactions.ServiceProvider = {}));
63
+ class InitializeCardTransactionRequest extends pb_1.Message {
64
+ #one_of_decls = [];
65
+ constructor(data) {
66
+ super();
67
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
68
+ if (!Array.isArray(data) && typeof data == "object") {
69
+ if ("accountId" in data && data.accountId != undefined) {
70
+ this.accountId = data.accountId;
71
+ }
72
+ if ("businessId" in data && data.businessId != undefined) {
73
+ this.businessId = data.businessId;
74
+ }
75
+ if ("terminalId" in data && data.terminalId != undefined) {
76
+ this.terminalId = data.terminalId;
77
+ }
78
+ if ("amount" in data && data.amount != undefined) {
79
+ this.amount = data.amount;
80
+ }
81
+ if ("meta" in data && data.meta != undefined) {
82
+ this.meta = data.meta;
83
+ }
84
+ if ("type" in data && data.type != undefined) {
85
+ this.type = data.type;
86
+ }
87
+ if ("cardData" in data && data.cardData != undefined) {
88
+ this.cardData = data.cardData;
89
+ }
90
+ if ("accountName" in data && data.accountName != undefined) {
91
+ this.accountName = data.accountName;
92
+ }
93
+ }
94
+ }
95
+ get accountId() {
96
+ return pb_1.Message.getFieldWithDefault(this, 1, "");
97
+ }
98
+ set accountId(value) {
99
+ pb_1.Message.setField(this, 1, value);
100
+ }
101
+ get businessId() {
102
+ return pb_1.Message.getFieldWithDefault(this, 2, "");
103
+ }
104
+ set businessId(value) {
105
+ pb_1.Message.setField(this, 2, value);
106
+ }
107
+ get terminalId() {
108
+ return pb_1.Message.getFieldWithDefault(this, 3, "");
109
+ }
110
+ set terminalId(value) {
111
+ pb_1.Message.setField(this, 3, value);
112
+ }
113
+ get amount() {
114
+ return pb_1.Message.getFieldWithDefault(this, 4, 0);
115
+ }
116
+ set amount(value) {
117
+ pb_1.Message.setField(this, 4, value);
118
+ }
119
+ get meta() {
120
+ return pb_1.Message.getFieldWithDefault(this, 5, "");
121
+ }
122
+ set meta(value) {
123
+ pb_1.Message.setField(this, 5, value);
124
+ }
125
+ get type() {
126
+ return pb_1.Message.getFieldWithDefault(this, 6, "");
127
+ }
128
+ set type(value) {
129
+ pb_1.Message.setField(this, 6, value);
130
+ }
131
+ get cardData() {
132
+ return pb_1.Message.getWrapperField(this, CardData, 7);
133
+ }
134
+ set cardData(value) {
135
+ pb_1.Message.setWrapperField(this, 7, value);
136
+ }
137
+ get hasCardData() {
138
+ return pb_1.Message.getField(this, 7) != null;
139
+ }
140
+ get accountName() {
141
+ return pb_1.Message.getFieldWithDefault(this, 8, "");
142
+ }
143
+ set accountName(value) {
144
+ pb_1.Message.setField(this, 8, value);
145
+ }
146
+ static fromObject(data) {
147
+ const message = new InitializeCardTransactionRequest({});
148
+ if (data.accountId != null) {
149
+ message.accountId = data.accountId;
150
+ }
151
+ if (data.businessId != null) {
152
+ message.businessId = data.businessId;
153
+ }
154
+ if (data.terminalId != null) {
155
+ message.terminalId = data.terminalId;
156
+ }
157
+ if (data.amount != null) {
158
+ message.amount = data.amount;
159
+ }
160
+ if (data.meta != null) {
161
+ message.meta = data.meta;
162
+ }
163
+ if (data.type != null) {
164
+ message.type = data.type;
165
+ }
166
+ if (data.cardData != null) {
167
+ message.cardData = CardData.fromObject(data.cardData);
168
+ }
169
+ if (data.accountName != null) {
170
+ message.accountName = data.accountName;
171
+ }
172
+ return message;
173
+ }
174
+ toObject() {
175
+ const data = {};
176
+ if (this.accountId != null) {
177
+ data.accountId = this.accountId;
178
+ }
179
+ if (this.businessId != null) {
180
+ data.businessId = this.businessId;
181
+ }
182
+ if (this.terminalId != null) {
183
+ data.terminalId = this.terminalId;
184
+ }
185
+ if (this.amount != null) {
186
+ data.amount = this.amount;
187
+ }
188
+ if (this.meta != null) {
189
+ data.meta = this.meta;
190
+ }
191
+ if (this.type != null) {
192
+ data.type = this.type;
193
+ }
194
+ if (this.cardData != null) {
195
+ data.cardData = this.cardData.toObject();
196
+ }
197
+ if (this.accountName != null) {
198
+ data.accountName = this.accountName;
199
+ }
200
+ return data;
201
+ }
202
+ serialize(w) {
203
+ const writer = w || new pb_1.BinaryWriter();
204
+ if (this.accountId.length)
205
+ writer.writeString(1, this.accountId);
206
+ if (this.businessId.length)
207
+ writer.writeString(2, this.businessId);
208
+ if (this.terminalId.length)
209
+ writer.writeString(3, this.terminalId);
210
+ if (this.amount != 0)
211
+ writer.writeDouble(4, this.amount);
212
+ if (this.meta.length)
213
+ writer.writeString(5, this.meta);
214
+ if (this.type.length)
215
+ writer.writeString(6, this.type);
216
+ if (this.hasCardData)
217
+ writer.writeMessage(7, this.cardData, () => this.cardData.serialize(writer));
218
+ if (this.accountName.length)
219
+ writer.writeString(8, this.accountName);
220
+ if (!w)
221
+ return writer.getResultBuffer();
222
+ }
223
+ static deserialize(bytes) {
224
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new InitializeCardTransactionRequest();
225
+ while (reader.nextField()) {
226
+ if (reader.isEndGroup())
227
+ break;
228
+ switch (reader.getFieldNumber()) {
229
+ case 1:
230
+ message.accountId = reader.readString();
231
+ break;
232
+ case 2:
233
+ message.businessId = reader.readString();
234
+ break;
235
+ case 3:
236
+ message.terminalId = reader.readString();
237
+ break;
238
+ case 4:
239
+ message.amount = reader.readDouble();
240
+ break;
241
+ case 5:
242
+ message.meta = reader.readString();
243
+ break;
244
+ case 6:
245
+ message.type = reader.readString();
246
+ break;
247
+ case 7:
248
+ reader.readMessage(message.cardData, () => message.cardData = CardData.deserialize(reader));
249
+ break;
250
+ case 8:
251
+ message.accountName = reader.readString();
252
+ break;
253
+ default: reader.skipField();
254
+ }
255
+ }
256
+ return message;
257
+ }
258
+ serializeBinary() {
259
+ return this.serialize();
260
+ }
261
+ static deserializeBinary(bytes) {
262
+ return InitializeCardTransactionRequest.deserialize(bytes);
263
+ }
264
+ }
265
+ terminalCardTransactions.InitializeCardTransactionRequest = InitializeCardTransactionRequest;
266
+ class ConfirmCardTransactionRequest extends pb_1.Message {
267
+ #one_of_decls = [];
268
+ constructor(data) {
269
+ super();
270
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
271
+ if (!Array.isArray(data) && typeof data == "object") {
272
+ if ("reference" in data && data.reference != undefined) {
273
+ this.reference = data.reference;
274
+ }
275
+ if ("rrn" in data && data.rrn != undefined) {
276
+ this.rrn = data.rrn;
277
+ }
278
+ if ("status" in data && data.status != undefined) {
279
+ this.status = data.status;
280
+ }
281
+ if ("meta" in data && data.meta != undefined) {
282
+ this.meta = data.meta;
283
+ }
284
+ if ("type" in data && data.type != undefined) {
285
+ this.type = data.type;
286
+ }
287
+ }
288
+ }
289
+ get reference() {
290
+ return pb_1.Message.getFieldWithDefault(this, 1, "");
291
+ }
292
+ set reference(value) {
293
+ pb_1.Message.setField(this, 1, value);
294
+ }
295
+ get rrn() {
296
+ return pb_1.Message.getFieldWithDefault(this, 2, "");
297
+ }
298
+ set rrn(value) {
299
+ pb_1.Message.setField(this, 2, value);
300
+ }
301
+ get status() {
302
+ return pb_1.Message.getFieldWithDefault(this, 3, POSTransactionStatus.PENDING);
303
+ }
304
+ set status(value) {
305
+ pb_1.Message.setField(this, 3, value);
306
+ }
307
+ get meta() {
308
+ return pb_1.Message.getFieldWithDefault(this, 4, "");
309
+ }
310
+ set meta(value) {
311
+ pb_1.Message.setField(this, 4, value);
312
+ }
313
+ get type() {
314
+ return pb_1.Message.getFieldWithDefault(this, 5, POSTransactionType.PURCHASE);
315
+ }
316
+ set type(value) {
317
+ pb_1.Message.setField(this, 5, value);
318
+ }
319
+ static fromObject(data) {
320
+ const message = new ConfirmCardTransactionRequest({});
321
+ if (data.reference != null) {
322
+ message.reference = data.reference;
323
+ }
324
+ if (data.rrn != null) {
325
+ message.rrn = data.rrn;
326
+ }
327
+ if (data.status != null) {
328
+ message.status = data.status;
329
+ }
330
+ if (data.meta != null) {
331
+ message.meta = data.meta;
332
+ }
333
+ if (data.type != null) {
334
+ message.type = data.type;
335
+ }
336
+ return message;
337
+ }
338
+ toObject() {
339
+ const data = {};
340
+ if (this.reference != null) {
341
+ data.reference = this.reference;
342
+ }
343
+ if (this.rrn != null) {
344
+ data.rrn = this.rrn;
345
+ }
346
+ if (this.status != null) {
347
+ data.status = this.status;
348
+ }
349
+ if (this.meta != null) {
350
+ data.meta = this.meta;
351
+ }
352
+ if (this.type != null) {
353
+ data.type = this.type;
354
+ }
355
+ return data;
356
+ }
357
+ serialize(w) {
358
+ const writer = w || new pb_1.BinaryWriter();
359
+ if (this.reference.length)
360
+ writer.writeString(1, this.reference);
361
+ if (this.rrn.length)
362
+ writer.writeString(2, this.rrn);
363
+ if (this.status != POSTransactionStatus.PENDING)
364
+ writer.writeEnum(3, this.status);
365
+ if (this.meta.length)
366
+ writer.writeString(4, this.meta);
367
+ if (this.type != POSTransactionType.PURCHASE)
368
+ writer.writeEnum(5, this.type);
369
+ if (!w)
370
+ return writer.getResultBuffer();
371
+ }
372
+ static deserialize(bytes) {
373
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ConfirmCardTransactionRequest();
374
+ while (reader.nextField()) {
375
+ if (reader.isEndGroup())
376
+ break;
377
+ switch (reader.getFieldNumber()) {
378
+ case 1:
379
+ message.reference = reader.readString();
380
+ break;
381
+ case 2:
382
+ message.rrn = reader.readString();
383
+ break;
384
+ case 3:
385
+ message.status = reader.readEnum();
386
+ break;
387
+ case 4:
388
+ message.meta = reader.readString();
389
+ break;
390
+ case 5:
391
+ message.type = reader.readEnum();
392
+ break;
393
+ default: reader.skipField();
394
+ }
395
+ }
396
+ return message;
397
+ }
398
+ serializeBinary() {
399
+ return this.serialize();
400
+ }
401
+ static deserializeBinary(bytes) {
402
+ return ConfirmCardTransactionRequest.deserialize(bytes);
403
+ }
404
+ }
405
+ terminalCardTransactions.ConfirmCardTransactionRequest = ConfirmCardTransactionRequest;
406
+ class GetCardTransactionRequest extends pb_1.Message {
407
+ #one_of_decls = [];
408
+ constructor(data) {
409
+ super();
410
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
411
+ if (!Array.isArray(data) && typeof data == "object") {
412
+ if ("accountId" in data && data.accountId != undefined) {
413
+ this.accountId = data.accountId;
414
+ }
415
+ if ("rrn" in data && data.rrn != undefined) {
416
+ this.rrn = data.rrn;
417
+ }
418
+ if ("type" in data && data.type != undefined) {
419
+ this.type = data.type;
420
+ }
421
+ }
422
+ }
423
+ get accountId() {
424
+ return pb_1.Message.getFieldWithDefault(this, 1, "");
425
+ }
426
+ set accountId(value) {
427
+ pb_1.Message.setField(this, 1, value);
428
+ }
429
+ get rrn() {
430
+ return pb_1.Message.getFieldWithDefault(this, 2, "");
431
+ }
432
+ set rrn(value) {
433
+ pb_1.Message.setField(this, 2, value);
434
+ }
435
+ get type() {
436
+ return pb_1.Message.getFieldWithDefault(this, 3, POSTransactionType.PURCHASE);
437
+ }
438
+ set type(value) {
439
+ pb_1.Message.setField(this, 3, value);
440
+ }
441
+ static fromObject(data) {
442
+ const message = new GetCardTransactionRequest({});
443
+ if (data.accountId != null) {
444
+ message.accountId = data.accountId;
445
+ }
446
+ if (data.rrn != null) {
447
+ message.rrn = data.rrn;
448
+ }
449
+ if (data.type != null) {
450
+ message.type = data.type;
451
+ }
452
+ return message;
453
+ }
454
+ toObject() {
455
+ const data = {};
456
+ if (this.accountId != null) {
457
+ data.accountId = this.accountId;
458
+ }
459
+ if (this.rrn != null) {
460
+ data.rrn = this.rrn;
461
+ }
462
+ if (this.type != null) {
463
+ data.type = this.type;
464
+ }
465
+ return data;
466
+ }
467
+ serialize(w) {
468
+ const writer = w || new pb_1.BinaryWriter();
469
+ if (this.accountId.length)
470
+ writer.writeString(1, this.accountId);
471
+ if (this.rrn.length)
472
+ writer.writeString(2, this.rrn);
473
+ if (this.type != POSTransactionType.PURCHASE)
474
+ writer.writeEnum(3, this.type);
475
+ if (!w)
476
+ return writer.getResultBuffer();
477
+ }
478
+ static deserialize(bytes) {
479
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetCardTransactionRequest();
480
+ while (reader.nextField()) {
481
+ if (reader.isEndGroup())
482
+ break;
483
+ switch (reader.getFieldNumber()) {
484
+ case 1:
485
+ message.accountId = reader.readString();
486
+ break;
487
+ case 2:
488
+ message.rrn = reader.readString();
489
+ break;
490
+ case 3:
491
+ message.type = reader.readEnum();
492
+ break;
493
+ default: reader.skipField();
494
+ }
495
+ }
496
+ return message;
497
+ }
498
+ serializeBinary() {
499
+ return this.serialize();
500
+ }
501
+ static deserializeBinary(bytes) {
502
+ return GetCardTransactionRequest.deserialize(bytes);
503
+ }
504
+ }
505
+ terminalCardTransactions.GetCardTransactionRequest = GetCardTransactionRequest;
506
+ class QueryCardTransactionsRequest extends pb_1.Message {
507
+ #one_of_decls = [];
508
+ constructor(data) {
509
+ super();
510
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
511
+ if (!Array.isArray(data) && typeof data == "object") {
512
+ if ("accountId" in data && data.accountId != undefined) {
513
+ this.accountId = data.accountId;
514
+ }
515
+ if ("startDate" in data && data.startDate != undefined) {
516
+ this.startDate = data.startDate;
517
+ }
518
+ if ("endDate" in data && data.endDate != undefined) {
519
+ this.endDate = data.endDate;
520
+ }
521
+ if ("rrn" in data && data.rrn != undefined) {
522
+ this.rrn = data.rrn;
523
+ }
524
+ if ("amount" in data && data.amount != undefined) {
525
+ this.amount = data.amount;
526
+ }
527
+ if ("type" in data && data.type != undefined) {
528
+ this.type = data.type;
529
+ }
530
+ }
531
+ }
532
+ get accountId() {
533
+ return pb_1.Message.getFieldWithDefault(this, 1, "");
534
+ }
535
+ set accountId(value) {
536
+ pb_1.Message.setField(this, 1, value);
537
+ }
538
+ get startDate() {
539
+ return pb_1.Message.getFieldWithDefault(this, 2, "");
540
+ }
541
+ set startDate(value) {
542
+ pb_1.Message.setField(this, 2, value);
543
+ }
544
+ get endDate() {
545
+ return pb_1.Message.getFieldWithDefault(this, 3, "");
546
+ }
547
+ set endDate(value) {
548
+ pb_1.Message.setField(this, 3, value);
549
+ }
550
+ get rrn() {
551
+ return pb_1.Message.getFieldWithDefault(this, 4, "");
552
+ }
553
+ set rrn(value) {
554
+ pb_1.Message.setField(this, 4, value);
555
+ }
556
+ get amount() {
557
+ return pb_1.Message.getFieldWithDefault(this, 5, 0);
558
+ }
559
+ set amount(value) {
560
+ pb_1.Message.setField(this, 5, value);
561
+ }
562
+ get type() {
563
+ return pb_1.Message.getFieldWithDefault(this, 6, POSTransactionType.PURCHASE);
564
+ }
565
+ set type(value) {
566
+ pb_1.Message.setField(this, 6, value);
567
+ }
568
+ static fromObject(data) {
569
+ const message = new QueryCardTransactionsRequest({});
570
+ if (data.accountId != null) {
571
+ message.accountId = data.accountId;
572
+ }
573
+ if (data.startDate != null) {
574
+ message.startDate = data.startDate;
575
+ }
576
+ if (data.endDate != null) {
577
+ message.endDate = data.endDate;
578
+ }
579
+ if (data.rrn != null) {
580
+ message.rrn = data.rrn;
581
+ }
582
+ if (data.amount != null) {
583
+ message.amount = data.amount;
584
+ }
585
+ if (data.type != null) {
586
+ message.type = data.type;
587
+ }
588
+ return message;
589
+ }
590
+ toObject() {
591
+ const data = {};
592
+ if (this.accountId != null) {
593
+ data.accountId = this.accountId;
594
+ }
595
+ if (this.startDate != null) {
596
+ data.startDate = this.startDate;
597
+ }
598
+ if (this.endDate != null) {
599
+ data.endDate = this.endDate;
600
+ }
601
+ if (this.rrn != null) {
602
+ data.rrn = this.rrn;
603
+ }
604
+ if (this.amount != null) {
605
+ data.amount = this.amount;
606
+ }
607
+ if (this.type != null) {
608
+ data.type = this.type;
609
+ }
610
+ return data;
611
+ }
612
+ serialize(w) {
613
+ const writer = w || new pb_1.BinaryWriter();
614
+ if (this.accountId.length)
615
+ writer.writeString(1, this.accountId);
616
+ if (this.startDate.length)
617
+ writer.writeString(2, this.startDate);
618
+ if (this.endDate.length)
619
+ writer.writeString(3, this.endDate);
620
+ if (this.rrn.length)
621
+ writer.writeString(4, this.rrn);
622
+ if (this.amount != 0)
623
+ writer.writeDouble(5, this.amount);
624
+ if (this.type != POSTransactionType.PURCHASE)
625
+ writer.writeEnum(6, this.type);
626
+ if (!w)
627
+ return writer.getResultBuffer();
628
+ }
629
+ static deserialize(bytes) {
630
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryCardTransactionsRequest();
631
+ while (reader.nextField()) {
632
+ if (reader.isEndGroup())
633
+ break;
634
+ switch (reader.getFieldNumber()) {
635
+ case 1:
636
+ message.accountId = reader.readString();
637
+ break;
638
+ case 2:
639
+ message.startDate = reader.readString();
640
+ break;
641
+ case 3:
642
+ message.endDate = reader.readString();
643
+ break;
644
+ case 4:
645
+ message.rrn = reader.readString();
646
+ break;
647
+ case 5:
648
+ message.amount = reader.readDouble();
649
+ break;
650
+ case 6:
651
+ message.type = reader.readEnum();
652
+ break;
653
+ default: reader.skipField();
654
+ }
655
+ }
656
+ return message;
657
+ }
658
+ serializeBinary() {
659
+ return this.serialize();
660
+ }
661
+ static deserializeBinary(bytes) {
662
+ return QueryCardTransactionsRequest.deserialize(bytes);
663
+ }
664
+ }
665
+ terminalCardTransactions.QueryCardTransactionsRequest = QueryCardTransactionsRequest;
666
+ class SaveReversalTransactionRequest extends pb_1.Message {
667
+ #one_of_decls = [];
668
+ constructor(data) {
669
+ super();
670
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
671
+ if (!Array.isArray(data) && typeof data == "object") {
672
+ if ("accountId" in data && data.accountId != undefined) {
673
+ this.accountId = data.accountId;
674
+ }
675
+ if ("businessId" in data && data.businessId != undefined) {
676
+ this.businessId = data.businessId;
677
+ }
678
+ if ("terminalId" in data && data.terminalId != undefined) {
679
+ this.terminalId = data.terminalId;
680
+ }
681
+ if ("amount" in data && data.amount != undefined) {
682
+ this.amount = data.amount;
683
+ }
684
+ if ("meta" in data && data.meta != undefined) {
685
+ this.meta = data.meta;
686
+ }
687
+ if ("rrn" in data && data.rrn != undefined) {
688
+ this.rrn = data.rrn;
689
+ }
690
+ if ("stan" in data && data.stan != undefined) {
691
+ this.stan = data.stan;
692
+ }
693
+ }
694
+ }
695
+ get accountId() {
696
+ return pb_1.Message.getFieldWithDefault(this, 1, "");
697
+ }
698
+ set accountId(value) {
699
+ pb_1.Message.setField(this, 1, value);
700
+ }
701
+ get businessId() {
702
+ return pb_1.Message.getFieldWithDefault(this, 2, "");
703
+ }
704
+ set businessId(value) {
705
+ pb_1.Message.setField(this, 2, value);
706
+ }
707
+ get terminalId() {
708
+ return pb_1.Message.getFieldWithDefault(this, 3, "");
709
+ }
710
+ set terminalId(value) {
711
+ pb_1.Message.setField(this, 3, value);
712
+ }
713
+ get amount() {
714
+ return pb_1.Message.getFieldWithDefault(this, 4, 0);
715
+ }
716
+ set amount(value) {
717
+ pb_1.Message.setField(this, 4, value);
718
+ }
719
+ get meta() {
720
+ return pb_1.Message.getFieldWithDefault(this, 5, "");
721
+ }
722
+ set meta(value) {
723
+ pb_1.Message.setField(this, 5, value);
724
+ }
725
+ get rrn() {
726
+ return pb_1.Message.getFieldWithDefault(this, 6, "");
727
+ }
728
+ set rrn(value) {
729
+ pb_1.Message.setField(this, 6, value);
730
+ }
731
+ get stan() {
732
+ return pb_1.Message.getFieldWithDefault(this, 7, "");
733
+ }
734
+ set stan(value) {
735
+ pb_1.Message.setField(this, 7, value);
736
+ }
737
+ static fromObject(data) {
738
+ const message = new SaveReversalTransactionRequest({});
739
+ if (data.accountId != null) {
740
+ message.accountId = data.accountId;
741
+ }
742
+ if (data.businessId != null) {
743
+ message.businessId = data.businessId;
744
+ }
745
+ if (data.terminalId != null) {
746
+ message.terminalId = data.terminalId;
747
+ }
748
+ if (data.amount != null) {
749
+ message.amount = data.amount;
750
+ }
751
+ if (data.meta != null) {
752
+ message.meta = data.meta;
753
+ }
754
+ if (data.rrn != null) {
755
+ message.rrn = data.rrn;
756
+ }
757
+ if (data.stan != null) {
758
+ message.stan = data.stan;
759
+ }
760
+ return message;
761
+ }
762
+ toObject() {
763
+ const data = {};
764
+ if (this.accountId != null) {
765
+ data.accountId = this.accountId;
766
+ }
767
+ if (this.businessId != null) {
768
+ data.businessId = this.businessId;
769
+ }
770
+ if (this.terminalId != null) {
771
+ data.terminalId = this.terminalId;
772
+ }
773
+ if (this.amount != null) {
774
+ data.amount = this.amount;
775
+ }
776
+ if (this.meta != null) {
777
+ data.meta = this.meta;
778
+ }
779
+ if (this.rrn != null) {
780
+ data.rrn = this.rrn;
781
+ }
782
+ if (this.stan != null) {
783
+ data.stan = this.stan;
784
+ }
785
+ return data;
786
+ }
787
+ serialize(w) {
788
+ const writer = w || new pb_1.BinaryWriter();
789
+ if (this.accountId.length)
790
+ writer.writeString(1, this.accountId);
791
+ if (this.businessId.length)
792
+ writer.writeString(2, this.businessId);
793
+ if (this.terminalId.length)
794
+ writer.writeString(3, this.terminalId);
795
+ if (this.amount != 0)
796
+ writer.writeDouble(4, this.amount);
797
+ if (this.meta.length)
798
+ writer.writeString(5, this.meta);
799
+ if (this.rrn.length)
800
+ writer.writeString(6, this.rrn);
801
+ if (this.stan.length)
802
+ writer.writeString(7, this.stan);
803
+ if (!w)
804
+ return writer.getResultBuffer();
805
+ }
806
+ static deserialize(bytes) {
807
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new SaveReversalTransactionRequest();
808
+ while (reader.nextField()) {
809
+ if (reader.isEndGroup())
810
+ break;
811
+ switch (reader.getFieldNumber()) {
812
+ case 1:
813
+ message.accountId = reader.readString();
814
+ break;
815
+ case 2:
816
+ message.businessId = reader.readString();
817
+ break;
818
+ case 3:
819
+ message.terminalId = reader.readString();
820
+ break;
821
+ case 4:
822
+ message.amount = reader.readDouble();
823
+ break;
824
+ case 5:
825
+ message.meta = reader.readString();
826
+ break;
827
+ case 6:
828
+ message.rrn = reader.readString();
829
+ break;
830
+ case 7:
831
+ message.stan = reader.readString();
832
+ break;
833
+ default: reader.skipField();
834
+ }
835
+ }
836
+ return message;
837
+ }
838
+ serializeBinary() {
839
+ return this.serialize();
840
+ }
841
+ static deserializeBinary(bytes) {
842
+ return SaveReversalTransactionRequest.deserialize(bytes);
843
+ }
844
+ }
845
+ terminalCardTransactions.SaveReversalTransactionRequest = SaveReversalTransactionRequest;
846
+ class DeleteReversalTransactionRequest extends pb_1.Message {
847
+ #one_of_decls = [];
848
+ constructor(data) {
849
+ super();
850
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
851
+ if (!Array.isArray(data) && typeof data == "object") {
852
+ if ("accountId" in data && data.accountId != undefined) {
853
+ this.accountId = data.accountId;
854
+ }
855
+ if ("rrn" in data && data.rrn != undefined) {
856
+ this.rrn = data.rrn;
857
+ }
858
+ if ("type" in data && data.type != undefined) {
859
+ this.type = data.type;
860
+ }
861
+ }
862
+ }
863
+ get accountId() {
864
+ return pb_1.Message.getFieldWithDefault(this, 1, "");
865
+ }
866
+ set accountId(value) {
867
+ pb_1.Message.setField(this, 1, value);
868
+ }
869
+ get rrn() {
870
+ return pb_1.Message.getFieldWithDefault(this, 2, "");
871
+ }
872
+ set rrn(value) {
873
+ pb_1.Message.setField(this, 2, value);
874
+ }
875
+ get type() {
876
+ return pb_1.Message.getFieldWithDefault(this, 3, POSTransactionType.PURCHASE);
877
+ }
878
+ set type(value) {
879
+ pb_1.Message.setField(this, 3, value);
880
+ }
881
+ static fromObject(data) {
882
+ const message = new DeleteReversalTransactionRequest({});
883
+ if (data.accountId != null) {
884
+ message.accountId = data.accountId;
885
+ }
886
+ if (data.rrn != null) {
887
+ message.rrn = data.rrn;
888
+ }
889
+ if (data.type != null) {
890
+ message.type = data.type;
891
+ }
892
+ return message;
893
+ }
894
+ toObject() {
895
+ const data = {};
896
+ if (this.accountId != null) {
897
+ data.accountId = this.accountId;
898
+ }
899
+ if (this.rrn != null) {
900
+ data.rrn = this.rrn;
901
+ }
902
+ if (this.type != null) {
903
+ data.type = this.type;
904
+ }
905
+ return data;
906
+ }
907
+ serialize(w) {
908
+ const writer = w || new pb_1.BinaryWriter();
909
+ if (this.accountId.length)
910
+ writer.writeString(1, this.accountId);
911
+ if (this.rrn.length)
912
+ writer.writeString(2, this.rrn);
913
+ if (this.type != POSTransactionType.PURCHASE)
914
+ writer.writeEnum(3, this.type);
915
+ if (!w)
916
+ return writer.getResultBuffer();
917
+ }
918
+ static deserialize(bytes) {
919
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new DeleteReversalTransactionRequest();
920
+ while (reader.nextField()) {
921
+ if (reader.isEndGroup())
922
+ break;
923
+ switch (reader.getFieldNumber()) {
924
+ case 1:
925
+ message.accountId = reader.readString();
926
+ break;
927
+ case 2:
928
+ message.rrn = reader.readString();
929
+ break;
930
+ case 3:
931
+ message.type = reader.readEnum();
932
+ break;
933
+ default: reader.skipField();
934
+ }
935
+ }
936
+ return message;
937
+ }
938
+ serializeBinary() {
939
+ return this.serialize();
940
+ }
941
+ static deserializeBinary(bytes) {
942
+ return DeleteReversalTransactionRequest.deserialize(bytes);
943
+ }
944
+ }
945
+ terminalCardTransactions.DeleteReversalTransactionRequest = DeleteReversalTransactionRequest;
946
+ class CardData extends pb_1.Message {
947
+ #one_of_decls = [];
948
+ constructor(data) {
949
+ super();
950
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
951
+ if (!Array.isArray(data) && typeof data == "object") {
952
+ if ("pan" in data && data.pan != undefined) {
953
+ this.pan = data.pan;
954
+ }
955
+ if ("expiryDate" in data && data.expiryDate != undefined) {
956
+ this.expiryDate = data.expiryDate;
957
+ }
958
+ if ("cvv" in data && data.cvv != undefined) {
959
+ this.cvv = data.cvv;
960
+ }
961
+ if ("track2" in data && data.track2 != undefined) {
962
+ this.track2 = data.track2;
963
+ }
964
+ if ("cardHolderName" in data && data.cardHolderName != undefined) {
965
+ this.cardHolderName = data.cardHolderName;
966
+ }
967
+ }
968
+ }
969
+ get pan() {
970
+ return pb_1.Message.getFieldWithDefault(this, 1, "");
971
+ }
972
+ set pan(value) {
973
+ pb_1.Message.setField(this, 1, value);
974
+ }
975
+ get expiryDate() {
976
+ return pb_1.Message.getFieldWithDefault(this, 2, "");
977
+ }
978
+ set expiryDate(value) {
979
+ pb_1.Message.setField(this, 2, value);
980
+ }
981
+ get cvv() {
982
+ return pb_1.Message.getFieldWithDefault(this, 3, "");
983
+ }
984
+ set cvv(value) {
985
+ pb_1.Message.setField(this, 3, value);
986
+ }
987
+ get track2() {
988
+ return pb_1.Message.getFieldWithDefault(this, 4, "");
989
+ }
990
+ set track2(value) {
991
+ pb_1.Message.setField(this, 4, value);
992
+ }
993
+ get cardHolderName() {
994
+ return pb_1.Message.getFieldWithDefault(this, 5, "");
995
+ }
996
+ set cardHolderName(value) {
997
+ pb_1.Message.setField(this, 5, value);
998
+ }
999
+ static fromObject(data) {
1000
+ const message = new CardData({});
1001
+ if (data.pan != null) {
1002
+ message.pan = data.pan;
1003
+ }
1004
+ if (data.expiryDate != null) {
1005
+ message.expiryDate = data.expiryDate;
1006
+ }
1007
+ if (data.cvv != null) {
1008
+ message.cvv = data.cvv;
1009
+ }
1010
+ if (data.track2 != null) {
1011
+ message.track2 = data.track2;
1012
+ }
1013
+ if (data.cardHolderName != null) {
1014
+ message.cardHolderName = data.cardHolderName;
1015
+ }
1016
+ return message;
1017
+ }
1018
+ toObject() {
1019
+ const data = {};
1020
+ if (this.pan != null) {
1021
+ data.pan = this.pan;
1022
+ }
1023
+ if (this.expiryDate != null) {
1024
+ data.expiryDate = this.expiryDate;
1025
+ }
1026
+ if (this.cvv != null) {
1027
+ data.cvv = this.cvv;
1028
+ }
1029
+ if (this.track2 != null) {
1030
+ data.track2 = this.track2;
1031
+ }
1032
+ if (this.cardHolderName != null) {
1033
+ data.cardHolderName = this.cardHolderName;
1034
+ }
1035
+ return data;
1036
+ }
1037
+ serialize(w) {
1038
+ const writer = w || new pb_1.BinaryWriter();
1039
+ if (this.pan.length)
1040
+ writer.writeString(1, this.pan);
1041
+ if (this.expiryDate.length)
1042
+ writer.writeString(2, this.expiryDate);
1043
+ if (this.cvv.length)
1044
+ writer.writeString(3, this.cvv);
1045
+ if (this.track2.length)
1046
+ writer.writeString(4, this.track2);
1047
+ if (this.cardHolderName.length)
1048
+ writer.writeString(5, this.cardHolderName);
1049
+ if (!w)
1050
+ return writer.getResultBuffer();
1051
+ }
1052
+ static deserialize(bytes) {
1053
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new CardData();
1054
+ while (reader.nextField()) {
1055
+ if (reader.isEndGroup())
1056
+ break;
1057
+ switch (reader.getFieldNumber()) {
1058
+ case 1:
1059
+ message.pan = reader.readString();
1060
+ break;
1061
+ case 2:
1062
+ message.expiryDate = reader.readString();
1063
+ break;
1064
+ case 3:
1065
+ message.cvv = reader.readString();
1066
+ break;
1067
+ case 4:
1068
+ message.track2 = reader.readString();
1069
+ break;
1070
+ case 5:
1071
+ message.cardHolderName = reader.readString();
1072
+ break;
1073
+ default: reader.skipField();
1074
+ }
1075
+ }
1076
+ return message;
1077
+ }
1078
+ serializeBinary() {
1079
+ return this.serialize();
1080
+ }
1081
+ static deserializeBinary(bytes) {
1082
+ return CardData.deserialize(bytes);
1083
+ }
1084
+ }
1085
+ terminalCardTransactions.CardData = CardData;
1086
+ class CardTransactionResponse extends pb_1.Message {
1087
+ #one_of_decls = [];
1088
+ constructor(data) {
1089
+ super();
1090
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
1091
+ if (!Array.isArray(data) && typeof data == "object") {
1092
+ if ("success" in data && data.success != undefined) {
1093
+ this.success = data.success;
1094
+ }
1095
+ if ("status" in data && data.status != undefined) {
1096
+ this.status = data.status;
1097
+ }
1098
+ if ("message" in data && data.message != undefined) {
1099
+ this.message = data.message;
1100
+ }
1101
+ if ("data" in data && data.data != undefined) {
1102
+ this.data = data.data;
1103
+ }
1104
+ if ("errors" in data && data.errors != undefined) {
1105
+ this.errors = data.errors;
1106
+ }
1107
+ }
1108
+ }
1109
+ get success() {
1110
+ return pb_1.Message.getFieldWithDefault(this, 1, false);
1111
+ }
1112
+ set success(value) {
1113
+ pb_1.Message.setField(this, 1, value);
1114
+ }
1115
+ get status() {
1116
+ return pb_1.Message.getFieldWithDefault(this, 2, 0);
1117
+ }
1118
+ set status(value) {
1119
+ pb_1.Message.setField(this, 2, value);
1120
+ }
1121
+ get message() {
1122
+ return pb_1.Message.getFieldWithDefault(this, 3, "");
1123
+ }
1124
+ set message(value) {
1125
+ pb_1.Message.setField(this, 3, value);
1126
+ }
1127
+ get data() {
1128
+ return pb_1.Message.getWrapperField(this, CardTransactionData, 4);
1129
+ }
1130
+ set data(value) {
1131
+ pb_1.Message.setWrapperField(this, 4, value);
1132
+ }
1133
+ get hasData() {
1134
+ return pb_1.Message.getField(this, 4) != null;
1135
+ }
1136
+ get errors() {
1137
+ return pb_1.Message.getWrapperField(this, ValidationErrors, 5);
1138
+ }
1139
+ set errors(value) {
1140
+ pb_1.Message.setWrapperField(this, 5, value);
1141
+ }
1142
+ get hasErrors() {
1143
+ return pb_1.Message.getField(this, 5) != null;
1144
+ }
1145
+ static fromObject(data) {
1146
+ const message = new CardTransactionResponse({});
1147
+ if (data.success != null) {
1148
+ message.success = data.success;
1149
+ }
1150
+ if (data.status != null) {
1151
+ message.status = data.status;
1152
+ }
1153
+ if (data.message != null) {
1154
+ message.message = data.message;
1155
+ }
1156
+ if (data.data != null) {
1157
+ message.data = CardTransactionData.fromObject(data.data);
1158
+ }
1159
+ if (data.errors != null) {
1160
+ message.errors = ValidationErrors.fromObject(data.errors);
1161
+ }
1162
+ return message;
1163
+ }
1164
+ toObject() {
1165
+ const data = {};
1166
+ if (this.success != null) {
1167
+ data.success = this.success;
1168
+ }
1169
+ if (this.status != null) {
1170
+ data.status = this.status;
1171
+ }
1172
+ if (this.message != null) {
1173
+ data.message = this.message;
1174
+ }
1175
+ if (this.data != null) {
1176
+ data.data = this.data.toObject();
1177
+ }
1178
+ if (this.errors != null) {
1179
+ data.errors = this.errors.toObject();
1180
+ }
1181
+ return data;
1182
+ }
1183
+ serialize(w) {
1184
+ const writer = w || new pb_1.BinaryWriter();
1185
+ if (this.success != false)
1186
+ writer.writeBool(1, this.success);
1187
+ if (this.status != 0)
1188
+ writer.writeUint32(2, this.status);
1189
+ if (this.message.length)
1190
+ writer.writeString(3, this.message);
1191
+ if (this.hasData)
1192
+ writer.writeMessage(4, this.data, () => this.data.serialize(writer));
1193
+ if (this.hasErrors)
1194
+ writer.writeMessage(5, this.errors, () => this.errors.serialize(writer));
1195
+ if (!w)
1196
+ return writer.getResultBuffer();
1197
+ }
1198
+ static deserialize(bytes) {
1199
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new CardTransactionResponse();
1200
+ while (reader.nextField()) {
1201
+ if (reader.isEndGroup())
1202
+ break;
1203
+ switch (reader.getFieldNumber()) {
1204
+ case 1:
1205
+ message.success = reader.readBool();
1206
+ break;
1207
+ case 2:
1208
+ message.status = reader.readUint32();
1209
+ break;
1210
+ case 3:
1211
+ message.message = reader.readString();
1212
+ break;
1213
+ case 4:
1214
+ reader.readMessage(message.data, () => message.data = CardTransactionData.deserialize(reader));
1215
+ break;
1216
+ case 5:
1217
+ reader.readMessage(message.errors, () => message.errors = ValidationErrors.deserialize(reader));
1218
+ break;
1219
+ default: reader.skipField();
1220
+ }
1221
+ }
1222
+ return message;
1223
+ }
1224
+ serializeBinary() {
1225
+ return this.serialize();
1226
+ }
1227
+ static deserializeBinary(bytes) {
1228
+ return CardTransactionResponse.deserialize(bytes);
1229
+ }
1230
+ }
1231
+ terminalCardTransactions.CardTransactionResponse = CardTransactionResponse;
1232
+ class CardTransactionsResponse extends pb_1.Message {
1233
+ #one_of_decls = [];
1234
+ constructor(data) {
1235
+ super();
1236
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4], this.#one_of_decls);
1237
+ if (!Array.isArray(data) && typeof data == "object") {
1238
+ if ("success" in data && data.success != undefined) {
1239
+ this.success = data.success;
1240
+ }
1241
+ if ("status" in data && data.status != undefined) {
1242
+ this.status = data.status;
1243
+ }
1244
+ if ("message" in data && data.message != undefined) {
1245
+ this.message = data.message;
1246
+ }
1247
+ if ("data" in data && data.data != undefined) {
1248
+ this.data = data.data;
1249
+ }
1250
+ if ("errors" in data && data.errors != undefined) {
1251
+ this.errors = data.errors;
1252
+ }
1253
+ }
1254
+ }
1255
+ get success() {
1256
+ return pb_1.Message.getFieldWithDefault(this, 1, false);
1257
+ }
1258
+ set success(value) {
1259
+ pb_1.Message.setField(this, 1, value);
1260
+ }
1261
+ get status() {
1262
+ return pb_1.Message.getFieldWithDefault(this, 2, 0);
1263
+ }
1264
+ set status(value) {
1265
+ pb_1.Message.setField(this, 2, value);
1266
+ }
1267
+ get message() {
1268
+ return pb_1.Message.getFieldWithDefault(this, 3, "");
1269
+ }
1270
+ set message(value) {
1271
+ pb_1.Message.setField(this, 3, value);
1272
+ }
1273
+ get data() {
1274
+ return pb_1.Message.getRepeatedWrapperField(this, CardTransactionData, 4);
1275
+ }
1276
+ set data(value) {
1277
+ pb_1.Message.setRepeatedWrapperField(this, 4, value);
1278
+ }
1279
+ get errors() {
1280
+ return pb_1.Message.getWrapperField(this, ValidationErrors, 5);
1281
+ }
1282
+ set errors(value) {
1283
+ pb_1.Message.setWrapperField(this, 5, value);
1284
+ }
1285
+ get hasErrors() {
1286
+ return pb_1.Message.getField(this, 5) != null;
1287
+ }
1288
+ static fromObject(data) {
1289
+ const message = new CardTransactionsResponse({});
1290
+ if (data.success != null) {
1291
+ message.success = data.success;
1292
+ }
1293
+ if (data.status != null) {
1294
+ message.status = data.status;
1295
+ }
1296
+ if (data.message != null) {
1297
+ message.message = data.message;
1298
+ }
1299
+ if (data.data != null) {
1300
+ message.data = data.data.map(item => CardTransactionData.fromObject(item));
1301
+ }
1302
+ if (data.errors != null) {
1303
+ message.errors = ValidationErrors.fromObject(data.errors);
1304
+ }
1305
+ return message;
1306
+ }
1307
+ toObject() {
1308
+ const data = {};
1309
+ if (this.success != null) {
1310
+ data.success = this.success;
1311
+ }
1312
+ if (this.status != null) {
1313
+ data.status = this.status;
1314
+ }
1315
+ if (this.message != null) {
1316
+ data.message = this.message;
1317
+ }
1318
+ if (this.data != null) {
1319
+ data.data = this.data.map((item) => item.toObject());
1320
+ }
1321
+ if (this.errors != null) {
1322
+ data.errors = this.errors.toObject();
1323
+ }
1324
+ return data;
1325
+ }
1326
+ serialize(w) {
1327
+ const writer = w || new pb_1.BinaryWriter();
1328
+ if (this.success != false)
1329
+ writer.writeBool(1, this.success);
1330
+ if (this.status != 0)
1331
+ writer.writeUint32(2, this.status);
1332
+ if (this.message.length)
1333
+ writer.writeString(3, this.message);
1334
+ if (this.data.length)
1335
+ writer.writeRepeatedMessage(4, this.data, (item) => item.serialize(writer));
1336
+ if (this.hasErrors)
1337
+ writer.writeMessage(5, this.errors, () => this.errors.serialize(writer));
1338
+ if (!w)
1339
+ return writer.getResultBuffer();
1340
+ }
1341
+ static deserialize(bytes) {
1342
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new CardTransactionsResponse();
1343
+ while (reader.nextField()) {
1344
+ if (reader.isEndGroup())
1345
+ break;
1346
+ switch (reader.getFieldNumber()) {
1347
+ case 1:
1348
+ message.success = reader.readBool();
1349
+ break;
1350
+ case 2:
1351
+ message.status = reader.readUint32();
1352
+ break;
1353
+ case 3:
1354
+ message.message = reader.readString();
1355
+ break;
1356
+ case 4:
1357
+ reader.readMessage(message.data, () => pb_1.Message.addToRepeatedWrapperField(message, 4, CardTransactionData.deserialize(reader), CardTransactionData));
1358
+ break;
1359
+ case 5:
1360
+ reader.readMessage(message.errors, () => message.errors = ValidationErrors.deserialize(reader));
1361
+ break;
1362
+ default: reader.skipField();
1363
+ }
1364
+ }
1365
+ return message;
1366
+ }
1367
+ serializeBinary() {
1368
+ return this.serialize();
1369
+ }
1370
+ static deserializeBinary(bytes) {
1371
+ return CardTransactionsResponse.deserialize(bytes);
1372
+ }
1373
+ }
1374
+ terminalCardTransactions.CardTransactionsResponse = CardTransactionsResponse;
1375
+ class CardTransactionData extends pb_1.Message {
1376
+ #one_of_decls = [];
1377
+ constructor(data) {
1378
+ super();
1379
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
1380
+ if (!Array.isArray(data) && typeof data == "object") {
1381
+ if ("account" in data && data.account != undefined) {
1382
+ this.account = data.account;
1383
+ }
1384
+ if ("businessId" in data && data.businessId != undefined) {
1385
+ this.businessId = data.businessId;
1386
+ }
1387
+ if ("terminalId" in data && data.terminalId != undefined) {
1388
+ this.terminalId = data.terminalId;
1389
+ }
1390
+ if ("provider" in data && data.provider != undefined) {
1391
+ this.provider = data.provider;
1392
+ }
1393
+ if ("reference" in data && data.reference != undefined) {
1394
+ this.reference = data.reference;
1395
+ }
1396
+ if ("amount" in data && data.amount != undefined) {
1397
+ this.amount = data.amount;
1398
+ }
1399
+ if ("meta" in data && data.meta != undefined) {
1400
+ this.meta = data.meta;
1401
+ }
1402
+ if ("status" in data && data.status != undefined) {
1403
+ this.status = data.status;
1404
+ }
1405
+ if ("rrn" in data && data.rrn != undefined) {
1406
+ this.rrn = data.rrn;
1407
+ }
1408
+ if ("stan" in data && data.stan != undefined) {
1409
+ this.stan = data.stan;
1410
+ }
1411
+ if ("type" in data && data.type != undefined) {
1412
+ this.type = data.type;
1413
+ }
1414
+ if ("createdAt" in data && data.createdAt != undefined) {
1415
+ this.createdAt = data.createdAt;
1416
+ }
1417
+ if ("updatedAt" in data && data.updatedAt != undefined) {
1418
+ this.updatedAt = data.updatedAt;
1419
+ }
1420
+ if ("authorizationCode" in data && data.authorizationCode != undefined) {
1421
+ this.authorizationCode = data.authorizationCode;
1422
+ }
1423
+ if ("responseCode" in data && data.responseCode != undefined) {
1424
+ this.responseCode = data.responseCode;
1425
+ }
1426
+ if ("cardDetails" in data && data.cardDetails != undefined) {
1427
+ this.cardDetails = data.cardDetails;
1428
+ }
1429
+ if ("processorData" in data && data.processorData != undefined) {
1430
+ this.processorData = data.processorData;
1431
+ }
1432
+ }
1433
+ }
1434
+ get account() {
1435
+ return pb_1.Message.getFieldWithDefault(this, 1, "");
1436
+ }
1437
+ set account(value) {
1438
+ pb_1.Message.setField(this, 1, value);
1439
+ }
1440
+ get businessId() {
1441
+ return pb_1.Message.getFieldWithDefault(this, 2, "");
1442
+ }
1443
+ set businessId(value) {
1444
+ pb_1.Message.setField(this, 2, value);
1445
+ }
1446
+ get terminalId() {
1447
+ return pb_1.Message.getFieldWithDefault(this, 3, "");
1448
+ }
1449
+ set terminalId(value) {
1450
+ pb_1.Message.setField(this, 3, value);
1451
+ }
1452
+ get provider() {
1453
+ return pb_1.Message.getFieldWithDefault(this, 4, "");
1454
+ }
1455
+ set provider(value) {
1456
+ pb_1.Message.setField(this, 4, value);
1457
+ }
1458
+ get reference() {
1459
+ return pb_1.Message.getFieldWithDefault(this, 5, "");
1460
+ }
1461
+ set reference(value) {
1462
+ pb_1.Message.setField(this, 5, value);
1463
+ }
1464
+ get amount() {
1465
+ return pb_1.Message.getFieldWithDefault(this, 6, 0);
1466
+ }
1467
+ set amount(value) {
1468
+ pb_1.Message.setField(this, 6, value);
1469
+ }
1470
+ get meta() {
1471
+ return pb_1.Message.getFieldWithDefault(this, 7, "");
1472
+ }
1473
+ set meta(value) {
1474
+ pb_1.Message.setField(this, 7, value);
1475
+ }
1476
+ get status() {
1477
+ return pb_1.Message.getFieldWithDefault(this, 8, POSTransactionStatus.PENDING);
1478
+ }
1479
+ set status(value) {
1480
+ pb_1.Message.setField(this, 8, value);
1481
+ }
1482
+ get rrn() {
1483
+ return pb_1.Message.getFieldWithDefault(this, 9, "");
1484
+ }
1485
+ set rrn(value) {
1486
+ pb_1.Message.setField(this, 9, value);
1487
+ }
1488
+ get stan() {
1489
+ return pb_1.Message.getFieldWithDefault(this, 10, "");
1490
+ }
1491
+ set stan(value) {
1492
+ pb_1.Message.setField(this, 10, value);
1493
+ }
1494
+ get type() {
1495
+ return pb_1.Message.getFieldWithDefault(this, 11, POSTransactionType.PURCHASE);
1496
+ }
1497
+ set type(value) {
1498
+ pb_1.Message.setField(this, 11, value);
1499
+ }
1500
+ get createdAt() {
1501
+ return pb_1.Message.getFieldWithDefault(this, 12, "");
1502
+ }
1503
+ set createdAt(value) {
1504
+ pb_1.Message.setField(this, 12, value);
1505
+ }
1506
+ get updatedAt() {
1507
+ return pb_1.Message.getFieldWithDefault(this, 13, "");
1508
+ }
1509
+ set updatedAt(value) {
1510
+ pb_1.Message.setField(this, 13, value);
1511
+ }
1512
+ get authorizationCode() {
1513
+ return pb_1.Message.getFieldWithDefault(this, 14, "");
1514
+ }
1515
+ set authorizationCode(value) {
1516
+ pb_1.Message.setField(this, 14, value);
1517
+ }
1518
+ get responseCode() {
1519
+ return pb_1.Message.getFieldWithDefault(this, 15, "");
1520
+ }
1521
+ set responseCode(value) {
1522
+ pb_1.Message.setField(this, 15, value);
1523
+ }
1524
+ get cardDetails() {
1525
+ return pb_1.Message.getWrapperField(this, CardDetails, 16);
1526
+ }
1527
+ set cardDetails(value) {
1528
+ pb_1.Message.setWrapperField(this, 16, value);
1529
+ }
1530
+ get hasCardDetails() {
1531
+ return pb_1.Message.getField(this, 16) != null;
1532
+ }
1533
+ get processorData() {
1534
+ return pb_1.Message.getFieldWithDefault(this, 17, "");
1535
+ }
1536
+ set processorData(value) {
1537
+ pb_1.Message.setField(this, 17, value);
1538
+ }
1539
+ static fromObject(data) {
1540
+ const message = new CardTransactionData({});
1541
+ if (data.account != null) {
1542
+ message.account = data.account;
1543
+ }
1544
+ if (data.businessId != null) {
1545
+ message.businessId = data.businessId;
1546
+ }
1547
+ if (data.terminalId != null) {
1548
+ message.terminalId = data.terminalId;
1549
+ }
1550
+ if (data.provider != null) {
1551
+ message.provider = data.provider;
1552
+ }
1553
+ if (data.reference != null) {
1554
+ message.reference = data.reference;
1555
+ }
1556
+ if (data.amount != null) {
1557
+ message.amount = data.amount;
1558
+ }
1559
+ if (data.meta != null) {
1560
+ message.meta = data.meta;
1561
+ }
1562
+ if (data.status != null) {
1563
+ message.status = data.status;
1564
+ }
1565
+ if (data.rrn != null) {
1566
+ message.rrn = data.rrn;
1567
+ }
1568
+ if (data.stan != null) {
1569
+ message.stan = data.stan;
1570
+ }
1571
+ if (data.type != null) {
1572
+ message.type = data.type;
1573
+ }
1574
+ if (data.createdAt != null) {
1575
+ message.createdAt = data.createdAt;
1576
+ }
1577
+ if (data.updatedAt != null) {
1578
+ message.updatedAt = data.updatedAt;
1579
+ }
1580
+ if (data.authorizationCode != null) {
1581
+ message.authorizationCode = data.authorizationCode;
1582
+ }
1583
+ if (data.responseCode != null) {
1584
+ message.responseCode = data.responseCode;
1585
+ }
1586
+ if (data.cardDetails != null) {
1587
+ message.cardDetails = CardDetails.fromObject(data.cardDetails);
1588
+ }
1589
+ if (data.processorData != null) {
1590
+ message.processorData = data.processorData;
1591
+ }
1592
+ return message;
1593
+ }
1594
+ toObject() {
1595
+ const data = {};
1596
+ if (this.account != null) {
1597
+ data.account = this.account;
1598
+ }
1599
+ if (this.businessId != null) {
1600
+ data.businessId = this.businessId;
1601
+ }
1602
+ if (this.terminalId != null) {
1603
+ data.terminalId = this.terminalId;
1604
+ }
1605
+ if (this.provider != null) {
1606
+ data.provider = this.provider;
1607
+ }
1608
+ if (this.reference != null) {
1609
+ data.reference = this.reference;
1610
+ }
1611
+ if (this.amount != null) {
1612
+ data.amount = this.amount;
1613
+ }
1614
+ if (this.meta != null) {
1615
+ data.meta = this.meta;
1616
+ }
1617
+ if (this.status != null) {
1618
+ data.status = this.status;
1619
+ }
1620
+ if (this.rrn != null) {
1621
+ data.rrn = this.rrn;
1622
+ }
1623
+ if (this.stan != null) {
1624
+ data.stan = this.stan;
1625
+ }
1626
+ if (this.type != null) {
1627
+ data.type = this.type;
1628
+ }
1629
+ if (this.createdAt != null) {
1630
+ data.createdAt = this.createdAt;
1631
+ }
1632
+ if (this.updatedAt != null) {
1633
+ data.updatedAt = this.updatedAt;
1634
+ }
1635
+ if (this.authorizationCode != null) {
1636
+ data.authorizationCode = this.authorizationCode;
1637
+ }
1638
+ if (this.responseCode != null) {
1639
+ data.responseCode = this.responseCode;
1640
+ }
1641
+ if (this.cardDetails != null) {
1642
+ data.cardDetails = this.cardDetails.toObject();
1643
+ }
1644
+ if (this.processorData != null) {
1645
+ data.processorData = this.processorData;
1646
+ }
1647
+ return data;
1648
+ }
1649
+ serialize(w) {
1650
+ const writer = w || new pb_1.BinaryWriter();
1651
+ if (this.account.length)
1652
+ writer.writeString(1, this.account);
1653
+ if (this.businessId.length)
1654
+ writer.writeString(2, this.businessId);
1655
+ if (this.terminalId.length)
1656
+ writer.writeString(3, this.terminalId);
1657
+ if (this.provider.length)
1658
+ writer.writeString(4, this.provider);
1659
+ if (this.reference.length)
1660
+ writer.writeString(5, this.reference);
1661
+ if (this.amount != 0)
1662
+ writer.writeDouble(6, this.amount);
1663
+ if (this.meta.length)
1664
+ writer.writeString(7, this.meta);
1665
+ if (this.status != POSTransactionStatus.PENDING)
1666
+ writer.writeEnum(8, this.status);
1667
+ if (this.rrn.length)
1668
+ writer.writeString(9, this.rrn);
1669
+ if (this.stan.length)
1670
+ writer.writeString(10, this.stan);
1671
+ if (this.type != POSTransactionType.PURCHASE)
1672
+ writer.writeEnum(11, this.type);
1673
+ if (this.createdAt.length)
1674
+ writer.writeString(12, this.createdAt);
1675
+ if (this.updatedAt.length)
1676
+ writer.writeString(13, this.updatedAt);
1677
+ if (this.authorizationCode.length)
1678
+ writer.writeString(14, this.authorizationCode);
1679
+ if (this.responseCode.length)
1680
+ writer.writeString(15, this.responseCode);
1681
+ if (this.hasCardDetails)
1682
+ writer.writeMessage(16, this.cardDetails, () => this.cardDetails.serialize(writer));
1683
+ if (this.processorData.length)
1684
+ writer.writeString(17, this.processorData);
1685
+ if (!w)
1686
+ return writer.getResultBuffer();
1687
+ }
1688
+ static deserialize(bytes) {
1689
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new CardTransactionData();
1690
+ while (reader.nextField()) {
1691
+ if (reader.isEndGroup())
1692
+ break;
1693
+ switch (reader.getFieldNumber()) {
1694
+ case 1:
1695
+ message.account = reader.readString();
1696
+ break;
1697
+ case 2:
1698
+ message.businessId = reader.readString();
1699
+ break;
1700
+ case 3:
1701
+ message.terminalId = reader.readString();
1702
+ break;
1703
+ case 4:
1704
+ message.provider = reader.readString();
1705
+ break;
1706
+ case 5:
1707
+ message.reference = reader.readString();
1708
+ break;
1709
+ case 6:
1710
+ message.amount = reader.readDouble();
1711
+ break;
1712
+ case 7:
1713
+ message.meta = reader.readString();
1714
+ break;
1715
+ case 8:
1716
+ message.status = reader.readEnum();
1717
+ break;
1718
+ case 9:
1719
+ message.rrn = reader.readString();
1720
+ break;
1721
+ case 10:
1722
+ message.stan = reader.readString();
1723
+ break;
1724
+ case 11:
1725
+ message.type = reader.readEnum();
1726
+ break;
1727
+ case 12:
1728
+ message.createdAt = reader.readString();
1729
+ break;
1730
+ case 13:
1731
+ message.updatedAt = reader.readString();
1732
+ break;
1733
+ case 14:
1734
+ message.authorizationCode = reader.readString();
1735
+ break;
1736
+ case 15:
1737
+ message.responseCode = reader.readString();
1738
+ break;
1739
+ case 16:
1740
+ reader.readMessage(message.cardDetails, () => message.cardDetails = CardDetails.deserialize(reader));
1741
+ break;
1742
+ case 17:
1743
+ message.processorData = reader.readString();
1744
+ break;
1745
+ default: reader.skipField();
1746
+ }
1747
+ }
1748
+ return message;
1749
+ }
1750
+ serializeBinary() {
1751
+ return this.serialize();
1752
+ }
1753
+ static deserializeBinary(bytes) {
1754
+ return CardTransactionData.deserialize(bytes);
1755
+ }
1756
+ }
1757
+ terminalCardTransactions.CardTransactionData = CardTransactionData;
1758
+ class CardDetails extends pb_1.Message {
1759
+ #one_of_decls = [];
1760
+ constructor(data) {
1761
+ super();
1762
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
1763
+ if (!Array.isArray(data) && typeof data == "object") {
1764
+ if ("maskedPan" in data && data.maskedPan != undefined) {
1765
+ this.maskedPan = data.maskedPan;
1766
+ }
1767
+ if ("cardBrand" in data && data.cardBrand != undefined) {
1768
+ this.cardBrand = data.cardBrand;
1769
+ }
1770
+ if ("cardType" in data && data.cardType != undefined) {
1771
+ this.cardType = data.cardType;
1772
+ }
1773
+ if ("expiryMonth" in data && data.expiryMonth != undefined) {
1774
+ this.expiryMonth = data.expiryMonth;
1775
+ }
1776
+ if ("expiryYear" in data && data.expiryYear != undefined) {
1777
+ this.expiryYear = data.expiryYear;
1778
+ }
1779
+ }
1780
+ }
1781
+ get maskedPan() {
1782
+ return pb_1.Message.getFieldWithDefault(this, 1, "");
1783
+ }
1784
+ set maskedPan(value) {
1785
+ pb_1.Message.setField(this, 1, value);
1786
+ }
1787
+ get cardBrand() {
1788
+ return pb_1.Message.getFieldWithDefault(this, 2, "");
1789
+ }
1790
+ set cardBrand(value) {
1791
+ pb_1.Message.setField(this, 2, value);
1792
+ }
1793
+ get cardType() {
1794
+ return pb_1.Message.getFieldWithDefault(this, 3, "");
1795
+ }
1796
+ set cardType(value) {
1797
+ pb_1.Message.setField(this, 3, value);
1798
+ }
1799
+ get expiryMonth() {
1800
+ return pb_1.Message.getFieldWithDefault(this, 4, "");
1801
+ }
1802
+ set expiryMonth(value) {
1803
+ pb_1.Message.setField(this, 4, value);
1804
+ }
1805
+ get expiryYear() {
1806
+ return pb_1.Message.getFieldWithDefault(this, 5, "");
1807
+ }
1808
+ set expiryYear(value) {
1809
+ pb_1.Message.setField(this, 5, value);
1810
+ }
1811
+ static fromObject(data) {
1812
+ const message = new CardDetails({});
1813
+ if (data.maskedPan != null) {
1814
+ message.maskedPan = data.maskedPan;
1815
+ }
1816
+ if (data.cardBrand != null) {
1817
+ message.cardBrand = data.cardBrand;
1818
+ }
1819
+ if (data.cardType != null) {
1820
+ message.cardType = data.cardType;
1821
+ }
1822
+ if (data.expiryMonth != null) {
1823
+ message.expiryMonth = data.expiryMonth;
1824
+ }
1825
+ if (data.expiryYear != null) {
1826
+ message.expiryYear = data.expiryYear;
1827
+ }
1828
+ return message;
1829
+ }
1830
+ toObject() {
1831
+ const data = {};
1832
+ if (this.maskedPan != null) {
1833
+ data.maskedPan = this.maskedPan;
1834
+ }
1835
+ if (this.cardBrand != null) {
1836
+ data.cardBrand = this.cardBrand;
1837
+ }
1838
+ if (this.cardType != null) {
1839
+ data.cardType = this.cardType;
1840
+ }
1841
+ if (this.expiryMonth != null) {
1842
+ data.expiryMonth = this.expiryMonth;
1843
+ }
1844
+ if (this.expiryYear != null) {
1845
+ data.expiryYear = this.expiryYear;
1846
+ }
1847
+ return data;
1848
+ }
1849
+ serialize(w) {
1850
+ const writer = w || new pb_1.BinaryWriter();
1851
+ if (this.maskedPan.length)
1852
+ writer.writeString(1, this.maskedPan);
1853
+ if (this.cardBrand.length)
1854
+ writer.writeString(2, this.cardBrand);
1855
+ if (this.cardType.length)
1856
+ writer.writeString(3, this.cardType);
1857
+ if (this.expiryMonth.length)
1858
+ writer.writeString(4, this.expiryMonth);
1859
+ if (this.expiryYear.length)
1860
+ writer.writeString(5, this.expiryYear);
1861
+ if (!w)
1862
+ return writer.getResultBuffer();
1863
+ }
1864
+ static deserialize(bytes) {
1865
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new CardDetails();
1866
+ while (reader.nextField()) {
1867
+ if (reader.isEndGroup())
1868
+ break;
1869
+ switch (reader.getFieldNumber()) {
1870
+ case 1:
1871
+ message.maskedPan = reader.readString();
1872
+ break;
1873
+ case 2:
1874
+ message.cardBrand = reader.readString();
1875
+ break;
1876
+ case 3:
1877
+ message.cardType = reader.readString();
1878
+ break;
1879
+ case 4:
1880
+ message.expiryMonth = reader.readString();
1881
+ break;
1882
+ case 5:
1883
+ message.expiryYear = reader.readString();
1884
+ break;
1885
+ default: reader.skipField();
1886
+ }
1887
+ }
1888
+ return message;
1889
+ }
1890
+ serializeBinary() {
1891
+ return this.serialize();
1892
+ }
1893
+ static deserializeBinary(bytes) {
1894
+ return CardDetails.deserialize(bytes);
1895
+ }
1896
+ }
1897
+ terminalCardTransactions.CardDetails = CardDetails;
1898
+ class ValidationErrors extends pb_1.Message {
1899
+ #one_of_decls = [];
1900
+ constructor(data) {
1901
+ super();
1902
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
1903
+ if (!Array.isArray(data) && typeof data == "object") {
1904
+ if ("field" in data && data.field != undefined) {
1905
+ this.field = data.field;
1906
+ }
1907
+ if ("message" in data && data.message != undefined) {
1908
+ this.message = data.message;
1909
+ }
1910
+ }
1911
+ }
1912
+ get field() {
1913
+ return pb_1.Message.getFieldWithDefault(this, 1, "");
1914
+ }
1915
+ set field(value) {
1916
+ pb_1.Message.setField(this, 1, value);
1917
+ }
1918
+ get message() {
1919
+ return pb_1.Message.getFieldWithDefault(this, 2, "");
1920
+ }
1921
+ set message(value) {
1922
+ pb_1.Message.setField(this, 2, value);
1923
+ }
1924
+ static fromObject(data) {
1925
+ const message = new ValidationErrors({});
1926
+ if (data.field != null) {
1927
+ message.field = data.field;
1928
+ }
1929
+ if (data.message != null) {
1930
+ message.message = data.message;
1931
+ }
1932
+ return message;
1933
+ }
1934
+ toObject() {
1935
+ const data = {};
1936
+ if (this.field != null) {
1937
+ data.field = this.field;
1938
+ }
1939
+ if (this.message != null) {
1940
+ data.message = this.message;
1941
+ }
1942
+ return data;
1943
+ }
1944
+ serialize(w) {
1945
+ const writer = w || new pb_1.BinaryWriter();
1946
+ if (this.field.length)
1947
+ writer.writeString(1, this.field);
1948
+ if (this.message.length)
1949
+ writer.writeString(2, this.message);
1950
+ if (!w)
1951
+ return writer.getResultBuffer();
1952
+ }
1953
+ static deserialize(bytes) {
1954
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ValidationErrors();
1955
+ while (reader.nextField()) {
1956
+ if (reader.isEndGroup())
1957
+ break;
1958
+ switch (reader.getFieldNumber()) {
1959
+ case 1:
1960
+ message.field = reader.readString();
1961
+ break;
1962
+ case 2:
1963
+ message.message = reader.readString();
1964
+ break;
1965
+ default: reader.skipField();
1966
+ }
1967
+ }
1968
+ return message;
1969
+ }
1970
+ serializeBinary() {
1971
+ return this.serialize();
1972
+ }
1973
+ static deserializeBinary(bytes) {
1974
+ return ValidationErrors.deserialize(bytes);
1975
+ }
1976
+ }
1977
+ terminalCardTransactions.ValidationErrors = ValidationErrors;
1978
+ class InitializeCardTransactionData extends pb_1.Message {
1979
+ #one_of_decls = [];
1980
+ constructor(data) {
1981
+ super();
1982
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
1983
+ if (!Array.isArray(data) && typeof data == "object") {
1984
+ if ("transactionId" in data && data.transactionId != undefined) {
1985
+ this.transactionId = data.transactionId;
1986
+ }
1987
+ if ("rrn" in data && data.rrn != undefined) {
1988
+ this.rrn = data.rrn;
1989
+ }
1990
+ if ("stan" in data && data.stan != undefined) {
1991
+ this.stan = data.stan;
1992
+ }
1993
+ if ("route" in data && data.route != undefined) {
1994
+ this.route = data.route;
1995
+ }
1996
+ if ("reference" in data && data.reference != undefined) {
1997
+ this.reference = data.reference;
1998
+ }
1999
+ if ("encryptedData" in data && data.encryptedData != undefined) {
2000
+ this.encryptedData = data.encryptedData;
2001
+ }
2002
+ }
2003
+ }
2004
+ get transactionId() {
2005
+ return pb_1.Message.getFieldWithDefault(this, 1, "");
2006
+ }
2007
+ set transactionId(value) {
2008
+ pb_1.Message.setField(this, 1, value);
2009
+ }
2010
+ get rrn() {
2011
+ return pb_1.Message.getFieldWithDefault(this, 2, "");
2012
+ }
2013
+ set rrn(value) {
2014
+ pb_1.Message.setField(this, 2, value);
2015
+ }
2016
+ get stan() {
2017
+ return pb_1.Message.getFieldWithDefault(this, 3, "");
2018
+ }
2019
+ set stan(value) {
2020
+ pb_1.Message.setField(this, 3, value);
2021
+ }
2022
+ get route() {
2023
+ return pb_1.Message.getFieldWithDefault(this, 4, "");
2024
+ }
2025
+ set route(value) {
2026
+ pb_1.Message.setField(this, 4, value);
2027
+ }
2028
+ get reference() {
2029
+ return pb_1.Message.getFieldWithDefault(this, 5, "");
2030
+ }
2031
+ set reference(value) {
2032
+ pb_1.Message.setField(this, 5, value);
2033
+ }
2034
+ get encryptedData() {
2035
+ return pb_1.Message.getFieldWithDefault(this, 6, "");
2036
+ }
2037
+ set encryptedData(value) {
2038
+ pb_1.Message.setField(this, 6, value);
2039
+ }
2040
+ static fromObject(data) {
2041
+ const message = new InitializeCardTransactionData({});
2042
+ if (data.transactionId != null) {
2043
+ message.transactionId = data.transactionId;
2044
+ }
2045
+ if (data.rrn != null) {
2046
+ message.rrn = data.rrn;
2047
+ }
2048
+ if (data.stan != null) {
2049
+ message.stan = data.stan;
2050
+ }
2051
+ if (data.route != null) {
2052
+ message.route = data.route;
2053
+ }
2054
+ if (data.reference != null) {
2055
+ message.reference = data.reference;
2056
+ }
2057
+ if (data.encryptedData != null) {
2058
+ message.encryptedData = data.encryptedData;
2059
+ }
2060
+ return message;
2061
+ }
2062
+ toObject() {
2063
+ const data = {};
2064
+ if (this.transactionId != null) {
2065
+ data.transactionId = this.transactionId;
2066
+ }
2067
+ if (this.rrn != null) {
2068
+ data.rrn = this.rrn;
2069
+ }
2070
+ if (this.stan != null) {
2071
+ data.stan = this.stan;
2072
+ }
2073
+ if (this.route != null) {
2074
+ data.route = this.route;
2075
+ }
2076
+ if (this.reference != null) {
2077
+ data.reference = this.reference;
2078
+ }
2079
+ if (this.encryptedData != null) {
2080
+ data.encryptedData = this.encryptedData;
2081
+ }
2082
+ return data;
2083
+ }
2084
+ serialize(w) {
2085
+ const writer = w || new pb_1.BinaryWriter();
2086
+ if (this.transactionId.length)
2087
+ writer.writeString(1, this.transactionId);
2088
+ if (this.rrn.length)
2089
+ writer.writeString(2, this.rrn);
2090
+ if (this.stan.length)
2091
+ writer.writeString(3, this.stan);
2092
+ if (this.route.length)
2093
+ writer.writeString(4, this.route);
2094
+ if (this.reference.length)
2095
+ writer.writeString(5, this.reference);
2096
+ if (this.encryptedData.length)
2097
+ writer.writeString(6, this.encryptedData);
2098
+ if (!w)
2099
+ return writer.getResultBuffer();
2100
+ }
2101
+ static deserialize(bytes) {
2102
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new InitializeCardTransactionData();
2103
+ while (reader.nextField()) {
2104
+ if (reader.isEndGroup())
2105
+ break;
2106
+ switch (reader.getFieldNumber()) {
2107
+ case 1:
2108
+ message.transactionId = reader.readString();
2109
+ break;
2110
+ case 2:
2111
+ message.rrn = reader.readString();
2112
+ break;
2113
+ case 3:
2114
+ message.stan = reader.readString();
2115
+ break;
2116
+ case 4:
2117
+ message.route = reader.readString();
2118
+ break;
2119
+ case 5:
2120
+ message.reference = reader.readString();
2121
+ break;
2122
+ case 6:
2123
+ message.encryptedData = reader.readString();
2124
+ break;
2125
+ default: reader.skipField();
2126
+ }
2127
+ }
2128
+ return message;
2129
+ }
2130
+ serializeBinary() {
2131
+ return this.serialize();
2132
+ }
2133
+ static deserializeBinary(bytes) {
2134
+ return InitializeCardTransactionData.deserialize(bytes);
2135
+ }
2136
+ }
2137
+ terminalCardTransactions.InitializeCardTransactionData = InitializeCardTransactionData;
2138
+ class InitializeCardTransactionResponse extends pb_1.Message {
2139
+ #one_of_decls = [];
2140
+ constructor(data) {
2141
+ super();
2142
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
2143
+ if (!Array.isArray(data) && typeof data == "object") {
2144
+ if ("success" in data && data.success != undefined) {
2145
+ this.success = data.success;
2146
+ }
2147
+ if ("status" in data && data.status != undefined) {
2148
+ this.status = data.status;
2149
+ }
2150
+ if ("message" in data && data.message != undefined) {
2151
+ this.message = data.message;
2152
+ }
2153
+ if ("data" in data && data.data != undefined) {
2154
+ this.data = data.data;
2155
+ }
2156
+ if ("errors" in data && data.errors != undefined) {
2157
+ this.errors = data.errors;
2158
+ }
2159
+ }
2160
+ }
2161
+ get success() {
2162
+ return pb_1.Message.getFieldWithDefault(this, 1, false);
2163
+ }
2164
+ set success(value) {
2165
+ pb_1.Message.setField(this, 1, value);
2166
+ }
2167
+ get status() {
2168
+ return pb_1.Message.getFieldWithDefault(this, 2, 0);
2169
+ }
2170
+ set status(value) {
2171
+ pb_1.Message.setField(this, 2, value);
2172
+ }
2173
+ get message() {
2174
+ return pb_1.Message.getFieldWithDefault(this, 3, "");
2175
+ }
2176
+ set message(value) {
2177
+ pb_1.Message.setField(this, 3, value);
2178
+ }
2179
+ get data() {
2180
+ return pb_1.Message.getWrapperField(this, InitializeCardTransactionData, 4);
2181
+ }
2182
+ set data(value) {
2183
+ pb_1.Message.setWrapperField(this, 4, value);
2184
+ }
2185
+ get hasData() {
2186
+ return pb_1.Message.getField(this, 4) != null;
2187
+ }
2188
+ get errors() {
2189
+ return pb_1.Message.getWrapperField(this, ValidationErrors, 5);
2190
+ }
2191
+ set errors(value) {
2192
+ pb_1.Message.setWrapperField(this, 5, value);
2193
+ }
2194
+ get hasErrors() {
2195
+ return pb_1.Message.getField(this, 5) != null;
2196
+ }
2197
+ static fromObject(data) {
2198
+ const message = new InitializeCardTransactionResponse({});
2199
+ if (data.success != null) {
2200
+ message.success = data.success;
2201
+ }
2202
+ if (data.status != null) {
2203
+ message.status = data.status;
2204
+ }
2205
+ if (data.message != null) {
2206
+ message.message = data.message;
2207
+ }
2208
+ if (data.data != null) {
2209
+ message.data = InitializeCardTransactionData.fromObject(data.data);
2210
+ }
2211
+ if (data.errors != null) {
2212
+ message.errors = ValidationErrors.fromObject(data.errors);
2213
+ }
2214
+ return message;
2215
+ }
2216
+ toObject() {
2217
+ const data = {};
2218
+ if (this.success != null) {
2219
+ data.success = this.success;
2220
+ }
2221
+ if (this.status != null) {
2222
+ data.status = this.status;
2223
+ }
2224
+ if (this.message != null) {
2225
+ data.message = this.message;
2226
+ }
2227
+ if (this.data != null) {
2228
+ data.data = this.data.toObject();
2229
+ }
2230
+ if (this.errors != null) {
2231
+ data.errors = this.errors.toObject();
2232
+ }
2233
+ return data;
2234
+ }
2235
+ serialize(w) {
2236
+ const writer = w || new pb_1.BinaryWriter();
2237
+ if (this.success != false)
2238
+ writer.writeBool(1, this.success);
2239
+ if (this.status != 0)
2240
+ writer.writeUint32(2, this.status);
2241
+ if (this.message.length)
2242
+ writer.writeString(3, this.message);
2243
+ if (this.hasData)
2244
+ writer.writeMessage(4, this.data, () => this.data.serialize(writer));
2245
+ if (this.hasErrors)
2246
+ writer.writeMessage(5, this.errors, () => this.errors.serialize(writer));
2247
+ if (!w)
2248
+ return writer.getResultBuffer();
2249
+ }
2250
+ static deserialize(bytes) {
2251
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new InitializeCardTransactionResponse();
2252
+ while (reader.nextField()) {
2253
+ if (reader.isEndGroup())
2254
+ break;
2255
+ switch (reader.getFieldNumber()) {
2256
+ case 1:
2257
+ message.success = reader.readBool();
2258
+ break;
2259
+ case 2:
2260
+ message.status = reader.readUint32();
2261
+ break;
2262
+ case 3:
2263
+ message.message = reader.readString();
2264
+ break;
2265
+ case 4:
2266
+ reader.readMessage(message.data, () => message.data = InitializeCardTransactionData.deserialize(reader));
2267
+ break;
2268
+ case 5:
2269
+ reader.readMessage(message.errors, () => message.errors = ValidationErrors.deserialize(reader));
2270
+ break;
2271
+ default: reader.skipField();
2272
+ }
2273
+ }
2274
+ return message;
2275
+ }
2276
+ serializeBinary() {
2277
+ return this.serialize();
2278
+ }
2279
+ static deserializeBinary(bytes) {
2280
+ return InitializeCardTransactionResponse.deserialize(bytes);
2281
+ }
2282
+ }
2283
+ terminalCardTransactions.InitializeCardTransactionResponse = InitializeCardTransactionResponse;
2284
+ class UnimplementedTerminalCardTransactionServiceService {
2285
+ static definition = {
2286
+ InitializeCardTransaction: {
2287
+ path: "/com.pkg.posv1.terminalCardTransactions.TerminalCardTransactionService/InitializeCardTransaction",
2288
+ requestStream: false,
2289
+ responseStream: false,
2290
+ requestSerialize: (message) => Buffer.from(message.serialize()),
2291
+ requestDeserialize: (bytes) => InitializeCardTransactionRequest.deserialize(new Uint8Array(bytes)),
2292
+ responseSerialize: (message) => Buffer.from(message.serialize()),
2293
+ responseDeserialize: (bytes) => CardTransactionResponse.deserialize(new Uint8Array(bytes))
2294
+ },
2295
+ ConfirmCardTransaction: {
2296
+ path: "/com.pkg.posv1.terminalCardTransactions.TerminalCardTransactionService/ConfirmCardTransaction",
2297
+ requestStream: false,
2298
+ responseStream: false,
2299
+ requestSerialize: (message) => Buffer.from(message.serialize()),
2300
+ requestDeserialize: (bytes) => ConfirmCardTransactionRequest.deserialize(new Uint8Array(bytes)),
2301
+ responseSerialize: (message) => Buffer.from(message.serialize()),
2302
+ responseDeserialize: (bytes) => CardTransactionResponse.deserialize(new Uint8Array(bytes))
2303
+ },
2304
+ GetCardTransaction: {
2305
+ path: "/com.pkg.posv1.terminalCardTransactions.TerminalCardTransactionService/GetCardTransaction",
2306
+ requestStream: false,
2307
+ responseStream: false,
2308
+ requestSerialize: (message) => Buffer.from(message.serialize()),
2309
+ requestDeserialize: (bytes) => GetCardTransactionRequest.deserialize(new Uint8Array(bytes)),
2310
+ responseSerialize: (message) => Buffer.from(message.serialize()),
2311
+ responseDeserialize: (bytes) => CardTransactionResponse.deserialize(new Uint8Array(bytes))
2312
+ },
2313
+ GetCardTransactions: {
2314
+ path: "/com.pkg.posv1.terminalCardTransactions.TerminalCardTransactionService/GetCardTransactions",
2315
+ requestStream: false,
2316
+ responseStream: false,
2317
+ requestSerialize: (message) => Buffer.from(message.serialize()),
2318
+ requestDeserialize: (bytes) => QueryCardTransactionsRequest.deserialize(new Uint8Array(bytes)),
2319
+ responseSerialize: (message) => Buffer.from(message.serialize()),
2320
+ responseDeserialize: (bytes) => CardTransactionsResponse.deserialize(new Uint8Array(bytes))
2321
+ },
2322
+ GetReversalTransactions: {
2323
+ path: "/com.pkg.posv1.terminalCardTransactions.TerminalCardTransactionService/GetReversalTransactions",
2324
+ requestStream: false,
2325
+ responseStream: false,
2326
+ requestSerialize: (message) => Buffer.from(message.serialize()),
2327
+ requestDeserialize: (bytes) => GetCardTransactionRequest.deserialize(new Uint8Array(bytes)),
2328
+ responseSerialize: (message) => Buffer.from(message.serialize()),
2329
+ responseDeserialize: (bytes) => CardTransactionsResponse.deserialize(new Uint8Array(bytes))
2330
+ },
2331
+ SaveReversalTransaction: {
2332
+ path: "/com.pkg.posv1.terminalCardTransactions.TerminalCardTransactionService/SaveReversalTransaction",
2333
+ requestStream: false,
2334
+ responseStream: false,
2335
+ requestSerialize: (message) => Buffer.from(message.serialize()),
2336
+ requestDeserialize: (bytes) => SaveReversalTransactionRequest.deserialize(new Uint8Array(bytes)),
2337
+ responseSerialize: (message) => Buffer.from(message.serialize()),
2338
+ responseDeserialize: (bytes) => CardTransactionResponse.deserialize(new Uint8Array(bytes))
2339
+ },
2340
+ DeleteReversalTransaction: {
2341
+ path: "/com.pkg.posv1.terminalCardTransactions.TerminalCardTransactionService/DeleteReversalTransaction",
2342
+ requestStream: false,
2343
+ responseStream: false,
2344
+ requestSerialize: (message) => Buffer.from(message.serialize()),
2345
+ requestDeserialize: (bytes) => DeleteReversalTransactionRequest.deserialize(new Uint8Array(bytes)),
2346
+ responseSerialize: (message) => Buffer.from(message.serialize()),
2347
+ responseDeserialize: (bytes) => CardTransactionResponse.deserialize(new Uint8Array(bytes))
2348
+ }
2349
+ };
2350
+ }
2351
+ terminalCardTransactions.UnimplementedTerminalCardTransactionServiceService = UnimplementedTerminalCardTransactionServiceService;
2352
+ class TerminalCardTransactionServiceClient extends grpc_1.makeGenericClientConstructor(UnimplementedTerminalCardTransactionServiceService.definition, "TerminalCardTransactionService", {}) {
2353
+ constructor(address, credentials, options) {
2354
+ super(address, credentials, options);
2355
+ }
2356
+ InitializeCardTransaction = (message, metadata, options) => {
2357
+ if (!metadata) {
2358
+ metadata = new grpc_1.Metadata;
2359
+ }
2360
+ if (!options) {
2361
+ options = {};
2362
+ }
2363
+ return new Promise((resolve, reject) => super.InitializeCardTransaction(message, metadata, options, (error, response) => {
2364
+ if (error) {
2365
+ reject(error);
2366
+ }
2367
+ else {
2368
+ resolve(response);
2369
+ }
2370
+ }));
2371
+ };
2372
+ ConfirmCardTransaction = (message, metadata, options) => {
2373
+ if (!metadata) {
2374
+ metadata = new grpc_1.Metadata;
2375
+ }
2376
+ if (!options) {
2377
+ options = {};
2378
+ }
2379
+ return new Promise((resolve, reject) => super.ConfirmCardTransaction(message, metadata, options, (error, response) => {
2380
+ if (error) {
2381
+ reject(error);
2382
+ }
2383
+ else {
2384
+ resolve(response);
2385
+ }
2386
+ }));
2387
+ };
2388
+ GetCardTransaction = (message, metadata, options) => {
2389
+ if (!metadata) {
2390
+ metadata = new grpc_1.Metadata;
2391
+ }
2392
+ if (!options) {
2393
+ options = {};
2394
+ }
2395
+ return new Promise((resolve, reject) => super.GetCardTransaction(message, metadata, options, (error, response) => {
2396
+ if (error) {
2397
+ reject(error);
2398
+ }
2399
+ else {
2400
+ resolve(response);
2401
+ }
2402
+ }));
2403
+ };
2404
+ GetCardTransactions = (message, metadata, options) => {
2405
+ if (!metadata) {
2406
+ metadata = new grpc_1.Metadata;
2407
+ }
2408
+ if (!options) {
2409
+ options = {};
2410
+ }
2411
+ return new Promise((resolve, reject) => super.GetCardTransactions(message, metadata, options, (error, response) => {
2412
+ if (error) {
2413
+ reject(error);
2414
+ }
2415
+ else {
2416
+ resolve(response);
2417
+ }
2418
+ }));
2419
+ };
2420
+ GetReversalTransactions = (message, metadata, options) => {
2421
+ if (!metadata) {
2422
+ metadata = new grpc_1.Metadata;
2423
+ }
2424
+ if (!options) {
2425
+ options = {};
2426
+ }
2427
+ return new Promise((resolve, reject) => super.GetReversalTransactions(message, metadata, options, (error, response) => {
2428
+ if (error) {
2429
+ reject(error);
2430
+ }
2431
+ else {
2432
+ resolve(response);
2433
+ }
2434
+ }));
2435
+ };
2436
+ SaveReversalTransaction = (message, metadata, options) => {
2437
+ if (!metadata) {
2438
+ metadata = new grpc_1.Metadata;
2439
+ }
2440
+ if (!options) {
2441
+ options = {};
2442
+ }
2443
+ return new Promise((resolve, reject) => super.SaveReversalTransaction(message, metadata, options, (error, response) => {
2444
+ if (error) {
2445
+ reject(error);
2446
+ }
2447
+ else {
2448
+ resolve(response);
2449
+ }
2450
+ }));
2451
+ };
2452
+ DeleteReversalTransaction = (message, metadata, options) => {
2453
+ if (!metadata) {
2454
+ metadata = new grpc_1.Metadata;
2455
+ }
2456
+ if (!options) {
2457
+ options = {};
2458
+ }
2459
+ return new Promise((resolve, reject) => super.DeleteReversalTransaction(message, metadata, options, (error, response) => {
2460
+ if (error) {
2461
+ reject(error);
2462
+ }
2463
+ else {
2464
+ resolve(response);
2465
+ }
2466
+ }));
2467
+ };
2468
+ }
2469
+ terminalCardTransactions.TerminalCardTransactionServiceClient = TerminalCardTransactionServiceClient;
2470
+ })(terminalCardTransactions = posv1.terminalCardTransactions || (posv1.terminalCardTransactions = {}));
2471
+ })(posv1 = pkg.posv1 || (pkg.posv1 = {}));
2472
+ })(pkg = com.pkg || (com.pkg = {}));
2473
+ })(com || (exports.com = com = {}));