spree/spree — pull request #2930 by gmacdougall (2013-04-23 22:12:07+00:00)
Title: Active Merchant amount fix

The payment processing code currently multiplies all amounts by 100 when passing the results in to active merchant. This does not play nicely with currency which do not have cents (or other forms of subunits of a currency).

RubyMoney tracks this sort of stuff nicely, so I modified this code to use the RubyMoney cents function:

```
Money.new(100, 'USD').cents #=> 100
Money.new(100, 'USD').to_s #=> "1.00"

Money.new(100, 'JPY').cents #=> 100
Money.new(100, 'JPY').to_s #=> "100"
```

This means that items which cost 100 yen, will have 100 passed to ActiveMerchant rather than 10,000.

This has the potential to cause issues for people who have written gateways which relied upon this behaviour, but I believe this code correctly represents what should be happening.