Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In App Billing V3 Android

Tags:

android

I am developing an app that offers Products that consist in items with information. I implement everything in the right way and in normal circumstances it all goes ok and the flow is correct. the purchase in google ocurrs and than I insert the data in my server.

The problematic thing is that i cant manage to handle the case when i get no connection as soon as i try to insert data in my server.

This is a bad thing because it results in loss of money for the user and no information gain for him.

the items are managed and consumable.

I would like to know how to cancel an order if I detect that the inserting of data in my server isn't happening, for different reasons example : 1-Server down , no connection , device shut down etc.

Thank you in advance.

like image 333
Rubin Basha Avatar asked May 25 '26 06:05

Rubin Basha


1 Answers

I would like to know how to cancel an order if I detect that the inserting of data in my server isn't happening,

It is not a great idea to cancel the order just because you are not able to insert a purchase record into your server.

Google Play In app billing, as of version 3, stores all the valid purchases made by the users using their google account. This can be retrieved anytime and the purchase can be restored. You would have to code the purchase restoring logic, if you want to help the user retrieve his purchase.

If you still want to store the purchase information on your server for your own analytics, then you can imagine storing the purchase in a local storage, like a small database before you send it to your server. And once you know that your server has saved the purchase record, you may delete the purchase entry from the local db or something similar.

like image 147
siddharthsn Avatar answered May 27 '26 19:05

siddharthsn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!