【问题标题】:A field was longer or shorter than the server allows - Rails production environment error字段比服务器允许的长或短 - Rails 生产环境错误
【发布时间】:2013-05-31 18:42:12
【问题描述】:

我在 Rails 应用程序中使用 paypal 直接付款。我已集成在实时站点中,同时购买任何显示错误的项目,例如,

字段比服务器允许的长或短

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')

请给出解决方案。

【问题讨论】:

    标签: paypal ruby-on-rails-3.2 activemerchant


    【解决方案1】:

    您的帐户中显示的唯一错误如下。

    错误代码 10501
    短消息“无效配置”
    longmessage "由于商户配置无效,此交易无法处理。"

    当您尝试执行 DoDirectPayment API 请求并且没有在您的帐户上启用 Pro 时,可能会导致此问题。您的软件可能将该错误转换为您看到的字段错误。如果您希望在您的帐户上启用 Pro 以便能够执行 DoDirectPayment API 调用,请联系客户支持。

    【讨论】:

    • 还有其他解决方案吗?如何启用到 Pro?
    • 对于真实账户,您需要联系 PayPal 客户支持,对于沙盒账户,您通常可以自己在账户上启用此功能,对于有问题的账户,MTS 通常可以启用这些功能。
    猜你喜欢
    • 2011-11-18
    • 2016-12-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-23
    相关资源
    最近更新 更多