KWCardEase Object

KioWare for Android now supports Chip and PIN (EMV) transactions via CreditCall's CardEase Mobile (MPos) platform for devices running Android 4.1 and higher. The supported Pin Pad may either be connected via USB or paired via Bluetooth. The KioWare Device Support APK must be installed on your device. Transactions and refunds can be run on your device using compatible devices.

There are three main parts to using the CardEase Mobile platform: initialization, PIN pad communication, and running a transaction. These items are reviewed below.

Setting up Bluetooth

If choosing to use Bluetooth as the communication layer, it must first be paired as a Bluetooth device in Android. Open your settings and select "Bluetooth". Turn on the Bluetooth devices feature, and any nearby Bluetooth devices will appear in the listing. Your device will then show as a paired device on the CardEase Devices screen in the Config Tool (see Device Management Tab, CardEase Devices). Select the "CardEase Mobile Device Type" setting, and then select the "Miura M007/M010 - Bluetooth" option to enable Bluetooth devices. Next, select the "Bluetooth Device" setting that appears and choose one of the paired devices. Once CardEase is enabled, JavaScript calls can be used to request actions (see below).

Initialization

  1. To initialize the framework of the CardEase Mobile platform, call KWCardEase.setParameters(). This call only needs to be made once after starting KioWare for Android, but can be made more than once if desired. If the function returns false, then the initialization has failed. Do not continue until the function returns true.
  2. The call will return immediately, but the result will not be available immediately. The web page should wait until a result is available by checking if your device is busy. To get the busy status, call KWCardEase.getIsBusy(). If the function returns true, then the device is busy. If not, then the result is ready.
  3. Once the device is no longer busy, the web page can call KWCardEase.isInitialised() to find out whether the framework was successfully initialized. If the function returns false, then the initialization has failed. Do not continue until the function returns true.

PIN Pad Communication

When the web page is ready to run a transaction, it should attempt a connection to the PIN pad. Communication must be established with the PIN pad before any transactions can be run.

  1. To connect to the PIN pad, call KWCardEase.connectToPinPad(). If this function returns false, the connection has failed. Do not continue until the function returns true. As with setParameters, the function will return immediately, but the result will not be available until the device is no longer busy. Note: Before attempting to connect, the PIN pad must be powered up and the Bluetooth radio must be ready for connections.
  2. Next, call KWCardEase.getIsBusy() until the function returns false.
  3. Once the device is no longer busy, the web page can call KWCardEase.isPinPadConnected() to find out whether a connection was made to the PIN pad. If the function returns false, the connection has failed. Do not continue until the function returns true.

Note: Though you can call connectToPinPad() when the PIN pad is already connected, do not assume that the PIN pad is still connected, even after a recent transaction. If the Bluetooth radio loses connectivity with the Android device, the connection will close.

Running a Transaction

After the PIN pad has connected, transactions can be run.

  1. To run a transaction, call KWCardEase.processSaleTransaction(), with dollars and cents as a string (e.g., "125" for $1.25). If the function returns false, then the transaction has failed. Do not continue until the function returns true.
  2. Call KWCardEase.getIsBusy() until the function returns false. While the device is busy, the web page can request the current state of the PIN pad using KWCardEase.getProcessUpdate(), which will return a numeric state.
  3. When the device no longer reports a busy state, call KWCardEase.getLastTransactionResult() to get the last transaction. This will return a JavaScript Object Notation (JSON) object with details of the result.

Functions

Type Signature
void setParameters(string, string, bool, string)
This function initializes the CardEase Mobile framework.
bool getIsBusy()
This function requests the busy state of the device.
bool isInitialised()
This function requests the initialization state of the framework.
bool connectToPinPad()
This function begins a connection to the Bluetooth PIN pad.
bool isPinPadConnected()
This function queries whether the PIN pad is connected.
bool processSaleTransaction(string transactionAmount)
This function requests a sale transaction to be started.
int getProcessUpdate()
This function requests the current state of the in-progress transaction.
int getLastTransactionResult()
This function returns the last transaction result.