aeremmiddleware 1.0.21 → 1.0.22
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/README.md +28 -28
- package/dist/AU finance/auEncrypt.d.ts +2 -0
- package/dist/AU finance/auEncrypt.js +63 -0
- package/dist/AU finance/auEncrypt.js.map +1 -0
- package/dist/AU finance/auFinance.d.ts +7 -0
- package/dist/AU finance/auFinance.js +43 -0
- package/dist/AU finance/auFinance.js.map +1 -0
- package/dist/Finance/auEncrypt.d.ts +2 -0
- package/dist/Finance/auEncrypt.js +36 -0
- package/dist/Finance/auEncrypt.js.map +1 -0
- package/dist/Finance/auFinance.d.ts +19 -0
- package/dist/Finance/auFinance.js +73 -0
- package/dist/Finance/auFinance.js.map +1 -0
- package/dist/Finance/index.d.ts +2 -0
- package/dist/Finance/index.js +2 -0
- package/dist/Finance/index.js.map +1 -1
- package/dist/Finance/ingenicoHtml.js +114 -114
- package/dist/Finance/novel.js +1 -1
- package/dist/Finance/novel.types.js +1 -1
- package/dist/Finance/novel.types.js.map +1 -1
- package/dist/Finance/qbrik.d.ts +34 -33
- package/dist/Finance/qbrik.js +7 -6
- package/dist/Finance/qbrik.js.map +1 -1
- package/dist/Finance/qbrik.types.d.ts +50 -0
- package/dist/Socials/Sms.types.js +1 -1
- package/dist/Socials/Sms.types.js.map +1 -1
- package/dist/Socials/Whatsapp.types.js +1 -1
- package/dist/Socials/Whatsapp.types.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/{PushNotification → pushNotification}/index.js +1 -1
- package/package.json +21 -21
- package/src/Finance/Ingenico.types.ts +21 -21
- package/src/Finance/auEncrypt.ts +32 -0
- package/src/Finance/auFinance.ts +78 -0
- package/src/Finance/crimeCheck.ts +135 -135
- package/src/Finance/crimecheck.types.ts +31 -31
- package/src/Finance/encrypt.ts +18 -18
- package/src/Finance/idfy.ts +542 -542
- package/src/Finance/index.ts +15 -13
- package/src/Finance/ingenico.ts +110 -110
- package/src/Finance/ingenicoHtml.ts +119 -119
- package/src/Finance/novel.ts +226 -226
- package/src/Finance/novel.types.ts +24 -24
- package/src/Finance/qbrik.ts +828 -822
- package/src/Finance/qbrik.types.ts +131 -81
- package/src/PushNotification/index.ts +5 -5
- package/src/PushNotification/pushNotificationFCM.ts +37 -37
- package/src/Socials/Sms.types.ts +9 -9
- package/src/Socials/SmsSender.ts +78 -78
- package/src/Socials/Whatsapp.types.ts +95 -95
- package/src/Socials/index.ts +6 -6
- package/src/Socials/whatsApp.ts +188 -188
- package/src/index.ts +9 -9
- package/tsconfig.json +111 -111
- /package/dist/{PushNotification → pushNotification}/index.d.ts +0 -0
- /package/dist/{PushNotification → pushNotification}/index.js.map +0 -0
- /package/dist/{PushNotification → pushNotification}/pushNotificationFCM.d.ts +0 -0
- /package/dist/{PushNotification → pushNotification}/pushNotificationFCM.js +0 -0
- /package/dist/{PushNotification → pushNotification}/pushNotificationFCM.js.map +0 -0
package/src/Finance/qbrik.ts
CHANGED
|
@@ -1,822 +1,828 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
|
-
import FormData from "form-data";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
private
|
|
19
|
-
private
|
|
20
|
-
private
|
|
21
|
-
private
|
|
22
|
-
private
|
|
23
|
-
|
|
24
|
-
private
|
|
25
|
-
private
|
|
26
|
-
private
|
|
27
|
-
private
|
|
28
|
-
|
|
29
|
-
private
|
|
30
|
-
private
|
|
31
|
-
private
|
|
32
|
-
private
|
|
33
|
-
private
|
|
34
|
-
private
|
|
35
|
-
private
|
|
36
|
-
private
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
);
|
|
165
|
-
formData.append("
|
|
166
|
-
formData.append(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
);
|
|
173
|
-
formData.append(
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
);
|
|
282
|
-
formData.append(
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
formData.append(
|
|
296
|
-
"associate[0][
|
|
297
|
-
associateDetails.
|
|
298
|
-
);
|
|
299
|
-
formData.append("associate[0][
|
|
300
|
-
formData.append(
|
|
301
|
-
"associate[0][
|
|
302
|
-
associateDetails.
|
|
303
|
-
);
|
|
304
|
-
formData.append(
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
formData.append(
|
|
322
|
-
"associate[0][
|
|
323
|
-
associateDetails.
|
|
324
|
-
);
|
|
325
|
-
formData.append(
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
formData.append(
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
formData.append(
|
|
510
|
-
"entity[0][identity_proof][0][
|
|
511
|
-
entityPayload.
|
|
512
|
-
);
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
formData
|
|
544
|
-
|
|
545
|
-
formData.append("
|
|
546
|
-
formData.append("
|
|
547
|
-
formData.append("
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
);
|
|
581
|
-
formData.append(
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
formData
|
|
623
|
-
|
|
624
|
-
formData.append("
|
|
625
|
-
formData.append("
|
|
626
|
-
formData.append("
|
|
627
|
-
formData.append("
|
|
628
|
-
formData.append("
|
|
629
|
-
formData.append("
|
|
630
|
-
formData.append("
|
|
631
|
-
formData.append("
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
formData
|
|
720
|
-
|
|
721
|
-
formData.append("
|
|
722
|
-
formData.append("
|
|
723
|
-
formData.append("
|
|
724
|
-
formData.append("
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
1
|
+
import axios, { AxiosResponse } from "axios";
|
|
2
|
+
import FormData from "form-data";
|
|
3
|
+
import {
|
|
4
|
+
AccountPayload,
|
|
5
|
+
ApproveData,
|
|
6
|
+
AssociateDetails,
|
|
7
|
+
CustomerDetails,
|
|
8
|
+
Doctype,
|
|
9
|
+
EntityPayload,
|
|
10
|
+
LoginDetails,
|
|
11
|
+
MasterListInput,
|
|
12
|
+
OpenLoanAccountType,
|
|
13
|
+
SolarPayloadType,
|
|
14
|
+
UpdateLoanPayloadType,
|
|
15
|
+
} from "./qbrik.types";
|
|
16
|
+
|
|
17
|
+
class QbrikApiWrapper {
|
|
18
|
+
private isUAT: boolean;
|
|
19
|
+
private baseUrl: string;
|
|
20
|
+
private loginEndpoint = "api/1/auth/loginRest";
|
|
21
|
+
private enrollCustomerEndpoint = "api/1/customer/CreateEnterpriseCustomer";
|
|
22
|
+
private getDateEndpoint = "api/1/user/getDates";
|
|
23
|
+
private getMasterListEndpoint = "api/1/customer/getMasterList";
|
|
24
|
+
private identityProofMasterEndpoint = "api/1/customer/getIdentityProofList";
|
|
25
|
+
private branchMasterEndpoint = "api/1/user/getBranchList";
|
|
26
|
+
private viewCustomerDetailEndpoint = "api/1/customer/ViewEnterpriseCustomer";
|
|
27
|
+
private viewBranchCustomerDetailEndpoint =
|
|
28
|
+
"api/1/customer/GetBranchBasedEnterpriseCustomerList";
|
|
29
|
+
private addAssosiateInformationEndpoint = "api/1/account/addAccountAssociate";
|
|
30
|
+
private approveEndpoint = "api/1/loan/approve";
|
|
31
|
+
private viewAssociatesEndpoint = "api/1/account/ViewAssociates";
|
|
32
|
+
private addEntityProofsEndpoint = "api/1/customer/AddEntityProofs";
|
|
33
|
+
private openLoanAccountEndpoint = "api/1/appType2Loan/create";
|
|
34
|
+
private updateLoanInfoEndpoint = "api/1/appType2Loan/updateLoanInformation";
|
|
35
|
+
private addSolarInfoEndpoint = "api/1/appType2Loan/addSolarInformation";
|
|
36
|
+
private generateDocumentEndpoint = "api/1/doc_engine/GenerateDocuments";
|
|
37
|
+
private generateTransactionIdEndpoint = "api/1/transaction/create";
|
|
38
|
+
private addAccountDocumentEndpoint = "api/1/account/addAccountDocumentGroup";
|
|
39
|
+
private viewLoanEndpoint = "api/1/loan/view";
|
|
40
|
+
private viewLoanScheduleEndpoint = "api/1/account/viewLoanSchedules";
|
|
41
|
+
private viewLoanStatementEndpoint = "api/1/account/viewLoanStatement";
|
|
42
|
+
|
|
43
|
+
constructor(isUAT: boolean) {
|
|
44
|
+
this.isUAT = isUAT;
|
|
45
|
+
this.baseUrl = this.isUAT
|
|
46
|
+
? "https://uat5.qbrik.in/c8752/"
|
|
47
|
+
: "https://c8752.qbrik.in/shakti/";
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async login(loginDetails: LoginDetails): Promise<AxiosResponse<any>> {
|
|
51
|
+
const formData = new FormData();
|
|
52
|
+
|
|
53
|
+
formData.append("username", loginDetails.username);
|
|
54
|
+
formData.append("password", loginDetails.password);
|
|
55
|
+
loginDetails.version
|
|
56
|
+
? formData.append("version", loginDetails.version)
|
|
57
|
+
: null;
|
|
58
|
+
|
|
59
|
+
try {
|
|
60
|
+
const response = await axios.post(
|
|
61
|
+
`${this.baseUrl}${this.loginEndpoint}`,
|
|
62
|
+
formData,
|
|
63
|
+
{
|
|
64
|
+
headers: {
|
|
65
|
+
...formData.getHeaders(),
|
|
66
|
+
},
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
return response.data;
|
|
70
|
+
} catch (error) {
|
|
71
|
+
throw error;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
async getDates(accessToken: string): Promise<any> {
|
|
76
|
+
try {
|
|
77
|
+
const response = await axios.get(
|
|
78
|
+
`${this.baseUrl}${this.getDateEndpoint}`,
|
|
79
|
+
{
|
|
80
|
+
headers: {
|
|
81
|
+
Authorization: accessToken,
|
|
82
|
+
},
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
return response.data;
|
|
87
|
+
} catch (error) {
|
|
88
|
+
throw error;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
async getMasterList({
|
|
93
|
+
masterListInput,
|
|
94
|
+
accessToken,
|
|
95
|
+
}: {
|
|
96
|
+
masterListInput: MasterListInput;
|
|
97
|
+
accessToken: string;
|
|
98
|
+
}): Promise<AxiosResponse> {
|
|
99
|
+
const params: { [key: string]: string } = {
|
|
100
|
+
...(masterListInput.name_0 ? { "name[0]": masterListInput.name_0 } : {}),
|
|
101
|
+
...(masterListInput.name_1 ? { "name[1]": masterListInput.name_1 } : {}),
|
|
102
|
+
...(masterListInput.name_2 ? { "name[2]": masterListInput.name_2 } : {}),
|
|
103
|
+
};
|
|
104
|
+
try {
|
|
105
|
+
const response = await axios.get(
|
|
106
|
+
`${this.baseUrl}${this.getMasterListEndpoint}`,
|
|
107
|
+
{
|
|
108
|
+
params: params,
|
|
109
|
+
headers: {
|
|
110
|
+
Authorization: accessToken,
|
|
111
|
+
},
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
return response.data;
|
|
115
|
+
} catch (error) {
|
|
116
|
+
throw error;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
async identityProofMaster(accessToken: string): Promise<AxiosResponse> {
|
|
121
|
+
try {
|
|
122
|
+
const response = await axios.get(
|
|
123
|
+
`${this.baseUrl}${this.identityProofMasterEndpoint}`,
|
|
124
|
+
{
|
|
125
|
+
headers: {
|
|
126
|
+
Authorization: accessToken,
|
|
127
|
+
},
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
return response.data;
|
|
131
|
+
} catch (error) {
|
|
132
|
+
throw error;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
async branchMaster(accessToken: string): Promise<AxiosResponse> {
|
|
137
|
+
try {
|
|
138
|
+
const response = await axios.get(
|
|
139
|
+
`${this.baseUrl}${this.branchMasterEndpoint}`,
|
|
140
|
+
{
|
|
141
|
+
headers: {
|
|
142
|
+
Authorization: accessToken,
|
|
143
|
+
},
|
|
144
|
+
params: {
|
|
145
|
+
"name[0]": "Client Type",
|
|
146
|
+
},
|
|
147
|
+
}
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
return response.data;
|
|
151
|
+
} catch (error) {
|
|
152
|
+
throw error;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
async enrollCustomer({
|
|
157
|
+
customerDetails,
|
|
158
|
+
accessToken,
|
|
159
|
+
}: {
|
|
160
|
+
customerDetails: CustomerDetails;
|
|
161
|
+
accessToken: string;
|
|
162
|
+
}): Promise<AxiosResponse> {
|
|
163
|
+
const formData = new FormData();
|
|
164
|
+
formData.append("enrollment_date", customerDetails.enrollment_date);
|
|
165
|
+
formData.append("legal_name", customerDetails.legal_name);
|
|
166
|
+
formData.append(
|
|
167
|
+
"date_of_incorporation",
|
|
168
|
+
customerDetails.date_of_incorporation
|
|
169
|
+
);
|
|
170
|
+
formData.append("branch[code]", customerDetails.branch_code);
|
|
171
|
+
formData.append("branch[name]", customerDetails.branch_name);
|
|
172
|
+
formData.append("client_type", customerDetails.client_type);
|
|
173
|
+
formData.append("institutional_type", customerDetails.institutional_type);
|
|
174
|
+
formData.append(
|
|
175
|
+
"identity_proof[0][type]",
|
|
176
|
+
customerDetails.identity_proof_type
|
|
177
|
+
);
|
|
178
|
+
formData.append(
|
|
179
|
+
"identity_proof[0][number]",
|
|
180
|
+
customerDetails.identity_proof_number
|
|
181
|
+
);
|
|
182
|
+
formData.append(
|
|
183
|
+
"identity_proof[0][is_primary]",
|
|
184
|
+
customerDetails.identity_proof_is_primary
|
|
185
|
+
);
|
|
186
|
+
formData.append(
|
|
187
|
+
"identity_proof[0][is_address_proof]",
|
|
188
|
+
customerDetails.identity_proof_is_address_proof
|
|
189
|
+
);
|
|
190
|
+
formData.append(
|
|
191
|
+
"identity_proof[0][is_id_proof]",
|
|
192
|
+
customerDetails.identity_proof_is_id_proof
|
|
193
|
+
);
|
|
194
|
+
formData.append(
|
|
195
|
+
"identity_proof[0][is_address_proof_primary]",
|
|
196
|
+
customerDetails.identity_proof_is_address_proof_primary
|
|
197
|
+
);
|
|
198
|
+
formData.append(
|
|
199
|
+
"identity_proof[0][is_id_proof_primary]",
|
|
200
|
+
customerDetails.identity_proof_is_id_proof_primary
|
|
201
|
+
);
|
|
202
|
+
|
|
203
|
+
try {
|
|
204
|
+
const response = await axios.post(
|
|
205
|
+
`${this.baseUrl}${this.enrollCustomerEndpoint}`,
|
|
206
|
+
formData,
|
|
207
|
+
{
|
|
208
|
+
headers: {
|
|
209
|
+
Authorization: accessToken,
|
|
210
|
+
...formData.getHeaders(),
|
|
211
|
+
},
|
|
212
|
+
}
|
|
213
|
+
);
|
|
214
|
+
console.log(response.data);
|
|
215
|
+
return response.data.data;
|
|
216
|
+
} catch (error: any) {
|
|
217
|
+
console.log("------------error", error?.response?.data);
|
|
218
|
+
return error?.response?.data;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
async viewCustomerDetails({
|
|
223
|
+
customerNo,
|
|
224
|
+
accessToken,
|
|
225
|
+
}: {
|
|
226
|
+
customerNo: string;
|
|
227
|
+
accessToken: string;
|
|
228
|
+
}): Promise<AxiosResponse> {
|
|
229
|
+
try {
|
|
230
|
+
const response = await axios.get(
|
|
231
|
+
`${this.baseUrl}${this.viewCustomerDetailEndpoint}`,
|
|
232
|
+
{
|
|
233
|
+
headers: {
|
|
234
|
+
Authorization: accessToken,
|
|
235
|
+
},
|
|
236
|
+
params: {
|
|
237
|
+
customer_no: customerNo,
|
|
238
|
+
},
|
|
239
|
+
}
|
|
240
|
+
);
|
|
241
|
+
|
|
242
|
+
return response.data;
|
|
243
|
+
} catch (error: any) {
|
|
244
|
+
return error?.response?.data;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
async viewBranchCustomerDetails({
|
|
249
|
+
branchCode,
|
|
250
|
+
accessToken,
|
|
251
|
+
}: {
|
|
252
|
+
branchCode: string;
|
|
253
|
+
accessToken: string;
|
|
254
|
+
}): Promise<AxiosResponse> {
|
|
255
|
+
try {
|
|
256
|
+
const response = await axios.get(
|
|
257
|
+
`${this.baseUrl}${this.viewBranchCustomerDetailEndpoint}`,
|
|
258
|
+
{
|
|
259
|
+
headers: {
|
|
260
|
+
Authorization: accessToken,
|
|
261
|
+
},
|
|
262
|
+
params: {
|
|
263
|
+
branch_code: branchCode,
|
|
264
|
+
},
|
|
265
|
+
}
|
|
266
|
+
);
|
|
267
|
+
|
|
268
|
+
return response.data;
|
|
269
|
+
} catch (error: any) {
|
|
270
|
+
throw error?.response?.data;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
async addLoanAssociateInformation({
|
|
275
|
+
associateDetails,
|
|
276
|
+
accessToken,
|
|
277
|
+
}: {
|
|
278
|
+
associateDetails: AssociateDetails;
|
|
279
|
+
accessToken: string;
|
|
280
|
+
}): Promise<AxiosResponse> {
|
|
281
|
+
const formData = new FormData();
|
|
282
|
+
formData.append("account_no", associateDetails.account_no);
|
|
283
|
+
formData.append(
|
|
284
|
+
"associate[0][associate_type]",
|
|
285
|
+
associateDetails.associate_type
|
|
286
|
+
);
|
|
287
|
+
formData.append(
|
|
288
|
+
"associate[0][entity_no]",
|
|
289
|
+
associateDetails.associate_entity_no
|
|
290
|
+
);
|
|
291
|
+
formData.append(
|
|
292
|
+
"associate[0][relation]",
|
|
293
|
+
associateDetails.associate_relation
|
|
294
|
+
);
|
|
295
|
+
formData.append(
|
|
296
|
+
"associate[0][legal_name]",
|
|
297
|
+
associateDetails.associate_legal_name
|
|
298
|
+
);
|
|
299
|
+
formData.append("associate[0][alias]", associateDetails.associate_alias);
|
|
300
|
+
formData.append(
|
|
301
|
+
"associate[0][date_of_birth]",
|
|
302
|
+
associateDetails.associate_date_of_birth
|
|
303
|
+
);
|
|
304
|
+
formData.append("associate[0][gender]", associateDetails.associate_gender);
|
|
305
|
+
formData.append(
|
|
306
|
+
"associate[0][occupation]",
|
|
307
|
+
associateDetails.associate_occupation
|
|
308
|
+
);
|
|
309
|
+
formData.append(
|
|
310
|
+
"associate[0][father_name]",
|
|
311
|
+
associateDetails.associate_father_name
|
|
312
|
+
);
|
|
313
|
+
formData.append(
|
|
314
|
+
"associate[0][telephone]",
|
|
315
|
+
associateDetails.associate_telephone
|
|
316
|
+
);
|
|
317
|
+
formData.append(
|
|
318
|
+
"associate[0][education_level]",
|
|
319
|
+
associateDetails.associate_education_level
|
|
320
|
+
);
|
|
321
|
+
formData.append(
|
|
322
|
+
"associate[0][marital_status]",
|
|
323
|
+
associateDetails.associate_marital_status
|
|
324
|
+
);
|
|
325
|
+
formData.append("auto_create_area", associateDetails.auto_create_area);
|
|
326
|
+
formData.append(
|
|
327
|
+
"associate[0][address][residence_state_name]",
|
|
328
|
+
associateDetails.associate_address_residence_state_name
|
|
329
|
+
);
|
|
330
|
+
formData.append(
|
|
331
|
+
"associate[0][address][residence_district_name]",
|
|
332
|
+
associateDetails.associate_address_residence_district_name
|
|
333
|
+
);
|
|
334
|
+
formData.append(
|
|
335
|
+
"associate[0][address][residence_block_name]",
|
|
336
|
+
associateDetails.associate_address_residence_block_name
|
|
337
|
+
);
|
|
338
|
+
formData.append(
|
|
339
|
+
"associate[0][address][residence_area_name]",
|
|
340
|
+
associateDetails.associate_address_residence_area_name
|
|
341
|
+
);
|
|
342
|
+
formData.append(
|
|
343
|
+
"associate[0][address][residence_pincode]",
|
|
344
|
+
associateDetails.associate_address_residence_pincode
|
|
345
|
+
);
|
|
346
|
+
formData.append(
|
|
347
|
+
"associate[0][address][residence_address]",
|
|
348
|
+
associateDetails.associate_address_residence_address
|
|
349
|
+
);
|
|
350
|
+
formData.append(
|
|
351
|
+
"associate[0][address][office_address]",
|
|
352
|
+
associateDetails.associate_address_office_address
|
|
353
|
+
);
|
|
354
|
+
formData.append(
|
|
355
|
+
"associate[0][address][office_state_name]",
|
|
356
|
+
associateDetails.associate_address_office_state_name
|
|
357
|
+
);
|
|
358
|
+
formData.append(
|
|
359
|
+
"associate[0][address][office_district_name]",
|
|
360
|
+
associateDetails.associate_address_office_district_name
|
|
361
|
+
);
|
|
362
|
+
formData.append(
|
|
363
|
+
"associate[0][address][office_block_name]",
|
|
364
|
+
associateDetails.associate_address_office_block_name
|
|
365
|
+
);
|
|
366
|
+
formData.append(
|
|
367
|
+
"associate[0][address][office_area_name]",
|
|
368
|
+
associateDetails.associate_address_office_area_name
|
|
369
|
+
);
|
|
370
|
+
formData.append(
|
|
371
|
+
"associate[0][address][office_pincode]",
|
|
372
|
+
associateDetails.associate_address_office_pincode
|
|
373
|
+
);
|
|
374
|
+
formData.append(
|
|
375
|
+
"associate[0][bank_details][bank_name]",
|
|
376
|
+
associateDetails.associate_bank_details_bank_name
|
|
377
|
+
);
|
|
378
|
+
formData.append(
|
|
379
|
+
"bank_details[branch_name]",
|
|
380
|
+
associateDetails.associate_bank_details_branch_name
|
|
381
|
+
);
|
|
382
|
+
formData.append(
|
|
383
|
+
"associate[0][bank_details][IFSCCode]",
|
|
384
|
+
associateDetails.associate_bank_details_IFSCCode
|
|
385
|
+
);
|
|
386
|
+
formData.append(
|
|
387
|
+
"associate[0][bank_details][account_no]",
|
|
388
|
+
associateDetails.associate_bank_details_account_no
|
|
389
|
+
);
|
|
390
|
+
formData.append(
|
|
391
|
+
"associate[0][bank_details][account_type]",
|
|
392
|
+
associateDetails.associate_bank_details_account_type
|
|
393
|
+
);
|
|
394
|
+
formData.append(
|
|
395
|
+
"associate[0][bank_details][beneficiary_name]",
|
|
396
|
+
associateDetails.associate_bank_details_beneficiary_name
|
|
397
|
+
);
|
|
398
|
+
formData.append(
|
|
399
|
+
"associate[0][bank_details][is_primary]",
|
|
400
|
+
associateDetails.associate_bank_details_is_primary
|
|
401
|
+
);
|
|
402
|
+
formData.append(
|
|
403
|
+
"associate[0][comment]",
|
|
404
|
+
associateDetails.associate_comment
|
|
405
|
+
);
|
|
406
|
+
|
|
407
|
+
try {
|
|
408
|
+
const response = await axios.post(
|
|
409
|
+
`${this.baseUrl}${this.addAssosiateInformationEndpoint}`,
|
|
410
|
+
formData,
|
|
411
|
+
{
|
|
412
|
+
headers: {
|
|
413
|
+
Authorization: accessToken,
|
|
414
|
+
...formData.getHeaders(),
|
|
415
|
+
},
|
|
416
|
+
}
|
|
417
|
+
);
|
|
418
|
+
console.log(response.data);
|
|
419
|
+
return response.data;
|
|
420
|
+
} catch (error: any) {
|
|
421
|
+
console.log("------------error", error?.response?.data);
|
|
422
|
+
return error?.response?.data;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
async approve({
|
|
427
|
+
approveData,
|
|
428
|
+
accessToken,
|
|
429
|
+
}: {
|
|
430
|
+
approveData: ApproveData;
|
|
431
|
+
accessToken: string;
|
|
432
|
+
}): Promise<AxiosResponse> {
|
|
433
|
+
const formData = new FormData();
|
|
434
|
+
|
|
435
|
+
formData.append("account_no", approveData.account_no);
|
|
436
|
+
formData.append("approved_loan_amount", approveData.approved_loan_amount);
|
|
437
|
+
|
|
438
|
+
try {
|
|
439
|
+
const response = await axios.post(
|
|
440
|
+
`${this.baseUrl}${this.approveEndpoint}`,
|
|
441
|
+
formData,
|
|
442
|
+
{
|
|
443
|
+
headers: {
|
|
444
|
+
Authorization: accessToken,
|
|
445
|
+
...formData.getHeaders(),
|
|
446
|
+
},
|
|
447
|
+
}
|
|
448
|
+
);
|
|
449
|
+
return response.data;
|
|
450
|
+
} catch (error: any) {
|
|
451
|
+
return error?.response?.data;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
async viewAssociates({
|
|
456
|
+
accNo,
|
|
457
|
+
accessToken,
|
|
458
|
+
}: {
|
|
459
|
+
accNo: string;
|
|
460
|
+
accessToken: string;
|
|
461
|
+
}): Promise<AxiosResponse> {
|
|
462
|
+
const formData = new FormData();
|
|
463
|
+
formData.append("account_no", accNo);
|
|
464
|
+
|
|
465
|
+
try {
|
|
466
|
+
const response = await axios.get(
|
|
467
|
+
`${this.baseUrl}${this.viewAssociatesEndpoint}`,
|
|
468
|
+
{
|
|
469
|
+
headers: {
|
|
470
|
+
Authorization: accessToken,
|
|
471
|
+
},
|
|
472
|
+
params: {
|
|
473
|
+
account_no: accNo,
|
|
474
|
+
},
|
|
475
|
+
}
|
|
476
|
+
);
|
|
477
|
+
return response.data;
|
|
478
|
+
} catch (error: any) {
|
|
479
|
+
return error?.response?.data;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
async addEntityProofs({
|
|
484
|
+
entityPayload,
|
|
485
|
+
accessToken,
|
|
486
|
+
}: {
|
|
487
|
+
entityPayload: EntityPayload;
|
|
488
|
+
accessToken: string;
|
|
489
|
+
}): Promise<AxiosResponse> {
|
|
490
|
+
const formData = new FormData();
|
|
491
|
+
|
|
492
|
+
formData.append("entity[0][entity_no]", entityPayload.entity_no);
|
|
493
|
+
formData.append(
|
|
494
|
+
"entity[0][identity_proof][0][type]",
|
|
495
|
+
entityPayload.identity_proof_type
|
|
496
|
+
);
|
|
497
|
+
formData.append(
|
|
498
|
+
"entity[0][identity_proof][0][number]",
|
|
499
|
+
entityPayload.identity_proof_number
|
|
500
|
+
);
|
|
501
|
+
formData.append(
|
|
502
|
+
"entity[0][identity_proof][0][is_id_proof]",
|
|
503
|
+
entityPayload.identity_proof_is_id_proof
|
|
504
|
+
);
|
|
505
|
+
formData.append(
|
|
506
|
+
"entity[0][identity_proof][0][is_id_proof_primary]",
|
|
507
|
+
entityPayload.identity_proof_is_id_proof_primary
|
|
508
|
+
);
|
|
509
|
+
formData.append(
|
|
510
|
+
"entity[0][identity_proof][0][is_address_proof]",
|
|
511
|
+
entityPayload.identity_proof_is_address_proof
|
|
512
|
+
);
|
|
513
|
+
formData.append("transaction_id", entityPayload.transaction_id);
|
|
514
|
+
formData.append(
|
|
515
|
+
"entity[0][identity_proof][0][is_address_proof_primary]",
|
|
516
|
+
entityPayload.identity_proof_is_address_proof_primary
|
|
517
|
+
);
|
|
518
|
+
|
|
519
|
+
try {
|
|
520
|
+
const response = await axios.post(
|
|
521
|
+
`${this.baseUrl}${this.addEntityProofsEndpoint}`,
|
|
522
|
+
formData,
|
|
523
|
+
{
|
|
524
|
+
headers: {
|
|
525
|
+
Authorization: accessToken,
|
|
526
|
+
...formData.getHeaders(),
|
|
527
|
+
},
|
|
528
|
+
}
|
|
529
|
+
);
|
|
530
|
+
return response.data;
|
|
531
|
+
} catch (error: any) {
|
|
532
|
+
return error?.response?.data;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
async openLoanAccount({
|
|
537
|
+
loanPayload,
|
|
538
|
+
accessToken,
|
|
539
|
+
}: {
|
|
540
|
+
loanPayload: OpenLoanAccountType;
|
|
541
|
+
accessToken: string;
|
|
542
|
+
}): Promise<AxiosResponse> {
|
|
543
|
+
const formData = new FormData();
|
|
544
|
+
|
|
545
|
+
formData.append("customer_no", loanPayload.customer_no);
|
|
546
|
+
formData.append("product_code", loanPayload.product_code);
|
|
547
|
+
formData.append("officer_code", loanPayload.officer_code);
|
|
548
|
+
formData.append("loan_purpose", loanPayload.loan_purpose);
|
|
549
|
+
formData.append("loan_amount", loanPayload.loan_amount);
|
|
550
|
+
formData.append("disbursement_mode", loanPayload.disbursement_mode);
|
|
551
|
+
formData.append("collateral_type", loanPayload.collateral_type);
|
|
552
|
+
formData.append("ltv", loanPayload.ltv);
|
|
553
|
+
|
|
554
|
+
try {
|
|
555
|
+
const response = await axios.post(
|
|
556
|
+
`${this.baseUrl}${this.openLoanAccountEndpoint}`,
|
|
557
|
+
formData,
|
|
558
|
+
{
|
|
559
|
+
headers: {
|
|
560
|
+
Authorization: accessToken,
|
|
561
|
+
...formData.getHeaders(),
|
|
562
|
+
},
|
|
563
|
+
}
|
|
564
|
+
);
|
|
565
|
+
return response.data;
|
|
566
|
+
} catch (error: any) {
|
|
567
|
+
return error?.response?.data;
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
async updateLoanInfo({
|
|
572
|
+
loanPayload,
|
|
573
|
+
accessToken,
|
|
574
|
+
}: {
|
|
575
|
+
loanPayload: UpdateLoanPayloadType;
|
|
576
|
+
accessToken: string;
|
|
577
|
+
}): Promise<AxiosResponse> {
|
|
578
|
+
const formData = new FormData();
|
|
579
|
+
|
|
580
|
+
formData.append("account_no", loanPayload.account_no);
|
|
581
|
+
formData.append("tenure", loanPayload.tenure);
|
|
582
|
+
formData.append(
|
|
583
|
+
"installments[0][installment_type]",
|
|
584
|
+
loanPayload.installment_type
|
|
585
|
+
);
|
|
586
|
+
formData.append(
|
|
587
|
+
"installments[0][num_installments]",
|
|
588
|
+
loanPayload.num_installments
|
|
589
|
+
);
|
|
590
|
+
formData.append(
|
|
591
|
+
"installments[0][installment_amount]",
|
|
592
|
+
loanPayload.installment_amount
|
|
593
|
+
);
|
|
594
|
+
formData.append("interest_rate", loanPayload.interest_rate);
|
|
595
|
+
|
|
596
|
+
try {
|
|
597
|
+
const response = await axios.post(
|
|
598
|
+
`${this.baseUrl}${this.updateLoanInfoEndpoint}`,
|
|
599
|
+
formData,
|
|
600
|
+
{
|
|
601
|
+
headers: {
|
|
602
|
+
Authorization: accessToken,
|
|
603
|
+
...formData.getHeaders(),
|
|
604
|
+
},
|
|
605
|
+
}
|
|
606
|
+
);
|
|
607
|
+
console.log("response-----------", response.data);
|
|
608
|
+
return response.data;
|
|
609
|
+
} catch (error: any) {
|
|
610
|
+
console.log("error---------", error?.response?.data);
|
|
611
|
+
return error?.response?.data;
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
async addSolarInfo({
|
|
616
|
+
solarPayload,
|
|
617
|
+
accessToken,
|
|
618
|
+
}: {
|
|
619
|
+
solarPayload: SolarPayloadType;
|
|
620
|
+
accessToken: string;
|
|
621
|
+
}): Promise<AxiosResponse> {
|
|
622
|
+
const formData = new FormData();
|
|
623
|
+
|
|
624
|
+
formData.append("account_no", solarPayload.account_no);
|
|
625
|
+
formData.append("capacity", solarPayload.capacity);
|
|
626
|
+
formData.append("pv_module_serial_no", solarPayload.pv_module_serial_no);
|
|
627
|
+
formData.append("collateral_no", solarPayload.collateral_no);
|
|
628
|
+
formData.append("down_payment", solarPayload.down_payment);
|
|
629
|
+
formData.append("asset_value", solarPayload.asset_value);
|
|
630
|
+
formData.append("inverter_serial_no", solarPayload.inverter_serial_no);
|
|
631
|
+
formData.append("finance_type", solarPayload.finance_type);
|
|
632
|
+
formData.append("asset_category", solarPayload.asset_category);
|
|
633
|
+
formData.append("pv_module_model", solarPayload.pv_module_model);
|
|
634
|
+
formData.append("inverter_model", solarPayload.inverter_model);
|
|
635
|
+
formData.append("installer_code", solarPayload.installer_code);
|
|
636
|
+
formData.append("notation", solarPayload.notation);
|
|
637
|
+
|
|
638
|
+
try {
|
|
639
|
+
const response = await axios.post(
|
|
640
|
+
`${this.baseUrl}${this.addSolarInfoEndpoint}`,
|
|
641
|
+
formData,
|
|
642
|
+
{
|
|
643
|
+
headers: {
|
|
644
|
+
Authorization: accessToken,
|
|
645
|
+
...formData.getHeaders(),
|
|
646
|
+
},
|
|
647
|
+
}
|
|
648
|
+
);
|
|
649
|
+
console.log("response-----------", response.data);
|
|
650
|
+
return response.data;
|
|
651
|
+
} catch (error: any) {
|
|
652
|
+
console.log("error---------", error?.response?.data);
|
|
653
|
+
return error?.response?.data;
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
async generateDocument({
|
|
658
|
+
docDetails,
|
|
659
|
+
accessToken,
|
|
660
|
+
}: {
|
|
661
|
+
docDetails: Doctype;
|
|
662
|
+
accessToken: string;
|
|
663
|
+
}): Promise<AxiosResponse> {
|
|
664
|
+
try {
|
|
665
|
+
const response = await axios.get(
|
|
666
|
+
`${this.baseUrl}${this.generateDocumentEndpoint}`,
|
|
667
|
+
{
|
|
668
|
+
headers: {
|
|
669
|
+
Authorization: accessToken,
|
|
670
|
+
},
|
|
671
|
+
params: {
|
|
672
|
+
template_name: docDetails.template_name,
|
|
673
|
+
"unique_numbers[0]": docDetails.unique_numbers,
|
|
674
|
+
is_pdf: docDetails.is_pdf,
|
|
675
|
+
},
|
|
676
|
+
}
|
|
677
|
+
);
|
|
678
|
+
return response.data;
|
|
679
|
+
} catch (error: any) {
|
|
680
|
+
return error?.response?.data;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
async generateTransactionId({
|
|
685
|
+
actionName,
|
|
686
|
+
accessToken,
|
|
687
|
+
}: {
|
|
688
|
+
actionName: string;
|
|
689
|
+
accessToken: string;
|
|
690
|
+
}): Promise<AxiosResponse> {
|
|
691
|
+
const formData = new FormData();
|
|
692
|
+
|
|
693
|
+
formData.append("action_name", actionName);
|
|
694
|
+
|
|
695
|
+
try {
|
|
696
|
+
const response = await axios.post(
|
|
697
|
+
`${this.baseUrl}${this.generateTransactionIdEndpoint}`,
|
|
698
|
+
formData,
|
|
699
|
+
{
|
|
700
|
+
headers: {
|
|
701
|
+
Authorization: accessToken,
|
|
702
|
+
...formData.getHeaders(),
|
|
703
|
+
},
|
|
704
|
+
}
|
|
705
|
+
);
|
|
706
|
+
return response.data;
|
|
707
|
+
} catch (error: any) {
|
|
708
|
+
return error?.response?.data;
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
async addAccountDocument({
|
|
713
|
+
addAccPayload,
|
|
714
|
+
accessToken,
|
|
715
|
+
}: {
|
|
716
|
+
addAccPayload: AccountPayload;
|
|
717
|
+
accessToken: string;
|
|
718
|
+
}): Promise<AxiosResponse> {
|
|
719
|
+
const formData = new FormData();
|
|
720
|
+
|
|
721
|
+
formData.append("local_posting_time", addAccPayload.local_posting_time);
|
|
722
|
+
formData.append("user_name", addAccPayload.user_name);
|
|
723
|
+
formData.append("latitude", addAccPayload.latitude);
|
|
724
|
+
formData.append("accuracy", addAccPayload.accuracy);
|
|
725
|
+
formData.append("account_no", addAccPayload.account_no);
|
|
726
|
+
formData.append("type", addAccPayload.type);
|
|
727
|
+
formData.append("longitude", addAccPayload.longitude);
|
|
728
|
+
formData.append("transaction_id", addAccPayload.transaction_id);
|
|
729
|
+
formData.append("document[0][file]", addAccPayload.document_file);
|
|
730
|
+
formData.append("document[0][page_no]", addAccPayload.document_page_no);
|
|
731
|
+
|
|
732
|
+
try {
|
|
733
|
+
const response = await axios.post(
|
|
734
|
+
`${this.baseUrl}${this.addAccountDocumentEndpoint}`,
|
|
735
|
+
formData,
|
|
736
|
+
{
|
|
737
|
+
headers: {
|
|
738
|
+
Authorization: accessToken,
|
|
739
|
+
...formData.getHeaders(),
|
|
740
|
+
},
|
|
741
|
+
}
|
|
742
|
+
);
|
|
743
|
+
return response.data;
|
|
744
|
+
} catch (error: any) {
|
|
745
|
+
return error?.response?.data;
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
async viewLoan({
|
|
750
|
+
accNo,
|
|
751
|
+
accessToken,
|
|
752
|
+
}: {
|
|
753
|
+
accNo: string;
|
|
754
|
+
accessToken: string;
|
|
755
|
+
}): Promise<AxiosResponse> {
|
|
756
|
+
try {
|
|
757
|
+
const response = await axios.get(
|
|
758
|
+
`${this.baseUrl}${this.viewLoanEndpoint}`,
|
|
759
|
+
{
|
|
760
|
+
headers: {
|
|
761
|
+
Authorization: accessToken,
|
|
762
|
+
},
|
|
763
|
+
params: {
|
|
764
|
+
account_no: accNo,
|
|
765
|
+
},
|
|
766
|
+
}
|
|
767
|
+
);
|
|
768
|
+
|
|
769
|
+
return response.data;
|
|
770
|
+
} catch (error: any) {
|
|
771
|
+
return error?.response?.data;
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
async viewLoanSchedules({
|
|
776
|
+
accNo,
|
|
777
|
+
accessToken,
|
|
778
|
+
}: {
|
|
779
|
+
accNo: string;
|
|
780
|
+
accessToken: string;
|
|
781
|
+
}): Promise<AxiosResponse> {
|
|
782
|
+
try {
|
|
783
|
+
const response = await axios.get(
|
|
784
|
+
`${this.baseUrl}${this.viewLoanScheduleEndpoint}`,
|
|
785
|
+
{
|
|
786
|
+
headers: {
|
|
787
|
+
Authorization: accessToken,
|
|
788
|
+
},
|
|
789
|
+
params: {
|
|
790
|
+
account_no: accNo,
|
|
791
|
+
},
|
|
792
|
+
}
|
|
793
|
+
);
|
|
794
|
+
|
|
795
|
+
return response.data;
|
|
796
|
+
} catch (error: any) {
|
|
797
|
+
return error?.response?.data;
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
async viewLoanStatement({
|
|
802
|
+
accNo,
|
|
803
|
+
accessToken,
|
|
804
|
+
}: {
|
|
805
|
+
accNo: string;
|
|
806
|
+
accessToken: string;
|
|
807
|
+
}): Promise<AxiosResponse> {
|
|
808
|
+
try {
|
|
809
|
+
const response = await axios.get(
|
|
810
|
+
`${this.baseUrl}${this.viewLoanStatementEndpoint}`,
|
|
811
|
+
{
|
|
812
|
+
headers: {
|
|
813
|
+
Authorization: accessToken,
|
|
814
|
+
},
|
|
815
|
+
params: {
|
|
816
|
+
account_no: accNo,
|
|
817
|
+
},
|
|
818
|
+
}
|
|
819
|
+
);
|
|
820
|
+
|
|
821
|
+
return response.data;
|
|
822
|
+
} catch (error: any) {
|
|
823
|
+
return error?.response?.data;
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
export default QbrikApiWrapper;
|