Skip to content

Commit 479315b

Browse files
committed
fix(Android): missing connect sam for samComputeEventLogSignature method
1 parent 2eae2b0 commit 479315b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

android/src/main/java/com/pos/CardManager.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,9 @@ abstract class CardManager {
7575
val userInfo = Arguments.createMap()
7676
userInfo.putBoolean("isPosError", true)
7777

78-
if (!samIsConnected) {
79-
promise.reject(PosException.NO_SAM_AVAILABLE, "No SAM available", userInfo)
80-
return
81-
}
82-
8378
try {
79+
connectSam()
80+
8481
val kif = options.getInt("kif").toByte()
8582
val kvc = options.getInt("kvc").toByte()
8683
val log = ByteConvertReactNativeUtil.arrayListToByteArray(options.getArray("log")!!.toArrayList() as ArrayList<Int>)
@@ -100,6 +97,8 @@ abstract class CardManager {
10097
samComputeLogSignatureParser.checkStatus()
10198

10299
promise.resolve(ByteConvertReactNativeUtil.byteArrayToReadableArray(samComputeLogSignatureParser.signature))
100+
101+
disconnectSam()
103102
} catch (e: Exception) {
104103
val userInfo = Arguments.createMap()
105104
userInfo.putBoolean("isPosError", true)

0 commit comments

Comments
 (0)