@technova-tech/olive-proto-lib 2.5.6 → 2.5.8

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