spree/spree — pull request #2530 by LBRapid (2013-02-06 18:35:34+00:00)
Title: Apply coupons through the checkouts api

With https://github.com/spree/spree/commit/387650b7908d094fc2f7f65c59c0438eb5d342dc a few weeks ago, I added a CheckoutsController to the spree API that is further explained at http://api.spreecommerce.com/v1/order/checkouts/

One thing missing was the ability to apply coupon codes to orders, which is what I'm adding here. There was a lot of refactoring involved in this in order to prevent duplication and cleanup existing duplication between promo/core.

While what I have works, I'm not sure it is 100% ready to be merged to master. Particularly of interest to me is trying to improve what the `Spree::ApplyCoupons` module returns so I can better handle flash messages while still managing to detect errors on the API side of things.

Feedback welcome!