The constructor for the EMV expect as the parameter to be a valid reader-ID. A reader-ID can be obtained from the exposed core functionality, for more information see Core Services.
Core services responds with available card-readers, available card in a card-reader, etc.
For example:
In order to get all connected card-readers, with available cards:
var coreService =client.core();core.readersCardAvailable(callback);
This function call returns:
We notice that a card object is available in the response in the context of a detected reader.
The reader in the example above is VASCO DIGIPASS 870, has pin-pad capabilities, and there is a card detected with given ATR and some descriptions.
An ATR (Answer To Reset) identifies the type of a smart-card.
The reader, has a unique ID, reader_id; this reader_id must be used in order to request functionalities for the EMV card.
This must be done upon instantiation of the EMV container:
var emv =client.emv(reader_id);
All methods for emv will use the selected reader - identified by the reader_id.
On some applications there is an issuer public key certificate present. The aid parameter indicates which application you want to use, this can be fetched using the applications endpoint.
// Application ID can be retrieved with the Applications endpointvar aid ="..."client.emv(reader_id).issuerPublicCertificate(aid, callback);
On some applications there is an icc public key certificate present. The aid parameter indicates which application you want to use, this can be fetched using the applications endpoint.
// Application ID can be retrieved with the Applications endpointvar aid ="..."client.emv(reader_id).iccPublicCertificate(aid, callback);
Note that, when the user has at least one retry left, entering a correct PIN resets the PIN retry status.
Error Handling
Error Object
The functions specified are asynchronous and always need a callback function.
The callback function will reply with a data object in case of success, or with an error object in case of an error. An example callback: