为什么Android BillingClient v2慢速信用卡测试永远不会取消? [英] Why Android BillingClient v2 slow credit card test never cancels?

查看:156
本文介绍了为什么Android BillingClient v2慢速信用卡测试永远不会取消?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为非消耗性应用内购买实现新的BillingClient库(v2.1.0). 我正在与测试用户一起测试未决交易.可以在几分钟后批准信用卡"的情况下正常工作,但是在慢速信用卡,几分钟后拒绝信用卡"的情况下,购买状态始终处于待处理状态(在Play控制台上显示为取消后,将等待数小时).

I am implementing the new BillingClient library (v2.1.0) for a non-consumable in-app purchase. I am testing pending transactions with a test user. It works fine with "Credit card approves after a few minutes", but with "Slow credit card, rejects after a few minutes" the purchase state is always pending (Waited for hours after it shows as canceled on Play Console).

为了获取购买状态,我以mBillingClient.queryPurchases(BillingClient.SkuType.INAPP) "noreferrer">文档

In order to retrieve purchae status, I am calling to mBillingClient.queryPurchases(BillingClient.SkuType.INAPP) as states in the documentation

以前有人遇到过这个问题吗?是开发环境问题,还是最终用户也会发生?

Has anybody come across this issue before? Is it a development environment problem or does it happen for final users as well?

谢谢!

推荐答案

我还在测试中发现,尽管我还记得使用过时的AIDL,我的应用程序用户花费了24小时才能验证购买.我考虑了可能会花几个小时才拒绝慢速卡的情况,并且我已执行以下操作:

I also discovered that in my tests, although I also remember that using the deprecated AIDL a user of my app took 24 hours to validate the purchase. I have considered the case of the refused slow card taking hours may occur and I have done the following:

如果为purchase.getPurchaseState() == Purchase.PurchaseState.PENDING,则显示一个对话框,显示:等待购买验证.有时可能会持续几个小时

If purchase.getPurchaseState() == Purchase.PurchaseState.PENDING then I show a dialog that says: Waiting for purchase validation. Sometimes it can last several hours

如果用户尝试再次购买该商品,然后单击billingResult.getResponseCode() == BillingClient.BillingResponseCode.ITEM_ALREADY_OWNED,则显示一个对话框,显示:无法购买该商品.您已经拥有它或先前的购买仍在等待验证

If the user tries to buy the item again and billingResult.getResponseCode() == BillingClient.BillingResponseCode.ITEM_ALREADY_OWNED then I show a dialog that says: Cannot buy the item. You already own it or a previous purchase is still pending for validation

希望这会有所帮助

这篇关于为什么Android BillingClient v2慢速信用卡测试永远不会取消?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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