spree/spree — pull request #1528 by shadchnev (2012-05-11 09:13:50+00:00)
Title: The currency code is not passed to the gateway correcly

I am implementing a store in the UK on Spree. I am using spree_gateway for Paypal Website Payments Pro support. I noticed that even though I set currency_code in the gateway options to "GBP", Paypal still bills the card in USD.

It turned out that Spree::Payment::Processing.gateway_options that is responsible for passing the options to the Paypal gateway is not passing :currency. Because it's not passed, Paypal assumes USD as the default.

The gateway options (including the currency_code) are used to [initialize the gateway](https://github.com/spree/spree/blob/master/core/app/models/spree/gateway.rb#L25) but the Paypal gateway expects the currency to be in a [different set of options that are passed to authorize()](https://github.com/Shopify/active_merchant/blob/master/lib/active_merchant/billing/gateways/paypal.rb#L16), which are [passed from Spree](https://github.com/spree/spree/blob/master/core/app/models/spree/payment/processing.rb#L106) without the currency code.

A patch with a test case (my first for spree!) is included.