简体   繁体   English

如何检测 Google 应用内结算的取消或退款订单?

[英]How to detect canceled or refunded order for Google in-app billing?

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.我有很多帖子和 Google 文档,但我仍然不清楚如何判断应用内购买已退款。 I have red carefully In-App Billing v3 - Don't detect refund and Does Google Play In-App Billing Version 3 support refunds?我小心红了In-App Billing v3 - 不检测退款Google Play In-App Billing Version 3 支持退款吗? . .

I believe that I took the following notes from an official Google document a while ago by copy & paste:我相信我在不久前通过复制和粘贴从 Google 官方文档中记下了以下笔记:

purchaseState: The purchase state of the order. purchaseState:订单的购买状态。 Possible values are 0 (purchased), 1 (canceled), or 2 (refunded).可能的值为 0(已购买)、1(已取消)或 2(已退款)。

Now, the official document has the following:现在, 官方文档有以下内容:

-> purchaseState: The purchase state of the order. -> purchaseState:订单的购买状态。 It always returns 0-它总是返回 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)?更具体地说,如果 IAB 购买被退款或取消,那是否仍在 mHelper.queryInventoryAsync(mGotInventoryListener) 获取的用户库存中? If so, how can one tell the purchase has been canceled or refunded?如果是这样,如何判断购买已被取消或退款?

Update [2019-12-12]:更新 [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 .如果订单在退款后被取消,它将从getPurchasesList返回的结果中消失。 The time it takes for this to happen varies.发生这种情况所需的时间各不相同。 It could be minutes to over 10 hours.可能是几分钟到 10 多个小时。 I think this depends on when Google Play refreshes its cache.我认为这取决于 Google Play 何时刷新其缓存。 It seems that one can open Google Play to refresh its cache.似乎可以打开 Google Play 来刷新其缓存。 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.在一种情况下, getPurchasesList在退款 10 多个小时后仍然返回了已退款的购买,但在 Google Play 一打开它就停止了退货。

Have you checked out the voided purchase list API?您是否查看了无效的采购清单 API? It returns a list of cancelled, refunded or charged-back purchases.它返回已取消、退款或退款的购买清单。

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

Scrape the Google Console.抓取 Google 控制台。 That's what I do.这就是我所做的。

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

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