This pull request fixes #842 by checking the stock of line items before redirecting users to off-site gateways, like Mollie.
Previously, if one of the products didn't have enough stock to fulfil the order, the customer would still be redirected to the payment gateway. Simple Commerce would then error in the webhook causing the order to never be marked as paid.
This has been fixed in v5.0 in #843 as part of some other changes so this PR fixes the issue for v4.
This pull request fixes #842 by checking the stock of line items before redirecting users to off-site gateways, like Mollie.
Previously, if one of the products didn't have enough stock to fulfil the order, the customer would still be redirected to the payment gateway. Simple Commerce would then error in the webhook causing the order to never be marked as paid.
This has been fixed in v5.0 in #843 as part of some other changes so this PR fixes the issue for v4.