Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/06/2015, 13:10
jierson88
 
Fecha de Ingreso: junio-2015
Mensajes: 6
Antigüedad: 8 años, 10 meses
Puntos: 0
Implementacion Pago PayULatam

Muy buenas Tardes:

Hola me dirijo a uds para solucionar un error que me sale al momento de hacer ruebas con targeta de credito me funciono un dia pero volvi a probar y ya no me sirve el error es este:

( ! ) Fatal error: Uncaught exception 'ErrorException' with message 'The Payu library requires the curl extension.' in C:\wamp\www\TBM\lib\PayU\api\Environment.php on line 160
( ! ) ErrorException: The Payu library requires the curl extension. in C:\wamp\www\TBM\lib\PayU\api\Environment.php on line 160

En Pay U no me ayudan y pues agradeceria mucho que alguien me pueda ayudar el metodo que implemente es SDK PHP dejo el codigo que hice que me devuelve los datos en JSON de nuevo muchas gracias.

Código PHP:
require_once 'PayU.php';

$appResponse = array(
    
"respuesta" => false,
    
"mensajerror" => 'NOT APPROVED',
    
"estado" => 'OK',
    
"mensajecarro"=>'',
    
"respuesta" => ''
    
);

//para realizar un pago con tarjeta de crédito---------------------------------
$parameters = array(
    
//Ingrese aquí el identificador de la cuenta.
    
PayUParameters::ACCOUNT_ID => "500538",
    
//Ingrese aquí el código de referencia.
    
PayUParameters::REFERENCE_CODE => $_POST['ReferenceCode'],
    
//Ingrese aquí la descripción.
    
PayUParameters::DESCRIPTION => "Compra Productos en TBM",

    
// -- Valores --
    //Ingrese aquí el valor.        
    
PayUParameters::VALUE => $_POST['primerpago'],
    
//Ingrese aquí la moneda.
    
PayUParameters::CURRENCY => "COP",

    
// -- Comprador 
    //Ingrese aquí el nombre del comprador.
    
PayUParameters::BUYER_NAME => $_POST['NombreF'],
    
//Ingrese aquí el email del comprador.
    
PayUParameters::BUYER_EMAIL => $_POST['strEmail'],
    
//Ingrese aquí el teléfono de contacto del comprador.
    
PayUParameters::BUYER_CONTACT_PHONE => $_POST['TelefonoF'],
    
//Ingrese aquí el documento de contacto del comprador.
    
PayUParameters::BUYER_DNI => $_POST['strCedula'],
    
//Ingrese aquí la dirección del comprador.
    
PayUParameters::BUYER_STREET => $_POST['DireccionF'],
    
PayUParameters::BUYER_STREET_2 => $_POST['BarrioF'],
    
PayUParameters::BUYER_CITY => $_POST['CiudadF'],
    
PayUParameters::BUYER_STATE => $_POST['RegionF'],
    
PayUParameters::BUYER_COUNTRY => "CO",

    
// -- pagador --
    //Ingrese aquí el nombre del pagador.
    
PayUParameters::PAYER_NAME => $_POST['NombreTargeta'],
    
//Ingrese aquí el email del pagador.
    
PayUParameters::PAYER_EMAIL => $_POST['strEmail'],
    
//Ingrese aquí el teléfono de contacto del pagador.
    
PayUParameters::PAYER_CONTACT_PHONE => $_POST['TelefonoF'],
    
//Ingrese aquí el documento de contacto del pagador.
    
PayUParameters::PAYER_DNI => "5415668464654",
    
//Ingrese aquí la dirección del pagador.
    
PayUParameters::PAYER_STREET => $_POST['DireccionF'],
    
PayUParameters::PAYER_STREET_2 => $_POST['BarrioF'],
    
PayUParameters::PAYER_CITY => $_POST['CiudadF'],
    
PayUParameters::PAYER_STATE => $_POST['RegionF'],
    
PayUParameters::PAYER_COUNTRY => "CO",


    
// -- Datos de la tarjeta de crédito -- 
    //Ingrese aquí el número de la tarjeta de crédito
    
PayUParameters::CREDIT_CARD_NUMBER => $_POST['NumeroTargeta'],
    
//Ingrese aquí la fecha de vencimiento de la tarjeta de crédito
    
PayUParameters::CREDIT_CARD_EXPIRATION_DATE => $_POST['AnoTargeta'].'/'.$_POST['MesTargeta'],
    
//Ingrese aquí el código de seguridad de la tarjeta de crédito
    
PayUParameters::CREDIT_CARD_SECURITY_CODE=> $_POST['NumeroVerificacion'],
    
//Ingrese aquí el nombre de la tarjeta de crédito
    //PaymentMethods::VISA||PaymentMethods::MASTERCARD||PaymentMethods::AMEX||PaymentMethods::DINERS
    
PayUParameters::PAYMENT_METHOD => $_POST['sucursal'],

    
//Ingrese aquí el número de cuotas.
    
PayUParameters::INSTALLMENTS_NUMBER => $_POST['CuotasTargeta'],
    
//Ingrese aquí el nombre del pais.
    
PayUParameters::COUNTRY => PayUCountries::CO,

    
//Session id del device.
    
PayUParameters::DEVICE_SESSION_ID => $_POST['sesionid'],
    
//IP del pagadador
    
PayUParameters::IP_ADDRESS => $_POST['DireccionIp'],
    
//Cookie de la sesión actual.
    
PayUParameters::PAYER_COOKIE=>"pt1t38347bs6jc9ruv2ecpv7o2",
    
//Cookie de la sesión actual.        
    
PayUParameters::USER_AGENT=>"Mozilla/5.0 (Windows NT 5.1; rv:18.0) Gecko/20100101 Firefox/18.0"
);
    
 try {
        
$response PayUPayments::doAuthorizationAndCapture($parameters);
        if (
$response->code == "SUCCESS") {
            if (
$response->transactionResponse->state == "APPROVED") {

                include(
'FunctionsPagos.inc.php');

                if(
cambiarcarro($_POST,$mysqli)){
                    if(
agendarentrega($_POST,$mysqli)){
                        
$appResponse['mensajecarro'] = "Pronto Recibira correo con la fecha de entrega";
                        
$appResponse['respuesta'] = true;
                    }
                    else{
                        
$appResponse['mensajecarro'] = "No se Agendo Entrega";
                        
$appResponse['respuesta'] = true;
                    }
                }
                else{
                    
$appResponse['mensajecarro']= "No Se Cambio Estado en Carrito";
                    
$appResponse['respuesta'] = true;
                }

            } else {
                
$appResponse['estado'] = "ERROR";
                
$appResponse['mensajerror'] = "NO FUE APROVADA";
            }
            
$respuesta $response->transactionResponse;
        } else {
            
//TODO
            
$appResponse['estado'] = "ERROR";
            
$appResponse['mensajerror'] = $response->code;
        }
    } catch (
Exception $exc) {
        
$appResponse['estado'] = "ERROR";
        
$appResponse['mensajerror'] = $exc->getMessage();
    }

echo 
json_encode($appResponse);