Validate Receipt - ReconoSERID/SDK-ReconoSERID-Android GitHub Wiki

Validate Receipt

Method to validate an address receipt for Mexican citizens, to determine by means of a QR code whether the citizen being registered is the person to whom the address receipt being scanned by 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 onValidationReceipt(@NotNull ValidateReceiptIn validateReceiptIn, @NotNull CallbackValidationReceipt listener)
#!Kotlin

fun onValidationReceipt(validateReceiptIn : ValidateReceiptIn, listener: CallbackValidationReceipt)

Receives as parameters

Parameters

Parameter Type Required Description
ValidateReceiptIn Object YES Object with required parameters
CallbackValidationReceipt Callback YES Returns a ValidateReceiptOut and RespuestaTransaccion

ValidateReceiptIn Parameters

Parámetro Tipo Requerido Descripción
formato String YES Image format type (B64_PDF, B64_JPG o B64_PNG)
guidProcesoConvenio String YES Unique process identification
idServicio int YES Service ID
image String YES Biometric data Base64
subTipo String YES Service difference
usuario String YES User storing information
#!java

public ValidateReceiptIn( String formato,    //Image format type (B64_PDF, B64_JPG o B64_PNG)
                          String guidProcesoConvenio,    //Unique process identification
                          String idServicio, //Service ID
                          String image,      //Biometric data Base64
                          String subTipo,    //Service difference
                          String usuario)    //User storing information 
                          
#!Kotlin

fun ValidateReceiptIn( formato : String ,    //Image format type (B64_PDF, B64_JPG o B64_PNG)
                       guidProcesoConvenio : String ,    //Unique process identification
                       idServicio : String , //Service ID
                       image : String ,      //Biometric data Base64
                       subTipo : String,     //Service difference
                       usuario : String)     //User storing information 
                          

and returns class ValidateReceiptOut

Parameters ValidateReceiptOut

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

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 status
            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 ValidateReceiptOut(Card card, Trasaccion trasaccion)
#!Kotlin

fun ValidateReceiptOut(card : Card, trasaccion : Trasaccion)                    

Ex:

#!java

ValidateReceiptIn validateReceiptIn = new ValidateReceiptIn();
        validateReceiptIn.setGuidProcesoConvenio(guidProcesoConvenio);
        validateReceiptIn.setIdServicio(28);
        validateReceiptIn.setSubTipo(7);
        validateReceiptIn.setFormato("JPG_B64");
        validateReceiptIn.setUsuario("[email protected]");
        validateReceiptIn.setImage(ImageUtils.getEncodedBase64FromFilePath(stringExtra));

        ServicesOlimpia.getInstance().onValidationReceipt(validateReceiptIn, new OlimpiaInterface.CallbackValidationReceipt() {
            @Override
            public void onSuccess(ValidateReceiptOut validateReceiptOut) {
                //
            }

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

val validateReceiptIn = ValidateReceiptIn()

validateReceiptIn.setGuidProcesoConvenio(guidProcesoConvenio);

        validateReceiptIn.formato = "JPG_B64"
        validateReceiptIn.guidProcesoConvenio = guidProcesoConvenio
        validateReceiptIn.idServicio = 28
        validateReceiptIn.image = ImageUtils.getEncodedBase64FromFilePath(stringExtra)
        validateReceiptIn.subTipo = 7
        validateReceiptIn.usuario = "[email protected]"

        ServicesOlimpia.getInstance()
            .onValidationReceipt(
                validateReceiptIn,
                object : OlimpiaInterface.CallbackValidationReceipt {

                    override fun onSuccess(validateReceiptOut: ValidateReceiptOut?) {
                        //
                    }

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

...