bool Void(string)
Voids an unconfirmed PreAuth transaction and returns the result via the OnKioEMVTransactionCompleted callback.
Security
Trust Level Required: Full Trust
Parameters
Name | Description |
input |
string Serialized JSON string with the following parameters from the EMVRequestInput class: PaymentAmount, TaxAmount, TransactionRef, CardToken, AuthCode, AcqRefData, ProcessData, and (optional) DeviceName. |
Return
True if the command was queued for processing, false otherwise.
Remarks
After successfully running a PreAuth transaction, the transaction must then be confirmed or voided. This call effectively cancels the submitted PreAuth transaction. The call must be made while the PreAuth transaction is still in the day's batch. This transaction type is not supported by NETePay. This call should not be used to void sale transactions; VoidSale() should be called instead.
Examples
var input1 = {
"PaymentAmount": 425,
"TaxAmount": 10,
"DeviceName": "MyDevice"
};
if (!KioEMVDevice.Payment(input1))
alert('Failed to call Payment!');
var TransTypes = {
"None": 0,
"SetParameters": 1,
"Payment": 2, // PreAuth
"Confirm": 3, // PreAuth Capture
"Terminate": 4,
"VoidTrans": 5,
"Refund": 6,
"SetIdleMsg": 7,
"Sale": 8,
"VoidSale": 9,
"Reset": 10,
"RequestTMSUpdate": 11
};
var ResultTypes = {
"Unknown": 0,
"Approved": 1,
"Declined": 2,
"Error": 3
};
// callback fired when operation processed
function OnKioEMVTransactionCompleted(lastTransResult) {
alert('Operation returned: ' + lastTransResult.Result);
if (lastTransResult.Result == ResultTypes.Approved && lastTransResult.TransType == TransTypes.Payment) {
var input2 = {
"PaymentAmount": lastTransResult.Amount,
"TaxAmount": lastTransResult.Tax,
"TransactionRef": lastTransResult.ReferenceID,
"CardToken": lastTransResult.CardHashToken,
"AuthCode": lastTransResult.AuthorizationCode,
"AcqRefData": lastTransResult.AcqRefData,
"ProcessData": lastTransResult.ProcessData,
"DeviceName": "MyDevice"
};
}
if (!KioEMVDevice.Void(input2))
alert('Failed to call Void');
}
Requirements
KioWare for Windows version 8.24 or greater.