@finos_sdk/sdk-ekyc 1.4.2 → 1.4.4
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 +26 -9
- package/android/build.gradle +1 -1
- package/android/src/main/java/finos/sdk/ekyc/EKYCModule.kt +71 -71
- package/dist/EKYCModule.js +1 -1
- package/dist/index.js +17 -7
- package/dist/package.json +2 -2
- package/dist/src/modules/FinosEKYCModule.js +17 -10
- package/dist/src/modules/FinosESignModule.js +17 -7
- package/dist/src/services/sharingService.js +2 -2
- package/dist/src/types/EKYCErrorResult.d.ts +34 -0
- package/dist/src/types/EKYCErrorResult.js +57 -7
- package/dist/src/types/ekycESignType.js +1 -1
- package/dist/src/types/ekycFlowType.js +3 -3
- package/dist/src/types/ekycLivenessType.d.ts +1 -2
- package/dist/src/types/ekycLivenessType.js +3 -3
- package/dist/src/types/ekycType.js +3 -3
- package/dist/src/utils/utils.js +1 -2
- package/ios/EKYCModule.swift +5 -4
- package/ios/EKYCModuleBridge.m +8 -8
- package/package.json +2 -2
- package/src/modules/FinosEKYCModule.ts +0 -5
- package/src/types/EKYCErrorResult.ts +51 -0
- package/src/types/ekycLivenessType.ts +1 -2
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
React Native SDK for eKYC (electronic Know Your Customer) and eSign. Features include Vietnamese CCCD NFC reading, OCR, Liveness detection, Face matching, C06 residence verification, SMS OTP verification, and Electronic Signature (eSign) capabilities.
|
|
7
7
|
|
|
8
|
-
**Version**: 1.4.
|
|
8
|
+
**Version**: 1.4.2
|
|
9
9
|
|
|
10
10
|
## Features
|
|
11
11
|
|
|
@@ -49,6 +49,7 @@ import {
|
|
|
49
49
|
getEkycError,
|
|
50
50
|
SDKFaceDetectStatus,
|
|
51
51
|
SDKFlowType,
|
|
52
|
+
AppIDType,
|
|
52
53
|
} from '@finos_sdk/sdk-ekyc';
|
|
53
54
|
|
|
54
55
|
import type {
|
|
@@ -138,6 +139,7 @@ const result = await FinosEKYC.startEkycUI(
|
|
|
138
139
|
SDKFaceDetectStatus.STRAIGHT,
|
|
139
140
|
],
|
|
140
141
|
activeActionCount: 3, // Random action count 1-10 (if customActions is null)
|
|
142
|
+
appIDType: AppIDType.VIKKI, // App ID type: NONE | HD_BANK | VIKKI
|
|
141
143
|
},
|
|
142
144
|
|
|
143
145
|
// --- styleConfig: UI customization ---
|
|
@@ -249,6 +251,7 @@ SDK behavior and runtime settings.
|
|
|
249
251
|
| `isShowCameraFont` | `boolean` | `true` | Show instruction text on camera screen |
|
|
250
252
|
| `customActions` | `SDKFaceDetectStatus[]` | `undefined` | Custom liveness action sequence |
|
|
251
253
|
| `activeActionCount` | `number` | `2` | Number of random actions (1-10, used when `customActions` is null) |
|
|
254
|
+
| `appIDType` | `AppIDType` | `NONE` | App ID type for branding: `NONE`, `HD_BANK`, or `VIKKI` |
|
|
252
255
|
|
|
253
256
|
```typescript
|
|
254
257
|
// Minimal
|
|
@@ -270,9 +273,27 @@ const optionConfig = {
|
|
|
270
273
|
SDKFaceDetectStatus.STRAIGHT,
|
|
271
274
|
],
|
|
272
275
|
activeActionCount: 3,
|
|
276
|
+
appIDType: AppIDType.VIKKI,
|
|
273
277
|
};
|
|
274
278
|
```
|
|
275
279
|
|
|
280
|
+
### AppIDType
|
|
281
|
+
|
|
282
|
+
Determines the branding/skin of SDK screens.
|
|
283
|
+
|
|
284
|
+
| Value | Description |
|
|
285
|
+
|-------|-------------|
|
|
286
|
+
| `NONE` | Default, no branding |
|
|
287
|
+
| `HD_BANK` | HD Bank branding |
|
|
288
|
+
| `VIKKI` | Vikki branding |
|
|
289
|
+
|
|
290
|
+
```typescript
|
|
291
|
+
import { AppIDType } from '@finos_sdk/sdk-ekyc';
|
|
292
|
+
|
|
293
|
+
// In optionConfig
|
|
294
|
+
{ appIDType: AppIDType.VIKKI }
|
|
295
|
+
```
|
|
296
|
+
|
|
276
297
|
### StyleConfig
|
|
277
298
|
|
|
278
299
|
UI appearance customization. All color values use ARGB integer format (e.g., `0xFFRRGGBB`).
|
|
@@ -822,17 +843,13 @@ useEffect(() => {
|
|
|
822
843
|
|
|
823
844
|
## What's New
|
|
824
845
|
|
|
825
|
-
### v1.4.
|
|
846
|
+
### v1.4.2
|
|
847
|
+
- `AppIDType` enum (NONE, HD_BANK, VIKKI) for branding/skin selection
|
|
826
848
|
- `captureButtonColor` and `captureButtonDisabledColor` in StyleConfig
|
|
827
|
-
- Android responsive layouts for camera preview screens
|
|
828
|
-
|
|
829
|
-
### v1.4.3
|
|
830
849
|
- `USER_CANCEL` error code (999) for user cancellation detection
|
|
831
|
-
- Auto-detect user cancellation when activity closed without completing
|
|
832
|
-
|
|
833
|
-
### v1.4.2
|
|
834
850
|
- User cancellation callback support across all modules
|
|
835
|
-
-
|
|
851
|
+
- Android responsive layouts for camera preview screens
|
|
852
|
+
- Refactored StyleConfig JSON parsing with proper JSONObject
|
|
836
853
|
|
|
837
854
|
### v1.4.1
|
|
838
855
|
- Full iOS native bridge support
|
package/android/build.gradle
CHANGED
|
@@ -65,7 +65,7 @@ dependencies {
|
|
|
65
65
|
implementation 'com.facebook.react:react-android'
|
|
66
66
|
|
|
67
67
|
// Finos eKYC SDK dependencies from GitHub Packages Maven repository
|
|
68
|
-
def sdkVersion = "1.4.
|
|
68
|
+
def sdkVersion = "1.4.4"
|
|
69
69
|
implementation("finos.sdk.ekyc:ekyc:$sdkVersion")
|
|
70
70
|
implementation("finos.sdk.ekyc:ekycui:$sdkVersion")
|
|
71
71
|
implementation("finos.sdk.ekyc:nfc:$sdkVersion")
|
|
@@ -16,7 +16,7 @@ import com.facebook.react.bridge.WritableArray
|
|
|
16
16
|
import com.facebook.react.bridge.WritableMap
|
|
17
17
|
import com.facebook.react.module.annotations.ReactModule
|
|
18
18
|
import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
19
|
-
import finos.sdk.c06.
|
|
19
|
+
import finos.sdk.c06.eKYCFinOSC06
|
|
20
20
|
import finos.sdk.core.define.EKYCErrorResult
|
|
21
21
|
import finos.sdk.core.define.EKYCEvent
|
|
22
22
|
import finos.sdk.core.define.SDKType
|
|
@@ -32,15 +32,15 @@ import finos.sdk.core.model.sdk.config.OcrConfig
|
|
|
32
32
|
import finos.sdk.core.model.sdk.config.OptionConfig
|
|
33
33
|
import finos.sdk.core.model.sdk.config.StyleConfig
|
|
34
34
|
import finos.sdk.core.define.AppIDType
|
|
35
|
-
import finos.sdk.ekyc.
|
|
36
|
-
import finos.sdk.ekyc.ui.
|
|
37
|
-
import finos.sdk.faceservice.
|
|
38
|
-
import finos.sdk.liveness.
|
|
39
|
-
import finos.sdk.nfc.
|
|
40
|
-
import finos.sdk.ocr.
|
|
41
|
-
import finos.sdk.smsotp.
|
|
35
|
+
import finos.sdk.ekyc.eKYCFinOS
|
|
36
|
+
import finos.sdk.ekyc.ui.eKYCFinOSUI
|
|
37
|
+
import finos.sdk.faceservice.eKYCFinOSFaceService
|
|
38
|
+
import finos.sdk.liveness.eKYCFinOSLiveness
|
|
39
|
+
import finos.sdk.nfc.eKYCFinOSNfc
|
|
40
|
+
import finos.sdk.ocr.eKYCFinOSOcr
|
|
41
|
+
import finos.sdk.smsotp.OTPFinOS
|
|
42
42
|
import finos.sdk.core.model.sdk.config.SmsOtpConfig
|
|
43
|
-
import vn.softdreams.easyca.sdk.
|
|
43
|
+
import vn.softdreams.easyca.sdk.eSignFinOS
|
|
44
44
|
import vn.softdreams.easyca.sdk.esign.ESignModels
|
|
45
45
|
|
|
46
46
|
import org.json.JSONArray
|
|
@@ -151,7 +151,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
151
151
|
fun initSdkEkyc(promise: Promise) {
|
|
152
152
|
Log.d(TAG, "▶️ initSdkEkyc() called")
|
|
153
153
|
try {
|
|
154
|
-
|
|
154
|
+
eKYCFinOS.initSDKEkyc(reactApplicationContext) {
|
|
155
155
|
Log.d(TAG, "✅ initSdkEkyc() success")
|
|
156
156
|
val params =
|
|
157
157
|
Arguments.createMap().apply {
|
|
@@ -183,7 +183,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
183
183
|
fun setTransactionId(transactionId: String, promise: Promise) {
|
|
184
184
|
Log.d(TAG, "▶️ setTransactionId() called with: $transactionId")
|
|
185
185
|
try {
|
|
186
|
-
|
|
186
|
+
eKYCFinOS.setTransactionId(transactionId)
|
|
187
187
|
Log.d(TAG, "✅ setTransactionId() success")
|
|
188
188
|
promise.resolve(true)
|
|
189
189
|
} catch (e: Exception) {
|
|
@@ -221,7 +221,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
221
221
|
val ekycConfig =
|
|
222
222
|
EKYCConfigSDK(appKey = AppKeyConfig(appKey), sdkType = SDKType.NFC, nfcConfig = nfcConfig)
|
|
223
223
|
|
|
224
|
-
|
|
224
|
+
eKYCFinOSNfc.startEkyc(
|
|
225
225
|
activity = currentActivity,
|
|
226
226
|
ekycConfigSDK = ekycConfig,
|
|
227
227
|
callbackSuccess = { event, data ->
|
|
@@ -277,7 +277,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
277
277
|
putString("customCode", errorResult.code)
|
|
278
278
|
putString("customMessage", errorResult.message)
|
|
279
279
|
}
|
|
280
|
-
promise.reject(event.name.toString(), errorResult.message,
|
|
280
|
+
promise.reject(event.name.toString(), errorResult.message, null, promiseErrorMap)
|
|
281
281
|
}
|
|
282
282
|
)
|
|
283
283
|
} catch (e: Exception) {
|
|
@@ -307,7 +307,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
307
307
|
|
|
308
308
|
val ekycConfig = EKYCConfigSDK(appKey = AppKeyConfig(appKey), c06Config = c06Config)
|
|
309
309
|
|
|
310
|
-
|
|
310
|
+
eKYCFinOSC06.startEkyc(
|
|
311
311
|
ekycConfigSDK = ekycConfig,
|
|
312
312
|
callbackSuccess = { event, data ->
|
|
313
313
|
Log.d(TAG, "✅ checkC06() success")
|
|
@@ -341,7 +341,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
341
341
|
putString("customCode", errorResult.code)
|
|
342
342
|
putString("customMessage", errorResult.message)
|
|
343
343
|
}
|
|
344
|
-
promise.reject(event.name.toString(), errorResult.message,
|
|
344
|
+
promise.reject(event.name.toString(), errorResult.message, null, promiseErrorMap)
|
|
345
345
|
}
|
|
346
346
|
)
|
|
347
347
|
} catch (e: Exception) {
|
|
@@ -380,7 +380,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
380
380
|
)
|
|
381
381
|
val ekycConfig =
|
|
382
382
|
EKYCConfigSDK(appKey = AppKeyConfig(appKey), sdkType = SDKType.OCR, ocrConfig = ocrConfig)
|
|
383
|
-
|
|
383
|
+
eKYCFinOSOcr.startEkyc(
|
|
384
384
|
ekycConfigSDK = ekycConfig,
|
|
385
385
|
callbackSuccess = { event, data ->
|
|
386
386
|
Log.d(TAG, "✅ startOcr() success")
|
|
@@ -405,7 +405,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
405
405
|
putString("customCode", errorResult.code)
|
|
406
406
|
putString("customMessage", errorResult.message)
|
|
407
407
|
}
|
|
408
|
-
promise.reject(event.name.toString(), errorResult.message,
|
|
408
|
+
promise.reject(event.name.toString(), errorResult.message, null, promiseErrorMap)
|
|
409
409
|
}
|
|
410
410
|
)
|
|
411
411
|
} catch (e: Exception) {
|
|
@@ -419,13 +419,12 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
419
419
|
appKey: String,
|
|
420
420
|
selfieImage: String,
|
|
421
421
|
transactionId: String,
|
|
422
|
-
|
|
423
|
-
useActiveLiveness: Boolean?,
|
|
424
|
-
autoCapture: Boolean?,
|
|
422
|
+
isActiveLiveness: Boolean?,
|
|
425
423
|
isShowCameraFont: Boolean?,
|
|
426
424
|
customActionsArray: ReadableArray?,
|
|
427
425
|
activeActionCount: Int?,
|
|
428
426
|
forceCaptureTimeout: Double?,
|
|
427
|
+
isActiveLivenessColor: Boolean?,
|
|
429
428
|
promise: Promise
|
|
430
429
|
) {
|
|
431
430
|
Log.d(TAG, "▶️ startLiveness() called")
|
|
@@ -461,8 +460,9 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
461
460
|
|
|
462
461
|
val livenessConfig =
|
|
463
462
|
LivenessConfig(
|
|
464
|
-
isActiveLiveness =
|
|
465
|
-
|
|
463
|
+
isActiveLiveness = isActiveLiveness ?: false,
|
|
464
|
+
isActiveLivenessColor = isActiveLivenessColor ?: false,
|
|
465
|
+
isShowCameraFont = isShowCameraFont ?: true,
|
|
466
466
|
// Custom actions từ checkboxes (nếu có chọn)
|
|
467
467
|
// Nếu có actions được chọn → sử dụng customActions
|
|
468
468
|
// Nếu không có actions nào được chọn → sử dụng random actions với activeActionCount
|
|
@@ -480,7 +480,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
480
480
|
sdkType = SDKType.LIVENESS,
|
|
481
481
|
livenessConfig = livenessConfig
|
|
482
482
|
)
|
|
483
|
-
|
|
483
|
+
eKYCFinOSLiveness.startEkyc(
|
|
484
484
|
ekycConfigSDK = ekycConfig,
|
|
485
485
|
callbackSuccess = { event, data ->
|
|
486
486
|
Log.d(TAG, "✅ startLiveness() success")
|
|
@@ -505,7 +505,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
505
505
|
putString("customCode", errorResult.code)
|
|
506
506
|
putString("customMessage", errorResult.message)
|
|
507
507
|
}
|
|
508
|
-
promise.reject(event.name.toString(), errorResult.message,
|
|
508
|
+
promise.reject(event.name.toString(), errorResult.message, null, promiseErrorMap)
|
|
509
509
|
}
|
|
510
510
|
)
|
|
511
511
|
} catch (e: Exception) {
|
|
@@ -553,7 +553,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
553
553
|
|
|
554
554
|
// Đảm bảo chạy trên main thread để tránh crash trên một số devices/SDK versions.
|
|
555
555
|
Handler(Looper.getMainLooper()).post {
|
|
556
|
-
|
|
556
|
+
eKYCFinOSFaceService.startEkyc(
|
|
557
557
|
ekycConfigSDK = ekycConfig,
|
|
558
558
|
callbackSuccess = { event, data ->
|
|
559
559
|
Log.d(TAG, "✅ startFaceCompare() success")
|
|
@@ -578,7 +578,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
578
578
|
putString("customCode", errorResult.code)
|
|
579
579
|
putString("customMessage", errorResult.message)
|
|
580
580
|
}
|
|
581
|
-
promise.reject(event.name.toString(), errorResult.message,
|
|
581
|
+
promise.reject(event.name.toString(), errorResult.message, null, promiseErrorMap)
|
|
582
582
|
}
|
|
583
583
|
)
|
|
584
584
|
}
|
|
@@ -591,21 +591,21 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
591
591
|
@ReactMethod
|
|
592
592
|
fun onResume() {
|
|
593
593
|
reactApplicationContext.currentActivity?.let { activity ->
|
|
594
|
-
activity.runOnUiThread {
|
|
594
|
+
activity.runOnUiThread { eKYCFinOSNfc.onResumeNfc(activity) }
|
|
595
595
|
}
|
|
596
596
|
}
|
|
597
597
|
|
|
598
598
|
@ReactMethod
|
|
599
599
|
fun onPause() {
|
|
600
600
|
reactApplicationContext.currentActivity?.let { activity ->
|
|
601
|
-
activity.runOnUiThread {
|
|
601
|
+
activity.runOnUiThread { eKYCFinOSNfc.onPauseNfc(activity) }
|
|
602
602
|
}
|
|
603
603
|
}
|
|
604
604
|
|
|
605
605
|
@ReactMethod
|
|
606
606
|
fun handleNewIntent() {
|
|
607
607
|
reactApplicationContext.currentActivity?.let { activity ->
|
|
608
|
-
activity.runOnUiThread {
|
|
608
|
+
activity.runOnUiThread { eKYCFinOSNfc.onNewIntentNfc(activity.intent) }
|
|
609
609
|
}
|
|
610
610
|
}
|
|
611
611
|
|
|
@@ -778,7 +778,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
778
778
|
flowSDK = finalFlow
|
|
779
779
|
)
|
|
780
780
|
|
|
781
|
-
|
|
781
|
+
eKYCFinOSUI.startEkyc(
|
|
782
782
|
activity = currentActivity,
|
|
783
783
|
ekycConfigSDK = ekycConfigSDK,
|
|
784
784
|
callbackSuccess = { event, data ->
|
|
@@ -825,7 +825,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
825
825
|
putString("message", errorResult.message)
|
|
826
826
|
}
|
|
827
827
|
sendEvent("onEkycUIError", errorMap)
|
|
828
|
-
promise.reject(event.name.toString(), errorResult.message,
|
|
828
|
+
promise.reject(event.name.toString(), errorResult.message, null, promiseErrorMap)
|
|
829
829
|
}
|
|
830
830
|
)
|
|
831
831
|
|
|
@@ -1074,7 +1074,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1074
1074
|
referenceId = referenceId
|
|
1075
1075
|
)
|
|
1076
1076
|
|
|
1077
|
-
|
|
1077
|
+
OTPFinOS.sendOtp(
|
|
1078
1078
|
apiKey = appKey,
|
|
1079
1079
|
smsOtpConfig = smsOtpConfig,
|
|
1080
1080
|
callbackSuccess = { event, result ->
|
|
@@ -1106,7 +1106,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1106
1106
|
putString("customCode", error.code)
|
|
1107
1107
|
putString("customMessage", error.message)
|
|
1108
1108
|
}
|
|
1109
|
-
promise.reject(event.name.toString(), error.message,
|
|
1109
|
+
promise.reject(event.name.toString(), error.message, null, promiseErrorMap)
|
|
1110
1110
|
}
|
|
1111
1111
|
)
|
|
1112
1112
|
} catch (e: Exception) {
|
|
@@ -1134,7 +1134,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1134
1134
|
requestId = requestId
|
|
1135
1135
|
)
|
|
1136
1136
|
|
|
1137
|
-
|
|
1137
|
+
OTPFinOS.verifyOtp(
|
|
1138
1138
|
apiKey = appKey,
|
|
1139
1139
|
smsOtpConfig = smsOtpConfig,
|
|
1140
1140
|
otpCode = otpCode,
|
|
@@ -1167,7 +1167,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1167
1167
|
putString("customCode", error.code)
|
|
1168
1168
|
putString("customMessage", error.message)
|
|
1169
1169
|
}
|
|
1170
|
-
promise.reject(event.name.toString(), error.message,
|
|
1170
|
+
promise.reject(event.name.toString(), error.message, null, promiseErrorMap)
|
|
1171
1171
|
}
|
|
1172
1172
|
)
|
|
1173
1173
|
} catch (e: Exception) {
|
|
@@ -1194,7 +1194,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1194
1194
|
requestId = requestId
|
|
1195
1195
|
)
|
|
1196
1196
|
|
|
1197
|
-
|
|
1197
|
+
OTPFinOS.resendOtp(
|
|
1198
1198
|
apiKey = appKey,
|
|
1199
1199
|
smsOtpConfig = smsOtpConfig,
|
|
1200
1200
|
callbackSuccess = { event, result ->
|
|
@@ -1226,7 +1226,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1226
1226
|
putString("customCode", error.code)
|
|
1227
1227
|
putString("customMessage", error.message)
|
|
1228
1228
|
}
|
|
1229
|
-
promise.reject(event.name.toString(), error.message,
|
|
1229
|
+
promise.reject(event.name.toString(), error.message, null, promiseErrorMap)
|
|
1230
1230
|
}
|
|
1231
1231
|
)
|
|
1232
1232
|
} catch (e: Exception) {
|
|
@@ -1248,7 +1248,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1248
1248
|
return
|
|
1249
1249
|
}
|
|
1250
1250
|
|
|
1251
|
-
|
|
1251
|
+
eSignFinOS.initializeESign(
|
|
1252
1252
|
context = currentActivity,
|
|
1253
1253
|
finosToken = finosToken,
|
|
1254
1254
|
isProd = isProd,
|
|
@@ -1286,7 +1286,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1286
1286
|
putString("customCode", error.code)
|
|
1287
1287
|
putString("customMessage", error.message ?: "")
|
|
1288
1288
|
}
|
|
1289
|
-
promise.reject(event.name.toString(), error.message ?: "Unknown Error",
|
|
1289
|
+
promise.reject(event.name.toString(), error.message ?: "Unknown Error", null, promiseErrorMap)
|
|
1290
1290
|
}
|
|
1291
1291
|
}
|
|
1292
1292
|
)
|
|
@@ -1305,7 +1305,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1305
1305
|
) {
|
|
1306
1306
|
Log.d(TAG, "▶️ getSdkToken() called")
|
|
1307
1307
|
try {
|
|
1308
|
-
|
|
1308
|
+
eSignFinOS.getSdkToken(
|
|
1309
1309
|
cccd = identity, // Map identity param to cccd
|
|
1310
1310
|
name = name,
|
|
1311
1311
|
deviceId = deviceId,
|
|
@@ -1327,7 +1327,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1327
1327
|
putString("customCode", error.code)
|
|
1328
1328
|
putString("customMessage", error.message ?: "")
|
|
1329
1329
|
}
|
|
1330
|
-
promise.reject(event.name.toString(), error.message ?: "Get SDK Token failed",
|
|
1330
|
+
promise.reject(event.name.toString(), error.message ?: "Get SDK Token failed", null, promiseErrorMap)
|
|
1331
1331
|
}
|
|
1332
1332
|
)
|
|
1333
1333
|
} catch (e: Exception) {
|
|
@@ -1354,7 +1354,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1354
1354
|
|
|
1355
1355
|
if (accessToken != null && accessToken.isNotEmpty()) {
|
|
1356
1356
|
// Option 1: With existing JWT access token
|
|
1357
|
-
|
|
1357
|
+
eSignFinOS.openSessionId(
|
|
1358
1358
|
context = currentActivity,
|
|
1359
1359
|
accessToken = accessToken,
|
|
1360
1360
|
username = username ?: "",
|
|
@@ -1382,7 +1382,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1382
1382
|
putString("customCode", error.code)
|
|
1383
1383
|
putString("customMessage", error.message ?: "")
|
|
1384
1384
|
}
|
|
1385
|
-
promise.reject(event.name.toString(), error.message ?: "Unknown Error",
|
|
1385
|
+
promise.reject(event.name.toString(), error.message ?: "Unknown Error", null, promiseErrorMap)
|
|
1386
1386
|
}
|
|
1387
1387
|
)
|
|
1388
1388
|
} else {
|
|
@@ -1411,7 +1411,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1411
1411
|
return
|
|
1412
1412
|
}
|
|
1413
1413
|
|
|
1414
|
-
|
|
1414
|
+
eSignFinOS.registerDevice(
|
|
1415
1415
|
context = currentActivity,
|
|
1416
1416
|
recoverCode = recoverCode,
|
|
1417
1417
|
pinCode = pinCode,
|
|
@@ -1439,7 +1439,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1439
1439
|
putString("customCode", error.code)
|
|
1440
1440
|
putString("customMessage", error.message ?: "")
|
|
1441
1441
|
}
|
|
1442
|
-
promise.reject(event.name.toString(), error.message ?: "Unknown Error",
|
|
1442
|
+
promise.reject(event.name.toString(), error.message ?: "Unknown Error", null, promiseErrorMap)
|
|
1443
1443
|
}
|
|
1444
1444
|
)
|
|
1445
1445
|
} catch (e: Exception) {
|
|
@@ -1462,7 +1462,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1462
1462
|
return
|
|
1463
1463
|
}
|
|
1464
1464
|
|
|
1465
|
-
|
|
1465
|
+
eSignFinOS.listCerts(
|
|
1466
1466
|
context = currentActivity,
|
|
1467
1467
|
pageNumber = pageNumber,
|
|
1468
1468
|
pageSize = pageSize,
|
|
@@ -1499,7 +1499,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1499
1499
|
putString("customCode", error.code)
|
|
1500
1500
|
putString("customMessage", error.message ?: "")
|
|
1501
1501
|
}
|
|
1502
|
-
promise.reject(event.name.toString(), error.message ?: "Unknown Error",
|
|
1502
|
+
promise.reject(event.name.toString(), error.message ?: "Unknown Error", null, promiseErrorMap)
|
|
1503
1503
|
}
|
|
1504
1504
|
)
|
|
1505
1505
|
} catch (e: Exception) {
|
|
@@ -1533,7 +1533,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1533
1533
|
return
|
|
1534
1534
|
}
|
|
1535
1535
|
|
|
1536
|
-
|
|
1536
|
+
eSignFinOS.verifyCert(
|
|
1537
1537
|
context = currentActivity,
|
|
1538
1538
|
serial = serial,
|
|
1539
1539
|
callbackSuccess = { code, message ->
|
|
@@ -1559,7 +1559,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1559
1559
|
putString("customCode", error.code)
|
|
1560
1560
|
putString("customMessage", error.message ?: "")
|
|
1561
1561
|
}
|
|
1562
|
-
promise.reject(event.name.toString(), error.message ?: "Unknown Error",
|
|
1562
|
+
promise.reject(event.name.toString(), error.message ?: "Unknown Error", null, promiseErrorMap)
|
|
1563
1563
|
}
|
|
1564
1564
|
)
|
|
1565
1565
|
} catch (e: Exception) {
|
|
@@ -1581,7 +1581,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1581
1581
|
return
|
|
1582
1582
|
}
|
|
1583
1583
|
|
|
1584
|
-
|
|
1584
|
+
eSignFinOS.listSignRequest(
|
|
1585
1585
|
context = currentActivity,
|
|
1586
1586
|
pageNumber = pageNumber,
|
|
1587
1587
|
pageSize = pageSize,
|
|
@@ -1617,7 +1617,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1617
1617
|
putString("customCode", error.code)
|
|
1618
1618
|
putString("customMessage", error.message ?: "")
|
|
1619
1619
|
}
|
|
1620
|
-
promise.reject(event.name.toString(), error.message ?: "Unknown Error",
|
|
1620
|
+
promise.reject(event.name.toString(), error.message ?: "Unknown Error", null, promiseErrorMap)
|
|
1621
1621
|
}
|
|
1622
1622
|
)
|
|
1623
1623
|
} catch (e: Exception) {
|
|
@@ -1645,8 +1645,8 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1645
1645
|
return
|
|
1646
1646
|
}
|
|
1647
1647
|
|
|
1648
|
-
Log.d(TAG, " 🔄 Calling
|
|
1649
|
-
|
|
1648
|
+
Log.d(TAG, " 🔄 Calling eSignFinOS.confirmSign()")
|
|
1649
|
+
eSignFinOS.confirmSign(
|
|
1650
1650
|
context = currentActivity,
|
|
1651
1651
|
signRequestId = signRequestId,
|
|
1652
1652
|
pinCode = pinCode,
|
|
@@ -1692,7 +1692,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1692
1692
|
putString("customCode", error.code)
|
|
1693
1693
|
putString("customMessage", errorMessage)
|
|
1694
1694
|
}
|
|
1695
|
-
promise.reject(event.name.toString(), errorMessage,
|
|
1695
|
+
promise.reject(event.name.toString(), errorMessage, null, promiseErrorMap)
|
|
1696
1696
|
}
|
|
1697
1697
|
}
|
|
1698
1698
|
)
|
|
@@ -1720,7 +1720,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1720
1720
|
return
|
|
1721
1721
|
}
|
|
1722
1722
|
|
|
1723
|
-
|
|
1723
|
+
eSignFinOS.initAuthorize(
|
|
1724
1724
|
context = currentActivity,
|
|
1725
1725
|
serial = serial,
|
|
1726
1726
|
quantity = quantity,
|
|
@@ -1749,7 +1749,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1749
1749
|
putString("customCode", error.code)
|
|
1750
1750
|
putString("customMessage", error.message ?: "")
|
|
1751
1751
|
}
|
|
1752
|
-
promise.reject(event.name.toString(), error.message ?: "Unknown Error",
|
|
1752
|
+
promise.reject(event.name.toString(), error.message ?: "Unknown Error", null, promiseErrorMap)
|
|
1753
1753
|
}
|
|
1754
1754
|
)
|
|
1755
1755
|
} catch (e: Exception) {
|
|
@@ -1772,7 +1772,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1772
1772
|
return
|
|
1773
1773
|
}
|
|
1774
1774
|
|
|
1775
|
-
|
|
1775
|
+
eSignFinOS.listAuthorize(
|
|
1776
1776
|
context = currentActivity,
|
|
1777
1777
|
pageNumber = pageNumber,
|
|
1778
1778
|
pageSize = pageSize,
|
|
@@ -1815,7 +1815,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1815
1815
|
putString("customCode", error.code)
|
|
1816
1816
|
putString("customMessage", error.message ?: "")
|
|
1817
1817
|
}
|
|
1818
|
-
promise.reject(event.name.toString(), error.message ?: "Unknown Error",
|
|
1818
|
+
promise.reject(event.name.toString(), error.message ?: "Unknown Error", null, promiseErrorMap)
|
|
1819
1819
|
}
|
|
1820
1820
|
)
|
|
1821
1821
|
} catch (e: Exception) {
|
|
@@ -1840,7 +1840,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1840
1840
|
return
|
|
1841
1841
|
}
|
|
1842
1842
|
|
|
1843
|
-
|
|
1843
|
+
eSignFinOS.registerAuthorize(
|
|
1844
1844
|
context = currentActivity,
|
|
1845
1845
|
authId = authId,
|
|
1846
1846
|
authData = authData,
|
|
@@ -1870,7 +1870,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1870
1870
|
putString("customCode", error.code)
|
|
1871
1871
|
putString("customMessage", error.message ?: "")
|
|
1872
1872
|
}
|
|
1873
|
-
promise.reject(event.name.toString(), error.message ?: "Unknown Error",
|
|
1873
|
+
promise.reject(event.name.toString(), error.message ?: "Unknown Error", null, promiseErrorMap)
|
|
1874
1874
|
}
|
|
1875
1875
|
)
|
|
1876
1876
|
} catch (e: Exception) {
|
|
@@ -1885,7 +1885,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1885
1885
|
) {
|
|
1886
1886
|
Log.d(TAG, "▶️ signPdfMultiplePositions() called")
|
|
1887
1887
|
try {
|
|
1888
|
-
|
|
1888
|
+
eSignFinOS.signPdfMultiplePositions(
|
|
1889
1889
|
requestJson = requestJson,
|
|
1890
1890
|
callbackSuccess = { result ->
|
|
1891
1891
|
Log.d(TAG, "✅ signPdfMultiplePositions() callbackSuccess - status=${result.status}")
|
|
@@ -1902,7 +1902,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1902
1902
|
putString("message", errorMessage)
|
|
1903
1903
|
}
|
|
1904
1904
|
sendEvent("onESignError", errorMap)
|
|
1905
|
-
promise.reject(event.name.toString(), errorMessage,
|
|
1905
|
+
promise.reject(event.name.toString(), errorMessage, null,
|
|
1906
1906
|
Arguments.createMap().apply {
|
|
1907
1907
|
putString("event", event.name.toString())
|
|
1908
1908
|
putString("customCode", error.code)
|
|
@@ -1922,7 +1922,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1922
1922
|
) {
|
|
1923
1923
|
Log.d(TAG, "▶️ registerRemoteSigning() called")
|
|
1924
1924
|
try {
|
|
1925
|
-
|
|
1925
|
+
eSignFinOS.registerRemoteSigning(
|
|
1926
1926
|
requestJson = requestJson,
|
|
1927
1927
|
callbackSuccess = { result ->
|
|
1928
1928
|
Log.d(TAG, "✅ registerRemoteSigning() success")
|
|
@@ -1947,7 +1947,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1947
1947
|
putString("customCode", error.code)
|
|
1948
1948
|
putString("customMessage", error.message ?: "")
|
|
1949
1949
|
}
|
|
1950
|
-
promise.reject(event.name.toString(), error.message ?: "Unknown Error",
|
|
1950
|
+
promise.reject(event.name.toString(), error.message ?: "Unknown Error", null, promiseErrorMap)
|
|
1951
1951
|
}
|
|
1952
1952
|
)
|
|
1953
1953
|
} catch (e: Exception) {
|
|
@@ -1958,7 +1958,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1958
1958
|
|
|
1959
1959
|
/**
|
|
1960
1960
|
* Composite API: Register Remote Signing + Send Confirmation Document
|
|
1961
|
-
* Align với
|
|
1961
|
+
* Align với eSignFinOSImpl.registerAndConfirm: gọi registerRemoteSigning -> parse sessionId -> sendConfirmationDocument
|
|
1962
1962
|
*/
|
|
1963
1963
|
@ReactMethod
|
|
1964
1964
|
fun registerAndConfirm(
|
|
@@ -1968,7 +1968,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1968
1968
|
) {
|
|
1969
1969
|
Log.d(TAG, "▶️ registerAndConfirm() called")
|
|
1970
1970
|
try {
|
|
1971
|
-
|
|
1971
|
+
eSignFinOS.registerAndConfirm(
|
|
1972
1972
|
requestJson = requestJson,
|
|
1973
1973
|
confirmationDocBase64 = confirmationDocBase64,
|
|
1974
1974
|
callbackSuccess = { result ->
|
|
@@ -1994,7 +1994,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1994
1994
|
putString("customCode", error.code)
|
|
1995
1995
|
putString("customMessage", error.message ?: "")
|
|
1996
1996
|
}
|
|
1997
|
-
promise.reject(event.name.toString(), error.message ?: "Unknown Error",
|
|
1997
|
+
promise.reject(event.name.toString(), error.message ?: "Unknown Error", null, promiseErrorMap)
|
|
1998
1998
|
}
|
|
1999
1999
|
)
|
|
2000
2000
|
} catch (e: Exception) {
|
|
@@ -2010,7 +2010,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
2010
2010
|
) {
|
|
2011
2011
|
Log.d(TAG, "▶️ signPdf() called")
|
|
2012
2012
|
try {
|
|
2013
|
-
|
|
2013
|
+
eSignFinOS.signPdf(
|
|
2014
2014
|
requestJson = requestJson,
|
|
2015
2015
|
callbackSuccess = { result ->
|
|
2016
2016
|
Log.d(TAG, "✅ signPdf() callbackSuccess - status=${result.status}")
|
|
@@ -2027,7 +2027,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
2027
2027
|
putString("message", errorMessage)
|
|
2028
2028
|
}
|
|
2029
2029
|
sendEvent("onESignError", errorMap)
|
|
2030
|
-
promise.reject(event.name.toString(), errorMessage,
|
|
2030
|
+
promise.reject(event.name.toString(), errorMessage, null,
|
|
2031
2031
|
Arguments.createMap().apply {
|
|
2032
2032
|
putString("event", event.name.toString())
|
|
2033
2033
|
putString("customCode", error.code)
|
|
@@ -2047,7 +2047,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
2047
2047
|
) {
|
|
2048
2048
|
Log.d(TAG, "▶️ sendConfirmationDocument() called")
|
|
2049
2049
|
try {
|
|
2050
|
-
|
|
2050
|
+
eSignFinOS.sendConfirmationDocument(
|
|
2051
2051
|
requestJson = requestJson,
|
|
2052
2052
|
callbackSuccess = { rawResponse ->
|
|
2053
2053
|
// Bắn raw data lên - để EKYCModule.ts xử lý
|
|
@@ -2071,7 +2071,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
2071
2071
|
putString("customCode", error.code)
|
|
2072
2072
|
putString("customMessage", error.message ?: "")
|
|
2073
2073
|
}
|
|
2074
|
-
promise.reject(event.name.toString(), error.message ?: "Unknown Error",
|
|
2074
|
+
promise.reject(event.name.toString(), error.message ?: "Unknown Error", null, promiseErrorMap)
|
|
2075
2075
|
}
|
|
2076
2076
|
)
|
|
2077
2077
|
} catch (e: Exception) {
|
package/dist/EKYCModule.js
CHANGED
|
@@ -213,7 +213,7 @@ class SDKeKYC {
|
|
|
213
213
|
try {
|
|
214
214
|
// Convert SDKFaceDetectStatus enum array to string array
|
|
215
215
|
const customActionsStrings = (_b = (_a = config.customActions) === null || _a === void 0 ? void 0 : _a.map(action => String(action))) !== null && _b !== void 0 ? _b : undefined;
|
|
216
|
-
return await nativeModule.startLiveness(config.appKey, config.selfieImage, (_c = config.transactionId) !== null && _c !== void 0 ? _c : '', config.
|
|
216
|
+
return await nativeModule.startLiveness(config.appKey, config.selfieImage, (_c = config.transactionId) !== null && _c !== void 0 ? _c : '', config.isActiveLiveness, config.isShowCameraFont, customActionsStrings, config.activeActionCount, config.forceCaptureTimeout, config.isActiveLivenessColor);
|
|
217
217
|
}
|
|
218
218
|
catch (error) {
|
|
219
219
|
console.error('Liveness Error:', error);
|
package/dist/index.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.OCR_FAKE_PORTRAIT_DETECTED_CMND = exports.OCR_FAKE_CHARACTERS_DETECTED_CMND = exports.OCR_USE_NEW_ID_DOCUMENT_2 = exports.OCR_USE_NEW_ID_DOCUMENT_1 = exports.OCR_FAKE_MRZ = exports.OCR_INVALID_GENDER_CODE = exports.OCR_INVALID_ID_CARD = exports.OCR_GLARE_ID_CARD = exports.OCR_BLURRY_ID_CARD = exports.OCR_CUT_CORNER_ID_CARD = exports.OCR_CANNOT_RECOGNIZE_PORTRAIT = exports.OCR_ID_CARD_FROM_OTHER_DEVICE = exports.OCR_NOT_ORIGINAL_ID_CARD = exports.OCR_MISSING_ID_CARD_PART = exports.OCR_CANNOT_GET_ISSUE_PLACE = exports.OCR_CANNOT_GET_GENDER = exports.OCR_CANNOT_GET_HOMETOWN = exports.OCR_CANNOT_GET_RESIDENCE = exports.OCR_CANNOT_GET_ISSUE_DATE = exports.OCR_CANNOT_GET_EXPIRY_DATE = exports.OCR_CANNOT_GET_BIRTH_YEAR = exports.OCR_CANNOT_GET_NAME = exports.OCR_CANNOT_GET_ID_NUMBER = exports.OCR_WRONG_ID_CARD_SIDE = exports.OCR_UNRECOGNIZED_ID_CARD = exports.SDK_MISS_KEY = exports.ERROR_UNKNOWN = exports.SDK_START_ERROR = exports.SDK_START_FLOW_ERROR = exports.getMessage = exports.getErrorResultFromDetails = exports.createCustom = exports.fromCode = exports.getLocalizedMessage = exports.parseNfcResponse = exports.AuthorizationStatus = exports.AppIDType = exports.getEkycError = exports.customActionsToStrings = exports.SDK_LIVENESS_ACTIONS = exports.SDKFaceDetectStatus = exports.flowToStrings = exports.SDK_FLOW_OPTIONS = exports.SDKFlowType = exports.FinosESignModule = exports.FinosESign = exports.FinosEKYCModule = exports.FinosEKYC = exports.SDKeKYC = exports.sdkEKYC = void 0;
|
|
27
37
|
exports.ESIGN_INVALID_RECOVERY_OR_PIN = exports.ESIGN_SESSION_INVALID_REGISTER = exports.ESIGN_INVALID_USER_ACCOUNT = exports.ESIGN_APP_LIMITED = exports.ESIGN_DEVICE_NOT_INIT = exports.ESIGN_INVALID_LICENSE_CONTENT = exports.ESIGN_INVALID_LICENSE = exports.ESIGN_DEVICE_ALREADY_INIT = exports.ESIGN_SESSION_INVALID = exports.FETCH_HISTORY_ERROR = exports.QRCODE_ERROR = exports.SMS_OTP_RATE_LIMIT = exports.SMS_OTP_NOT_FOUND = exports.SMS_OTP_MAX_ATTEMPTS = exports.SMS_OTP_INVALID_PHONE = exports.SMS_OTP_ERROR = exports.NFC_CHIP_AUTH_FAILED = exports.NFC_USER_CANCEL = exports.NFC_UNKNOWN_ERROR = exports.NFC_IO_ERROR = exports.NFC_INVALID_MRZ_KEY = exports.NFC_CONNECTION_LOST = exports.NFC_MUTUAL_AUTH_FAILED = exports.C06_ERROR = exports.SCAN_NFC_ENABLE = exports.SCAN_NFC_CHECK = exports.SCAN_NFC_ERROR = exports.HEAD_IS_TURNED_IN_SELFIE = exports.NUDITY_DETECTED_IN_SELFIE = exports.READING_GLASSES_DETECTED_IN_SELFIE = exports.EYEWEAR_DETECTED_IN_SELFIE = exports.FACE_OCCLUDED_IN_SELFIE = exports.FACE_IS_BLURRED = exports.MASK_PRESENT_IN_SELFIE = exports.EYES_CLOSED_IN_SELFIE = exports.MULTIPLE_FACES_IN_SELFIE = exports.LIVENESS_FAIL = exports.LIVENESS_ERROR = exports.FACE_ERROR = exports.FACE_HAT_ERROR = exports.OCR_ERROR = exports.OCR_FONT_BACK_NOT_MATCH = exports.OCR_PHOTOCOPY_ID_CARD = exports.OCR_FAKE_PORTRAIT_DETECTED = exports.OCR_FAKE_CHARACTERS_DETECTED_2 = exports.OCR_FAKE_CHARACTERS_DETECTED_1 = exports.OCR_UNKNOWN_ID_NUMBER_LENGTH = exports.OCR_MODIFIED_BIRTH_DATE_DETECTED_CMND = exports.OCR_MODIFIED_SYMBOL_DETECTED_CMND = exports.OCR_FAKE_BIRTH_DATE_DETECTED_CMND = void 0;
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finos_sdk/sdk-ekyc",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.4",
|
|
4
4
|
"description": "React Native SDK for eKYC - Vietnamese CCCD NFC reading, OCR, Liveness detection, Face matching, and C06, eSign, SmsOTP residence verification",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -83,4 +83,4 @@
|
|
|
83
83
|
"engines": {
|
|
84
84
|
"node": ">=18"
|
|
85
85
|
}
|
|
86
|
-
}
|
|
86
|
+
}
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.SDK_NAME = exports.SDK_VERSION = exports.AppIDType = exports.getEkycError = exports.SDKFaceDetectStatus = exports.FinosEKYC = exports.FinosEKYCModule = void 0;
|
|
27
37
|
const react_native_1 = require("react-native");
|
|
@@ -202,9 +212,6 @@ class FinosEKYCModule {
|
|
|
202
212
|
else if (config.activeActionCount !== undefined) {
|
|
203
213
|
console.log('🎲 Random actions count:', config.activeActionCount);
|
|
204
214
|
}
|
|
205
|
-
if (config.switchFrontCamera !== undefined) {
|
|
206
|
-
console.log('📷 Front camera setting:', config.switchFrontCamera ? 'ON' : 'OFF');
|
|
207
|
-
}
|
|
208
215
|
const result = await this.sdk.startLiveness(config);
|
|
209
216
|
console.log('✅ Liveness detection completed:', result.event);
|
|
210
217
|
return result;
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.SDK_NAME = exports.SDK_VERSION = exports.getEkycError = exports.SDKFaceDetectStatus = exports.FinosESign = exports.FinosESignModule = void 0;
|
|
27
37
|
const react_native_1 = require("react-native");
|
|
@@ -14,7 +14,7 @@ let SharingService = class SharingService {
|
|
|
14
14
|
this.imageNFC = null;
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
SharingService =
|
|
17
|
+
exports.SharingService = SharingService;
|
|
18
|
+
exports.SharingService = SharingService = __decorate([
|
|
18
19
|
(0, tsyringe_1.singleton)()
|
|
19
20
|
], SharingService);
|
|
20
|
-
exports.SharingService = SharingService;
|
|
@@ -107,6 +107,40 @@ export declare const ESIGN_INVALID_CONTEXT: EKYCErrorResultLike;
|
|
|
107
107
|
export declare const ESIGN_INVALID_LICENSE_CODE: EKYCErrorResultLike;
|
|
108
108
|
export declare const ESIGN_INVALID_RECOVERY_CODE: EKYCErrorResultLike;
|
|
109
109
|
export declare const ESIGN_INVALID_PIN_CODE: EKYCErrorResultLike;
|
|
110
|
+
export declare const ESIGN_MISSING_NAME: EKYCErrorResultLike;
|
|
111
|
+
export declare const ESIGN_MISSING_DEVICE_ID: EKYCErrorResultLike;
|
|
112
|
+
export declare const ESIGN_INVALID_REQUEST_JSON: EKYCErrorResultLike;
|
|
113
|
+
export declare const ESIGN_MISSING_PIN_CODE: EKYCErrorResultLike;
|
|
114
|
+
export declare const ESIGN_MISSING_USER_PIN: EKYCErrorResultLike;
|
|
115
|
+
export declare const ESIGN_INVALID_PAGE_PARAMS: EKYCErrorResultLike;
|
|
116
|
+
export declare const ESIGN_INVALID_QUANTITY: EKYCErrorResultLike;
|
|
117
|
+
export declare const ESIGN_INVALID_TIME: EKYCErrorResultLike;
|
|
118
|
+
export declare const ESIGN_INVALID_PIN_FORMAT: EKYCErrorResultLike;
|
|
119
|
+
export declare const ESIGN_INVALID_RECOVERY_FORMAT: EKYCErrorResultLike;
|
|
120
|
+
export declare const ESIGN_MISSING_USER_INFO: EKYCErrorResultLike;
|
|
121
|
+
export declare const ESIGN_MISSING_FIELD_IDENTITY: EKYCErrorResultLike;
|
|
122
|
+
export declare const ESIGN_MISSING_FIELD_SOD: EKYCErrorResultLike;
|
|
123
|
+
export declare const ESIGN_MISSING_FIELD_REGISTER_DATE: EKYCErrorResultLike;
|
|
124
|
+
export declare const ESIGN_MISSING_FIELD_EXPIRED_DATE: EKYCErrorResultLike;
|
|
125
|
+
export declare const ESIGN_MISSING_SIGNING_CONTENTS: EKYCErrorResultLike;
|
|
126
|
+
export declare const ESIGN_MISSING_FIELD_DATA: EKYCErrorResultLike;
|
|
127
|
+
export declare const ESIGN_MISSING_TOKEN_INFO: EKYCErrorResultLike;
|
|
128
|
+
export declare const ESIGN_MISSING_FIELD_USERNAME: EKYCErrorResultLike;
|
|
129
|
+
export declare const ESIGN_MISSING_FIELD_SERIAL_TOKEN: EKYCErrorResultLike;
|
|
130
|
+
export declare const ESIGN_MISSING_FIELD_SESSION_ID: EKYCErrorResultLike;
|
|
131
|
+
export declare const ESIGN_MISSING_FIELD_NAME: EKYCErrorResultLike;
|
|
132
|
+
export declare const ESIGN_MISSING_FIELD_ADDRESS: EKYCErrorResultLike;
|
|
133
|
+
export declare const ESIGN_MISSING_FIELD_SIGNATURE: EKYCErrorResultLike;
|
|
134
|
+
export declare const ESIGN_MISSING_EMAIL_OR_PHONE: EKYCErrorResultLike;
|
|
135
|
+
export declare const ESIGN_MISSING_POLICY_AGREEMENT: EKYCErrorResultLike;
|
|
136
|
+
export declare const ESIGN_MISSING_FIELD_POLICY_STATUS: EKYCErrorResultLike;
|
|
137
|
+
export declare const ESIGN_MISSING_FIELD_ACCEPT_TIME: EKYCErrorResultLike;
|
|
138
|
+
export declare const ESIGN_MISSING_FIELD_DEVICE: EKYCErrorResultLike;
|
|
139
|
+
export declare const ESIGN_MISSING_SIGN_POSITIONS: EKYCErrorResultLike;
|
|
140
|
+
export declare const ESIGN_MISSING_SIGN_POSITION_LOCATION: EKYCErrorResultLike;
|
|
141
|
+
export declare const ESIGN_MISSING_FIELD_DOCUMENT_NAME: EKYCErrorResultLike;
|
|
142
|
+
export declare const ESIGN_INVALID_REGISTER_DATE_FORMAT: EKYCErrorResultLike;
|
|
143
|
+
export declare const ESIGN_INVALID_EXPIRED_DATE_FORMAT: EKYCErrorResultLike;
|
|
110
144
|
/**
|
|
111
145
|
* Lấy message đã localize theo ngôn ngữ (giống Kotlin getLocalizedMessage).
|
|
112
146
|
*/
|
|
@@ -5,8 +5,13 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.READING_GLASSES_DETECTED_IN_SELFIE = exports.EYEWEAR_DETECTED_IN_SELFIE = exports.FACE_OCCLUDED_IN_SELFIE = exports.FACE_IS_BLURRED = exports.MASK_PRESENT_IN_SELFIE = exports.EYES_CLOSED_IN_SELFIE = exports.MULTIPLE_FACES_IN_SELFIE = exports.LIVENESS_FAIL = exports.LIVENESS_ERROR = exports.FACE_ERROR = exports.FACE_HAT_ERROR = exports.OCR_ERROR = exports.OCR_FONT_BACK_NOT_MATCH = exports.OCR_PHOTOCOPY_ID_CARD = exports.OCR_FAKE_PORTRAIT_DETECTED = exports.OCR_FAKE_CHARACTERS_DETECTED_2 = exports.OCR_FAKE_CHARACTERS_DETECTED_1 = exports.OCR_UNKNOWN_ID_NUMBER_LENGTH = exports.OCR_MODIFIED_BIRTH_DATE_DETECTED_CMND = exports.OCR_MODIFIED_SYMBOL_DETECTED_CMND = exports.OCR_FAKE_BIRTH_DATE_DETECTED_CMND = exports.OCR_FAKE_PORTRAIT_DETECTED_CMND = exports.OCR_FAKE_CHARACTERS_DETECTED_CMND = exports.OCR_USE_NEW_ID_DOCUMENT_2 = exports.OCR_USE_NEW_ID_DOCUMENT_1 = exports.OCR_FAKE_MRZ = exports.OCR_INVALID_GENDER_CODE = exports.OCR_INVALID_ID_CARD = exports.OCR_GLARE_ID_CARD = exports.OCR_BLURRY_ID_CARD = exports.OCR_CUT_CORNER_ID_CARD = exports.OCR_CANNOT_RECOGNIZE_PORTRAIT = exports.OCR_ID_CARD_FROM_OTHER_DEVICE = exports.OCR_NOT_ORIGINAL_ID_CARD = exports.OCR_MISSING_ID_CARD_PART = exports.OCR_CANNOT_GET_ISSUE_PLACE = exports.OCR_CANNOT_GET_GENDER = exports.OCR_CANNOT_GET_HOMETOWN = exports.OCR_CANNOT_GET_RESIDENCE = exports.OCR_CANNOT_GET_ISSUE_DATE = exports.OCR_CANNOT_GET_EXPIRY_DATE = exports.OCR_CANNOT_GET_BIRTH_YEAR = exports.OCR_CANNOT_GET_NAME = exports.OCR_CANNOT_GET_ID_NUMBER = exports.OCR_WRONG_ID_CARD_SIDE = exports.OCR_UNRECOGNIZED_ID_CARD = exports.SDK_MISS_KEY = exports.ERROR_UNKNOWN = exports.SDK_START_ERROR = exports.SDK_START_FLOW_ERROR = void 0;
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
8
|
+
exports.ESIGN_MISSING_NAME = exports.ESIGN_INVALID_PIN_CODE = exports.ESIGN_INVALID_RECOVERY_CODE = exports.ESIGN_INVALID_LICENSE_CODE = exports.ESIGN_INVALID_CONTEXT = exports.ESIGN_MISSING_REQUEST_ID = exports.ESIGN_MISSING_SERIAL = exports.ESIGN_MISSING_IDENTITY = exports.ESIGN_MISSING_ACCESS_TOKEN = exports.ESIGN_NO_SESSION_ID = exports.ESIGN_MISSING_CONFIRMATION_DOC = exports.ESIGN_MISSING_REQUEST_JSON = exports.ESIGN_MISSING_CCCD = exports.ESIGN_MISSING_TOKEN = exports.ESIGN_ERROR_UNKNOWN = exports.ESIGN_AUTH_REQUEST_EXISTS = exports.ESIGN_INVALID_CERT_FOR_AUTH = exports.ESIGN_INVALID_SIGN_COUNT_OR_TIME = exports.ESIGN_AUTH_EXISTS = exports.ESIGN_SESSION_INVALID_LIST_CERT = exports.ESIGN_INVALID_RECOVERY_OR_PIN = exports.ESIGN_SESSION_INVALID_REGISTER = exports.ESIGN_INVALID_USER_ACCOUNT = exports.ESIGN_APP_LIMITED = exports.ESIGN_DEVICE_NOT_INIT = exports.ESIGN_INVALID_LICENSE_CONTENT = exports.ESIGN_INVALID_LICENSE = exports.ESIGN_DEVICE_ALREADY_INIT = exports.ESIGN_SESSION_INVALID = exports.FETCH_HISTORY_ERROR = exports.QRCODE_ERROR = exports.USER_CANCEL = exports.SMS_OTP_RATE_LIMIT = exports.SMS_OTP_NOT_FOUND = exports.SMS_OTP_MAX_ATTEMPTS = exports.SMS_OTP_INVALID_PHONE = exports.SMS_OTP_ERROR = exports.NFC_CHIP_AUTH_FAILED = exports.NFC_USER_CANCEL = exports.NFC_UNKNOWN_ERROR = exports.NFC_IO_ERROR = exports.NFC_INVALID_MRZ_KEY = exports.NFC_CONNECTION_LOST = exports.NFC_MUTUAL_AUTH_FAILED = exports.C06_ERROR = exports.SCAN_NFC_ENABLE = exports.SCAN_NFC_CHECK = exports.SCAN_NFC_ERROR = exports.HEAD_IS_TURNED_IN_SELFIE = exports.NUDITY_DETECTED_IN_SELFIE = void 0;
|
|
9
|
+
exports.ESIGN_INVALID_EXPIRED_DATE_FORMAT = exports.ESIGN_INVALID_REGISTER_DATE_FORMAT = exports.ESIGN_MISSING_FIELD_DOCUMENT_NAME = exports.ESIGN_MISSING_SIGN_POSITION_LOCATION = exports.ESIGN_MISSING_SIGN_POSITIONS = exports.ESIGN_MISSING_FIELD_DEVICE = exports.ESIGN_MISSING_FIELD_ACCEPT_TIME = exports.ESIGN_MISSING_FIELD_POLICY_STATUS = exports.ESIGN_MISSING_POLICY_AGREEMENT = exports.ESIGN_MISSING_EMAIL_OR_PHONE = exports.ESIGN_MISSING_FIELD_SIGNATURE = exports.ESIGN_MISSING_FIELD_ADDRESS = exports.ESIGN_MISSING_FIELD_NAME = exports.ESIGN_MISSING_FIELD_SESSION_ID = exports.ESIGN_MISSING_FIELD_SERIAL_TOKEN = exports.ESIGN_MISSING_FIELD_USERNAME = exports.ESIGN_MISSING_TOKEN_INFO = exports.ESIGN_MISSING_FIELD_DATA = exports.ESIGN_MISSING_SIGNING_CONTENTS = exports.ESIGN_MISSING_FIELD_EXPIRED_DATE = exports.ESIGN_MISSING_FIELD_REGISTER_DATE = exports.ESIGN_MISSING_FIELD_SOD = exports.ESIGN_MISSING_FIELD_IDENTITY = exports.ESIGN_MISSING_USER_INFO = exports.ESIGN_INVALID_RECOVERY_FORMAT = exports.ESIGN_INVALID_PIN_FORMAT = exports.ESIGN_INVALID_TIME = exports.ESIGN_INVALID_QUANTITY = exports.ESIGN_INVALID_PAGE_PARAMS = exports.ESIGN_MISSING_USER_PIN = exports.ESIGN_MISSING_PIN_CODE = exports.ESIGN_INVALID_REQUEST_JSON = exports.ESIGN_MISSING_DEVICE_ID = void 0;
|
|
10
|
+
exports.getLocalizedMessage = getLocalizedMessage;
|
|
11
|
+
exports.fromCode = fromCode;
|
|
12
|
+
exports.createCustom = createCustom;
|
|
13
|
+
exports.getErrorResultFromDetails = getErrorResultFromDetails;
|
|
14
|
+
exports.getMessage = getMessage;
|
|
10
15
|
function def(code, viMessage, enMessage) {
|
|
11
16
|
return { code, viMessage, enMessage };
|
|
12
17
|
}
|
|
@@ -137,6 +142,43 @@ exports.ESIGN_INVALID_LICENSE_CODE = def('611', 'Mã license không được đ
|
|
|
137
142
|
exports.ESIGN_INVALID_RECOVERY_CODE = def('612', 'Mã recovery không được để trống (8 chữ số)', 'Recovery code cannot be empty (8 digits required)');
|
|
138
143
|
exports.ESIGN_INVALID_PIN_CODE = def('613', 'Mã PIN không được để trống (6 chữ số)', 'PIN code cannot be empty (6 digits required)');
|
|
139
144
|
// ========================================
|
|
145
|
+
// ESIGN VALIDATION ERRORS (614 -> 649)
|
|
146
|
+
// ========================================
|
|
147
|
+
exports.ESIGN_MISSING_NAME = def('614', 'Thiếu tên người dùng', 'User name is required');
|
|
148
|
+
exports.ESIGN_MISSING_DEVICE_ID = def('615', 'Thiếu Device ID', 'Device ID is required');
|
|
149
|
+
exports.ESIGN_INVALID_REQUEST_JSON = def('616', 'Request JSON không hợp lệ (không parse được)', 'Request JSON is invalid (cannot parse)');
|
|
150
|
+
exports.ESIGN_MISSING_PIN_CODE = def('617', 'Thiếu mã PIN', 'PIN code is required');
|
|
151
|
+
exports.ESIGN_MISSING_USER_PIN = def('618', 'Thiếu mã PIN người dùng', 'User PIN is required');
|
|
152
|
+
exports.ESIGN_INVALID_PAGE_PARAMS = def('619', 'pageNumber và pageSize phải lớn hơn 0', 'pageNumber and pageSize must be greater than 0');
|
|
153
|
+
exports.ESIGN_INVALID_QUANTITY = def('620', 'Số lượng (quantity) phải lớn hơn 0', 'Quantity must be greater than 0');
|
|
154
|
+
exports.ESIGN_INVALID_TIME = def('621', 'Thời gian (time) phải lớn hơn 0', 'Time must be greater than 0');
|
|
155
|
+
exports.ESIGN_INVALID_PIN_FORMAT = def('622', 'Mã PIN phải đúng 6 chữ số', 'PIN code must be exactly 6 digits');
|
|
156
|
+
exports.ESIGN_INVALID_RECOVERY_FORMAT = def('623', 'Mã recovery phải đúng 8 chữ số', 'Recovery code must be exactly 8 digits');
|
|
157
|
+
exports.ESIGN_MISSING_USER_INFO = def('624', 'Thiếu object userInfo trong request JSON', 'userInfo object is required in request JSON');
|
|
158
|
+
exports.ESIGN_MISSING_FIELD_IDENTITY = def('625', 'Thiếu userInfo.identity trong request JSON', 'userInfo.identity is required in request JSON');
|
|
159
|
+
exports.ESIGN_MISSING_FIELD_SOD = def('626', 'Thiếu userInfo.sod trong request JSON', 'userInfo.sod is required in request JSON');
|
|
160
|
+
exports.ESIGN_MISSING_FIELD_REGISTER_DATE = def('627', 'Thiếu userInfo.registerDate trong request JSON', 'userInfo.registerDate is required in request JSON');
|
|
161
|
+
exports.ESIGN_MISSING_FIELD_EXPIRED_DATE = def('628', 'Thiếu userInfo.expiredDate trong request JSON', 'userInfo.expiredDate is required in request JSON');
|
|
162
|
+
exports.ESIGN_MISSING_SIGNING_CONTENTS = def('629', 'Thiếu signingRequestContents trong request JSON', 'signingRequestContents is required in request JSON');
|
|
163
|
+
exports.ESIGN_MISSING_FIELD_DATA = def('630', 'Thiếu data (PDF base64) trong signingRequestContents', 'data (PDF base64) is required in signingRequestContents');
|
|
164
|
+
exports.ESIGN_MISSING_TOKEN_INFO = def('631', 'Thiếu tokenInfo trong request JSON', 'tokenInfo object is required in request JSON');
|
|
165
|
+
exports.ESIGN_MISSING_FIELD_USERNAME = def('632', 'Thiếu tokenInfo.username trong request JSON', 'tokenInfo.username is required in request JSON');
|
|
166
|
+
exports.ESIGN_MISSING_FIELD_SERIAL_TOKEN = def('633', 'Thiếu tokenInfo.serial trong request JSON', 'tokenInfo.serial is required in request JSON');
|
|
167
|
+
exports.ESIGN_MISSING_FIELD_SESSION_ID = def('634', 'Thiếu sessionId trong request JSON', 'sessionId is required in request JSON');
|
|
168
|
+
exports.ESIGN_MISSING_FIELD_NAME = def('635', 'Thiếu userInfo.name trong request JSON', 'userInfo.name is required in request JSON');
|
|
169
|
+
exports.ESIGN_MISSING_FIELD_ADDRESS = def('636', 'Thiếu userInfo.address trong request JSON', 'userInfo.address is required in request JSON');
|
|
170
|
+
exports.ESIGN_MISSING_FIELD_SIGNATURE = def('637', 'Thiếu userInfo.signature trong request JSON', 'userInfo.signature is required in request JSON');
|
|
171
|
+
exports.ESIGN_MISSING_EMAIL_OR_PHONE = def('638', 'Phải có ít nhất email hoặc phone trong request JSON', 'At least email or phone is required in request JSON');
|
|
172
|
+
exports.ESIGN_MISSING_POLICY_AGREEMENT = def('639', 'Thiếu policyAgreement trong request JSON', 'policyAgreement object is required in request JSON');
|
|
173
|
+
exports.ESIGN_MISSING_FIELD_POLICY_STATUS = def('640', 'Thiếu policyAgreement.policyStatus trong request JSON', 'policyAgreement.policyStatus is required in request JSON');
|
|
174
|
+
exports.ESIGN_MISSING_FIELD_ACCEPT_TIME = def('641', 'Thiếu policyAgreement.acceptTime trong request JSON', 'policyAgreement.acceptTime is required in request JSON');
|
|
175
|
+
exports.ESIGN_MISSING_FIELD_DEVICE = def('642', 'Thiếu policyAgreement.device trong request JSON', 'policyAgreement.device is required in request JSON');
|
|
176
|
+
exports.ESIGN_MISSING_SIGN_POSITIONS = def('645', 'Thiếu signPositions trong signingRequestContents (API multiple positions)', 'signPositions array is required in signingRequestContents');
|
|
177
|
+
exports.ESIGN_MISSING_SIGN_POSITION_LOCATION = def('646', 'Thiếu location trong signPositions', 'location object is required in each signPosition');
|
|
178
|
+
exports.ESIGN_MISSING_FIELD_DOCUMENT_NAME = def('647', 'Thiếu documentName trong signingRequestContents', 'documentName is required in signingRequestContents');
|
|
179
|
+
exports.ESIGN_INVALID_REGISTER_DATE_FORMAT = def('648', 'userInfo.registerDate phải đúng định dạng dd/MM/yyyy', 'userInfo.registerDate must be in dd/MM/yyyy format');
|
|
180
|
+
exports.ESIGN_INVALID_EXPIRED_DATE_FORMAT = def('649', 'userInfo.expiredDate phải đúng định dạng dd/MM/yyyy', 'userInfo.expiredDate must be in dd/MM/yyyy format');
|
|
181
|
+
// ========================================
|
|
140
182
|
// Predefined list & code map (companion object)
|
|
141
183
|
// ========================================
|
|
142
184
|
const PREDEFINED_ERRORS = [
|
|
@@ -165,6 +207,19 @@ const PREDEFINED_ERRORS = [
|
|
|
165
207
|
exports.ESIGN_INVALID_USER_ACCOUNT, exports.ESIGN_SESSION_INVALID_REGISTER, exports.ESIGN_INVALID_RECOVERY_OR_PIN,
|
|
166
208
|
exports.ESIGN_SESSION_INVALID_LIST_CERT, exports.ESIGN_AUTH_EXISTS, exports.ESIGN_INVALID_SIGN_COUNT_OR_TIME,
|
|
167
209
|
exports.ESIGN_INVALID_CERT_FOR_AUTH, exports.ESIGN_AUTH_REQUEST_EXISTS,
|
|
210
|
+
exports.ESIGN_MISSING_NAME, exports.ESIGN_MISSING_DEVICE_ID, exports.ESIGN_INVALID_REQUEST_JSON,
|
|
211
|
+
exports.ESIGN_MISSING_PIN_CODE, exports.ESIGN_MISSING_USER_PIN, exports.ESIGN_INVALID_PAGE_PARAMS,
|
|
212
|
+
exports.ESIGN_INVALID_QUANTITY, exports.ESIGN_INVALID_TIME, exports.ESIGN_INVALID_PIN_FORMAT, exports.ESIGN_INVALID_RECOVERY_FORMAT,
|
|
213
|
+
exports.ESIGN_MISSING_USER_INFO, exports.ESIGN_MISSING_FIELD_IDENTITY, exports.ESIGN_MISSING_FIELD_SOD,
|
|
214
|
+
exports.ESIGN_MISSING_FIELD_REGISTER_DATE, exports.ESIGN_MISSING_FIELD_EXPIRED_DATE,
|
|
215
|
+
exports.ESIGN_MISSING_SIGNING_CONTENTS, exports.ESIGN_MISSING_FIELD_DATA, exports.ESIGN_MISSING_TOKEN_INFO,
|
|
216
|
+
exports.ESIGN_MISSING_FIELD_USERNAME, exports.ESIGN_MISSING_FIELD_SERIAL_TOKEN, exports.ESIGN_MISSING_FIELD_SESSION_ID,
|
|
217
|
+
exports.ESIGN_MISSING_FIELD_NAME, exports.ESIGN_MISSING_FIELD_ADDRESS, exports.ESIGN_MISSING_FIELD_SIGNATURE,
|
|
218
|
+
exports.ESIGN_MISSING_EMAIL_OR_PHONE, exports.ESIGN_MISSING_POLICY_AGREEMENT,
|
|
219
|
+
exports.ESIGN_MISSING_FIELD_POLICY_STATUS, exports.ESIGN_MISSING_FIELD_ACCEPT_TIME, exports.ESIGN_MISSING_FIELD_DEVICE,
|
|
220
|
+
exports.ESIGN_MISSING_SIGN_POSITIONS, exports.ESIGN_MISSING_SIGN_POSITION_LOCATION,
|
|
221
|
+
exports.ESIGN_MISSING_FIELD_DOCUMENT_NAME,
|
|
222
|
+
exports.ESIGN_INVALID_REGISTER_DATE_FORMAT, exports.ESIGN_INVALID_EXPIRED_DATE_FORMAT,
|
|
168
223
|
exports.USER_CANCEL,
|
|
169
224
|
];
|
|
170
225
|
const CODE_MAP = {};
|
|
@@ -179,7 +234,6 @@ function getLocalizedMessage(result, language) {
|
|
|
179
234
|
}
|
|
180
235
|
return (result.viMessage || result.enMessage).trim();
|
|
181
236
|
}
|
|
182
|
-
exports.getLocalizedMessage = getLocalizedMessage;
|
|
183
237
|
/**
|
|
184
238
|
* Tìm EKYCErrorResult theo code (giống Kotlin fromCode).
|
|
185
239
|
*/
|
|
@@ -187,14 +241,12 @@ function fromCode(code) {
|
|
|
187
241
|
var _a;
|
|
188
242
|
return (_a = CODE_MAP[code]) !== null && _a !== void 0 ? _a : null;
|
|
189
243
|
}
|
|
190
|
-
exports.fromCode = fromCode;
|
|
191
244
|
/**
|
|
192
245
|
* Tạo lỗi tùy biến (giống Kotlin createCustom / CustomError).
|
|
193
246
|
*/
|
|
194
247
|
function createCustom(code, message) {
|
|
195
248
|
return defSame(code, message);
|
|
196
249
|
}
|
|
197
|
-
exports.createCustom = createCustom;
|
|
198
250
|
/**
|
|
199
251
|
* Lấy error từ danh sách details (giống Kotlin getErrorResultFromDetails).
|
|
200
252
|
* Chi tiết có thể có .code hoặc .getCode().
|
|
@@ -218,11 +270,9 @@ function getErrorResultFromDetails(details) {
|
|
|
218
270
|
}
|
|
219
271
|
return exports.ERROR_UNKNOWN;
|
|
220
272
|
}
|
|
221
|
-
exports.getErrorResultFromDetails = getErrorResultFromDetails;
|
|
222
273
|
/**
|
|
223
274
|
* Trả về message theo ngôn ngữ cho một result (alias tiện).
|
|
224
275
|
*/
|
|
225
276
|
function getMessage(result, lang) {
|
|
226
277
|
return getLocalizedMessage(result, lang);
|
|
227
278
|
}
|
|
228
|
-
exports.getMessage = getMessage;
|
|
@@ -17,4 +17,4 @@ var AuthorizationStatus;
|
|
|
17
17
|
AuthorizationStatus["INACTIVE"] = "INACTIVE";
|
|
18
18
|
AuthorizationStatus["REJECTED"] = "REJECTED";
|
|
19
19
|
AuthorizationStatus["ACTIVE"] = "ACTIVE";
|
|
20
|
-
})(AuthorizationStatus
|
|
20
|
+
})(AuthorizationStatus || (exports.AuthorizationStatus = AuthorizationStatus = {}));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SDK_FLOW_OPTIONS = exports.SDKFlowType = void 0;
|
|
4
|
+
exports.flowToStrings = flowToStrings;
|
|
4
5
|
/**
|
|
5
6
|
* Các bước trong flow eKYC – map với Android SDKType (OCR, NFC, LIVENESS).
|
|
6
7
|
* Bên sử dụng truyền enum vào SDK thay vì string.
|
|
@@ -14,7 +15,7 @@ var SDKFlowType;
|
|
|
14
15
|
SDKFlowType["OCR"] = "OCR";
|
|
15
16
|
SDKFlowType["NFC"] = "NFC";
|
|
16
17
|
SDKFlowType["LIVENESS"] = "LIVENESS";
|
|
17
|
-
})(SDKFlowType
|
|
18
|
+
})(SDKFlowType || (exports.SDKFlowType = SDKFlowType = {}));
|
|
18
19
|
/** Mảng đầy đủ các bước (dùng cho picker / default flow). */
|
|
19
20
|
exports.SDK_FLOW_OPTIONS = [
|
|
20
21
|
SDKFlowType.OCR,
|
|
@@ -25,4 +26,3 @@ exports.SDK_FLOW_OPTIONS = [
|
|
|
25
26
|
function flowToStrings(flow) {
|
|
26
27
|
return flow.map(f => f);
|
|
27
28
|
}
|
|
28
|
-
exports.flowToStrings = flowToStrings;
|
|
@@ -24,9 +24,8 @@ export interface LivenessConfig {
|
|
|
24
24
|
appKey: string;
|
|
25
25
|
transactionId?: string;
|
|
26
26
|
selfieImage: string;
|
|
27
|
-
switchFrontCamera?: boolean;
|
|
28
27
|
isActiveLiveness?: boolean;
|
|
29
|
-
|
|
28
|
+
isActiveLivenessColor?: boolean;
|
|
30
29
|
isShowCameraFont?: boolean;
|
|
31
30
|
customActions?: SDKFaceDetectStatus[];
|
|
32
31
|
activeActionCount?: number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SDK_LIVENESS_ACTIONS = exports.SDKFaceDetectStatus = void 0;
|
|
4
|
+
exports.customActionsToStrings = customActionsToStrings;
|
|
4
5
|
/**
|
|
5
6
|
* Custom actions cho liveness – map Android SDKFaceDetectStatus.
|
|
6
7
|
* Bên sử dụng truyền enum vào optionConfig.customActions thay vì string.
|
|
@@ -18,7 +19,7 @@ var SDKFaceDetectStatus;
|
|
|
18
19
|
SDKFaceDetectStatus["WINK_LEFT"] = "WINK_LEFT";
|
|
19
20
|
SDKFaceDetectStatus["WINK_RIGHT"] = "WINK_RIGHT";
|
|
20
21
|
SDKFaceDetectStatus["STRAIGHT"] = "STRAIGHT";
|
|
21
|
-
})(SDKFaceDetectStatus
|
|
22
|
+
})(SDKFaceDetectStatus || (exports.SDKFaceDetectStatus = SDKFaceDetectStatus = {}));
|
|
22
23
|
/** Mảng đầy đủ các action (trừ STRAIGHT thường được SDK tự thêm cuối) – dùng cho picker / default. */
|
|
23
24
|
exports.SDK_LIVENESS_ACTIONS = [
|
|
24
25
|
SDKFaceDetectStatus.LEFT,
|
|
@@ -37,4 +38,3 @@ exports.SDK_LIVENESS_ACTIONS = [
|
|
|
37
38
|
function customActionsToStrings(actions) {
|
|
38
39
|
return actions.map(a => a);
|
|
39
40
|
}
|
|
40
|
-
exports.customActionsToStrings = customActionsToStrings;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.AppIDType = void 0;
|
|
4
|
+
exports.getEkycError = getEkycError;
|
|
4
5
|
/**
|
|
5
6
|
* AppIDType – loại app ID truyền vào SDK.
|
|
6
7
|
* Map native: Android AppIDType.NONE / AppIDType.HD_BANK / AppIDType.VIKKI,
|
|
@@ -11,7 +12,7 @@ var AppIDType;
|
|
|
11
12
|
AppIDType["NONE"] = "NONE";
|
|
12
13
|
AppIDType["HD_BANK"] = "HD_BANK";
|
|
13
14
|
AppIDType["VIKKI"] = "VIKKI";
|
|
14
|
-
})(AppIDType
|
|
15
|
+
})(AppIDType || (exports.AppIDType = AppIDType = {}));
|
|
15
16
|
/**
|
|
16
17
|
* Parse chuỗi lỗi cũ từ native (trước khi gửi object): "CustomError(customCode=109, customMessage=Lỗi Face compare...)"
|
|
17
18
|
* Giúp app vẫn lấy được customCode/customMessage khi dùng bản native chưa có userInfo.
|
|
@@ -55,4 +56,3 @@ function getEkycError(error) {
|
|
|
55
56
|
message,
|
|
56
57
|
};
|
|
57
58
|
}
|
|
58
|
-
exports.getEkycError = getEkycError;
|
package/dist/src/utils/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseNfcResponse =
|
|
3
|
+
exports.parseNfcResponse = parseNfcResponse;
|
|
4
4
|
// Utility function to parse NFC response string to NFCData
|
|
5
5
|
function parseNfcResponse(nfcResponseStr) {
|
|
6
6
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -41,5 +41,4 @@ function parseNfcResponse(nfcResponseStr) {
|
|
|
41
41
|
return null;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
exports.parseNfcResponse = parseNfcResponse;
|
|
45
44
|
;
|
package/ios/EKYCModule.swift
CHANGED
|
@@ -161,8 +161,8 @@ class EKYCModule: RCTEventEmitter {
|
|
|
161
161
|
|
|
162
162
|
// MARK: - Liveness
|
|
163
163
|
|
|
164
|
-
@objc(startLiveness:selfieImage:transactionId:
|
|
165
|
-
func startLiveness(_ appKey: String, selfieImage: String, transactionId: String,
|
|
164
|
+
@objc(startLiveness:selfieImage:transactionId:isActiveLiveness:isShowCameraFont:customActionsArray:activeActionCount:forceCaptureTimeout:isActiveLivenessColor:resolver:rejecter:)
|
|
165
|
+
func startLiveness(_ appKey: String, selfieImage: String, transactionId: String, isActiveLiveness: Bool, isShowCameraFont: Bool, customActionsArray: [String]?, activeActionCount: Int, forceCaptureTimeout: Double, isActiveLivenessColor: Bool, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
166
166
|
DispatchQueue.main.async { [weak self] in
|
|
167
167
|
guard let vc = self?.rootVC else { reject("NO_VC", "No root view controller", nil); return }
|
|
168
168
|
guard let selfieUIImage = self?.resolveImageInput(selfieImage) else {
|
|
@@ -172,8 +172,9 @@ class EKYCModule: RCTEventEmitter {
|
|
|
172
172
|
switch $0 { case "LEFT": return .left; case "RIGHT": return .right; case "STRAIGHT": return .straight; default: return nil }
|
|
173
173
|
}
|
|
174
174
|
let livenessConfig = LivenessConfig(
|
|
175
|
-
isActiveLiveness:
|
|
176
|
-
|
|
175
|
+
isActiveLiveness: isActiveLiveness,
|
|
176
|
+
isActiveLivenessColor: isActiveLivenessColor,
|
|
177
|
+
isShowCameraFont: isShowCameraFont,
|
|
177
178
|
customActions: customActions?.isEmpty == false ? customActions : nil,
|
|
178
179
|
activeActionCount: activeActionCount > 0 ? activeActionCount : 2,
|
|
179
180
|
forceCaptureTimeout: Int64(forceCaptureTimeout * 1000),
|
package/ios/EKYCModuleBridge.m
CHANGED
|
@@ -47,14 +47,14 @@ RCT_EXTERN_METHOD(startOcr : (NSString *)appKey idImage : (
|
|
|
47
47
|
// MARK: - Liveness
|
|
48
48
|
RCT_EXTERN_METHOD(
|
|
49
49
|
startLiveness : (NSString *)appKey selfieImage : (NSString *)selfieImage
|
|
50
|
-
transactionId : (NSString *)transactionId
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
50
|
+
transactionId : (NSString *)transactionId isActiveLiveness : (BOOL)
|
|
51
|
+
isActiveLiveness isShowCameraFont : (BOOL)isShowCameraFont
|
|
52
|
+
customActionsArray : (NSArray *)customActionsArray
|
|
53
|
+
activeActionCount : (NSInteger)activeActionCount
|
|
54
|
+
forceCaptureTimeout : (double)forceCaptureTimeout
|
|
55
|
+
isActiveLivenessColor : (BOOL)isActiveLivenessColor
|
|
56
|
+
resolver : (RCTPromiseResolveBlock)resolve
|
|
57
|
+
rejecter : (RCTPromiseRejectBlock)reject)
|
|
58
58
|
|
|
59
59
|
// MARK: - FaceCompare
|
|
60
60
|
RCT_EXTERN_METHOD(startFaceCompare : (NSString *)appKey transactionId : (
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finos_sdk/sdk-ekyc",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.4",
|
|
4
4
|
"description": "React Native SDK for eKYC - Vietnamese CCCD NFC reading, OCR, Liveness detection, Face matching, and C06, eSign, SmsOTP residence verification",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -83,4 +83,4 @@
|
|
|
83
83
|
"engines": {
|
|
84
84
|
"node": ">=18"
|
|
85
85
|
}
|
|
86
|
-
}
|
|
86
|
+
}
|
|
@@ -207,11 +207,6 @@ export class FinosEKYCModule {
|
|
|
207
207
|
} else if (config.activeActionCount !== undefined) {
|
|
208
208
|
console.log('🎲 Random actions count:', config.activeActionCount);
|
|
209
209
|
}
|
|
210
|
-
if (config.switchFrontCamera !== undefined) {
|
|
211
|
-
console.log('📷 Front camera setting:', config.switchFrontCamera ? 'ON' : 'OFF');
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
|
|
215
210
|
|
|
216
211
|
const result = await this.sdk.startLiveness(config);
|
|
217
212
|
console.log('✅ Liveness detection completed:', result.event);
|
|
@@ -150,6 +150,44 @@ export const ESIGN_INVALID_LICENSE_CODE = def('611', 'Mã license không đượ
|
|
|
150
150
|
export const ESIGN_INVALID_RECOVERY_CODE = def('612', 'Mã recovery không được để trống (8 chữ số)', 'Recovery code cannot be empty (8 digits required)');
|
|
151
151
|
export const ESIGN_INVALID_PIN_CODE = def('613', 'Mã PIN không được để trống (6 chữ số)', 'PIN code cannot be empty (6 digits required)');
|
|
152
152
|
|
|
153
|
+
// ========================================
|
|
154
|
+
// ESIGN VALIDATION ERRORS (614 -> 649)
|
|
155
|
+
// ========================================
|
|
156
|
+
export const ESIGN_MISSING_NAME = def('614', 'Thiếu tên người dùng', 'User name is required');
|
|
157
|
+
export const ESIGN_MISSING_DEVICE_ID = def('615', 'Thiếu Device ID', 'Device ID is required');
|
|
158
|
+
export const ESIGN_INVALID_REQUEST_JSON = def('616', 'Request JSON không hợp lệ (không parse được)', 'Request JSON is invalid (cannot parse)');
|
|
159
|
+
export const ESIGN_MISSING_PIN_CODE = def('617', 'Thiếu mã PIN', 'PIN code is required');
|
|
160
|
+
export const ESIGN_MISSING_USER_PIN = def('618', 'Thiếu mã PIN người dùng', 'User PIN is required');
|
|
161
|
+
export const ESIGN_INVALID_PAGE_PARAMS = def('619', 'pageNumber và pageSize phải lớn hơn 0', 'pageNumber and pageSize must be greater than 0');
|
|
162
|
+
export const ESIGN_INVALID_QUANTITY = def('620', 'Số lượng (quantity) phải lớn hơn 0', 'Quantity must be greater than 0');
|
|
163
|
+
export const ESIGN_INVALID_TIME = def('621', 'Thời gian (time) phải lớn hơn 0', 'Time must be greater than 0');
|
|
164
|
+
export const ESIGN_INVALID_PIN_FORMAT = def('622', 'Mã PIN phải đúng 6 chữ số', 'PIN code must be exactly 6 digits');
|
|
165
|
+
export const ESIGN_INVALID_RECOVERY_FORMAT = def('623', 'Mã recovery phải đúng 8 chữ số', 'Recovery code must be exactly 8 digits');
|
|
166
|
+
export const ESIGN_MISSING_USER_INFO = def('624', 'Thiếu object userInfo trong request JSON', 'userInfo object is required in request JSON');
|
|
167
|
+
export const ESIGN_MISSING_FIELD_IDENTITY = def('625', 'Thiếu userInfo.identity trong request JSON', 'userInfo.identity is required in request JSON');
|
|
168
|
+
export const ESIGN_MISSING_FIELD_SOD = def('626', 'Thiếu userInfo.sod trong request JSON', 'userInfo.sod is required in request JSON');
|
|
169
|
+
export const ESIGN_MISSING_FIELD_REGISTER_DATE = def('627', 'Thiếu userInfo.registerDate trong request JSON', 'userInfo.registerDate is required in request JSON');
|
|
170
|
+
export const ESIGN_MISSING_FIELD_EXPIRED_DATE = def('628', 'Thiếu userInfo.expiredDate trong request JSON', 'userInfo.expiredDate is required in request JSON');
|
|
171
|
+
export const ESIGN_MISSING_SIGNING_CONTENTS = def('629', 'Thiếu signingRequestContents trong request JSON', 'signingRequestContents is required in request JSON');
|
|
172
|
+
export const ESIGN_MISSING_FIELD_DATA = def('630', 'Thiếu data (PDF base64) trong signingRequestContents', 'data (PDF base64) is required in signingRequestContents');
|
|
173
|
+
export const ESIGN_MISSING_TOKEN_INFO = def('631', 'Thiếu tokenInfo trong request JSON', 'tokenInfo object is required in request JSON');
|
|
174
|
+
export const ESIGN_MISSING_FIELD_USERNAME = def('632', 'Thiếu tokenInfo.username trong request JSON', 'tokenInfo.username is required in request JSON');
|
|
175
|
+
export const ESIGN_MISSING_FIELD_SERIAL_TOKEN = def('633', 'Thiếu tokenInfo.serial trong request JSON', 'tokenInfo.serial is required in request JSON');
|
|
176
|
+
export const ESIGN_MISSING_FIELD_SESSION_ID = def('634', 'Thiếu sessionId trong request JSON', 'sessionId is required in request JSON');
|
|
177
|
+
export const ESIGN_MISSING_FIELD_NAME = def('635', 'Thiếu userInfo.name trong request JSON', 'userInfo.name is required in request JSON');
|
|
178
|
+
export const ESIGN_MISSING_FIELD_ADDRESS = def('636', 'Thiếu userInfo.address trong request JSON', 'userInfo.address is required in request JSON');
|
|
179
|
+
export const ESIGN_MISSING_FIELD_SIGNATURE = def('637', 'Thiếu userInfo.signature trong request JSON', 'userInfo.signature is required in request JSON');
|
|
180
|
+
export const ESIGN_MISSING_EMAIL_OR_PHONE = def('638', 'Phải có ít nhất email hoặc phone trong request JSON', 'At least email or phone is required in request JSON');
|
|
181
|
+
export const ESIGN_MISSING_POLICY_AGREEMENT = def('639', 'Thiếu policyAgreement trong request JSON', 'policyAgreement object is required in request JSON');
|
|
182
|
+
export const ESIGN_MISSING_FIELD_POLICY_STATUS = def('640', 'Thiếu policyAgreement.policyStatus trong request JSON', 'policyAgreement.policyStatus is required in request JSON');
|
|
183
|
+
export const ESIGN_MISSING_FIELD_ACCEPT_TIME = def('641', 'Thiếu policyAgreement.acceptTime trong request JSON', 'policyAgreement.acceptTime is required in request JSON');
|
|
184
|
+
export const ESIGN_MISSING_FIELD_DEVICE = def('642', 'Thiếu policyAgreement.device trong request JSON', 'policyAgreement.device is required in request JSON');
|
|
185
|
+
export const ESIGN_MISSING_SIGN_POSITIONS = def('645', 'Thiếu signPositions trong signingRequestContents (API multiple positions)', 'signPositions array is required in signingRequestContents');
|
|
186
|
+
export const ESIGN_MISSING_SIGN_POSITION_LOCATION = def('646', 'Thiếu location trong signPositions', 'location object is required in each signPosition');
|
|
187
|
+
export const ESIGN_MISSING_FIELD_DOCUMENT_NAME = def('647', 'Thiếu documentName trong signingRequestContents', 'documentName is required in signingRequestContents');
|
|
188
|
+
export const ESIGN_INVALID_REGISTER_DATE_FORMAT = def('648', 'userInfo.registerDate phải đúng định dạng dd/MM/yyyy', 'userInfo.registerDate must be in dd/MM/yyyy format');
|
|
189
|
+
export const ESIGN_INVALID_EXPIRED_DATE_FORMAT = def('649', 'userInfo.expiredDate phải đúng định dạng dd/MM/yyyy', 'userInfo.expiredDate must be in dd/MM/yyyy format');
|
|
190
|
+
|
|
153
191
|
// ========================================
|
|
154
192
|
// Predefined list & code map (companion object)
|
|
155
193
|
// ========================================
|
|
@@ -179,6 +217,19 @@ const PREDEFINED_ERRORS: EKYCErrorResultLike[] = [
|
|
|
179
217
|
ESIGN_INVALID_USER_ACCOUNT, ESIGN_SESSION_INVALID_REGISTER, ESIGN_INVALID_RECOVERY_OR_PIN,
|
|
180
218
|
ESIGN_SESSION_INVALID_LIST_CERT, ESIGN_AUTH_EXISTS, ESIGN_INVALID_SIGN_COUNT_OR_TIME,
|
|
181
219
|
ESIGN_INVALID_CERT_FOR_AUTH, ESIGN_AUTH_REQUEST_EXISTS,
|
|
220
|
+
ESIGN_MISSING_NAME, ESIGN_MISSING_DEVICE_ID, ESIGN_INVALID_REQUEST_JSON,
|
|
221
|
+
ESIGN_MISSING_PIN_CODE, ESIGN_MISSING_USER_PIN, ESIGN_INVALID_PAGE_PARAMS,
|
|
222
|
+
ESIGN_INVALID_QUANTITY, ESIGN_INVALID_TIME, ESIGN_INVALID_PIN_FORMAT, ESIGN_INVALID_RECOVERY_FORMAT,
|
|
223
|
+
ESIGN_MISSING_USER_INFO, ESIGN_MISSING_FIELD_IDENTITY, ESIGN_MISSING_FIELD_SOD,
|
|
224
|
+
ESIGN_MISSING_FIELD_REGISTER_DATE, ESIGN_MISSING_FIELD_EXPIRED_DATE,
|
|
225
|
+
ESIGN_MISSING_SIGNING_CONTENTS, ESIGN_MISSING_FIELD_DATA, ESIGN_MISSING_TOKEN_INFO,
|
|
226
|
+
ESIGN_MISSING_FIELD_USERNAME, ESIGN_MISSING_FIELD_SERIAL_TOKEN, ESIGN_MISSING_FIELD_SESSION_ID,
|
|
227
|
+
ESIGN_MISSING_FIELD_NAME, ESIGN_MISSING_FIELD_ADDRESS, ESIGN_MISSING_FIELD_SIGNATURE,
|
|
228
|
+
ESIGN_MISSING_EMAIL_OR_PHONE, ESIGN_MISSING_POLICY_AGREEMENT,
|
|
229
|
+
ESIGN_MISSING_FIELD_POLICY_STATUS, ESIGN_MISSING_FIELD_ACCEPT_TIME, ESIGN_MISSING_FIELD_DEVICE,
|
|
230
|
+
ESIGN_MISSING_SIGN_POSITIONS, ESIGN_MISSING_SIGN_POSITION_LOCATION,
|
|
231
|
+
ESIGN_MISSING_FIELD_DOCUMENT_NAME,
|
|
232
|
+
ESIGN_INVALID_REGISTER_DATE_FORMAT, ESIGN_INVALID_EXPIRED_DATE_FORMAT,
|
|
182
233
|
USER_CANCEL,
|
|
183
234
|
];
|
|
184
235
|
|
|
@@ -45,10 +45,9 @@ export interface LivenessConfig {
|
|
|
45
45
|
// usingRandomAction: boolean;
|
|
46
46
|
// isStraight: boolean;
|
|
47
47
|
selfieImage: string;
|
|
48
|
-
switchFrontCamera?: boolean;
|
|
49
48
|
// New fields for version 1.3.0
|
|
50
49
|
isActiveLiveness?: boolean;
|
|
51
|
-
|
|
50
|
+
isActiveLivenessColor?: boolean;
|
|
52
51
|
isShowCameraFont?: boolean;
|
|
53
52
|
customActions?: SDKFaceDetectStatus[];
|
|
54
53
|
activeActionCount?: number;
|