简体   繁体   English

服务器上的Google Play inapp购买验证

[英]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). 我使用了使用IBAHelper的Marmalade扩展名“ s3eAndroidGooglePlayBilling”-我在那找到了验证,但我并不真正了解Java,并且在Android Billing v3文档中找不到验证失败后如何取消交易(例如ios inapp购买)。 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). 注意2:服务器端已经实现,如果购买是否有效,客户端会收到一条消息,但是我不知道如何在客户端使用它给用户硬币并仅在此之后向用户收费(如果购买有效) 。

in s3eAndroidMarketBilling extension there are s3eAndroidMarketBillingConfirmNotifications function. 在s3eAndroidMarketBilling扩展中,有s3eAndroidMarketBillingConfirmNotifications函数。 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. 如果不调用此函数(服务器未响应),则将在功能s3eAndroidMarketBilling回调中获取所有未关闭的事务。 And if you use item with google play controll you can use s3eAndroidMarketBillingRestoreTransactions for restore all user transaction. 而且,如果您将项目与Google Play控件一起使用,则可以使用s3eAndroidMarketBillingRestoreTransactions恢复所有用户交易。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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