@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.
@@ -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
- const token = await authentification();
440
- const url = `${this.backendServiceURL}/verification/api/kyc/result/?session_id=${session_id}`;
441
- const res = await axios.get<VerificationResult>(url,
442
- { headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` } });
443
- logger.log('getVerificationResult res', JSON.stringify(truncateFields(res.data), null, 2));
444
- return res.data;
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
 
@@ -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 - 80,
86
- width: bbox.width + 100,
87
- height: bbox.height + 150,
85
+ originY: bbox.minY ,
86
+ width: bbox.width ,
87
+ height: bbox.height,
88
88
  };
89
89
 
90
90
  // 4️⃣ Appliquer le crop