Driver's license validation - ReconoSERID/SDK-ReconoSERID-Android GitHub Wiki

Driver's license validation

Method to validate a Mexican citizens driver's license receipt, to determine by means of a QR code if the citizen being registered is the person to whom the driver's license being scanned by means of the device's camera belongs.

The values returned are validation percentages that indicate if the citizen is the one who is really being identified, as well as indicating if there was an error when the service request was made.


#!java

public void onValidationDriverLicense(@NotNull ValidateDriverLicenseIn validateDriverLicenseIn, @NotNull 
            OlimpiaInterface.CallbackValidationDriverLicense listener)
#!Kotlin

fun onValidationDriverLicense(validateDriverLicenseIn : ValidateDriverLicenseIn, 
                                     listener: CallbackValidationDriverLicense)

Receives as parameters

Parameters

Parameter Type Required Description
ValidateDriverLicenseIn Object YES Object with required parameters
CallbackValidationDriverLicense Callback YES Returns a ValidateDriverLicenseOut and RespuestaTransaccion

ValidateDriverLicenseIn Parameters

Parameter Type Required Description
formato String YES Image format type (B64_PDF, B64_JPG o B64_PNG)
guidProcesoConvenio String YES Unique identification of the process
idServicio int YES Service ID
image String YES Biometric data Base64
subTipo String YES Service difference
usuario String YES User saving information
#!java

public ValidateDriverLicenseIn( String formato,    //Image format type (B64_PDF, B64_JPG o B64_PNG)
                          String guidProcesoConvenio,    //Unique identification of the process
                          String idServicio, //Service ID
                          String image,      //Biometric data Base64
                          String subTipo,    //Service difference
                          String usuario)    //Number of preventive measure associated with the document 
                          
#!Kotlin

fun ValidateDriverLicenseIn( formato : String ,    //Image format type (B64_PDF, B64_JPG o B64_PNG)
                       guidProcesoConvenio : String ,    //Unique identification of the process
                       idServicio : String , //Service ID
                       image : String ,      //Biometric data Base64
                       subTipo : String,     //Service difference
                       usuario : String)     //Number of preventive measure associated with the document  
                          

and returns the class ValidateDriverLicenseOut

ValidateDriverLicenseOut Parameters

Parameter Type Description
Card Object Object with required parameters
RespuestaTransaccion List Transaction response

Card Card Parameters

Parameter Type Required Description
docProcess String YES Data associated with the receipt to the scanned receipt
estado String YES Request status
score int YES Percentage indicating the similarity of registered citizen
#!java

public Card(String docProcess,    //Data associated with the receipt to the scanned receipt
            String estado, //Request statusn
            int score)    //Percentage indicating the similarity of registered citizen                       
#!Kotlin

fun Card(docProcess : String, //Data associated with the receipt to the scanned receipt
            estado : String,  //Request status
            score : int)      //Percentage indicating the similarity of registered citizen                       
#!java

public ValidateDriverLicenseOut(Card card, RespuestaTransaccion respuestaTransaccion)
#!Kotlin

fun ValidateDriverLicenseOut(card : Card, respuestaTransaccion : RespuestaTransaccion)                    

Ex:

#!java

ValidateDriverLicenseIn validateDriverLicenseIn = new ValidateDriverLicenseIn();
        validateDriverLicenseIn.setGuidProcesoConvenio(guidProcesoConvenio);
        validateDriverLicenseIn.setIdServicio(34);
        validateDriverLicenseIn.setSubTipo(7);
        validateDriverLicenseIn.setFormato("JPG_B64");
        validateDriverLicenseIn.setUsuario("[email protected]");
        validateDriverLicenseIn.setImage(ImageUtils.getEncodedBase64FromFilePath(stringExtra));

        ServicesOlimpia.getInstance().onValidationDriverLicense(validateDriverLicenseIn, 
                                      new OlimpiaInterface.CallbackValidationDriverLicense() {
            @Override
            public void onSuccess(ValidateDriverLicenseOut validateDriverLicenseOut) {
                //
            }

            @Override
            public void onError(RespuestaTransaccion transactionResponse) {
                //
            }
        });
#!Kotlin

val validateDriverLicenseIn = ValidateDriverLicenseIn()

        validateDriverLicenseIn.setGuidProcesoConvenio(guidProcesoConvenio);
        validateDriverLicenseIn.formato = "JPG_B64"
        validateDriverLicenseIn.guidProcesoConvenio = guidProcesoConvenio
        validateDriverLicenseIn.idServicio = 34
        validateDriverLicenseIn.image = ImageUtils.getEncodedBase64FromFilePath(stringExtra)
        validateDriverLicenseIn.subTipo = 7
        validateDriverLicenseIn.usuario = "[email protected]"

        ServicesOlimpia.getInstance()
            .onValidationFederalDriverLicense(
                validateDriverLicenseIn,
                object : OlimpiaInterface.CallbackValidationDriverLicense {

                    override fun onSuccess(validateDriverLicenseOut: ValidateDriverLicenseOut?) {
                        //
                    }

                    override fun onError(transactionResponse: RespuestaTransaccion?) {
                        //
                    }
                })

...