MagneFlex Demo Page (JS)
Use this page to request MagneFlex app request
Download MTMagneFlexLib.js
Select a tab that is relevant to your device to send request
Sample Request From JavaScript
Command return data will be here.
Request Data
Use this function to request card swipe.
Request Data
View Sample Code
function requestData()
{
var readerParam = new MTMagneFlexParameter.readerParameter();
readerParam.timeLimit = '3C';
var requestParam = new MTMagneFlexParameter.requestParameter();
requestParam.operation = MagneFlexOp.REQUEST_DATA;
requestParam.httpMethod = HTTPMethod.NONE;
requestParam.customDisplayMessage = 'Please Swipe Card or Scan a Check';
requestParam.fullScreenMode = false;
requestParam.closeDeviceAfter = true;
requestParam.destinationURL = '';
MTMagneFlexLib.requestData(readerParam, requestParam, dataCallBack);
}
Sample return data will be here.
Sample Request From JavaScript
Request Card Swipe
Use this function to request card swipe.
Request Swipe
Request Cancel Card Swipe
Card Swipe Event Message will be displayed here.
View Sample Code
function requestCardSwipe()
{
var readerParam = new MTMagneFlexParameter.readerParameter();
readerParam.timeLimit = '3c';
readerParam.endSession = true;
var requestParam = new MTMagneFlexParameter.requestParameter();
requestParam.operation = MagneFlexOp.REQUEST_CARD_SWIPE;
requestParam.httpMethod = HTTPMethod.NONE;
requestParam.customDisplayMessage = "";
requestParam.fullScreenMode = false;
requestParam.destinationURL = '';
requestParam.closeDeviceAfter = true;
MTMagneFlexLib.requestCardSwipe(readerParam, requestParam, event_CardSwipeCallback);
}
Sample return data will be here.
Command return data will be here.
Command return data will be here.
Request Smart Card Transaction
Use this function to start a Smart Card Transaction.
Transaction Type:
Request EMV Transaction
Request Cancel EMV Transaction
EMV Transaction Event Message will be displayed here.
View Sample Code
Refresh
function requestSmartCard() {
var readerParam = new MTMagneFlexParameter.readerParameter();
readerParam.timeLimit = '3C';
readerParam.endSession = "true";
readerParam.amount = txtTransactionAmount.value;
readerParam.cashBack = txtTransactionCashback.value;
readerParam.option = "00";
readerParam.currencyCode = "0840";
readerParam.cardType = "02";
readerParam.transactionType = "00";
readerParam.sendBatchData = "true";
readerParam.contact = chkReader_Contact.checked ? "true" : "false";
readerParam.contactless = chkReader_Contactless.checked ? "true" : "false";
readerParam.quickChipMode = chkTransactionType_QuickChip.checked ? "true" : "false";
var requestParam = new MTMagneFlexParameter.requestParameter();
requestParam.operation = MagneFlexOp.REQUEST_SMART_CARD_TRANSACTION;
requestParam.httpMethod = HTTPMethod.NONE;
requestParam.fullScreenMode = false;
requestParam.destinationURL = '';
requestParam.closeDeviceAfter = true;
MTMagneFlexLib.requestSmartCard(readerParam, requestParam, arcqDataCallBack, batchDataCallback, displayEMVMessageCallback);
}
Sample ARQC data return data will be here.
Sample Batch data return data will be here.
Request PIN
PINPAD only function
Use this function request PIN from PINPAD.
Request PIN
Request PIN Event Message will be displayed here.
View Sample Code
function requestPINEntry()
{
var readerParam = new MTMagneFlexParameter.readerParameter();
readerParam.endSession = true;
readerParam.timeLimit = "3C";
readerParam.fieldSeparator = "|";
readerParam.maxPinLength = "0C";
readerParam.minPinLength = "04";
readerParam.pinMode = "0";
readerParam.tone = "01";
readerParam.pinOption = "02";
var requestParam = new MTMagneFlexParameter.requestParameter();
requestParam.operation = MagneFlexOp.REQUEST_PIN_ENTRY;
requestParam.httpMethod = HTTPMethod.NONE;
requestParam.fullScreenMode = false;
requestParam.destinationURL = '';
requestParam.closeDeviceAfter = true;
MTMagneFlexLib.requestPinEntry(readerParam, requestParam, pinDataCallback);
}
Encrypted PIN Data will be displayed here.
Request Manual Card Entry
PINPAD only function
Use this function request Manual Card Entry from PINPAD.
Request Manual Entry
View Sample Code
function requestManualEntry()
{
var readerParam = new MTMagneFlexParameter.readerParameter();
readerParam.endSession = true;
readerParam.timeLimit = "3C";
readerParam.tone = "01";
readerParam.option = "08";
var requestParam = new MTMagneFlexParameter.requestParameter();
requestParam.operation = MagneFlexOp.REQUEST_MANUAL_CARD_ENTRY;
requestParam.httpMethod = HTTPMethod.NONE;
requestParam.fullScreenMode = false;
requestParam.destinationURL = '';
requestParam.closeDeviceAfter = true;
MTMagneFlexLib.requestManualEntry(readerParam, requestParam, manualCardDataCallback);
}
Encrypted Card Data will be displayed here.
Scanned Barcode Data will be displayed here.