quivio-transaction-processor 1.0.9 → 1.0.11
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/libs/emvCardReaderLib/src/main/java/com/rohan/emvcardreaderlib/EMVTransactionCommunicator.kt +1 -1
- package/libs/emvCardReaderLib/src/main/java/com/rohan/emvcardreaderlib/PosState.kt +1 -0
- package/libs/emvCardReaderLib/src/main/java/com/rohan/emvcardreaderlib/manager/DsiEMVManager.kt +6 -2
- package/libs/emvNative/src/main/java/com/quivio_transaction_processor/DsiEMVManagerModule.kt +12 -3
- package/package.json +1 -1
package/libs/emvCardReaderLib/src/main/java/com/rohan/emvcardreaderlib/EMVTransactionCommunicator.kt
CHANGED
|
@@ -2,7 +2,7 @@ package com.rohan.emvcardreaderlib
|
|
|
2
2
|
|
|
3
3
|
// Interface for EMV transaction callback communication
|
|
4
4
|
interface EMVTransactionCommunicator {
|
|
5
|
-
fun onError(
|
|
5
|
+
fun onError(error: ErrorResponse)
|
|
6
6
|
fun onCardReadSuccessfully(cardData: CardData)
|
|
7
7
|
fun onSaleTransactionCompleted(saleDetails: SaleTransactionResponse)
|
|
8
8
|
fun onRecurringSaleCompleted(recurringDetails: RecurringTransactionResponse)
|
package/libs/emvCardReaderLib/src/main/java/com/rohan/emvcardreaderlib/manager/DsiEMVManager.kt
CHANGED
|
@@ -57,6 +57,7 @@ class DsiEMVManager(
|
|
|
57
57
|
private suspend fun downloadConfigParams() = withContext(Dispatchers.IO) {
|
|
58
58
|
Log.d(PRINT_TAG, "Download Config Initiated: $currentPosState")
|
|
59
59
|
posTransactionExecutor.downloadConfig()
|
|
60
|
+
currentPosState = CrState.DownloadingConfig
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
suspend fun cancelTransaction(){
|
|
@@ -133,15 +134,15 @@ class DsiEMVManager(
|
|
|
133
134
|
CrState.RunConfig -> {
|
|
134
135
|
if (errorRes.dsixReturnCode == ErrorCode.PSCS_ERROR.code) {
|
|
135
136
|
downloadConfigParams()
|
|
137
|
+
return
|
|
136
138
|
} else {
|
|
137
139
|
configCommunicator?.onConfigError(errorRes.textResponse)
|
|
138
140
|
}
|
|
139
141
|
}
|
|
140
142
|
CrState.PingConfig -> configCommunicator?.onConfigPingFailed()
|
|
141
143
|
else -> {
|
|
142
|
-
communicator?.onError(error
|
|
144
|
+
communicator?.onError(error)
|
|
143
145
|
}
|
|
144
|
-
|
|
145
146
|
}
|
|
146
147
|
}
|
|
147
148
|
currentPosState = CrState.IDLE
|
|
@@ -149,6 +150,9 @@ class DsiEMVManager(
|
|
|
149
150
|
|
|
150
151
|
private fun checkSuccessResponse(xml: String) {
|
|
151
152
|
when (currentPosState) {
|
|
153
|
+
CrState.DownloadingConfig -> {
|
|
154
|
+
configCommunicator?.onConfigPingSuccess()
|
|
155
|
+
}
|
|
152
156
|
CrState.PingConfig -> {
|
|
153
157
|
configCommunicator?.onConfigPingSuccess()
|
|
154
158
|
}
|
package/libs/emvNative/src/main/java/com/quivio_transaction_processor/DsiEMVManagerModule.kt
CHANGED
|
@@ -7,6 +7,7 @@ import com.rohan.emvcardreaderlib.manager.DsiEMVManager
|
|
|
7
7
|
import com.rohan.emvcardreaderlib.EMVTransactionCommunicator
|
|
8
8
|
import com.rohan.emvcardreaderlib.ConfigurationCommunicator
|
|
9
9
|
import com.rohan.emvcardreaderlib.CardData
|
|
10
|
+
import com.rohan.emvcardreaderlib.ErrorResponse
|
|
10
11
|
import com.rohan.emvcardreaderlib.SaleTransactionResponse
|
|
11
12
|
import com.rohan.emvcardreaderlib.RecurringTransactionResponse
|
|
12
13
|
import com.rohan.emvcardreaderlib.ZeroAuthTransactionResponse
|
|
@@ -137,9 +138,17 @@ class DsiEMVManagerModule(private val reactContext: ReactApplicationContext) :
|
|
|
137
138
|
}
|
|
138
139
|
|
|
139
140
|
// EMVTransactionCommunicator callbacks
|
|
140
|
-
override fun onError(
|
|
141
|
-
Log.d("DsiEMVManagerModule", "onError: $
|
|
142
|
-
|
|
141
|
+
override fun onError(errorResponse: ErrorResponse) {
|
|
142
|
+
Log.d("DsiEMVManagerModule", "onError: $errorResponse")
|
|
143
|
+
val map = Arguments.createMap().apply {
|
|
144
|
+
putString("responseOrigin", errorResponse.responseOrigin)
|
|
145
|
+
putString("dsixReturnCode", errorResponse.dsixReturnCode)
|
|
146
|
+
putString("cmdStatus", errorResponse.cmdStatus)
|
|
147
|
+
putString("textResponse", errorResponse.textResponse)
|
|
148
|
+
putString("sequenceNo", errorResponse.sequenceNo)
|
|
149
|
+
putString("userTrace", errorResponse.userTrace)
|
|
150
|
+
}
|
|
151
|
+
sendEvent("onError", map)
|
|
143
152
|
}
|
|
144
153
|
|
|
145
154
|
override fun onCardReadSuccessfully(cardData: CardData) {
|