1
votes

I have integrated my android app with Paypal and i have tested it with paypal sandbox credentials. Ti test with other credentials , i have created another account and when i test this, i am getting error saying....

  request failure with http statusCode:422,exception:org.apache.http.client.HttpResponseException: Unprocessable Entity

request failed with server response:{"name":"PAYMENT_CREATION_ERROR","debug_id":"c9abdab19db06","message":"checkout-session is NON_PAYABLE: {\"id\":\"4NJ51372SE556852L\",\"state\":\"NON_PAYABLE\",\"cart_id\":\"4NJ51372SE556852L\",\"payer\":{\"payment_method\":\"paypal\",\"payer_info\":{\"email\":\"[email protected]\",\"payer_id\":\"GK7QYNA573LCC\",\"shipping_address\":{\"recipient_name\":\"gv\",\"id\":\"16820688\",\"line1\":\"Flat no. 507 Wing A Raheja Residency\",\"line2\":\"Film City Road, Goregaon East\",\"city\":\"Mumbai\",\"state\":\"Maharashtra\",\"postal_code\":\"400097\",\"country_code\":\"IN\",\"normalization_status\":\"UNKNOWN\",\"default_address\":true,\"preferred_address\":false},\"phone\":\"202-167-7620\",\"phone_type\":\"HOME\"}},\"payment_approved\":false,\"offers\":[{\"offer_intensity\":\"NO_OFFER\"}],\"payment_contingency\":{\"name\":\"PAYER_ACTION_REQUIRED\",\"cause_name\":\"NO_VALID_FUNDING_INSTRUMENT\",\"resolutions\":[{\"name\":\"ADD_PAYMENT_CARD\",\"funding_instrument_details\":{\"type\":\"PAYMENT_CARD\",\"payment_card\":{\"billing_address\":{\"line1\":\"Flat no. 507 Wing A Raheja Residency\",\"line2\":\"Film City Road, Goregaon East\",\"city\":\"Mumbai\",\"state\":\"Maharashtra\",\"postal_code\":\"400097\",\"country_code\":\"IN\"}}}}]}}","information_link":"https://api.sandbox.paypal.com/docs/api/#PAYMENT_CREATION_ERROR"}

enter image description here

kindly give me valuable suggestions and help me

1

1 Answers

1
votes

The server response indicates the problem fairly clearly: PAYER_ACTION_REQUIRED / NO_VALID_FUNDING_INSTRUMENT / ADD_PAYMENT_CARD. Your code is working; the payment was refused on PayPal's end because the payer account is not able to pay. Fix your test payer account, or use another known-good payer account.

One additional caution: despite the messaging suggesting the solution is to add a card to the account, that may not be enough. PayPal has to live under a variety of international legal rules, and I think that India is one country in which PayPal and the government are not getting along very well:

http://www.zdnet.com/article/paypal-puts-india-on-hold/

... so that account with an address in Mumbai may be out of luck, and your test scenario would be considered a negative test case -- payment from Indian payer refused 'correctly' per PayPal policy & Indian law :(.