Activate binding with customer service
Last updated
Was this helpful?
Was this helpful?
@Override
public void onIssuerAuthenticationRequired(IDVSession idvSession) {
// Submit CUSTOMER_SERVICE ID&V Method
for (IDVMethod idvMethod : idvSession.getIdvMethods()) {
if (idvMethod.getType().equals(IDVType.CUSTOMER_SERVICE)) {
idvSession.selectIdvMethod(idvMethod);
}
}
}
@Override
public void onIssuerAuthenticationReady(IDVSession idvSession,
@Nullable OtpActivationStatus status) {
}
@Override
public void onError(TMGClientException exception) {
// Check if there's any error
int errorCode = exception.getErrorCode();
int errorMessage = exception.getMessage();
}guard let idvSession = VisaService.shared.idvSession else {
// no idv session
return
}
// 1. Displays the list of IDV methods
do {
let idvMethods = try idvSession.idvMethods
let selectedIdvMethod = idvMethods[0] // user select an CUSTOMER_SERVICE idv method
// 2. Submit the IDV method.
idvSession.selectIDVMethod(selectedIdvMethod) { (result) in
if let otpActivationStatus = result {
} else {
if selectedIdvMethod.type == .customerService {
let value = selectedIdvMethod.value
// 3. Verify through customer service.
}
}
}
} catch let error {
// Handles the error.
}
// 4. Failure in step 2, selectIDVMethod, will be handled in completionHandler.
VisaService.shared.completionHandler = { (session, error) in
// 5. Check if it is a selectIDVMethod error.
if let session = session,
let error = error,
error.description == TMGError.invalidIdvMethod.description {
VisaService.shared.idvSession = session
// 6. Retry the IDV flow.
}
}// Get the customer service data
String value = idvMethod.getValue();let value = selectedIdvMethod.value@Override
public void onIssuerAuthenticationReady(IDVSession idvSession,
@Nullable OtpActivationStatus status) {
// Activate binding locally
idvSession.activateBinding(null);
}
@Override
public void onError(TMGClientException exception) {
// Check if there's any error
int errorCode = exception.getErrorCode();
int errorMessage = exception.getMessage();
}guard let idvSession = VisaService.shared.idvSession else {
// no idv session
return
}
// 1. Call activate
idvSession.activateBinding(withValue: nil)
VisaService.shared.completionHandler = { (session, error) in
// 2. Binding successful
if error == nil {
}
}