spree/spree — pull request #5754 by gmacdougall (2014-12-11 13:56:48+00:00)
Title: Fix for failure of one of multiple payments.

This corrects an issue which would leave the user on the confirm page
when one of multiple payments failed. This would allow the user to
proceed through the confirm step with an invalid payment, not billing
them for the full amount required.

An example would be with the store credit payment method, where they are
able to pay for part of the order with store credit. Example, the
customer has $20 store credit available and is trying to purchase a $100
item.

Currently, if attempting to charge $80 to the credit card fails (due to
the card being declined), they $80 credit card payment will be flagged
invalid, leaving only the $20 payment. The user would remain on the
confirm page, which allows them to check out paying $20 on their store
credit. The user will beleieve that everything worked correctly, however
their $20 store credit has been consumed, but the order is still in a
balance due state.

This is fixed by only allowing an order to remain on the confirm page if
they have sufficient payments to pay for the entire order.