Trouble converting Paypal library to CI |
[eluser]tagawa[/eluser]
Hi. I really like Micah's revised Paypal IPN library here: https://github.com/Quixotix/PHP-PayPal-IPN and am trying to convert it to a CI class. I can get the original library to work, but when I try out my controller with the Paypal sandbox test tool I get "IPN delivery failed. HTTP error code 500: Internal Server Error". Going to the controller's URL directly gets the same server error (which it should), so it doesn't seem to be a syntax bug. I'm not a CI expert (yet) so it could be something simple I've overlooked. Can anyone see anything wrong with what I've done? Thanks in advance for any help. Code: <?php defined('BASEPATH') OR exit('No direct script access allowed');
[eluser]arkin[/eluser]
By default when a PHP error occurs, if its fatal, it can cause a 500 error. Seems like a common case of production errors not being enabled, and if they are turned on make sure in php.ini you have Display_errors = On.
[eluser]tagawa[/eluser]
Thanks for the quick reply. I'm not sure that's the problem in this case as I did get regular syntax errors initially, due to a couple of typos. Those are now gone so I think the PHP itself is OK - I think it's the way I've structured it that's not, but I'm not sure why.
[eluser]weboap[/eluser]
check your apache log, for possible error messages, post the error if any. Code: $verified = $listener->processIpn(); i seen where you are not sending any data if you look at the class it self, the function look like Code: public function processIpn($post_data=null) { on another note converting the class to CI Style code can start like : you add a constructor to the IpnListener class something like http://stackoverflow.com/questions/91419...odeigniter then place it in the library folder after that you can do Code: $config = array (
[eluser]tagawa[/eluser]
Turns out you were both right about checking the error logs more thoroughly. I managed to find the problem - it was that CSRF protection is enabled in my config file so the PayPal POST requests were being blocked. I used the solution here to disable CSRF protection just for the PayPal controller: http://stackoverflow.com/questions/76283...er-7705531 Again thank you both for the help. Oh, and that multiple parameter workaround is new to me - will come in handy. |
Welcome Guest, Not a member yet? Register Sign In |