调试ActiveMerchant; 需要完整的请求和响应.如何?

wkh*_*tch 5 paypal activemerchant ruby-on-rails-3

Rails 3.0.10和activemerchant gem 1.29.3

我的应用程序在沙箱中工作正常,但生产模式下的事务失败,"安全标头无效","ErrorCode"=>"10002"

我们在审核了所有配置参数一百万次之后,我们用paypal发起了一个支持请求,他们觉得我们遇到了一个不正确的端点.他们已经要求对交易进行全面跟踪,包括标题等,所以我试图弄清楚如何做到这一点.我找到了这篇文章

建议将其添加到配置块

ActiveMerchant::Billing::PaypalGateway.wiredump_device = File.new(File.join([Rails.root, "log", "paypal.log"]), "a")
Run Code Online (Sandbox Code Playgroud)

但这只会导致空日志; 什么都没有被抛弃.

那么,如果可能的话,如何从GATEWAY对象获取此信息?这是生产配置,其格式与staging env中使用的格式相同.

::GATEWAY = ActiveMerchant::Billing::PaypalGateway(
      :login => 'me_api1.blah...',
      :password => 'string...',
      :signature => 'longer string...'
    )
Run Code Online (Sandbox Code Playgroud)

谢谢.

wkh*_*tch 5

需要添加额外的行如下:

ActiveMerchant::Billing::PaypalGateway.wiredump_device.sync = true
Run Code Online (Sandbox Code Playgroud)

在环境中的相同配置块内