-2

I have made a payment through paypal adaptive payment and its succecced

then i send validation request and i gotted status=VERIFIED

here is code :

function process_new() {
$req = 'cmd=_notify-validate&'.file_get_contents("php://input");
$ipnmsg=$this->decodePayPalIPN($req);
$ch = curl_init('https://www.sandbox.paypal.com/cgi-bin/webscr');
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));
$res=curl_exec($ch);
curl_close($ch);
    //if ($this->InstantPaymentNotification->is_valid($req)) 
    if($res=='VERIFIED') // i got verified here
    {
        $txnIds=array();
        $notifications = $this->InstantPaymentNotification->buildAssociationsFromIPN_new($ipnmsg);
        foreach($notifications as $notification){
            $this->IpnNotification->create();
            $this->IpnNotification->save($notification);
            $txnIds[]=$this->IpnNotification->id;
            }
       //$this->InstantPaymentNotificationNew->saveAll($notification);
        $this->__processTransactionNew($txnIds);
    }

    //$this->redirect('/');
}

unable to find the reason why the notify_url keep hitting.

If more information needed i will post them too ...

This is IPN history :

enter image description here

  `$code = curl_getinfo($curl, CURLINFO_HTTP_CODE);`

it return 200 but still paypal shows HTTP status code : 500

and the notification url :http://example.com/instant_payment_notifications/process_new doesn't return HTTP status code : 500

thanks.

Rajeev Ranjan
  • 4,152
  • 3
  • 28
  • 41

1 Answers1

2

Look closely at your PayPal screenshot: your server is returning HTTP code 500 on those requests, meaning that PayPal interprets this as a bad thing and that the HTTP transaction didn't complete successfully and it will try again until it receives a 200 OK.

Check the configuration of your server. Did you recently make changes to your server's configuration? If you craft your own POST to your endpoint URL, does it return a 500 status code for you? Has it been down for maintenance for a time when these requests were put in? Set up some API monitoring to ensure that these 500 errors aren't being thrown often.

esqew
  • 42,425
  • 27
  • 92
  • 132
  • how will i check that POST to your endpoint URL returning http 500 status code. `curl_setopt($curl, CURLOPT_URL, END_POINT_URL . $APIName . '/' . $APIOperation); where `END_POINT_URL='https://svcs.sandbox.paypal.com/'; $APIName='AdaptivePayments'; $APIName='Pay'; – Rajeev Ranjan Jun 27 '14 at 13:30
  • Just craft a request that mocks PayPal's IPN request and get the status code. I don't have any idea why you just pasted that code there... – esqew Jun 27 '14 at 13:33
  • The endpoint URL I'm referring to is listed as "Notification URL" in your screenshot. – esqew Jun 27 '14 at 13:37
  • Build an HTML form with the action set to your IPN URL and include hidden fields that match the params you expect to get from PayPal in the IPN. This way you can load it in a browser and submit it directly so you can see the result on screen and get rid of any errors that are occurring. Keep in mind it won't validate when you do it this way because the data didn't come from PayPal. – Drew Angell Jun 28 '14 at 01:49
  • You could also just check your web server logs, which should provide the same info you would see on screen in a browser. You've probably just got some sort of syntax error or something going on in your IPN script. – Drew Angell Jun 28 '14 at 01:50
  • @esqew many many thanks.there was error in server configuration. – Rajeev Ranjan Jun 30 '14 at 07:49