bool Sale(string)

Performs a single step sale transaction for the requested amount and returns the result via the OnKioEMVTransactionCompleted callback.

Security

Trust Level Required: Full Trust

Parameters

Name Description
input string
Serialized JSON string with parameters from the EMVRequestInput class.

Return

True if the command was queued for processing, false otherwise.

Remarks

This transaction type is not supported by ChipDNA. Most integrations only require the PaymentAmount parameter to be specified. TaxAmount is only required by Shift4. FreedomPay requires the ProductDescriptors parameter.

Examples



// set up the request
var input = {
  "PaymentAmount": 425
};

// begin the sale operation
if (!KioEMVDevice.Sale(input))
   alert('Failed to call Sale!');

// TransTypes constants, to make life easier
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
};

// ResultTypes constants
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.Sale) {
        alert('Sale succeeded!');
    }
    else {
    	alert('Operation returned: ' + lastTransResult.Result);
    }
}

Requirements

KioWare for Windows version 8.24 or greater.