tomtimms Posted June 10, 2010 Share Posted June 10, 2010 I am currently using the Pay Pal API and whenever I go to the page that connects it shows the complete connection in my error log. How can I prevent this? Below is what is printed out. I tried using "@" before each curl_ reference however this doesn't prevent the error from showing. Connected to api-3t.paypal.com (66.211.168.126) port 443 * successfully set certificate verify locations: * CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none * SSL connection using DES-CBC3-SHA * Server certificate: * subject: /C=US/ST=California/L=San Jose/O=PayPal, Inc./OU=Information Systems/CN=api-3t.paypal.com * start date: 2009-09-24 00:00:00 GMT * expire date: 2011-09-19 23:59:59 GMT * issuer: /C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=Terms of use at https://www.verisign.com/rpa ©09/CN=VeriSign Class 3 Secure Server CA - G2 * SSL certificate verify ok. > POST /nvp HTTP/1.1 Host: api-3t.paypal.com Accept: */* Content-Length: 157 Content-Type: application/x-www-form-urlencoded METHOD=GetBalance&VERSION=51.0&PWD=6SZ4PMFR7879HBDB&USER=****_api1.*****.com&SIGNATURE=AFcWxV21C7fd0v3bYYYRCpSSRl31Adju6w2eRqw.IhcgUi1iU1NUsGrQ< HTTP/1.1 200 OK < Date: Thu, 10 Jun 2010 18:51:58 GMT < Server: Apache < Content-Length: 140 < Connection: close < Content-Type: text/plain; charset=utf-8 * Closing connection #0 * About to connect() to api-3t.paypal.com port 443 * Trying 66.211.168.126... * connected * Connected to api-3t.paypal.com (66.211.168.126) port 443 * successfully set certificate verify locations: * CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none * SSL connection using DES-CBC3-SHA * Server certificate: * subject: /C=US/ST=California/L=San Jose/O=PayPal, Inc./OU=Information Systems/CN=api-3t.paypal.com * start date: 2009-09-24 00:00:00 GMT * expire date: 2011-09-19 23:59:59 GMT * issuer: /C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=Terms of use at https://www.verisign.com/rpa ©09/CN=VeriSign Class 3 Secure Server CA - G2 * SSL certificate verify ok. > POST /nvp HTTP/1.1 Host: api-3t.paypal.com Accept: */* Content-Length: 157 Content-Type: application/x-www-form-urlencoded Link to comment https://forums.phpfreaks.com/topic/204419-paypal-api-using-curl-how-to-prevent-status-in-error-log/ Share on other sites More sharing options...
mrMarcus Posted June 10, 2010 Share Posted June 10, 2010 Does the API class write to a log file on a successful connection? Perhaps it's just a coincidence that it's writing to your error log. Simply posting the message is not sufficient code to help you troubleshoot. Link to comment https://forums.phpfreaks.com/topic/204419-paypal-api-using-curl-how-to-prevent-status-in-error-log/#findComment-1070490 Share on other sites More sharing options...
tomtimms Posted June 10, 2010 Author Share Posted June 10, 2010 here is my connection <?php function PPHttpPost($methodName_, $nvpStr_) { $API_UserName = $API_Password = $API_Signature = $API_Endpoint = "https://api-3t.paypal.com/nvp"; $version = urlencode('51.0'); // setting the curl parameters. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $API_Endpoint); curl_setopt($ch, CURLOPT_VERBOSE, 1); // turning off the server and peer verification(TrustManager Concept). curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); // NVPRequest for submitting to server $nvpreq = "METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_"; // setting the nvpreq as POST FIELD to curl curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq); // getting response from server $httpResponse = curl_exec($ch); if (!$httpResponse) { exit("$methodName_ failed: " . curl_error($ch) . '(' . curl_errno($ch) . ')'); } // Extract the RefundTransaction response details $httpResponseAr = explode("&", $httpResponse); $httpParsedResponseAr = array(); foreach ($httpResponseAr as $i => $value) { $tmpAr = explode("=", $value); if (sizeof($tmpAr) > 1) { $httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1]; } } if ((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) { exit("Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint."); } return $httpParsedResponseAr; } ?> Link to comment https://forums.phpfreaks.com/topic/204419-paypal-api-using-curl-how-to-prevent-status-in-error-log/#findComment-1070492 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.