17/05/2013, 08:55
|
| | | Fecha de Ingreso: mayo-2013 Ubicación: san jose
Mensajes: 8
Antigüedad: 11 años, 6 meses Puntos: 0 | |
Respuesta: HTTPs Post comunicacion Bueno aqui te copio el codigo, agrego headers personalizados al mensaje, parece que estan bien declarados ya que si se reciben, el problema radica en que no se debe enviar como webform y no se o no he podido encontrar si hay forma de cambiar el tipo de post que realiza el curl predeterminadamente
$paPostData2 = 'AuthorizationRequestParam=F1F1F0F0723C24C128E0820 0F1';
$paLenPostData= strlen($paPostData2);
$aHeaderData = array(
'POST /IPPayments/inter/CardAuthorization.do HTTP/1.1',
'User-Agent: NextPay',
'Content-Type: plain/text',
'Accept-Language: en-us',
'Cache-Control: no-cache',
'Connection: Keep-Alive',
'origin: Test',
'country: 840',
'region: EMEA',
'message: ISO GCAG',
'MerchNbr: 576757657',
'RtInd: 020',
'Content-Length: ' . $paLenPostData
);
//create cURL connection
$oCurl_connection = curl_init($this->sSiteTarget);
//set options
curl_setopt($oCurl_connection, CURLOPT_HEADER, true);
curl_setopt($oCurl_connection, CURLOPT_HTTPHEADER, $aHeaderData);
curl_setopt($oCurl_connection, CURLOPT_POST, true);
curl_setopt($oCurl_connection, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($oCurl_connection, CURLOPT_POST, 1);
curl_setopt($oCurl_connection, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($oCurl_connection, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)");
curl_setopt($oCurl_connection, CURLOPT_RETURNTRANSFER, true);
curl_setopt($oCurl_connection, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($oCurl_connection, CURLOPT_PORT, 443);
curl_setopt($oCurl_connection, CURLOPT_POSTFIELDS, $paPostData);
//perform request
$oResult = curl_exec($oCurl_connection);
$info = curl_getinfo($oCurl_connection);
curl_close($oCurl_connection);
return $oResult; |