PayPal express/Active Merchant - 不显示订单项或购物车总数?

Ale*_*Fox 6 paypal ruby-on-rails activemerchant

我正在尝试使用活跃的商家设置PayPal快速结账,但我遇到了问题.我已经按照教程进行了,我可以在paypal上找到"选择支付方式"的表格,但没有显示任何项目或价格.

这是一个截图.http://i39.tinypic.com/35mircz.png

为什么即使我传递它们也没有显示价格或任何物品?这是我用来setup_purchase的代码.

@product = Product.find(params[:product_id])

setup_response = gateway.setup_purchase(200,
  :ip                => request.remote_ip,
  :items => [{:name => "Tickets", :quantity => 22, :description => "Tickets for 232323", :amount => 10}],
  :return_url        => url_for(:action => 'confirm', :only_path => false),
  :cancel_return_url => url_for(:action => 'index', :only_path => false)
)

redirect_to gateway.redirect_url_for(setup_response.token)
Run Code Online (Sandbox Code Playgroud)

任何帮助将不胜感激.亚历克斯

小智 8

您的问题在于您的数量和定价 - 如果您在通过类似的方式调用后输出setup_response

logger.debug setup_response
Run Code Online (Sandbox Code Playgroud)

并检查日志,您会发现它可能会抱怨项目中的价格与您传递的金额(第一个值)不匹配.

目前,你的数量为22,每个'金额'为10. 10*22 = 220,并且因为你只是在第一个值中加入200,所以你错了它们.解决这个问题,你应该好好去.