webtechnick / CakePHP-Paypal-IPN-Plugin

CakePHP Paypal Instant Payment Notification Plugin
http://www.webtechnick.com
82 stars 47 forks source link

PayPal IPN Failed Handshake Fix #24

Open Camasoft opened 5 years ago

Camasoft commented 5 years ago

I recently received a notification that PayPal IPN notifications sent to my website PayPal listener were failing. I was able to determine that all of the data was successfully received and stored in the database table, along with the VERIFIED response from PayPal, but they were receiving a 302 instead of a 200 response from my website. This turned out to be a needed fix in the return from the InstantPaymentNotificationsController::process method:

https://github.com/webtechnick/CakePHP-Paypal-IPN-Plugin/blob/75d88ad2f45cbd459153c77e25c066dbc69dba73/Controller/InstantPaymentNotificationsController.php#L30-L51

Specifically line 50: return $this->redirect('/');. This needs to be changed to

return CURLOPT_HTTP200ALIASES;

I am opening this issue and supplying the resolution in the hopes that anyone else who is still using CakePHP 2 and this plugin will find it helpful, since it appears this plugin has not been updated for a long time.

webtechnick commented 5 years ago

Thank you very much for your contribution. I would encourage you to fork and issue a pull request so that I may review it and get it checked in.

edstonestudio commented 5 years ago

This fix worked for me. Thanks so much!