Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Excerpt

onValidated() is triggered when the transaction has been terminated. This is how the Cardinal Mobile SDK hands back control to the merchant's application. This event will include data on how the transaction attempt ended and should be where you review the results of the transaction and make decisions regarding the next steps. The field ActionCode should be used to determine the overall state of the transaction. On the first pass, we recommend that on an ActionCode of 'SUCCESS' or 'NOACTION' you send the response JWT to your backend for verification. There is more information on verifying JWT's in the next section.

Code Block
languagejava
themeEmacs
titleJava
@Override
   public void onValidated(Context currentContext, ValidateResponse validateResponse, String serverJWT) {
 
       switch (validateResponse.getActionCode()){
 
           case SUCCESS:
               // Handle successful transaction, send JWT to backend to verify
               break;
           case NOACTION:
               // Handle no actionable outcome
               break;
           case FAILURE:
               // Handle failed transaction attempt
               break;
 		   case CANCEL:
               // Handle cancel transaction 
               break;
           case ERROR:
               // Handle service level error
               break;
		   case TIMEOUT:
               // Handle timeout 
               break;
       }
   }


Code Block
languagejava
themeEmacs
titleKotlin
collapsetrue
override fun onValidated(currentContext: Context?, validateResponse: ValidateResponse, serverJWT: String?) {
 
       when (validateResponse.getActionCode()!!) {
 
           CardinalActionCode.SUCCESS -> {
               // Handle successful transaction, send JWT to backend to verify
		   }

           CardinalActionCode.NOACTION -> {
               // Handle no actionable outcome
           }
 
           CardinalActionCode.FAILURE -> {
               // Handle failed transaction attempt
           }

 		   CardinalActionCode.CANCEL -> {
               // Handle cancel transaction 
           }

           CardinalActionCode.ERROR -> {
               // Handle service level error
           }

		   CardinalActionCode.TIMEOUT -> {
               // Handle timeout
           }
       }
   }



Value
Description
SUCCESSAuthentication was completed successfully. You will have a CAVV, ECIFlag, and XID to send during authorization.
NOACTIONAuthentication was not applicable and no service level errors were encountered. When the ErrorNumber is 0, generally this means you may move on to authorization, but be aware the transaction may not be eligible for liability shift.
FAILUREAuthentication resulted in a failure - this includes the end user failing authentication.
ERRORAn error was encountered. Refer to ErrorNumber and ErrorDescription for more details on the error. If a Payment object is present you may have additional details in the ReasonCode and ReasonDescription fields within the Payment object.
CANCELTransaction canceled by the user. 
TIMEOUT

Returned when the challenge process reaches or exceeds the timeout interval that is specified during the cca_continue call.

Insert excerptValidateResponse - Android - V 2.2.1ValidateResponse - Android - V 2.2.1