Exception in Integration with Paypal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am integrating Paypal rest api with my application.When I am setting the PayerInfo details to the Payer object I am getting exception which I am unable to find the exact reason.
Please find the sample code and the exception that I am getting below
=================================================================
Payer payer = new Payer();
payer.setPaymentMethod(method.toString());
PayerInfo pi = new PayerInfo();
pi.setBuyerAccountNumber("2345");
Address adress = new Address();
adress.setCity("Kollam");
adress.setPostalCode("695581");
pi.setBillingAddress(adress);<[Removed. Phone #s not permitted]");
pi.setCountryCode("IN");
pi.setEmail("am at m.com")
pi.setExternalRememberMeId("369874");
pi.setFirstName("FName");
pi.setLastName("LName");
pi.setMiddleName("MName");
pi.setPayerId("LCJ65SJX8");
pi.setPhone[Removed. Phone #s not permitted]);
pi.setPhoneType("HOME");
pi.setSalutation("Mr");
ShippingAddress sa = new ShippingAddress();
sa.setRecipientName("Cory");
sa.setCity("City");
sa.setCountryCode("IN");
sa.setLine1("line1");
sa.setLine2("line 2");
sa.setPhone("1234-345-678");
sa.setPostalCode("695581");
sa.setRecipientName("B");
pi.setShippingAddress(sa);
pi.setSuffix("Suffix");
pi.setTaxId("123");
pi.setTaxIdType("BR_CPF");
payer.setPayerInfo(pi);
=====================================
Exception
=====================================
Response code: 400 Error response: {"name":"MALFORMED_REQUEST","message":"Incoming JSON request does not map to API request","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#MALFORMED_REQUEST","debug_id":"#######"}
Any suggestion would be of great help.
Thank You,
- Labels:
-
Payments REST APIs
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Using Paypal Smart Buttons for checkout sometimes fails with Debit/ Credit Cards Form in Braintree Client-side Integration (JS, iOS, Android SDKs)
- Sandbox account not generating IPNs in Sandbox Environment
- Need help to integrate PayPal Checkout (PPCP) with OpenCart? in PayPal Upgrade Community
- How can I integrate PayPal to enable direct tipping features between users on a content platform? in REST APIs
- Need help to integrate PayPal Checkout with Ecwid in PayPal Upgrade Community