2014-11-02 68 views
0

我做一个Rails应用程序,我需要让人们在不同的货币如欧元,美元,墨西哥比索,韩元等支付 我当前的代码如下:货币贝宝的Rails 4.1

def paypal_url(return_url) 
    values = { 
    :business => '[email protected]', 
    :cmd => '_cart', 
    :upload => 1, 
    :return => return_url, 
    :invoice => id, 
} 
values.merge!({ 
    "amount_1" => price, 
    "item_name_1" => title, 
    "item_number_1" => id, 
    "quantity_1" => '1' 

}) 
"https://www.sandbox.paypal.com/cgi-bin/webscr?" + values.to_query 
end 

这可行,但它只能让你用美元支付。 我该如何改变它?我试图写入内部值:currency =>'EUR',但它不起作用。

Thnx !!

回答

1

尝试使用:currency_code => 'EUR'。它应该工作。

+0

谢谢!有用 :) – Naster 2014-11-02 10:58:37