MT188 Card Reader
npm install @janiscommerce/mt188-card-reader---
``sh`
npm install @janiscommerce/mt188-card-reader
---
Parameters
options Object*
| options.contactless: Boolean* Indicates whether the card is contactles or not. Default: false
Returns Object with cardNumber, expirationMonth and expirationYear properties.
Throws MT188CardReaderError in case of error
Parameters
options Object -- Extends the options of getPAN()20
| options.maxAttempts: Number* The max quantity of attempts to get the card's PAN. Default:
Returns Promise Resolves with getPan() return value or rejects with a MT188CardReaderError Error
---
`js
const { MT188CardReader } = require('@janiscommerce/mt188-card-reader');
MT188CardReader.getPan({ contactless: false })
.then(pan => {
console.log(pan);
})
.catch(e => {
console.error(e);
});
// Or
MT188CardReader.getPANWithRetries({ contactless: false, maxAttempts: 10 })
.then(pan => {
console.log(pan);
})
.catch(e => {
console.error(e);
});
`
---
See the examples` directory.