bool Sale (int, 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
amount int
The amount of the transaction to run in cents, or whatever the minor currency unit is for your device/configuration.
deviceName (Optional) string
The name of the device. If not supplied, the first matching configured device of this type will be used.

Return

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

Remarks

This transaction type is not supported by ChipDNA.

Examples


if (!KioEMVTransaction.Sale(425))
   alert('Failed to call Sale!');

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,
    Timeout = 4,
    Cancelled = 5,
}

// callback fired when operation processed
function OnKioEMVTransactionCompleted(result) {
   if (lastTransResult.Result == ResultTypes.Approved) {
      if ((lastTransResult.TransType == TransTypes.Sale) {
          alert('Success!');
      }
   }
}
                        

Requirements

KioWare for Windows version 8.7 or greater.