I have decided for the time being, to remove the "place order on out of stock items" option from the checkout.
I am not even sure if anyone actually use that option or not anyway. But the problem I see with it, is if the main item someone wanted to order was a power supply for example, and it went out of stock a few seconds before they placed their order, and they had that option ticked, the order would still go ahead and could potentially be rather annoying for the customer, even though that is what they decided to do.
The default option was to abort orders anyway, and it will simply report that some items are out of stock, and the order will not go ahead. The customer simply has to go back to the basket and go from there.
I also just realised, that because card details were entered before checkout on my current store, the stock quantities would be altered very quickly after payment was successful. However, with the Sage system, there could be some delay while users completes the card payments. Because of this, technically, the stock quantities should be altered as quickly as possible which is right at the start of the sage payment screen. However, if the payment fails, that "purchased stock" would have to be returned to the main stock list. This way items are "reserved" in your basket until payment. This is basically how shopping works in any high street store etc
BUT.. It is technically possible for Sage to come up a error screen without being returned to my store. On such errors the reserved contents would not be returned back to the main stock list. On that basis, I should only deduct stock quantities after a successful payment.
BUT.. This opens up the door to the situation where if several people just happens to order the same item within about five minutes of each other, The transaction would complete and the quantities in my store could actually end up a negative value. In which case two orders I would not be able to fulfil because items were actually out of stock.
Technically at this point, such items would be automatically placed on back order (with other shops such as farnell etc) . But I really do not want to go down backorder routes because I may or may not produce that item again, and it could be several weeks or months before that item would be back in stock again. I really do not want to go down that road again with all the "nagging emails" that go along with it.
The easiest thing to do & program overall, is to only deduct stock quantities after successful payment. The chances of two people ordering the same item at the same time as it going out of stock, is pretty slim, but I really do not want to build in "potential bugs" into the store