【问题标题】:Pre-filling first and last name in Paypal setExpressCheckout using ActiveMerchant使用 ActiveMerchant 在 Paypal setExpressCheckout 中预先填写名字和姓氏
【发布时间】:2011-08-25 21:46:48
【问题描述】:

我正在尝试让 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)

在结果页面上,我没有看到为计费预先填写的名称。 我做错了什么?

谢谢

【问题讨论】:

    标签: ruby-on-rails paypal activemerchant


    【解决方案1】:

    我遇到了和你一样的问题。经过一些研究,我得出结论,这是 ActiveMerchant 中的一个错误。请参阅我提交的问题。它包括对我如何修补代码以使电话号码和姓名起作用的说明:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-02-22
      • 1970-01-01
      • 1970-01-01
      • 2018-03-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-02
      相关资源
      最近更新 更多