Search code examples
ruby-on-rails-3paypalactivemerchant

Debugging ActiveMerchant; need full request and response. How to?


Rails 3.0.10 and activemerchant gem 1.29.3

My app works fine in sandbox, but transactions in production mode are failing with "Security header is not valid", "ErrorCode"=>"10002"

We initiated a support request with paypal, after reviewing all the configuration parameters a million times and they feel we're hitting an incorrect endpoint. They've asked for a full trace for the transaction, including headers, etc, so I'm trying to figure out how to do that. I found this article

which suggested adding this to the config block

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

But that just results in an empty log; nothing gets dumped to it.

So, how can I obtain this info from the GATEWAY object, if possible? Here's the production config, the format of which is identical to what's used in staging env.

::GATEWAY = ActiveMerchant::Billing::PaypalGateway(
      :login => 'me_api1.blah...',
      :password => 'string...',
      :signature => 'longer string...'
    )

Thanks.


Solution

  • Needed to add the additional line as follows:

    ActiveMerchant::Billing::PaypalGateway.wiredump_device.sync = true
    

    Within the same config block in the environment