简体   繁体   English

货币PayPal Rails 4.1

[英]Currency PayPal Rails 4.1

I'm making a rails app and I need to let people pay in different currencies like EUR, USD, MXN, KRW, etc. My current code is as follows: 我正在制作Rails应用程序,需要让人们使用欧元,美元,墨西哥比索,韩元等不同的货币付款。我当前的代码如下:

def paypal_url(return_url)
  values = {
  :business => 'tourify-facilitator@gmx.com',
  :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

This works, but it only lets you pay in USD. 这可行,但是只允许您以美元支付。 How can I change it? 我该如何更改? I've tried to write inside values :currency => 'EUR' but it doesn't work. 我试图写里面的值:currency =>'EUR'但它不起作用。

Thnx!! 日Thnx!

try to use :currency_code => 'EUR' . 尝试使用:currency_code => 'EUR' It should work. 它应该工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM