@stashfin/grpc 1.3.8 → 1.3.10

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.
@@ -8,54 +8,187 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
8
8
  return (mod && mod.__esModule) ? mod : { "default": mod };
9
9
  };
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.BDTransactionResponse = exports.AuthSessionResponse = exports.TxnResponse = exports.BDTransactionRequest = exports.BDWebhookRequest = exports.protobufPackage = void 0;
11
+ exports.BDTransactionResponse = exports.AuthSessionResponse = exports.TxnResponse = exports.BDTransactionRequest = exports.Metadata = exports.CustomerContext = exports.PaymentDetails = exports.PaymentAdditionalInfo = exports.protobufPackage = void 0;
12
12
  /* eslint-disable */
13
+ const long_1 = __importDefault(require("long"));
13
14
  const minimal_1 = __importDefault(require("protobufjs/minimal"));
14
15
  exports.protobufPackage = "bbps.processwebhook";
15
- function createBaseBDWebhookRequest() {
16
+ function createBasePaymentAdditionalInfo() {
17
+ return { additional_info1: undefined, additional_info2: undefined, additional_info3: undefined };
18
+ }
19
+ exports.PaymentAdditionalInfo = {
20
+ encode(message, writer = minimal_1.default.Writer.create()) {
21
+ if (message.additional_info1 !== undefined) {
22
+ writer.uint32(10).string(message.additional_info1);
23
+ }
24
+ if (message.additional_info2 !== undefined) {
25
+ writer.uint32(18).string(message.additional_info2);
26
+ }
27
+ if (message.additional_info3 !== undefined) {
28
+ writer.uint32(26).string(message.additional_info3);
29
+ }
30
+ return writer;
31
+ },
32
+ decode(input, length) {
33
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
34
+ let end = length === undefined ? reader.len : reader.pos + length;
35
+ const message = createBasePaymentAdditionalInfo();
36
+ while (reader.pos < end) {
37
+ const tag = reader.uint32();
38
+ switch (tag >>> 3) {
39
+ case 1:
40
+ if (tag !== 10) {
41
+ break;
42
+ }
43
+ message.additional_info1 = reader.string();
44
+ continue;
45
+ case 2:
46
+ if (tag !== 18) {
47
+ break;
48
+ }
49
+ message.additional_info2 = reader.string();
50
+ continue;
51
+ case 3:
52
+ if (tag !== 26) {
53
+ break;
54
+ }
55
+ message.additional_info3 = reader.string();
56
+ continue;
57
+ }
58
+ if ((tag & 7) === 4 || tag === 0) {
59
+ break;
60
+ }
61
+ reader.skipType(tag & 7);
62
+ }
63
+ return message;
64
+ },
65
+ fromJSON(object) {
66
+ return {
67
+ additional_info1: isSet(object.additional_info1) ? globalThis.String(object.additional_info1) : undefined,
68
+ additional_info2: isSet(object.additional_info2) ? globalThis.String(object.additional_info2) : undefined,
69
+ additional_info3: isSet(object.additional_info3) ? globalThis.String(object.additional_info3) : undefined,
70
+ };
71
+ },
72
+ toJSON(message) {
73
+ const obj = {};
74
+ if (message.additional_info1 !== undefined) {
75
+ obj.additional_info1 = message.additional_info1;
76
+ }
77
+ if (message.additional_info2 !== undefined) {
78
+ obj.additional_info2 = message.additional_info2;
79
+ }
80
+ if (message.additional_info3 !== undefined) {
81
+ obj.additional_info3 = message.additional_info3;
82
+ }
83
+ return obj;
84
+ },
85
+ create(base) {
86
+ return exports.PaymentAdditionalInfo.fromPartial(base ?? {});
87
+ },
88
+ fromPartial(object) {
89
+ const message = createBasePaymentAdditionalInfo();
90
+ message.additional_info1 = object.additional_info1 ?? undefined;
91
+ message.additional_info2 = object.additional_info2 ?? undefined;
92
+ message.additional_info3 = object.additional_info3 ?? undefined;
93
+ return message;
94
+ },
95
+ };
96
+ function createBasePaymentDetails() {
16
97
  return {
17
- order_id: undefined,
18
- transaction_id: undefined,
19
- auth_status: undefined,
20
- transaction_error_type: undefined,
21
- payment_method_type: undefined,
22
- transaction_date: undefined,
23
- transaction_error_desc: undefined,
24
- amount: undefined,
98
+ method: undefined,
99
+ pg_txn_id: undefined,
100
+ bank_ref_no: undefined,
101
+ settled_at: undefined,
102
+ remitter_name: undefined,
103
+ txn_process_type: undefined,
104
+ bank_id: undefined,
105
+ payment_category: undefined,
106
+ item_code: undefined,
107
+ upi_vpa: undefined,
108
+ upi_masked_vpa: undefined,
109
+ card_type: undefined,
110
+ card_masked: undefined,
111
+ card_end: undefined,
112
+ card_issuer: undefined,
113
+ card_network: undefined,
114
+ auth_code: undefined,
115
+ account_number: undefined,
116
+ ifsc: undefined,
117
+ bank_name: undefined,
118
+ additional_info: undefined,
25
119
  };
26
120
  }
27
- exports.BDWebhookRequest = {
121
+ exports.PaymentDetails = {
28
122
  encode(message, writer = minimal_1.default.Writer.create()) {
29
- if (message.order_id !== undefined) {
30
- writer.uint32(10).string(message.order_id);
123
+ if (message.method !== undefined) {
124
+ writer.uint32(10).string(message.method);
31
125
  }
32
- if (message.transaction_id !== undefined) {
33
- writer.uint32(18).string(message.transaction_id);
126
+ if (message.pg_txn_id !== undefined) {
127
+ writer.uint32(18).string(message.pg_txn_id);
34
128
  }
35
- if (message.auth_status !== undefined) {
36
- writer.uint32(26).string(message.auth_status);
129
+ if (message.bank_ref_no !== undefined) {
130
+ writer.uint32(26).string(message.bank_ref_no);
37
131
  }
38
- if (message.transaction_error_type !== undefined) {
39
- writer.uint32(34).string(message.transaction_error_type);
132
+ if (message.settled_at !== undefined) {
133
+ writer.uint32(34).string(message.settled_at);
40
134
  }
41
- if (message.payment_method_type !== undefined) {
42
- writer.uint32(42).string(message.payment_method_type);
135
+ if (message.remitter_name !== undefined) {
136
+ writer.uint32(42).string(message.remitter_name);
43
137
  }
44
- if (message.transaction_date !== undefined) {
45
- writer.uint32(50).string(message.transaction_date);
138
+ if (message.txn_process_type !== undefined) {
139
+ writer.uint32(50).string(message.txn_process_type);
140
+ }
141
+ if (message.bank_id !== undefined) {
142
+ writer.uint32(58).string(message.bank_id);
143
+ }
144
+ if (message.payment_category !== undefined) {
145
+ writer.uint32(66).string(message.payment_category);
146
+ }
147
+ if (message.item_code !== undefined) {
148
+ writer.uint32(74).string(message.item_code);
149
+ }
150
+ if (message.upi_vpa !== undefined) {
151
+ writer.uint32(82).string(message.upi_vpa);
152
+ }
153
+ if (message.upi_masked_vpa !== undefined) {
154
+ writer.uint32(90).string(message.upi_masked_vpa);
155
+ }
156
+ if (message.card_type !== undefined) {
157
+ writer.uint32(98).string(message.card_type);
158
+ }
159
+ if (message.card_masked !== undefined) {
160
+ writer.uint32(106).string(message.card_masked);
161
+ }
162
+ if (message.card_end !== undefined) {
163
+ writer.uint32(114).string(message.card_end);
164
+ }
165
+ if (message.card_issuer !== undefined) {
166
+ writer.uint32(122).string(message.card_issuer);
167
+ }
168
+ if (message.card_network !== undefined) {
169
+ writer.uint32(130).string(message.card_network);
46
170
  }
47
- if (message.transaction_error_desc !== undefined) {
48
- writer.uint32(58).string(message.transaction_error_desc);
171
+ if (message.auth_code !== undefined) {
172
+ writer.uint32(138).string(message.auth_code);
49
173
  }
50
- if (message.amount !== undefined) {
51
- writer.uint32(66).string(message.amount);
174
+ if (message.account_number !== undefined) {
175
+ writer.uint32(146).string(message.account_number);
176
+ }
177
+ if (message.ifsc !== undefined) {
178
+ writer.uint32(154).string(message.ifsc);
179
+ }
180
+ if (message.bank_name !== undefined) {
181
+ writer.uint32(162).string(message.bank_name);
182
+ }
183
+ if (message.additional_info !== undefined) {
184
+ exports.PaymentAdditionalInfo.encode(message.additional_info, writer.uint32(170).fork()).ldelim();
52
185
  }
53
186
  return writer;
54
187
  },
55
188
  decode(input, length) {
56
189
  const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
57
190
  let end = length === undefined ? reader.len : reader.pos + length;
58
- const message = createBaseBDWebhookRequest();
191
+ const message = createBasePaymentDetails();
59
192
  while (reader.pos < end) {
60
193
  const tag = reader.uint32();
61
194
  switch (tag >>> 3) {
@@ -63,49 +196,127 @@ exports.BDWebhookRequest = {
63
196
  if (tag !== 10) {
64
197
  break;
65
198
  }
66
- message.order_id = reader.string();
199
+ message.method = reader.string();
67
200
  continue;
68
201
  case 2:
69
202
  if (tag !== 18) {
70
203
  break;
71
204
  }
72
- message.transaction_id = reader.string();
205
+ message.pg_txn_id = reader.string();
73
206
  continue;
74
207
  case 3:
75
208
  if (tag !== 26) {
76
209
  break;
77
210
  }
78
- message.auth_status = reader.string();
211
+ message.bank_ref_no = reader.string();
79
212
  continue;
80
213
  case 4:
81
214
  if (tag !== 34) {
82
215
  break;
83
216
  }
84
- message.transaction_error_type = reader.string();
217
+ message.settled_at = reader.string();
85
218
  continue;
86
219
  case 5:
87
220
  if (tag !== 42) {
88
221
  break;
89
222
  }
90
- message.payment_method_type = reader.string();
223
+ message.remitter_name = reader.string();
91
224
  continue;
92
225
  case 6:
93
226
  if (tag !== 50) {
94
227
  break;
95
228
  }
96
- message.transaction_date = reader.string();
229
+ message.txn_process_type = reader.string();
97
230
  continue;
98
231
  case 7:
99
232
  if (tag !== 58) {
100
233
  break;
101
234
  }
102
- message.transaction_error_desc = reader.string();
235
+ message.bank_id = reader.string();
103
236
  continue;
104
237
  case 8:
105
238
  if (tag !== 66) {
106
239
  break;
107
240
  }
108
- message.amount = reader.string();
241
+ message.payment_category = reader.string();
242
+ continue;
243
+ case 9:
244
+ if (tag !== 74) {
245
+ break;
246
+ }
247
+ message.item_code = reader.string();
248
+ continue;
249
+ case 10:
250
+ if (tag !== 82) {
251
+ break;
252
+ }
253
+ message.upi_vpa = reader.string();
254
+ continue;
255
+ case 11:
256
+ if (tag !== 90) {
257
+ break;
258
+ }
259
+ message.upi_masked_vpa = reader.string();
260
+ continue;
261
+ case 12:
262
+ if (tag !== 98) {
263
+ break;
264
+ }
265
+ message.card_type = reader.string();
266
+ continue;
267
+ case 13:
268
+ if (tag !== 106) {
269
+ break;
270
+ }
271
+ message.card_masked = reader.string();
272
+ continue;
273
+ case 14:
274
+ if (tag !== 114) {
275
+ break;
276
+ }
277
+ message.card_end = reader.string();
278
+ continue;
279
+ case 15:
280
+ if (tag !== 122) {
281
+ break;
282
+ }
283
+ message.card_issuer = reader.string();
284
+ continue;
285
+ case 16:
286
+ if (tag !== 130) {
287
+ break;
288
+ }
289
+ message.card_network = reader.string();
290
+ continue;
291
+ case 17:
292
+ if (tag !== 138) {
293
+ break;
294
+ }
295
+ message.auth_code = reader.string();
296
+ continue;
297
+ case 18:
298
+ if (tag !== 146) {
299
+ break;
300
+ }
301
+ message.account_number = reader.string();
302
+ continue;
303
+ case 19:
304
+ if (tag !== 154) {
305
+ break;
306
+ }
307
+ message.ifsc = reader.string();
308
+ continue;
309
+ case 20:
310
+ if (tag !== 162) {
311
+ break;
312
+ }
313
+ message.bank_name = reader.string();
314
+ continue;
315
+ case 21:
316
+ if (tag !== 170) {
317
+ break;
318
+ }
319
+ message.additional_info = exports.PaymentAdditionalInfo.decode(reader, reader.uint32());
109
320
  continue;
110
321
  }
111
322
  if ((tag & 7) === 4 || tag === 0) {
@@ -117,73 +328,322 @@ exports.BDWebhookRequest = {
117
328
  },
118
329
  fromJSON(object) {
119
330
  return {
120
- order_id: isSet(object.order_id) ? globalThis.String(object.order_id) : undefined,
121
- transaction_id: isSet(object.transaction_id) ? globalThis.String(object.transaction_id) : undefined,
122
- auth_status: isSet(object.auth_status) ? globalThis.String(object.auth_status) : undefined,
123
- transaction_error_type: isSet(object.transaction_error_type)
124
- ? globalThis.String(object.transaction_error_type)
125
- : undefined,
126
- payment_method_type: isSet(object.payment_method_type)
127
- ? globalThis.String(object.payment_method_type)
128
- : undefined,
129
- transaction_date: isSet(object.transaction_date) ? globalThis.String(object.transaction_date) : undefined,
130
- transaction_error_desc: isSet(object.transaction_error_desc)
131
- ? globalThis.String(object.transaction_error_desc)
331
+ method: isSet(object.method) ? globalThis.String(object.method) : undefined,
332
+ pg_txn_id: isSet(object.pg_txn_id) ? globalThis.String(object.pg_txn_id) : undefined,
333
+ bank_ref_no: isSet(object.bank_ref_no) ? globalThis.String(object.bank_ref_no) : undefined,
334
+ settled_at: isSet(object.settled_at) ? globalThis.String(object.settled_at) : undefined,
335
+ remitter_name: isSet(object.remitter_name) ? globalThis.String(object.remitter_name) : undefined,
336
+ txn_process_type: isSet(object.txn_process_type) ? globalThis.String(object.txn_process_type) : undefined,
337
+ bank_id: isSet(object.bank_id) ? globalThis.String(object.bank_id) : undefined,
338
+ payment_category: isSet(object.payment_category) ? globalThis.String(object.payment_category) : undefined,
339
+ item_code: isSet(object.item_code) ? globalThis.String(object.item_code) : undefined,
340
+ upi_vpa: isSet(object.upi_vpa) ? globalThis.String(object.upi_vpa) : undefined,
341
+ upi_masked_vpa: isSet(object.upi_masked_vpa) ? globalThis.String(object.upi_masked_vpa) : undefined,
342
+ card_type: isSet(object.card_type) ? globalThis.String(object.card_type) : undefined,
343
+ card_masked: isSet(object.card_masked) ? globalThis.String(object.card_masked) : undefined,
344
+ card_end: isSet(object.card_end) ? globalThis.String(object.card_end) : undefined,
345
+ card_issuer: isSet(object.card_issuer) ? globalThis.String(object.card_issuer) : undefined,
346
+ card_network: isSet(object.card_network) ? globalThis.String(object.card_network) : undefined,
347
+ auth_code: isSet(object.auth_code) ? globalThis.String(object.auth_code) : undefined,
348
+ account_number: isSet(object.account_number) ? globalThis.String(object.account_number) : undefined,
349
+ ifsc: isSet(object.ifsc) ? globalThis.String(object.ifsc) : undefined,
350
+ bank_name: isSet(object.bank_name) ? globalThis.String(object.bank_name) : undefined,
351
+ additional_info: isSet(object.additional_info)
352
+ ? exports.PaymentAdditionalInfo.fromJSON(object.additional_info)
132
353
  : undefined,
133
- amount: isSet(object.amount) ? globalThis.String(object.amount) : undefined,
134
354
  };
135
355
  },
136
356
  toJSON(message) {
137
357
  const obj = {};
138
- if (message.order_id !== undefined) {
139
- obj.order_id = message.order_id;
358
+ if (message.method !== undefined) {
359
+ obj.method = message.method;
140
360
  }
141
- if (message.transaction_id !== undefined) {
142
- obj.transaction_id = message.transaction_id;
361
+ if (message.pg_txn_id !== undefined) {
362
+ obj.pg_txn_id = message.pg_txn_id;
143
363
  }
144
- if (message.auth_status !== undefined) {
145
- obj.auth_status = message.auth_status;
364
+ if (message.bank_ref_no !== undefined) {
365
+ obj.bank_ref_no = message.bank_ref_no;
146
366
  }
147
- if (message.transaction_error_type !== undefined) {
148
- obj.transaction_error_type = message.transaction_error_type;
367
+ if (message.settled_at !== undefined) {
368
+ obj.settled_at = message.settled_at;
149
369
  }
150
- if (message.payment_method_type !== undefined) {
151
- obj.payment_method_type = message.payment_method_type;
370
+ if (message.remitter_name !== undefined) {
371
+ obj.remitter_name = message.remitter_name;
152
372
  }
153
- if (message.transaction_date !== undefined) {
154
- obj.transaction_date = message.transaction_date;
373
+ if (message.txn_process_type !== undefined) {
374
+ obj.txn_process_type = message.txn_process_type;
375
+ }
376
+ if (message.bank_id !== undefined) {
377
+ obj.bank_id = message.bank_id;
155
378
  }
156
- if (message.transaction_error_desc !== undefined) {
157
- obj.transaction_error_desc = message.transaction_error_desc;
379
+ if (message.payment_category !== undefined) {
380
+ obj.payment_category = message.payment_category;
158
381
  }
159
- if (message.amount !== undefined) {
160
- obj.amount = message.amount;
382
+ if (message.item_code !== undefined) {
383
+ obj.item_code = message.item_code;
384
+ }
385
+ if (message.upi_vpa !== undefined) {
386
+ obj.upi_vpa = message.upi_vpa;
387
+ }
388
+ if (message.upi_masked_vpa !== undefined) {
389
+ obj.upi_masked_vpa = message.upi_masked_vpa;
390
+ }
391
+ if (message.card_type !== undefined) {
392
+ obj.card_type = message.card_type;
393
+ }
394
+ if (message.card_masked !== undefined) {
395
+ obj.card_masked = message.card_masked;
396
+ }
397
+ if (message.card_end !== undefined) {
398
+ obj.card_end = message.card_end;
399
+ }
400
+ if (message.card_issuer !== undefined) {
401
+ obj.card_issuer = message.card_issuer;
402
+ }
403
+ if (message.card_network !== undefined) {
404
+ obj.card_network = message.card_network;
405
+ }
406
+ if (message.auth_code !== undefined) {
407
+ obj.auth_code = message.auth_code;
408
+ }
409
+ if (message.account_number !== undefined) {
410
+ obj.account_number = message.account_number;
411
+ }
412
+ if (message.ifsc !== undefined) {
413
+ obj.ifsc = message.ifsc;
414
+ }
415
+ if (message.bank_name !== undefined) {
416
+ obj.bank_name = message.bank_name;
417
+ }
418
+ if (message.additional_info !== undefined) {
419
+ obj.additional_info = exports.PaymentAdditionalInfo.toJSON(message.additional_info);
161
420
  }
162
421
  return obj;
163
422
  },
164
423
  create(base) {
165
- return exports.BDWebhookRequest.fromPartial(base ?? {});
424
+ return exports.PaymentDetails.fromPartial(base ?? {});
166
425
  },
167
426
  fromPartial(object) {
168
- const message = createBaseBDWebhookRequest();
169
- message.order_id = object.order_id ?? undefined;
170
- message.transaction_id = object.transaction_id ?? undefined;
171
- message.auth_status = object.auth_status ?? undefined;
172
- message.transaction_error_type = object.transaction_error_type ?? undefined;
173
- message.payment_method_type = object.payment_method_type ?? undefined;
174
- message.transaction_date = object.transaction_date ?? undefined;
175
- message.transaction_error_desc = object.transaction_error_desc ?? undefined;
176
- message.amount = object.amount ?? undefined;
427
+ const message = createBasePaymentDetails();
428
+ message.method = object.method ?? undefined;
429
+ message.pg_txn_id = object.pg_txn_id ?? undefined;
430
+ message.bank_ref_no = object.bank_ref_no ?? undefined;
431
+ message.settled_at = object.settled_at ?? undefined;
432
+ message.remitter_name = object.remitter_name ?? undefined;
433
+ message.txn_process_type = object.txn_process_type ?? undefined;
434
+ message.bank_id = object.bank_id ?? undefined;
435
+ message.payment_category = object.payment_category ?? undefined;
436
+ message.item_code = object.item_code ?? undefined;
437
+ message.upi_vpa = object.upi_vpa ?? undefined;
438
+ message.upi_masked_vpa = object.upi_masked_vpa ?? undefined;
439
+ message.card_type = object.card_type ?? undefined;
440
+ message.card_masked = object.card_masked ?? undefined;
441
+ message.card_end = object.card_end ?? undefined;
442
+ message.card_issuer = object.card_issuer ?? undefined;
443
+ message.card_network = object.card_network ?? undefined;
444
+ message.auth_code = object.auth_code ?? undefined;
445
+ message.account_number = object.account_number ?? undefined;
446
+ message.ifsc = object.ifsc ?? undefined;
447
+ message.bank_name = object.bank_name ?? undefined;
448
+ message.additional_info = (object.additional_info !== undefined && object.additional_info !== null)
449
+ ? exports.PaymentAdditionalInfo.fromPartial(object.additional_info)
450
+ : undefined;
451
+ return message;
452
+ },
453
+ };
454
+ function createBaseCustomerContext() {
455
+ return { customer_id: undefined, email: undefined };
456
+ }
457
+ exports.CustomerContext = {
458
+ encode(message, writer = minimal_1.default.Writer.create()) {
459
+ if (message.customer_id !== undefined) {
460
+ writer.uint32(10).string(message.customer_id);
461
+ }
462
+ if (message.email !== undefined) {
463
+ writer.uint32(18).string(message.email);
464
+ }
465
+ return writer;
466
+ },
467
+ decode(input, length) {
468
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
469
+ let end = length === undefined ? reader.len : reader.pos + length;
470
+ const message = createBaseCustomerContext();
471
+ while (reader.pos < end) {
472
+ const tag = reader.uint32();
473
+ switch (tag >>> 3) {
474
+ case 1:
475
+ if (tag !== 10) {
476
+ break;
477
+ }
478
+ message.customer_id = reader.string();
479
+ continue;
480
+ case 2:
481
+ if (tag !== 18) {
482
+ break;
483
+ }
484
+ message.email = reader.string();
485
+ continue;
486
+ }
487
+ if ((tag & 7) === 4 || tag === 0) {
488
+ break;
489
+ }
490
+ reader.skipType(tag & 7);
491
+ }
492
+ return message;
493
+ },
494
+ fromJSON(object) {
495
+ return {
496
+ customer_id: isSet(object.customer_id) ? globalThis.String(object.customer_id) : undefined,
497
+ email: isSet(object.email) ? globalThis.String(object.email) : undefined,
498
+ };
499
+ },
500
+ toJSON(message) {
501
+ const obj = {};
502
+ if (message.customer_id !== undefined) {
503
+ obj.customer_id = message.customer_id;
504
+ }
505
+ if (message.email !== undefined) {
506
+ obj.email = message.email;
507
+ }
508
+ return obj;
509
+ },
510
+ create(base) {
511
+ return exports.CustomerContext.fromPartial(base ?? {});
512
+ },
513
+ fromPartial(object) {
514
+ const message = createBaseCustomerContext();
515
+ message.customer_id = object.customer_id ?? undefined;
516
+ message.email = object.email ?? undefined;
517
+ return message;
518
+ },
519
+ };
520
+ function createBaseMetadata() {
521
+ return { source: undefined, campaign: undefined };
522
+ }
523
+ exports.Metadata = {
524
+ encode(message, writer = minimal_1.default.Writer.create()) {
525
+ if (message.source !== undefined) {
526
+ writer.uint32(10).string(message.source);
527
+ }
528
+ if (message.campaign !== undefined) {
529
+ writer.uint32(18).string(message.campaign);
530
+ }
531
+ return writer;
532
+ },
533
+ decode(input, length) {
534
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
535
+ let end = length === undefined ? reader.len : reader.pos + length;
536
+ const message = createBaseMetadata();
537
+ while (reader.pos < end) {
538
+ const tag = reader.uint32();
539
+ switch (tag >>> 3) {
540
+ case 1:
541
+ if (tag !== 10) {
542
+ break;
543
+ }
544
+ message.source = reader.string();
545
+ continue;
546
+ case 2:
547
+ if (tag !== 18) {
548
+ break;
549
+ }
550
+ message.campaign = reader.string();
551
+ continue;
552
+ }
553
+ if ((tag & 7) === 4 || tag === 0) {
554
+ break;
555
+ }
556
+ reader.skipType(tag & 7);
557
+ }
558
+ return message;
559
+ },
560
+ fromJSON(object) {
561
+ return {
562
+ source: isSet(object.source) ? globalThis.String(object.source) : undefined,
563
+ campaign: isSet(object.campaign) ? globalThis.String(object.campaign) : undefined,
564
+ };
565
+ },
566
+ toJSON(message) {
567
+ const obj = {};
568
+ if (message.source !== undefined) {
569
+ obj.source = message.source;
570
+ }
571
+ if (message.campaign !== undefined) {
572
+ obj.campaign = message.campaign;
573
+ }
574
+ return obj;
575
+ },
576
+ create(base) {
577
+ return exports.Metadata.fromPartial(base ?? {});
578
+ },
579
+ fromPartial(object) {
580
+ const message = createBaseMetadata();
581
+ message.source = object.source ?? undefined;
582
+ message.campaign = object.campaign ?? undefined;
177
583
  return message;
178
584
  },
179
585
  };
180
586
  function createBaseBDTransactionRequest() {
181
- return { metadata: undefined };
587
+ return {
588
+ transaction_id: undefined,
589
+ client_id: undefined,
590
+ order_id: undefined,
591
+ amount_minor: undefined,
592
+ charged_total_minor: undefined,
593
+ currency: undefined,
594
+ status: undefined,
595
+ final: undefined,
596
+ transaction_date: undefined,
597
+ payment_details: undefined,
598
+ customer_ctx: undefined,
599
+ metadata: undefined,
600
+ timestamp: undefined,
601
+ signature: undefined,
602
+ };
182
603
  }
183
604
  exports.BDTransactionRequest = {
184
605
  encode(message, writer = minimal_1.default.Writer.create()) {
606
+ if (message.transaction_id !== undefined) {
607
+ writer.uint32(10).string(message.transaction_id);
608
+ }
609
+ if (message.client_id !== undefined) {
610
+ writer.uint32(18).string(message.client_id);
611
+ }
612
+ if (message.order_id !== undefined) {
613
+ writer.uint32(26).string(message.order_id);
614
+ }
615
+ if (message.amount_minor !== undefined) {
616
+ writer.uint32(32).int64(message.amount_minor);
617
+ }
618
+ if (message.charged_total_minor !== undefined) {
619
+ writer.uint32(40).int64(message.charged_total_minor);
620
+ }
621
+ if (message.currency !== undefined) {
622
+ writer.uint32(50).string(message.currency);
623
+ }
624
+ if (message.status !== undefined) {
625
+ writer.uint32(58).string(message.status);
626
+ }
627
+ if (message.final !== undefined) {
628
+ writer.uint32(64).bool(message.final);
629
+ }
630
+ if (message.transaction_date !== undefined) {
631
+ writer.uint32(74).string(message.transaction_date);
632
+ }
633
+ if (message.payment_details !== undefined) {
634
+ exports.PaymentDetails.encode(message.payment_details, writer.uint32(82).fork()).ldelim();
635
+ }
636
+ if (message.customer_ctx !== undefined) {
637
+ exports.CustomerContext.encode(message.customer_ctx, writer.uint32(90).fork()).ldelim();
638
+ }
185
639
  if (message.metadata !== undefined) {
186
- exports.BDWebhookRequest.encode(message.metadata, writer.uint32(10).fork()).ldelim();
640
+ exports.Metadata.encode(message.metadata, writer.uint32(98).fork()).ldelim();
641
+ }
642
+ if (message.timestamp !== undefined) {
643
+ writer.uint32(106).string(message.timestamp);
644
+ }
645
+ if (message.signature !== undefined) {
646
+ writer.uint32(114).string(message.signature);
187
647
  }
188
648
  return writer;
189
649
  },
@@ -198,7 +658,85 @@ exports.BDTransactionRequest = {
198
658
  if (tag !== 10) {
199
659
  break;
200
660
  }
201
- message.metadata = exports.BDWebhookRequest.decode(reader, reader.uint32());
661
+ message.transaction_id = reader.string();
662
+ continue;
663
+ case 2:
664
+ if (tag !== 18) {
665
+ break;
666
+ }
667
+ message.client_id = reader.string();
668
+ continue;
669
+ case 3:
670
+ if (tag !== 26) {
671
+ break;
672
+ }
673
+ message.order_id = reader.string();
674
+ continue;
675
+ case 4:
676
+ if (tag !== 32) {
677
+ break;
678
+ }
679
+ message.amount_minor = longToNumber(reader.int64());
680
+ continue;
681
+ case 5:
682
+ if (tag !== 40) {
683
+ break;
684
+ }
685
+ message.charged_total_minor = longToNumber(reader.int64());
686
+ continue;
687
+ case 6:
688
+ if (tag !== 50) {
689
+ break;
690
+ }
691
+ message.currency = reader.string();
692
+ continue;
693
+ case 7:
694
+ if (tag !== 58) {
695
+ break;
696
+ }
697
+ message.status = reader.string();
698
+ continue;
699
+ case 8:
700
+ if (tag !== 64) {
701
+ break;
702
+ }
703
+ message.final = reader.bool();
704
+ continue;
705
+ case 9:
706
+ if (tag !== 74) {
707
+ break;
708
+ }
709
+ message.transaction_date = reader.string();
710
+ continue;
711
+ case 10:
712
+ if (tag !== 82) {
713
+ break;
714
+ }
715
+ message.payment_details = exports.PaymentDetails.decode(reader, reader.uint32());
716
+ continue;
717
+ case 11:
718
+ if (tag !== 90) {
719
+ break;
720
+ }
721
+ message.customer_ctx = exports.CustomerContext.decode(reader, reader.uint32());
722
+ continue;
723
+ case 12:
724
+ if (tag !== 98) {
725
+ break;
726
+ }
727
+ message.metadata = exports.Metadata.decode(reader, reader.uint32());
728
+ continue;
729
+ case 13:
730
+ if (tag !== 106) {
731
+ break;
732
+ }
733
+ message.timestamp = reader.string();
734
+ continue;
735
+ case 14:
736
+ if (tag !== 114) {
737
+ break;
738
+ }
739
+ message.signature = reader.string();
202
740
  continue;
203
741
  }
204
742
  if ((tag & 7) === 4 || tag === 0) {
@@ -209,12 +747,68 @@ exports.BDTransactionRequest = {
209
747
  return message;
210
748
  },
211
749
  fromJSON(object) {
212
- return { metadata: isSet(object.metadata) ? exports.BDWebhookRequest.fromJSON(object.metadata) : undefined };
750
+ return {
751
+ transaction_id: isSet(object.transaction_id) ? globalThis.String(object.transaction_id) : undefined,
752
+ client_id: isSet(object.client_id) ? globalThis.String(object.client_id) : undefined,
753
+ order_id: isSet(object.order_id) ? globalThis.String(object.order_id) : undefined,
754
+ amount_minor: isSet(object.amount_minor) ? globalThis.Number(object.amount_minor) : undefined,
755
+ charged_total_minor: isSet(object.charged_total_minor)
756
+ ? globalThis.Number(object.charged_total_minor)
757
+ : undefined,
758
+ currency: isSet(object.currency) ? globalThis.String(object.currency) : undefined,
759
+ status: isSet(object.status) ? globalThis.String(object.status) : undefined,
760
+ final: isSet(object.final) ? globalThis.Boolean(object.final) : undefined,
761
+ transaction_date: isSet(object.transaction_date) ? globalThis.String(object.transaction_date) : undefined,
762
+ payment_details: isSet(object.payment_details) ? exports.PaymentDetails.fromJSON(object.payment_details) : undefined,
763
+ customer_ctx: isSet(object.customer_ctx) ? exports.CustomerContext.fromJSON(object.customer_ctx) : undefined,
764
+ metadata: isSet(object.metadata) ? exports.Metadata.fromJSON(object.metadata) : undefined,
765
+ timestamp: isSet(object.timestamp) ? globalThis.String(object.timestamp) : undefined,
766
+ signature: isSet(object.signature) ? globalThis.String(object.signature) : undefined,
767
+ };
213
768
  },
214
769
  toJSON(message) {
215
770
  const obj = {};
771
+ if (message.transaction_id !== undefined) {
772
+ obj.transaction_id = message.transaction_id;
773
+ }
774
+ if (message.client_id !== undefined) {
775
+ obj.client_id = message.client_id;
776
+ }
777
+ if (message.order_id !== undefined) {
778
+ obj.order_id = message.order_id;
779
+ }
780
+ if (message.amount_minor !== undefined) {
781
+ obj.amount_minor = Math.round(message.amount_minor);
782
+ }
783
+ if (message.charged_total_minor !== undefined) {
784
+ obj.charged_total_minor = Math.round(message.charged_total_minor);
785
+ }
786
+ if (message.currency !== undefined) {
787
+ obj.currency = message.currency;
788
+ }
789
+ if (message.status !== undefined) {
790
+ obj.status = message.status;
791
+ }
792
+ if (message.final !== undefined) {
793
+ obj.final = message.final;
794
+ }
795
+ if (message.transaction_date !== undefined) {
796
+ obj.transaction_date = message.transaction_date;
797
+ }
798
+ if (message.payment_details !== undefined) {
799
+ obj.payment_details = exports.PaymentDetails.toJSON(message.payment_details);
800
+ }
801
+ if (message.customer_ctx !== undefined) {
802
+ obj.customer_ctx = exports.CustomerContext.toJSON(message.customer_ctx);
803
+ }
216
804
  if (message.metadata !== undefined) {
217
- obj.metadata = exports.BDWebhookRequest.toJSON(message.metadata);
805
+ obj.metadata = exports.Metadata.toJSON(message.metadata);
806
+ }
807
+ if (message.timestamp !== undefined) {
808
+ obj.timestamp = message.timestamp;
809
+ }
810
+ if (message.signature !== undefined) {
811
+ obj.signature = message.signature;
218
812
  }
219
813
  return obj;
220
814
  },
@@ -223,9 +817,26 @@ exports.BDTransactionRequest = {
223
817
  },
224
818
  fromPartial(object) {
225
819
  const message = createBaseBDTransactionRequest();
820
+ message.transaction_id = object.transaction_id ?? undefined;
821
+ message.client_id = object.client_id ?? undefined;
822
+ message.order_id = object.order_id ?? undefined;
823
+ message.amount_minor = object.amount_minor ?? undefined;
824
+ message.charged_total_minor = object.charged_total_minor ?? undefined;
825
+ message.currency = object.currency ?? undefined;
826
+ message.status = object.status ?? undefined;
827
+ message.final = object.final ?? undefined;
828
+ message.transaction_date = object.transaction_date ?? undefined;
829
+ message.payment_details = (object.payment_details !== undefined && object.payment_details !== null)
830
+ ? exports.PaymentDetails.fromPartial(object.payment_details)
831
+ : undefined;
832
+ message.customer_ctx = (object.customer_ctx !== undefined && object.customer_ctx !== null)
833
+ ? exports.CustomerContext.fromPartial(object.customer_ctx)
834
+ : undefined;
226
835
  message.metadata = (object.metadata !== undefined && object.metadata !== null)
227
- ? exports.BDWebhookRequest.fromPartial(object.metadata)
836
+ ? exports.Metadata.fromPartial(object.metadata)
228
837
  : undefined;
838
+ message.timestamp = object.timestamp ?? undefined;
839
+ message.signature = object.signature ?? undefined;
229
840
  return message;
230
841
  },
231
842
  };
@@ -630,6 +1241,19 @@ exports.BDTransactionResponse = {
630
1241
  return message;
631
1242
  },
632
1243
  };
1244
+ function longToNumber(long) {
1245
+ if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) {
1246
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
1247
+ }
1248
+ if (long.lt(globalThis.Number.MIN_SAFE_INTEGER)) {
1249
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
1250
+ }
1251
+ return long.toNumber();
1252
+ }
1253
+ if (minimal_1.default.util.Long !== long_1.default) {
1254
+ minimal_1.default.util.Long = long_1.default;
1255
+ minimal_1.default.configure();
1256
+ }
633
1257
  function isSet(value) {
634
1258
  return value !== null && value !== undefined;
635
1259
  }