quivio-transaction-processor 1.0.9 → 1.0.10

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.
@@ -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(errorMessage: String)
5
+ fun onError(error: ErrorResponse)
6
6
  fun onCardReadSuccessfully(cardData: CardData)
7
7
  fun onSaleTransactionCompleted(saleDetails: SaleTransactionResponse)
8
8
  fun onRecurringSaleCompleted(recurringDetails: RecurringTransactionResponse)
@@ -139,7 +139,7 @@ class DsiEMVManager(
139
139
  }
140
140
  CrState.PingConfig -> configCommunicator?.onConfigPingFailed()
141
141
  else -> {
142
- communicator?.onError(error.textResponse)
142
+ communicator?.onError(error)
143
143
  }
144
144
 
145
145
  }
@@ -137,9 +137,17 @@ class DsiEMVManagerModule(private val reactContext: ReactApplicationContext) :
137
137
  }
138
138
 
139
139
  // EMVTransactionCommunicator callbacks
140
- override fun onError(errorMessage: String) {
141
- Log.d("DsiEMVManagerModule", "onError: $errorMessage")
142
- sendEvent("onError", errorMessage)
140
+ override fun onError(errorResponse: ErrorResponse) {
141
+ Log.d("DsiEMVManagerModule", "onError: $errorResponse")
142
+ val map = Arguments.createMap().apply {
143
+ putString("responseOrigin", errorResponse.responseOrigin)
144
+ putString("dsixReturnCode", errorResponse.dsixReturnCode)
145
+ putString("cmdStatus", errorResponse.cmdStatus)
146
+ putString("textResponse", errorResponse.textResponse)
147
+ putString("sequenceNo", errorResponse.sequenceNo)
148
+ putString("userTrace", errorResponse.userTrace)
149
+ }
150
+ sendEvent("onError", map)
143
151
  }
144
152
 
145
153
  override fun onCardReadSuccessfully(cardData: CardData) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quivio-transaction-processor",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "React Native hook for Card payment integration with DataCap",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",