我已经使用了gem "active_paypal_adaptive_payment"也设置了付款选项
def checkout
recipients = [recipientarray]
response = gateway.setup_purchase(
:return_url => url_for(:action => 'action', :only_path => false),
:cancel_url => url_for(:action => 'action', :only_path => false),
:ipn_notification_url => url_for(:action => 'notify_action', :only_path => false),
:receiver_list => recipients
)
# For redirecting the customer to the actual paypal site to finish the payment.
redirect_to (gateway.redirect_url_for(response["payKey"]))
end它正在重定向到paypal付款页面。这是页面

在付款汇总中,不显示任何项目名称、价格等。
有没有人能建议如何配置它。请帮帮忙
谢谢
发布于 2013-10-11 18:57:59
你可能想尝试使用"“gem --它是由Shofify更新的,我们提供了它来做你想做的事情。
Problem
让PayPal列出商品的方法是使用ExpressCheckout version (我认为您只是设置了一个点对点支付),然后在散列数组中传递商品。我们用的是手推车,不过你也可以用别的。
paypal epxress的诀窍是,你必须让所有的总数正确地相加。正如您将在我发布的代码中看到的,我们目前只使用静态发送值(我们仍在开发此当前项目),但如果您不需要它,则可以省略发送值。
解决方案
我只能保证ActiveMerchant,因为这是我唯一拥有的代码,但我们要做的是:
路由
#config/routes.rb
get 'checkout/paypal' => 'orders#paypal_express', :as => 'checkout'
get 'checkout/paypal/go' => 'orders#create_payment', :as => 'go_paypal'订单控制器
#controllers/orders_controller.rb
class OrdersController < ApplicationController
#Paypal Express
def paypal_express
response = EXPRESS_GATEWAY.setup_purchase(total,
:items => cart_session.build_order, #this is where you create the hash of items
:subtotal => subtotal,
:shipping => 50,
:handling => 0,
:tax => 0,
:return_url => url_for(:action => 'create_payment'),
:cancel_return_url => url_for(:controller => 'cart', :action => 'index')
)
redirect_to EXPRESS_GATEWAY.redirect_url_for(response.token)
end
#some other stuff is here....
end生成项
#models/cart_session.rb (we use this with a cart)
#Build Hash For ActiveMerchant
def build_order
#Take cart objects & add them to items hash
products = cart_contents
@order = []
products.each do |product|
@order << {name: product[0].name, quantity: product[1]["qty"], amount: (product[0].price * 100).to_i }
end
return @order
end
endhttps://stackoverflow.com/questions/19316221
复制相似问题