检查的Andr​​iod购买状态,但返回购买令牌没有被发现 [英] Check andriod purchase status but return the purchase token was not found

查看:290
本文介绍了检查的Andr​​iod购买状态,但返回购买令牌没有被发现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我所指向谷歌Play中的Andr​​oid API 检查一个在应用项目的购买和消费状态。
对于一些订单,我能得到正确的结果,但一些返回如下错误:

I refered google play android api to check the purchase and consumption status of an in-app item. For some orders, I can get right result,but some return the error as below:

error: {
errors: [
{
domain: "global",
reason: "purchaseTokenNotFound",
message: "The purchase token was not found.",
locationType: "parameter",
location: "token"
}
],
code: 404,
message: "The purchase token was not found."
}

购买令牌是由谷歌提供的,它可以伪造?

Purchase token is provided by google, does it can be faked?

我发现,如果我取消订单谷歌,然后检查购买状态,它会返回购买令牌没有被发现。如果没有,我会得到正确的购买状态。

I found if I cancel the google order, then check the purchase status,it will return the purchase token was not found. if not, i will get the right purchase status.

希望有人可以提供帮助。

Hope somebody can help.

推荐答案

如果您在短期内出售相同应用程式内产品相同的用户muliple倍,那么它很可能是除最后一次购买所有的访问令牌将返回一个 404 code。

If you are selling the same INAPP product to the same user muliple times within a short period, then it's very likely that all access tokens except the last purchase will return a 404 code.

例如:

john@example.com 到您的应用程序并购买 com.example.test.product 几次,你将你的记录中probaly通知(或谷歌钱包商家帐户),它是同一个用户购买的产品。

john@example.com went to your app and purchased com.example.test.product a few times, you will probaly notice within your records (or Google Wallet Merchant account) that it's the same user buying the product.

当你去到该用户检查上次进货,再下面是可能出现

When you go to check the last purchase from this user, then the following is likely to appear

{
kind: "androidpublisher#inappPurchase",
purchaseTime: "1409823171827",
purchaseState: "0",
consumptionState: "1",
developerPayload: "My Product | Ref | 1409823162466"
}

,但如果你要检查他的previous令牌,那么它很可能是他的采购将返回的 404

我读的地方(不记得在哪里),对于每次购买产生购买令牌基本上是基于对应用程式内产品和谷歌用户。因此,它很可能每个收购将消灭,为相同的用户创建的任何previous购买令牌。

I had read somewhere (can't remember where) that the purchase token created for each purchase is basically based on the inapp product and google user. Therefore, it's very likely that each purchase will "destroy" any previous purchase token created for the same user.

希望这有助于解释。我一直有这个问题时,每天我的服务器尝试连接到谷歌API和检查交易。也许有一天,有人会读这一点,并提供了一​​个解决方案:)

Hope this explanation helps. I am constantly having this problem everyday when my server is attempting to connect to the Google API and check the transactions. Perhaps one day somebody will read this and provide a solution :)

这篇关于检查的Andr​​iod购买状态,但返回购买令牌没有被发现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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