Realizar una transacción con tarjeta presente
Una vez se han recuperado los datos de la tarjeta durante el proceso de lectura, es posible dar inicio al proceso de pago.
Paso a paso
- Instanciar el objeto
DoProcessAdquirerOperationData. - Invocar le método
doOperationy pasarle como parámetro el tipo de operación. - Configurar un observer para recibir el resultado.
Ejemplo de implementación
private val operationFlow: OperationFlow?
get() = OperationFlowHolder.operationFlow
val doPayment = DoProcessAdquirerOperationData(
context = this,
version = "",
transactionDate = DateUtil.getLocalDateTimeWithOffset(),
dataFlow = operationFlow
)
doPayment.doOperation(operationType = OperationType.PAYMENT)
doPayment.operationResponse.observe(this) {
it.data?.let { response ->
val operationResponse = response as Adquirer
if (operationResponse.status?.code == OperationResponseCode.APPROVED) {
Log.i(TAG, "Pago aprobado!")
Log.i(TAG, "PaymentId: ${operationResponse.id}")
} else {
Log.i(TAG, "Pago declinado!")
}
} ?: run {
Log.i(TAG, "Pago no procesado!")
}
}Códigos de respuesta
El resultado de la transacción se recibe mediante el objeto Adquirer.
En la siguiente tabla se muestran los diferentes códigos de error, estos se recuperan desde Adquirer.response.code
- El primer parámetro corresponde al código de respuesta recibido en
Adquirer.response.code - El segundo parámetro es el error
- El tercer parámetro es la descripción del error
APPROVED("0", "APROBADO", "Transacciones exitosas"),
CONTACT_ISSUER("1", "CONTACTAR AL EMISOR", "Transacciones rechazadas por el emisor"),
INSUFFICIENT_FUNDS("2", "FONDOS INSUFICIENTES", "Transacciones rechazadas por el emisor"),
INVALID_MERCHANT("3", "COMERCIO INVALIDO", "Transacciones rechazadas por el adquirente"),
RETAIN_CARD("4", "RETENER TARJETA", "Transacciones rechazadas por el emisor"),
DECLINED_TRANSACTION("5", "TRANSACCION DENEGADA", "Transacciones rechazadas por el emisor"),
GENERIC_ERROR_1("6", "ERROR GENERICO", "Transacciones rechazadas por el emisor"),
SECURITY_CODE_ERROR("7", "ERROR EN CODIGO DE SEGURIDAD (CVV)", "Transacciones rechazadas por el adquirente"),
INVALID_TERMINAL("8", "TERMINAL INVALIDA", "Transacciones rechazadas por el adquirente"),
DUPLICATE_TRANSACTION("9", "TRANSACCION DUPLICADA", "Transacciones con fallo menta"),
MANUAL_APPROVAL("10", "APROBACION MANUAL", "Transacciones exitosas"),
PENDING_TRANSACTION("11", "TRANSACCION PENDIENTE", "Transaccion pendiente"),
INVALID_TRANSACTION("12", "TRANSACCION INVALIDA", "Transacciones rechazadas por el adquirente"),
INVALID_AMOUNT("13", "MONTO INVALIDO", "Transacciones rechazadas por el emisor"),
INVALID_CARD("14", "TARJETA INVALIDA", "Transacciones rechazadas por el emisor"),
ACQUIRER_ACCOUNT_NOT_FOUND("15", "CUENTA INEXISTENTE", "Transacciones rechazadas por el adquirente"),
ISSUER_ACCOUNT_NOT_FOUND("16", "CUENTA INEXISTENTE", "Transacciones rechazadas por el emisor"),
TRANSACTION_NOT_ALLOWED("17", "TRANSACCION NO PERMITIDA", "Transacciones rechazadas por el adquirente"),
WITHDRAWAL_AMOUNT_EXCEEDS_LIMIT_1("18", "MONTO LIMITE DE RETIRO EXCEDIDO", "Transacciones rechazadas por el emisor"),
PROCESSING_ERROR_1("19", "ERROR EN PROCESAMIENTO", "Transacciones rechazadas por el adquirente"),
AUTHORIZATION_ERROR("20", "ERROR EN AUTORIZACION", "Transacciones rechazadas por el adquirente"),
REFUND_ERROR("21", "ERROR EN DEVOLUCION", "Transacciones rechazadas por el adquirente"),
OTHER_ACQUIRER_ERRORS("22", "OTROS ERRORES ADQUIRENTE", "Transacciones rechazadas por el adquirente"),
PIN_ERROR_1("23", "ERROR EN PIN", "Transacciones rechazadas por el emisor"),
LIMIT_EXCEEDED("24", "LIMITE EXCEDIDO", "Transacciones rechazadas por el adquirente"),
POSSIBLE_FRAUD("25", "POSIBLE FRAUDE", "Transacciones rechazadas por el adquirente"),
CHARGEBACK_ERROR("26", "ERROR EN CONTRACARGO", "Transacciones rechazadas por el adquirente"),
EMV_ERROR_1("27", "ERROR EMV", "Transacciones con fallo menta"),
EMV_ERROR_2("28", "ERROR EMV", "Transacciones rechazadas por el adquirente"),
CASHOUT_ERROR("29", "ERROR EN CASHOUT", "Transacciones rechazadas por el adquirente"),
FORMAT_ERROR_1("30", "ERROR EN FORMATO", "Transacciones con fallo menta"),
CARD_BLOCKED("31", "TARJETA BLOQUEADA", "Transacciones rechazadas por el emisor"),
BIN_ERROR("32", "ERROR DE BIN", "Transacciones rechazadas por el adquirente"),
EXPIRED_CARD("33", "TARJETA VENCIDA", "Transacciones rechazadas por el emisor"),
LIMIT_EXCEEDED_1("34", "MONTO LIMITE EXCEDIDO", "Transacciones rechazadas por el adquirente"),
CONTACT_ACQUIRER_1("35", "CONTACTAR ADQUIRENTE", "Transacciones rechazadas por el adquirente"),
RESTRICTED_CARD("36", "TARJETA RESTRINGIDA", "Transacciones rechazadas por el emisor"),
ERROR_IN_3DS("37", "ERROR EN 3DS", "Transacciones rechazadas por el adquirente"),
NUMBER_OF_RETRIES_EXCEEDED("38", "CANTIDAD DE REINTENTOS EXCEDIDA", "Transacciones rechazadas por el emisor"),
USER_ERROR("39", "ERROR DE USUARIO", "Transacciones rechazadas por el adquirente"),
HSM_ERROR("40", "ERROR EN HSM", "Transacciones rechazadas por el adquirente"),
LOST_CARD("41", "TARJETA EXTRAVIADA", "Transacciones rechazadas por el emisor"),
TRANSACTION_DENIED("42", "TRANSACCION DENEGADA", "Transacciones rechazadas por el adquirente"),
GENERIC_ERROR_2("43", "ERROR GENERICO", "Transacciones con fallo menta"),
DUPLICATE_TRANSACTION_1("44", "TRANSACCION DUPLICADA", "Transacciones rechazadas por el adquirente"),
INSTALLMENT_ERROR_1("45", "ERROR EN CUOTAS", "Transacciones con fallo menta"),
INVALID_AMOUNT_2("46", "MONTO INVALIDO", "Transacciones rechazadas por el adquirente"),
ISSUER_ERROR("47", "ERROR EN EMISOR", "Transacciones rechazadas por el adquirente"),
INSTALLMENT_ERROR_2("48", "ERROR EN CUOTAS", "Transacciones rechazadas por el emisor"),
EXPIRATION_DATE_ERROR("49", "ERROR EN FECHA DE EXPIRACION", "Transacciones rechazadas por el adquirente"),
AMOUNT_EXCEEDS_LIMIT("50", "MONTO LIMITE EXCEDIDO", "Transacciones rechazadas por el emisor"),
INVALID_TRANSACTION_2("51", "TRANSACCION INVALIDA", "Transacciones rechazadas por el adquirente"),
WITHDRAWAL_AMOUNT_EXCEEDS_LIMIT_2("52", "MONTO LIMITE DE RETIRO EXCEDIDO", "Transacciones rechazadas por el adquirente"),
PROCESSING_ERROR_2("53", "ERROR EN PROCESAMIENTO", "Transacciones con fallo menta"),
CONTACT_ACQUIRER_2("54", "CONTACTAR ADQUIRENTE", "Transacciones rechazadas por el emisor"),
PIN_ERROR_2("55", "ERROR EN PIN", "Transacciones rechazadas por el adquirente"),
FORMAT_ERROR_2("56", "ERROR EN FORMATO", "Transacciones con fallo menta"),
INTERNAL_ERROR("57", "ERROR INTERNO", "Transacciones con fallo menta"),
UNKNOWN_CODE("58", "CODIGO DESCONOCIDO", "Transacciones con codigo desconocido"),
INVALID_CBU("59", "CBU NO INFORMADO", "Transacciones con fallo menta"),
UNINFORMED_ACTIVITY("60", "ACTIVIDAD NO INFORMADA", "Transacciones con fallo menta"),
UNINFORMED_FANTASY_NAME("61", "NOMBRE DE FANTASIA NO INFORMADO", "Transacciones con fallo menta"),
UNINFORMED_CATEGORY("62", "CATEGORIA NO INFORMADA", "Transacciones con fallo menta"),
INVALID_CATEGORY("63", "CATEGORIA INVALIDA", "Transacciones con fallo menta"),
INVALID_TRANSACTION_TYPE("64", "TIPO DE TRANSACCION INVALIDA", "Transacciones con fallo menta"),
UNINFORMED_TRANSACTION_TYPE("65", "TIPO DE TRANSACCION NO ENVIADA", "Transacciones con fallo menta"),
ERROR_IN_AUTHENTICATION("66", "ERROR EN AUTENTICACION", "Transacciones con fallo menta"),
ERROR_IN_COMMUNICATION("67", "ERROR DE COMUNICACION", "Transacciones con fallo menta"),
GENERIC_ERROR_3("68", "ERROR GENERICO", "Transacciones con fallo menta"),
INVALID_QR("69", "QR INVALIDO", "Transacciones con fallo menta"),
INVALID_ACCOUNT("70", "CUENTA INVALIDA", "Transacciones rechazadas por el adquirente"),
ACCOUNT_NOT_FOUND("71", "CUENTA INEXISTENTE", "Transacciones rechazadas por el adquirente"),
ERROR_IN_ACCOUNT("72", "ERROR EN CUENTA", "Transacciones rechazadas por el adquirente"),
INVALID_TRANSACTION_3("73", "TRANSACCION INVALIDA", "Transacciones rechazadas por el adquirente"),
INSUFFICIENT_FUNDS_2("74", "FONDOS INSUFICIENTES", "Transacciones rechazadas por el adquirente"),
CARD_NOT_FOUND("75", "TARJETA INEXISTENTE", "Transacciones rechazadas por el adquirente"),
CARD_INACTIVE("76", "TARJETA INACTIVA", "Transacciones rechazadas por el adquirente"),
DAILY_LIMIT_EXCEEDED("77", "LIMITE DIARIO EXCEDIDO", "Transacciones rechazadas por el adquirente"),
ERROR_TRANSFER("78", "ERROR EN TRANSFERENCIA", "Transacciones rechazadas por el adquirente"),
ERROR_IN_PARAMETERS("79", "ERROR EN PARAMETROS", "Transacciones rechazadas por el adquirente"),
ERROR_IN_AFFILIATION("80", "ERROR EN DATOS DE AFILIACION", "Transacciones rechazadas por el adquirente"),
ERROR_IN_PROMOTION("81", "ERROR EN PROMOCION", "Transacciones rechazadas por el adquirente"),
ERROR_IN_FALLBACK("82", "ERROR EN FALLBACK", "Transacciones rechazadas por el adquirente"),
ERROR_IN_SUBAFFILIATION("83", "ERROR EN SUBAFILIACION", "Transacciones rechazadas por el adquirente"),
ERROR_IN_READ("84", "ERROR DE LECTURA", "Transacciones rechazadas por el adquirente"),
ERROR_IN_AFFILIATION_DB("85", "ERROR EN AFILIACION EN BD", "Transacciones rechazadas por el adquirente"),
ERROR_IN_INVALID_SUBMERCHANT("86", "FORMATO INVALIDO EN SUBMERCHANT", "Transacciones rechazadas por el adquirente"),
ERROR_IN_CONFIGURATION_AFFILIATION("87", "ERROR DE CONFIGURACION DE AFILIACION", "Transacciones rechazadas por el adquirente"),
REVERSAL_OPERATION("88", "OPERACION REVERSADA", "La operacion ha sido reversada"),
EXPIRED_QR("88", "QR EXPIRADO", "Transacciones expiradas"),
CANCELED_QR("89", "QR CANCELADO", "Transacciones canceladas");