我正在尝试使Paypal SetExpressCheckout操作添加用于结算的名字和姓氏。我正在使用ActiveMerchant。我看到地址字段已预先填充(街道,州,城市,邮政编码),但没有其他内容。

#### gateway ######
gateway = ActiveMerchant::Billing::PaypalExpressGateway.new(:login => 'login',:password     => 'pass',:signature => 'sig')
### options ######
@options = Hash.new
@options.merge!(:ip => '127.0.0.1')
@options.merge!(:return_url => '127.0.0.1')
@options.merge!(:return_url => 'http://www.google.com')
@options.merge!(:cancel_return_url => 'http://www.google.com')
@options.merge!(:name => 'name')
@options.merge!(:description => 'description')
@options.merge!(:max_amount => 5000)
@options.merge!(:solution_type => 'Sole')
@options.merge!(:no_shipping => 1)
@options.merge!(:address_override => 1)
### build address
@address = Hash.new
@address.merge!(:name => "Joe User")
@address.merge!(:address1 => "111 ABCD EFG")
@address.merge!(:address2 => nil)
@address.merge!(:city => "Fremont")
@address.merge!(:state => "CA")
@address.merge!(:country => "US")
@address.merge!(:phone => "408-111-2222")
@options.merge!(:address => @address)
setup_response = gateway.setup_purchase(5000, @options)
redirect_to gateway.redirect_url_for(setup_response.token)


在结果页面上,我没有看到预填帐单的名称。
我究竟做错了什么?

谢谢

最佳答案

我和你有同样的问题。经过研究,我得出的结论是这是ActiveMerchant中的错误。请查看我提出的问题。其中包括有关如何修补代码以使电话号码和姓名正常工作的说明:

https://github.com/Shopify/active_merchant/issues/161

09-18 10:35