The currency code is not passed to the gateway correcly #1528
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 but the Paypal gateway expects the currency to be in a different set of options that are passed to authorize(), which are passed from Spree without the currency code.
A patch with a test case (my first for spree!) is included.