Bugs with cart process: CustomerID occasionally missing and redirect failure
I'm having two problems with my checkout process:
1) Occasionally the customer's customerid is not posted (saved) into the orders table. Strangely, this is the ONLY field in the whole database that has this problem. The exact same customer id is always posted correctly in the "rosters" table (which is the "orderdetail" table in my DB).
Could you please examine the attached file and determine why the customer ID would occasionally fail to post (the table/field name is orders.ordercustomerid)?
I would say it fails about 25% or 30% of the time. It is a random failure as best I can tell. Sometimes it happens with new customers, sometimes not. Sometimes it posts correctly when a customer places an order, then immediately after does not post when they place a second order. But there are also many (maybe most) times it works fine in those same scenarios.
We are using the SecurityAssist/DataAssist user login / authentication to make the users log in before purchasing. The customerid gets set into a session variable at login (or registration). I have not been able to find a circumstance where that customerID session var fails to get set, and this is backed up (I think) by the fact that the orderdetail table ("rosters") always stores the customerid correctly
2) For some reason, when users try to use an invalid credit card type (for example, AmEx) or do something else to cause a declined transaction (bad address, perhaps - I received the user reports third hand so I'm not sure the details) instead of being redirected to checkout_failure.php they are (at least sometimes) being redirected to checkout_success.php as if the order had gone through. This is causing terrible confusion. The only way some users know something is wrong is that on the confirmation page, the orderid is blank - and they've called us to ask what went wrong. We're afraid other people have probably placed orders that were actually declined, but because they saw the checkout_success page they probably think their order went through fine :-(
If I need to add any additional info or if you need to see any of the other site files, please let me know.