简体   繁体   中英

Google Play inapp purchase verification on server

So I don't really get what should I do if receipt verification fails on server. Is there a way to wait for server verification to then accept transaction that will charge the user and tell me that I should give him consumable item.

I use Marmalade extension "s3eAndroidGooglePlayBilling" that uses IBAHelper - I found verification there but I don't really know Java and can't find in Android Billing v3 documentation how does it cancel transaction if verification failed (like for ios inapp purchases). But also I need to make verification on server side.

Or do I just verify on a server and give the user consumable item based on that? but that seems like a bad idea because if server did not respond user already spent money but client doesnt know if purchase was valid.

NOTE: this is not just a Marmalade question, it is more like what should I do on a client for server verification to not charge user if server thinks receipt is not valid (because I think I can modify the extension and use it like normal)

NOTE 2: Server side is already implemented and client gets a message if purchase is valid or not, but I don't know what to do with it on client side to give user coins and charge him only after that (if purchase was valid).

in s3eAndroidMarketBilling extension there are s3eAndroidMarketBillingConfirmNotifications function. You must call it when you get purchase callback. And this call will make transaction closed. If you don't call this function (your server not respond) you will get all not closed transaction in feature s3eAndroidMarketBilling callbacks. And if you use item with google play controll you can use s3eAndroidMarketBillingRestoreTransactions for restore all user transaction.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM