@sanctum-key/react-native-sdk 1.0.0
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/README.md +278 -0
- package/android/build/.transforms/f62cb96b2d1f78ca96ab35932dd530dc/results.bin +1 -0
- package/android/build/.transforms/f62cb96b2d1f78ca96ab35932dd530dc/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/generated/source/buildConfig/debug/kyc/transfergratis/com/BuildConfig.java +10 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +69 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
- package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
- package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +1 -0
- package/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/xml_file_paths.xml.flat +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +2 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
- package/android/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/transfergratis-react-native-sdk_debug.kotlin_module +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/kyc/transfergratis/com/BuildConfig.class +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +3 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +110 -0
- package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +69 -0
- package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
- package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
- package/android/build/intermediates/packaged_res/debug/packageDebugResources/xml/file_paths.xml +15 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +2 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +2 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +101 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/transfergratis-react-native-sdk_debug.kotlin_module +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$1$5$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$1$5$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$3.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$4.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$5.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$6.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$3.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$4.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$View$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$lambda$4$$inlined$Prop$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$lambda$4$$inlined$Prop$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkView.class +0 -0
- package/android/build.gradle +43 -0
- package/android/src/main/AndroidManifest.xml +49 -0
- package/android/src/main/java/kyc/transfergratis/com/TransfergratisSdkModule.kt +131 -0
- package/android/src/main/java/kyc/transfergratis/com/TransfergratisSdkView.kt +161 -0
- package/android/src/main/res/xml/file_paths.xml +15 -0
- package/build/App.d.ts +3 -0
- package/build/App.d.ts.map +1 -0
- package/build/App.js +9 -0
- package/build/App.js.map +1 -0
- package/build/TransfergratisSdk.types.d.ts +32 -0
- package/build/TransfergratisSdk.types.d.ts.map +1 -0
- package/build/TransfergratisSdk.types.js +2 -0
- package/build/TransfergratisSdk.types.js.map +1 -0
- package/build/TransfergratisSdkModule.d.ts +21 -0
- package/build/TransfergratisSdkModule.d.ts.map +1 -0
- package/build/TransfergratisSdkModule.js +4 -0
- package/build/TransfergratisSdkModule.js.map +1 -0
- package/build/TransfergratisSdkModule.web.d.ts +20 -0
- package/build/TransfergratisSdkModule.web.d.ts.map +1 -0
- package/build/TransfergratisSdkModule.web.js +25 -0
- package/build/TransfergratisSdkModule.web.js.map +1 -0
- package/build/TransfergratisSdkView.d.ts +4 -0
- package/build/TransfergratisSdkView.d.ts.map +1 -0
- package/build/TransfergratisSdkView.js +7 -0
- package/build/TransfergratisSdkView.js.map +1 -0
- package/build/TransfergratisSdkView.web.d.ts +4 -0
- package/build/TransfergratisSdkView.web.d.ts.map +1 -0
- package/build/TransfergratisSdkView.web.js +11 -0
- package/build/TransfergratisSdkView.web.js.map +1 -0
- 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/Camera/index.d.ts +2 -0
- package/build/components/Camera/index.d.ts.map +1 -0
- package/build/components/Camera/index.js +2 -0
- package/build/components/Camera/index.js.map +1 -0
- package/build/components/Camera/index.web.d.ts +2 -0
- package/build/components/Camera/index.web.d.ts.map +1 -0
- package/build/components/Camera/index.web.js +2 -0
- package/build/components/Camera/index.web.js.map +1 -0
- package/build/components/Camera/types.d.ts +2 -0
- package/build/components/Camera/types.d.ts.map +1 -0
- package/build/components/Camera/types.js +2 -0
- package/build/components/Camera/types.js.map +1 -0
- package/build/components/ConfigurableKYCFlow.d.ts +11 -0
- package/build/components/ConfigurableKYCFlow.d.ts.map +1 -0
- package/build/components/ConfigurableKYCFlow.js +257 -0
- package/build/components/ConfigurableKYCFlow.js.map +1 -0
- package/build/components/CustomCameraExample.d.ts +10 -0
- package/build/components/CustomCameraExample.d.ts.map +1 -0
- package/build/components/CustomCameraExample.js +232 -0
- package/build/components/CustomCameraExample.js.map +1 -0
- package/build/components/EnhancedCameraView.d.ts +4 -0
- package/build/components/EnhancedCameraView.d.ts.map +1 -0
- package/build/components/EnhancedCameraView.js +393 -0
- package/build/components/EnhancedCameraView.js.map +1 -0
- package/build/components/EnhancedCameraView.web.d.ts +4 -0
- package/build/components/EnhancedCameraView.web.d.ts.map +1 -0
- package/build/components/EnhancedCameraView.web.js +499 -0
- package/build/components/EnhancedCameraView.web.js.map +1 -0
- package/build/components/FileUpload.d.ts +13 -0
- package/build/components/FileUpload.d.ts.map +1 -0
- package/build/components/FileUpload.js +216 -0
- package/build/components/FileUpload.js.map +1 -0
- package/build/components/KYCElementRenderer.d.ts +14 -0
- package/build/components/KYCElementRenderer.d.ts.map +1 -0
- package/build/components/KYCElementRenderer.js +31 -0
- package/build/components/KYCElementRenderer.js.map +1 -0
- package/build/components/KYCElements/AdditionalDocumentsTemplate.d.ts +12 -0
- package/build/components/KYCElements/AdditionalDocumentsTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/AdditionalDocumentsTemplate.js +283 -0
- package/build/components/KYCElements/AdditionalDocumentsTemplate.js.map +1 -0
- package/build/components/KYCElements/CameraCapture.d.ts +11 -0
- package/build/components/KYCElements/CameraCapture.d.ts.map +1 -0
- package/build/components/KYCElements/CameraCapture.js +219 -0
- package/build/components/KYCElements/CameraCapture.js.map +1 -0
- package/build/components/KYCElements/CompletionStep.d.ts +10 -0
- package/build/components/KYCElements/CompletionStep.d.ts.map +1 -0
- package/build/components/KYCElements/CompletionStep.js +147 -0
- package/build/components/KYCElements/CompletionStep.js.map +1 -0
- package/build/components/KYCElements/CountrySelection.d.ts +11 -0
- package/build/components/KYCElements/CountrySelection.d.ts.map +1 -0
- package/build/components/KYCElements/CountrySelection.js +147 -0
- package/build/components/KYCElements/CountrySelection.js.map +1 -0
- package/build/components/KYCElements/CountrySelectionTemplate.d.ts +15 -0
- package/build/components/KYCElements/CountrySelectionTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/CountrySelectionTemplate.js +438 -0
- package/build/components/KYCElements/CountrySelectionTemplate.js.map +1 -0
- package/build/components/KYCElements/DocumentTypeSelection.d.ts +11 -0
- package/build/components/KYCElements/DocumentTypeSelection.d.ts.map +1 -0
- package/build/components/KYCElements/DocumentTypeSelection.js +143 -0
- package/build/components/KYCElements/DocumentTypeSelection.js.map +1 -0
- package/build/components/KYCElements/EmailVerificationTemplate.d.ts +12 -0
- package/build/components/KYCElements/EmailVerificationTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/EmailVerificationTemplate.js +212 -0
- package/build/components/KYCElements/EmailVerificationTemplate.js.map +1 -0
- package/build/components/KYCElements/FileUpload.d.ts +11 -0
- package/build/components/KYCElements/FileUpload.d.ts.map +1 -0
- package/build/components/KYCElements/FileUpload.js +268 -0
- package/build/components/KYCElements/FileUpload.js.map +1 -0
- package/build/components/KYCElements/FileUploadTemplate.d.ts +12 -0
- package/build/components/KYCElements/FileUploadTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/FileUploadTemplate.js +331 -0
- package/build/components/KYCElements/FileUploadTemplate.js.map +1 -0
- package/build/components/KYCElements/IDCardCapture.d.ts +19 -0
- package/build/components/KYCElements/IDCardCapture.d.ts.map +1 -0
- package/build/components/KYCElements/IDCardCapture.js +877 -0
- package/build/components/KYCElements/IDCardCapture.js.map +1 -0
- 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 +20 -0
- package/build/components/KYCElements/LocationCaptureTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/LocationCaptureTemplate.js +318 -0
- package/build/components/KYCElements/LocationCaptureTemplate.js.map +1 -0
- package/build/components/KYCElements/OrientationVideoCapture.d.ts +14 -0
- package/build/components/KYCElements/OrientationVideoCapture.d.ts.map +1 -0
- package/build/components/KYCElements/OrientationVideoCapture.js +534 -0
- package/build/components/KYCElements/OrientationVideoCapture.js.map +1 -0
- package/build/components/KYCElements/OrientationVideoCaptureEnhanced.d.ts +14 -0
- package/build/components/KYCElements/OrientationVideoCaptureEnhanced.d.ts.map +1 -0
- package/build/components/KYCElements/OrientationVideoCaptureEnhanced.js +504 -0
- package/build/components/KYCElements/OrientationVideoCaptureEnhanced.js.map +1 -0
- package/build/components/KYCElements/OrientationVideoCaptureFinal.d.ts +14 -0
- package/build/components/KYCElements/OrientationVideoCaptureFinal.d.ts.map +1 -0
- package/build/components/KYCElements/OrientationVideoCaptureFinal.js +430 -0
- package/build/components/KYCElements/OrientationVideoCaptureFinal.js.map +1 -0
- package/build/components/KYCElements/PersonalInformationTemplate.d.ts +12 -0
- package/build/components/KYCElements/PersonalInformationTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/PersonalInformationTemplate.js +120 -0
- package/build/components/KYCElements/PersonalInformationTemplate.js.map +1 -0
- package/build/components/KYCElements/PhoneVerificationTemplate.d.ts +12 -0
- package/build/components/KYCElements/PhoneVerificationTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/PhoneVerificationTemplate.js +185 -0
- package/build/components/KYCElements/PhoneVerificationTemplate.js.map +1 -0
- 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/SelfieCapture.d.ts +11 -0
- package/build/components/KYCElements/SelfieCapture.d.ts.map +1 -0
- package/build/components/KYCElements/SelfieCapture.js +236 -0
- package/build/components/KYCElements/SelfieCapture.js.map +1 -0
- package/build/components/KYCElements/SelfieCaptureTemplate.d.ts +16 -0
- package/build/components/KYCElements/SelfieCaptureTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/SelfieCaptureTemplate.js +568 -0
- package/build/components/KYCElements/SelfieCaptureTemplate.js.map +1 -0
- 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 +195 -0
- package/build/components/KYCElements/VerificationProgressTemplate.js.map +1 -0
- package/build/components/KYCElements/VerificationStep.d.ts +10 -0
- package/build/components/KYCElements/VerificationStep.d.ts.map +1 -0
- package/build/components/KYCElements/VerificationStep.js +199 -0
- package/build/components/KYCElements/VerificationStep.js.map +1 -0
- package/build/components/KYCElements/WelcomeTemplate.d.ts +12 -0
- package/build/components/KYCElements/WelcomeTemplate.d.ts.map +1 -0
- package/build/components/KYCElements/WelcomeTemplate.js +244 -0
- package/build/components/KYCElements/WelcomeTemplate.js.map +1 -0
- package/build/components/KYCExample.d.ts +3 -0
- package/build/components/KYCExample.d.ts.map +1 -0
- package/build/components/KYCExample.js +247 -0
- package/build/components/KYCExample.js.map +1 -0
- package/build/components/KYCFlow.d.ts +3 -0
- package/build/components/KYCFlow.d.ts.map +1 -0
- package/build/components/KYCFlow.js +308 -0
- package/build/components/KYCFlow.js.map +1 -0
- package/build/components/NativeCameraView.d.ts +11 -0
- package/build/components/NativeCameraView.d.ts.map +1 -0
- package/build/components/NativeCameraView.js +27 -0
- package/build/components/NativeCameraView.js.map +1 -0
- package/build/components/OverLay/IdCard.d.ts +4 -0
- package/build/components/OverLay/IdCard.d.ts.map +1 -0
- package/build/components/OverLay/IdCard.js +185 -0
- package/build/components/OverLay/IdCard.js.map +1 -0
- package/build/components/OverLay/SelfieOverlay.d.ts +4 -0
- package/build/components/OverLay/SelfieOverlay.d.ts.map +1 -0
- package/build/components/OverLay/SelfieOverlay.js +169 -0
- package/build/components/OverLay/SelfieOverlay.js.map +1 -0
- package/build/components/OverLay/StepOverlay.d.ts +9 -0
- package/build/components/OverLay/StepOverlay.d.ts.map +1 -0
- package/build/components/OverLay/StepOverlay.js +53 -0
- package/build/components/OverLay/StepOverlay.js.map +1 -0
- package/build/components/OverLay/type.d.ts +98 -0
- package/build/components/OverLay/type.d.ts.map +1 -0
- package/build/components/OverLay/type.js +2 -0
- package/build/components/OverLay/type.js.map +1 -0
- package/build/components/ProgressIndicator.d.ts +8 -0
- package/build/components/ProgressIndicator.d.ts.map +1 -0
- package/build/components/ProgressIndicator.js +48 -0
- package/build/components/ProgressIndicator.js.map +1 -0
- package/build/components/SelfieCapture.d.ts +3 -0
- package/build/components/SelfieCapture.d.ts.map +1 -0
- package/build/components/SelfieCapture.js +197 -0
- package/build/components/SelfieCapture.js.map +1 -0
- package/build/components/SimpleExample.d.ts +3 -0
- package/build/components/SimpleExample.d.ts.map +1 -0
- package/build/components/SimpleExample.js +89 -0
- package/build/components/SimpleExample.js.map +1 -0
- package/build/components/Svgs/GpsIcon.d.ts +3 -0
- package/build/components/Svgs/GpsIcon.d.ts.map +1 -0
- package/build/components/Svgs/GpsIcon.js +9 -0
- package/build/components/Svgs/GpsIcon.js.map +1 -0
- package/build/components/Svgs/Schield.d.ts +3 -0
- package/build/components/Svgs/Schield.d.ts.map +1 -0
- package/build/components/Svgs/Schield.js +22 -0
- package/build/components/Svgs/Schield.js.map +1 -0
- package/build/components/Svgs/directionArrow.gif +0 -0
- package/build/components/Svgs/frontSelfieIcon.d.ts +3 -0
- package/build/components/Svgs/frontSelfieIcon.d.ts.map +1 -0
- package/build/components/Svgs/frontSelfieIcon.js +11 -0
- package/build/components/Svgs/frontSelfieIcon.js.map +1 -0
- package/build/components/Svgs/scanningLine.d.ts +9 -0
- package/build/components/Svgs/scanningLine.d.ts.map +1 -0
- package/build/components/Svgs/scanningLine.js +61 -0
- package/build/components/Svgs/scanningLine.js.map +1 -0
- package/build/components/Svgs/sideSelfieIcon.d.ts +3 -0
- package/build/components/Svgs/sideSelfieIcon.d.ts.map +1 -0
- package/build/components/Svgs/sideSelfieIcon.js +9 -0
- package/build/components/Svgs/sideSelfieIcon.js.map +1 -0
- package/build/components/TemplateKYCExample.d.ts +22 -0
- package/build/components/TemplateKYCExample.d.ts.map +1 -0
- package/build/components/TemplateKYCExample.js +155 -0
- package/build/components/TemplateKYCExample.js.map +1 -0
- package/build/components/TemplateKYCFlowRefactored.d.ts +26 -0
- package/build/components/TemplateKYCFlowRefactored.d.ts.map +1 -0
- package/build/components/TemplateKYCFlowRefactored.js +359 -0
- package/build/components/TemplateKYCFlowRefactored.js.map +1 -0
- package/build/components/VisionCameraView.d.ts +22 -0
- package/build/components/VisionCameraView.d.ts.map +1 -0
- package/build/components/VisionCameraView.js +142 -0
- package/build/components/VisionCameraView.js.map +1 -0
- package/build/components/example/CameraCaptureEx.d.ts +4 -0
- package/build/components/example/CameraCaptureEx.d.ts.map +1 -0
- package/build/components/example/CameraCaptureEx.js +219 -0
- package/build/components/example/CameraCaptureEx.js.map +1 -0
- package/build/components/example/CameraCaptureExAdvanced.d.ts +3 -0
- package/build/components/example/CameraCaptureExAdvanced.d.ts.map +1 -0
- package/build/components/example/CameraCaptureExAdvanced.js +229 -0
- package/build/components/example/CameraCaptureExAdvanced.js.map +1 -0
- package/build/components/example/CameraCaptureExScan.d.ts +3 -0
- package/build/components/example/CameraCaptureExScan.d.ts.map +1 -0
- package/build/components/example/CameraCaptureExScan.js +213 -0
- package/build/components/example/CameraCaptureExScan.js.map +1 -0
- package/build/components/example/CameraCaptureExSimple.d.ts +3 -0
- package/build/components/example/CameraCaptureExSimple.d.ts.map +1 -0
- package/build/components/example/CameraCaptureExSimple.js +138 -0
- package/build/components/example/CameraCaptureExSimple.js.map +1 -0
- package/build/components/example/DynamicTemplateExample.d.ts +10 -0
- package/build/components/example/DynamicTemplateExample.d.ts.map +1 -0
- package/build/components/example/DynamicTemplateExample.js +241 -0
- package/build/components/example/DynamicTemplateExample.js.map +1 -0
- package/build/components/example/OrientationVideoExample.d.ts +4 -0
- package/build/components/example/OrientationVideoExample.d.ts.map +1 -0
- package/build/components/example/OrientationVideoExample.js +325 -0
- package/build/components/example/OrientationVideoExample.js.map +1 -0
- package/build/components/example/SelfieCaptureEx.d.ts +4 -0
- package/build/components/example/SelfieCaptureEx.d.ts.map +1 -0
- package/build/components/example/SelfieCaptureEx.js +238 -0
- package/build/components/example/SelfieCaptureEx.js.map +1 -0
- package/build/components/ui/Button.d.ts +37 -0
- package/build/components/ui/Button.d.ts.map +1 -0
- package/build/components/ui/Button.js +194 -0
- package/build/components/ui/Button.js.map +1 -0
- package/build/components/ui/ButtonExample.d.ts +4 -0
- package/build/components/ui/ButtonExample.d.ts.map +1 -0
- package/build/components/ui/ButtonExample.js +209 -0
- package/build/components/ui/ButtonExample.js.map +1 -0
- package/build/components/ui/ButtonStyles.d.ts +521 -0
- package/build/components/ui/ButtonStyles.d.ts.map +1 -0
- package/build/components/ui/ButtonStyles.js +429 -0
- package/build/components/ui/ButtonStyles.js.map +1 -0
- package/build/config/KYCConfig.d.ts +14 -0
- package/build/config/KYCConfig.d.ts.map +1 -0
- package/build/config/KYCConfig.js +26 -0
- package/build/config/KYCConfig.js.map +1 -0
- package/build/config/KYCConfigs.d.ts +7 -0
- package/build/config/KYCConfigs.d.ts.map +1 -0
- package/build/config/KYCConfigs.js +516 -0
- package/build/config/KYCConfigs.js.map +1 -0
- package/build/config/allowedDomains.d.ts +30 -0
- package/build/config/allowedDomains.d.ts.map +1 -0
- package/build/config/allowedDomains.js +112 -0
- package/build/config/allowedDomains.js.map +1 -0
- package/build/config/countriesData.d.ts +3 -0
- package/build/config/countriesData.d.ts.map +1 -0
- package/build/config/countriesData.js +80 -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 +736 -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/useKYC.d.ts +15 -0
- package/build/hooks/useKYC.d.ts.map +1 -0
- package/build/hooks/useKYC.js +103 -0
- package/build/hooks/useKYC.js.map +1 -0
- package/build/hooks/useKYCFlow.d.ts +3 -0
- package/build/hooks/useKYCFlow.d.ts.map +1 -0
- package/build/hooks/useKYCFlow.js +221 -0
- package/build/hooks/useKYCFlow.js.map +1 -0
- package/build/hooks/useLocation.d.ts +32 -0
- package/build/hooks/useLocation.d.ts.map +1 -0
- package/build/hooks/useLocation.js +165 -0
- package/build/hooks/useLocation.js.map +1 -0
- package/build/hooks/useOrientationVideo.d.ts +10 -0
- package/build/hooks/useOrientationVideo.d.ts.map +1 -0
- package/build/hooks/useOrientationVideo.js +118 -0
- package/build/hooks/useOrientationVideo.js.map +1 -0
- 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 +48 -0
- package/build/hooks/useTemplateKYCFlow.d.ts.map +1 -0
- package/build/hooks/useTemplateKYCFlow.js +910 -0
- package/build/hooks/useTemplateKYCFlow.js.map +1 -0
- package/build/hooks/useTemplateLoader.d.ts +14 -0
- package/build/hooks/useTemplateLoader.d.ts.map +1 -0
- package/build/hooks/useTemplateLoader.js +85 -0
- package/build/hooks/useTemplateLoader.js.map +1 -0
- package/build/i18n/en/index.d.ts +233 -0
- package/build/i18n/en/index.d.ts.map +1 -0
- package/build/i18n/en/index.js +261 -0
- package/build/i18n/en/index.js.map +1 -0
- package/build/i18n/fr/index.d.ts +219 -0
- package/build/i18n/fr/index.d.ts.map +1 -0
- package/build/i18n/fr/index.js +246 -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 +162 -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 +11 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +17 -0
- package/build/index.js.map +1 -0
- package/build/modules/api/CardAuthentification.d.ts +72 -0
- package/build/modules/api/CardAuthentification.d.ts.map +1 -0
- package/build/modules/api/CardAuthentification.js +487 -0
- package/build/modules/api/CardAuthentification.js.map +1 -0
- package/build/modules/api/KYCService.d.ts +116 -0
- package/build/modules/api/KYCService.d.ts.map +1 -0
- package/build/modules/api/KYCService.js +526 -0
- package/build/modules/api/KYCService.js.map +1 -0
- package/build/modules/api/SelfieVerification.d.ts +5 -0
- package/build/modules/api/SelfieVerification.d.ts.map +1 -0
- package/build/modules/api/SelfieVerification.js +25 -0
- package/build/modules/api/SelfieVerification.js.map +1 -0
- package/build/modules/api/TemplateService.d.ts +44 -0
- package/build/modules/api/TemplateService.d.ts.map +1 -0
- package/build/modules/api/TemplateService.js +146 -0
- package/build/modules/api/TemplateService.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 +53 -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/modules/camera/NativeCameraModule.d.ts +52 -0
- package/build/modules/camera/NativeCameraModule.d.ts.map +1 -0
- package/build/modules/camera/NativeCameraModule.js +149 -0
- package/build/modules/camera/NativeCameraModule.js.map +1 -0
- package/build/modules/camera/UnifiedCameraModule.d.ts +70 -0
- package/build/modules/camera/UnifiedCameraModule.d.ts.map +1 -0
- package/build/modules/camera/UnifiedCameraModule.js +125 -0
- package/build/modules/camera/UnifiedCameraModule.js.map +1 -0
- package/build/modules/camera/VisionCameraModule.d.ts +62 -0
- package/build/modules/camera/VisionCameraModule.d.ts.map +1 -0
- package/build/modules/camera/VisionCameraModule.js +313 -0
- package/build/modules/camera/VisionCameraModule.js.map +1 -0
- package/build/modules/camera/VisionCameraModule.web.d.ts +145 -0
- package/build/modules/camera/VisionCameraModule.web.d.ts.map +1 -0
- package/build/modules/camera/VisionCameraModule.web.js +589 -0
- package/build/modules/camera/VisionCameraModule.web.js.map +1 -0
- package/build/modules/camera/index.d.ts +5 -0
- package/build/modules/camera/index.d.ts.map +1 -0
- package/build/modules/camera/index.js +4 -0
- package/build/modules/camera/index.js.map +1 -0
- package/build/stores/kycStore.d.ts +55 -0
- package/build/stores/kycStore.d.ts.map +1 -0
- package/build/stores/kycStore.js +98 -0
- package/build/stores/kycStore.js.map +1 -0
- package/build/types/KYC.types.d.ts +643 -0
- package/build/types/KYC.types.d.ts.map +1 -0
- package/build/types/KYC.types.js +25 -0
- package/build/types/KYC.types.js.map +1 -0
- package/build/types/env.types.d.ts +13 -0
- package/build/types/env.types.d.ts.map +1 -0
- package/build/types/env.types.js +2 -0
- package/build/types/env.types.js.map +1 -0
- package/build/utils/cropByObb.d.ts +37 -0
- package/build/utils/cropByObb.d.ts.map +1 -0
- package/build/utils/cropByObb.js +215 -0
- package/build/utils/cropByObb.js.map +1 -0
- package/build/utils/deviceDetection.d.ts +6 -0
- package/build/utils/deviceDetection.d.ts.map +1 -0
- package/build/utils/deviceDetection.js +12 -0
- package/build/utils/deviceDetection.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/logger.d.ts +12 -0
- package/build/utils/logger.d.ts.map +1 -0
- package/build/utils/logger.js +45 -0
- package/build/utils/logger.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 +65 -0
- package/build/utils/pathToBase64.js.map +1 -0
- package/build/utils/platformAlert.d.ts +20 -0
- package/build/utils/platformAlert.d.ts.map +1 -0
- package/build/utils/platformAlert.js +67 -0
- package/build/utils/platformAlert.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/utils/template-transformer.d.ts +10 -0
- package/build/utils/template-transformer.d.ts.map +1 -0
- package/build/utils/template-transformer.js +365 -0
- package/build/utils/template-transformer.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 +288 -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/expo-module.config.json +9 -0
- package/ios/TransfergratisSdk.podspec +31 -0
- package/ios/TransfergratisSdkModule.swift +409 -0
- package/package.json +71 -0
- package/plugin/build/index.d.ts +5 -0
- package/plugin/build/index.js +12 -0
- package/plugin/build/withLocation.d.ts +9 -0
- package/plugin/build/withLocation.js +77 -0
- package/plugin/build/withRemovePermissions.d.ts +3 -0
- package/plugin/build/withRemovePermissions.js +67 -0
- package/plugin/build/withVisionCamera.d.ts +8 -0
- package/plugin/build/withVisionCamera.js +68 -0
- package/plugin/src/index.ts +5 -0
- package/plugin/src/withLocation.ts +109 -0
- package/plugin/src/withRemovePermissions.js +85 -0
- package/plugin/src/withRemovePermissions.ts +83 -0
- package/plugin/src/withVisionCamera.js +88 -0
- package/plugin/src/withVisionCamera.ts +97 -0
- package/plugin/tsconfig.json +17 -0
- package/plugin/tsconfig.tsbuildinfo +1 -0
- package/plugin.js +19 -0
- package/src/App.tsx +9 -0
- package/src/TransfergratisSdk.types.ts +30 -0
- package/src/TransfergratisSdkModule.ts +16 -0
- package/src/TransfergratisSdkModule.web.ts +31 -0
- package/src/TransfergratisSdkView.tsx +11 -0
- package/src/TransfergratisSdkView.web.tsx +15 -0
- package/src/api/axios.ts +144 -0
- package/src/components/Camera/index.tsx +0 -0
- package/src/components/Camera/index.web.tsx +0 -0
- package/src/components/Camera/types.ts +0 -0
- package/src/components/ConfigurableKYCFlow.tsx +334 -0
- package/src/components/CustomCameraExample.tsx +274 -0
- package/src/components/EnhancedCameraView.tsx +482 -0
- package/src/components/EnhancedCameraView.web.tsx +597 -0
- package/src/components/FileUpload.tsx +249 -0
- package/src/components/KYCElementRenderer.tsx +106 -0
- package/src/components/KYCElements/AdditionalDocumentsTemplate.tsx +346 -0
- package/src/components/KYCElements/CameraCapture.tsx +268 -0
- package/src/components/KYCElements/CompletionStep.tsx +161 -0
- package/src/components/KYCElements/CountrySelection.tsx +177 -0
- package/src/components/KYCElements/CountrySelectionTemplate.tsx +526 -0
- package/src/components/KYCElements/DocumentTypeSelection.tsx +173 -0
- package/src/components/KYCElements/EmailVerificationTemplate.tsx +278 -0
- package/src/components/KYCElements/FileUpload.tsx +318 -0
- package/src/components/KYCElements/FileUploadTemplate.tsx +395 -0
- package/src/components/KYCElements/IDCardCapture.tsx +1053 -0
- package/src/components/KYCElements/InitializationStep.tsx +53 -0
- package/src/components/KYCElements/LocationCaptureTemplate.tsx +378 -0
- package/src/components/KYCElements/OrientationVideoCapture.tsx +649 -0
- package/src/components/KYCElements/OrientationVideoCaptureEnhanced.tsx +616 -0
- package/src/components/KYCElements/OrientationVideoCaptureFinal.tsx +534 -0
- package/src/components/KYCElements/PersonalInformationTemplate.tsx +158 -0
- package/src/components/KYCElements/PhoneVerificationTemplate.tsx +253 -0
- package/src/components/KYCElements/ReviewSubmitTemplate.tsx +201 -0
- package/src/components/KYCElements/SelfieCapture.tsx +284 -0
- package/src/components/KYCElements/SelfieCaptureTemplate.tsx +662 -0
- package/src/components/KYCElements/VerificationProgressTemplate.tsx +247 -0
- package/src/components/KYCElements/VerificationStep.tsx +234 -0
- package/src/components/KYCElements/WelcomeTemplate.tsx +290 -0
- package/src/components/KYCExample.tsx +297 -0
- package/src/components/KYCFlow.tsx +377 -0
- package/src/components/NativeCameraView.tsx +47 -0
- package/src/components/OverLay/IdCard.tsx +277 -0
- package/src/components/OverLay/SelfieOverlay.tsx +211 -0
- package/src/components/OverLay/StepOverlay.tsx +64 -0
- package/src/components/OverLay/type.ts +91 -0
- package/src/components/ProgressIndicator.tsx +62 -0
- package/src/components/SelfieCapture.tsx +244 -0
- package/src/components/SimpleExample.tsx +92 -0
- package/src/components/Svgs/GpsIcon.tsx +12 -0
- package/src/components/Svgs/Schield.tsx +26 -0
- package/src/components/Svgs/directionArrow.gif +0 -0
- package/src/components/Svgs/frontSelfieIcon.tsx +13 -0
- package/src/components/Svgs/scanningLine.tsx +88 -0
- package/src/components/Svgs/sideSelfieIcon.tsx +10 -0
- package/src/components/TemplateKYCExample.tsx +194 -0
- package/src/components/TemplateKYCFlowRefactored.tsx +473 -0
- package/src/components/VisionCameraView.tsx +197 -0
- package/src/components/example/CameraCaptureEx.tsx +335 -0
- package/src/components/example/CameraCaptureExAdvanced.tsx +357 -0
- package/src/components/example/CameraCaptureExScan.tsx +336 -0
- package/src/components/example/CameraCaptureExSimple.tsx +215 -0
- package/src/components/example/DynamicTemplateExample.tsx +289 -0
- package/src/components/example/OrientationVideoExample.tsx +380 -0
- package/src/components/example/SelfieCaptureEx.tsx +358 -0
- package/src/components/ui/Button.tsx +328 -0
- package/src/components/ui/ButtonExample.tsx +318 -0
- package/src/components/ui/ButtonStyles.ts +465 -0
- package/src/config/KYCConfig.ts +34 -0
- package/src/config/KYCConfigs.ts +528 -0
- package/src/config/allowedDomains.ts +133 -0
- package/src/config/countriesData.ts +85 -0
- package/src/config/region_mapping.json +735 -0
- package/src/config/region_mapping.ts +737 -0
- package/src/hooks/useI18n.ts +53 -0
- package/src/hooks/useKYC.ts +131 -0
- package/src/hooks/useKYCFlow.ts +248 -0
- package/src/hooks/useLocation.ts +221 -0
- package/src/hooks/useOrientationVideo.ts +149 -0
- package/src/hooks/useRealtimeVerifier.ts +128 -0
- package/src/hooks/useTemplateKYCFlow.tsx +1051 -0
- package/src/hooks/useTemplateLoader.ts +102 -0
- package/src/i18n/README.md +288 -0
- package/src/i18n/en/index.ts +275 -0
- package/src/i18n/fr/index.ts +260 -0
- package/src/i18n/index.ts +65 -0
- package/src/i18n/types.ts +182 -0
- package/src/i18n/usage-example.tsx +202 -0
- package/src/index.ts +25 -0
- package/src/modules/api/CardAuthentification.ts +589 -0
- package/src/modules/api/KYCService.ts +666 -0
- package/src/modules/api/SelfieVerification.ts +33 -0
- package/src/modules/api/TemplateService.ts +168 -0
- package/src/modules/api/backendApi.ts +8 -0
- package/src/modules/api/types.ts +59 -0
- package/src/modules/camera/NativeCameraModule.ts +170 -0
- package/src/modules/camera/UnifiedCameraModule.ts +160 -0
- package/src/modules/camera/VisionCameraModule.ts +334 -0
- package/src/modules/camera/VisionCameraModule.web.ts +679 -0
- package/src/modules/camera/index.ts +6 -0
- package/src/stores/kycStore.ts +161 -0
- package/src/types/KYC.types.ts +837 -0
- package/src/types/env.types.ts +13 -0
- package/src/utils/cropByObb.ts +254 -0
- package/src/utils/deviceDetection.ts +11 -0
- package/src/utils/get-document-type-info.ts +62 -0
- package/src/utils/logger.ts +48 -0
- package/src/utils/pathToBase64.ts +63 -0
- package/src/utils/platformAlert.ts +86 -0
- package/src/utils/remove-duplicate.ts +3 -0
- package/src/utils/template-transformer.ts +445 -0
- package/src/web/WebKYCEntry.tsx +375 -0
- package/src/web/index.ts +1 -0
|
@@ -0,0 +1,1053 @@
|
|
|
1
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import { View, Text, StyleSheet, Image, ScrollView, Platform, Modal, TouchableOpacity, ActivityIndicator } from 'react-native';
|
|
3
|
+
import { showAlert } from '../../utils/platformAlert';
|
|
4
|
+
import { EnhancedCameraView } from '../EnhancedCameraView';
|
|
5
|
+
import { TemplateComponent, LocalizedText, GovernmentDocumentType, ISilentCaptureResult, IBbox, GovernmentDocumentTypeShorted, GovernmentDocumentTypeBackend } from '../../types/KYC.types';
|
|
6
|
+
import IdCardOverlay from '../OverLay/IdCard';
|
|
7
|
+
import { useTemplateKYCFlowContext } from '../../hooks/useTemplateKYCFlow';
|
|
8
|
+
import { useI18n } from '../../hooks/useI18n';
|
|
9
|
+
import { Button } from '../ui/Button';
|
|
10
|
+
import { removeDuplicates } from '../../utils/remove-duplicate';
|
|
11
|
+
import { backVerification, checkTemplateType, frontVerification } from '../../modules/api/CardAuthentification';
|
|
12
|
+
import { getDocumentTypeInfo } from '../../utils/get-document-type-info';
|
|
13
|
+
import pathToBase64 from '../../utils/pathToBase64';
|
|
14
|
+
import kycService, { truncateFields } from '../../modules/api/KYCService';
|
|
15
|
+
import { cropByObb, cropImageWithBBox, cropImageWithBBoxWithTolerance, getObbConfidence, OBB_CONFIDENCE_THRESHOLD } from '../../utils/cropByObb';
|
|
16
|
+
import { isMobileWeb } from '../../utils/deviceDetection';
|
|
17
|
+
import { logger } from '../../utils/logger';
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
interface IIDCardPayload {
|
|
21
|
+
dir: string;
|
|
22
|
+
file: string;
|
|
23
|
+
mrz: string;
|
|
24
|
+
templatePath?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface IDCardCaptureProps {
|
|
28
|
+
component: TemplateComponent;
|
|
29
|
+
value?: Record<string, IIDCardPayload>;
|
|
30
|
+
onValueChange: (value: Record<string, IIDCardPayload | string>) => void;
|
|
31
|
+
error?: string;
|
|
32
|
+
language?: string;
|
|
33
|
+
currentSide?: string; // Nouveau prop pour spécifier le côté actuel
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const IDCardCapture: React.FC<IDCardCaptureProps> = ({
|
|
37
|
+
component,
|
|
38
|
+
value = {},
|
|
39
|
+
onValueChange,
|
|
40
|
+
error,
|
|
41
|
+
language = 'en',
|
|
42
|
+
}) => {
|
|
43
|
+
const { t, locale } = useI18n();
|
|
44
|
+
const [showCamera, setShowCamera] = useState(false);
|
|
45
|
+
const [capturedImages, setCapturedImages] = useState<Record<string, IIDCardPayload>>(value || {});
|
|
46
|
+
const [cropImageUri, setCropImageUri] = useState<string>('');
|
|
47
|
+
const [currentSide, setCurrentSide] = useState<'front' | 'back'>('front');
|
|
48
|
+
const [bboxBySide, setBboxBySide] = useState<Record<string, IBbox>>({});
|
|
49
|
+
const [silentCaptureResult, setSilentCaptureResult] = useState<ISilentCaptureResult>({ success: false, isAnalyzing: false });
|
|
50
|
+
const [showQRModal, setShowQRModal] = useState(false);
|
|
51
|
+
|
|
52
|
+
// Mapping des types de documents backend vers SDK
|
|
53
|
+
const documentTypeMapping: Record<string, GovernmentDocumentType> = {
|
|
54
|
+
'nationalId': 'national_id',
|
|
55
|
+
'passport': 'passport',
|
|
56
|
+
'driversLicense': 'drivers_licence',
|
|
57
|
+
'residencePermit': 'permanent_residence',
|
|
58
|
+
'healthInsuranceCard': 'health_insurance_card',
|
|
59
|
+
};
|
|
60
|
+
// const [imageNaturalSize, setImageNaturalSize] = useState<{ width: number; height: number } | null>(null);
|
|
61
|
+
|
|
62
|
+
const { actions, state, env } = useTemplateKYCFlowContext();
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
const getLocalizedText = (text: LocalizedText | Record<string, LocalizedText>): string => {
|
|
67
|
+
// console.log("text", text, JSON.stringify(component, null, 2));
|
|
68
|
+
if (text && typeof text[currentSide] === 'object' && text[currentSide][locale]) {
|
|
69
|
+
return text[currentSide][locale] || '';
|
|
70
|
+
}
|
|
71
|
+
return "";
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
// Récupérer les données depuis le composant country_selection
|
|
75
|
+
const countrySelectionData = useMemo(() => {
|
|
76
|
+
const countrySelectionComponent = state.template.components.find(c => c.type === 'country_selection');
|
|
77
|
+
if (countrySelectionComponent) {
|
|
78
|
+
return state.componentData[countrySelectionComponent.id];
|
|
79
|
+
}
|
|
80
|
+
return null;
|
|
81
|
+
}, [state.template.components, state.componentData]);
|
|
82
|
+
|
|
83
|
+
// Extraire selectedDocumentType depuis countrySelectionData
|
|
84
|
+
const selectedDocumentType = useMemo<{ type: GovernmentDocumentType; region: string } | null>(() => {
|
|
85
|
+
if (!countrySelectionData?.documentType) return null;
|
|
86
|
+
|
|
87
|
+
const backendDocType = countrySelectionData.documentType;
|
|
88
|
+
const mappedType = documentTypeMapping[backendDocType] || backendDocType as GovernmentDocumentType;
|
|
89
|
+
const region = countrySelectionData.region || 'root';
|
|
90
|
+
|
|
91
|
+
return { type: mappedType, region };
|
|
92
|
+
}, [countrySelectionData, documentTypeMapping]);
|
|
93
|
+
|
|
94
|
+
// Récupérer countryData pour compatibilité avec le code existant
|
|
95
|
+
const countryData = useMemo(() => {
|
|
96
|
+
return countrySelectionData;
|
|
97
|
+
}, [countrySelectionData]);
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
// Synchroniser capturedImages avec value quand les données sont chargées (ex: reprise de session)
|
|
101
|
+
useEffect(() => {
|
|
102
|
+
if (value && Object.keys(value).length > 0) {
|
|
103
|
+
// Vérifier si les données ont changé
|
|
104
|
+
const valueChanged = JSON.stringify(value) !== JSON.stringify(capturedImages);
|
|
105
|
+
if (valueChanged) {
|
|
106
|
+
logger.log("Updating capturedImages from value:", Object.keys(value));
|
|
107
|
+
logger.log("Value data sample:", truncateFields(value));
|
|
108
|
+
const updatedImages = value as Record<string, IIDCardPayload>;
|
|
109
|
+
setCapturedImages(updatedImages);
|
|
110
|
+
|
|
111
|
+
// Si on a des images chargées, mettre à jour silentCaptureResult pour l'affichage
|
|
112
|
+
Object.keys(updatedImages).forEach((side) => {
|
|
113
|
+
const imageData = updatedImages[side];
|
|
114
|
+
if (imageData?.dir) {
|
|
115
|
+
setSilentCaptureResult(prev => ({
|
|
116
|
+
...prev,
|
|
117
|
+
path: imageData.dir,
|
|
118
|
+
success: true,
|
|
119
|
+
isAnalyzing: false,
|
|
120
|
+
mrz: imageData.mrz || '',
|
|
121
|
+
templatePath: imageData.templatePath || '',
|
|
122
|
+
}));
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}, [value]);
|
|
128
|
+
|
|
129
|
+
useEffect(() => {
|
|
130
|
+
logger.log("cropImageUri", JSON.stringify(truncateFields({ box: silentCaptureResult }), null, 2));
|
|
131
|
+
if (capturedImages[currentSide]?.dir && silentCaptureResult?.bbox) {
|
|
132
|
+
cropImageWithBBox(capturedImages[currentSide].dir, silentCaptureResult.bbox)?.then((uri) => {
|
|
133
|
+
setCropImageUri(uri);
|
|
134
|
+
console.log(cropImageUri)
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
}, [capturedImages[currentSide]?.dir, silentCaptureResult?.bbox])
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
const cameraConfig = useMemo(() => {
|
|
142
|
+
const instructions = selectedDocumentType
|
|
143
|
+
? (locale === 'en' ? getDocumentTypeInfo(selectedDocumentType.type).instructions.en : getDocumentTypeInfo(selectedDocumentType.type).instructions.fr)
|
|
144
|
+
: getLocalizedText(component.instructions as Record<string, LocalizedText>);
|
|
145
|
+
|
|
146
|
+
return {
|
|
147
|
+
aspectRatio: 4 / 3,
|
|
148
|
+
quality: 0.7,
|
|
149
|
+
flashMode: 'auto' as const,
|
|
150
|
+
cameraType: 'back' as const,
|
|
151
|
+
autoFocus: 'on',
|
|
152
|
+
whiteBalance: 'auto',
|
|
153
|
+
allowRetake: true,
|
|
154
|
+
maxRetakes: 3,
|
|
155
|
+
overlay: {
|
|
156
|
+
showGuide: true,
|
|
157
|
+
guideText: instructions,
|
|
158
|
+
bbox: {
|
|
159
|
+
xMin: 20,
|
|
160
|
+
yMin: 140,
|
|
161
|
+
xMax: 370,
|
|
162
|
+
yMax: 340,
|
|
163
|
+
borderColor: '#2DBD60',
|
|
164
|
+
borderWidth: 3,
|
|
165
|
+
cornerRadius: 8
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
}, [selectedDocumentType, locale, component.instructions]);
|
|
170
|
+
|
|
171
|
+
const retakePicture = (sideToRetake: 'front' | 'back') => {
|
|
172
|
+
// 1. Turn the camera back on and hide the stepper
|
|
173
|
+
setShowCamera(true);
|
|
174
|
+
actions.showCustomStepper(false);
|
|
175
|
+
|
|
176
|
+
// 2. WIPE LOCAL STATE: Use functional update to prevent stale closures
|
|
177
|
+
setCapturedImages((prev) => {
|
|
178
|
+
const newState = { ...prev };
|
|
179
|
+
delete newState[sideToRetake];
|
|
180
|
+
return newState;
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
setSilentCaptureResult({
|
|
184
|
+
path: '',
|
|
185
|
+
success: false,
|
|
186
|
+
isAnalyzing: false,
|
|
187
|
+
error: '',
|
|
188
|
+
templatePath: '',
|
|
189
|
+
mrz: '',
|
|
190
|
+
bbox: undefined,
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
if (value) {
|
|
195
|
+
const newValue = { ...value };
|
|
196
|
+
delete newValue[sideToRetake];
|
|
197
|
+
onValueChange(newValue);
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
const getCurrentSideVerification = (currentSide: string) => {
|
|
204
|
+
if (!selectedDocumentType || !countryData?.regionMapping) {
|
|
205
|
+
return { authMethod: [], mrzTypes: [], regionMapping: null, key: 'root' };
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
const regionMapping = countryData.regionMapping[selectedDocumentType.type as GovernmentDocumentType];
|
|
209
|
+
const authMethod: string[] = [];
|
|
210
|
+
const mrzTypes: string[] = [];
|
|
211
|
+
|
|
212
|
+
const key = selectedDocumentType.region?.trim()?.length > 0 ? selectedDocumentType.region.trim() : 'root';
|
|
213
|
+
|
|
214
|
+
if (regionMapping?.[key] && Array.isArray(regionMapping[key])) {
|
|
215
|
+
regionMapping[key].forEach((item: any) => {
|
|
216
|
+
if (item[currentSide as keyof typeof item]) {
|
|
217
|
+
authMethod.push(item[currentSide as keyof typeof item]);
|
|
218
|
+
if (item?.mrz_type) {
|
|
219
|
+
mrzTypes.push(item?.mrz_type);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
logger.log("regionMapping", JSON.stringify(truncateFields({ regionMapping, selectedDocumentType: selectedDocumentType.region, key }), null, 2));
|
|
226
|
+
|
|
227
|
+
return { authMethod: removeDuplicates(authMethod), mrzTypes: removeDuplicates(mrzTypes), regionMapping: regionMapping, key: key };
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
const getCorrespondingMrzType = (templatePath: string, mapping: any, selectedDocumentType: string = "root") => {
|
|
231
|
+
if (!mapping || !mapping[selectedDocumentType]) return null;
|
|
232
|
+
|
|
233
|
+
// Extraire le nom du fichier depuis le template_path
|
|
234
|
+
const fileName = templatePath.split("/").pop()?.replace(".jpg", "").replace(".png", "");
|
|
235
|
+
|
|
236
|
+
if (!fileName) return null;
|
|
237
|
+
|
|
238
|
+
// Normaliser en .py
|
|
239
|
+
const pyName = `${fileName}.py`; // ex: cameroon_id_back_3_1.py
|
|
240
|
+
|
|
241
|
+
// Chercher dans la liste
|
|
242
|
+
const found = mapping[selectedDocumentType].find((item: any) => item.py_file === pyName);
|
|
243
|
+
|
|
244
|
+
return found?.mrz_type || null;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
const handleSilentCapture = async (result: { success: boolean; path?: string; error?: string }) => {
|
|
248
|
+
if (silentCaptureResult.isAnalyzing) {
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
if (result.success && result.path) {
|
|
252
|
+
setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: true, success: false, error: '' }));
|
|
253
|
+
let templatePath = silentCaptureResult.templatePath || '';
|
|
254
|
+
let templateBbox: IBbox | undefined;
|
|
255
|
+
|
|
256
|
+
if (!selectedDocumentType) {
|
|
257
|
+
setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, success: false, error: 'Document type not selected' }));
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
const regionMappings = getCurrentSideVerification(currentSide)
|
|
262
|
+
// logger.log("regionMappings", JSON.stringify(truncateFields({regionMappings, templatePath}), null, 2));
|
|
263
|
+
if (templatePath.length === 0) {
|
|
264
|
+
try {
|
|
265
|
+
logger.log("checkTemplateType - BEFORE call", {
|
|
266
|
+
selectedDocumentTypeType: selectedDocumentType?.type,
|
|
267
|
+
countrySelectionDataDocumentType: countrySelectionData?.documentType,
|
|
268
|
+
docTypeToSend: selectedDocumentType?.type
|
|
269
|
+
});
|
|
270
|
+
const templateType = await checkTemplateType({ path: result.path || '', docType: selectedDocumentType?.type as GovernmentDocumentType, docRegion: countryData?.code || "", postfix: currentSide }, env);
|
|
271
|
+
|
|
272
|
+
if (templateType.template_path) {
|
|
273
|
+
templatePath = templateType.template_path;
|
|
274
|
+
logger.log("templatePath", templatePath);
|
|
275
|
+
setSilentCaptureResult((prev) => ({ ...prev, templatePath: templatePath }));
|
|
276
|
+
}
|
|
277
|
+
if (templateType.card_obb) {
|
|
278
|
+
const obbConfidence = getObbConfidence((templateType as any).card_obb);
|
|
279
|
+
if (obbConfidence !== null && obbConfidence < OBB_CONFIDENCE_THRESHOLD) {
|
|
280
|
+
setSilentCaptureResult((prev) => ({
|
|
281
|
+
...prev,
|
|
282
|
+
isAnalyzing: false,
|
|
283
|
+
success: false,
|
|
284
|
+
error: t('kyc.idCardCapture.cardNotFullyInFrame'),
|
|
285
|
+
}));
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
let bbox: IBbox | undefined;
|
|
289
|
+
try {
|
|
290
|
+
const crop = await cropByObb(result?.path || '', (templateType as any).card_obb);
|
|
291
|
+
bbox = crop.bbox;
|
|
292
|
+
templateBbox = bbox;
|
|
293
|
+
} catch { }
|
|
294
|
+
}
|
|
295
|
+
} catch (e: any) {
|
|
296
|
+
logger.log("error checking template type", truncateFields(e));
|
|
297
|
+
setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, success: false, error: e?.message || 'Erreur de vérification du template' }));
|
|
298
|
+
return; // Return early if checkTemplateType fails
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
logger.log("templatePath before verification", templatePath, "currentSide", currentSide);
|
|
302
|
+
if (currentSide === 'front') {
|
|
303
|
+
logger.log("frontVerification - BEFORE call", {
|
|
304
|
+
selectedDocumentTypeType: selectedDocumentType?.type,
|
|
305
|
+
countrySelectionDataDocumentType: countrySelectionData?.documentType,
|
|
306
|
+
docTypeToSend: selectedDocumentType?.type
|
|
307
|
+
});
|
|
308
|
+
logger.log("Calling frontVerification", { templatePath, selectedDocumentType: selectedDocumentType?.type, regionMappings });
|
|
309
|
+
console.log("About to call frontVerification", typeof frontVerification);
|
|
310
|
+
try {
|
|
311
|
+
const mrzType = getCorrespondingMrzType(templatePath, regionMappings.regionMapping, regionMappings.key || '') || '';
|
|
312
|
+
console.log("mrzType calculated", mrzType);
|
|
313
|
+
const verificationParams = {
|
|
314
|
+
path: result.path,
|
|
315
|
+
regionMapping: {
|
|
316
|
+
authMethod: regionMappings.authMethod,
|
|
317
|
+
mrzTypes: regionMappings.mrzTypes,
|
|
318
|
+
},
|
|
319
|
+
selectedDocumentType: GovernmentDocumentTypeShorted[selectedDocumentType?.type as keyof typeof GovernmentDocumentTypeShorted] || '',
|
|
320
|
+
code: countryData?.code || '',
|
|
321
|
+
currentSide: currentSide,
|
|
322
|
+
templatePath: templatePath,
|
|
323
|
+
mrzType: mrzType,
|
|
324
|
+
};
|
|
325
|
+
console.log("frontVerification params", verificationParams);
|
|
326
|
+
console.log("About to call frontVerification function");
|
|
327
|
+
|
|
328
|
+
const promise = frontVerification(verificationParams, env);
|
|
329
|
+
console.log("frontVerification promise created", promise);
|
|
330
|
+
|
|
331
|
+
promise.then((res: any) => {
|
|
332
|
+
logger.log("front verification result", truncateFields(res));
|
|
333
|
+
const bbox = res?.bbox || templateBbox;
|
|
334
|
+
|
|
335
|
+
setSilentCaptureResult((prev) => ({
|
|
336
|
+
...prev,
|
|
337
|
+
path: result.path,
|
|
338
|
+
templatePath: templatePath,
|
|
339
|
+
bbox: bbox,
|
|
340
|
+
success: true,
|
|
341
|
+
mrz: res?.mrz ? JSON.stringify(res.mrz) : "",
|
|
342
|
+
isAnalyzing: false,
|
|
343
|
+
country: countryData?.code,
|
|
344
|
+
documentType: selectedDocumentType.type,
|
|
345
|
+
}));
|
|
346
|
+
|
|
347
|
+
// Stocker le bbox pour ce côté
|
|
348
|
+
if (bbox && typeof bbox === 'object') {
|
|
349
|
+
setBboxBySide((prev) => ({ ...prev, [currentSide]: bbox }));
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
}).catch((e: any) => {
|
|
353
|
+
|
|
354
|
+
}).catch((e: any) => {
|
|
355
|
+
console.log("error front verification", e);
|
|
356
|
+
logger.log("error front verification", truncateFields(e));
|
|
357
|
+
const isCardNotFullyInFrame =
|
|
358
|
+
e?.message === 'CARD_NOT_FULLY_IN_FRAME' ||
|
|
359
|
+
e?.message?.includes('entirement') ||
|
|
360
|
+
e?.message?.includes('fully in frame');
|
|
361
|
+
const errorMessage = isCardNotFullyInFrame
|
|
362
|
+
? t('kyc.idCardCapture.cardNotFullyInFrame')
|
|
363
|
+
: (e?.message || 'Erreur de détection du MRZ');
|
|
364
|
+
setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, templatePath: templatePath, success: false, error: errorMessage }));
|
|
365
|
+
});
|
|
366
|
+
} catch (error: any) {
|
|
367
|
+
console.log("Error setting up frontVerification call", error);
|
|
368
|
+
setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, success: false, error: error?.message || 'Erreur lors de la configuration de la vérification' }));
|
|
369
|
+
}
|
|
370
|
+
} else {
|
|
371
|
+
const backRegionMappings = getCurrentSideVerification(currentSide);
|
|
372
|
+
logger.log("Calling backVerification", { templatePath, selectedDocumentType: selectedDocumentType.type, backRegionMappings });
|
|
373
|
+
|
|
374
|
+
backVerification({
|
|
375
|
+
path: result.path,
|
|
376
|
+
regionMapping: {
|
|
377
|
+
authMethod: backRegionMappings.authMethod,
|
|
378
|
+
mrzTypes: backRegionMappings.mrzTypes,
|
|
379
|
+
},
|
|
380
|
+
selectedDocumentType: GovernmentDocumentTypeShorted[selectedDocumentType.type as keyof typeof GovernmentDocumentTypeShorted] || '',
|
|
381
|
+
code: countryData?.code || '',
|
|
382
|
+
currentSide: currentSide,
|
|
383
|
+
templatePath: templatePath,
|
|
384
|
+
mrzType: getCorrespondingMrzType(templatePath, backRegionMappings.regionMapping, backRegionMappings.key || '') || '',
|
|
385
|
+
}, env).then((res: any) => {
|
|
386
|
+
logger.log("back verification result", truncateFields(res));
|
|
387
|
+
const bbox = res?.bbox || templateBbox;
|
|
388
|
+
|
|
389
|
+
setSilentCaptureResult((prev) => ({
|
|
390
|
+
...prev,
|
|
391
|
+
path: result.path,
|
|
392
|
+
bbox: bbox,
|
|
393
|
+
success: true,
|
|
394
|
+
mrz: res?.mrz ? JSON.stringify(res.mrz) : "",
|
|
395
|
+
isAnalyzing: false,
|
|
396
|
+
country: countryData?.code,
|
|
397
|
+
documentType: selectedDocumentType.type,
|
|
398
|
+
}));
|
|
399
|
+
|
|
400
|
+
// Stocker le bbox pour ce côté
|
|
401
|
+
if (bbox && typeof bbox === 'object') {
|
|
402
|
+
setBboxBySide((prev) => ({ ...prev, [currentSide]: bbox }));
|
|
403
|
+
}
|
|
404
|
+
}).catch((e: any) => {
|
|
405
|
+
logger.log("error back verification", truncateFields(e));
|
|
406
|
+
const isCardNotFullyInFrame =
|
|
407
|
+
e?.message === 'CARD_NOT_FULLY_IN_FRAME' ||
|
|
408
|
+
e?.message?.includes('entirement') ||
|
|
409
|
+
e?.message?.includes('fully in frame');
|
|
410
|
+
const errorMessage = isCardNotFullyInFrame
|
|
411
|
+
? t('kyc.idCardCapture.cardNotFullyInFrame')
|
|
412
|
+
: (e?.message || 'Erreur de détection du MRZ');
|
|
413
|
+
setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, templatePath: templatePath, success: false, error: errorMessage }));
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
const handleCapture = async (result: { success: boolean; path?: string; error?: string }) => {
|
|
421
|
+
if (silentCaptureResult.path) {
|
|
422
|
+
let imagePathForUpload = silentCaptureResult.path;
|
|
423
|
+
if (silentCaptureResult.bbox) {
|
|
424
|
+
try {
|
|
425
|
+
imagePathForUpload = await cropImageWithBBoxWithTolerance(silentCaptureResult.path, silentCaptureResult.bbox, 0.05);
|
|
426
|
+
} catch (error) {
|
|
427
|
+
imagePathForUpload = silentCaptureResult.path;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
const base64 = await pathToBase64(imagePathForUpload);
|
|
432
|
+
|
|
433
|
+
// ✅ FIX: Use 'imagePathForUpload' (the cropped image) for the local display directory!
|
|
434
|
+
const newImages = {
|
|
435
|
+
...capturedImages,
|
|
436
|
+
[currentSide]: {
|
|
437
|
+
dir: imagePathForUpload, // <--- CHANGED THIS LINE
|
|
438
|
+
file: base64,
|
|
439
|
+
mrz: silentCaptureResult.mrz || "",
|
|
440
|
+
templatePath: silentCaptureResult.templatePath
|
|
441
|
+
}
|
|
442
|
+
};
|
|
443
|
+
|
|
444
|
+
setCapturedImages(newImages);
|
|
445
|
+
|
|
446
|
+
if (silentCaptureResult.country && silentCaptureResult.documentType) {
|
|
447
|
+
onValueChange({
|
|
448
|
+
...newImages,
|
|
449
|
+
country: silentCaptureResult.country,
|
|
450
|
+
documentType: GovernmentDocumentTypeBackend[silentCaptureResult.documentType as keyof typeof GovernmentDocumentTypeBackend] || '',
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
setShowCamera(false);
|
|
454
|
+
actions.showCustomStepper(true);
|
|
455
|
+
} else {
|
|
456
|
+
showAlert('Erreur', result.error || 'Impossible de prendre la photo');
|
|
457
|
+
}
|
|
458
|
+
};
|
|
459
|
+
|
|
460
|
+
const handleError = (event: { message: string }) => {
|
|
461
|
+
showAlert('Erreur', event.message);
|
|
462
|
+
setShowCamera(false);
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
useEffect(() => {
|
|
466
|
+
actions.showCustomStepper(!showCamera);
|
|
467
|
+
}, [showCamera]);
|
|
468
|
+
|
|
469
|
+
// Cross-device polling logic
|
|
470
|
+
useEffect(() => {
|
|
471
|
+
if (!showQRModal || !state.session.session_id) return;
|
|
472
|
+
|
|
473
|
+
const pollInterval = setInterval(async () => {
|
|
474
|
+
try {
|
|
475
|
+
const result = await kycService.getVerificationResult(state.session.session_id);
|
|
476
|
+
const sessionData = result[state.session.session_id]?.data;
|
|
477
|
+
|
|
478
|
+
if (sessionData) {
|
|
479
|
+
// Check if verification is completed or if we have ID card data
|
|
480
|
+
// Since the requirement is "verification restarts", we might look for overall completion
|
|
481
|
+
// or we could check if user_data is populated.
|
|
482
|
+
// For now, let's assume if status is not PENDING/INITIALIZED it might be done.
|
|
483
|
+
// Or simplier: if the mobile flow completes, the session status updates.
|
|
484
|
+
logger.log('Polling result:', truncateFields(sessionData));
|
|
485
|
+
|
|
486
|
+
if (sessionData.verification_status === 'completed' || sessionData.verification_status === 'approved' || sessionData.verification_status === 'review') {
|
|
487
|
+
clearInterval(pollInterval);
|
|
488
|
+
setShowQRModal(false);
|
|
489
|
+
actions.submitVerification(); // Or handleComplete
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
} catch (error) {
|
|
493
|
+
console.error('Polling error:', error);
|
|
494
|
+
}
|
|
495
|
+
}, 5000);
|
|
496
|
+
|
|
497
|
+
return () => clearInterval(pollInterval);
|
|
498
|
+
}, [showQRModal, state.session.session_id, actions]);
|
|
499
|
+
|
|
500
|
+
const getQrCodeUrl = (): string => {
|
|
501
|
+
// Only available on web platform
|
|
502
|
+
if (Platform.OS !== 'web') return '';
|
|
503
|
+
if (typeof window === 'undefined' || !window.location || !window.location.href) return '';
|
|
504
|
+
|
|
505
|
+
try {
|
|
506
|
+
const currentUrl = new URL(window.location.href);
|
|
507
|
+
if (!currentUrl.searchParams.has('kyc_id') && state.session.session_id) {
|
|
508
|
+
currentUrl.searchParams.set('kyc_id', state.session.session_id);
|
|
509
|
+
}
|
|
510
|
+
currentUrl.searchParams.set('component_index', String(state.currentComponentIndex));
|
|
511
|
+
if (countrySelectionData?.code) {
|
|
512
|
+
currentUrl.searchParams.set('country', countrySelectionData.code);
|
|
513
|
+
if (countrySelectionData.documentType) currentUrl.searchParams.set('document_type', countrySelectionData.documentType);
|
|
514
|
+
if (countrySelectionData.region) currentUrl.searchParams.set('region', countrySelectionData.region);
|
|
515
|
+
}
|
|
516
|
+
return `https://api.qrserver.com/v1/create-qr-code/?size=250x250&data=${encodeURIComponent(currentUrl.toString())}`;
|
|
517
|
+
} catch (error) {
|
|
518
|
+
console.warn('Error generating QR code URL:', error);
|
|
519
|
+
return '';
|
|
520
|
+
}
|
|
521
|
+
};
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
// En reprise sur un autre appareil: afficher un chargement tant que les données de session ne sont pas restaurées
|
|
530
|
+
const isResumingSession = Boolean(state.session.session_id && state.currentComponentIndex > 0);
|
|
531
|
+
const sessionDataRestored = state.session.sessionDataRestored !== false;
|
|
532
|
+
if (isResumingSession && !sessionDataRestored && (!countrySelectionData || !selectedDocumentType)) {
|
|
533
|
+
return (
|
|
534
|
+
<View style={styles.root}>
|
|
535
|
+
<View style={[styles.container, { justifyContent: 'center', alignItems: 'center' }]}>
|
|
536
|
+
<ActivityIndicator size="large" color="#2DBD60" />
|
|
537
|
+
<Text style={[styles.description, { marginTop: 16 }]}>
|
|
538
|
+
{state.currentLanguage === 'en' ? 'Loading your session...' : 'Chargement de votre session...'}
|
|
539
|
+
</Text>
|
|
540
|
+
</View>
|
|
541
|
+
</View>
|
|
542
|
+
);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
// Vérifier si les données sont disponibles, sinon afficher un message d'erreur
|
|
546
|
+
if (!countrySelectionData || !selectedDocumentType) {
|
|
547
|
+
return (
|
|
548
|
+
<View style={styles.root}>
|
|
549
|
+
<View style={styles.container}>
|
|
550
|
+
<Text style={styles.title}>{getLocalizedText(component.labels)}</Text>
|
|
551
|
+
<Text style={styles.description}>
|
|
552
|
+
{state.currentLanguage === "en"
|
|
553
|
+
? "Please complete the country and document selection first."
|
|
554
|
+
: "Veuillez d'abord compléter la sélection du pays et du document."}
|
|
555
|
+
</Text>
|
|
556
|
+
{error && (
|
|
557
|
+
<Text style={styles.errorText}>{error}</Text>
|
|
558
|
+
)}
|
|
559
|
+
</View>
|
|
560
|
+
</View>
|
|
561
|
+
);
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
if (showCamera) {
|
|
567
|
+
return (
|
|
568
|
+
<View style={styles.cameraContainer}>
|
|
569
|
+
<EnhancedCameraView
|
|
570
|
+
showCamera={true}
|
|
571
|
+
cameraType={cameraConfig.cameraType}
|
|
572
|
+
style={styles.camera}
|
|
573
|
+
onCapture={handleCapture}
|
|
574
|
+
onError={handleError}
|
|
575
|
+
onClose={() => setShowCamera(false)}
|
|
576
|
+
quality="high"
|
|
577
|
+
showCaptureButton={true}
|
|
578
|
+
showSwitchCamera={true}
|
|
579
|
+
onSilentCapture={handleSilentCapture}
|
|
580
|
+
silentCaptureResult={silentCaptureResult}
|
|
581
|
+
captureStabilizationDelayMs={3000}
|
|
582
|
+
enableFlash={cameraConfig.flashMode === 'auto' || cameraConfig.flashMode === 'on'}
|
|
583
|
+
overlayComponent={
|
|
584
|
+
<IdCardOverlay
|
|
585
|
+
xMin={cameraConfig.overlay.bbox.xMin}
|
|
586
|
+
yMin={cameraConfig.overlay.bbox.yMin}
|
|
587
|
+
xMax={cameraConfig.overlay.bbox.xMax}
|
|
588
|
+
yMax={cameraConfig.overlay.bbox.yMax}
|
|
589
|
+
instructions={cameraConfig.overlay.guideText}
|
|
590
|
+
cornerOpacity={cameraConfig.overlay.bbox.cornerRadius || 0 as number}
|
|
591
|
+
isSuccess={silentCaptureResult.success}
|
|
592
|
+
language={state.currentLanguage}
|
|
593
|
+
stepperProps={{
|
|
594
|
+
back: () => {
|
|
595
|
+
if (currentSide === 'back') {
|
|
596
|
+
setCurrentSide('front');
|
|
597
|
+
setShowCamera(false);
|
|
598
|
+
// Si une image front existe, on la restaure pour l'afficher
|
|
599
|
+
if (capturedImages['front']?.dir) {
|
|
600
|
+
// Restaurer l'état de capture du front pour afficher l'image
|
|
601
|
+
const frontImage = capturedImages['front'];
|
|
602
|
+
const frontBbox = bboxBySide['front'];
|
|
603
|
+
setSilentCaptureResult((prev) => ({
|
|
604
|
+
path: frontImage.dir,
|
|
605
|
+
success: true,
|
|
606
|
+
isAnalyzing: false,
|
|
607
|
+
error: '',
|
|
608
|
+
mrz: frontImage.mrz || '',
|
|
609
|
+
templatePath: frontImage.templatePath || '',
|
|
610
|
+
country: silentCaptureResult.country,
|
|
611
|
+
documentType: silentCaptureResult.documentType,
|
|
612
|
+
bbox: frontBbox // Restaurer le bbox pour recalculer le cropImageUri
|
|
613
|
+
}));
|
|
614
|
+
} else {
|
|
615
|
+
// Pas d'image front, on réinitialise
|
|
616
|
+
setSilentCaptureResult((prev) => ({ path: '', success: false, isAnalyzing: false, error: '', templatePath: '' }));
|
|
617
|
+
}
|
|
618
|
+
} else {
|
|
619
|
+
// Retour au composant précédent (country_selection)
|
|
620
|
+
actions.previousComponent();
|
|
621
|
+
}
|
|
622
|
+
},
|
|
623
|
+
selectedDocumentType: selectedDocumentType ? (locale === 'en' ? getDocumentTypeInfo(selectedDocumentType.type).name.en : getDocumentTypeInfo(selectedDocumentType.type).name.fr) : '',
|
|
624
|
+
step: state.currentComponentIndex + 1,
|
|
625
|
+
totalSteps: state.template.components.length,
|
|
626
|
+
side: currentSide,
|
|
627
|
+
}}
|
|
628
|
+
/>
|
|
629
|
+
}
|
|
630
|
+
/>
|
|
631
|
+
|
|
632
|
+
{silentCaptureResult.error ? (
|
|
633
|
+
<View style={styles.floatingErrorBanner}>
|
|
634
|
+
<Text style={styles.floatingErrorText}>
|
|
635
|
+
{silentCaptureResult.error}
|
|
636
|
+
</Text>
|
|
637
|
+
</View>
|
|
638
|
+
) : null}
|
|
639
|
+
|
|
640
|
+
</View>
|
|
641
|
+
);
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+
return (
|
|
646
|
+
<View style={styles.root}>
|
|
647
|
+
<View style={styles.previewContainer}>
|
|
648
|
+
<ScrollView style={styles.previewItemContainer} showsVerticalScrollIndicator={false}>
|
|
649
|
+
<View key={currentSide} style={styles.sideContainer}>
|
|
650
|
+
<Text style={styles.sideTitle}>
|
|
651
|
+
{t('kyc.idCardCapture.captureTitle', { side: currentSide === 'front' ? locale === 'en' ? 'Front' : 'Recto' : locale === 'en' ? 'Back' : 'Verso' })}
|
|
652
|
+
</Text>
|
|
653
|
+
<Text style={{ fontSize: 14, color: '#666', textAlign: 'center', marginBottom: 16, lineHeight: 22 }}>
|
|
654
|
+
{getLocalizedText(component.instructions)}
|
|
655
|
+
</Text>
|
|
656
|
+
|
|
657
|
+
<View style={{ alignItems: 'center', justifyContent: 'center', flexDirection: "column", gap: 16 }}>
|
|
658
|
+
{silentCaptureResult?.error === 'TOO_FAR_AWAY' && (
|
|
659
|
+
<View style={{
|
|
660
|
+
backgroundColor: '#FF9500',
|
|
661
|
+
padding: 12,
|
|
662
|
+
borderRadius: 8,
|
|
663
|
+
width: '100%',
|
|
664
|
+
shadowColor: '#000',
|
|
665
|
+
shadowOffset: { width: 0, height: 2 },
|
|
666
|
+
shadowOpacity: 0.2,
|
|
667
|
+
shadowRadius: 4,
|
|
668
|
+
elevation: 4
|
|
669
|
+
}}>
|
|
670
|
+
<Text style={{ color: 'white', fontWeight: 'bold', textAlign: 'center', fontSize: 16 }}>
|
|
671
|
+
{state.currentLanguage === "en"
|
|
672
|
+
? "Move the document closer to the camera."
|
|
673
|
+
: "Veuillez rapprocher le document de la caméra."}
|
|
674
|
+
</Text>
|
|
675
|
+
</View>
|
|
676
|
+
)}
|
|
677
|
+
|
|
678
|
+
<View
|
|
679
|
+
style={{
|
|
680
|
+
width: '100%',
|
|
681
|
+
height: 200,
|
|
682
|
+
borderRadius: 12,
|
|
683
|
+
padding: 1,
|
|
684
|
+
overflow: 'hidden',
|
|
685
|
+
shadowColor: '#000',
|
|
686
|
+
shadowOffset: { width: 0, height: 4 },
|
|
687
|
+
shadowOpacity: 0.18,
|
|
688
|
+
shadowRadius: 8,
|
|
689
|
+
elevation: 8,
|
|
690
|
+
backgroundColor: '#000',
|
|
691
|
+
}}
|
|
692
|
+
>
|
|
693
|
+
{capturedImages[currentSide]?.dir ? (
|
|
694
|
+
<Image
|
|
695
|
+
source={{ uri: capturedImages[currentSide].dir }}
|
|
696
|
+
style={{
|
|
697
|
+
width: '100%',
|
|
698
|
+
height: '100%',
|
|
699
|
+
borderRadius: 12,
|
|
700
|
+
resizeMode: 'contain',
|
|
701
|
+
}}
|
|
702
|
+
/>
|
|
703
|
+
) : silentCaptureResult.path ? (
|
|
704
|
+
<Image
|
|
705
|
+
source={{ uri: silentCaptureResult.path }}
|
|
706
|
+
style={{
|
|
707
|
+
width: '100%',
|
|
708
|
+
height: '100%',
|
|
709
|
+
borderRadius: 12,
|
|
710
|
+
resizeMode: 'contain',
|
|
711
|
+
}}
|
|
712
|
+
/>
|
|
713
|
+
) : null}
|
|
714
|
+
</View>
|
|
715
|
+
{/* Capture button si aucune image n'a été capturée */}
|
|
716
|
+
{!capturedImages[currentSide]?.dir && (
|
|
717
|
+
<Button
|
|
718
|
+
title={state.currentLanguage === "en" ? "Take Photo" : "Prendre une photo"}
|
|
719
|
+
onPress={() => {
|
|
720
|
+
setShowCamera(true);
|
|
721
|
+
actions.showCustomStepper(false);
|
|
722
|
+
}}
|
|
723
|
+
variant="primary"
|
|
724
|
+
size="large"
|
|
725
|
+
fullWidth
|
|
726
|
+
/>
|
|
727
|
+
)}
|
|
728
|
+
{/* retake button si une image a été capturée */}
|
|
729
|
+
{capturedImages[currentSide]?.dir && (
|
|
730
|
+
<>
|
|
731
|
+
<Button title={t('kyc.idCardCapture.retakeButton')} onPress={() => {
|
|
732
|
+
retakePicture(currentSide);
|
|
733
|
+
}}
|
|
734
|
+
variant="outline"
|
|
735
|
+
size="medium"
|
|
736
|
+
fullWidth
|
|
737
|
+
/>
|
|
738
|
+
<Button title={t('common.next')} onPress={() => {
|
|
739
|
+
if (!selectedDocumentType) {
|
|
740
|
+
showAlert('Error', 'Document type not selected');
|
|
741
|
+
return;
|
|
742
|
+
}
|
|
743
|
+
if (currentSide === 'back' || selectedDocumentType.type === 'passport') {
|
|
744
|
+
actions.nextComponent();
|
|
745
|
+
return;
|
|
746
|
+
} else {
|
|
747
|
+
setShowCamera(true);
|
|
748
|
+
setCurrentSide('back');
|
|
749
|
+
setSilentCaptureResult((prev) => ({ path: '', success: false, isAnalyzing: false, error: '', mrz: '', templatePath: '' }));
|
|
750
|
+
setCropImageUri('');
|
|
751
|
+
}
|
|
752
|
+
}}
|
|
753
|
+
variant="primary"
|
|
754
|
+
size="large"
|
|
755
|
+
fullWidth
|
|
756
|
+
/>
|
|
757
|
+
</>
|
|
758
|
+
)}
|
|
759
|
+
</View>
|
|
760
|
+
</View>
|
|
761
|
+
</ScrollView>
|
|
762
|
+
|
|
763
|
+
|
|
764
|
+
|
|
765
|
+
{error && (
|
|
766
|
+
<Text style={styles.errorText}>{error}</Text>
|
|
767
|
+
)}
|
|
768
|
+
|
|
769
|
+
{/* Cross-Device / Continue on Phone Button (Web Only) */}
|
|
770
|
+
{Platform.OS === 'web' && !isMobileWeb() && !capturedImages[currentSide]?.dir && (
|
|
771
|
+
<Button title={t('kyc.idCardCapture.continueOnPhone')} onPress={() => { setShowQRModal(true) }} />
|
|
772
|
+
)}
|
|
773
|
+
|
|
774
|
+
{/* QR Code Modal - Web Only */}
|
|
775
|
+
{Platform.OS === 'web' && (
|
|
776
|
+
<Modal
|
|
777
|
+
visible={showQRModal}
|
|
778
|
+
transparent={true}
|
|
779
|
+
animationType="fade"
|
|
780
|
+
onRequestClose={() => setShowQRModal(false)}
|
|
781
|
+
>
|
|
782
|
+
<View style={styles.modalOverlay}>
|
|
783
|
+
<View style={styles.modalContent}>
|
|
784
|
+
<Text style={styles.modalTitle}>
|
|
785
|
+
{t('kyc.idCardCapture.continueOnMobile')}
|
|
786
|
+
</Text>
|
|
787
|
+
<Text style={styles.modalDescription}>
|
|
788
|
+
{t('kyc.idCardCapture.scanQrCode')}
|
|
789
|
+
</Text>
|
|
790
|
+
|
|
791
|
+
{showQRModal && getQrCodeUrl() ? (
|
|
792
|
+
<Image
|
|
793
|
+
source={{ uri: getQrCodeUrl() }}
|
|
794
|
+
style={styles.qrCodeImage}
|
|
795
|
+
/>
|
|
796
|
+
) : null}
|
|
797
|
+
|
|
798
|
+
<TouchableOpacity
|
|
799
|
+
style={styles.closeButton}
|
|
800
|
+
onPress={() => setShowQRModal(false)}
|
|
801
|
+
>
|
|
802
|
+
<Text style={styles.closeButtonText}>
|
|
803
|
+
{t('common.close')}
|
|
804
|
+
</Text>
|
|
805
|
+
</TouchableOpacity>
|
|
806
|
+
</View>
|
|
807
|
+
</View>
|
|
808
|
+
</Modal>
|
|
809
|
+
)}
|
|
810
|
+
|
|
811
|
+
</View>
|
|
812
|
+
</View>
|
|
813
|
+
);
|
|
814
|
+
};
|
|
815
|
+
|
|
816
|
+
const styles = StyleSheet.create({
|
|
817
|
+
root: {
|
|
818
|
+
flex: 1,
|
|
819
|
+
maxWidth: 760,
|
|
820
|
+
width: '100%',
|
|
821
|
+
},
|
|
822
|
+
container: {
|
|
823
|
+
backgroundColor: 'white',
|
|
824
|
+
margin: 10,
|
|
825
|
+
borderRadius: 10,
|
|
826
|
+
paddingVertical: 16,
|
|
827
|
+
paddingHorizontal: 16,
|
|
828
|
+
// shadow
|
|
829
|
+
shadowColor: '#000',
|
|
830
|
+
shadowOffset: { width: 0, height: 2 },
|
|
831
|
+
shadowOpacity: 0.35,
|
|
832
|
+
shadowRadius: 4.84,
|
|
833
|
+
elevation: 10,
|
|
834
|
+
// padding: 16,
|
|
835
|
+
},
|
|
836
|
+
cameraContainer: {
|
|
837
|
+
flex: 1,
|
|
838
|
+
width: '100%',
|
|
839
|
+
height: '100%',
|
|
840
|
+
},
|
|
841
|
+
previewContainer: {
|
|
842
|
+
width: '95%',
|
|
843
|
+
backgroundColor: 'white',
|
|
844
|
+
margin: 10,
|
|
845
|
+
borderRadius: 10,
|
|
846
|
+
paddingVertical: 16,
|
|
847
|
+
paddingHorizontal: 16,
|
|
848
|
+
},
|
|
849
|
+
previewItemContainer: {
|
|
850
|
+
|
|
851
|
+
// marginBottom: 24,
|
|
852
|
+
},
|
|
853
|
+
title: {
|
|
854
|
+
fontSize: 24,
|
|
855
|
+
fontWeight: 'bold',
|
|
856
|
+
color: '#333',
|
|
857
|
+
marginBottom: 8,
|
|
858
|
+
textAlign: 'center',
|
|
859
|
+
},
|
|
860
|
+
subtitle: {
|
|
861
|
+
fontSize: 18,
|
|
862
|
+
color: '#666',
|
|
863
|
+
textAlign: 'center',
|
|
864
|
+
marginBottom: 16,
|
|
865
|
+
},
|
|
866
|
+
sideInfo: {
|
|
867
|
+
fontSize: 14,
|
|
868
|
+
color: '#888',
|
|
869
|
+
textAlign: 'center',
|
|
870
|
+
marginBottom: 16,
|
|
871
|
+
fontStyle: 'italic',
|
|
872
|
+
},
|
|
873
|
+
description: {
|
|
874
|
+
fontSize: 16,
|
|
875
|
+
color: '#666',
|
|
876
|
+
textAlign: 'center',
|
|
877
|
+
marginBottom: 24,
|
|
878
|
+
lineHeight: 22,
|
|
879
|
+
},
|
|
880
|
+
sidesContainer: {
|
|
881
|
+
flex: 1,
|
|
882
|
+
},
|
|
883
|
+
sideContainer: {
|
|
884
|
+
marginBottom: 24,
|
|
885
|
+
},
|
|
886
|
+
sideTitle: {
|
|
887
|
+
fontSize: 25,
|
|
888
|
+
fontWeight: 'bold',
|
|
889
|
+
color: '#000',
|
|
890
|
+
marginBottom: 12,
|
|
891
|
+
textAlign: 'center',
|
|
892
|
+
},
|
|
893
|
+
captureButton: {
|
|
894
|
+
borderWidth: 2,
|
|
895
|
+
borderColor: '#2DBD60',
|
|
896
|
+
borderStyle: 'dashed',
|
|
897
|
+
borderRadius: 12,
|
|
898
|
+
padding: 32,
|
|
899
|
+
alignItems: 'center',
|
|
900
|
+
backgroundColor: '#f0f9f0',
|
|
901
|
+
},
|
|
902
|
+
captureIcon: {
|
|
903
|
+
fontSize: 48,
|
|
904
|
+
marginBottom: 16,
|
|
905
|
+
},
|
|
906
|
+
captureText: {
|
|
907
|
+
fontSize: 16,
|
|
908
|
+
color: '#2DBD60',
|
|
909
|
+
fontWeight: '600',
|
|
910
|
+
},
|
|
911
|
+
capturedImageContainer: {
|
|
912
|
+
position: 'relative',
|
|
913
|
+
},
|
|
914
|
+
capturedImage: {
|
|
915
|
+
width: '100%',
|
|
916
|
+
height: 200,
|
|
917
|
+
borderRadius: 12,
|
|
918
|
+
resizeMode: 'contain',
|
|
919
|
+
backgroundColor: '#f0f0f0',
|
|
920
|
+
},
|
|
921
|
+
retakeButton: {
|
|
922
|
+
position: 'absolute',
|
|
923
|
+
top: 8,
|
|
924
|
+
right: 8,
|
|
925
|
+
backgroundColor: 'rgba(0, 0, 0, 0.7)',
|
|
926
|
+
paddingHorizontal: 12,
|
|
927
|
+
paddingVertical: 6,
|
|
928
|
+
borderRadius: 6,
|
|
929
|
+
},
|
|
930
|
+
retakeButtonText: {
|
|
931
|
+
color: 'white',
|
|
932
|
+
fontSize: 12,
|
|
933
|
+
fontWeight: '600',
|
|
934
|
+
},
|
|
935
|
+
camera: {
|
|
936
|
+
flex: 1,
|
|
937
|
+
},
|
|
938
|
+
completionContainer: {
|
|
939
|
+
marginTop: 24,
|
|
940
|
+
alignItems: 'center',
|
|
941
|
+
},
|
|
942
|
+
completionText: {
|
|
943
|
+
fontSize: 16,
|
|
944
|
+
color: '#2DBD60',
|
|
945
|
+
fontWeight: '600',
|
|
946
|
+
marginBottom: 16,
|
|
947
|
+
},
|
|
948
|
+
primaryButton: {
|
|
949
|
+
paddingHorizontal: 32,
|
|
950
|
+
paddingVertical: 16,
|
|
951
|
+
borderRadius: 8,
|
|
952
|
+
// minWidth: 120,
|
|
953
|
+
alignItems: 'center',
|
|
954
|
+
backgroundColor: '#2DBD60',
|
|
955
|
+
},
|
|
956
|
+
primaryButtonText: {
|
|
957
|
+
color: 'white',
|
|
958
|
+
fontWeight: '600',
|
|
959
|
+
fontSize: 16,
|
|
960
|
+
},
|
|
961
|
+
errorText: {
|
|
962
|
+
color: '#dc2626',
|
|
963
|
+
fontSize: 14,
|
|
964
|
+
marginTop: 8,
|
|
965
|
+
textAlign: 'center',
|
|
966
|
+
},
|
|
967
|
+
crossDeviceButton: {
|
|
968
|
+
marginTop: 16,
|
|
969
|
+
padding: 12,
|
|
970
|
+
alignItems: 'center',
|
|
971
|
+
borderWidth: 1,
|
|
972
|
+
borderColor: '#2DBD60',
|
|
973
|
+
borderRadius: 8,
|
|
974
|
+
backgroundColor: '#f0f9f0',
|
|
975
|
+
},
|
|
976
|
+
crossDeviceText: {
|
|
977
|
+
color: '#2DBD60',
|
|
978
|
+
fontSize: 16,
|
|
979
|
+
fontWeight: '600',
|
|
980
|
+
},
|
|
981
|
+
modalOverlay: {
|
|
982
|
+
flex: 1,
|
|
983
|
+
backgroundColor: 'rgba(0,0,0,0.5)',
|
|
984
|
+
justifyContent: 'center',
|
|
985
|
+
alignItems: 'center',
|
|
986
|
+
},
|
|
987
|
+
modalContent: {
|
|
988
|
+
backgroundColor: 'white',
|
|
989
|
+
borderRadius: 16,
|
|
990
|
+
padding: 24,
|
|
991
|
+
alignItems: 'center',
|
|
992
|
+
width: '90%',
|
|
993
|
+
maxWidth: 340,
|
|
994
|
+
shadowColor: '#000',
|
|
995
|
+
shadowOffset: { width: 0, height: 2 },
|
|
996
|
+
shadowOpacity: 0.25,
|
|
997
|
+
shadowRadius: 4,
|
|
998
|
+
elevation: 5,
|
|
999
|
+
},
|
|
1000
|
+
modalTitle: {
|
|
1001
|
+
fontSize: 20,
|
|
1002
|
+
fontWeight: 'bold',
|
|
1003
|
+
marginBottom: 12,
|
|
1004
|
+
color: '#333',
|
|
1005
|
+
},
|
|
1006
|
+
modalDescription: {
|
|
1007
|
+
fontSize: 16,
|
|
1008
|
+
color: '#666',
|
|
1009
|
+
textAlign: 'center',
|
|
1010
|
+
marginBottom: 20,
|
|
1011
|
+
lineHeight: 22,
|
|
1012
|
+
},
|
|
1013
|
+
qrCodeImage: {
|
|
1014
|
+
width: 200,
|
|
1015
|
+
height: 200,
|
|
1016
|
+
marginBottom: 20,
|
|
1017
|
+
},
|
|
1018
|
+
closeButton: {
|
|
1019
|
+
paddingVertical: 10,
|
|
1020
|
+
paddingHorizontal: 20,
|
|
1021
|
+
backgroundColor: '#f5f5f5',
|
|
1022
|
+
borderRadius: 8,
|
|
1023
|
+
},
|
|
1024
|
+
closeButtonText: {
|
|
1025
|
+
fontSize: 16,
|
|
1026
|
+
color: '#666',
|
|
1027
|
+
fontWeight: '600',
|
|
1028
|
+
},
|
|
1029
|
+
floatingErrorBanner: {
|
|
1030
|
+
position: 'absolute',
|
|
1031
|
+
top: 60, // Pushes it down slightly from the very top of the screen
|
|
1032
|
+
left: '10%',
|
|
1033
|
+
right: '10%',
|
|
1034
|
+
backgroundColor: 'rgba(220, 38, 38, 0.95)', // Bright red
|
|
1035
|
+
paddingVertical: 12,
|
|
1036
|
+
paddingHorizontal: 16,
|
|
1037
|
+
borderRadius: 8,
|
|
1038
|
+
alignItems: 'center',
|
|
1039
|
+
justifyContent: 'center',
|
|
1040
|
+
shadowColor: '#000',
|
|
1041
|
+
shadowOffset: { width: 0, height: 4 },
|
|
1042
|
+
shadowOpacity: 0.3,
|
|
1043
|
+
shadowRadius: 5,
|
|
1044
|
+
elevation: 8,
|
|
1045
|
+
zIndex: 100,
|
|
1046
|
+
},
|
|
1047
|
+
floatingErrorText: {
|
|
1048
|
+
color: 'white',
|
|
1049
|
+
fontSize: 14,
|
|
1050
|
+
fontWeight: '700',
|
|
1051
|
+
textAlign: 'center',
|
|
1052
|
+
},
|
|
1053
|
+
});
|