Authentication failed #21

Closed
joaomilho opened this Issue May 25, 2012 · 6 comments

Projects

None yet

2 participants

@joaomilho

I've tried with 3 different users, but with all of them Paypal returns me an auth erros. Here's the relevant parts of my env:

ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin10.8.0]

Gemfile
gem 'rails', '3.2.3'
gem 'activemerchant', '1.17.0', require: 'active_merchant'
gem 'active_paypal_adaptive_payment', '~> 0.3.13'

Debug (I've added headers to the debug method, and added the IP address also):

Url: https://svcs.sandbox.paypal.com/AdaptivePayments/Pay

Headers: {"X-PAYPAL-REQUEST-DATA-FORMAT"=>"XML", "X-PAYPAL-RESPONSE-DATA-FORMAT"=>"JSON", "X-PAYPAL-SECURITY-USERID"=>"****", "X-PAYPAL-SECURITY-PASSWORD"=>"**", "X-PAYPAL-SECURITY-SIGNATURE"=>"***", "X-PAYPAL-APPLICATION-ID"=>"APP-80W284485P519543T", "X-PAYPAL-DEVICE-IPADDRESS"=>"127.0.0.1"}

Request:

ReturnAll en_US PAY http://localhost:3000/pt/paypal/8/cancel http://localhost:3000/pt/paypal/8/success currencyCode:BRL/ person1@example.com 55.0 true false

Response: {"responseEnvelope":{"timestamp":"2012-05-25T10:33:38.824-07:00","ack":"Failure","correlationId":"6fd3fcb2e9390","build":"2945555"},"error":[{"errorId":"520003","domain":"PLATFORM","subdomain":"Application","severity":"Error","category":"Application","message":"Authentication failed. API credentials are incorrect."}]}"

@joaomilho

Damn.... It looks like GitHub doesn't deal very well with xml... :/

@joaomilho

Here's the debug info https://gist.github.com/2789450

@jpablobr
Owner

Hummm weird, have you tried following this tutorial for creating your users?

https://www.x.com/devzone/articles/iauction-adaptive-payments-tutorial-featuring-parallel-payments

@joaomilho

Well... I haven't :/. I'll try it out and if it work - or not - I'll let u know.

@joaomilho

Well... I've tried with curl and discovered that the problem is in the request [] method, 'cause it sets the header key to downcase and it seems PayPal ONLY accepts headers upcase. It's [pretty] weird none of you had this same problem... There's also a discussion at stack overflow about it: http://stackoverflow.com/questions/2710373/preserving-case-in-http-headers-with-rubys-nethttp

I'll try to monkeypatch the methods...

@joaomilho

Well. That wasn't the real problem. It was a problem in the signature PayPal sent me :/ Thanks for your atention anyway :D

@joaomilho joaomilho closed this May 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment