Skip to main content

Fallback

Normally, a terminal should not allow magnetic stripe transactions with a chip-enabled card. However, when the card's chip cannot be read (e.g., if it is damaged), fallback mode can be enabled, which allows a transaction with magnetic stripe to be performed.

Scenarios

Card Reading via Magnetic Stripe

When reading a card with ReadMode swipe, the hasChip property of the read card data must be verified. If the card has a chip, the transaction should not be allowed to continue.

Card Reading via Chip

If an error occurs when trying to perform a transaction, a recoverable fallback error is received. This error can be recovered and the following actions can be taken:

  • Indicate to the user that they can retry reading the card by swiping it.
  • If the next reading is by stripe, the transaction can be allowed regardless of the hasChip flag, and the fallback flag must be activated in the confirmation like this:
override fun onTransactionStateChanged(state: SDKTransactionState) {
when (state) {
is SDKTransactionState.ConfirmTransaction.Sale,
is SDKTransactionState.ConfirmTransaction.Cancel,
is SDKTransactionState.ConfirmTransaction.Refund -> {
state.confirm(
SDKConfirmationJson(
json = """
{
"paymentMethod": {
"entryMode": {
"fallback": true
},
// ...
},
// ...
}
""",
// other fields
)
)
}
// other cases ...
else -> {}
}
}