@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
|
@@ -1,34 +1,42 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { View, Text, StyleSheet, SafeAreaView, TouchableOpacity } from 'react-native';
|
|
3
|
-
import { KYCTemplate } from '../types/KYC.types';
|
|
2
|
+
import { View, Text, StyleSheet, SafeAreaView, TouchableOpacity, ActivityIndicator, Dimensions } from 'react-native';
|
|
3
|
+
import { KYCTemplate, VerificationState } from '../types/KYC.types';
|
|
4
4
|
import { TemplateKYCFlowProvider, useTemplateKYCFlowContext } from '../hooks/useTemplateKYCFlow';
|
|
5
|
+
import { useI18n } from '../hooks/useI18n';
|
|
5
6
|
import { IDCardCapture } from './KYCElements/IDCardCapture';
|
|
6
7
|
import { SelfieCaptureTemplate } from './KYCElements/SelfieCaptureTemplate';
|
|
7
8
|
import { FileUploadTemplate } from './KYCElements/FileUploadTemplate';
|
|
8
9
|
import { LocationCaptureTemplate } from './KYCElements/LocationCaptureTemplate';
|
|
9
10
|
import { CountrySelectionTemplate } from './KYCElements/CountrySelectionTemplate';
|
|
11
|
+
import { InitializationStep } from './KYCElements/InitializationStep';
|
|
12
|
+
import { ReviewSubmitTemplate } from './KYCElements/ReviewSubmitTemplate';
|
|
13
|
+
import { VerificationProgressTemplate } from './KYCElements/VerificationProgressTemplate';
|
|
10
14
|
|
|
11
15
|
interface TemplateKYCFlowProps {
|
|
12
16
|
template: KYCTemplate;
|
|
13
|
-
onComplete?: (data:
|
|
17
|
+
onComplete?: (data: VerificationState) => void;
|
|
14
18
|
onError?: (error: string) => void;
|
|
15
19
|
language?: string;
|
|
16
20
|
onCancel?: () => void;
|
|
21
|
+
API_KEY?: string;
|
|
17
22
|
}
|
|
18
23
|
|
|
19
24
|
export const TemplateKYCFlow: React.FC<TemplateKYCFlowProps> = ({
|
|
20
25
|
template,
|
|
21
26
|
onComplete,
|
|
22
27
|
onError,
|
|
23
|
-
language = '
|
|
28
|
+
language = 'fr',
|
|
24
29
|
onCancel,
|
|
30
|
+
API_KEY,
|
|
25
31
|
}) => {
|
|
26
32
|
return (
|
|
27
33
|
<TemplateKYCFlowProvider
|
|
28
34
|
template={template}
|
|
29
35
|
onComplete={onComplete}
|
|
30
36
|
onError={onError}
|
|
37
|
+
onCancel={onCancel}
|
|
31
38
|
initialLanguage={language}
|
|
39
|
+
apiKey={API_KEY}
|
|
32
40
|
>
|
|
33
41
|
<TemplateKYCFlowContent onCancel={onCancel} />
|
|
34
42
|
</TemplateKYCFlowProvider>
|
|
@@ -43,20 +51,7 @@ const TemplateKYCFlowContent: React.FC<{ onCancel?: () => void }> = ({ onCancel
|
|
|
43
51
|
progress,
|
|
44
52
|
} = useTemplateKYCFlowContext();
|
|
45
53
|
|
|
46
|
-
|
|
47
|
-
const getCurrentSideForComponent = (componentId: number): string => {
|
|
48
|
-
const component = state.template.components.find(c => c.id === componentId);
|
|
49
|
-
if (!component || component.type !== 'id_card') return 'front';
|
|
50
|
-
|
|
51
|
-
const idConfig = component.config as any;
|
|
52
|
-
const sides = idConfig.sides || ['front', 'back'];
|
|
53
|
-
|
|
54
|
-
// Calculer le côté basé sur l'ordre dans le template
|
|
55
|
-
const componentIndex = state.template.components.findIndex(c => c.id === componentId);
|
|
56
|
-
const sideIndex = componentIndex % sides.length;
|
|
57
|
-
|
|
58
|
-
return sides[sideIndex];
|
|
59
|
-
};
|
|
54
|
+
const { t } = useI18n();
|
|
60
55
|
|
|
61
56
|
const updateComponentData = (componentId: number, data: unknown) => {
|
|
62
57
|
actions.updateComponentData(componentId, data);
|
|
@@ -65,7 +60,7 @@ const TemplateKYCFlowContent: React.FC<{ onCancel?: () => void }> = ({ onCancel
|
|
|
65
60
|
if (!currentComponent) {
|
|
66
61
|
return (
|
|
67
62
|
<View style={styles.container}>
|
|
68
|
-
<Text style={styles.errorText}>
|
|
63
|
+
<Text style={styles.errorText}>{t('errors.unknownError')}</Text>
|
|
69
64
|
</View>
|
|
70
65
|
);
|
|
71
66
|
}
|
|
@@ -80,9 +75,13 @@ const TemplateKYCFlowContent: React.FC<{ onCancel?: () => void }> = ({ onCancel
|
|
|
80
75
|
language: state.currentLanguage,
|
|
81
76
|
};
|
|
82
77
|
|
|
78
|
+
if (!state.session.isInitialized) {
|
|
79
|
+
return <InitializationStep session={state.session} />
|
|
80
|
+
}
|
|
81
|
+
|
|
83
82
|
switch (currentComponent.type) {
|
|
84
83
|
case 'id_card':
|
|
85
|
-
return <IDCardCapture {...commonProps}
|
|
84
|
+
return <IDCardCapture {...commonProps} />;
|
|
86
85
|
|
|
87
86
|
case 'selfie':
|
|
88
87
|
return <SelfieCaptureTemplate {...commonProps} />;
|
|
@@ -96,11 +95,17 @@ const TemplateKYCFlowContent: React.FC<{ onCancel?: () => void }> = ({ onCancel
|
|
|
96
95
|
case 'country_selection':
|
|
97
96
|
return <CountrySelectionTemplate {...commonProps} />;
|
|
98
97
|
|
|
98
|
+
case 'review_submit':
|
|
99
|
+
return <ReviewSubmitTemplate {...commonProps} />;
|
|
100
|
+
|
|
101
|
+
case 'verification_progress':
|
|
102
|
+
return <VerificationProgressTemplate {...commonProps} />;
|
|
103
|
+
|
|
99
104
|
default:
|
|
100
105
|
return (
|
|
101
106
|
<View style={styles.unsupportedContainer}>
|
|
102
107
|
<Text style={styles.unsupportedText}>
|
|
103
|
-
|
|
108
|
+
{t('errors.unknownError')}: {currentComponent.type}
|
|
104
109
|
</Text>
|
|
105
110
|
</View>
|
|
106
111
|
);
|
|
@@ -108,38 +113,48 @@ const TemplateKYCFlowContent: React.FC<{ onCancel?: () => void }> = ({ onCancel
|
|
|
108
113
|
};
|
|
109
114
|
|
|
110
115
|
return (
|
|
111
|
-
<
|
|
112
|
-
{
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
<
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
116
|
+
<View style={{ flex: 1 }}>
|
|
117
|
+
{state.isProcessing && (
|
|
118
|
+
<View style={styles.processingContainer}>
|
|
119
|
+
<Text style={styles.processingText}>{t('common.loading')}</Text>
|
|
120
|
+
<ActivityIndicator size="large" color="#fff" />
|
|
121
|
+
</View>
|
|
122
|
+
)}
|
|
123
|
+
<SafeAreaView style={styles.container}>
|
|
124
|
+
{/* Header avec informations sur l'étape */}
|
|
125
|
+
|
|
126
|
+
{(state.showCustomStepper && state.session.isInitialized) ? (
|
|
127
|
+
<View style={styles.header}>
|
|
128
|
+
<Text style={styles.progressText}>
|
|
129
|
+
{t('kyc.step', { current: state.currentComponentIndex + 1, total: state.template.components.length })}
|
|
130
|
+
</Text>
|
|
131
|
+
<View style={styles.progressContainer}>
|
|
132
|
+
<View style={styles.progressBar}>
|
|
133
|
+
<View
|
|
134
|
+
style={[
|
|
135
|
+
styles.progressFill,
|
|
136
|
+
{ width: `${progress}%` }
|
|
137
|
+
]}
|
|
138
|
+
/>
|
|
139
|
+
</View>
|
|
140
|
+
|
|
126
141
|
</View>
|
|
127
142
|
|
|
143
|
+
<View style={{ position: 'absolute', right: 12, top: 12 }}>
|
|
144
|
+
<TouchableOpacity onPress={onCancel} disabled={!onCancel} style={{ opacity: onCancel ? 1 : 0.5 }}>
|
|
145
|
+
<Text style={{ fontSize: 20, fontWeight: 'bold', color: '#333' }}>{`X`}</Text>
|
|
146
|
+
</TouchableOpacity>
|
|
147
|
+
</View>
|
|
128
148
|
</View>
|
|
149
|
+
) : null}
|
|
129
150
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
</TouchableOpacity>
|
|
134
|
-
</View>
|
|
151
|
+
{/* Contenu principal */}
|
|
152
|
+
<View style={styles.content}>
|
|
153
|
+
{renderCurrentComponent()}
|
|
135
154
|
</View>
|
|
136
|
-
|
|
155
|
+
</SafeAreaView>
|
|
156
|
+
</View>
|
|
137
157
|
|
|
138
|
-
{/* Contenu principal */}
|
|
139
|
-
<View style={styles.content}>
|
|
140
|
-
{renderCurrentComponent()}
|
|
141
|
-
</View>
|
|
142
|
-
</SafeAreaView>
|
|
143
158
|
);
|
|
144
159
|
};
|
|
145
160
|
|
|
@@ -147,7 +162,7 @@ const styles = StyleSheet.create({
|
|
|
147
162
|
container: {
|
|
148
163
|
flex: 1,
|
|
149
164
|
backgroundColor: '#f5f5f5',
|
|
150
|
-
|
|
165
|
+
|
|
151
166
|
},
|
|
152
167
|
header: {
|
|
153
168
|
backgroundColor: 'white',
|
|
@@ -260,4 +275,21 @@ const styles = StyleSheet.create({
|
|
|
260
275
|
color: '#666',
|
|
261
276
|
textAlign: 'center',
|
|
262
277
|
},
|
|
278
|
+
processingContainer: {
|
|
279
|
+
position: 'absolute',
|
|
280
|
+
flex: 1,
|
|
281
|
+
width: Dimensions.get('window').width,
|
|
282
|
+
height: Dimensions.get('window').height,
|
|
283
|
+
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
284
|
+
justifyContent: 'center',
|
|
285
|
+
alignItems: 'center',
|
|
286
|
+
zIndex: 1000,
|
|
287
|
+
},
|
|
288
|
+
processingText: {
|
|
289
|
+
fontSize: 16,
|
|
290
|
+
color: '#fff',
|
|
291
|
+
textAlign: 'center',
|
|
292
|
+
fontWeight: 'bold',
|
|
293
|
+
marginBottom: 10,
|
|
294
|
+
},
|
|
263
295
|
});
|
|
@@ -6,21 +6,17 @@ import {
|
|
|
6
6
|
TouchableOpacity,
|
|
7
7
|
Alert,
|
|
8
8
|
ScrollView,
|
|
9
|
-
} from 'react-native';
|
|
10
|
-
import KYCService from '../../modules/api/KYCService';
|
|
9
|
+
} from 'react-native';
|
|
11
10
|
import { OrientationVideoResult } from '../../types/KYC.types';
|
|
12
11
|
import OrientationVideoCaptureEnhanced from '../KYCElements/OrientationVideoCaptureEnhanced';
|
|
12
|
+
import kycService from '../../modules/api/KYCService';
|
|
13
13
|
|
|
14
14
|
const OrientationVideoExample: React.FC = () => {
|
|
15
15
|
const [showVideoCapture, setShowVideoCapture] = useState(false);
|
|
16
16
|
const [result, setResult] = useState<OrientationVideoResult | null>(null);
|
|
17
17
|
const [isLoading] = useState(false);
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
const kycService = new KYCService(
|
|
21
|
-
'http://18.188.180.154:8001/', // Replace with your actual API base URL
|
|
22
|
-
'1234567890' // Replace with your actual API key
|
|
23
|
-
);
|
|
19
|
+
|
|
24
20
|
|
|
25
21
|
const handleComplete = (orientationResult: OrientationVideoResult) => {
|
|
26
22
|
setResult(orientationResult);
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Country } from "../types/KYC.types";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export const countryData: Record<string, Country> = {
|
|
8
|
+
FR: { name: 'France', name_en: "France", flag: '🇫🇷' },
|
|
9
|
+
CM: { name: 'Cameroun', name_en: "Cameroon", flag: '🇨🇲' },
|
|
10
|
+
US: { name: 'États-Unis', name_en: "United States of America", flag: '🇺🇸' },
|
|
11
|
+
DE: { name: 'Allemagne', name_en: "Germany", flag: '🇩🇪' },
|
|
12
|
+
BE: { name: 'Belgique', name_en: "Belgium", flag: '🇧🇪' },
|
|
13
|
+
LU: { name: 'Luxembourg', name_en: "Luxembourg", flag: '🇱🇺' },
|
|
14
|
+
IT: { name: 'Italie', name_en: "Italy", flag: '🇮🇹' },
|
|
15
|
+
ES: { name: 'Espagne', name_en: "Spain", flag: '🇪🇸' },
|
|
16
|
+
PT: { name: 'Portugal', name_en: "Portugal", flag: '🇵🇹' },
|
|
17
|
+
AT: { name: 'Autriche', name_en: "Austria", flag: '🇦🇹' },
|
|
18
|
+
CH: { name: 'Suisse', name_en: "Switzerland", flag: '🇨ðŸ‡' },
|
|
19
|
+
NL: { name: 'Pays-Bas', name_en: "Netherlands", flag: '🇳🇱' },
|
|
20
|
+
CA: { name: 'Canada', name_en: "Canada", flag: '🇨🇦', hasRegions: true },
|
|
21
|
+
GB: { name: 'Royaume-Uni', name_en: "United Kingdom", flag: '🇬🇧' },
|
|
22
|
+
AU: { name: 'Australie', name_en: "Australia", flag: '🇦🇺' },
|
|
23
|
+
JP: { name: 'Japon', name_en: "Japan", flag: '🇯🇵' },
|
|
24
|
+
KR: { name: 'Corée du Sud', name_en: "South Korea", flag: '🇰🇷' },
|
|
25
|
+
SG: { name: 'Singapour', name_en: "Singapore", flag: '🇸🇬' },
|
|
26
|
+
HK: { name: 'Hong Kong', name_en: "Hong Kong", flag: 'ðŸ‡ðŸ‡°' },
|
|
27
|
+
AE: { name: 'Émirats Arabes Unis', name_en: "United Arab Emirates", flag: '🇦🇪' },
|
|
28
|
+
SA: { name: 'Arabie Saoudite', name_en: "Saudi Arabia", flag: '🇸🇦' },
|
|
29
|
+
QA: { name: 'Qatar', name_en: "Qatar", flag: '🇶🇦' },
|
|
30
|
+
KW: { name: 'Koweït', name_en: "Kuwait", flag: '🇰🇼' },
|
|
31
|
+
BH: { name: 'Bahreïn', name_en: "Bahrain", flag: '🇧ðŸ‡' },
|
|
32
|
+
OM: { name: 'Oman', name_en: "Oman", flag: '🇴🇲' },
|
|
33
|
+
JO: { name: 'Jordanie', name_en: "Jordan", flag: '🇯🇴' },
|
|
34
|
+
LB: { name: 'Liban', name_en: "Lebanon", flag: '🇱🇧' },
|
|
35
|
+
EG: { name: 'Égypte', name_en: "Egypt", flag: '🇪🇬' },
|
|
36
|
+
MA: { name: 'Maroc', name_en: "Morocco", flag: '🇲🇦' },
|
|
37
|
+
TN: { name: 'Tunisie', name_en: "Tunisia", flag: '🇹🇳' },
|
|
38
|
+
DZ: { name: 'Algérie', name_en: "Algeria", flag: '🇩🇿' },
|
|
39
|
+
SN: { name: 'Sénégal', name_en: "Senegal", flag: '🇸🇳' },
|
|
40
|
+
CI: { name: 'Côte d\'Ivoire', name_en: "Ivory Coast", flag: '🇨🇮' },
|
|
41
|
+
NG: { name: 'Nigeria', name_en: "Nigeria", flag: '🇳🇬' },
|
|
42
|
+
KE: { name: 'Kenya', name_en: "Kenya", flag: '🇰🇪' },
|
|
43
|
+
ZA: { name: 'Afrique du Sud', name_en: "South Africa", flag: '🇿🇦' },
|
|
44
|
+
BR: { name: 'Brésil', name_en: "Brazil", flag: '🇧🇷' },
|
|
45
|
+
MX: { name: 'Mexique', name_en: "Mexico", flag: '🇲🇽' },
|
|
46
|
+
AR: { name: 'Argentine', name_en: "Argentina", flag: '🇦🇷' },
|
|
47
|
+
CL: { name: 'Chili', name_en: "Chile", flag: '🇨🇱' },
|
|
48
|
+
PE: { name: 'Pérou', name_en: "Peru", flag: '🇵🇪' },
|
|
49
|
+
CO: { name: 'Colombie', name_en: "Colombia", flag: '🇨🇴' },
|
|
50
|
+
VE: { name: 'Venezuela', name_en: "Venezuela", flag: '🇻🇪' },
|
|
51
|
+
EC: { name: 'Équateur', name_en: "Ecuador", flag: '🇪🇨' },
|
|
52
|
+
UY: { name: 'Uruguay', name_en: "Uruguay", flag: '🇺🇾' },
|
|
53
|
+
PY: { name: 'Paraguay', name_en: "Paraguay", flag: '🇵🇾' },
|
|
54
|
+
BO: { name: 'Bolivie', name_en: "Bolivia", flag: '🇧🇴' },
|
|
55
|
+
IN: { name: 'Inde', name_en: "India", flag: '🇮🇳' },
|
|
56
|
+
CN: { name: 'Chine', name_en: "China", flag: '🇨🇳' },
|
|
57
|
+
TH: { name: 'Thaïlande', name_en: "Thailand", flag: '🇹ðŸ‡' },
|
|
58
|
+
VN: { name: 'Vietnam', name_en: "Vietnam", flag: '🇻🇳' },
|
|
59
|
+
ID: { name: 'Indonésie', name_en: "Indonesia", flag: '🇮🇩' },
|
|
60
|
+
MY: { name: 'Malaisie', name_en: "Malaysia", flag: '🇲🇾' },
|
|
61
|
+
PH: { name: 'Philippines', name_en: "Philippines", flag: '🇵ðŸ‡' },
|
|
62
|
+
TR: { name: 'Turquie', name_en: "Turkey", flag: '🇹🇷' },
|
|
63
|
+
IL: { name: 'Israël', name_en: "Israel", flag: '🇮🇱' },
|
|
64
|
+
RU: { name: 'Russie', name_en: "Russia", flag: '🇷🇺' },
|
|
65
|
+
UA: { name: 'Ukraine', name_en: "Ukraine", flag: '🇺🇦' },
|
|
66
|
+
PL: { name: 'Pologne', name_en: "Poland", flag: '🇵🇱' },
|
|
67
|
+
CZ: { name: 'République Tchèque', name_en: "Czech Republic", flag: '🇨🇿' },
|
|
68
|
+
HU: { name: 'Hongrie', name_en: "Hungary", flag: 'ðŸ‡ðŸ‡º' },
|
|
69
|
+
RO: { name: 'Roumanie', name_en: "Romania", flag: '🇷🇴' },
|
|
70
|
+
BG: { name: 'Bulgarie', name_en: "Bulgaria", flag: '🇧🇬' },
|
|
71
|
+
HR: { name: 'Croatie', name_en: "Croatia", flag: 'ðŸ‡ðŸ‡·' },
|
|
72
|
+
SI: { name: 'Slovénie', name_en: "Slovenia", flag: '🇸🇮' },
|
|
73
|
+
SK: { name: 'Slovaquie', name_en: "Slovakia", flag: '🇸🇰' },
|
|
74
|
+
LT: { name: 'Lituanie', name_en: "Lithuania", flag: '🇱🇹' },
|
|
75
|
+
LV: { name: 'Lettonie', name_en: "Latvia", flag: '🇱🇻' },
|
|
76
|
+
EE: { name: 'Estonie', name_en: "Estonia", flag: '🇪🇪' },
|
|
77
|
+
FI: { name: 'Finlande', name_en: "Finland", flag: '🇫🇮' },
|
|
78
|
+
SE: { name: 'Suède', name_en: "Sweden", flag: '🇸🇪' },
|
|
79
|
+
NO: { name: 'Norvège', name_en: "Norway", flag: '🇳🇴' },
|
|
80
|
+
DK: { name: 'Danemark', name_en: "Denmark", flag: '🇩🇰' },
|
|
81
|
+
IS: { name: 'Islande', name_en: "Iceland", flag: '🇮🇸' },
|
|
82
|
+
IE: { name: 'Irlande', name_en: "Ireland", flag: '🇮🇪' },
|
|
83
|
+
NZ: { name: 'Nouvelle-Zélande', name_en: "New Zealand", flag: '🇳🇿' },
|
|
84
|
+
};
|