@finos_sdk/sdk-ekyc 0.0.31 โ 0.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/SDKeKYC/finos/sdk/ekyc/c06/maven-metadata-local.xml +1 -1
- package/android/SDKeKYC/finos/sdk/ekyc/ekyc/maven-metadata-local.xml +1 -1
- package/android/SDKeKYC/finos/sdk/ekyc/ekycui/1.2.0/ekycui-1.2.0-javadoc.jar +0 -0
- package/android/SDKeKYC/finos/sdk/ekyc/ekycui/1.2.0/ekycui-1.2.0-sources.jar +0 -0
- package/android/SDKeKYC/finos/sdk/ekyc/ekycui/1.2.0/ekycui-1.2.0.aar +0 -0
- package/android/SDKeKYC/finos/sdk/ekyc/ekycui/1.2.0/ekycui-1.2.0.module +151 -0
- package/android/SDKeKYC/finos/sdk/ekyc/ekycui/1.2.0/ekycui-1.2.0.pom +43 -0
- package/android/SDKeKYC/finos/sdk/ekyc/ekycui/maven-metadata-local.xml +13 -0
- package/android/SDKeKYC/finos/sdk/ekyc/faceservice/maven-metadata-local.xml +1 -1
- package/android/SDKeKYC/finos/sdk/ekyc/liveness/maven-metadata-local.xml +1 -1
- package/android/SDKeKYC/finos/sdk/ekyc/nfc/maven-metadata-local.xml +1 -1
- package/android/SDKeKYC/finos/sdk/ekyc/ocr/maven-metadata-local.xml +1 -1
- package/android/SDKeKYC/finos/sdk/ekyc/qrcode/maven-metadata-local.xml +1 -1
- package/android/SDKeKYC/finos/sdk/ekyc/sdkcore/maven-metadata-local.xml +1 -1
- package/android/SDKeKYC/finos/sdk/ekyc/sdkcorecamera/maven-metadata-local.xml +1 -1
- package/android/SDKeKYC/finos/sdk/ekyc/sdkui/1.2.0/sdkui-1.2.0-javadoc.jar +0 -0
- package/android/SDKeKYC/finos/sdk/ekyc/sdkui/1.2.0/sdkui-1.2.0-sources.jar +0 -0
- package/android/SDKeKYC/finos/sdk/ekyc/sdkui/1.2.0/sdkui-1.2.0.aar +0 -0
- package/android/SDKeKYC/finos/sdk/ekyc/sdkui/1.2.0/sdkui-1.2.0.module +228 -0
- package/android/SDKeKYC/finos/sdk/ekyc/sdkui/1.2.0/sdkui-1.2.0.pom +103 -0
- package/android/SDKeKYC/finos/sdk/ekyc/sdkui/maven-metadata-local.xml +13 -0
- package/android/src/main/build/generated/source/buildConfig/debug/com/sdkekycrn/BuildConfig.java +10 -0
- package/android/src/main/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +7 -0
- package/android/src/main/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
- package/android/src/main/build/intermediates/aar_main_jar/debug/syncDebugLibJars/classes.jar +0 -0
- package/android/src/main/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
- package/android/src/main/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
- package/android/src/main/build/intermediates/annotations_typedef_file/debug/extractDebugAnnotations/typedefs.txt +0 -0
- package/android/src/main/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/android/src/main/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
- package/android/src/main/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -0
- package/android/src/main/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
- package/android/src/main/build/intermediates/incremental/debug-mergeJavaRes/merge-state +0 -0
- package/android/src/main/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
- package/android/src/main/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
- package/android/src/main/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
- package/android/src/main/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/sdkekycrn/BuildConfig.class +0 -0
- package/android/src/main/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +2 -0
- package/android/src/main/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +7 -0
- package/android/src/main/build/intermediates/merged_java_res/debug/mergeDebugJavaResource/feature-main.jar +0 -0
- package/android/src/main/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +7 -0
- package/android/src/main/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
- package/android/src/main/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +1 -0
- package/android/src/main/build/outputs/aar/main-debug.aar +0 -0
- package/android/src/main/build/outputs/logs/manifest-merger-debug-report.txt +16 -0
- package/android/src/main/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/dist/App.js +481 -12
- package/dist/EKYCModule.d.ts +60 -0
- package/dist/EKYCModule.js +140 -9
- package/dist/index.d.ts +4 -1
- package/dist/index.js +7 -2
- package/dist/src/modules/FinosEKYCModule.d.ts +206 -0
- package/dist/src/modules/FinosEKYCModule.js +352 -0
- package/package.json +2 -2
- package/src/modules/FinosEKYCModule.ts +450 -0
- package/src/modules/README.md +347 -0
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
import sdkEKYC, { SDKeKYC, SDK_VERSION, SDK_NAME } from '../../EKYCModule';
|
|
3
|
+
import { NfcConfig, NfcError } from '../types/ekycNFCType';
|
|
4
|
+
import { SDKEkycResultWithEvent, SDKEkycResultStringWithEvent } from '../types/ekycType';
|
|
5
|
+
import { C06Config } from '../types/ekycC06Type';
|
|
6
|
+
import { OcrConfig } from '../types/ekycOCRType';
|
|
7
|
+
import { LivenessConfig } from '../types/ekycLivenessType';
|
|
8
|
+
import { FaceServiceConfig } from '../types/ekycFaceType';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Finos eKYC SDK Module v0.0.31
|
|
12
|
+
*
|
|
13
|
+
* A comprehensive React Native module for electronic Know Your Customer (eKYC) operations
|
|
14
|
+
* including Vietnamese CCCD NFC reading, OCR, Liveness detection, Face matching, and C06 residence verification.
|
|
15
|
+
*
|
|
16
|
+
* @version 0.0.31
|
|
17
|
+
* @author FinOS
|
|
18
|
+
* @license MIT
|
|
19
|
+
*/
|
|
20
|
+
export class FinosEKYCModule {
|
|
21
|
+
private static instance: FinosEKYCModule;
|
|
22
|
+
private sdk: SDKeKYC;
|
|
23
|
+
private isInitialized: boolean = false;
|
|
24
|
+
private platform: string;
|
|
25
|
+
|
|
26
|
+
private constructor() {
|
|
27
|
+
this.sdk = sdkEKYC;
|
|
28
|
+
this.platform = Platform.OS;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Get singleton instance of FinosEKYCModule
|
|
33
|
+
*/
|
|
34
|
+
public static getInstance(): FinosEKYCModule {
|
|
35
|
+
if (!FinosEKYCModule.instance) {
|
|
36
|
+
FinosEKYCModule.instance = new FinosEKYCModule();
|
|
37
|
+
}
|
|
38
|
+
return FinosEKYCModule.instance;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Get SDK information
|
|
43
|
+
*/
|
|
44
|
+
public async getSDKInfo(): Promise<{
|
|
45
|
+
name: string;
|
|
46
|
+
version: string;
|
|
47
|
+
buildNumber: string;
|
|
48
|
+
platform: string;
|
|
49
|
+
isInitialized: boolean;
|
|
50
|
+
}> {
|
|
51
|
+
try {
|
|
52
|
+
const nativeInfo = await this.sdk.getSDKInfo();
|
|
53
|
+
return {
|
|
54
|
+
...nativeInfo,
|
|
55
|
+
platform: this.platform,
|
|
56
|
+
isInitialized: this.isInitialized
|
|
57
|
+
};
|
|
58
|
+
} catch (error) {
|
|
59
|
+
return {
|
|
60
|
+
name: SDK_NAME,
|
|
61
|
+
version: SDK_VERSION,
|
|
62
|
+
buildNumber: '1',
|
|
63
|
+
platform: this.platform,
|
|
64
|
+
isInitialized: this.isInitialized
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Initialize the eKYC SDK
|
|
71
|
+
* Must be called before using any other methods
|
|
72
|
+
*/
|
|
73
|
+
public async initialize(): Promise<string> {
|
|
74
|
+
try {
|
|
75
|
+
if (this.isInitialized) {
|
|
76
|
+
console.log('โ
SDK already initialized');
|
|
77
|
+
return 'SDK already initialized';
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Check if SDK is already initialized on native side
|
|
81
|
+
if (this.sdk.isSDKInitialized()) {
|
|
82
|
+
this.isInitialized = true;
|
|
83
|
+
console.log('โ
SDK already initialized on native side');
|
|
84
|
+
return 'SDK already initialized on native side';
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const result = await this.sdk.initSdkEkyc();
|
|
88
|
+
this.isInitialized = true;
|
|
89
|
+
console.log('โ
Finos eKYC SDK v0.0.31 initialized successfully');
|
|
90
|
+
return result;
|
|
91
|
+
} catch (error) {
|
|
92
|
+
// Handle Koin Application already started error
|
|
93
|
+
if (error && error.toString().includes('Koin Application has already been started')) {
|
|
94
|
+
console.log('โ
SDK already initialized (Koin Application started)');
|
|
95
|
+
this.isInitialized = true;
|
|
96
|
+
return 'SDK already initialized (Koin Application started)';
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
console.error('โ Failed to initialize Finos eKYC SDK:', error);
|
|
100
|
+
throw new Error(`SDK initialization failed: ${error}`);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Check if SDK is initialized
|
|
106
|
+
*/
|
|
107
|
+
public isSDKReady(): boolean {
|
|
108
|
+
return this.isInitialized && this.sdk.isSDKInitialized();
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Start NFC scanning for Vietnamese CCCD
|
|
113
|
+
* @param config NFC configuration
|
|
114
|
+
*/
|
|
115
|
+
public async startNfcScan(config: NfcConfig): Promise<SDKEkycResultStringWithEvent> {
|
|
116
|
+
this.validateSDKReady();
|
|
117
|
+
this.validatePlatform('android', 'NFC scanning is only available on Android');
|
|
118
|
+
|
|
119
|
+
try {
|
|
120
|
+
console.log('๐ก Starting NFC scan...');
|
|
121
|
+
const result = await this.sdk.startNfcScan(config);
|
|
122
|
+
console.log('โ
NFC scan completed:', result.event);
|
|
123
|
+
return result;
|
|
124
|
+
} catch (error) {
|
|
125
|
+
console.error('โ NFC scan failed:', error);
|
|
126
|
+
throw error;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Check C06 residence verification
|
|
132
|
+
* @param config C06 configuration
|
|
133
|
+
*/
|
|
134
|
+
public async checkC06(config: C06Config): Promise<SDKEkycResultStringWithEvent> {
|
|
135
|
+
this.validateSDKReady();
|
|
136
|
+
|
|
137
|
+
try {
|
|
138
|
+
console.log('๐ Starting C06 residence check...');
|
|
139
|
+
const result = await this.sdk.checkC06(config);
|
|
140
|
+
console.log('โ
C06 check completed:', result.event);
|
|
141
|
+
return result;
|
|
142
|
+
} catch (error) {
|
|
143
|
+
console.error('โ C06 check failed:', error);
|
|
144
|
+
throw error;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Start OCR document scanning
|
|
150
|
+
* @param config OCR configuration
|
|
151
|
+
*/
|
|
152
|
+
public async startOCR(config: OcrConfig): Promise<SDKEkycResultStringWithEvent> {
|
|
153
|
+
this.validateSDKReady();
|
|
154
|
+
|
|
155
|
+
try {
|
|
156
|
+
console.log('๐ Starting OCR scan...');
|
|
157
|
+
const result = await this.sdk.startOcr(config);
|
|
158
|
+
console.log('โ
OCR scan completed:', result.event);
|
|
159
|
+
return result;
|
|
160
|
+
} catch (error) {
|
|
161
|
+
console.error('โ OCR scan failed:', error);
|
|
162
|
+
throw error;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Start liveness detection
|
|
168
|
+
* @param config Liveness configuration
|
|
169
|
+
*/
|
|
170
|
+
public async startLiveness(config: LivenessConfig): Promise<SDKEkycResultStringWithEvent> {
|
|
171
|
+
this.validateSDKReady();
|
|
172
|
+
|
|
173
|
+
try {
|
|
174
|
+
console.log('๐๏ธ Starting liveness detection...');
|
|
175
|
+
const result = await this.sdk.startLiveness(config);
|
|
176
|
+
console.log('โ
Liveness detection completed:', result.event);
|
|
177
|
+
return result;
|
|
178
|
+
} catch (error) {
|
|
179
|
+
console.error('โ Liveness detection failed:', error);
|
|
180
|
+
throw error;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Start face comparison
|
|
186
|
+
* @param config Face service configuration
|
|
187
|
+
*/
|
|
188
|
+
public async startFaceCompare(config: FaceServiceConfig): Promise<SDKEkycResultStringWithEvent> {
|
|
189
|
+
this.validateSDKReady();
|
|
190
|
+
|
|
191
|
+
try {
|
|
192
|
+
console.log('๐ค Starting face comparison...');
|
|
193
|
+
const result = await this.sdk.startFaceCompare(config);
|
|
194
|
+
console.log('โ
Face comparison completed:', result.event);
|
|
195
|
+
return result;
|
|
196
|
+
} catch (error) {
|
|
197
|
+
console.error('โ Face comparison failed:', error);
|
|
198
|
+
throw error;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Extract NFC data for C06 verification
|
|
204
|
+
* @param nfcResultJson NFC result JSON string
|
|
205
|
+
*/
|
|
206
|
+
public async extractNfcDataForC06(nfcResultJson: string): Promise<any> {
|
|
207
|
+
this.validateSDKReady();
|
|
208
|
+
|
|
209
|
+
try {
|
|
210
|
+
console.log('๐ Extracting NFC data for C06...');
|
|
211
|
+
// Note: This method needs to be implemented in the native module
|
|
212
|
+
console.log('โ
NFC data extraction completed');
|
|
213
|
+
return { success: true, data: nfcResultJson };
|
|
214
|
+
} catch (error) {
|
|
215
|
+
console.error('โ NFC data extraction failed:', error);
|
|
216
|
+
throw error;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Handle app lifecycle - Resume
|
|
222
|
+
*/
|
|
223
|
+
public onResume(): void {
|
|
224
|
+
this.sdk.onResume();
|
|
225
|
+
console.log('๐ฑ App resumed');
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Handle app lifecycle - Pause
|
|
230
|
+
*/
|
|
231
|
+
public onPause(): void {
|
|
232
|
+
this.sdk.onPause();
|
|
233
|
+
console.log('๐ฑ App paused');
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Handle new intent (Android)
|
|
238
|
+
*/
|
|
239
|
+
public handleNewIntent(): void {
|
|
240
|
+
// Note: This method needs to be implemented in the native module
|
|
241
|
+
console.log('๐ฑ New intent handled');
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// Event Listeners
|
|
245
|
+
/**
|
|
246
|
+
* Listen for NFC scan start events
|
|
247
|
+
*/
|
|
248
|
+
public onNfcScanStart(callback: (data: SDKEkycResultWithEvent) => void) {
|
|
249
|
+
return this.sdk.onNfcScanStart(callback);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Listen for NFC scan success events
|
|
254
|
+
*/
|
|
255
|
+
public onNfcScanSuccess(callback: (data: SDKEkycResultStringWithEvent) => void) {
|
|
256
|
+
return this.sdk.onNfcScanSuccess(callback);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Listen for NFC error events
|
|
261
|
+
*/
|
|
262
|
+
public onNfcError(callback: (error: NfcError) => void) {
|
|
263
|
+
return this.sdk.onNfcError(callback);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Listen for C06 success events
|
|
268
|
+
*/
|
|
269
|
+
public onC06Success(callback: (data: SDKEkycResultWithEvent) => void) {
|
|
270
|
+
return this.sdk.onC06Success(callback);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Listen for C06 error events
|
|
275
|
+
*/
|
|
276
|
+
public onC06Error(callback: (error: NfcError) => void) {
|
|
277
|
+
return this.sdk.onC06Error(callback);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Listen for OCR success events
|
|
282
|
+
*/
|
|
283
|
+
public onOCRSuccess(callback: (data: SDKEkycResultStringWithEvent) => void) {
|
|
284
|
+
return this.sdk.onOcrSuccess(callback);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Listen for OCR error events
|
|
289
|
+
*/
|
|
290
|
+
public onOCRError(callback: (error: any) => void) {
|
|
291
|
+
return this.sdk.onOcrError(callback);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Listen for liveness success events
|
|
296
|
+
*/
|
|
297
|
+
public onLivenessSuccess(callback: (data: SDKEkycResultStringWithEvent) => void) {
|
|
298
|
+
return this.sdk.onLivenessSuccess(callback);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Listen for liveness error events
|
|
303
|
+
*/
|
|
304
|
+
public onLivenessError(callback: (error: any) => void) {
|
|
305
|
+
return this.sdk.onLivenessError(callback);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Listen for face compare success events
|
|
310
|
+
*/
|
|
311
|
+
public onFaceCompareSuccess(callback: (data: SDKEkycResultWithEvent) => void) {
|
|
312
|
+
return this.sdk.onFaceCompareSuccess(callback);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Listen for face compare error events
|
|
317
|
+
*/
|
|
318
|
+
public onFaceCompareError(callback: (error: any) => void) {
|
|
319
|
+
return this.sdk.onFaceCompareError(callback);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Remove all event listeners
|
|
324
|
+
*/
|
|
325
|
+
public removeAllListeners(): void {
|
|
326
|
+
this.sdk.removeAllListeners();
|
|
327
|
+
console.log('๐งน All event listeners removed');
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Start eKYC UI with flow (like MainActivity.kt)
|
|
332
|
+
* @param appKey Main app key
|
|
333
|
+
* @param flowSDK Array of SDK types
|
|
334
|
+
* @param language Language code (vi/en)
|
|
335
|
+
* @param transactionId Transaction ID
|
|
336
|
+
* @param optionConfig Optional configuration settings
|
|
337
|
+
* @param appKeyConfig Optional app key configuration
|
|
338
|
+
* @param styleConfig Optional style configuration
|
|
339
|
+
*/
|
|
340
|
+
public async startEkycUI(
|
|
341
|
+
appKey: string,
|
|
342
|
+
flowSDK: string[],
|
|
343
|
+
language: string,
|
|
344
|
+
transactionId: string,
|
|
345
|
+
appKeyConfig: {
|
|
346
|
+
appKey: string;
|
|
347
|
+
appKeyNfc: string;
|
|
348
|
+
appKeyOcr: string;
|
|
349
|
+
appKeyLiveness: string;
|
|
350
|
+
appKeyC06: string;
|
|
351
|
+
appKeyFaceService: string;
|
|
352
|
+
},
|
|
353
|
+
optionConfig?: {
|
|
354
|
+
baseUrl?: string;
|
|
355
|
+
countMaxRetry?: number;
|
|
356
|
+
language?: string;
|
|
357
|
+
},
|
|
358
|
+
styleConfig?: {
|
|
359
|
+
textSize?: number;
|
|
360
|
+
textFont?: string;
|
|
361
|
+
textColor?: number;
|
|
362
|
+
statusBarBackground?: number;
|
|
363
|
+
backIcon?: number;
|
|
364
|
+
titleStyle?: {
|
|
365
|
+
textSize?: number;
|
|
366
|
+
textFont?: string;
|
|
367
|
+
textColor?: number;
|
|
368
|
+
};
|
|
369
|
+
toolbarStyle?: {
|
|
370
|
+
textSize?: number;
|
|
371
|
+
textFont?: string;
|
|
372
|
+
textColor?: number;
|
|
373
|
+
};
|
|
374
|
+
instructionStyle?: {
|
|
375
|
+
textSize?: number;
|
|
376
|
+
textFont?: string;
|
|
377
|
+
textColor?: number;
|
|
378
|
+
};
|
|
379
|
+
errorStyle?: {
|
|
380
|
+
textSize?: number;
|
|
381
|
+
textFont?: string;
|
|
382
|
+
textColor?: number;
|
|
383
|
+
};
|
|
384
|
+
successStyle?: {
|
|
385
|
+
textSize?: number;
|
|
386
|
+
textFont?: string;
|
|
387
|
+
textColor?: number;
|
|
388
|
+
};
|
|
389
|
+
warningStyle?: {
|
|
390
|
+
textSize?: number;
|
|
391
|
+
textFont?: string;
|
|
392
|
+
textColor?: number;
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
): Promise<any> {
|
|
396
|
+
this.validateSDKReady();
|
|
397
|
+
|
|
398
|
+
try {
|
|
399
|
+
console.log('๐ Starting eKYC UI with flow:', flowSDK);
|
|
400
|
+
console.log('๐ง OptionConfig:', optionConfig);
|
|
401
|
+
console.log('๐ AppKeyConfig:', appKeyConfig);
|
|
402
|
+
console.log('๐จ StyleConfig:', styleConfig);
|
|
403
|
+
|
|
404
|
+
const result = await this.sdk.startEkycUI(
|
|
405
|
+
appKey,
|
|
406
|
+
flowSDK,
|
|
407
|
+
language,
|
|
408
|
+
transactionId,
|
|
409
|
+
appKeyConfig,
|
|
410
|
+
optionConfig,
|
|
411
|
+
styleConfig
|
|
412
|
+
);
|
|
413
|
+
console.log('โ
eKYC UI started successfully');
|
|
414
|
+
return result;
|
|
415
|
+
} catch (error) {
|
|
416
|
+
console.error('โ eKYC UI failed:', error);
|
|
417
|
+
throw error;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
// Private validation methods
|
|
422
|
+
private validateSDKReady(): void {
|
|
423
|
+
if (!this.isSDKReady()) {
|
|
424
|
+
throw new Error('SDK is not initialized. Please call initialize() first.');
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
private validatePlatform(requiredPlatform: string, message: string): void {
|
|
429
|
+
if (this.platform !== requiredPlatform) {
|
|
430
|
+
throw new Error(message);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
// Export singleton instance
|
|
436
|
+
export const FinosEKYC = FinosEKYCModule.getInstance();
|
|
437
|
+
|
|
438
|
+
// Export types
|
|
439
|
+
export type { NfcConfig, NfcError } from '../types/ekycNFCType';
|
|
440
|
+
export type { C06Config } from '../types/ekycC06Type';
|
|
441
|
+
export type { OcrConfig } from '../types/ekycOCRType';
|
|
442
|
+
export type { LivenessConfig } from '../types/ekycLivenessType';
|
|
443
|
+
export type { FaceServiceConfig } from '../types/ekycFaceType';
|
|
444
|
+
export type { SDKEkycResultWithEvent, SDKEkycResultStringWithEvent } from '../types/ekycType';
|
|
445
|
+
|
|
446
|
+
// Export constants
|
|
447
|
+
export { SDK_VERSION, SDK_NAME };
|
|
448
|
+
|
|
449
|
+
// Default export
|
|
450
|
+
export default FinosEKYC;
|