Ruby on Rails - PayPal不能识别不同货币(欧元)的支付URL


Ruby on Rails - PayPal doesn't recognize payment URL with different currency (EUR)

我想建立一个PayPal支付URL与欧元货币。

我找到了欧元(EUR)的国家代码:https://developer.paypal.com/docs/classic/api/currency_codes/

我把它放到我的URL:

  def paypal_url(return_path)
    values = {
        business: "paypal@page.info",
        cmd: "_xclick",
        upload: 1,
        return: "#{Rails.application.secrets.app_host}#{return_path}",
        invoice: id,
        amount: amount, 
        currency: 'EUR',
        item_name: verwendungszweck,
        item_number: id,
        quantity: '1',
        notify_url: "#{Rails.application.secrets.app_host}/hook"
    }
    "#{Rails.application.secrets.paypal_host}/cgi-bin/webscr?" + values.to_query
  end

重定向到:

https://www.sandbox.paypal.com/cgi-bin/webscr?
amount=42.0&
business=paypal%40page.info&
cmd=_xclick&
currency=EUR&
invoice=7&
item_name=kostendeckung&
item_number=7&
notify_url=http%3A%2F%2F78.232.186.71%2Fhook&quantity=1
  &return=http%3A%2F%2F78.232.186.71%2Fdonations.7&upload=1

但是当我启动它时,paypal显示了美元货币的价格。

您应该在您的paypal账户中设置您想要处理的货币。查看链接https://webinterpret.zendesk.com/hc/en-us/articles/203728826-How-do-I-set-up-my-PayPal-to-accept-foreign-currencies-new-PayPal-interface-