在Google Play中测试非易耗品IAP项目 [英] Testing non-consumable IAP items in Google Play

查看:681
本文介绍了在Google Play中测试非易耗品IAP项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是Google Play IABv3,希望能够轻松测试自己的操作(并不令人意外)。由于IABv3所有项目都是托管的,它取决于应用程序使用它认为是耗材的项目。



我不确定预期的工作流程对于非测试 - 可供产品。为了能够多次测试购买流程,您需要能够删除以前的购买。然而,购买的目的是非消耗性的,所以我们显然不想添加任何消耗它的代码(因为它可能会意外地漏过并删除真正的用户购买)。



我想用某种方式从购买中清除测试用户帐户,我怀疑这是可能的,因为没有真正的测试用户。



什么是建议如何做到这一点?

解决方案

您可以使用测试产品ID而不是实际项目。请记住仅在调试版本中使用它。



https://developer.android.com/google/play/billing/billing_testing.html


android.test.purchased



当您以
此产品ID制作应用内结算请求时,Google Play会像您成功
购买了一件物品。该响应包含一个JSON字符串,其中包含
的假购买信息(例如,伪订单ID)。在一些
的情况下,JSON字符串被签名,并且响应包含
签名,因此您可以使用这些响应来测试签名验证实现


android.test.canceled

b $ b使用此产品ID的结算请求Google Play会回复,因为购买的
已被取消。在订单处理过程中遇到
错误(例如无效信用卡),或者
在收取用户订单之前取消订单时可能会发生这种情况。

android.test.refunded



使用此产品ID的Google Play
的应用内结算请求会回复,就好像该退款一样。退款不能是通过Google Play的应用内结算服务启动的
。退款必须由您(商家)发起
。在您通过Google电子钱包商家帐户处理退款请求
后,退款消息会通过Google Play发送给您的应用程序
。只有当Google Play
从Google电子钱包获得退款时,才会发生这种情况。有关
更多退款信息,请参阅处理IN_APP_NOTIFY消息
和应用内结算定价。


android.test.item_unavailable



当您制作应用内结算请求此产品ID后,Google Play
会回应您所购买的商品未列入您的
应用商品列表中。



I'm using Google Play IABv3 and want to be able to easily test what I do (not surprisingly). Since IABv3 all items are managed and it's up to the application to consume the items that it considers consumables.

I'm not sure what the expected work flow is with testing non-consumable products. To be able to test the purchase flow more than once you need to be able to remove the previous purchase. However, the purchase is intended to be non-consumable so we obviously don't want to add any code that consumes it (since it could accidentally slip through and remove real users purchases).

I would like some way of clearing a test users account from purchases, which I doubt is possible since there is no "real" test users.

What is the suggested way to do this?

解决方案

You can use test product IDs instead of real items. Remember to use it only in debug builds.

https://developer.android.com/google/play/billing/billing_testing.html

android.test.purchased

When you make an In-app Billing request with this product ID, Google Play responds as though you successfully purchased an item. The response includes a JSON string, which contains fake purchase information (for example, a fake order ID). In some cases, the JSON string is signed and the response includes the signature so you can test your signature verification implementation using these responses.

android.test.canceled

When you make an In-app Billing request with this product ID Google Play responds as though the purchase was canceled. This can occur when an error is encountered in the order process, such as an invalid credit card, or when you cancel a user's order before it is charged.

android.test.refunded

When you make an In-app Billing request with this product ID, Google Play responds as though the purchase was refunded. Refunds cannot be initiated through Google Play's in-app billing service. Refunds must be initiated by you (the merchant). After you process a refund request through your Google Wallet merchant account, a refund message is sent to your application by Google Play. This occurs only when Google Play gets notification from Google Wallet that a refund has been made. For more information about refunds, see Handling IN_APP_NOTIFY messages and In-app Billing Pricing.

android.test.item_unavailable

When you make an In-app Billing request with this product ID, Google Play responds as though the item being purchased was not listed in your application's product list.

这篇关于在Google Play中测试非易耗品IAP项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆