I'm working on a custom ecommerce solution for a client. They process around 15-30 transactions per hour via PayPal Direct and ExpressPay. During development and testing everything worked perfectly. Now the PayPal direct is spawning what we've termed 'ghost orders', here's the scenario with the DirectPay:
The system collects the submitted information (name, address, credit card #, etc) and passes it to the API which then returns the transaction ID (or errors) and then the system either returns an error code or processes the order - saving it as a database record. Nothing super complex. This works 98% of the time, except when it doesn't and (from what I can tell) PayPal doesn't return anything before the script times out. However, when this happens the payment still goes through on the PayPal side and the customer is charged - we just have no record of it in the system native.
I can replicate the issue by setting the CURL_TIMEOUT to a super-low value in which case the script times out, doesn't send anything back (except a CURL timeout), but the process goes through on the PayPal side.
I'd include code or something to look at but I've rewritten the code so many times I'm not sure what to send at this point - it happens no matter what I do.
My question is has anyone else experienced this, or have any idea how I can ensure some sort of response from PayPal?