buddhi-desilva/spree-pp-website-standard — Issue #1: refreshing payment page causes many Payments to get attached to Order
Author: berkes
Created: 2012-02-29 13:46:27+00:00
State: open

In the controller_decorator, the `GET edit` is overridden. In that override we create and attach a new payment on each call:

```RUBY
payment = Spree::Payment.new
payment.amount = @order.total
#...
@order.payments << payment
```

If you go back in the statemachine, or refresh that page, new payments will be added to the order. This violates the RESTfull "rules" where a get should never have a side-effect.

Should this paypal extension not simply insert a step in the checkout Order statemachine and act on that, instead of this?

I realize that this is a lot of work, but the core checkoutcontroller is rather inflexible, and violates REST already.