I want to implement an in-app purchasing mechanism that supports both Google checkout and PayPal for purchasing virtual items in one of my Android apps. I read both references of these mechanisms but I still have one question as to what is the correct way to handle such purchases.
The issue is that i’d like to manage a call to my own server as part of the purchase transaction and in case that call fails to cancel/rollback the entire transaction. If I first perform the purchasing transaction and only when its confirmed I call my own service, what should I do if it fails? If I first call my service and than try to handle the transaction and it fails I need to rollback my call (and what happens if the rollback fails? ??)
What is the correct way to manage it? Is there some way to create a multi-phase transaction that I’m missing?
Try to use the
Google CheckoutMechanism provided for InApp Billing thanPayPalSDK as it is the best way for getting the error responses of the transaction as well asRESTORE TRANSACTIONSif the app is deleted from the device and reinstalled again. Google Provides the Asynchronous Broadcast Notifications during the App Billing transactions. Purchase Types can be divided into Managed(per user account) and UnManaged.Google provides the information here: In App Billing Overview as below:
1.Some in-app billing implementations may also use a private remote server to deliver content or validate transactions, but a remote server is not required to implement in-app billing.
2.A remote server can be useful if you are selling digital content that needs to be delivered to a user’s device, such as media files or photos.
3.You might also use a remote server to store users’ transaction history or perform various in-app billing security tasks, such as signature verification.
4.Although you can handle all security-related tasks in your application, performing those tasks on a remote server is recommended because it helps make your application less vulnerable to security attacks.
So, Finally I would like to recommend you the Google InApp Billing Implementation over other third-party payment process.