Optimized Debit Routing
Test and go live
We recommended testing PINless debit in the sandbox before moving to a live environment.
The following card details can be used for testing. When these cards are used, the payer is routed through one of the debit networks:
- 5208233085365191 (Mastercard)
- 4070021557035923 (Visa)
Transactions are routed to one of the debit networks (STAR, Accel, NYCE, PULSE, or Maestro) based on optimized debit routing logic. The network depends on the transaction amount sent in the transaction sale request and the merchant category code (MCC) of the merchant account.
Auto-retry
If a transaction routed to the debit network is not successful, Braintree can retry the transaction over Visa or Mastercard networks. Reach out to your technical account manager to get enabled for auto-retries.
The debit network is empty during a successful retry, because the retry will be routed on Visa, Mastercard networks.
If the retry attempt proves unsuccessful as well, the initial transaction is recorded as a failed retry along with both the original and all subsequent retried transaction IDs.
-
getRetriedTransactionId()
: The transaction ID of the transaction that was retried -
getRetryIds()
: An array of transaction IDs for all retry attempts for this transaction -
isRetried()
: Returns true if the transaction is retried; otherwise false
Response:
- Java sample
if (authResult.isSuccess()) {
Transaction transaction = authResult.getTarget();
transaction.getId();
transaction.isRetried();
transaction.getStatus();
transaction.getRetryIds();
transaction.getRetriedTransactionId(); // Corrected line
// ...
transaction.getDebitNetwork();
}
- Successful retry
"transaction": {
"id": "5p4z558e",
// other fields...
"retriedTransactionId": "79cv9vpc", // this shows the parent transaction that failed initially
"retried": true,
"debitNetwork": null
}
- Failed retry
"transaction": {
"id": "79cv9vpc",
// other fields...
"retryIds": [
"02scmpqn",
"5p4z558e"
],
"retried": true,
"debitNetwork": "STAR"
}
Testing auto-retry
To test a retry of a PINless debit transaction in a sandbox environment, set the transaction amount to 2046. Please note that this is a negative test-case, the transaction will be unsuccessfully routed to a debit network, and the retry will be over Visa, or Mastercard network, and this will also result in failure.