Event Callbacks
Event callbacks in the EMV Core SDK are event-driven mechanisms triggered by the SDK to notify the application when specific events occur during the transaction lifecycle. They enable developers to respond dynamically to changes in transaction status and system events. These callbacks provide real-time updates, ensuring seamless communication between the SDK and the application.
These are the available callbacks.
You can read a more detailed description of each Callback event in the sections below.
TransactionComplete
TransactionComplete
The TransactionComplete
is called by EMV-Core when the transaction is complete and either succeeds or fails. Contains the details required by the POS to print a receipt and to link transactions to sale events
void TransactionComplete(AuthorizationDetails authorizationDetails);
In case of no response
If EMV-Core doesn’t get an answer, it will re-send 2 times (for a total of 3 messages), and if it still doesn’t get an answer, it will assume the message received and will not cancel the transaction.
Where:
Parameter | Description |
---|---|
errorDescription | A short technical description of the error is aimed at helping developers and tech support people identify the problem. It should not be presented to users. |
errorCode | A numerical code describing the error if one occurs. See the table in the section below for details of each code. |
status | Status OK, Declined, Error, Timeout, Cancelled, LocalMifare. |
amountAuthorized | The amount approved for the transaction. It may be lower than the original requested amount if it is a prepaid card. |
amountRequested | Amount requested for transaction approval. |
authorization_Code | PSP Transaction Identifier issued for approved transactions (EVO, Apriva, Traderoot). |
partialPan | Masked PAN with the card account number's first six and last four digits. |
cardType | Card scheme (MasterCard, Visa, Amex, etc.) or ‘Mifare’ in case of a closed loop. |
authID | Approval Code from the processor (for some processors). |
receiptID | Digital receipt ID in the PSP System. |
transaction_Reference | Transaction reference. It should be used to confirm or void. |
RRN | Processor reference number for approved transactions. |
card_ID | Mifare UID in case of a Mifare card and CLP_MIFARE_ENABLED=2 . |
isTransactionApproved | Boolean indicating the transaction approval status. |
CardToken | A token identifying the card. For payment cards, it returns a Base64 string. For closed-loop cards (e.g., Mifare), it returns the card UID. |
Channel | Channel used for card reading (e.g., Contactless, Magstripe, Contact). |
AID, TVR, IAD, TSI, ARC | Card/Transaction parameters that may be used for the receipt. |
transactionTime | Transaction time. |
application_Label | Card scheme (e.g., Visa, MasterCard, American Express). |
currency | Currency code according to ISO 4217 code (e.g., 840 means $US). |
CVM | Card Verification Method. |
additional_Parameters | The payment processor sends optional additional parameters. |
entryMode | |
card_Balance | End-user card hash (NMI). |
Error Codes
These are the possible error codes in the response:
Error Type | Error Code |
---|---|
JsonParse | -32700 |
General | -1000 |
Terminate | -999 |
Timeout | -998 |
Payment | -997 |
Reader Communication | -996 |
Positive code | Payment Service Provider (PSP) errors |
SystemStatusChanged
SystemStatusChanged
The SystemStatusChanged
event indicates changes in the SDKs or connected devices' operational state.
void onTransactionComplete(TransactionResult result);
SystemStatus
is an enumeration representing the current state of the system. See the possible result values in the table below:
Result | Description |
---|---|
Ready | The SDK is ready for transactions. |
NotReady | The SDK is not operational. |
PaymentTransaction | A transaction is currently in progress. |
Update | A firmware or configuration update is ongoing. |
ReaderMessageEvent
ReaderMessageEvent
The ReaderMessageEvent
callback provides updates on user interface messages from the card reader.
public ReaderMessage(int index, String line1, String line2)
Parameters:
Parameter | Description |
---|---|
index | The index of the message. Decimal value according to the Reader messages Index table . |
line1 | Text is shown in the 1st line of the reader display. |
line2 | Text is shown in the 2nd line of the reader display. |
Reader Configuration
For this feature to work, the reader must be configured to send External Display message events (Tag DF 46 with index 04).
CardTokenReceived
CardTokenReceived
The CardTokenReceived
event is triggered after a card token is successfully retrieved.
void CardTokenReceived(TokenDetails tokenDetails);
Where:
Parameter | Description |
---|---|
tokenDetails | String with the Card token. |
Updated 4 months ago