Methods
(static) this.monitorStatus(readerStatus)
Helper function to monitor the status of the supported magnetic card readers. This function is used to receive realtime notifications when supported a reader becomes available.
Parameters:
| Name | Type | Description |
|---|---|---|
readerStatus |
function | Callback function that updates the card reader status in real time. Parameters: info(object) - info.connected(boolean) - indicates if supported reader is connected - info.name(string) - reader name - info.version(string) - reader firmware version |
- Source:
Example
function MSStatus(info)
{
if (info.connected)
document.body.innerHTML+="Connected magnetic card reader <b>"+info.name+" "+info.version+"</b>, find me some cards!<br/>";
else
document.body.innerHTML+="Hey I want my magnetic card reader back!<br/>";
}
(static) this.setActiveHead(headIndex, successFunction, errorFunction)
Set the active head for scanner
Parameters:
| Name | Type | Description |
|---|---|---|
headIndex |
number | Currently real head is on index 0, emulated head is on 1 |
successFunction |
function | Callback function on success |
errorFunction |
function | Error function |
- Source:
(static) this.setEMSREncryption(encryptionIndex, successFunction, errorFunction)
Set the encryption type
Parameters:
| Name | Type | Description |
|---|---|---|
encryptionIndex |
number | index of encryption type. Use 3 for IDTECH 3 |
successFunction |
function | Callback function on success |
errorFunction |
function | Error function |
- Source:
Example
QBrowser.MagStripe.setEMSREncryption(2, EMSRSuccess, EMSRFailed);
(static) this.setEMSRMaskedData(boolExpiration, unmaskedDigitsAtStart, unmaskedDigitsAtEnd, successFunction, errorFunction)
Config the mask card data
Parameters:
| Name | Type | Description |
|---|---|---|
boolExpiration |
boolean | show expiration |
unmaskedDigitsAtStart |
number | number of unmasked digits at start, max is 6 |
unmaskedDigitsAtEnd |
number | number of unmasked digits at end, max is 6 |
successFunction |
function | Callback function on success |
errorFunction |
function | Error function |
- Source:
Example
QBrowser.MagStripe.setEMSRMaskedData(true, 4, 4, EMSRSuccess, EMSRFailed);
(static) this.simulate()
Helper function to simulate magnetic card scan for testing purposes. The simulated magnetic card data is sent to the function in QBrowsers settings.
- Source: