我在 Rails 应用程序中使用 Paypal 直接付款。我集成在实时站点中,同时购买任何显示错误的项目,例如,
A field was longer or shorter than the server allows
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')
请给出解决方案
最佳答案
您帐户中显示的唯一错误如下。
错误代码 10501
短信“无效配置”
longmessage "由于商家配置无效,无法处理此交易。"
这可能是由于您尝试执行 DoDirectPayment API 请求而没有在您的帐户上启用 Pro。您的软件可能将该错误转换为您看到的字段错误。如果您希望在您的帐户上启用 Pro 以便能够执行 DoDirectPayment API 调用,请联系客户支持。
关于paypal - 字段比服务器允许的长或短 - Rails 生产环境错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16933593/