So I’ll describe a little bit problem –
1) I got PayPal IPN script, with features if is verified, it inserts data in database otherwise it sends email to me.
2) I tested the script with PayPal Sandbox Test Tools, where I just need to insert link and it automatically check’s if it is working, and it inserted data, so it’s working.
But now problem starts –
3) After that I tried to test it with PayPal Sandbox Test accounts. I created two test PayPal accounts – Seller and Buyer.
4) Configured everything for Seller and created a button (PayPal Technical support configured everything was ok with button and IPN link).
5) So I inserted the button in homeapge, and tried to pay with test accounts.
6) Logged in, payed and wen’t back to homepage, but no data was inserted in database eather no email was sent to my mail.
7) I wen’t to Seller account PayPal History, and it showed that I got one history from IPN script, that was succesfully sent and with 200 HTTP (this means everything was OK!).
8) Money from my buyer account was sent to seller account.
It seems that everything worked great, except, paypal didn’t do anything that was inside IPN script, so maybe you could help me with ideas? I tried contacting PayPal technical support, and they confirmed that everything should be okay!
Hope you can help me with this problem!
Best regards,
Valters
There’s no easy answer here, so I’ll help you with some instructions on how specifically to debug this scenario.
First of all, pay attention to the different payment statuses. PayPal has a “pending” status, as well as I believe some “verified” or “confirmed” statuses (can’t remember the exact terminology right now). The IPN simulator and the buyer test account could be generating two different types of payments, resulting in two different statuses, so check that first. If they’re not identical, find what’s wrong in your code that’s handling the non-working payment status.
Failing that, …
Sounds like it’s not an issue necessarily having anything to do with PayPal and its IPN, but with your PHP script at some point in execution. In other words, it sounds like your PHP script is, at some point, either encountering a PHP error that’s crashing the script or encountering some behavioral bug.
Because everything’s working fine with the IPN simulator, it could be that just a specific type of test case is causing the error; some very minor difference in how the IPN simulator works and how a buyer account is set up could be triggering different parts of your code to execute…
Take a look and see if you have an error_log file on your server in the same directory as your IPN script. If so, open that up and scroll down to the most recent errors. This is just a log of the errors that get output to the screen when your script encounters an error; obviously, you’re working with IPN here, so PayPal is the client who would “see” the errors being output to the screen (but their IPN system doesn’t pay any attention to it anyway), so your only way to see that output is through this error_log or to write some debugging code.
If the error_log doesn’t suffice and you do need to write some debugging code, you should add some code to your IPN callback script that will write some output to a text file at certain intervals in the script. That way, you can tell exactly where the script is crashing (if it IS crashing). If it turns out the script doesn’t appear to be crashing at all, then write some code to output your SQL query.
Actually, the fastest way to get to the bottom of this would probably be just to do that: write some debugging code to output your SQL query to a file. The result will give you a big clue on what’s going wrong: whether your script is crashing or if your code is branching away from wherever that query takes place (no file output), whether something’s wrong with the query itself (could very likely be the case), or… well, pretty much one of those two cases.
Good luck!