I have been looking at the order process in Zen Cart and would just like to check if my understanding is correct.
I've been looking in /includes/modules/checkout_process.php
The process seems to be to take the payment first, then create the order record in the database. Is that correct? The order id doesn't exist until after the payment is processed?
The reason I ask is I am looking at writing a mod to run a MaxMind fraud detection query before payment is taken so high risk customers can be rejected as the product is an automatic digital delivery once the order is completed.
Would it be a significant job to rearrange the code to write the order to the database first as pending so the query can be run then update the order status is payment is successful (Pending->Processed) then continue with the send_order email etc...
Are there any obvious problems that I might come across doing this?
Thanks,
Matt




