Ruby on Rails - PayPal无法识别不同货币的支付网址(EUR)

时间:2016-08-27 16:48:26

标签: php ruby-on-rails ruby paypal

我想使用欧元货币构建PayPal付款网址。

我在以下网址找到了欧元(EUR)的国家/地区代码: https://developer.paypal.com/docs/classic/api/currency_codes/

我把它放到我的网址:

  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会向我显示美元货币的价格。

1 个答案:

答案 0 :(得分:0)