Authenticate a transaction
Last updated
Was this helpful?
Was this helpful?
visaCTFHelper.authenticateTransaction(vProvisionedTokenId,
new TransactionListener() {
@Override
public void onDeviceAuthentication(DeviceAuthentication deviceAuthentication) {
FragmentActivity fragmentActivity;
CharSequence title;
CharSequence subTitle;
CharSequence description;
CharSequence negativeButtonText;
deviceAuthentication.startAuthentication(fragmentActivity,
title,
subTitle,
description,
negativeButtonText);
}
@Override
public void onError(TMGClientException exception) {
// Check error
int errorCode = exception.getErrorCode();
int errorMessage = exception.getMessage();
}
@Override
public void onSuccess(String visaPayload) {
// Retrieved the Visa Payload
}
});let vProvisionedTokenID: String = ""
// 1. Start authenticate transaction
visaCTFHelper.authenticateTransaction(forVProvisionedTokenID: vProvisionedTokenID,
deviceAuthenticationHandler: { auth in
// 2. Start user authentication
let customMessage = "" // Pass in the custom message. e.g: "Authenticate with Face ID"
auth.startAuthentication(withMessage: customMessage)
}, completionHandler: { (visaPayload, error) in
// 3. Success generate payload
if error == nil {
} else {
// Handle error
}
})