Authenticating Enrolled Cards
In the response from the enrollment check service, confirm that you receive
these fields and values:
- 3-D Secure version = 2.x
- VERes enrolled = Y
- PARes status = C
These values identify whether it is an EMV 3-D Secure 2.x transaction and that
a challenge is required.
After you validate these fields, you request the
Cardinal.cca_continue
process (Android SDK) or the Cardinal session continue
process (iOS SDK) for the
SDK to perform the challenge between the customer and the issuing bank.Calling Cardinal.cca_continue (Android SDK)
After you verify that a customer’s card is enrolled in a card authentication
program, you must include the payload and the
consumerAuthenticationInformation.authenticationTransactionId
response field
and incorporate them into the Cardinal.cca_continue
function as shown in this
example before proceeding with the authentication session./** * Cca continue. * * @param transactionId the transaction id * @param payload the payload * @param currentActivity the current activity * @throws InvalidInputException the invalid input exception * @throws JSONException the json exception * @throws UnsupportedEncodingException the unsupported encoding exception */ try { cardinal.cca_continue("[TRANSACTION ID ]", "[PAYLOAD]", this, new CardinalValidateReceiver() { /** * This method is triggered when the transaction * has been terminated. This is how SDK hands back * control to the merchant's application. This method will * include data on how the transaction attempt ended and * you should have your logic for reviewing the results of * the transaction and making decisions regarding next steps. * JWT will be empty if validate was not successful. * * @param validateResponse * @param serverJWT */ @Override public void onValidated(Context currentContext, ValidateResponse validateResponse, String serverJWT) { } }); } catch (Exception e) { // Handle exception }
Calling Cardinal session continue (iOS SDK)
When you have verified that a customer’s card is enrolled in a card authentication
program, include the payload, and the response field and incorporate
them into the
Cardinal session continue
function before proceeding with the
authentication session.In the
Cardinal session continue
function, you should pass a class conforming
to the CardinalValidationDelegate
protocol (and implement the
stepUpDidValidate
method) as a parameter. These examples show a class
conforming to the CardinalValidationDelegate
protocol. Objective-C Examples
Objective-C Examples
Cardinal session continue (iOS SDK - Objective-C)
@interface YourViewController()<CardinalValidationDelegate>{ //Conform your ViewController or any other class to CardinalValidationDelegate protocol } @end @implementation YourViewController /** * This method is triggered when the transaction has * been terminated.This is how SDK hands back * control to the merchant's application. This method will * include data on how the transaction attempt ended and * you should have your logic for reviewing the results of * the transaction and making decisions regarding next steps. * JWT will be empty if validate was not successful * * @param session * @param validateResponse * @param serverJWT */ -(void)cardinalSession:(CardinalSession *)session stepUpDidValidateWithResponse:(CardinalResponse *)validateResponse serverJWT:(NSString *)serverJWT{ } @end
If the
Cardinal.continue
process is requested in the same class, request the method shown
in the following example to start the step up flow.Cardinal.continue Request in the Same Class (Objective-C)
[session continueWithTransactionId: @"[TRANSACTION_ID]" payload: @"[PAYLOAD]" didValidateDelegate: self];
Swift Examples
Swift Examples
Cardinal session continue (iOS SDK - Swift)
class YourViewController:CardinalValidationDelegate { /** * This method is triggered when the transaction has been * terminated.This is how SDK hands back * control to the merchant's application. This method will * include data on how the transaction attempt ended and * you should have your logic for reviewing the results of * the transaction and making decisions regarding next steps. * JWT will be empty if validate was not successful * * @param session * @param validateResponse * @param serverJWT */ func cardinalSession(cardinalSession session: CardinalSession!, stepUpValidated validateResponse: CardinalResponse!, serverJWT: String!) { } }
If If the
Cardinal.continue
function is requested in the same class, request
the method shown in the example below to start the step up flow. Cardinal.continue Request in the Same Class (Swift)
session.continueWith(transactionId: "[TRANSACTION_ID]", payload: "[PAYLOAD]", validationDelegate: self)
When necessary, the SDK displays the authentication window and the customer enters
their authentication information.
Receiving the Authentication Results
Next, the
onValidated()
function (Android SDK) or the stepUpDidValidate
function
(iOS SDK) launches and returns the authentication results and response JWT along with the
processor transaction ID as shown in this example. Decoded Response JWT
{ "iss": "5a4504be6fe3d1127cdfd94e", "iat": 1555075930, "exp": 1555083130, "jti": "cc532159-636d-4fa8-931d-d4b0f4c83b99", "ConsumerSessionId": "0_9a16b7f5-8b94-480d-bf92-09cd302c9230", "aud": "d0cf3392-62c5-4107-bf6a-8fc3bb49922b", "Payload": { "Payment": { "Type": "CCA", "ProcessorTransactionId": "YGSaOBivyG0dzCFs2Zv0" }, "ErrorNumber": 0, "ErrorDescription": "Success" } }