5

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.

wkhatch
  • 2,664
  • 7
  • 36
  • 45

2 Answers2

5

Needed to add the additional line as follows:

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

Within the same config block in the environment

wkhatch
  • 2,664
  • 7
  • 36
  • 45
-4

Somewhere in the class library you're using there should be a function to output this for you (if it's a well built library, that is.)

Even without that, though, you should be able to look in that PaypalGateway function to see where/how it's setting the endpoint. It's either hard-coding the value or it'll be setting different endpoints based on some sandbox option you have configured somewhere else in the class.

It's hard to tell you more than that without getting a look a the actual class library you're using, but I can concur that it must be either incorrect credentials or an incorrect endpoint. I've never once seen that security header error when it wasn't simply invalid credentials, which means either your values are incorrect or you're hitting the wrong endpoint.

If you want to post that whole function (or maybe even the whole library as the endpoint could be getting set from some other function) I can take a look and find the problem for you.

Drew Angell
  • 25,968
  • 5
  • 32
  • 51
  • not really an answer to the question, is it? I agree, there should be some way of getting it to output. That is the essence of my question... – wkhatch Dec 19 '12 at 00:24
  • Yeah, it is an answer to the question when you don't provide the actual class to look at. Showing us the usage of a function does no good at all. If you want to provide that I'd be happy to find the answer for you. I appreciate the neg for trying to help, though. I'll keep that in mind next time I see you asking a question I can help with. – Drew Angell Dec 19 '12 at 04:30
  • 1
    This: ActiveMerchant::Billing::PaypalGateway is part of a third party library... the activemerchant gem, in ruby. If you know about that, please update your answer, with, an actual answer. Otherwise, the down vote stands. Thank you – wkhatch Dec 19 '12 at 06:55