I tried using PayPal's Sandbox IPN Simulator to send some test payments and still the IPN log says IPN was failed. I tried getting into Profile > Selling Tools > Language Encoding > Changed to UTF-8
still no use. IPN Log says
[09/11/2014 10:02 PM] - FAIL: IPN Validation Failed.
IPN POST Vars from Paypal:
residence_country=US, invoice=abc1234, address_city=San Jose, first_name=John, payer_id=TESTBUYERID01, shipping=3.04, mc_fee=0.44, txn_id=222972945, receiver_email=seller@paypalsandbox.com, quantity=1, custom=xyz123, payment_date=04:59:06 11 Sep 2014 PDT, address_country_code=US, address_zip=95131, tax=2.02, item_name=something, address_name=John Smith, last_name=Smith, receiver_id=seller@paypalsandbox.com, item_number=AK-1234, verify_sign=AFcWxV21C7fd0v3bYYYRCpSSRl31AMzH.1OGLzhiRtwR90w31D5sjl55, address_country=United States, payment_status=Completed, address_status=confirmed, business=seller@paypalsandbox.com, payer_email=buyer@paypalsandbox.com, notify_version=2.1, txn_type=web_accept, test_ipn=1, payer_status=verified, mc_currency=USD, mc_gross=12.34, address_state=CA, mc_gross1=9.34, payment_type=instant, address_street=123, any street,
IPN Response from Paypal Server:
HTTP/1.0 302 Found
Location: https://www.sandbox.paypal.com
Server: BigIP
Connection: close
Content-Length: 0
As per PayPal's documentation I been to https://gist.github.com/xcommerce-gists/3440401/download# this link is mentioned in PayPal's documentation. And tried using the same code and did setup the url in both PayPal IPN Settings and IPN Simulator's Notify URL too. But still not working. Unfortunately, the code in the above link doesn't add any record to the log file.
I also have an another code which makes record in log file but recorded as Fail.
Code:
<?php
ob_start();
if($_SESSION == null) {
session_start();
}
error_reporting(0);
require_once('paypal.class.php'); // include the class file
$p = new paypal_class; // initiate an instance of the class
$p->paypal_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr'; // testing paypal url
$this_script = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
if (empty($_GET['action'])) $_GET['action'] = 'process';
switch ($_GET['action']) {
case 'ipn':
if ($p->validate_ipn()) {
$subject = 'Instant Payment Notification - Recieved Payment';
$p->send_report ( $subject );
}
else {
$subject = 'Instant Payment Notification - Payment Fail';
$p->send_report ( $subject );
}
break;
}
?>