Optional features
Overview
Use these implementation details to complete the payment flow.
Use these features only when they are supported by your payment experience.
SDK
Display the authentication timer
Use DeviceAuthenticationTimeoutCallback to show the remaining time before the end user must tap again.
Register the callback with registerDeviceAuthTimeoutCallback() when the payment flow reaches onReadyToTap().
This callback is useful for payment experiences that require a second tap, such as manual mode.
ContactlessTransactionListener paymentCallback = new ContactlessTransactionListener() {
@Override
public void onReadyToTap() {
// ...
// Register the timeout callback to update the end user on the
// remaining time before the second tap.
D1PayConfigParams.getInstance()
.getContactlessTransactionListener()
.registerDeviceAuthTimeoutCallback(
new DeviceAuthenticationTimeoutCallback() {
@Override
public void onTimer(int remain) {
// Update the countdown screen with the current
// remaining time.
}
@Override
public void onTimeout() {
// Inform the end user that authentication timed out.
}
}
);
// Inform the end user to tap again and show the countdown screen
// for the CDCVM validity period.
}
// ...
};Display transaction details
To improve the end user experience, the issuer application can display transaction details, such as amount, currency, and transaction type, when TransactionData is available.
Use the TransactionData object to access these values.
The callback that exposes TransactionData depends on the payment experience. For example, in manual mode, TransactionData is only available in onTransactionCompleted().
Enable or disable contactless payment
You can disable contactless payment by default and enable it only after the end user signs in and selects Pay in the issuer application.
After the D1 SDK initializes, call D1PayWallet.setContactlessTransactionAllowed(false).
When the end user selects Pay, call D1PayWallet.setContactlessTransactionAllowed(true) to enable the contactless transaction.
Enable contactless payment for each transaction, then disable it again after the transaction completes or is canceled.
Last updated
Was this helpful?