quivio-transaction-processor 1.0.12 → 1.0.13

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.
@@ -37,95 +37,69 @@ enum class ErrorCode(val code: String) {
37
37
  }
38
38
 
39
39
  data class SaleTransactionResponse(
40
- // Basic response fields
40
+ // CmdResponse section
41
41
  val responseOrigin: String,
42
42
  val dsixReturnCode: String,
43
43
  val cmdStatus: String,
44
44
  val textResponse: String,
45
- val sequenceNo: String,
46
- val userTrace: String,
47
-
48
- // Transaction details
45
+
46
+ // TranResponse section
49
47
  val merchantID: String,
48
+ val payAPIId: String,
50
49
  val acctNo: String,
51
50
  val cardType: String,
52
51
  val tranCode: String,
53
52
  val authCode: String,
53
+ val avsResult: String,
54
+ val cvvResult: String,
54
55
  val captureStatus: String,
55
56
  val refNo: String,
56
- val invoiceNo: String,
57
-
58
- // Amount fields
59
57
  val amount: Amount,
60
-
61
- // Additional transaction data
58
+ val cardholderName: String,
62
59
  val acqRefData: String,
60
+ val processorToken: String,
63
61
  val processData: String,
64
62
  val recordNo: String,
63
+ val recurringData: String,
65
64
  val entryMethod: String,
66
65
  val date: String,
67
66
  val time: String,
68
- val applicationLabel: String,
69
-
70
- // EMV specific fields
71
- val aid: String,
72
- val tvr: String,
73
- val iad: String,
74
- val tsi: String,
75
- val arc: String,
76
- val cvm: String,
77
- val payAPIId: String
67
+ val cvm: String
78
68
  )
79
69
 
80
70
  data class Amount(
81
71
  val purchase: String,
82
- val gratuity: String,
83
- val authorize: String,
84
- val cashback: String
72
+ val authorize: String
85
73
  )
86
-
87
74
  data class RecurringTransactionResponse(
88
- // Basic response fields
75
+ // CmdResponse section
89
76
  val responseOrigin: String,
90
77
  val dsixReturnCode: String,
91
78
  val cmdStatus: String,
92
79
  val textResponse: String,
93
- val sequenceNo: String,
94
- val userTrace: String,
95
-
96
- // Transaction details
80
+
81
+ // TranResponse section
97
82
  val merchantID: String,
83
+ val payAPIId: String,
98
84
  val acctNo: String,
99
85
  val cardType: String,
100
86
  val tranCode: String,
101
87
  val authCode: String,
88
+ val avsResult: String,
89
+ val cvvResult: String,
102
90
  val captureStatus: String,
103
91
  val refNo: String,
104
- val invoiceNo: String,
105
-
106
- // Amount fields
107
92
  val amount: Amount,
108
-
109
- // Additional transaction data
93
+ val cardholderName: String,
110
94
  val acqRefData: String,
95
+ val processorToken: String,
111
96
  val processData: String,
112
- val cardHolderID: String,
113
97
  val recordNo: String,
114
- val cardholderName: String,
115
98
  val recurringData: String,
116
99
  val entryMethod: String,
117
100
  val date: String,
118
101
  val time: String,
119
- val applicationLabel: String,
120
-
121
- // EMV specific fields
122
- val aid: String,
123
- val tvr: String,
124
- val iad: String,
125
- val tsi: String,
126
- val arc: String,
127
- val cvm: String,
128
- val payAPIId: String
102
+ val cvm: String
129
103
  )
130
104
 
131
105
  data class ZeroAuthTransactionResponse(
@@ -29,51 +29,38 @@ class XMLResponseExtractor {
29
29
  // build the amount object
30
30
  val amount = Amount(
31
31
  purchase = tag("Purchase").ifEmpty { "0.00" },
32
- gratuity = tag("Gratuity").ifEmpty { "0.00" },
33
32
  authorize = tag("Authorize").ifEmpty { "0.00" },
34
- cashback = tag("Cashback").ifEmpty { "0.00" }
35
33
  )
36
34
 
37
- // construct the response in one go
38
35
  SaleTransactionResponse(
39
- // Basic response fields
36
+ // CmdResponse section
40
37
  responseOrigin = tag("ResponseOrigin"),
41
- dsixReturnCode = tag("DSIXReturnCode"),
42
- cmdStatus = tag("CmdStatus"),
43
- textResponse = tag("TextResponse"),
44
- sequenceNo = tag("SequenceNo"),
45
- userTrace = tag("UserTrace"),
46
-
47
- // Transaction details
48
- merchantID = tag("MerchantID"),
49
- acctNo = tag("AcctNo"),
50
- cardType = tag("CardType"),
51
- tranCode = tag("TranCode"),
52
- authCode = tag("AuthCode"),
53
- captureStatus = tag("CaptureStatus"),
54
- refNo = tag("RefNo"),
55
- invoiceNo = tag("InvoiceNo"),
56
-
57
- // Amount fields
58
- amount = amount,
59
-
60
- // Additional transaction data
61
- acqRefData = tag("AcqRefData"),
62
- processData = tag("ProcessData"),
63
- recordNo = tag("RecordNo"),
64
- entryMethod = tag("EntryMethod"),
65
- date = tag("Date"),
66
- time = tag("Time"),
67
- applicationLabel= tag("ApplicationLabel"),
68
-
69
- // EMV specific fields
70
- aid = tag("AID"),
71
- tvr = tag("TVR"),
72
- iad = tag("IAD"),
73
- tsi = tag("TSI"),
74
- arc = tag("ARC"),
75
- cvm = tag("CVM"),
76
- payAPIId = tag("PayAPI_Id")
38
+ dsixReturnCode = tag("DSIXReturnCode"),
39
+ cmdStatus = tag("CmdStatus"),
40
+ textResponse = tag("TextResponse"),
41
+
42
+ // TranResponse section
43
+ merchantID = tag("MerchantID"),
44
+ payAPIId = tag("PayAPI_Id"),
45
+ acctNo = tag("AcctNo"),
46
+ cardType = tag("CardType"),
47
+ tranCode = tag("TranCode"),
48
+ authCode = tag("AuthCode"),
49
+ avsResult = tag("AVSResult"),
50
+ cvvResult = tag("CVVResult"),
51
+ captureStatus = tag("CaptureStatus"),
52
+ refNo = tag("RefNo"),
53
+ amount = amount,
54
+ cardholderName = tag("CardholderName"),
55
+ acqRefData = tag("AcqRefData"),
56
+ processorToken = tag("ProcessorToken"),
57
+ processData = tag("ProcessData"),
58
+ recordNo = tag("RecordNo"),
59
+ recurringData = tag("RecurringData"),
60
+ entryMethod = tag("EntryMethod"),
61
+ date = tag("Date"),
62
+ time = tag("Time"),
63
+ cvm = tag("CVM"),
77
64
  ).also {
78
65
  Log.d(TAG, "Successfully extracted SaleTransactionResponse from XML")
79
66
  }
@@ -93,53 +80,38 @@ class XMLResponseExtractor {
93
80
 
94
81
  val amount = Amount(
95
82
  purchase = tag("Purchase").ifEmpty { "0.00" },
96
- gratuity = tag("Gratuity").ifEmpty { "0.00" },
97
83
  authorize = tag("Authorize").ifEmpty { "0.00" },
98
- cashback = tag("Cashback").ifEmpty { "0.00" }
99
84
  )
100
85
  // construct the comprehensive response
101
86
  RecurringTransactionResponse(
102
- // Basic response fields
87
+ // CmdResponse section
103
88
  responseOrigin = tag("ResponseOrigin"),
104
- dsixReturnCode = tag("DSIXReturnCode"),
105
- cmdStatus = tag("CmdStatus"),
106
- textResponse = tag("TextResponse"),
107
- sequenceNo = tag("SequenceNo"),
108
- userTrace = tag("UserTrace"),
109
-
110
- // Transaction details
111
- merchantID = tag("MerchantID"),
112
- acctNo = tag("AcctNo"),
113
- cardType = tag("CardType"),
114
- tranCode = tag("TranCode"),
115
- authCode = tag("AuthCode"),
116
- captureStatus = tag("CaptureStatus"),
117
- refNo = tag("RefNo"),
118
- invoiceNo = tag("InvoiceNo"),
119
-
120
- // Amount fields
121
- amount = amount,
122
-
123
- // Additional transaction data
124
- acqRefData = tag("AcqRefData"),
125
- processData = tag("ProcessData"),
126
- cardHolderID = tag("CardHolderID"),
127
- recordNo = tag("RecordNo"),
128
- cardholderName = tag("CardholderName"),
129
- recurringData = tag("RecurringData"),
130
- entryMethod = tag("EntryMethod"),
131
- date = tag("Date"),
132
- time = tag("Time"),
133
- applicationLabel= tag("ApplicationLabel"),
134
-
135
- // EMV specific fields
136
- aid = tag("AID"),
137
- tvr = tag("TVR"),
138
- iad = tag("IAD"),
139
- tsi = tag("TSI"),
140
- arc = tag("ARC"),
141
- cvm = tag("CVM"),
142
- payAPIId = tag("PayAPI_Id")
89
+ dsixReturnCode = tag("DSIXReturnCode"),
90
+ cmdStatus = tag("CmdStatus"),
91
+ textResponse = tag("TextResponse"),
92
+
93
+ // TranResponse section
94
+ merchantID = tag("MerchantID"),
95
+ payAPIId = tag("PayAPI_Id"),
96
+ acctNo = tag("AcctNo"),
97
+ cardType = tag("CardType"),
98
+ tranCode = tag("TranCode"),
99
+ authCode = tag("AuthCode"),
100
+ avsResult = tag("AVSResult"),
101
+ cvvResult = tag("CVVResult"),
102
+ captureStatus = tag("CaptureStatus"),
103
+ refNo = tag("RefNo"),
104
+ amount = amount,
105
+ cardholderName = tag("CardholderName"),
106
+ acqRefData = tag("AcqRefData"),
107
+ processorToken = tag("ProcessorToken"),
108
+ processData = tag("ProcessData"),
109
+ recordNo = tag("RecordNo"),
110
+ recurringData = tag("RecurringData"),
111
+ entryMethod = tag("EntryMethod"),
112
+ date = tag("Date"),
113
+ time = tag("Time"),
114
+ cvm = tag("CVM")
143
115
  ).also {
144
116
  Log.d(TAG, "Successfully extracted ComprehensiveTransactionResponse from XML")
145
117
  }
@@ -159,9 +131,7 @@ class XMLResponseExtractor {
159
131
 
160
132
  val amount = Amount(
161
133
  purchase = tag("Purchase").ifEmpty { "0.00" },
162
- gratuity = tag("Gratuity").ifEmpty { "0.00" },
163
- authorize = tag("Authorize").ifEmpty { "0.00" },
164
- cashback = tag("Cashback").ifEmpty { "0.00" }
134
+ authorize = tag("Authorize").ifEmpty { "0.00" }
165
135
  )
166
136
  // construct the comprehensive response
167
137
  ZeroAuthTransactionResponse(
@@ -162,49 +162,40 @@ class DsiEMVManagerModule(private val reactContext: ReactApplicationContext) :
162
162
  override fun onSaleTransactionCompleted(saleDetails: SaleTransactionResponse) {
163
163
  Log.d("DsiEMVManagerModule", "onSaleTransactionCompleted")
164
164
  val map = Arguments.createMap().apply {
165
- // Basic response fields
165
+ // CmdResponse section
166
166
  putString("responseOrigin", saleDetails.responseOrigin)
167
167
  putString("dsixReturnCode", saleDetails.dsixReturnCode)
168
168
  putString("cmdStatus", saleDetails.cmdStatus)
169
169
  putString("textResponse", saleDetails.textResponse)
170
- putString("sequenceNo", saleDetails.sequenceNo)
171
- putString("userTrace", saleDetails.userTrace)
172
-
173
- // Transaction details
170
+
171
+ // TranResponse section
174
172
  putString("merchantID", saleDetails.merchantID)
173
+ putString("payAPIId", saleDetails.payAPIId)
175
174
  putString("acctNo", saleDetails.acctNo)
176
175
  putString("cardType", saleDetails.cardType)
177
176
  putString("tranCode", saleDetails.tranCode)
178
177
  putString("authCode", saleDetails.authCode)
178
+ putString("avsResult", saleDetails.avsResult)
179
+ putString("cvvResult", saleDetails.cvvResult)
179
180
  putString("captureStatus", saleDetails.captureStatus)
180
181
  putString("refNo", saleDetails.refNo)
181
- putString("invoiceNo", saleDetails.invoiceNo)
182
-
182
+
183
183
  // Amount fields
184
184
  putMap("amount", Arguments.createMap().apply {
185
185
  putString("purchase", saleDetails.amount.purchase)
186
- putString("gratuity", saleDetails.amount.gratuity)
187
186
  putString("authorize", saleDetails.amount.authorize)
188
- putString("cashback", saleDetails.amount.cashback)
189
187
  })
190
188
 
191
- // Additional transaction data
189
+ putString("cardholderName", saleDetails.cardholderName)
192
190
  putString("acqRefData", saleDetails.acqRefData)
191
+ putString("processorToken", saleDetails.processorToken)
193
192
  putString("processData", saleDetails.processData)
194
193
  putString("recordNo", saleDetails.recordNo)
194
+ putString("recurringData", saleDetails.recurringData)
195
195
  putString("entryMethod", saleDetails.entryMethod)
196
196
  putString("date", saleDetails.date)
197
197
  putString("time", saleDetails.time)
198
- putString("applicationLabel", saleDetails.applicationLabel)
199
-
200
- // EMV specific fields
201
- putString("aid", saleDetails.aid)
202
- putString("tvr", saleDetails.tvr)
203
- putString("iad", saleDetails.iad)
204
- putString("tsi", saleDetails.tsi)
205
- putString("arc", saleDetails.arc)
206
198
  putString("cvm", saleDetails.cvm)
207
- putString("payAPIId", saleDetails.payAPIId)
208
199
  }
209
200
  sendEvent("onSaleTransactionCompleted", map)
210
201
  }
@@ -212,52 +203,40 @@ class DsiEMVManagerModule(private val reactContext: ReactApplicationContext) :
212
203
  override fun onRecurringSaleCompleted(recurringDetails: RecurringTransactionResponse) {
213
204
  Log.d("DsiEMVManagerModule", "onRecurringSaleCompleted")
214
205
  val map = Arguments.createMap().apply {
215
- // Basic response fields
206
+ // CmdResponse section
216
207
  putString("responseOrigin", recurringDetails.responseOrigin)
217
208
  putString("dsixReturnCode", recurringDetails.dsixReturnCode)
218
209
  putString("cmdStatus", recurringDetails.cmdStatus)
219
210
  putString("textResponse", recurringDetails.textResponse)
220
- putString("sequenceNo", recurringDetails.sequenceNo)
221
- putString("userTrace", recurringDetails.userTrace)
222
-
223
- // Transaction details
211
+
212
+ // TranResponse section
224
213
  putString("merchantID", recurringDetails.merchantID)
214
+ putString("payAPIId", recurringDetails.payAPIId)
225
215
  putString("acctNo", recurringDetails.acctNo)
226
216
  putString("cardType", recurringDetails.cardType)
227
217
  putString("tranCode", recurringDetails.tranCode)
228
218
  putString("authCode", recurringDetails.authCode)
219
+ putString("avsResult", recurringDetails.avsResult)
220
+ putString("cvvResult", recurringDetails.cvvResult)
229
221
  putString("captureStatus", recurringDetails.captureStatus)
230
222
  putString("refNo", recurringDetails.refNo)
231
- putString("invoiceNo", recurringDetails.invoiceNo)
232
-
223
+
233
224
  // Amount fields
234
225
  putMap("amount", Arguments.createMap().apply {
235
226
  putString("purchase", recurringDetails.amount.purchase)
236
- putString("gratuity", recurringDetails.amount.gratuity)
237
227
  putString("authorize", recurringDetails.amount.authorize)
238
- putString("cashback", recurringDetails.amount.cashback)
239
228
  })
240
-
241
- // Additional transaction data
229
+
230
+ putString("cardholderName", recurringDetails.cardholderName)
242
231
  putString("acqRefData", recurringDetails.acqRefData)
232
+ putString("processorToken", recurringDetails.processorToken)
243
233
  putString("processData", recurringDetails.processData)
244
- putString("cardHolderID", recurringDetails.cardHolderID)
245
234
  putString("recordNo", recurringDetails.recordNo)
246
- putString("cardholderName", recurringDetails.cardholderName)
247
235
  putString("recurringData", recurringDetails.recurringData)
248
236
  putString("entryMethod", recurringDetails.entryMethod)
249
237
  putString("date", recurringDetails.date)
250
238
  putString("time", recurringDetails.time)
251
- putString("applicationLabel", recurringDetails.applicationLabel)
252
-
253
- // EMV specific fields
254
- putString("aid", recurringDetails.aid)
255
- putString("tvr", recurringDetails.tvr)
256
- putString("iad", recurringDetails.iad)
257
- putString("tsi", recurringDetails.tsi)
258
- putString("arc", recurringDetails.arc)
259
239
  putString("cvm", recurringDetails.cvm)
260
- putString("payAPIId", recurringDetails.payAPIId)
261
240
  }
262
241
  sendEvent("onRecurringSaleCompleted", map)
263
242
  }
@@ -285,9 +264,7 @@ class DsiEMVManagerModule(private val reactContext: ReactApplicationContext) :
285
264
  // Amount fields
286
265
  putMap("amount", Arguments.createMap().apply {
287
266
  putString("purchase", zeroAuthData.amount.purchase)
288
- putString("gratuity", zeroAuthData.amount.gratuity)
289
267
  putString("authorize", zeroAuthData.amount.authorize)
290
- putString("cashback", zeroAuthData.amount.cashback)
291
268
  })
292
269
 
293
270
  // Additional transaction data
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quivio-transaction-processor",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
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",