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

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:

ParameterDescription
errorDescriptionA 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.
errorCodeA numerical code describing the error if one occurs. See the table in the section below for details of each code.
statusStatus OK, Declined, Error, Timeout, Cancelled, LocalMifare.
amountAuthorizedThe amount approved for the transaction. It may be lower than the original requested amount if it is a prepaid card.
amountRequestedAmount requested for transaction approval.
authorization_CodePSP Transaction Identifier issued for approved transactions (EVO, Apriva, Traderoot).
partialPanMasked PAN with the card account number's first six and last four digits.
cardTypeCard scheme (MasterCard, Visa, Amex, etc.) or ‘Mifare’ in case of a closed loop.
authIDApproval Code from the processor (for some processors).
receiptIDDigital receipt ID in the PSP System.
transaction_ReferenceTransaction reference. It should be used to confirm or void.
RRNProcessor reference number for approved transactions.
card_IDMifare UID in case of a Mifare card and CLP_MIFARE_ENABLED=2.
isTransactionApprovedBoolean indicating the transaction approval status.
CardTokenA token identifying the card. For payment cards, it returns a Base64 string. For closed-loop cards (e.g., Mifare), it returns the card UID.
ChannelChannel used for card reading (e.g., Contactless, Magstripe, Contact).
AID, TVR, IAD, TSI, ARCCard/Transaction parameters that may be used for the receipt.
transactionTimeTransaction time.
application_LabelCard scheme (e.g., Visa, MasterCard, American Express).
currencyCurrency code according to ISO 4217 code (e.g., 840 means $US).
CVMCard Verification Method.
additional_ParametersThe payment processor sends optional additional parameters.
entryMode
card_BalanceEnd-user card hash (NMI).

Error Codes

These are the possible error codes in the response:

Error TypeError Code
JsonParse-32700
General-1000
Terminate-999
Timeout-998
Payment-997
Reader Communication-996
Positive codePayment Service Provider (PSP) errors

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:

ResultDescription
ReadyThe SDK is ready for transactions.
NotReadyThe SDK is not operational.
PaymentTransactionA transaction is currently in progress.
UpdateA firmware or configuration update is ongoing.

ReaderMessageEvent

The ReaderMessageEvent callback provides updates on user interface messages from the card reader.

public ReaderMessage(int index, String line1, String line2)

Parameters:

ParameterDescription
indexThe index of the message. Decimal value according to the Reader messages Index table .
line1Text is shown in the 1st line of the reader display.
line2Text 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

The CardTokenReceived event is triggered after a card token is successfully retrieved.

void CardTokenReceived(TokenDetails tokenDetails);

Where:

ParameterDescription
tokenDetailsString with the Card token.