The currency code is not passed to the gateway correcly #1528

wants to merge 5 commits into


None yet

2 participants


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.


I think I accidentally added a few unnecessary commits to this pull request by not branching first, sorry. Only the first commit is relevant.

@BDQ BDQ closed this in 2db6baa May 14, 2012
BDQ commented May 14, 2012

Merged to 1-1-stable also, thanks for the contribution.

@tvdeyen tvdeyen pushed a commit to magiclabs/spree that referenced this pull request Jun 1, 2012
@shadchnev @radar shadchnev + radar passing the currency code from payment method preferences to the gateway
[fixes #1528]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment