@transfergratis/react-native-sdk 0.1.17 → 0.1.18
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/android/build.gradle +1 -1
- package/build/components/KYCElements/IDCardCapture.js +3 -3
- package/build/components/KYCElements/IDCardCapture.js.map +1 -1
- package/build/components/KYCElements/VerificationProgressTemplate.js +3 -3
- package/build/components/KYCElements/VerificationProgressTemplate.js.map +1 -1
- package/build/components/TemplateKYCExample.d.ts.map +1 -1
- package/build/components/TemplateKYCExample.js +5 -8
- package/build/components/TemplateKYCExample.js.map +1 -1
- package/build/components/TemplateKYCFlowRefactored.js +7 -2
- package/build/components/TemplateKYCFlowRefactored.js.map +1 -1
- package/build/modules/api/KYCService.d.ts.map +1 -1
- package/build/modules/api/KYCService.js +12 -6
- package/build/modules/api/KYCService.js.map +1 -1
- package/build/utils/cropByObb.js +3 -3
- package/build/utils/cropByObb.js.map +1 -1
- package/package.json +1 -1
- package/src/components/KYCElements/IDCardCapture.tsx +8 -8
- package/src/components/KYCElements/VerificationProgressTemplate.tsx +10 -10
- package/src/components/TemplateKYCExample.tsx +6 -8
- package/src/components/TemplateKYCFlowRefactored.tsx +10 -3
- package/src/modules/api/KYCService.ts +12 -7
- package/src/utils/cropByObb.ts +3 -3
|
@@ -226,9 +226,9 @@ export class KYCService {
|
|
|
226
226
|
const rnFile: any = { uri: fileUri, type: 'image/jpeg', name: 'id_card_front.jpg' };
|
|
227
227
|
formData.append('file', rnFile);
|
|
228
228
|
const docTypeShorted = GovernmentDocumentTypeShorted[docType as GovernmentDocumentType];
|
|
229
|
-
logger.log('checkTemplateType params', this.mrzServiceURL, JSON.stringify({ fileUri, docTypeShorted, docRegion, token, postfix }, null, 2));
|
|
230
229
|
const url = `${this.mrzServiceURL}/get_template_version/?doc_type=${encodeURIComponent(docTypeShorted)}&doc_region=${encodeURIComponent(docRegion)}&postfix=${postfix}`;
|
|
231
230
|
|
|
231
|
+
logger.log('checkTemplateType params', this.mrzServiceURL, JSON.stringify({ fileUri, docTypeShorted, docRegion, token, postfix, url }, null, 2));
|
|
232
232
|
try {
|
|
233
233
|
const res = await axios.post<CheckTemplateTypeResponse>(url, formData, {
|
|
234
234
|
headers: { 'Content-Type': 'multipart/form-data', 'Authorization': `Bearer ${token}`, },
|
|
@@ -436,12 +436,17 @@ export class KYCService {
|
|
|
436
436
|
}
|
|
437
437
|
// reultat de la verification
|
|
438
438
|
async getVerificationResult(session_id: string): Promise<VerificationResult> {
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
439
|
+
try {
|
|
440
|
+
const token = await authentification();
|
|
441
|
+
const url = `${this.backendServiceURL}/verification/api/kyc/result/?session_id=${session_id}`;
|
|
442
|
+
const res = await axios.get<VerificationResult>(url,
|
|
443
|
+
{ headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` } });
|
|
444
|
+
logger.log('getVerificationResult res', JSON.stringify(truncateFields(res.data), null, 2));
|
|
445
|
+
return res.data;
|
|
446
|
+
} catch (error) {
|
|
447
|
+
logger.error('Error getting verification result:', JSON.stringify(errorMessage(error), null, 2));
|
|
448
|
+
throw error;
|
|
449
|
+
}
|
|
445
450
|
}
|
|
446
451
|
}
|
|
447
452
|
|
package/src/utils/cropByObb.ts
CHANGED
|
@@ -82,9 +82,9 @@ export async function cropImageWithBBox(uri: string, bbox: any) {
|
|
|
82
82
|
// 3️⃣ Convertir le bbox à la taille réelle scale 0.10 = 10%
|
|
83
83
|
const crop = {
|
|
84
84
|
originX: bbox.minX ,
|
|
85
|
-
originY: bbox.minY
|
|
86
|
-
width: bbox.width
|
|
87
|
-
height: bbox.height
|
|
85
|
+
originY: bbox.minY ,
|
|
86
|
+
width: bbox.width ,
|
|
87
|
+
height: bbox.height,
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
// 4️⃣ Appliquer le crop
|