Home » Android » Paypal payment in android error handling

Paypal payment in android error handling

Posted by: admin November 1, 2017 Leave a comment


I have integrated paypal payment into my android app. It works like this…

  1. Android app call the Paypal API to accept payment on android
  2. Paypal API takes over the screen, allows user to enter their card, and then charges it.
  3. Control is returned to my app with a result, and a token if successful.
  4. token must be sent to my own server over a network connection, which takes the token and calls payPal API from my server to verify transaction using token.
  5. Server returns result to android app over the network connection where the app displays “SUCCESS!!” to user.

All of that works now in my app. However my concern is step 4 and step 5, where the app must make a network connection to my server and send it the token to be verified using PayPal API from the server.

What if the network connection between the app and my server breaks, and then app cant communicate with my server for some reason?

What is the correct thing to do in this case?