Pankaj Kumar

Pankaj Kumar

  • NA
  • 112
  • 10.2k

How to solve PayPalException error: (400) Bad Request.

Jun 21 2018 12:56 AM
I am currently testing credit card payments using the PayPal payments Rest API.
 
I keep getting the following error:
 
PayPalException Execute: The remote server returned an error: (400) Bad Request.
 
My Card details
  1. //Address for the payment  
  2. Address billingAddress = new Address();  
  3. billingAddress.city = "Johnstown";  
  4. billingAddress.country_code = "US";  
  5. billingAddress.line1 = "52 N Main ST";  
  6. billingAddress.postal_code = "43210";  
  7. billingAddress.state = "OH";  
  8. //Now Create an object of credit card and add above details to it  
  9. CreditCard crdtCard = new CreditCard();  
  10. crdtCard.billing_address = billingAddress;  
  11. crdtCard.cvv2 = "819";  
  12. crdtCard.expire_month = 10;  
  13. crdtCard.expire_year = 2019;  
  14. crdtCard.first_name = "pankaj";  
  15. crdtCard.last_name = "Kumar";  
  16. crdtCard.number = "4885699625443750";  
  17. crdtCard.type = "visa";

Answers (3)