refactor the sold-out logic to confirm orders before payment