@transfergratis/react-native-sdk 0.1.4 → 0.1.6
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/build/api/axios.d.ts +30 -0
- package/build/api/axios.d.ts.map +1 -0
- package/build/api/axios.js +92 -0
- package/build/api/axios.js.map +1 -0
- package/build/components/EnhancedCameraView.d.ts +1 -41
- package/build/components/EnhancedCameraView.d.ts.map +1 -1
- package/build/components/EnhancedCameraView.js +75 -34
- package/build/components/EnhancedCameraView.js.map +1 -1
- package/build/components/EnhancedCameraView.web.d.ts +1 -41
- package/build/components/EnhancedCameraView.web.d.ts.map +1 -1
- package/build/components/EnhancedCameraView.web.js +28 -4
- package/build/components/EnhancedCameraView.web.js.map +1 -1
- package/build/components/KYCElements/CountrySelectionTemplate.d.ts +2 -2
- package/build/components/KYCElements/CountrySelectionTemplate.d.ts.map +1 -1
- package/build/components/KYCElements/CountrySelectionTemplate.js +77 -114
- package/build/components/KYCElements/CountrySelectionTemplate.js.map +1 -1
- package/build/components/KYCElements/FileUploadTemplate.d.ts.map +1 -1
- package/build/components/KYCElements/FileUploadTemplate.js +7 -3
- package/build/components/KYCElements/FileUploadTemplate.js.map +1 -1
- package/build/components/KYCElements/IDCardCapture.d.ts +7 -2
- package/build/components/KYCElements/IDCardCapture.d.ts.map +1 -1
- package/build/components/KYCElements/IDCardCapture.js +253 -104
- package/build/components/KYCElements/IDCardCapture.js.map +1 -1
- package/build/components/KYCElements/InitializationStep.d.ts +5 -0
- package/build/components/KYCElements/InitializationStep.d.ts.map +1 -0
- package/build/components/KYCElements/InitializationStep.js +41 -0
- package/build/components/KYCElements/InitializationStep.js.map +1 -0
- package/build/components/KYCElements/LocationCaptureTemplate.d.ts.map +1 -1
- package/build/components/KYCElements/LocationCaptureTemplate.js +15 -13
- package/build/components/KYCElements/LocationCaptureTemplate.js.map +1 -1
- package/build/components/KYCElements/OrientationVideoCapture.d.ts +2 -2
- package/build/components/KYCElements/OrientationVideoCapture.d.ts.map +1 -1
- package/build/components/KYCElements/OrientationVideoCapture.js.map +1 -1
- package/build/components/KYCElements/OrientationVideoCaptureEnhanced.d.ts +2 -2
- package/build/components/KYCElements/OrientationVideoCaptureEnhanced.d.ts.map +1 -1
- package/build/components/KYCElements/OrientationVideoCaptureEnhanced.js.map +1 -1
- package/build/components/KYCElements/OrientationVideoCaptureFinal.d.ts +2 -2
- package/build/components/KYCElements/OrientationVideoCaptureFinal.d.ts.map +1 -1
- package/build/components/KYCElements/OrientationVideoCaptureFinal.js.map +1 -1
- package/build/components/KYCElements/ReviewSubmitTemplate.d.ts +12 -0
- package/build/components/KYCElements/ReviewSubmitTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/ReviewSubmitTemplate.js +171 -0
- package/build/components/KYCElements/ReviewSubmitTemplate.js.map +1 -0
- package/build/components/KYCElements/SelfieCaptureTemplate.d.ts +6 -2
- package/build/components/KYCElements/SelfieCaptureTemplate.d.ts.map +1 -1
- package/build/components/KYCElements/SelfieCaptureTemplate.js +137 -38
- package/build/components/KYCElements/SelfieCaptureTemplate.js.map +1 -1
- package/build/components/KYCElements/VerificationProgressTemplate.d.ts +12 -0
- package/build/components/KYCElements/VerificationProgressTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/VerificationProgressTemplate.js +194 -0
- package/build/components/KYCElements/VerificationProgressTemplate.js.map +1 -0
- package/build/components/OverLay/IdCard.d.ts +1 -1
- package/build/components/OverLay/IdCard.d.ts.map +1 -1
- package/build/components/OverLay/IdCard.js +10 -6
- package/build/components/OverLay/IdCard.js.map +1 -1
- package/build/components/OverLay/SelfieOverlay.d.ts +1 -1
- package/build/components/OverLay/SelfieOverlay.d.ts.map +1 -1
- package/build/components/OverLay/SelfieOverlay.js +5 -4
- package/build/components/OverLay/SelfieOverlay.js.map +1 -1
- package/build/components/OverLay/type.d.ts +71 -1
- package/build/components/OverLay/type.d.ts.map +1 -1
- package/build/components/OverLay/type.js.map +1 -1
- package/build/components/TemplateKYCExample.d.ts +4 -1
- package/build/components/TemplateKYCExample.d.ts.map +1 -1
- package/build/components/TemplateKYCExample.js +74 -199
- package/build/components/TemplateKYCExample.js.map +1 -1
- package/build/components/TemplateKYCFlowRefactored.d.ts +3 -2
- package/build/components/TemplateKYCFlowRefactored.d.ts.map +1 -1
- package/build/components/TemplateKYCFlowRefactored.js +64 -40
- package/build/components/TemplateKYCFlowRefactored.js.map +1 -1
- package/build/components/example/OrientationVideoExample.d.ts.map +1 -1
- package/build/components/example/OrientationVideoExample.js +1 -5
- package/build/components/example/OrientationVideoExample.js.map +1 -1
- package/build/config/countriesData.d.ts +3 -0
- package/build/config/countriesData.d.ts.map +1 -0
- package/build/config/countriesData.js +79 -0
- package/build/config/countriesData.js.map +1 -0
- package/build/config/region_mapping.d.ts +3 -0
- package/build/config/region_mapping.d.ts.map +1 -0
- package/build/config/region_mapping.js +687 -0
- package/build/config/region_mapping.js.map +1 -0
- package/build/hooks/useI18n.d.ts +11 -0
- package/build/hooks/useI18n.d.ts.map +1 -0
- package/build/hooks/useI18n.js +37 -0
- package/build/hooks/useI18n.js.map +1 -0
- package/build/hooks/useOrientationVideo.d.ts +1 -2
- package/build/hooks/useOrientationVideo.d.ts.map +1 -1
- package/build/hooks/useOrientationVideo.js +2 -1
- package/build/hooks/useOrientationVideo.js.map +1 -1
- package/build/hooks/useRealtimeVerifier.d.ts +28 -0
- package/build/hooks/useRealtimeVerifier.d.ts.map +1 -0
- package/build/hooks/useRealtimeVerifier.js +91 -0
- package/build/hooks/useRealtimeVerifier.js.map +1 -0
- package/build/hooks/useTemplateKYCFlow.d.ts +6 -3
- package/build/hooks/useTemplateKYCFlow.d.ts.map +1 -1
- package/build/hooks/useTemplateKYCFlow.js +356 -42
- package/build/hooks/useTemplateKYCFlow.js.map +1 -1
- package/build/i18n/en/index.d.ts +168 -0
- package/build/i18n/en/index.d.ts.map +1 -0
- package/build/i18n/en/index.js +195 -0
- package/build/i18n/en/index.js.map +1 -0
- package/build/i18n/fr/index.d.ts +168 -0
- package/build/i18n/fr/index.d.ts.map +1 -0
- package/build/i18n/fr/index.js +194 -0
- package/build/i18n/fr/index.js.map +1 -0
- package/build/i18n/index.d.ts +10 -0
- package/build/i18n/index.d.ts.map +1 -0
- package/build/i18n/index.js +56 -0
- package/build/i18n/index.js.map +1 -0
- package/build/i18n/types.d.ts +153 -0
- package/build/i18n/types.d.ts.map +1 -0
- package/build/i18n/types.js +3 -0
- package/build/i18n/types.js.map +1 -0
- package/build/i18n/usage-example.d.ts +4 -0
- package/build/i18n/usage-example.d.ts.map +1 -0
- package/build/i18n/usage-example.js +189 -0
- package/build/i18n/usage-example.js.map +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -0
- package/build/index.js.map +1 -1
- package/build/modules/api/CardAuthentification.d.ts +22 -0
- package/build/modules/api/CardAuthentification.d.ts.map +1 -0
- package/build/modules/api/CardAuthentification.js +107 -0
- package/build/modules/api/CardAuthentification.js.map +1 -0
- package/build/modules/api/KYCService.d.ts +58 -1
- package/build/modules/api/KYCService.d.ts.map +1 -1
- package/build/modules/api/KYCService.js +304 -27
- package/build/modules/api/KYCService.js.map +1 -1
- package/build/modules/api/SelfieVerification.d.ts +3 -0
- package/build/modules/api/SelfieVerification.d.ts.map +1 -0
- package/build/modules/api/SelfieVerification.js +9 -0
- package/build/modules/api/SelfieVerification.js.map +1 -0
- package/build/modules/api/backendApi.d.ts +2 -0
- package/build/modules/api/backendApi.d.ts.map +1 -0
- package/build/modules/api/backendApi.js +6 -0
- package/build/modules/api/backendApi.js.map +1 -0
- package/build/modules/api/types.d.ts +45 -0
- package/build/modules/api/types.d.ts.map +1 -0
- package/build/modules/api/types.js +2 -0
- package/build/modules/api/types.js.map +1 -0
- package/build/types/KYC.types.d.ts +56 -7
- package/build/types/KYC.types.d.ts.map +1 -1
- package/build/types/KYC.types.js +9 -1
- package/build/types/KYC.types.js.map +1 -1
- package/build/utils/cropByObb.d.ts +11 -0
- package/build/utils/cropByObb.d.ts.map +1 -0
- package/build/utils/cropByObb.js +78 -0
- package/build/utils/cropByObb.js.map +1 -0
- package/build/utils/get-document-type-info.d.ts +13 -0
- package/build/utils/get-document-type-info.d.ts.map +1 -0
- package/build/utils/get-document-type-info.js +59 -0
- package/build/utils/get-document-type-info.js.map +1 -0
- package/build/utils/pathToBase64.d.ts +3 -0
- package/build/utils/pathToBase64.d.ts.map +1 -0
- package/build/utils/pathToBase64.js +47 -0
- package/build/utils/pathToBase64.js.map +1 -0
- package/build/utils/remove-duplicate.d.ts +2 -0
- package/build/utils/remove-duplicate.d.ts.map +1 -0
- package/build/utils/remove-duplicate.js +4 -0
- package/build/utils/remove-duplicate.js.map +1 -0
- package/build/web/WebKYCEntry.d.ts +9 -0
- package/build/web/WebKYCEntry.d.ts.map +1 -0
- package/build/web/WebKYCEntry.js +156 -0
- package/build/web/WebKYCEntry.js.map +1 -0
- package/build/web/index.d.ts +2 -0
- package/build/web/index.d.ts.map +1 -0
- package/build/web/index.js +2 -0
- package/build/web/index.js.map +1 -0
- package/package.json +3 -1
- package/src/api/axios.ts +144 -0
- package/src/components/EnhancedCameraView.tsx +96 -78
- package/src/components/EnhancedCameraView.web.tsx +41 -40
- package/src/components/KYCElements/CountrySelectionTemplate.tsx +111 -136
- package/src/components/KYCElements/FileUploadTemplate.tsx +14 -8
- package/src/components/KYCElements/IDCardCapture.tsx +311 -115
- package/src/components/KYCElements/InitializationStep.tsx +53 -0
- package/src/components/KYCElements/LocationCaptureTemplate.tsx +17 -15
- package/src/components/KYCElements/OrientationVideoCapture.tsx +2 -2
- package/src/components/KYCElements/OrientationVideoCaptureEnhanced.tsx +2 -2
- package/src/components/KYCElements/OrientationVideoCaptureFinal.tsx +2 -2
- package/src/components/KYCElements/ReviewSubmitTemplate.tsx +201 -0
- package/src/components/KYCElements/SelfieCaptureTemplate.tsx +174 -57
- package/src/components/KYCElements/VerificationProgressTemplate.tsx +246 -0
- package/src/components/OverLay/IdCard.tsx +17 -9
- package/src/components/OverLay/SelfieOverlay.tsx +6 -5
- package/src/components/OverLay/type.ts +64 -2
- package/src/components/TemplateKYCExample.tsx +80 -200
- package/src/components/TemplateKYCFlowRefactored.tsx +80 -48
- package/src/components/example/OrientationVideoExample.tsx +3 -7
- package/src/config/countriesData.ts +84 -0
- package/src/config/region_mapping.ts +688 -0
- package/src/hooks/useI18n.ts +53 -0
- package/src/hooks/useOrientationVideo.ts +2 -2
- package/src/hooks/useRealtimeVerifier.ts +128 -0
- package/src/hooks/useTemplateKYCFlow.tsx +407 -57
- package/src/i18n/README.md +288 -0
- package/src/i18n/en/index.ts +206 -0
- package/src/i18n/fr/index.ts +205 -0
- package/src/i18n/index.ts +65 -0
- package/src/i18n/types.ts +172 -0
- package/src/i18n/usage-example.tsx +202 -0
- package/src/index.ts +3 -0
- package/src/modules/api/CardAuthentification.ts +114 -0
- package/src/modules/api/KYCService.ts +350 -30
- package/src/modules/api/SelfieVerification.ts +11 -0
- package/src/modules/api/backendApi.ts +8 -0
- package/src/modules/api/types.ts +51 -0
- package/src/types/KYC.types.ts +82 -14
- package/src/utils/cropByObb.ts +99 -0
- package/src/utils/get-document-type-info.ts +62 -0
- package/src/utils/pathToBase64.ts +47 -0
- package/src/utils/remove-duplicate.ts +3 -0
- package/src/web/WebKYCEntry.tsx +215 -0
- package/src/web/index.ts +1 -0
- package/src/types/nativewind.d.ts +0 -2
|
@@ -6,7 +6,7 @@ import FrontSelfieIcon from "../Svgs/frontSelfieIcon";
|
|
|
6
6
|
import StepOverlay from "./StepOverlay";
|
|
7
7
|
import SideSelfieIcon from "../Svgs/sideSelfieIcon";
|
|
8
8
|
|
|
9
|
-
const SelfieOverlay = ({ xMin, yMin, xMax, yMax, cornerOpacity, instructions, cornerColor = "#4CAF50", stepperProps, instructionsTile, instructionsSubtitle, orientation }: IdCardOverlayProps) => {
|
|
9
|
+
const SelfieOverlay = ({ xMin, yMin, xMax, yMax, cornerOpacity, instructions, cornerColor = "#4CAF50", stepperProps, instructionsTile, instructionsSubtitle, orientation, isSuccess }: IdCardOverlayProps) => {
|
|
10
10
|
const screenWidth = Dimensions.get('window').width;
|
|
11
11
|
const screenHeight = Dimensions.get('window').height;
|
|
12
12
|
|
|
@@ -65,7 +65,7 @@ const SelfieOverlay = ({ xMin, yMin, xMax, yMax, cornerOpacity, instructions, co
|
|
|
65
65
|
fill="rgba(0, 0, 0, 0.5)"
|
|
66
66
|
mask="url(#faceMask)"
|
|
67
67
|
/>
|
|
68
|
-
<ScanningLine yMin={scanningYMin} screenWidth={screenWidth} height={screenHeight} yMax={scanningYMax} />
|
|
68
|
+
{isSuccess ? null : <ScanningLine yMin={scanningYMin} screenWidth={screenWidth} height={screenHeight} yMax={scanningYMax} />}
|
|
69
69
|
</Svg>
|
|
70
70
|
|
|
71
71
|
{/* Container de l'icône - centré automatiquement */}
|
|
@@ -75,17 +75,17 @@ const SelfieOverlay = ({ xMin, yMin, xMax, yMax, cornerOpacity, instructions, co
|
|
|
75
75
|
width: iconWidth,
|
|
76
76
|
height: iconHeight,
|
|
77
77
|
}]}>
|
|
78
|
-
{orientation === "
|
|
78
|
+
{orientation === "center" ? <FrontSelfieIcon /> : <SideSelfieIcon />}
|
|
79
79
|
</View>
|
|
80
80
|
|
|
81
81
|
{/* Flèche directionnelle pour les orientations latérales */}
|
|
82
|
-
{orientation !== "
|
|
82
|
+
{orientation !== "center" ? (
|
|
83
83
|
<View style={[
|
|
84
84
|
styles.arrowContainer,
|
|
85
85
|
{
|
|
86
86
|
top: iconY + iconHeight / 2 - 50, // Centré verticalement par rapport à l'icône
|
|
87
87
|
left: orientation === "left" ? iconX - 72 : 'auto',
|
|
88
|
-
right: orientation === "right" ? iconX-75: 'auto'
|
|
88
|
+
right: orientation === "right" ? iconX - 75 : 'auto'
|
|
89
89
|
}
|
|
90
90
|
]}>
|
|
91
91
|
<Image
|
|
@@ -99,6 +99,7 @@ const SelfieOverlay = ({ xMin, yMin, xMax, yMax, cornerOpacity, instructions, co
|
|
|
99
99
|
</View>
|
|
100
100
|
) : null}
|
|
101
101
|
|
|
102
|
+
|
|
102
103
|
<View style={styles.bottomIntruction}>
|
|
103
104
|
<Text style={styles.bottomTitle}>
|
|
104
105
|
{instructionsTile}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { ViewStyle } from "react-native";
|
|
2
|
+
import { ISilentCaptureResult } from "../../types/KYC.types";
|
|
3
|
+
|
|
1
4
|
export interface IdCardOverlayProps {
|
|
2
5
|
xMin: number;
|
|
3
6
|
yMin: number;
|
|
@@ -9,7 +12,10 @@ export interface IdCardOverlayProps {
|
|
|
9
12
|
stepperProps?: StepperProps;
|
|
10
13
|
instructionsTile?: string;
|
|
11
14
|
instructionsSubtitle?: string;
|
|
12
|
-
orientation?: '
|
|
15
|
+
orientation?: 'center' | 'left' | 'right';
|
|
16
|
+
isAnalyzing?: boolean;
|
|
17
|
+
isSuccess?: boolean;
|
|
18
|
+
language:string
|
|
13
19
|
}
|
|
14
20
|
|
|
15
21
|
|
|
@@ -18,4 +24,60 @@ interface StepperProps {
|
|
|
18
24
|
selectedDocumentType: string;
|
|
19
25
|
step: number;
|
|
20
26
|
totalSteps: number;
|
|
21
|
-
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface ExtractMrzTextResponse {
|
|
30
|
+
parsed_data: {
|
|
31
|
+
mrz_type: string;
|
|
32
|
+
document_code: string;
|
|
33
|
+
issuer_code: string;
|
|
34
|
+
surname: string;
|
|
35
|
+
given_name: string;
|
|
36
|
+
document_number: string;
|
|
37
|
+
document_number_checkdigit: string;
|
|
38
|
+
nationality_code: string;
|
|
39
|
+
birth_date: string;
|
|
40
|
+
sex: string;
|
|
41
|
+
expiry_date: string;
|
|
42
|
+
optional_data: string;
|
|
43
|
+
mrz_text: string;
|
|
44
|
+
status: string;
|
|
45
|
+
},
|
|
46
|
+
success: boolean;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
export interface EnhancedCameraViewProps {
|
|
52
|
+
instructions?: string;
|
|
53
|
+
showCamera: boolean;
|
|
54
|
+
cameraType?: 'front' | 'back';
|
|
55
|
+
style?: ViewStyle;
|
|
56
|
+
onCapture?: (result: { success: boolean; path?: string; error?: string }) => void;
|
|
57
|
+
onSilentCapture?: (result: { success: boolean; path?: string; error?: string }) => void;
|
|
58
|
+
silentCaptureResult?: ISilentCaptureResult;
|
|
59
|
+
onError?: (event: { message: string }) => void;
|
|
60
|
+
onClose?: () => void;
|
|
61
|
+
enableFlash?: boolean;
|
|
62
|
+
enableHdr?: boolean;
|
|
63
|
+
quality?: 'low' | 'medium' | 'high';
|
|
64
|
+
showCaptureButton?: boolean;
|
|
65
|
+
showSwitchCamera?: boolean;
|
|
66
|
+
overlayComponent?: React.ReactNode;
|
|
67
|
+
bbox?: {
|
|
68
|
+
xMin: number;
|
|
69
|
+
yMin: number;
|
|
70
|
+
xMax: number;
|
|
71
|
+
yMax: number;
|
|
72
|
+
borderColor?: string;
|
|
73
|
+
borderWidth?: number;
|
|
74
|
+
cornerRadius?: number;
|
|
75
|
+
};
|
|
76
|
+
canFlip?: boolean;
|
|
77
|
+
// Video recording props
|
|
78
|
+
enableVideo?: boolean;
|
|
79
|
+
isRecording?: boolean;
|
|
80
|
+
onVideoRecordingStart?: () => void;
|
|
81
|
+
onVideoRecordingStop?: (result: { success: boolean; path?: string; error?: string }) => void;
|
|
82
|
+
videoDuration?: number;
|
|
83
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View, StyleSheet } from 'react-native';
|
|
3
3
|
import { TemplateKYCFlow } from './TemplateKYCFlowRefactored';
|
|
4
|
-
import { KYCTemplate } from '../types/KYC.types';
|
|
4
|
+
import { KYCTemplate, VerificationState } from '../types/KYC.types';
|
|
5
5
|
|
|
6
6
|
// Template JSON basé sur votre exemple
|
|
7
7
|
const advancedVerificationTemplate: KYCTemplate = {
|
|
@@ -39,147 +39,72 @@ const advancedVerificationTemplate: KYCTemplate = {
|
|
|
39
39
|
} as const
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
|
-
id:
|
|
43
|
-
type: "
|
|
42
|
+
id: 6,
|
|
43
|
+
type: "country_selection" as const,
|
|
44
44
|
order: 2,
|
|
45
|
-
templateId: 1,
|
|
46
45
|
labels: {
|
|
47
|
-
en: "
|
|
48
|
-
fr: "
|
|
46
|
+
en: "Select your country",
|
|
47
|
+
fr: "Sélectionnez votre pays"
|
|
49
48
|
},
|
|
50
49
|
instructions: {
|
|
51
|
-
en: "
|
|
52
|
-
fr: "
|
|
50
|
+
en: "Choose your country of residence.",
|
|
51
|
+
fr: "Choisissez votre pays de résidence."
|
|
53
52
|
},
|
|
54
53
|
ui: {
|
|
55
|
-
icon: "
|
|
54
|
+
icon: "country-icon.png",
|
|
56
55
|
themeColor: "#2DBD60",
|
|
57
|
-
buttonText: { en: "
|
|
56
|
+
buttonText: { en: "Confirm", fr: "Confirmer" }
|
|
58
57
|
},
|
|
59
58
|
config: {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
document_types: ["id_card", "passport", "drivers_license", "national_id"],
|
|
64
|
-
bbox_configs: {
|
|
65
|
-
id_card: {
|
|
66
|
-
xMin: 20,
|
|
67
|
-
yMin: 140,
|
|
68
|
-
xMax: 370,
|
|
69
|
-
yMax: 340,
|
|
70
|
-
borderColor: "#2DBD60",
|
|
71
|
-
borderWidth: 4,
|
|
72
|
-
cornerRadius: 12
|
|
73
|
-
},
|
|
74
|
-
passport: {
|
|
75
|
-
xMin: 15,
|
|
76
|
-
yMin: 130,
|
|
77
|
-
xMax: 375,
|
|
78
|
-
yMax: 350,
|
|
79
|
-
borderColor: "#007AFF",
|
|
80
|
-
borderWidth: 4,
|
|
81
|
-
cornerRadius: 8
|
|
82
|
-
},
|
|
83
|
-
drivers_license: {
|
|
84
|
-
xMin: 25,
|
|
85
|
-
yMin: 150,
|
|
86
|
-
xMax: 365,
|
|
87
|
-
yMax: 330,
|
|
88
|
-
borderColor: "#FF9500",
|
|
89
|
-
borderWidth: 4,
|
|
90
|
-
cornerRadius: 10
|
|
91
|
-
},
|
|
92
|
-
national_id: {
|
|
93
|
-
xMin: 20,
|
|
94
|
-
yMin: 140,
|
|
95
|
-
xMax: 370,
|
|
96
|
-
yMax: 340,
|
|
97
|
-
borderColor: "#5856D6",
|
|
98
|
-
borderWidth: 4,
|
|
99
|
-
cornerRadius: 12
|
|
100
|
-
},
|
|
101
|
-
residence_permit: {
|
|
102
|
-
xMin: 20,
|
|
103
|
-
yMin: 140,
|
|
104
|
-
xMax: 370,
|
|
105
|
-
yMax: 340,
|
|
106
|
-
borderColor: "#2DBD60",
|
|
107
|
-
borderWidth: 4,
|
|
108
|
-
cornerRadius: 12
|
|
109
|
-
},
|
|
110
|
-
voter_id: {
|
|
111
|
-
xMin: 20,
|
|
112
|
-
yMin: 140,
|
|
113
|
-
xMax: 370,
|
|
114
|
-
yMax: 340,
|
|
115
|
-
borderColor: "#2DBD60",
|
|
116
|
-
borderWidth: 4,
|
|
117
|
-
cornerRadius: 12
|
|
118
|
-
},
|
|
119
|
-
military_id: {
|
|
120
|
-
xMin: 20,
|
|
121
|
-
yMin: 140,
|
|
122
|
-
xMax: 370,
|
|
123
|
-
yMax: 340,
|
|
124
|
-
borderColor: "#2DBD60",
|
|
125
|
-
borderWidth: 4,
|
|
126
|
-
cornerRadius: 12
|
|
127
|
-
},
|
|
128
|
-
student_id: {
|
|
129
|
-
xMin: 20,
|
|
130
|
-
yMin: 140,
|
|
131
|
-
xMax: 370,
|
|
132
|
-
yMax: 340,
|
|
133
|
-
borderColor: "#2DBD60",
|
|
134
|
-
borderWidth: 4,
|
|
135
|
-
cornerRadius: 12
|
|
136
|
-
},
|
|
137
|
-
work_permit: {
|
|
138
|
-
xMin: 20,
|
|
139
|
-
yMin: 140,
|
|
140
|
-
xMax: 370,
|
|
141
|
-
yMax: 340,
|
|
142
|
-
borderColor: "#2DBD60",
|
|
143
|
-
borderWidth: 4,
|
|
144
|
-
cornerRadius: 12
|
|
145
|
-
},
|
|
146
|
-
other: {
|
|
147
|
-
xMin: 20,
|
|
148
|
-
yMin: 140,
|
|
149
|
-
xMax: 370,
|
|
150
|
-
yMax: 340,
|
|
151
|
-
borderColor: "#2DBD60",
|
|
152
|
-
borderWidth: 4,
|
|
153
|
-
cornerRadius: 12
|
|
154
|
-
}
|
|
155
|
-
}
|
|
59
|
+
allowed_countries: ["CA", "FR", "CM", "US", "DE", "SN", "NG", "MA", "DZ","CI", "KE","GH"],
|
|
60
|
+
default_country: "CA",
|
|
61
|
+
required: true
|
|
156
62
|
} as const
|
|
157
63
|
},
|
|
158
64
|
{
|
|
159
|
-
id:
|
|
65
|
+
id: 1,
|
|
160
66
|
type: "id_card" as const,
|
|
161
67
|
order: 3,
|
|
162
68
|
templateId: 1,
|
|
163
69
|
labels: {
|
|
164
|
-
|
|
165
|
-
|
|
70
|
+
front: {
|
|
71
|
+
en: "Upload front of ID card",
|
|
72
|
+
fr: "Téléversez le recto de votre carte d'identité"
|
|
73
|
+
},
|
|
74
|
+
back: {
|
|
75
|
+
en: "Upload back of ID card",
|
|
76
|
+
fr: "Téléversez le verso de votre carte d'identité"
|
|
77
|
+
},
|
|
166
78
|
},
|
|
167
79
|
instructions: {
|
|
168
|
-
|
|
169
|
-
|
|
80
|
+
front: {
|
|
81
|
+
en: "Take a clear photo of the front of your ID.",
|
|
82
|
+
fr: "Prenez une photo nette du recto de votre pièce."
|
|
83
|
+
},
|
|
84
|
+
back: {
|
|
85
|
+
en: "Take a clear photo of the back of your ID.",
|
|
86
|
+
fr: "Prenez une photo nette du verso de votre pièce."
|
|
87
|
+
},
|
|
170
88
|
},
|
|
171
89
|
ui: {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
90
|
+
front: {
|
|
91
|
+
icon: "id-card-icon.png",
|
|
92
|
+
themeColor: "#2DBD60",
|
|
93
|
+
buttonText: { en: "Next", fr: "Suivant" }
|
|
94
|
+
},
|
|
95
|
+
back: {
|
|
96
|
+
icon: "id-card-icon.png",
|
|
97
|
+
themeColor: "#2DBD60",
|
|
98
|
+
buttonText: { en: "Next", fr: "Suivant" }
|
|
99
|
+
},
|
|
175
100
|
},
|
|
176
101
|
config: {
|
|
177
|
-
sides: ["back"],
|
|
102
|
+
sides: ["front", "back"],
|
|
178
103
|
allowed_formats: ["jpg", "png"],
|
|
179
104
|
max_size_mb: 5,
|
|
180
|
-
document_types: ["
|
|
105
|
+
document_types: ["drivers_licence", "passport", "drivers_licence", "national_id"],
|
|
181
106
|
bbox_configs: {
|
|
182
|
-
|
|
107
|
+
drivers_licence: {
|
|
183
108
|
xMin: 20,
|
|
184
109
|
yMin: 140,
|
|
185
110
|
xMax: 370,
|
|
@@ -197,25 +122,7 @@ const advancedVerificationTemplate: KYCTemplate = {
|
|
|
197
122
|
borderWidth: 4,
|
|
198
123
|
cornerRadius: 8
|
|
199
124
|
},
|
|
200
|
-
|
|
201
|
-
xMin: 25,
|
|
202
|
-
yMin: 150,
|
|
203
|
-
xMax: 365,
|
|
204
|
-
yMax: 330,
|
|
205
|
-
borderColor: "#FF9500",
|
|
206
|
-
borderWidth: 4,
|
|
207
|
-
cornerRadius: 10
|
|
208
|
-
},
|
|
209
|
-
national_id: {
|
|
210
|
-
xMin: 20,
|
|
211
|
-
yMin: 140,
|
|
212
|
-
xMax: 370,
|
|
213
|
-
yMax: 340,
|
|
214
|
-
borderColor: "#5856D6",
|
|
215
|
-
borderWidth: 4,
|
|
216
|
-
cornerRadius: 12
|
|
217
|
-
},
|
|
218
|
-
residence_permit: {
|
|
125
|
+
identity_card: {
|
|
219
126
|
xMin: 20,
|
|
220
127
|
yMin: 140,
|
|
221
128
|
xMax: 370,
|
|
@@ -224,7 +131,7 @@ const advancedVerificationTemplate: KYCTemplate = {
|
|
|
224
131
|
borderWidth: 4,
|
|
225
132
|
cornerRadius: 12
|
|
226
133
|
},
|
|
227
|
-
|
|
134
|
+
health_insurance_card: {
|
|
228
135
|
xMin: 20,
|
|
229
136
|
yMin: 140,
|
|
230
137
|
xMax: 370,
|
|
@@ -233,16 +140,16 @@ const advancedVerificationTemplate: KYCTemplate = {
|
|
|
233
140
|
borderWidth: 4,
|
|
234
141
|
cornerRadius: 12
|
|
235
142
|
},
|
|
236
|
-
|
|
143
|
+
national_id: {
|
|
237
144
|
xMin: 20,
|
|
238
145
|
yMin: 140,
|
|
239
146
|
xMax: 370,
|
|
240
147
|
yMax: 340,
|
|
241
|
-
borderColor: "#
|
|
148
|
+
borderColor: "#5856D6",
|
|
242
149
|
borderWidth: 4,
|
|
243
150
|
cornerRadius: 12
|
|
244
151
|
},
|
|
245
|
-
|
|
152
|
+
permanent_residence: {
|
|
246
153
|
xMin: 20,
|
|
247
154
|
yMin: 140,
|
|
248
155
|
xMax: 370,
|
|
@@ -251,6 +158,8 @@ const advancedVerificationTemplate: KYCTemplate = {
|
|
|
251
158
|
borderWidth: 4,
|
|
252
159
|
cornerRadius: 12
|
|
253
160
|
},
|
|
161
|
+
|
|
162
|
+
|
|
254
163
|
work_permit: {
|
|
255
164
|
xMin: 20,
|
|
256
165
|
yMin: 140,
|
|
@@ -260,22 +169,14 @@ const advancedVerificationTemplate: KYCTemplate = {
|
|
|
260
169
|
borderWidth: 4,
|
|
261
170
|
cornerRadius: 12
|
|
262
171
|
},
|
|
263
|
-
|
|
264
|
-
xMin: 20,
|
|
265
|
-
yMin: 140,
|
|
266
|
-
xMax: 370,
|
|
267
|
-
yMax: 340,
|
|
268
|
-
borderColor: "#2DBD60",
|
|
269
|
-
borderWidth: 4,
|
|
270
|
-
cornerRadius: 12
|
|
271
|
-
}
|
|
172
|
+
|
|
272
173
|
}
|
|
273
174
|
} as const
|
|
274
175
|
},
|
|
275
176
|
{
|
|
276
177
|
id: 3,
|
|
277
178
|
type: "selfie" as const,
|
|
278
|
-
order:
|
|
179
|
+
order: 5,
|
|
279
180
|
templateId: 1,
|
|
280
181
|
labels: {
|
|
281
182
|
en: "Take selfies from different angles",
|
|
@@ -293,60 +194,38 @@ const advancedVerificationTemplate: KYCTemplate = {
|
|
|
293
194
|
config: {
|
|
294
195
|
liveness_check: true,
|
|
295
196
|
max_attempts: 3,
|
|
296
|
-
orientations: ["
|
|
197
|
+
orientations: ["center", "left", "right"]
|
|
297
198
|
} as const
|
|
298
199
|
},
|
|
299
|
-
{
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
},
|
|
322
|
-
|
|
323
|
-
id: 6,
|
|
324
|
-
type: "country_selection" as const,
|
|
325
|
-
order: 6,
|
|
326
|
-
labels: {
|
|
327
|
-
en: "Select your country",
|
|
328
|
-
fr: "Sélectionnez votre pays"
|
|
329
|
-
},
|
|
330
|
-
instructions: {
|
|
331
|
-
en: "Choose your country of residence.",
|
|
332
|
-
fr: "Choisissez votre pays de résidence."
|
|
333
|
-
},
|
|
334
|
-
ui: {
|
|
335
|
-
icon: "country-icon.png",
|
|
336
|
-
themeColor: "#2DBD60",
|
|
337
|
-
buttonText: { en: "Confirm", fr: "Confirmer" }
|
|
338
|
-
},
|
|
339
|
-
config: {
|
|
340
|
-
allowed_countries: ["FR", "CM", "US", "DE"],
|
|
341
|
-
default_country: "FR",
|
|
342
|
-
required: true
|
|
343
|
-
} as const
|
|
344
|
-
}
|
|
200
|
+
// {
|
|
201
|
+
// id: 4,
|
|
202
|
+
// type: "file_upload" as const,
|
|
203
|
+
// order: 6,
|
|
204
|
+
// labels: {
|
|
205
|
+
// en: "Upload proof of address",
|
|
206
|
+
// fr: "Téléversez un justificatif de domicile"
|
|
207
|
+
// },
|
|
208
|
+
// instructions: {
|
|
209
|
+
// en: "Upload a recent utility bill or bank statement (PDF, JPG, PNG).",
|
|
210
|
+
// fr: "Téléversez une facture récente ou un relevé bancaire (PDF, JPG, PNG)."
|
|
211
|
+
// },
|
|
212
|
+
// ui: {
|
|
213
|
+
// icon: "file-upload-icon.png",
|
|
214
|
+
// themeColor: "#2DBD60",
|
|
215
|
+
// buttonText: { en: "Upload", fr: "Téléverser" }
|
|
216
|
+
// },
|
|
217
|
+
// config: {
|
|
218
|
+
// allowed_formats: ["pdf", "jpg", "png"],
|
|
219
|
+
// max_size_mb: 10,
|
|
220
|
+
// required: true
|
|
221
|
+
// } as const
|
|
222
|
+
// },
|
|
223
|
+
|
|
345
224
|
]
|
|
346
225
|
};
|
|
347
226
|
|
|
348
|
-
export const TemplateKYCExample: React.FC<{ onComplete: (data:
|
|
349
|
-
const handleComplete = (data:
|
|
227
|
+
export const TemplateKYCExample: React.FC<{ onComplete: (data: VerificationState) => void, onCancel: () => void, onError: (error: string) => void, language: string, API_KEY: string }> = ({ onComplete, onCancel, onError, language, API_KEY }) => {
|
|
228
|
+
const handleComplete = (data: VerificationState) => {
|
|
350
229
|
console.log('KYC Template completed with data:', data);
|
|
351
230
|
onComplete(data);
|
|
352
231
|
// Ici vous pouvez envoyer les données à votre API
|
|
@@ -369,7 +248,8 @@ export const TemplateKYCExample: React.FC<{ onComplete: (data: Record<number, an
|
|
|
369
248
|
onComplete={handleComplete}
|
|
370
249
|
onError={handleError}
|
|
371
250
|
onCancel={handleCancel}
|
|
372
|
-
language=
|
|
251
|
+
language={language} // ou "en" pour l'anglais
|
|
252
|
+
API_KEY={API_KEY}
|
|
373
253
|
/>
|
|
374
254
|
</View>
|
|
375
255
|
);
|