Android In App Billing...为什么会有矛盾的信息?

标签 android in-app-purchase in-app-billing billing android-billing

我和许多其他人一样,只是在验证静态响应有效后尝试测试我的应用内购买。但是当我阅读文档、帖子和答案时,似乎没有任何结果。我变得非常沮丧。

我的最终目标是弄清楚我是否可以在不收费的情况下进行测试。

这个文档说我可以 - link

Once authorized with testing access, those users can side-load your app and test the full merchandising, purchase, and fulfillment flow for your products. Test purchases are real orders and Google Play processes them in the same way as other orders. When purchases are complete, Google Play prevents the orders from going to financial processing, ensuring that there are no actual charges to user accounts, and automatically canceling the completed orders after 14 days.

和相同的链接

During a test purchase, users can test the actual merchandising, purchase, and fulfillment flow in your app. During purchase, the inapp item is displayed as a normal item with an actual price. However, Google Play marks test purchases with a notice across the center of the purchase dialog, for easy identification

但是在这个页面上,它说 - link

Login to the test device by using a tester account. Test your In-app Billing application by purchasing a few items, and fix any issues that you encounter. Remember to refund the purchases if you don’t want your testers to be actually charged!

WTF...所以有人知道吗?可以做检测不收费吗?如果是这样,怎么做到的?

最佳答案

如果您使用的是应用内结算版本 3,那么您只需使用 product id="android.test.purchased"。它是虚拟产品,您不应将其添加到您的开发人员控制台中。您可以免费购买该产品。

android.test.purchased

当您使用此产品 ID 发出应用内结算请求时,Google Play 会做出响应,就像您成功购买了商品一样。响应包括一个 JSON 字符串,其中包含伪造的购买信息(例如,伪造的订单 ID)。在某些情况下,JSON 字符串已签名并且响应包含签名,因此您可以使用这些响应测试您的签名验证实现。

希望对你有所帮助。

关于Android In App Billing...为什么会有矛盾的信息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17227985/

相关文章:

ios - 首次提交内购审核

ios - React Native IAP 自动续订订阅检查过期

android - 实现应用内结算

android - 通过单击浏览器链接触发 WhatsApp Intent

java - 如何查看Pocketsphinx词典中是否存在该单词?

android - 为什么在 Android Listeners 上使用 Wea​​kReference?

iphone - 在 iPhone 上进行应用内购买时强制用户登录

android - Proguard 与应用内购买 "Duplicate zip entry"错误

Android 应用内购买同一类型产品的多种类型订阅

android - 修改按钮中的文本 - if 语句