Link to home
Start Free TrialLog in
Avatar of oxygen_728
oxygen_728

asked on

Paypal Direct Payments - Error Code 10747 - The IP Address provided is invalid.

I am setting up Paypal Website Payments Pro with OsCommerce. I set up curl properly on the server (I think), and am sending the proper information to paypal. When the order is sent to paypal for processing, all of the items (except the IP) are sent properly. If I don't type in a proper credit card, then it gives me an error saying that.

Every single time, on any computer, paypal returns the error "The IP Address provided is invalid.". The entire array is:
Array ( [TIMESTAMP] => 2008-06-08T00:41:48Z [CORRELATIONID] => 82232fd01b984 [ACK] => Failure [L_ERRORCODE0] => 10004 [L_SHORTMESSAGE0] => Transaction refused because of an invalid argument. See additional error messages for details. [L_LONGMESSAGE0] => The IP Address provided is invalid. [L_SEVERITYCODE0] => Error [VERSION] => 3.200000 [BUILD] => 588340 )

Sometimes the error code switches to 10747. In the $parameters array, the ip address variable is IPADDRESS.

I output the parameters right before I execute it with curl to check if the IP address is correct. It is, and I've tried hard coding valid IP addresses in there to no avail. I am sending a valid IP address to the paypal server, but it is not recognizing it.

I have set up a sandbox account with paypal properly and gotten the fake api credentials correctly. I've also tried this on the live version with my live credentials and received the same exact error.
//Initialize curl
        $ch = curl_init(); 
 
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
		curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_TIMEOUT, 180);
		curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);
		curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);
        curl_setopt($ch, CURLOPT_URL, $url); 
        curl_setopt($ch, CURLOPT_POST, 1); 
		curl_setopt($ch, CURLOPT_REFERER, $_SERVER['HTTP_REFERER']);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $parameters); 
        
        $result = curl_exec($ch);
		
		print_r($parameters);
		curl_close($ch);

Open in new window

Avatar of orion400
orion400

For error 10747 please check to see what IP address you are passing to PayPal, the IP address will have to be sent to PayPal in the correct format.  For example: 127.0.0.1 -- once your solution is live you can get this IP address from the payer's browser.
Avatar of oxygen_728

ASKER

I am passing it a properly formatted address

"I output the parameters right before I execute it with curl to check if the IP address is correct. It is, and I've tried hard coding valid IP addresses in there to no avail. I am sending a valid IP address to the paypal server, but it is not recognizing it."

It's that Paypal is not recognizing it as a valid IP. I've tried hard-coding multiple IPs and it still says it fails. Is there something wrong with my server or with curl?
ASKER CERTIFIED SOLUTION
Avatar of oxygen_728
oxygen_728

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial