Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 577
wkhatch Avatar asked Nov 12 '22 14:11

wkhatch


1 Answers

Needed to add the additional line as follows:

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

Within the same config block in the environment

like image 164
wkhatch Avatar answered Dec 30 '22 03:12

wkhatch