Cita:
Iniciado por GatorV
He leido el enlace GatorV, sin embargo no se que hago mal, en principio, entiendo que me lo has pasado porque puedo enviar los datos a una URL por POST mediante CURL, correcto?
Este es el código que utilizo para enviar por POST los datos al servidor y no me muestra ningun error ni por pantalla ni en el fichero de logs
Código php:
Ver original<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body >
<?
$url = "https://sis.sermepa.es/sis/realizarPago"; // escrbe aqui la url de tu formulario
$ch = curl_init(); // Inicializo el handler de Curl
//Seteo las opciones para el envio
curl_setopt($ch, CURLOPT_URL
,$url); // Url a donde se va a postea. curl_setopt($ch, CURLOPT_USERAGENT
, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11'); //Seteo el user Agent en este caso es el navegador firefox 2 curl_setopt($ch, CURLOPT_FAILONERROR
, 1); //terminar en caso de error curl_setopt($ch, CURLOPT_FOLLOWLOCATION
, 1);// Permitir Redirecciones curl_setopt($ch, CURLOPT_RETURNTRANSFER
,1); // Retornar la pagina de resultados en una variable curl_setopt($ch, CURLOPT_POST
, 1); // SETEAR el Envio por POST
/* valores TPV */
$postvalue['Ds_Merchant_Order'] = '12421415'; //Pedido
$postvalue['Ds_Merchant_Amount'] = '1000'; //Importe
$postvalue['Ds_Merchant_Currency'] = '978'; //Moneda
$postvalue['Ds_Merchant_MerchantCode'] = 'xxxxxx'; // FUC
$postvalue['Ds_Merchant_MerchantName'] = 'xxxxxxxxxxxxx'; // Comercio
$postvalue['Ds_Merchant_ConsumerLanguage'] = '1'; //Idioma
$postvalue['Ds_Merchant_Terminal'] = '1'; //Terminal
$postvalue['Ds_Merchant_MerchantSignature'] = 'xxxxxxxx'; //Clave
$postvalue['DS_Merchant_TransactionType'] = '0'; //Tipo de transaccion
curl_setopt($ch, CURLOPT_POSTFIELDS
, $postvalue); //cambia aqui por tu nombre de formulario y datos $result = curl_exec($ch); // Ejecutar el envio por post.
$header['errno'] = $err;
$header['errmsg'] = $errmsg;
$header['content'] = $content;
?>
</body>
</html>
Array ( [errno] => [errmsg] => [content] => )
¿Qué estoy haciendo mal?
Muchas gracias de antemano