I have a use-case where I need to know the order id from Magento before completing the order.
The idea is that I essentially call an API and if the API call is successful, then I proceed to complete the order, otherwise, I don't. The problem is that when I send the API call I need to send the order id as well.
I did this:
Mage::getModel("sales/order")->getCollection()->getLastItem()->getIncrementId() + 1
This obviously does not seem safe assuming multiple people are using the shop at the same time. Is there any way to predict what the final order id will be? Or to essentially get the last order id + "reserve" that order id + 1, and not affect the orders of other people that might be logged in at the same time?