spree/spree — pull request #3317 by BDQ (2013-07-03 19:22:02+00:00)
Title: Order.process_payment refactor

@radar can you take a quick sanity check on this and merge it to master + 2-0-stable when you get a chance please?

It fixes a condition encountered on a production spree store where "failed" payments (i.e. declined, etc) were allowing an order to get into a "complete" incorrectly.

While I was fixing it I decided I could drop the conditions from the `:go_to_state :complete` , as the refactored process_payments method provides the same protection in a slight simpler way. I just want to make I fully got all the edge cases those conditions where intended to protect against.

Also, if reverts + fixes the issues noted in #3282

Thanks.