@finos_sdk/sdk-ekyc 1.4.2 → 1.4.5
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 +107 -71
- package/dist/EKYCModule.d.ts +2 -0
- package/dist/EKYCModule.js +33 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +24 -10
- package/dist/package.json +2 -2
- package/dist/src/modules/FinosEKYCModule.d.ts +8 -0
- package/dist/src/modules/FinosEKYCModule.js +29 -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/EKYCEvent.d.ts +60 -0
- package/dist/src/types/EKYCEvent.js +65 -0
- package/dist/src/types/ekycESignType.d.ts +2 -0
- 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 +14 -5
- package/src/types/EKYCErrorResult.ts +51 -0
- package/src/types/EKYCEvent.ts +76 -0
- package/src/types/ekycESignType.ts +2 -0
- package/src/types/ekycLivenessType.ts +1 -2
|
@@ -2,6 +2,7 @@ package finos.sdk.ekyc
|
|
|
2
2
|
|
|
3
3
|
import android.R
|
|
4
4
|
import android.net.Uri
|
|
5
|
+
import com.google.gson.Gson
|
|
5
6
|
import android.os.Handler
|
|
6
7
|
import android.os.Looper
|
|
7
8
|
import android.util.Base64
|
|
@@ -16,7 +17,7 @@ import com.facebook.react.bridge.WritableArray
|
|
|
16
17
|
import com.facebook.react.bridge.WritableMap
|
|
17
18
|
import com.facebook.react.module.annotations.ReactModule
|
|
18
19
|
import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
19
|
-
import finos.sdk.c06.
|
|
20
|
+
import finos.sdk.c06.eKYCFinOSC06
|
|
20
21
|
import finos.sdk.core.define.EKYCErrorResult
|
|
21
22
|
import finos.sdk.core.define.EKYCEvent
|
|
22
23
|
import finos.sdk.core.define.SDKType
|
|
@@ -32,15 +33,15 @@ import finos.sdk.core.model.sdk.config.OcrConfig
|
|
|
32
33
|
import finos.sdk.core.model.sdk.config.OptionConfig
|
|
33
34
|
import finos.sdk.core.model.sdk.config.StyleConfig
|
|
34
35
|
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.
|
|
36
|
+
import finos.sdk.ekyc.eKYCFinOS
|
|
37
|
+
import finos.sdk.ekyc.ui.eKYCFinOSUI
|
|
38
|
+
import finos.sdk.faceservice.eKYCFinOSFaceService
|
|
39
|
+
import finos.sdk.liveness.eKYCFinOSLiveness
|
|
40
|
+
import finos.sdk.nfc.eKYCFinOSNfc
|
|
41
|
+
import finos.sdk.ocr.eKYCFinOSOcr
|
|
42
|
+
import finos.sdk.smsotp.OTPFinOS
|
|
42
43
|
import finos.sdk.core.model.sdk.config.SmsOtpConfig
|
|
43
|
-
import vn.softdreams.easyca.sdk.
|
|
44
|
+
import vn.softdreams.easyca.sdk.eSignFinOS
|
|
44
45
|
import vn.softdreams.easyca.sdk.esign.ESignModels
|
|
45
46
|
|
|
46
47
|
import org.json.JSONArray
|
|
@@ -108,6 +109,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
108
109
|
Arguments.createMap().apply {
|
|
109
110
|
putInt("status", result.status)
|
|
110
111
|
putString("msg", result.msg)
|
|
112
|
+
result.errorCode?.let { putString("errorCode", it) }
|
|
111
113
|
result.data?.let { d ->
|
|
112
114
|
putMap("data", Arguments.createMap().apply {
|
|
113
115
|
d.sessionId?.let { putString("sessionId", it) }
|
|
@@ -130,6 +132,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
130
132
|
Arguments.createMap().apply {
|
|
131
133
|
putInt("status", result.status)
|
|
132
134
|
putString("msg", result.msg)
|
|
135
|
+
result.errorCode?.let { putString("errorCode", it) }
|
|
133
136
|
result.data?.let { d ->
|
|
134
137
|
putMap("data", Arguments.createMap().apply {
|
|
135
138
|
putString("transactionId", d.transactionId)
|
|
@@ -151,7 +154,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
151
154
|
fun initSdkEkyc(promise: Promise) {
|
|
152
155
|
Log.d(TAG, "▶️ initSdkEkyc() called")
|
|
153
156
|
try {
|
|
154
|
-
|
|
157
|
+
eKYCFinOS.initSDKEkyc(reactApplicationContext) {
|
|
155
158
|
Log.d(TAG, "✅ initSdkEkyc() success")
|
|
156
159
|
val params =
|
|
157
160
|
Arguments.createMap().apply {
|
|
@@ -183,7 +186,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
183
186
|
fun setTransactionId(transactionId: String, promise: Promise) {
|
|
184
187
|
Log.d(TAG, "▶️ setTransactionId() called with: $transactionId")
|
|
185
188
|
try {
|
|
186
|
-
|
|
189
|
+
eKYCFinOS.setTransactionId(transactionId)
|
|
187
190
|
Log.d(TAG, "✅ setTransactionId() success")
|
|
188
191
|
promise.resolve(true)
|
|
189
192
|
} catch (e: Exception) {
|
|
@@ -221,7 +224,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
221
224
|
val ekycConfig =
|
|
222
225
|
EKYCConfigSDK(appKey = AppKeyConfig(appKey), sdkType = SDKType.NFC, nfcConfig = nfcConfig)
|
|
223
226
|
|
|
224
|
-
|
|
227
|
+
eKYCFinOSNfc.startEkyc(
|
|
225
228
|
activity = currentActivity,
|
|
226
229
|
ekycConfigSDK = ekycConfig,
|
|
227
230
|
callbackSuccess = { event, data ->
|
|
@@ -277,7 +280,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
277
280
|
putString("customCode", errorResult.code)
|
|
278
281
|
putString("customMessage", errorResult.message)
|
|
279
282
|
}
|
|
280
|
-
promise.reject(event.name.toString(), errorResult.message,
|
|
283
|
+
promise.reject(event.name.toString(), errorResult.message, null, promiseErrorMap)
|
|
281
284
|
}
|
|
282
285
|
)
|
|
283
286
|
} catch (e: Exception) {
|
|
@@ -307,7 +310,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
307
310
|
|
|
308
311
|
val ekycConfig = EKYCConfigSDK(appKey = AppKeyConfig(appKey), c06Config = c06Config)
|
|
309
312
|
|
|
310
|
-
|
|
313
|
+
eKYCFinOSC06.startEkyc(
|
|
311
314
|
ekycConfigSDK = ekycConfig,
|
|
312
315
|
callbackSuccess = { event, data ->
|
|
313
316
|
Log.d(TAG, "✅ checkC06() success")
|
|
@@ -341,7 +344,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
341
344
|
putString("customCode", errorResult.code)
|
|
342
345
|
putString("customMessage", errorResult.message)
|
|
343
346
|
}
|
|
344
|
-
promise.reject(event.name.toString(), errorResult.message,
|
|
347
|
+
promise.reject(event.name.toString(), errorResult.message, null, promiseErrorMap)
|
|
345
348
|
}
|
|
346
349
|
)
|
|
347
350
|
} catch (e: Exception) {
|
|
@@ -380,7 +383,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
380
383
|
)
|
|
381
384
|
val ekycConfig =
|
|
382
385
|
EKYCConfigSDK(appKey = AppKeyConfig(appKey), sdkType = SDKType.OCR, ocrConfig = ocrConfig)
|
|
383
|
-
|
|
386
|
+
eKYCFinOSOcr.startEkyc(
|
|
384
387
|
ekycConfigSDK = ekycConfig,
|
|
385
388
|
callbackSuccess = { event, data ->
|
|
386
389
|
Log.d(TAG, "✅ startOcr() success")
|
|
@@ -405,7 +408,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
405
408
|
putString("customCode", errorResult.code)
|
|
406
409
|
putString("customMessage", errorResult.message)
|
|
407
410
|
}
|
|
408
|
-
promise.reject(event.name.toString(), errorResult.message,
|
|
411
|
+
promise.reject(event.name.toString(), errorResult.message, null, promiseErrorMap)
|
|
409
412
|
}
|
|
410
413
|
)
|
|
411
414
|
} catch (e: Exception) {
|
|
@@ -419,13 +422,12 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
419
422
|
appKey: String,
|
|
420
423
|
selfieImage: String,
|
|
421
424
|
transactionId: String,
|
|
422
|
-
|
|
423
|
-
useActiveLiveness: Boolean?,
|
|
424
|
-
autoCapture: Boolean?,
|
|
425
|
+
isActiveLiveness: Boolean?,
|
|
425
426
|
isShowCameraFont: Boolean?,
|
|
426
427
|
customActionsArray: ReadableArray?,
|
|
427
428
|
activeActionCount: Int?,
|
|
428
429
|
forceCaptureTimeout: Double?,
|
|
430
|
+
isActiveLivenessColor: Boolean?,
|
|
429
431
|
promise: Promise
|
|
430
432
|
) {
|
|
431
433
|
Log.d(TAG, "▶️ startLiveness() called")
|
|
@@ -461,8 +463,9 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
461
463
|
|
|
462
464
|
val livenessConfig =
|
|
463
465
|
LivenessConfig(
|
|
464
|
-
isActiveLiveness =
|
|
465
|
-
|
|
466
|
+
isActiveLiveness = isActiveLiveness ?: false,
|
|
467
|
+
isActiveLivenessColor = isActiveLivenessColor ?: false,
|
|
468
|
+
isShowCameraFont = isShowCameraFont ?: true,
|
|
466
469
|
// Custom actions từ checkboxes (nếu có chọn)
|
|
467
470
|
// Nếu có actions được chọn → sử dụng customActions
|
|
468
471
|
// Nếu không có actions nào được chọn → sử dụng random actions với activeActionCount
|
|
@@ -480,9 +483,20 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
480
483
|
sdkType = SDKType.LIVENESS,
|
|
481
484
|
livenessConfig = livenessConfig
|
|
482
485
|
)
|
|
483
|
-
|
|
486
|
+
eKYCFinOSLiveness.startEkyc(
|
|
484
487
|
ekycConfigSDK = ekycConfig,
|
|
485
488
|
callbackSuccess = { event, data ->
|
|
489
|
+
// LOG_SUCCESS = internal submit result event (v1.4.5), don't resolve promise
|
|
490
|
+
if (event == EKYCEvent.LOG_SUCCESS) {
|
|
491
|
+
val logDataStr = data?.customData?.let { Gson().toJson(it) } ?: data?.toString() ?: "null"
|
|
492
|
+
Log.d(TAG, "LOG_SUCCESS [Liveness]: $logDataStr")
|
|
493
|
+
val logMap = Arguments.createMap().apply {
|
|
494
|
+
putString("event", event.name.toString())
|
|
495
|
+
putString("data", logDataStr)
|
|
496
|
+
}
|
|
497
|
+
sendEvent("onLivenessSuccess", logMap)
|
|
498
|
+
return@startEkyc
|
|
499
|
+
}
|
|
486
500
|
Log.d(TAG, "✅ startLiveness() success")
|
|
487
501
|
val (eventMap, promiseMap) = createSeparateMaps { map ->
|
|
488
502
|
map.putString("event", event.name.toString())
|
|
@@ -505,7 +519,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
505
519
|
putString("customCode", errorResult.code)
|
|
506
520
|
putString("customMessage", errorResult.message)
|
|
507
521
|
}
|
|
508
|
-
promise.reject(event.name.toString(), errorResult.message,
|
|
522
|
+
promise.reject(event.name.toString(), errorResult.message, null, promiseErrorMap)
|
|
509
523
|
}
|
|
510
524
|
)
|
|
511
525
|
} catch (e: Exception) {
|
|
@@ -553,9 +567,20 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
553
567
|
|
|
554
568
|
// Đảm bảo chạy trên main thread để tránh crash trên một số devices/SDK versions.
|
|
555
569
|
Handler(Looper.getMainLooper()).post {
|
|
556
|
-
|
|
570
|
+
eKYCFinOSFaceService.startEkyc(
|
|
557
571
|
ekycConfigSDK = ekycConfig,
|
|
558
572
|
callbackSuccess = { event, data ->
|
|
573
|
+
// LOG_SUCCESS = internal submit result event (v1.4.5), don't resolve promise
|
|
574
|
+
if (event == EKYCEvent.LOG_SUCCESS) {
|
|
575
|
+
val logDataStr = data?.customData?.let { Gson().toJson(it) } ?: data?.toString() ?: "null"
|
|
576
|
+
Log.d(TAG, "LOG_SUCCESS [FaceCompare]: $logDataStr")
|
|
577
|
+
val logMap = Arguments.createMap().apply {
|
|
578
|
+
putString("event", event.name.toString())
|
|
579
|
+
putString("data", logDataStr)
|
|
580
|
+
}
|
|
581
|
+
sendEvent("onFaceCompareSuccess", logMap)
|
|
582
|
+
return@startEkyc
|
|
583
|
+
}
|
|
559
584
|
Log.d(TAG, "✅ startFaceCompare() success")
|
|
560
585
|
val (eventMap, promiseMap) = createSeparateMaps { map ->
|
|
561
586
|
map.putString("event", event.name.toString())
|
|
@@ -578,7 +603,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
578
603
|
putString("customCode", errorResult.code)
|
|
579
604
|
putString("customMessage", errorResult.message)
|
|
580
605
|
}
|
|
581
|
-
promise.reject(event.name.toString(), errorResult.message,
|
|
606
|
+
promise.reject(event.name.toString(), errorResult.message, null, promiseErrorMap)
|
|
582
607
|
}
|
|
583
608
|
)
|
|
584
609
|
}
|
|
@@ -591,21 +616,21 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
591
616
|
@ReactMethod
|
|
592
617
|
fun onResume() {
|
|
593
618
|
reactApplicationContext.currentActivity?.let { activity ->
|
|
594
|
-
activity.runOnUiThread {
|
|
619
|
+
activity.runOnUiThread { eKYCFinOSNfc.onResumeNfc(activity) }
|
|
595
620
|
}
|
|
596
621
|
}
|
|
597
622
|
|
|
598
623
|
@ReactMethod
|
|
599
624
|
fun onPause() {
|
|
600
625
|
reactApplicationContext.currentActivity?.let { activity ->
|
|
601
|
-
activity.runOnUiThread {
|
|
626
|
+
activity.runOnUiThread { eKYCFinOSNfc.onPauseNfc(activity) }
|
|
602
627
|
}
|
|
603
628
|
}
|
|
604
629
|
|
|
605
630
|
@ReactMethod
|
|
606
631
|
fun handleNewIntent() {
|
|
607
632
|
reactApplicationContext.currentActivity?.let { activity ->
|
|
608
|
-
activity.runOnUiThread {
|
|
633
|
+
activity.runOnUiThread { eKYCFinOSNfc.onNewIntentNfc(activity.intent) }
|
|
609
634
|
}
|
|
610
635
|
}
|
|
611
636
|
|
|
@@ -778,10 +803,21 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
778
803
|
flowSDK = finalFlow
|
|
779
804
|
)
|
|
780
805
|
|
|
781
|
-
|
|
806
|
+
eKYCFinOSUI.startEkyc(
|
|
782
807
|
activity = currentActivity,
|
|
783
808
|
ekycConfigSDK = ekycConfigSDK,
|
|
784
809
|
callbackSuccess = { event, data ->
|
|
810
|
+
// LOG_SUCCESS = internal submit result event (v1.4.5), emit event only, don't resolve promise
|
|
811
|
+
if (event == EKYCEvent.LOG_SUCCESS) {
|
|
812
|
+
val logDataStr = data?.customData?.let { Gson().toJson(it) } ?: data?.toString() ?: "null"
|
|
813
|
+
Log.d(TAG, "LOG_SUCCESS [EkycUI]: $logDataStr")
|
|
814
|
+
sendEvent("onEkycUISuccess", Arguments.createMap().apply {
|
|
815
|
+
putString("status", "log")
|
|
816
|
+
putString("event", event.name.toString())
|
|
817
|
+
putString("data", logDataStr)
|
|
818
|
+
})
|
|
819
|
+
return@startEkyc
|
|
820
|
+
}
|
|
785
821
|
Log.d(TAG, "✅ startEkycUI() callback - event=${event.name}")
|
|
786
822
|
val result = data as? SDKEkycResult
|
|
787
823
|
val hasRealData = result?.ekycStateModel != null
|
|
@@ -825,7 +861,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
825
861
|
putString("message", errorResult.message)
|
|
826
862
|
}
|
|
827
863
|
sendEvent("onEkycUIError", errorMap)
|
|
828
|
-
promise.reject(event.name.toString(), errorResult.message,
|
|
864
|
+
promise.reject(event.name.toString(), errorResult.message, null, promiseErrorMap)
|
|
829
865
|
}
|
|
830
866
|
)
|
|
831
867
|
|
|
@@ -1074,7 +1110,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1074
1110
|
referenceId = referenceId
|
|
1075
1111
|
)
|
|
1076
1112
|
|
|
1077
|
-
|
|
1113
|
+
OTPFinOS.sendOtp(
|
|
1078
1114
|
apiKey = appKey,
|
|
1079
1115
|
smsOtpConfig = smsOtpConfig,
|
|
1080
1116
|
callbackSuccess = { event, result ->
|
|
@@ -1106,7 +1142,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1106
1142
|
putString("customCode", error.code)
|
|
1107
1143
|
putString("customMessage", error.message)
|
|
1108
1144
|
}
|
|
1109
|
-
promise.reject(event.name.toString(), error.message,
|
|
1145
|
+
promise.reject(event.name.toString(), error.message, null, promiseErrorMap)
|
|
1110
1146
|
}
|
|
1111
1147
|
)
|
|
1112
1148
|
} catch (e: Exception) {
|
|
@@ -1134,7 +1170,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1134
1170
|
requestId = requestId
|
|
1135
1171
|
)
|
|
1136
1172
|
|
|
1137
|
-
|
|
1173
|
+
OTPFinOS.verifyOtp(
|
|
1138
1174
|
apiKey = appKey,
|
|
1139
1175
|
smsOtpConfig = smsOtpConfig,
|
|
1140
1176
|
otpCode = otpCode,
|
|
@@ -1167,7 +1203,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1167
1203
|
putString("customCode", error.code)
|
|
1168
1204
|
putString("customMessage", error.message)
|
|
1169
1205
|
}
|
|
1170
|
-
promise.reject(event.name.toString(), error.message,
|
|
1206
|
+
promise.reject(event.name.toString(), error.message, null, promiseErrorMap)
|
|
1171
1207
|
}
|
|
1172
1208
|
)
|
|
1173
1209
|
} catch (e: Exception) {
|
|
@@ -1194,7 +1230,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1194
1230
|
requestId = requestId
|
|
1195
1231
|
)
|
|
1196
1232
|
|
|
1197
|
-
|
|
1233
|
+
OTPFinOS.resendOtp(
|
|
1198
1234
|
apiKey = appKey,
|
|
1199
1235
|
smsOtpConfig = smsOtpConfig,
|
|
1200
1236
|
callbackSuccess = { event, result ->
|
|
@@ -1226,7 +1262,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1226
1262
|
putString("customCode", error.code)
|
|
1227
1263
|
putString("customMessage", error.message)
|
|
1228
1264
|
}
|
|
1229
|
-
promise.reject(event.name.toString(), error.message,
|
|
1265
|
+
promise.reject(event.name.toString(), error.message, null, promiseErrorMap)
|
|
1230
1266
|
}
|
|
1231
1267
|
)
|
|
1232
1268
|
} catch (e: Exception) {
|
|
@@ -1248,7 +1284,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1248
1284
|
return
|
|
1249
1285
|
}
|
|
1250
1286
|
|
|
1251
|
-
|
|
1287
|
+
eSignFinOS.initializeESign(
|
|
1252
1288
|
context = currentActivity,
|
|
1253
1289
|
finosToken = finosToken,
|
|
1254
1290
|
isProd = isProd,
|
|
@@ -1286,7 +1322,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1286
1322
|
putString("customCode", error.code)
|
|
1287
1323
|
putString("customMessage", error.message ?: "")
|
|
1288
1324
|
}
|
|
1289
|
-
promise.reject(event.name.toString(), error.message ?: "Unknown Error",
|
|
1325
|
+
promise.reject(event.name.toString(), error.message ?: "Unknown Error", null, promiseErrorMap)
|
|
1290
1326
|
}
|
|
1291
1327
|
}
|
|
1292
1328
|
)
|
|
@@ -1305,7 +1341,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1305
1341
|
) {
|
|
1306
1342
|
Log.d(TAG, "▶️ getSdkToken() called")
|
|
1307
1343
|
try {
|
|
1308
|
-
|
|
1344
|
+
eSignFinOS.getSdkToken(
|
|
1309
1345
|
cccd = identity, // Map identity param to cccd
|
|
1310
1346
|
name = name,
|
|
1311
1347
|
deviceId = deviceId,
|
|
@@ -1327,7 +1363,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1327
1363
|
putString("customCode", error.code)
|
|
1328
1364
|
putString("customMessage", error.message ?: "")
|
|
1329
1365
|
}
|
|
1330
|
-
promise.reject(event.name.toString(), error.message ?: "Get SDK Token failed",
|
|
1366
|
+
promise.reject(event.name.toString(), error.message ?: "Get SDK Token failed", null, promiseErrorMap)
|
|
1331
1367
|
}
|
|
1332
1368
|
)
|
|
1333
1369
|
} catch (e: Exception) {
|
|
@@ -1354,7 +1390,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1354
1390
|
|
|
1355
1391
|
if (accessToken != null && accessToken.isNotEmpty()) {
|
|
1356
1392
|
// Option 1: With existing JWT access token
|
|
1357
|
-
|
|
1393
|
+
eSignFinOS.openSessionId(
|
|
1358
1394
|
context = currentActivity,
|
|
1359
1395
|
accessToken = accessToken,
|
|
1360
1396
|
username = username ?: "",
|
|
@@ -1382,7 +1418,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1382
1418
|
putString("customCode", error.code)
|
|
1383
1419
|
putString("customMessage", error.message ?: "")
|
|
1384
1420
|
}
|
|
1385
|
-
promise.reject(event.name.toString(), error.message ?: "Unknown Error",
|
|
1421
|
+
promise.reject(event.name.toString(), error.message ?: "Unknown Error", null, promiseErrorMap)
|
|
1386
1422
|
}
|
|
1387
1423
|
)
|
|
1388
1424
|
} else {
|
|
@@ -1411,7 +1447,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1411
1447
|
return
|
|
1412
1448
|
}
|
|
1413
1449
|
|
|
1414
|
-
|
|
1450
|
+
eSignFinOS.registerDevice(
|
|
1415
1451
|
context = currentActivity,
|
|
1416
1452
|
recoverCode = recoverCode,
|
|
1417
1453
|
pinCode = pinCode,
|
|
@@ -1439,7 +1475,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1439
1475
|
putString("customCode", error.code)
|
|
1440
1476
|
putString("customMessage", error.message ?: "")
|
|
1441
1477
|
}
|
|
1442
|
-
promise.reject(event.name.toString(), error.message ?: "Unknown Error",
|
|
1478
|
+
promise.reject(event.name.toString(), error.message ?: "Unknown Error", null, promiseErrorMap)
|
|
1443
1479
|
}
|
|
1444
1480
|
)
|
|
1445
1481
|
} catch (e: Exception) {
|
|
@@ -1462,7 +1498,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1462
1498
|
return
|
|
1463
1499
|
}
|
|
1464
1500
|
|
|
1465
|
-
|
|
1501
|
+
eSignFinOS.listCerts(
|
|
1466
1502
|
context = currentActivity,
|
|
1467
1503
|
pageNumber = pageNumber,
|
|
1468
1504
|
pageSize = pageSize,
|
|
@@ -1499,7 +1535,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1499
1535
|
putString("customCode", error.code)
|
|
1500
1536
|
putString("customMessage", error.message ?: "")
|
|
1501
1537
|
}
|
|
1502
|
-
promise.reject(event.name.toString(), error.message ?: "Unknown Error",
|
|
1538
|
+
promise.reject(event.name.toString(), error.message ?: "Unknown Error", null, promiseErrorMap)
|
|
1503
1539
|
}
|
|
1504
1540
|
)
|
|
1505
1541
|
} catch (e: Exception) {
|
|
@@ -1533,7 +1569,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1533
1569
|
return
|
|
1534
1570
|
}
|
|
1535
1571
|
|
|
1536
|
-
|
|
1572
|
+
eSignFinOS.verifyCert(
|
|
1537
1573
|
context = currentActivity,
|
|
1538
1574
|
serial = serial,
|
|
1539
1575
|
callbackSuccess = { code, message ->
|
|
@@ -1559,7 +1595,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1559
1595
|
putString("customCode", error.code)
|
|
1560
1596
|
putString("customMessage", error.message ?: "")
|
|
1561
1597
|
}
|
|
1562
|
-
promise.reject(event.name.toString(), error.message ?: "Unknown Error",
|
|
1598
|
+
promise.reject(event.name.toString(), error.message ?: "Unknown Error", null, promiseErrorMap)
|
|
1563
1599
|
}
|
|
1564
1600
|
)
|
|
1565
1601
|
} catch (e: Exception) {
|
|
@@ -1581,7 +1617,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1581
1617
|
return
|
|
1582
1618
|
}
|
|
1583
1619
|
|
|
1584
|
-
|
|
1620
|
+
eSignFinOS.listSignRequest(
|
|
1585
1621
|
context = currentActivity,
|
|
1586
1622
|
pageNumber = pageNumber,
|
|
1587
1623
|
pageSize = pageSize,
|
|
@@ -1617,7 +1653,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1617
1653
|
putString("customCode", error.code)
|
|
1618
1654
|
putString("customMessage", error.message ?: "")
|
|
1619
1655
|
}
|
|
1620
|
-
promise.reject(event.name.toString(), error.message ?: "Unknown Error",
|
|
1656
|
+
promise.reject(event.name.toString(), error.message ?: "Unknown Error", null, promiseErrorMap)
|
|
1621
1657
|
}
|
|
1622
1658
|
)
|
|
1623
1659
|
} catch (e: Exception) {
|
|
@@ -1645,8 +1681,8 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1645
1681
|
return
|
|
1646
1682
|
}
|
|
1647
1683
|
|
|
1648
|
-
Log.d(TAG, " 🔄 Calling
|
|
1649
|
-
|
|
1684
|
+
Log.d(TAG, " 🔄 Calling eSignFinOS.confirmSign()")
|
|
1685
|
+
eSignFinOS.confirmSign(
|
|
1650
1686
|
context = currentActivity,
|
|
1651
1687
|
signRequestId = signRequestId,
|
|
1652
1688
|
pinCode = pinCode,
|
|
@@ -1692,7 +1728,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1692
1728
|
putString("customCode", error.code)
|
|
1693
1729
|
putString("customMessage", errorMessage)
|
|
1694
1730
|
}
|
|
1695
|
-
promise.reject(event.name.toString(), errorMessage,
|
|
1731
|
+
promise.reject(event.name.toString(), errorMessage, null, promiseErrorMap)
|
|
1696
1732
|
}
|
|
1697
1733
|
}
|
|
1698
1734
|
)
|
|
@@ -1720,7 +1756,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1720
1756
|
return
|
|
1721
1757
|
}
|
|
1722
1758
|
|
|
1723
|
-
|
|
1759
|
+
eSignFinOS.initAuthorize(
|
|
1724
1760
|
context = currentActivity,
|
|
1725
1761
|
serial = serial,
|
|
1726
1762
|
quantity = quantity,
|
|
@@ -1749,7 +1785,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1749
1785
|
putString("customCode", error.code)
|
|
1750
1786
|
putString("customMessage", error.message ?: "")
|
|
1751
1787
|
}
|
|
1752
|
-
promise.reject(event.name.toString(), error.message ?: "Unknown Error",
|
|
1788
|
+
promise.reject(event.name.toString(), error.message ?: "Unknown Error", null, promiseErrorMap)
|
|
1753
1789
|
}
|
|
1754
1790
|
)
|
|
1755
1791
|
} catch (e: Exception) {
|
|
@@ -1772,7 +1808,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1772
1808
|
return
|
|
1773
1809
|
}
|
|
1774
1810
|
|
|
1775
|
-
|
|
1811
|
+
eSignFinOS.listAuthorize(
|
|
1776
1812
|
context = currentActivity,
|
|
1777
1813
|
pageNumber = pageNumber,
|
|
1778
1814
|
pageSize = pageSize,
|
|
@@ -1815,7 +1851,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1815
1851
|
putString("customCode", error.code)
|
|
1816
1852
|
putString("customMessage", error.message ?: "")
|
|
1817
1853
|
}
|
|
1818
|
-
promise.reject(event.name.toString(), error.message ?: "Unknown Error",
|
|
1854
|
+
promise.reject(event.name.toString(), error.message ?: "Unknown Error", null, promiseErrorMap)
|
|
1819
1855
|
}
|
|
1820
1856
|
)
|
|
1821
1857
|
} catch (e: Exception) {
|
|
@@ -1840,7 +1876,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1840
1876
|
return
|
|
1841
1877
|
}
|
|
1842
1878
|
|
|
1843
|
-
|
|
1879
|
+
eSignFinOS.registerAuthorize(
|
|
1844
1880
|
context = currentActivity,
|
|
1845
1881
|
authId = authId,
|
|
1846
1882
|
authData = authData,
|
|
@@ -1870,7 +1906,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1870
1906
|
putString("customCode", error.code)
|
|
1871
1907
|
putString("customMessage", error.message ?: "")
|
|
1872
1908
|
}
|
|
1873
|
-
promise.reject(event.name.toString(), error.message ?: "Unknown Error",
|
|
1909
|
+
promise.reject(event.name.toString(), error.message ?: "Unknown Error", null, promiseErrorMap)
|
|
1874
1910
|
}
|
|
1875
1911
|
)
|
|
1876
1912
|
} catch (e: Exception) {
|
|
@@ -1885,7 +1921,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1885
1921
|
) {
|
|
1886
1922
|
Log.d(TAG, "▶️ signPdfMultiplePositions() called")
|
|
1887
1923
|
try {
|
|
1888
|
-
|
|
1924
|
+
eSignFinOS.signPdfMultiplePositions(
|
|
1889
1925
|
requestJson = requestJson,
|
|
1890
1926
|
callbackSuccess = { result ->
|
|
1891
1927
|
Log.d(TAG, "✅ signPdfMultiplePositions() callbackSuccess - status=${result.status}")
|
|
@@ -1902,7 +1938,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1902
1938
|
putString("message", errorMessage)
|
|
1903
1939
|
}
|
|
1904
1940
|
sendEvent("onESignError", errorMap)
|
|
1905
|
-
promise.reject(event.name.toString(), errorMessage,
|
|
1941
|
+
promise.reject(event.name.toString(), errorMessage, null,
|
|
1906
1942
|
Arguments.createMap().apply {
|
|
1907
1943
|
putString("event", event.name.toString())
|
|
1908
1944
|
putString("customCode", error.code)
|
|
@@ -1922,7 +1958,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1922
1958
|
) {
|
|
1923
1959
|
Log.d(TAG, "▶️ registerRemoteSigning() called")
|
|
1924
1960
|
try {
|
|
1925
|
-
|
|
1961
|
+
eSignFinOS.registerRemoteSigning(
|
|
1926
1962
|
requestJson = requestJson,
|
|
1927
1963
|
callbackSuccess = { result ->
|
|
1928
1964
|
Log.d(TAG, "✅ registerRemoteSigning() success")
|
|
@@ -1947,7 +1983,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1947
1983
|
putString("customCode", error.code)
|
|
1948
1984
|
putString("customMessage", error.message ?: "")
|
|
1949
1985
|
}
|
|
1950
|
-
promise.reject(event.name.toString(), error.message ?: "Unknown Error",
|
|
1986
|
+
promise.reject(event.name.toString(), error.message ?: "Unknown Error", null, promiseErrorMap)
|
|
1951
1987
|
}
|
|
1952
1988
|
)
|
|
1953
1989
|
} catch (e: Exception) {
|
|
@@ -1958,7 +1994,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1958
1994
|
|
|
1959
1995
|
/**
|
|
1960
1996
|
* Composite API: Register Remote Signing + Send Confirmation Document
|
|
1961
|
-
* Align với
|
|
1997
|
+
* Align với eSignFinOSImpl.registerAndConfirm: gọi registerRemoteSigning -> parse sessionId -> sendConfirmationDocument
|
|
1962
1998
|
*/
|
|
1963
1999
|
@ReactMethod
|
|
1964
2000
|
fun registerAndConfirm(
|
|
@@ -1968,7 +2004,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1968
2004
|
) {
|
|
1969
2005
|
Log.d(TAG, "▶️ registerAndConfirm() called")
|
|
1970
2006
|
try {
|
|
1971
|
-
|
|
2007
|
+
eSignFinOS.registerAndConfirm(
|
|
1972
2008
|
requestJson = requestJson,
|
|
1973
2009
|
confirmationDocBase64 = confirmationDocBase64,
|
|
1974
2010
|
callbackSuccess = { result ->
|
|
@@ -1994,7 +2030,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
1994
2030
|
putString("customCode", error.code)
|
|
1995
2031
|
putString("customMessage", error.message ?: "")
|
|
1996
2032
|
}
|
|
1997
|
-
promise.reject(event.name.toString(), error.message ?: "Unknown Error",
|
|
2033
|
+
promise.reject(event.name.toString(), error.message ?: "Unknown Error", null, promiseErrorMap)
|
|
1998
2034
|
}
|
|
1999
2035
|
)
|
|
2000
2036
|
} catch (e: Exception) {
|
|
@@ -2010,7 +2046,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
2010
2046
|
) {
|
|
2011
2047
|
Log.d(TAG, "▶️ signPdf() called")
|
|
2012
2048
|
try {
|
|
2013
|
-
|
|
2049
|
+
eSignFinOS.signPdf(
|
|
2014
2050
|
requestJson = requestJson,
|
|
2015
2051
|
callbackSuccess = { result ->
|
|
2016
2052
|
Log.d(TAG, "✅ signPdf() callbackSuccess - status=${result.status}")
|
|
@@ -2027,7 +2063,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
2027
2063
|
putString("message", errorMessage)
|
|
2028
2064
|
}
|
|
2029
2065
|
sendEvent("onESignError", errorMap)
|
|
2030
|
-
promise.reject(event.name.toString(), errorMessage,
|
|
2066
|
+
promise.reject(event.name.toString(), errorMessage, null,
|
|
2031
2067
|
Arguments.createMap().apply {
|
|
2032
2068
|
putString("event", event.name.toString())
|
|
2033
2069
|
putString("customCode", error.code)
|
|
@@ -2047,7 +2083,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
2047
2083
|
) {
|
|
2048
2084
|
Log.d(TAG, "▶️ sendConfirmationDocument() called")
|
|
2049
2085
|
try {
|
|
2050
|
-
|
|
2086
|
+
eSignFinOS.sendConfirmationDocument(
|
|
2051
2087
|
requestJson = requestJson,
|
|
2052
2088
|
callbackSuccess = { rawResponse ->
|
|
2053
2089
|
// Bắn raw data lên - để EKYCModule.ts xử lý
|
|
@@ -2071,7 +2107,7 @@ class EKYCModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaMo
|
|
|
2071
2107
|
putString("customCode", error.code)
|
|
2072
2108
|
putString("customMessage", error.message ?: "")
|
|
2073
2109
|
}
|
|
2074
|
-
promise.reject(event.name.toString(), error.message ?: "Unknown Error",
|
|
2110
|
+
promise.reject(event.name.toString(), error.message ?: "Unknown Error", null, promiseErrorMap)
|
|
2075
2111
|
}
|
|
2076
2112
|
)
|
|
2077
2113
|
} catch (e: Exception) {
|
package/dist/EKYCModule.d.ts
CHANGED
|
@@ -44,6 +44,8 @@ declare class SDKeKYC {
|
|
|
44
44
|
onLivenessError(callback: (error: any) => void): EmitterSubscription | null;
|
|
45
45
|
onFaceCompareSuccess(callback: (data: SDKEkycResultWithEvent) => void): EmitterSubscription | null;
|
|
46
46
|
onFaceCompareError(callback: (error: any) => void): EmitterSubscription | null;
|
|
47
|
+
onEkycUISuccess(callback: (data: any) => void): EmitterSubscription | null;
|
|
48
|
+
onEkycUIError(callback: (error: any) => void): EmitterSubscription | null;
|
|
47
49
|
removeAllListeners(): void;
|
|
48
50
|
sendOtp(config: SmsOtpConfig): Promise<SmsOtpResult>;
|
|
49
51
|
verifyOtp(config: SmsOtpConfig, otpCode: string): Promise<SmsOtpResult>;
|