gpt4 book ai didi

ruby-on-rails - 使用 ActiveMerchant 在 Paypal setExpressCheckout 中预填名字和姓氏

转载 作者:太空宇宙 更新时间:2023-11-03 15:51:43 26 4
gpt4 key购买 nike

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

关于ruby-on-rails - 使用 ActiveMerchant 在 Paypal setExpressCheckout 中预填名字和姓氏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6008706/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com