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:
- Android
- iOS
- React Native
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 -> {}
}
}
func onTransactionStateChanged(state: SDKTransactionState) {
switch state {
case let .confirmPayment(card: card, confirmCallback: confirmCallback, rejectCallback: rejectCallback):
let confirmation = Confirmation(
// some fields
isFallback: true,
// other fields
)
Task {
let paymentConfirmation = PaymentConfirmation(
confirmation: confirmation,
// other fields
)
confirmCallback(paymentConfirmation)
}
// other cases ...
@unknown default:
break
}
}
func onTransactionStateChanged(transaction: CardTransaction, state: TransactionStates) {
switch (state) {
case TransactionStates.ConfirmTransactionSale:
await this.transaction.confirmSaleTransaction({
// some fields
fallbackEnabled: true,
// other fields
})
break
// other cases ...
}
}