paypal - 字段比服务器允许的长或短 - Rails 生产环境错误

标签 paypal ruby-on-rails-3.2 activemerchant

我在 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/

相关文章:

ruby-on-rails - 由于 ArgumentError : An API Certificate or API Signature is required to make requests to PayPal,Capistrano 和 ActiveMerchant Paypal 将不会部署

php - 如何将paypal SDK集成到我的自定义php网站?

ruby-on-rails-3 - 为什么 update_attribute 不更改我的时间戳列

ruby-on-rails - Sinatra 有 ActiveMerchant 吗?

ruby-on-rails - 如何使用 ActiveMerchant 进行 Paypal 网站支付标准?

php - PayPal Checkout - 默认打开信用卡选项卡

.htaccess - Codeigniter .htaccess 不忽略目录

ruby-on-rails - 使用 Devise 和 Omniauth 编辑用户

ruby-on-rails - strptime 和 I18n,如何解析当前语言的日期

ruby-on-rails - 最合适的 Paypal 支付集成选项