Tutorial: Sample Terminal UI Events

Sample Terminal UI Events


Full list of events available below


Example Code

Agent.onReady(async () => {
    const events = [];
    const subscription = await Agent.Payments.onTerminalUiEvent(
        ({ eventName, eventCode }) => events.push(`${eventName} (${eventCode})`)
    );

    const payment = await Agent.Payments.startTransaction(
        Agent.Payments.TransactionType.PreAuth,
        { invoiceNumber: 'DEF383832', invoiceDate: (new Date()).toISOString() },
        { total: 10 },
        {
            enableMSR: true,
            enableContact: true,
            noEMVFallbackToMSR: false
        }
    );

    await subscription.unSubscribe();
    events.forEach(event => console.log(event));
});

Scenarios

Approved Transactions

Using signature card
Event Name Event code
TransactionReady 07
ContactCardReadInitiated 20
ContactOnlineRequest 21
ContactTransactionApprovedOnline 27
ContactCardRemovedAfterCompletion 2D
Idle 01
Idle 01
Using offline pin card
Event Name Event code
TransactionReady 07
ContactCardReadInitiated 20
ContactPINRequiredFromUser 4E
ContactOfflinePinAccepted 49
ContactOnlineRequest 21
ContactTransactionApprovedOnline 27
ContactCardRemovedAfterCompletion 2D
Idle 01
Idle 01
Using online pin card
Event Name Event code
TransactionReady 07
ContactCardReadInitiated 20
ContactPINRequiredFromUser 4E
ContactOnlinePINRequired 22
ContactTransactionApprovedOnline 27
ContactCardRemovedAfterCompletion 2D
Idle 01
Idle 01

Cancelled Transaction

Inserted signature card removed at authorising screen
Event Name Event code
TransactionReady 07
ContactCardReadInitiated 20
ContactOnlineRequest 21
TransactionCancelled 09
ContactCardRemovedAfterCompletion 2D
Idle 01
Idle 01
Idle 01
Timeout at PIN prompt
Event Name Event code
TransactionReady 07
ContactCardReadInitiated 20
ContactPINRequiredFromUser 4E
ContactTerminateTransaction 46
ContactCardRemovedAfterCompletion 2D
Idle 01
ContactTransactionDeclinedOnline 28
Idle 01
User cancels transaction at PIN prompt from the terminal
Event Name Event code
TransactionReady 07
ContactCardReadInitiated 20
ContactPINRequiredFromUser 4E
ContactTerminateTransaction 46
ContactTransactionDeclinedOnline 28
ContactCardRemovedAfterCompletion 2D
Idle 01
Idle 01
Cancelled via Agent API at PIN prompt
Event Name Event code
TransactionReady 07
ContactCardReadInitiated 20
ContactPINRequiredFromUser 4E
ContactTerminateTransaction 46
ContactTransactionDeclinedOnline 28
ContactCardRemovedAfterCompletion 2D
Idle 01
Idle 01
Immediate Cancellation via Agent API
Event Name Event code
TransactionReady 07
TransactionCancelled 09
Idle 01
Idle 01

Fallback

User inserts card backwards x3

(noEMVFallbackToMSR: false)

Event Name Event code
TransactionReady 07
ContactTryCardInsertAgain 51
ContactCardRemovedAfterCompletion 2D
TransactionReady 07
ContactTryCardInsertAgain 51
ContactCardRemovedAfterCompletion 2D
TransactionReady 07
ContactErrorFallback 2B
ContactCardRemovedAfterCompletion 2D
FallbackMSRReady 08
MSRReadSuccessful 32
MSRTransactionApprovedOnline 4B
Idle 01
Idle 01
User inserts card backwards x3

(noEMVFallbackToMSR: true)

Event Name Event code
TransactionReady 07
ContactTryCardInsertAgain 51
ContactCardRemovedAfterCompletion 2D
TransactionReady 07
ContactTryCardInsertAgain 51
ContactCardRemovedAfterCompletion 2D
TransactionReady 07
ContactErrorFallback 2B
ContactCardRemovedAfterCompletion 2D
FallbackMSRReady 08
MSRReadSuccessful 32
MSRTransactionDeclinedOnline 4C
Idle 01
Idle 01



UI Events

Event Name Event code
Idle 01
TransactionReady 07
FallbackMSRReady 08
TransactionCancelled 09
TransactionTimeout 0A
ContactlessCollision 0C
ContactlessReadSuccessful 0F
ContactlessNotRemoved 10
ContactlessRemoved 11
ContactlessOnlineRequested 15
ContactlessPinRequired 16
ContactlessSignatureRequired 17
ContactlessTransactionApprovedOffline 18
ContactlessTransactionDeclinedOffline 19
ContactlessTransactionApprovedOnline 1A
ContactlessTransactionDeclinedOnline 1B
ContactlessErrorFallbackMagstripe 1C
ContactlessErrorFallbackContact 1D
ContactlessErrorFallbackOther 1E
ContactlessTransactionTryAgain 1F
ContactCardReadInitiated 20
ContactOnlineRequest 21
ContactPINRequiredFromUser 4E
ContactOnlinePINRequired 22
ContactSignatureRequired 23
ContactContinueTransaction 24
ContactTransactionApprovedOffline 25
ContactTransactionDeclinedOffline 26
ContactTransactionApprovedOnline 27
ContactTransactionDeclinedOnline 28
ContactError 29
ContactErrorCardCommunication 2A
ContactErrorFallback 2B
ContactCardNotRemoved 2C
ContactCardRemovedAfterCompletion 2D
ContactPINTryLimitExceeded 2E
ContactLastPINTry 2F
ContactTryAgain 30
ContactReferral 31
MSRReadSuccessful 32
MSRError 33
ErrorCardCommunication 34
Error 35
ContactlessTransactionTooManyTaps 3A
ContactlessInteracErrorFallbackOther 3B
ContactCardNotAccepted 3C
ContactlessInteracErrorFallbackContact 3D
ContactDeferredApproval 44
ContactDeferredDeclined 45
ContactTerminateTransaction 46
ContactIncorrectPinTransactionDeclined 47
ContactPinTryLimitExceedDeclined 48
ContactOfflinePinAccepted 49
MSRCardReadSuccessfulWFallback 4A
MSRTransactionApprovedOnline 4B
MSRTransactionDeclinedOnline 4C
ContactPauseTransactionProcessing 4D
ContactTransactionApprovedOnlineWIdle 4F
ContactTransactionDeclinedOnlineWIdle 50
ContactTryCardInsertAgain 51
ContactIncorrectPinTryAgain 52
ContactCardReadError 53