jeffchannell.com

Fraudulent PayPal IPN Issue

Posted in Joomla!
2010-03-11 07:36:40 +0000 UTC

I want to send my apologies to all the users that had their orders delayed due to some weirdness involving PayPal's IPN notifications. Apparently, PayPal was sending IPN notifications from an IP address that VirtueMart couldn't resolve as belonging to PayPal, and was rejecting the IPN notice as fraud. The notice I received from VirtueMart was:

Error code 506. Possible fraud. Error with REMOTE IP ADDRESS = 216.113.188.202.

In order to resolve this, I dove into the notification script at administrator/components/com_virtuemart/notify.php to see how it was determining what constituted a "fraudulent" IP address. Here's what I found:

$paypal_iplist = gethostbynamel('www.paypal.com');
$paypal_iplist2 = gethostbynamel('notify.paypal.com');
$paypal_iplist = array_merge( $paypal_iplist, $paypal_iplist2 );

Further down in the code, the array $paypal_iplist is looped and if $_SERVER['REMOTE_ADDR'] doesn't match, it's considered a fraudulent transaction. What I ended up doing was adding an extra line and explicitly added this new IP:

$paypal_iplist = gethostbynamel('www.paypal.com');
$paypal_iplist2 = gethostbynamel('notify.paypal.com');
$paypal_iplist = array_merge( $paypal_iplist, $paypal_iplist2 );
$paypal_iplist[] = '216.113.188.202';

Hopefully, this resolves this issue and nobody else will have to wait for their downloads. I suppose only time will tell...