我在 Rails 应用程序中使用贝宝直接付款。我集成在实时站点中,同时购买显示错误的任何项目,例如,
字段比服务器允许的长或短
require 'rubygems'
require 'active_merchant'
ActiveMerchant::Billing::Base.mode = :production
credit_card = ActiveMerchant::Billing::CreditCard.new(
:number => 'xxxxxxxxxxxxxxxxx',
:month => '3',
:year => '2018',
:first_name => 'xxxxxx',
:last_name => 'xxxxxxx',
:verification_value => 'xxxxxx'
)
gateway = ActiveMerchant::Billing::PaypalGateway.new(
:login => "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
:password => "xxxxxxxxxxxxxxxx",
:signature => "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "
)
response = gateway.authorize(1, credit_card, :ip => '127.1.1.1')
请给出解决方案。