1

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).

Josh Crozier
  • 233,099
  • 56
  • 391
  • 304
Stals
  • 1,543
  • 4
  • 27
  • 52
  • consumable items mean you can purchase same item more than one times which records will not be handle by the google play except one time purchase(non-consumable item). You have to manage in your application side or your server side to handle this. Make sure you are going to purchase single product one time purchase or more than one time purchase. – Maulik Oct 29 '13 at 09:29
  • @Maulik yes i get that, i give coins to user if purchase was successful so i need to consume so that use can purchase it again. What i need to know - is if purchase is truly valid to not give coins for not valid purchases(duplicates for example) but also not charge for it. – Stals Oct 29 '13 at 09:40
  • you can simply get this by using onActivityResult() method result. if it is successful then allow user to collect coins. check this links: 1) http://developer.android.com/google/play/billing/billing_integrate.html#billing-requests 2) http://stackoverflow.com/questions/19152065/in-app-billing-v3-error-in-activity-result/19158121#19158121 – Maulik Oct 29 '13 at 10:06
  • @Maulik Yes, but that does not use server side verification but just one that is inside IBAHelper. Currenly if verification inside IBAHelper is failed - user will not be charged (correct?), thats what i want for private server verification. – Stals Oct 29 '13 at 10:16
  • you should be handle it by your side and by calling web service you can update your data on your private server after purchase has been completed for consumable purchase. And I think purchase state api would not be work for the consumable products. – Maulik Oct 29 '13 at 13:26
  • @Maulik The problem is not to give user coins the problem is to not charge him if private server says that receipt is invalid but IBAHelper sad it was valid. – Stals Oct 30 '13 at 11:11
  • check this links: https://support.google.com/googleplay/answer/113515?hl=en and https://developers.google.com/android-publisher/v1_1/ I think it will not be possible at programmatically for in app products. Hope it will help you. – Maulik Oct 30 '13 at 14:01

1 Answers1

0

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.

  • thank you for the answer. But what should i do if server sad that receipt was invalid? i can't just not call s3eAndroidMarketBillingConfirmNotifications because market will later notify the app about this purchase which was invalid. – Stals Nov 11 '13 at 05:57