Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more: , +
Hi friends,

I am trying to get pay pal user info once he login to paypal and get authenticated by paypal. At first step I get the Authorization code. But when the execution reach to get the access token of the user that will help me to get user info in next step gives me the following error.

Invalid Http rsponse The remote server returned an error : (400) bad request.


I refer the paypal documentation and sdk for donet
Fowlling is my code

Dictionary configurationMap = new Dictionary(); configurationMap.Add("mode", "sandbox"); APIContext apiContext = new APIContext(); apiContext.Config = configurationMap; CreateFromAuthorizationCodeParameters param = new CreateFromAuthorizationCodeParameters(); param.setClientId("My ClientID goes here");
param.setClientSecret("My Client Secert goes here");
param.SetCode(code); // Authorization code goes here
Tokeninfo info = Tokeninfo.CreateFromAuthorizationCode(apiContext, param);

GetUserInfor(info);


Please guide me where I am lacking or how can i solve this.
Thanks
Posted
Updated 7-Aug-17 21:34pm
v2

Never, ever, accept code from a insecure website to handle anything to do with real money.
You do not know who is giving you the code, you do not know what it does, you do not know that it places the monies correctly into the appropriate account, without passing the details to any third parties.

Only get such code from Paypal - the scope for fraud otherwise is far too large. And remember, you personally could be liable for any monies lost if your action is seen to be negligent - which getting your code from a public forum would most certainly be!
 
Share this answer
 
I ran in to a similar problem a while back .. after debugging my code i found out that the transaction that i was making was logically wrong.. the subtotal was off be $0.25 and paypal server saw it and refused to process it, and gave me 400 bad request
 
Share this answer
 
Comments
TestyBaba 12-Feb-21 19:50pm    
Please how did you overcome this?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900