Use D1 SDK authentication
Let the D1 SDK manage Android device authentication during payment.
Overview
Flow
SDK
ContactlessTransactionListener paymentCallback = new ContactlessTransactionListener() {
@Override
public void onAuthenticationRequired(@NonNull VerificationMethod method) {
// At this stage, the issuer application calls the D1 SDK
// authentication API and lets the D1 SDK manage the
// Android device authentication screen.
// Create the AuthenticationParameter.
AuthenticationParameter params = new AuthenticationParameter(
activity, // The Activity that hosts authentication
"Custom authentication title",
"Custom authentication subtitle",
"Authentication description", // Include the transaction amount
"Cancel-button-label", // Label for the cancel button
new DeviceAuthenticationCallback() {
@Override
public void onSuccess() {
// Authentication succeeds.
// The payment flow continues to the next stage: onReadyToTap().
}
@Override
public void onFailed() {
// Authentication fails.
// The issuer application can ask the end user to retry
// by calling startAuthenticate() again.
}
@Override
public void onHelp(int fpCode, @NonNull CharSequence fpDetail) {
// For biometric authentication only.
// The issuer application can show the fpDetail message.
}
@Override
public void onError(int fpErrorCode) {
// For biometric authentication only.
// An error occurs during biometric authentication.
// For example, the sensor can be locked after multiple failed attempts.
// The issuer application should handle the error and guide the end user.
}
}
);
// Trigger authentication through the D1 SDK.
startAuthenticate(params);
}
// ...
}Last updated
Was this helpful?