paypal / ipn-code-samples

Other
562 stars 486 forks source link

The flow is unclear #133

Closed GildedHonour closed 6 years ago

GildedHonour commented 6 years ago

There's an ambiguity in the documentation and code examples. What's the correct flow?

1) Receive IPN, a) respond with "200 empty ok" right away and b) then send one more request with cmd=_notify-validate c) and then process a response if it's VERIFIED

2) Receive IPN and send a request with cmd=_notify-validate and then process a response if it's VERIFIED

overint commented 6 years ago

I believe the docs state that you should use respond with a 200 OK response before doing the processing on your side (if this could take a long time, as paypal may count it as a timeout and set the IPN to be retried).

AFAIK both methods are ok, but you may want to clarify with paypal tech support.

GildedHonour commented 6 years ago

why here https://github.com/paypal/ipn-code-samples/blob/master/ruby/paypal_ipn_rails.rb

a request is sent to

"https://ipnpb.sandbox.paypal.com/cgi-bin/webscr?cmd=_notify-validate"

instead of

"https://ipnpb.sandbox.paypal.com/cgi-bin/webscr?cmd=_notify-validate&#{original_query_string}"

?

overint commented 6 years ago

Some of the sample may be outdated, you are welcome to consult the docs and make a PR to correct them.

GildedHonour commented 6 years ago

What am I doing if not that? Why did you close the issue?

overint commented 6 years ago

What do you mean?

GildedHonour commented 6 years ago

Why did you close the issue?

overint commented 6 years ago

Because the original question was answered?

If you have additional issues, you can create tickets for them.

GildedHonour commented 6 years ago

Because the original question was answered?