Under somewhat rare circumstances, it's possible for a user's credit card to be charged and their order marked as complete, but to be told that their order cannot be completed because items are out of stock.
This happens when the 'submit' op of uc_credit_order and uc_multi_stock_order are called in the wrong order due to module weighting. If uc_credit_order is invoked first, the user's credit card is charged. If this succeeds, then uc_multi_stock_order is invoked - and if an item went out of stock because another customer bought it while this user was in checkout, they will be given the "out of stock" message.
My fix for this has been to increase the weight of uc_credit module in the system table. Decreasing the weight of uc_multi_stock is also an option, but perhaps this could also be considered an Ubercart bug.
Comments
Comment #1
longwaveDiscussion in #898050: hook_order('submit', ...) invoked by paypal module before order actually is submitted implies that the way this module checks here is actually an abuse of hook_order op 'submit', instead perhaps the stock check should be attached to a validate handler on the checkout and review forms?