Paypal 400 Bad Request Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About the remote server returned an error (400) bad request. c# paypal Us Learn more about Stack Overflow the company Business Learn more about hiring
The Remote Server Returned An Error 400 Bad Request Paypal
developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join error update rider bad request uber the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up PayPal 400 Bad Request, more paypal validation error specific? up vote 4 down vote favorite Is there any way to get a more specific PayPal error than 400 bad request? I saw someone doing something like this: if (ex.InnerException is ConnectionException) { Response.Write(((ConnectionException) ex.InnerException).Response); } else { Response.Write(ex.Message); } But that doesn't seem to do anything different for me, all the error says is: "The remote server returned an error: (400) Bad Request." I've
Paypal Debug Id
read that it could have something to do with some sort of validation error, but I've tried changing the data I'm sending to PayPal, but all with no luck so far. I hope you can help me, thank you! EDIT: Thanks to Aydin I managed to find this error-message in one of the HTTP requests through Fiddler: {"name":"VALIDATION_ERROR","details":[{"field":"payer.funding_instruments[0].credit_card.number","issue":"Value is invalid"}],"message":"Invalid request - see details","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#VALIDATION_ERROR","debug_id":"dd5f11f6e9c98"} c# asp.net-mvc paypal share|improve this question edited May 30 '15 at 0:53 asked May 30 '15 at 0:12 Mikkel 363113 Are you authenticated at this point in your code? PayPal might not give you a more detailed error message for security reasons. –Sumner Evans May 30 '15 at 0:18 Thanks for your fast comment! Hmm... It seems the exception occurs on payment Create. If if's an connection exception wouldn't it show more info when I use the above code though? –Mikkel May 30 '15 at 0:22 add a comment| 3 Answers 3 active oldest votes up vote 3 down vote accepted You can save yourself time by installing Fiddler, by doing so you can see the exact HTTP Web Requests that you send, and the responses
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this uber update rider bad request site About Us Learn more about Stack Overflow the company Business Learn paypal rest api more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question
Paypal Sandbox
x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up PayPal http://stackoverflow.com/questions/30540859/paypal-400-bad-request-more-specific REST API .net SDK - 400 Bad Requests up vote 12 down vote favorite 2 I'm working in the sandbox and using the PayPal REST .net SDK method Payment.Create with a CreditCard object. When all parameters are valid and using the test CC number from https://developer.paypal.com/webapps/developer/docs/integration/direct/accept-credit-cards/, the Payment object is returned from that method and all is well. However, when a parameter is not http://stackoverflow.com/questions/15581314/paypal-rest-api-net-sdk-400-bad-requests valid, such as a past expiration date or a CC number not recognized by the sandbox, the Payment object is not returned. Instead the method throws an exception: "Exception in HttpConnection Execute: Invalid HTTP response The remote server returned an error: (400) Bad Request", but with no further explanation. When I execute the same request in cURL, in addition to the "400 Bad Request", I get a JSON response. This includes more helpful messages such as "VALIDATION_ERROR" and "Invalid expiration (cannot be in the past)". My question: Is there a way to get these messages back from the SDK? What I've tried: PayPal docs: https://developer.paypal.com/webapps/developer/docs/api/#errors This document mentions that in the case of an error, they return the details in the body of the response. Unfortunately, it doesn't give a clue about whether these are accessible by the SDK. Various Google and SO searches. The PizzaApp sample code provided with the SDK has nothing in the way of exception handling or further insight into this problem. I see a PayPalException object in the SDK, but have not found anything that indicates how it should be used or if it'
Sign in Pricing Blog Support Search GitHub This repository Watch 161 Star 918 Fork 502 paypal/PayPal-PHP-SDK Code Issues 25 Pull requests https://github.com/paypal/PayPal-PHP-SDK/issues/249 1 Projects 0 Wiki Pulse Graphs New issue 400 while executing payment #249 Closed borki23 opened this Issue Feb 22, 2015 · 17 comments Projects None yet Labels api-payments question Milestone No milestone Assignees No one assigned 3 participants borki23 commented Feb 22, 2015 Hello, after I've created a payment (method is paypal) I bad request want to execute it on my return site via following code: $paymentId = $persInfos['paymentId']; $payment = Payment::get($paymentId, $apiContext); $execution = new PaymentExecution(); $execution->setPayerId($persInfos['PayerID']); $result = $payment->execute($execution, $apiContext); $persInfo is an array where i save all the field from the $_GET var => field names are the same. Sadly, I get a 400 "PAYMENT_STATE_INVALID" exception However on the paypal 400 bad request dashboard notifications i can see that the payment has been validated and i got a corresponding message both to the buyer and the payer. I don't know what causes this behavior, since the api samples on my localhost seem to work fine. Is this issue already known or does anybody has an idea what causes this exception? Thanks. jaypatel512 commented Feb 23, 2015 Few more details would help. Are you facing this on live or sandbox. Can you pass the logs that got generated in sandbox. If not done already, you could follow the instructions shown here. Can you pass the URL that you get when it returns from paypal. The one that should have all the paymentId and PayerId thing. If you could pass these three information, it would be extremely helpful. jaypatel512 added the question label Feb 23, 2015 jaypatel512 commented Feb 23, 2015 Hey @borki23 ! Just curious, were you able to resolve this issue ? Let me know and I could help you fix that. jaypatel