No se almacenan datos sensibles de la tarjeta de crédito PAN (Personal Account Number) y CVC (Card Verification Code).
Proceso a través de un TOKEN único por comercio que provee Paguelofacil recurrentes.
Recurrencia del pago.
Números de Tarjetas de crédito que salen aprobadas en la plataforma de pruebas
4059310181757001
4916012776136988
4716040174085053
4143766247546688
4929019201087046
4024007183324093
5451819737278230
5517747952039692
5161216979741515
5372362326060103
5527316088871226
Cualquier otra tarjeta será denegada siempre, en la plataforma de pruebas.
URL PRODUCCIÓN
https://recurrentes.paguelofacil.com/api/tokens
URL SANDBOX
https://recurrentes.pfserver.net/api/tokens
Errores
/* EJEMPLO ERROR */
/******** JSON *********/
"error": {
"code": 400,
"message": "You need verify with the administrator."
}
Ejemplo 1: Comercio Inactivo o Clave Invalida.
/* EJEMPLO ERROR */
/******** JSON *********/
"error": {
"code": 400,
"message": "You have some errors with the data parameters",
"exception": {
"email": "Este valor no es una dirección de email válida.",
"amount": "Este valor debería ser de tipo numeric."
}
}
Ejemplo 2: Parámetros incorrectos
API de Transacciones Recurrentes
web y apps
Permite procesar transacciones a través de tokens sin tener el riesgo y el gasto de almacenar los números de tarjeta de crédito.
Procesar un Transacción Aprobada
Puede verificar el detalle de los atributos del API en esta documentación:
/******** EJEMPLO EN PHP *********/
$url = "https://recurrentes.pfserver.net/api/tokens"; //URL DE PRUEBAS
/******** URL DE PRODUCCION *********/
//https://recurrentes.paguelofacil.com/api/tokens
/******** ********** *********/
$KEY = "NjMwNnBmMTYwNDE4MDgwNDAw";
$data = array( "commerce" => $KEY , "type" => "token", //Storage "amount" => 25.00, //Sí es Storage el monto debe ser 0.00 "description" => "Descripcion de la transacción", "cc_number" => "4111111111111111", "cc_expiration" => "2018-06", "ccv2" => "222", "firstname" => $Name, "lastname" => $Lastname, "email" => $Email, "var_text" => $desc ); $postR=""; foreach($data as $mk=>$mv) { $postR .= "&".$mk."=".urlencode($mv); } $ch = curl_init(); curl_setopt($ch,CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_AUTOREFERER, true ); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true ); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded')); curl_setopt($ch,CURLOPT_POSTFIELDS,$data); $result = curl_exec($ch); $result = json_decode($result, true); curl_close($ch);
Guardar el Token para procesar
/* EJEMPLO TRANSACCION APROBADA */
/******** JSON *********/
{
"token":"TK5aa9aef8adf5a",
"datetime":"2018-03-14 18:32:45",
"transaction":"RAT-5AA9B11BA322A",
"amount":"100.00",
"cc_number":"7004",
"email":"mcamacho@paguelofacil.com",
"var_text":"variable definida para el comercio",
"status":"SUCCESSFUL",
"message":"Approved"
}
/* EJEMPLO TRANSACCION DENEGADA */
/******** JSON *********/
{ "token": "TK5aa95c117d06b", "datetime": "2018-04-02 17:24:45", "transaction": "RAT-5AC2ADACA9BCC", "amount": "0.00", "cc_number": "1111", "email": "test@paguelofacil.com", "var_text": "variable definida por el comercio", "status": "DENIED", "message": "No such issuer" }
Guardar la variable token, correo electrónico, nombre y apellido en su base de datos de la transacción aprobada, para la próxima transacción.
Procesar a través del token
/******** EJEMPLO EN PHP *********/
$url = "https://recurrentes.pfserver.net/api/tokens"; //URL DE PRUEBAS
/******** URL DE PRODUCCION *********/
//https://recurrentes.paguelofacil.com/api/tokens
/******** ********** *********/
$KEY = "NjMwNnBmMTYwNDE4MDgwNDAw"; $data = array( "commerce" => $KEY , "token" => "TK5BB9F0242A1C9", "amount" => 25.00, "type" => "token", "description" => "Descripcion de la transacción", "firstname" => $Name, "lastname" => $Lastname, "email" => $Email, "var_text" => $desc ); $postR=""; foreach($data as $mk=>$mv) { $postR .= "&".$mk."=".urlencode($mv); } $ch = curl_init(); curl_setopt($ch,CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_AUTOREFERER, true ); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true ); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded')); curl_setopt($ch,CURLOPT_POSTFIELDS,$data); $result = curl_exec($ch); $result = json_decode($result, true); curl_close($ch);