aeremmiddleware 1.0.60 → 1.0.62
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/dist/Finance/idfy.d.ts +5 -0
- package/dist/Finance/idfy.js +24 -0
- package/dist/Finance/idfy.js.map +1 -1
- package/dist/Finance/kycKart.d.ts +1 -0
- package/dist/Finance/kycKart.js +3 -0
- package/dist/Finance/kycKart.js.map +1 -1
- package/package.json +6 -6
- package/src/Finance/idfy.ts +72 -51
- package/src/Finance/kycKart.ts +465 -461
package/src/Finance/kycKart.ts
CHANGED
|
@@ -1,91 +1,92 @@
|
|
|
1
1
|
import axios, { AxiosResponse } from "axios";
|
|
2
2
|
import FormData from "form-data";
|
|
3
3
|
export interface Address {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
city: string | null;
|
|
5
|
+
country: any;
|
|
6
|
+
full: any;
|
|
7
|
+
line_1: string | null;
|
|
8
|
+
line_2: string | null;
|
|
9
|
+
state: string | null;
|
|
10
|
+
street_name: string | null;
|
|
11
|
+
zip: string | null;
|
|
12
12
|
}
|
|
13
13
|
export interface SourceOutput {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
14
|
+
aadhaar_linked: any;
|
|
15
|
+
address: Address;
|
|
16
|
+
age: any;
|
|
17
|
+
category: any;
|
|
18
|
+
dob: any;
|
|
19
|
+
dob_check: string | null;
|
|
20
|
+
dob_verified: string | null;
|
|
21
|
+
email: any;
|
|
22
|
+
father_name: string | null;
|
|
23
|
+
full_name: any;
|
|
24
|
+
full_name_split: any;
|
|
25
|
+
gender: any;
|
|
26
|
+
input_dob: string | null;
|
|
27
|
+
is_minor: any;
|
|
28
|
+
less_info: string | null;
|
|
29
|
+
masked_aadhaar: any;
|
|
30
|
+
pan_alloted_date: string | null;
|
|
31
|
+
pan_number: any;
|
|
32
|
+
phone_number: any;
|
|
33
|
+
status: string;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
export interface Result {
|
|
37
|
-
|
|
37
|
+
source_output: SourceOutput;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export interface PANInfo {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
41
|
+
action: string;
|
|
42
|
+
completed_at: string;
|
|
43
|
+
created_at: string;
|
|
44
|
+
group_id: string;
|
|
45
|
+
request_id: string;
|
|
46
|
+
result: Result;
|
|
47
|
+
status: string;
|
|
48
|
+
task_id: string;
|
|
49
|
+
type: string;
|
|
50
|
+
dataDump: string;
|
|
50
51
|
}
|
|
51
52
|
export interface IAadhaarVerificationPayload {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
};
|
|
61
|
-
timestamp: string;
|
|
62
|
-
};
|
|
63
|
-
response: {
|
|
64
|
-
code: number;
|
|
65
|
-
pan: string;
|
|
53
|
+
status: {
|
|
54
|
+
statusCode: number;
|
|
55
|
+
statusMessage: string;
|
|
56
|
+
transactionId: string;
|
|
57
|
+
checkId: string;
|
|
58
|
+
groupId: string;
|
|
59
|
+
input: {
|
|
60
|
+
aadhaarNo: string;
|
|
66
61
|
};
|
|
62
|
+
timestamp: string;
|
|
63
|
+
};
|
|
64
|
+
response: {
|
|
65
|
+
code: number;
|
|
66
|
+
pan: string;
|
|
67
|
+
};
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
export interface IAadhaarOfflineGetOTPResponse {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
};
|
|
80
|
-
timestamp: string;
|
|
71
|
+
status: {
|
|
72
|
+
statusCode: number;
|
|
73
|
+
statusMessage: string;
|
|
74
|
+
transactionId: string;
|
|
75
|
+
checkId: string;
|
|
76
|
+
groupId: string;
|
|
77
|
+
input: {
|
|
78
|
+
aadhaarNo: string;
|
|
79
|
+
task: string;
|
|
81
80
|
};
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
81
|
+
timestamp: string;
|
|
82
|
+
};
|
|
83
|
+
response: {
|
|
84
|
+
requestId: string;
|
|
85
|
+
result: {
|
|
86
|
+
message: string;
|
|
88
87
|
};
|
|
88
|
+
statusCode: number;
|
|
89
|
+
};
|
|
89
90
|
}
|
|
90
91
|
|
|
91
92
|
// export interface IAadhaarOfflineGetFileResponse {
|
|
@@ -103,434 +104,437 @@ export interface IAadhaarOfflineGetOTPResponse {
|
|
|
103
104
|
// }
|
|
104
105
|
|
|
105
106
|
export interface IAadhaarOfflineGetFileResponse {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
};
|
|
114
|
-
timestamp: string;
|
|
107
|
+
status: {
|
|
108
|
+
statusCode: number;
|
|
109
|
+
statusMessage: string;
|
|
110
|
+
transactionId: string;
|
|
111
|
+
input: {
|
|
112
|
+
aadhaarNo: string;
|
|
113
|
+
task: string;
|
|
115
114
|
};
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
shareCode: string;
|
|
138
|
-
generatedDateTime: string;
|
|
139
|
-
image: string; // Base64 image data
|
|
115
|
+
timestamp: string;
|
|
116
|
+
};
|
|
117
|
+
response: {
|
|
118
|
+
maskedAadhaarNumber: string;
|
|
119
|
+
name: string;
|
|
120
|
+
dob: string;
|
|
121
|
+
gender: "M" | "F" | "Other";
|
|
122
|
+
fatherName: string;
|
|
123
|
+
careOf: string;
|
|
124
|
+
address: string;
|
|
125
|
+
splitAddress: {
|
|
126
|
+
country: string;
|
|
127
|
+
dist: string;
|
|
128
|
+
state: string;
|
|
129
|
+
po: string;
|
|
130
|
+
loc: string;
|
|
131
|
+
vtc: string;
|
|
132
|
+
subdist: string;
|
|
133
|
+
street: string;
|
|
134
|
+
house: string;
|
|
135
|
+
landmark: string;
|
|
140
136
|
};
|
|
137
|
+
pincode: string;
|
|
138
|
+
shareCode: string;
|
|
139
|
+
generatedDateTime: string;
|
|
140
|
+
image: string; // Base64 image data
|
|
141
|
+
};
|
|
141
142
|
}
|
|
142
143
|
|
|
143
144
|
export interface INameMatchResponse {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
145
|
+
status: {
|
|
146
|
+
statusCode: number;
|
|
147
|
+
statusMessage: string;
|
|
148
|
+
transactionId: string;
|
|
149
|
+
checkId: string;
|
|
150
|
+
groupId: string;
|
|
151
|
+
timestamp: string;
|
|
152
|
+
};
|
|
153
|
+
response: {
|
|
154
|
+
name1: string;
|
|
155
|
+
name2: string;
|
|
156
|
+
similarity: number;
|
|
157
|
+
similarityPercentage: string;
|
|
158
|
+
};
|
|
158
159
|
}
|
|
159
160
|
|
|
160
161
|
export interface INameMatchRequest {
|
|
161
|
-
|
|
162
|
-
|
|
162
|
+
name1: string;
|
|
163
|
+
name2: string;
|
|
163
164
|
}
|
|
164
165
|
export interface IAccountTransferHybridRequest {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
166
|
+
accountNumber: string;
|
|
167
|
+
ifsc: string;
|
|
168
|
+
}
|
|
169
|
+
|
|
169
170
|
export interface IAccountTransferHybridResponse {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
171
|
+
status: {
|
|
172
|
+
statusCode: number;
|
|
173
|
+
statusMessage: string;
|
|
174
|
+
transactionId: string;
|
|
175
|
+
checkId: string;
|
|
176
|
+
groupId: string;
|
|
177
|
+
timestamp: string;
|
|
178
|
+
};
|
|
179
|
+
response: {
|
|
180
|
+
account_status: string;
|
|
181
|
+
beneficiary_name: string;
|
|
182
|
+
bank_name: string;
|
|
183
|
+
branch_name: string;
|
|
184
|
+
npci_response_code: string;
|
|
185
|
+
transaction_id: string;
|
|
186
|
+
};
|
|
187
|
+
error?: {
|
|
188
|
+
code: string;
|
|
189
|
+
title: string;
|
|
190
|
+
message: string;
|
|
191
|
+
};
|
|
191
192
|
}
|
|
192
193
|
export default class KycCartAPIWrapper {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
194
|
+
private apiKey: string;
|
|
195
|
+
private baseUrl: string;
|
|
196
|
+
static AADHAAR_TASKS = {
|
|
197
|
+
GET_OTP: "getOtp",
|
|
198
|
+
GET_FILE: "getFile",
|
|
199
|
+
};
|
|
200
|
+
constructor(apiKey: string) {
|
|
201
|
+
this.apiKey = apiKey;
|
|
202
|
+
this.baseUrl = "https://api.kyckart.com/api";
|
|
203
|
+
}
|
|
203
204
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
205
|
+
public async accountTransfer({
|
|
206
|
+
accountNumber,
|
|
207
|
+
ifsc,
|
|
208
|
+
name,
|
|
209
|
+
checkId,
|
|
210
|
+
}: {
|
|
211
|
+
accountNumber: string;
|
|
212
|
+
ifsc: string;
|
|
213
|
+
name: string;
|
|
214
|
+
checkId: string;
|
|
215
|
+
}): Promise<AxiosResponse> {
|
|
216
|
+
const form = new FormData();
|
|
217
|
+
form.append("accountNumber", accountNumber);
|
|
218
|
+
form.append("ifsc", ifsc);
|
|
219
|
+
form.append("name", name);
|
|
220
|
+
form.append("checkId", checkId);
|
|
220
221
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}
|
|
231
|
-
);
|
|
232
|
-
return response.data;
|
|
233
|
-
} catch (error: any) {
|
|
234
|
-
throw {
|
|
235
|
-
statusCode: error.response.data.status.statusCode,
|
|
236
|
-
statusMessage: error.response.data.status.statusMessage,
|
|
237
|
-
errorTitle: error.response.data.error.title,
|
|
238
|
-
errorMessage: error.response.data.error.message,
|
|
239
|
-
};
|
|
222
|
+
try {
|
|
223
|
+
const response = await axios.post(
|
|
224
|
+
`${this.baseUrl}/bank/account-transfer`,
|
|
225
|
+
form,
|
|
226
|
+
{
|
|
227
|
+
headers: {
|
|
228
|
+
"x-api-key": this.apiKey,
|
|
229
|
+
...form.getHeaders(),
|
|
230
|
+
},
|
|
240
231
|
}
|
|
232
|
+
);
|
|
233
|
+
return response.data;
|
|
234
|
+
} catch (error: any) {
|
|
235
|
+
throw {
|
|
236
|
+
statusCode: error.response.data.status.statusCode,
|
|
237
|
+
statusMessage: error.response.data.status.statusMessage,
|
|
238
|
+
errorTitle: error.response.data.error.title,
|
|
239
|
+
errorMessage: error.response.data.error.message,
|
|
240
|
+
};
|
|
241
241
|
}
|
|
242
|
+
}
|
|
242
243
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
try {
|
|
252
|
-
const response = await axios.post(
|
|
253
|
-
`${this.baseUrl}/panCard/panDetailedContactV4`,
|
|
254
|
-
form,
|
|
255
|
-
{
|
|
256
|
-
headers: {
|
|
257
|
-
"x-api-key": this.apiKey,
|
|
258
|
-
...form.getHeaders(),
|
|
259
|
-
},
|
|
260
|
-
}
|
|
261
|
-
);
|
|
262
|
-
const data = response?.data?.response;
|
|
263
|
-
const panInfo : PANInfo = {
|
|
264
|
-
action: "verify_with_source",
|
|
265
|
-
completed_at: response?.data?.status?.timestamp,
|
|
266
|
-
created_at: response?.data?.status?.timestamp,
|
|
267
|
-
group_id: response?.data?.status?.transactionId,
|
|
268
|
-
request_id: response?.data?.status?.transactionId,
|
|
269
|
-
result: {
|
|
270
|
-
source_output: {
|
|
271
|
-
aadhaar_linked: data.aadhaarSeedingStatus ?? false,
|
|
272
|
-
address: {
|
|
273
|
-
city: data?.city || null,
|
|
274
|
-
country: data?.country || "India",
|
|
275
|
-
full: data?.country || "India",
|
|
276
|
-
line_1: data?.address || null,
|
|
277
|
-
line_2: data?.address || null,
|
|
278
|
-
state: data?.state || null,
|
|
279
|
-
street_name: null,
|
|
280
|
-
zip: data?.pincode || null,
|
|
281
|
-
},
|
|
282
|
-
age: 30,
|
|
283
|
-
category: data?.typeOfHolder || "person",
|
|
284
|
-
dob: data?.dob || "",
|
|
285
|
-
dob_check: null,
|
|
286
|
-
dob_verified: null,
|
|
287
|
-
email: data?.email || "",
|
|
288
|
-
father_name: data?.middleName || null,
|
|
289
|
-
full_name: data?.name || "",
|
|
290
|
-
full_name_split: [
|
|
291
|
-
data?.firstName,
|
|
292
|
-
data?.middleName,
|
|
293
|
-
data?.lastName,
|
|
294
|
-
],
|
|
295
|
-
gender: data?.gender || "M",
|
|
296
|
-
input_dob: null,
|
|
297
|
-
is_minor: false,
|
|
298
|
-
less_info: null,
|
|
299
|
-
masked_aadhaar: data?.maskedAadhaar || "XXXXXXXXXXXX",
|
|
300
|
-
pan_alloted_date: null,
|
|
301
|
-
pan_number: panNo || "",
|
|
302
|
-
phone_number: "",
|
|
303
|
-
status: "id_found",
|
|
304
|
-
},
|
|
305
|
-
},
|
|
306
|
-
status: "completed",
|
|
307
|
-
task_id: response?.data?.status?.transactionId,
|
|
308
|
-
type: "ind_pan_plus",
|
|
309
|
-
};
|
|
244
|
+
public async getIndividualPANInfo({
|
|
245
|
+
panNo,
|
|
246
|
+
}: {
|
|
247
|
+
panNo: string;
|
|
248
|
+
}): Promise<PANInfo[]> {
|
|
249
|
+
const form = new FormData();
|
|
250
|
+
form.append("panNumber", panNo);
|
|
310
251
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
address: {
|
|
321
|
-
city: null,
|
|
322
|
-
country: null,
|
|
323
|
-
full: null,
|
|
324
|
-
line_1: null,
|
|
325
|
-
line_2: null,
|
|
326
|
-
state: null,
|
|
327
|
-
street_name: null,
|
|
328
|
-
zip: null,
|
|
329
|
-
},
|
|
330
|
-
age: null,
|
|
331
|
-
category: null,
|
|
332
|
-
dob: null,
|
|
333
|
-
dob_check: null,
|
|
334
|
-
dob_verified: null,
|
|
335
|
-
email: null,
|
|
336
|
-
father_name: null,
|
|
337
|
-
full_name: null,
|
|
338
|
-
full_name_split: null,
|
|
339
|
-
gender: null,
|
|
340
|
-
input_dob: null,
|
|
341
|
-
is_minor: null,
|
|
342
|
-
less_info: null,
|
|
343
|
-
masked_aadhaar: null,
|
|
344
|
-
pan_alloted_date: null,
|
|
345
|
-
pan_number: null,
|
|
346
|
-
phone_number: null,
|
|
347
|
-
status: "id_not_found",
|
|
348
|
-
},
|
|
349
|
-
},
|
|
350
|
-
status: "completed",
|
|
351
|
-
task_id: response?.data?.status?.transactionId,
|
|
352
|
-
type: "ind_pan_plus",
|
|
353
|
-
};
|
|
354
|
-
|
|
355
|
-
if (response?.data?.response?.code == 200) {
|
|
356
|
-
return [panInfo];
|
|
357
|
-
} else if(response?.data?.status?.statusCode === 400) {
|
|
358
|
-
errorPAN.result.source_output.status = "source_down";
|
|
359
|
-
return [errorPAN];
|
|
360
|
-
}else{
|
|
361
|
-
return [errorPAN];
|
|
362
|
-
}
|
|
363
|
-
} catch (error: any) {
|
|
364
|
-
return [
|
|
365
|
-
{
|
|
366
|
-
action: "verify_with_source",
|
|
367
|
-
completed_at: error?.data?.status?.timestamp,
|
|
368
|
-
created_at: error?.data?.status?.timestamp,
|
|
369
|
-
group_id: error?.data?.status?.transactionId,
|
|
370
|
-
request_id: error?.data?.status?.transactionId,
|
|
371
|
-
result: {
|
|
372
|
-
source_output: {
|
|
373
|
-
aadhaar_linked: null,
|
|
374
|
-
address: {
|
|
375
|
-
city: null,
|
|
376
|
-
country: null,
|
|
377
|
-
full: null,
|
|
378
|
-
line_1: null,
|
|
379
|
-
line_2: null,
|
|
380
|
-
state: null,
|
|
381
|
-
street_name: null,
|
|
382
|
-
zip: null,
|
|
383
|
-
},
|
|
384
|
-
age: null,
|
|
385
|
-
category: null,
|
|
386
|
-
dob: null,
|
|
387
|
-
dob_check: null,
|
|
388
|
-
dob_verified: null,
|
|
389
|
-
email: null,
|
|
390
|
-
father_name: null,
|
|
391
|
-
full_name: null,
|
|
392
|
-
full_name_split: null,
|
|
393
|
-
gender: null,
|
|
394
|
-
input_dob: null,
|
|
395
|
-
is_minor: null,
|
|
396
|
-
less_info: null,
|
|
397
|
-
masked_aadhaar: null,
|
|
398
|
-
pan_alloted_date: null,
|
|
399
|
-
pan_number: null,
|
|
400
|
-
phone_number: null,
|
|
401
|
-
status: "id_not_found",
|
|
402
|
-
},
|
|
403
|
-
},
|
|
404
|
-
status: "failed",
|
|
405
|
-
task_id: "null",
|
|
406
|
-
type: "ind_pan_plus",
|
|
407
|
-
},
|
|
408
|
-
];
|
|
252
|
+
try {
|
|
253
|
+
const response = await axios.post(
|
|
254
|
+
`${this.baseUrl}/panCard/panDetailedContactV4`,
|
|
255
|
+
form,
|
|
256
|
+
{
|
|
257
|
+
headers: {
|
|
258
|
+
"x-api-key": this.apiKey,
|
|
259
|
+
...form.getHeaders(),
|
|
260
|
+
},
|
|
409
261
|
}
|
|
410
|
-
|
|
262
|
+
);
|
|
263
|
+
const data = response?.data?.response;
|
|
264
|
+
const panInfo: PANInfo = {
|
|
265
|
+
action: "verify_with_source",
|
|
266
|
+
completed_at: response?.data?.status?.timestamp,
|
|
267
|
+
created_at: response?.data?.status?.timestamp,
|
|
268
|
+
group_id: response?.data?.status?.transactionId,
|
|
269
|
+
request_id: response?.data?.status?.transactionId,
|
|
270
|
+
result: {
|
|
271
|
+
source_output: {
|
|
272
|
+
aadhaar_linked: data.aadhaarSeedingStatus ?? false,
|
|
273
|
+
address: {
|
|
274
|
+
city: data?.city || null,
|
|
275
|
+
country: data?.country || "India",
|
|
276
|
+
full: data?.country || "India",
|
|
277
|
+
line_1: data?.address || null,
|
|
278
|
+
line_2: data?.address || null,
|
|
279
|
+
state: data?.state || null,
|
|
280
|
+
street_name: null,
|
|
281
|
+
zip: data?.pincode || null,
|
|
282
|
+
},
|
|
283
|
+
age: 30,
|
|
284
|
+
category: data?.typeOfHolder || "person",
|
|
285
|
+
dob: data?.dob || "",
|
|
286
|
+
dob_check: null,
|
|
287
|
+
dob_verified: null,
|
|
288
|
+
email: data?.email || "",
|
|
289
|
+
father_name: data?.middleName || null,
|
|
290
|
+
full_name: data?.name || "",
|
|
291
|
+
full_name_split: [
|
|
292
|
+
data?.firstName,
|
|
293
|
+
data?.middleName,
|
|
294
|
+
data?.lastName,
|
|
295
|
+
],
|
|
296
|
+
gender: data?.gender || "M",
|
|
297
|
+
input_dob: null,
|
|
298
|
+
is_minor: false,
|
|
299
|
+
less_info: null,
|
|
300
|
+
masked_aadhaar: data?.maskedAadhaar || "XXXXXXXXXXXX",
|
|
301
|
+
pan_alloted_date: null,
|
|
302
|
+
pan_number: panNo || "",
|
|
303
|
+
phone_number: "",
|
|
304
|
+
status: "id_found",
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
status: "completed",
|
|
308
|
+
task_id: response?.data?.status?.transactionId,
|
|
309
|
+
type: "ind_pan_plus",
|
|
310
|
+
dataDump: JSON.stringify(response?.data),
|
|
311
|
+
};
|
|
411
312
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
313
|
+
const errorPAN: PANInfo = {
|
|
314
|
+
action: "verify_with_source",
|
|
315
|
+
completed_at: response?.data?.status?.timestamp,
|
|
316
|
+
created_at: response?.data?.status?.timestamp,
|
|
317
|
+
group_id: response?.data?.status?.transactionId,
|
|
318
|
+
request_id: response?.data?.status?.transactionId,
|
|
319
|
+
result: {
|
|
320
|
+
source_output: {
|
|
321
|
+
aadhaar_linked: null,
|
|
322
|
+
address: {
|
|
323
|
+
city: null,
|
|
324
|
+
country: null,
|
|
325
|
+
full: null,
|
|
326
|
+
line_1: null,
|
|
327
|
+
line_2: null,
|
|
328
|
+
state: null,
|
|
329
|
+
street_name: null,
|
|
330
|
+
zip: null,
|
|
331
|
+
},
|
|
332
|
+
age: null,
|
|
333
|
+
category: null,
|
|
334
|
+
dob: null,
|
|
335
|
+
dob_check: null,
|
|
336
|
+
dob_verified: null,
|
|
337
|
+
email: null,
|
|
338
|
+
father_name: null,
|
|
339
|
+
full_name: null,
|
|
340
|
+
full_name_split: null,
|
|
341
|
+
gender: null,
|
|
342
|
+
input_dob: null,
|
|
343
|
+
is_minor: null,
|
|
344
|
+
less_info: null,
|
|
345
|
+
masked_aadhaar: null,
|
|
346
|
+
pan_alloted_date: null,
|
|
347
|
+
pan_number: null,
|
|
348
|
+
phone_number: null,
|
|
349
|
+
status: "id_not_found",
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
status: "completed",
|
|
353
|
+
task_id: response?.data?.status?.transactionId,
|
|
354
|
+
type: "ind_pan_plus",
|
|
355
|
+
dataDump: JSON.stringify(response?.data),
|
|
356
|
+
};
|
|
426
357
|
|
|
427
|
-
|
|
428
|
-
|
|
358
|
+
if (response?.data?.response?.code == 200) {
|
|
359
|
+
return [panInfo];
|
|
360
|
+
} else if (response?.data?.status?.statusCode === 400) {
|
|
361
|
+
errorPAN.result.source_output.status = "source_down";
|
|
362
|
+
return [errorPAN];
|
|
363
|
+
} else {
|
|
364
|
+
return [errorPAN];
|
|
365
|
+
}
|
|
366
|
+
} catch (error: any) {
|
|
367
|
+
return [
|
|
368
|
+
{
|
|
369
|
+
action: "verify_with_source",
|
|
370
|
+
completed_at: error?.data?.status?.timestamp,
|
|
371
|
+
created_at: error?.data?.status?.timestamp,
|
|
372
|
+
group_id: error?.data?.status?.transactionId,
|
|
373
|
+
request_id: error?.data?.status?.transactionId,
|
|
374
|
+
result: {
|
|
375
|
+
source_output: {
|
|
376
|
+
aadhaar_linked: null,
|
|
377
|
+
address: {
|
|
378
|
+
city: null,
|
|
379
|
+
country: null,
|
|
380
|
+
full: null,
|
|
381
|
+
line_1: null,
|
|
382
|
+
line_2: null,
|
|
383
|
+
state: null,
|
|
384
|
+
street_name: null,
|
|
385
|
+
zip: null,
|
|
386
|
+
},
|
|
387
|
+
age: null,
|
|
388
|
+
category: null,
|
|
389
|
+
dob: null,
|
|
390
|
+
dob_check: null,
|
|
391
|
+
dob_verified: null,
|
|
392
|
+
email: null,
|
|
393
|
+
father_name: null,
|
|
394
|
+
full_name: null,
|
|
395
|
+
full_name_split: null,
|
|
396
|
+
gender: null,
|
|
397
|
+
input_dob: null,
|
|
398
|
+
is_minor: null,
|
|
399
|
+
less_info: null,
|
|
400
|
+
masked_aadhaar: null,
|
|
401
|
+
pan_alloted_date: null,
|
|
402
|
+
pan_number: null,
|
|
403
|
+
phone_number: null,
|
|
404
|
+
status: "id_not_found",
|
|
405
|
+
},
|
|
406
|
+
},
|
|
407
|
+
status: "failed",
|
|
408
|
+
task_id: "null",
|
|
409
|
+
type: "ind_pan_plus",
|
|
410
|
+
dataDump: "null",
|
|
411
|
+
},
|
|
412
|
+
];
|
|
413
|
+
}
|
|
414
|
+
}
|
|
429
415
|
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
416
|
+
public async getMaskedPanByAadhaar({ aadhaarNo }: { aadhaarNo: string }) {
|
|
417
|
+
try {
|
|
418
|
+
const form = new FormData();
|
|
419
|
+
form.append("aadhaarNo", aadhaarNo);
|
|
420
|
+
const response = await axios.post(
|
|
421
|
+
`${this.baseUrl}/aadhaar/aadhaarToPan`,
|
|
422
|
+
form,
|
|
423
|
+
{
|
|
424
|
+
headers: {
|
|
425
|
+
"x-api-key": this.apiKey,
|
|
426
|
+
...form.getHeaders(),
|
|
427
|
+
},
|
|
433
428
|
}
|
|
434
|
-
|
|
429
|
+
);
|
|
435
430
|
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
const form = new FormData();
|
|
439
|
-
form.append("aadhaarNo", aadhaarNo);
|
|
440
|
-
form.append("task", KycCartAPIWrapper.AADHAAR_TASKS.GET_OTP);
|
|
441
|
-
const response = await axios.post(
|
|
442
|
-
`${this.baseUrl}/aadhaar/aadhaarOfflineOtpV5`,
|
|
443
|
-
form,
|
|
444
|
-
{
|
|
445
|
-
headers: {
|
|
446
|
-
"x-api-key": this.apiKey,
|
|
447
|
-
...form.getHeaders(),
|
|
448
|
-
},
|
|
449
|
-
}
|
|
450
|
-
);
|
|
451
|
-
const data: IAadhaarOfflineGetOTPResponse = response?.data;
|
|
452
|
-
console.log(data);
|
|
431
|
+
const data: IAadhaarVerificationPayload = response?.data;
|
|
432
|
+
console.log(data);
|
|
453
433
|
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
}
|
|
434
|
+
return data;
|
|
435
|
+
} catch (error) {
|
|
436
|
+
throw error;
|
|
458
437
|
}
|
|
438
|
+
}
|
|
459
439
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
form.
|
|
472
|
-
|
|
473
|
-
form.append("requestId", requestId);
|
|
474
|
-
form.append("task", KycCartAPIWrapper.AADHAAR_TASKS.GET_FILE);
|
|
475
|
-
const response = await axios.post(
|
|
476
|
-
`${this.baseUrl}/aadhaar/aadhaarOfflineOtpV5`,
|
|
477
|
-
form,
|
|
478
|
-
{
|
|
479
|
-
headers: {
|
|
480
|
-
"x-api-key": this.apiKey,
|
|
481
|
-
...form.getHeaders(),
|
|
482
|
-
},
|
|
483
|
-
}
|
|
484
|
-
);
|
|
485
|
-
const data: IAadhaarOfflineGetFileResponse = response?.data;
|
|
486
|
-
|
|
487
|
-
return data;
|
|
488
|
-
} catch (error) {
|
|
489
|
-
throw error;
|
|
440
|
+
public async getAadhaarOtp({ aadhaarNo }: { aadhaarNo: string }) {
|
|
441
|
+
try {
|
|
442
|
+
const form = new FormData();
|
|
443
|
+
form.append("aadhaarNo", aadhaarNo);
|
|
444
|
+
form.append("task", KycCartAPIWrapper.AADHAAR_TASKS.GET_OTP);
|
|
445
|
+
const response = await axios.post(
|
|
446
|
+
`${this.baseUrl}/aadhaar/aadhaarOfflineOtpV5`,
|
|
447
|
+
form,
|
|
448
|
+
{
|
|
449
|
+
headers: {
|
|
450
|
+
"x-api-key": this.apiKey,
|
|
451
|
+
...form.getHeaders(),
|
|
452
|
+
},
|
|
490
453
|
}
|
|
454
|
+
);
|
|
455
|
+
const data: IAadhaarOfflineGetOTPResponse = response?.data;
|
|
456
|
+
console.log(data);
|
|
457
|
+
|
|
458
|
+
return data;
|
|
459
|
+
} catch (error) {
|
|
460
|
+
throw error;
|
|
491
461
|
}
|
|
462
|
+
}
|
|
492
463
|
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
464
|
+
public async verifyAadhaarOtp({
|
|
465
|
+
aadhaarNo,
|
|
466
|
+
otp,
|
|
467
|
+
requestId,
|
|
468
|
+
}: {
|
|
469
|
+
requestId: string;
|
|
470
|
+
aadhaarNo: string;
|
|
471
|
+
otp: string;
|
|
472
|
+
}) {
|
|
473
|
+
try {
|
|
474
|
+
const form = new FormData();
|
|
475
|
+
form.append("aadhaarNo", aadhaarNo);
|
|
476
|
+
form.append("otp", otp);
|
|
477
|
+
form.append("requestId", requestId);
|
|
478
|
+
form.append("task", KycCartAPIWrapper.AADHAAR_TASKS.GET_FILE);
|
|
479
|
+
const response = await axios.post(
|
|
480
|
+
`${this.baseUrl}/aadhaar/aadhaarOfflineOtpV5`,
|
|
481
|
+
form,
|
|
482
|
+
{
|
|
483
|
+
headers: {
|
|
484
|
+
"x-api-key": this.apiKey,
|
|
485
|
+
...form.getHeaders(),
|
|
486
|
+
},
|
|
487
|
+
}
|
|
488
|
+
);
|
|
489
|
+
const data: IAadhaarOfflineGetFileResponse = response?.data;
|
|
503
490
|
|
|
504
|
-
|
|
491
|
+
return data;
|
|
492
|
+
} catch (error) {
|
|
493
|
+
throw error;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
505
496
|
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
497
|
+
public async nameMatch(payload: INameMatchRequest) {
|
|
498
|
+
try {
|
|
499
|
+
const response = await axios.get(
|
|
500
|
+
`${this.baseUrl}/match/name?name1=${payload.name1}&name2=${payload.name2}`,
|
|
501
|
+
{
|
|
502
|
+
headers: {
|
|
503
|
+
"x-api-key": this.apiKey,
|
|
504
|
+
},
|
|
509
505
|
}
|
|
506
|
+
);
|
|
507
|
+
|
|
508
|
+
const data: INameMatchResponse = response?.data;
|
|
509
|
+
|
|
510
|
+
return data;
|
|
511
|
+
} catch (error) {
|
|
512
|
+
throw error;
|
|
510
513
|
}
|
|
514
|
+
}
|
|
511
515
|
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
}
|
|
529
|
-
);
|
|
530
|
-
|
|
531
|
-
return response.data;
|
|
532
|
-
} catch (error) {
|
|
533
|
-
throw error;
|
|
516
|
+
public async accountTransferHybrid(
|
|
517
|
+
payload: IAccountTransferHybridRequest
|
|
518
|
+
): Promise<IAccountTransferHybridResponse> {
|
|
519
|
+
try {
|
|
520
|
+
const form = new FormData();
|
|
521
|
+
form.append("accountNumber", payload.accountNumber);
|
|
522
|
+
form.append("ifsc", payload.ifsc);
|
|
523
|
+
|
|
524
|
+
const response = await axios.post(
|
|
525
|
+
`${this.baseUrl}/bank/accountTransferHybrid`,
|
|
526
|
+
form,
|
|
527
|
+
{
|
|
528
|
+
headers: {
|
|
529
|
+
"x-api-key": this.apiKey,
|
|
530
|
+
...form.getHeaders(),
|
|
531
|
+
},
|
|
534
532
|
}
|
|
533
|
+
);
|
|
534
|
+
|
|
535
|
+
return response.data;
|
|
536
|
+
} catch (error) {
|
|
537
|
+
throw error;
|
|
535
538
|
}
|
|
539
|
+
}
|
|
536
540
|
}
|