【发布时间】:2014-04-27 21:15:36
【问题描述】:
如果我的货币不是“美元”,我无法通过activemerchant创建purchase
这是来自response.message 的错误短信:
The transaction currency specified must be the same as previously specified.
这是购买设置:
response = EXPRESS_GATEWAY.setup_purchase(product.price,
:currency => product.currency.upcase, # it's 'EUR'
:items => [{name: product.name, quantity: 1, amount: product.price, description: product.description}],
:ip => request.remote_ip,
:return_url => paypal_checkout_url,
:cancel_return_url => paypal_checkout_url
)
这是购买本身:
def purchase
response = EXPRESS_GATEWAY.purchase(product.price, express_purchase_options)
end
def express_purchase_options
{
:ip => ip_address,
:token => express_token,
:payer_id => express_payer_id
}
end
也许我也应该在express_purchase_options 中指定货币?
【问题讨论】:
标签: paypal ruby-on-rails-4 paypal-sandbox activemerchant