Building a shopping cart. One thing I can't get my head around is processing orders.
In the example the user has their items in the basket and decides to make payment.
This is where I cannot work out the best way forward it.
Do you:
1) Add the final order details to the orders table just before the user pays, and once successful payment has been made through the payment processor provide a callback and set the status of the order to paid in your database
or
2) Do you add the order details to the orders table only after after Payment has been made and has been succesful.
Hope the above makes some sense. I am just interested on how you accomplished this, if you built your own shopping cart.