如何检测Google应用内结算中已取消或已退款的订单? [英] How to detect canceled or refunded order for Google in-app billing?

查看:1086
本文介绍了如何检测Google应用内结算中已取消或已退款的订单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有很多帖子和Google文档都是红色的,但仍不清楚如何告知应用内购买已退款.我已经仔细地​​应用内结算v3-未检测到退款 Google Play应用内结算版本3是否受支持退款吗?.

我相信我是在不久前通过复制& ;;从Google的正式文档中获得以下注释的:粘贴:

purchaseState:订单的购买状态.可能的值为0 (已购买),1(已取消)或2(已退款).

现在,官方文档具有以下内容:

-> PurchaseState:订单的购买状态.它总是返回0-

(已购买).

更具体地说,如果退款或取消了IAB购买,则mHelper.queryInventoryAsync(mGotInventoryListener)是否仍将其保留在用户的库存中? 如果是这样,该如何告知购买已被取消或退款?

更新[2019-12-12]:

我已经测试了很多次,并确认了以下内容:

如果订单在退款后被取消,它将从 getPurchasesList 退款后十多个小时仍退还了退款的商品,但是打开Goog​​le Play后,该商品就不再退还.

解决方案

您是否签出了无效的购买清单API?它返回已取消,退款或退款的购买清单.

https://developers.google.com/android -publisher/api-ref/purchases/voidedpurchases/list

I have red a lot of posts and Google documents, but am still not clear how to tell an in-app purchase has been refunded. I have red carefully In-App Billing v3 - Don't detect refund and Does Google Play In-App Billing Version 3 support refunds?.

I believe that I took the following notes from an official Google document a while ago by copy & paste:

purchaseState: The purchase state of the order. Possible values are 0 (purchased), 1 (canceled), or 2 (refunded).

Now, the official document has the following:

-> purchaseState: The purchase state of the order. It always returns 0-

(purchased).

More specifically, if an IAB purchase is refunded or canceled, is that still in the user's inventory obtained by mHelper.queryInventoryAsync(mGotInventoryListener)? If so, how can one tell the purchase has been canceled or refunded?

Update [2019-12-12]:

I have tested many times and confirmed the following:

If an order is canceled after refunding, it will disappear from the results returned by getPurchasesList. The time it takes for this to happen varies. It could be minutes to over 10 hours. I think this depends on when Google Play refreshes its cache. It seems that one can open Google Play to refresh its cache. In one case, getPurchasesList still returned a refunded purchase more than 10 hours after refunding, but it stopped returning it as soon as Google Play is opened.

解决方案

Have you checked out the voided purchase list API? It returns a list of cancelled, refunded or charged-back purchases.

https://developers.google.com/android-publisher/api-ref/purchases/voidedpurchases/list

这篇关于如何检测Google应用内结算中已取消或已退款的订单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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