Search code examples
ruby-on-rails-3paypalpaypal-ipn

Rails PayPal IPN notify_url is not called


So, I have a router with global IP address (Yeah, I know it will NOT work with the local ones, like 192.168.xx.xx) address and I've triple checked that it IS accessible from the outside.

I'm currently working in the sandbox environment.

I have all my payment options in the hidden :encrypted field (see appropriate railscast) that are being posted to PayPal. On the PayPal side everything is running pretty much smooth - I complete my payment and so on, but IPN is never called. There is simply no log-entry for my action being triggered (no errors/warnings or whatsoever), however there should be at least something.

I've tried to pass the notify_url 2 ways: 1) in the options hash in my purchase model, before being encrypted to :encrypted field; :notify_url => notify_url 2) notify_url as a separate hidden field explicitly => <%= hidden_field_tag :notify_url, notify_url %> 3) Combination of pts 1 and 2.

But it is hopeless - nothing seems to be working. :(

I have also tried to enabling the IPN in my sandbox business account settings, but that didn't do any help either.

What should I do in this situation ?

P.S I have also tried out the IPN Simulator service, and it seems to be working. What is wrong with it then ?


Solution

  • With trial-n-error, I've finally found a solution!

    Never, I repeat, NEVER use "_cart" as a cmd for your payment if you want to use: 1) IPN, 2) PDT validation. Use "_xclick" instead!

    That fixed my problem and now both of them working properly!

    Hope this will be useful to someone!