@stashfin/grpc 1.3.7 → 1.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stashfin/grpc",
3
- "version": "1.3.7",
3
+ "version": "1.3.9",
4
4
  "description": "Grpc proto manger",
5
5
  "scripts": {
6
6
  "prebuild": "rimraf src/ts && mkdirp src/ts && mkdirp dist",
@@ -1,19 +1,66 @@
1
1
  import _m0 from "protobufjs/minimal";
2
2
  export declare const protobufPackage = "bbps.processwebhook";
3
- export interface BDWebhookRequest {
4
- order_id?: string | undefined;
5
- transaction_id?: string | undefined;
6
- auth_status?: string | undefined;
7
- transaction_error_type?: string | undefined;
8
- payment_method_type?: string | undefined;
9
- transaction_date?: string | undefined;
10
- transaction_error_desc?: string | undefined;
11
- amount?: string | undefined;
3
+ export interface PaymentAdditionalInfo {
4
+ additional_info1?: string | undefined;
5
+ additional_info2?: string | undefined;
6
+ additional_info3?: string | undefined;
7
+ }
8
+ export interface PaymentDetails {
9
+ /** e.g., upi, card, netbanking */
10
+ method?: string | undefined;
11
+ pg_txn_id?: string | undefined;
12
+ bank_ref_no?: string | undefined;
13
+ settled_at?: string | undefined;
14
+ remitter_name?: string | undefined;
15
+ /** e.g., collect / online */
16
+ txn_process_type?: string | undefined;
17
+ bank_id?: string | undefined;
18
+ payment_category?: string | undefined;
19
+ item_code?: string | undefined;
20
+ upi_vpa?: string | undefined;
21
+ upi_masked_vpa?: string | undefined;
22
+ card_type?: string | undefined;
23
+ card_masked?: string | undefined;
24
+ card_end?: string | undefined;
25
+ card_issuer?: string | undefined;
26
+ card_network?: string | undefined;
27
+ auth_code?: string | undefined;
28
+ account_number?: string | undefined;
29
+ ifsc?: string | undefined;
30
+ bank_name?: string | undefined;
31
+ additional_info: PaymentAdditionalInfo | undefined;
32
+ }
33
+ export interface CustomerContext {
34
+ customer_id?: string | undefined;
35
+ email?: string | undefined;
36
+ }
37
+ export interface Metadata {
38
+ source?: string | undefined;
39
+ campaign?: string | undefined;
12
40
  }
13
41
  export interface BDTransactionRequest {
14
- metadata: BDWebhookRequest | undefined;
42
+ transaction_id?: string | undefined;
43
+ client_id?: string | undefined;
44
+ order_id?: string | undefined;
45
+ /** amount in paise */
46
+ amount_minor?: number | undefined;
47
+ charged_total_minor?: number | undefined;
48
+ /** e.g., INR */
49
+ currency?: string | undefined;
50
+ /** e.g., SUCCESS */
51
+ status?: string | undefined;
52
+ final?: boolean | undefined;
53
+ /** ISO 8601 */
54
+ transaction_date?: string | undefined;
55
+ /** nested payment info */
56
+ payment_details: PaymentDetails | undefined;
57
+ customer_ctx: CustomerContext | undefined;
58
+ metadata: Metadata | undefined;
59
+ /** ISO 8601 */
60
+ timestamp?: string | undefined;
61
+ /** HMAC or checksum */
62
+ signature?: string | undefined;
15
63
  }
16
- /** Transaction response message */
17
64
  export interface TxnResponse {
18
65
  id: number;
19
66
  customer_id: number;
@@ -36,24 +83,46 @@ export interface TxnResponse {
36
83
  /** optional / nullable */
37
84
  biller_status?: string | undefined;
38
85
  }
39
- /** Auth session response message */
40
86
  export interface AuthSessionResponse {
41
87
  customer_id: number;
42
88
  auth_token?: string | undefined;
43
89
  device_id?: string | undefined;
44
90
  }
45
- /** Combined response */
46
91
  export interface BDTransactionResponse {
47
92
  txnResponse: TxnResponse | undefined;
48
93
  authSessionResponse: AuthSessionResponse | undefined;
49
94
  }
50
- export declare const BDWebhookRequest: {
51
- encode(message: BDWebhookRequest, writer?: _m0.Writer): _m0.Writer;
52
- decode(input: _m0.Reader | Uint8Array, length?: number): BDWebhookRequest;
53
- fromJSON(object: any): BDWebhookRequest;
54
- toJSON(message: BDWebhookRequest): unknown;
55
- create<I extends Exact<DeepPartial<BDWebhookRequest>, I>>(base?: I): BDWebhookRequest;
56
- fromPartial<I extends Exact<DeepPartial<BDWebhookRequest>, I>>(object: I): BDWebhookRequest;
95
+ export declare const PaymentAdditionalInfo: {
96
+ encode(message: PaymentAdditionalInfo, writer?: _m0.Writer): _m0.Writer;
97
+ decode(input: _m0.Reader | Uint8Array, length?: number): PaymentAdditionalInfo;
98
+ fromJSON(object: any): PaymentAdditionalInfo;
99
+ toJSON(message: PaymentAdditionalInfo): unknown;
100
+ create<I extends Exact<DeepPartial<PaymentAdditionalInfo>, I>>(base?: I): PaymentAdditionalInfo;
101
+ fromPartial<I extends Exact<DeepPartial<PaymentAdditionalInfo>, I>>(object: I): PaymentAdditionalInfo;
102
+ };
103
+ export declare const PaymentDetails: {
104
+ encode(message: PaymentDetails, writer?: _m0.Writer): _m0.Writer;
105
+ decode(input: _m0.Reader | Uint8Array, length?: number): PaymentDetails;
106
+ fromJSON(object: any): PaymentDetails;
107
+ toJSON(message: PaymentDetails): unknown;
108
+ create<I extends Exact<DeepPartial<PaymentDetails>, I>>(base?: I): PaymentDetails;
109
+ fromPartial<I extends Exact<DeepPartial<PaymentDetails>, I>>(object: I): PaymentDetails;
110
+ };
111
+ export declare const CustomerContext: {
112
+ encode(message: CustomerContext, writer?: _m0.Writer): _m0.Writer;
113
+ decode(input: _m0.Reader | Uint8Array, length?: number): CustomerContext;
114
+ fromJSON(object: any): CustomerContext;
115
+ toJSON(message: CustomerContext): unknown;
116
+ create<I extends Exact<DeepPartial<CustomerContext>, I>>(base?: I): CustomerContext;
117
+ fromPartial<I extends Exact<DeepPartial<CustomerContext>, I>>(object: I): CustomerContext;
118
+ };
119
+ export declare const Metadata: {
120
+ encode(message: Metadata, writer?: _m0.Writer): _m0.Writer;
121
+ decode(input: _m0.Reader | Uint8Array, length?: number): Metadata;
122
+ fromJSON(object: any): Metadata;
123
+ toJSON(message: Metadata): unknown;
124
+ create<I extends Exact<DeepPartial<Metadata>, I>>(base?: I): Metadata;
125
+ fromPartial<I extends Exact<DeepPartial<Metadata>, I>>(object: I): Metadata;
57
126
  };
58
127
  export declare const BDTransactionRequest: {
59
128
  encode(message: BDTransactionRequest, writer?: _m0.Writer): _m0.Writer;
@@ -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
  }
@@ -2,15 +2,23 @@ import _m0 from "protobufjs/minimal";
2
2
  export declare const protobufPackage = "eqxpayments.createorderv2";
3
3
  export interface request {
4
4
  subscriber_id: string;
5
- status_page_url: string;
6
- redirect_url: string;
7
- checkout_token: string;
5
+ order_ref: string;
6
+ amount_minor: number;
7
+ currency: string;
8
+ return_url: string;
9
+ /** JSON string for customer context */
10
+ customer_ctx_json: string;
11
+ /** JSON string for metadata */
12
+ metadata_json: string;
8
13
  }
9
14
  export interface response {
10
15
  transaction_id: string;
11
16
  order_ref: string;
12
17
  subscriber_id: string;
13
18
  status: string;
19
+ status_page_url: string;
20
+ redirect_url: string;
21
+ checkout_token: string;
14
22
  created_at: string;
15
23
  }
16
24
  export declare const request: {
@@ -10,24 +10,42 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
11
  exports.response = exports.request = 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 = "eqxpayments.createorderv2";
15
16
  function createBaserequest() {
16
- return { subscriber_id: "", status_page_url: "", redirect_url: "", checkout_token: "" };
17
+ return {
18
+ subscriber_id: "",
19
+ order_ref: "",
20
+ amount_minor: 0,
21
+ currency: "",
22
+ return_url: "",
23
+ customer_ctx_json: "",
24
+ metadata_json: "",
25
+ };
17
26
  }
18
27
  exports.request = {
19
28
  encode(message, writer = minimal_1.default.Writer.create()) {
20
29
  if (message.subscriber_id !== "") {
21
30
  writer.uint32(10).string(message.subscriber_id);
22
31
  }
23
- if (message.status_page_url !== "") {
24
- writer.uint32(18).string(message.status_page_url);
32
+ if (message.order_ref !== "") {
33
+ writer.uint32(18).string(message.order_ref);
25
34
  }
26
- if (message.redirect_url !== "") {
27
- writer.uint32(26).string(message.redirect_url);
35
+ if (message.amount_minor !== 0) {
36
+ writer.uint32(24).int64(message.amount_minor);
28
37
  }
29
- if (message.checkout_token !== "") {
30
- writer.uint32(34).string(message.checkout_token);
38
+ if (message.currency !== "") {
39
+ writer.uint32(34).string(message.currency);
40
+ }
41
+ if (message.return_url !== "") {
42
+ writer.uint32(42).string(message.return_url);
43
+ }
44
+ if (message.customer_ctx_json !== "") {
45
+ writer.uint32(50).string(message.customer_ctx_json);
46
+ }
47
+ if (message.metadata_json !== "") {
48
+ writer.uint32(58).string(message.metadata_json);
31
49
  }
32
50
  return writer;
33
51
  },
@@ -48,19 +66,37 @@ exports.request = {
48
66
  if (tag !== 18) {
49
67
  break;
50
68
  }
51
- message.status_page_url = reader.string();
69
+ message.order_ref = reader.string();
52
70
  continue;
53
71
  case 3:
54
- if (tag !== 26) {
72
+ if (tag !== 24) {
55
73
  break;
56
74
  }
57
- message.redirect_url = reader.string();
75
+ message.amount_minor = longToNumber(reader.int64());
58
76
  continue;
59
77
  case 4:
60
78
  if (tag !== 34) {
61
79
  break;
62
80
  }
63
- message.checkout_token = reader.string();
81
+ message.currency = reader.string();
82
+ continue;
83
+ case 5:
84
+ if (tag !== 42) {
85
+ break;
86
+ }
87
+ message.return_url = reader.string();
88
+ continue;
89
+ case 6:
90
+ if (tag !== 50) {
91
+ break;
92
+ }
93
+ message.customer_ctx_json = reader.string();
94
+ continue;
95
+ case 7:
96
+ if (tag !== 58) {
97
+ break;
98
+ }
99
+ message.metadata_json = reader.string();
64
100
  continue;
65
101
  }
66
102
  if ((tag & 7) === 4 || tag === 0) {
@@ -73,9 +109,12 @@ exports.request = {
73
109
  fromJSON(object) {
74
110
  return {
75
111
  subscriber_id: isSet(object.subscriber_id) ? globalThis.String(object.subscriber_id) : "",
76
- status_page_url: isSet(object.status_page_url) ? globalThis.String(object.status_page_url) : "",
77
- redirect_url: isSet(object.redirect_url) ? globalThis.String(object.redirect_url) : "",
78
- checkout_token: isSet(object.checkout_token) ? globalThis.String(object.checkout_token) : "",
112
+ order_ref: isSet(object.order_ref) ? globalThis.String(object.order_ref) : "",
113
+ amount_minor: isSet(object.amount_minor) ? globalThis.Number(object.amount_minor) : 0,
114
+ currency: isSet(object.currency) ? globalThis.String(object.currency) : "",
115
+ return_url: isSet(object.return_url) ? globalThis.String(object.return_url) : "",
116
+ customer_ctx_json: isSet(object.customer_ctx_json) ? globalThis.String(object.customer_ctx_json) : "",
117
+ metadata_json: isSet(object.metadata_json) ? globalThis.String(object.metadata_json) : "",
79
118
  };
80
119
  },
81
120
  toJSON(message) {
@@ -83,14 +122,23 @@ exports.request = {
83
122
  if (message.subscriber_id !== "") {
84
123
  obj.subscriber_id = message.subscriber_id;
85
124
  }
86
- if (message.status_page_url !== "") {
87
- obj.status_page_url = message.status_page_url;
125
+ if (message.order_ref !== "") {
126
+ obj.order_ref = message.order_ref;
88
127
  }
89
- if (message.redirect_url !== "") {
90
- obj.redirect_url = message.redirect_url;
128
+ if (message.amount_minor !== 0) {
129
+ obj.amount_minor = Math.round(message.amount_minor);
91
130
  }
92
- if (message.checkout_token !== "") {
93
- obj.checkout_token = message.checkout_token;
131
+ if (message.currency !== "") {
132
+ obj.currency = message.currency;
133
+ }
134
+ if (message.return_url !== "") {
135
+ obj.return_url = message.return_url;
136
+ }
137
+ if (message.customer_ctx_json !== "") {
138
+ obj.customer_ctx_json = message.customer_ctx_json;
139
+ }
140
+ if (message.metadata_json !== "") {
141
+ obj.metadata_json = message.metadata_json;
94
142
  }
95
143
  return obj;
96
144
  },
@@ -100,14 +148,26 @@ exports.request = {
100
148
  fromPartial(object) {
101
149
  const message = createBaserequest();
102
150
  message.subscriber_id = object.subscriber_id ?? "";
103
- message.status_page_url = object.status_page_url ?? "";
104
- message.redirect_url = object.redirect_url ?? "";
105
- message.checkout_token = object.checkout_token ?? "";
151
+ message.order_ref = object.order_ref ?? "";
152
+ message.amount_minor = object.amount_minor ?? 0;
153
+ message.currency = object.currency ?? "";
154
+ message.return_url = object.return_url ?? "";
155
+ message.customer_ctx_json = object.customer_ctx_json ?? "";
156
+ message.metadata_json = object.metadata_json ?? "";
106
157
  return message;
107
158
  },
108
159
  };
109
160
  function createBaseresponse() {
110
- return { transaction_id: "", order_ref: "", subscriber_id: "", status: "", created_at: "" };
161
+ return {
162
+ transaction_id: "",
163
+ order_ref: "",
164
+ subscriber_id: "",
165
+ status: "",
166
+ status_page_url: "",
167
+ redirect_url: "",
168
+ checkout_token: "",
169
+ created_at: "",
170
+ };
111
171
  }
112
172
  exports.response = {
113
173
  encode(message, writer = minimal_1.default.Writer.create()) {
@@ -123,8 +183,17 @@ exports.response = {
123
183
  if (message.status !== "") {
124
184
  writer.uint32(34).string(message.status);
125
185
  }
186
+ if (message.status_page_url !== "") {
187
+ writer.uint32(42).string(message.status_page_url);
188
+ }
189
+ if (message.redirect_url !== "") {
190
+ writer.uint32(50).string(message.redirect_url);
191
+ }
192
+ if (message.checkout_token !== "") {
193
+ writer.uint32(58).string(message.checkout_token);
194
+ }
126
195
  if (message.created_at !== "") {
127
- writer.uint32(42).string(message.created_at);
196
+ writer.uint32(66).string(message.created_at);
128
197
  }
129
198
  return writer;
130
199
  },
@@ -163,6 +232,24 @@ exports.response = {
163
232
  if (tag !== 42) {
164
233
  break;
165
234
  }
235
+ message.status_page_url = reader.string();
236
+ continue;
237
+ case 6:
238
+ if (tag !== 50) {
239
+ break;
240
+ }
241
+ message.redirect_url = reader.string();
242
+ continue;
243
+ case 7:
244
+ if (tag !== 58) {
245
+ break;
246
+ }
247
+ message.checkout_token = reader.string();
248
+ continue;
249
+ case 8:
250
+ if (tag !== 66) {
251
+ break;
252
+ }
166
253
  message.created_at = reader.string();
167
254
  continue;
168
255
  }
@@ -179,6 +266,9 @@ exports.response = {
179
266
  order_ref: isSet(object.order_ref) ? globalThis.String(object.order_ref) : "",
180
267
  subscriber_id: isSet(object.subscriber_id) ? globalThis.String(object.subscriber_id) : "",
181
268
  status: isSet(object.status) ? globalThis.String(object.status) : "",
269
+ status_page_url: isSet(object.status_page_url) ? globalThis.String(object.status_page_url) : "",
270
+ redirect_url: isSet(object.redirect_url) ? globalThis.String(object.redirect_url) : "",
271
+ checkout_token: isSet(object.checkout_token) ? globalThis.String(object.checkout_token) : "",
182
272
  created_at: isSet(object.created_at) ? globalThis.String(object.created_at) : "",
183
273
  };
184
274
  },
@@ -196,6 +286,15 @@ exports.response = {
196
286
  if (message.status !== "") {
197
287
  obj.status = message.status;
198
288
  }
289
+ if (message.status_page_url !== "") {
290
+ obj.status_page_url = message.status_page_url;
291
+ }
292
+ if (message.redirect_url !== "") {
293
+ obj.redirect_url = message.redirect_url;
294
+ }
295
+ if (message.checkout_token !== "") {
296
+ obj.checkout_token = message.checkout_token;
297
+ }
199
298
  if (message.created_at !== "") {
200
299
  obj.created_at = message.created_at;
201
300
  }
@@ -210,10 +309,26 @@ exports.response = {
210
309
  message.order_ref = object.order_ref ?? "";
211
310
  message.subscriber_id = object.subscriber_id ?? "";
212
311
  message.status = object.status ?? "";
312
+ message.status_page_url = object.status_page_url ?? "";
313
+ message.redirect_url = object.redirect_url ?? "";
314
+ message.checkout_token = object.checkout_token ?? "";
213
315
  message.created_at = object.created_at ?? "";
214
316
  return message;
215
317
  },
216
318
  };
319
+ function longToNumber(long) {
320
+ if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) {
321
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
322
+ }
323
+ if (long.lt(globalThis.Number.MIN_SAFE_INTEGER)) {
324
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
325
+ }
326
+ return long.toNumber();
327
+ }
328
+ if (minimal_1.default.util.Long !== long_1.default) {
329
+ minimal_1.default.util.Long = long_1.default;
330
+ minimal_1.default.configure();
331
+ }
217
332
  function isSet(value) {
218
333
  return value !== null && value !== undefined;
219
334
  }