2017-08-15 37 views
2

在收到訂購狀態響應(https://developers.google.com/android-publisher/api-ref/purchases/subscriptions/get)API與谷歌Android出版商API與「410 purchaseTokenNoLongerValid」錯誤

{ 
    "error": { 
    "errors": [ 
     {  
     "domain": "androidpublisher",  
     "reason": "purchaseTokenNoLongerValid",  
     "message": "The purchase token is no longer valid." 
     } 
    ], 
    "code": 410, 
    "message": "The purchase token is no longer valid." 
    } 
} 

我找不到「purchaseTokenNoLongerValid」提及任何響應或「購買令牌沒有在Android發佈程序API的情況下,無論是在文檔中還是在Google搜索中,「更有效」。

我能猜到這是什麼錯誤意味着,但更好的確切地知道,反正,我應該與此錯誤後,認購呢?

回答

-1

看起來像當用戶從谷歌帳戶更改其密碼或刪除帳戶購買令牌被撤銷。然後這個錯誤將在每個請求中返回。

這裏的原因的OAuth2令牌列表 - https://developers.google.com/identity/protocols/OAuth2#expiration,但我覺得這是完全一樣的情況。

  • 用戶已取消訪問。
  • 令牌未使用六個月。
  • 用戶更改密碼,令牌包含Gmail作用域。
  • 用戶帳戶已超過一定數量的令牌請求。
+0

這不是OAuth2用戶錯誤和令牌不涉及OAuth2令牌。 – Blago

+0

我沒有說它是OAuth2令牌,我說它可以是「相同的情況」。 – ksimka

1

我認爲谷歌剛剛更新了自己的API,並開始與響應狀態代碼410給未更新的很長一段時間(沒有訂閱續訂)與購買令牌的請求。所以他們肯定100%認爲用這種令牌的訂閱不會被更新。

所以,這是一個好消息,因爲現在你能檢測出這種購買令牌,不把它們發送到驗證可言,如果你以前做過。

0

我從谷歌官方迴應Play支援小組關於此錯誤:

I took a look and the order ID you provided is associated with an account that has now been deleted. This is why it does not pass verification. This is a good example of the licensing system working as intended.

You may feel free to simply ignore this subscription.

而另一封電子郵件後,我詢問更多細節:

Technically, the subscription is still active even though it's not attached to an account - hence, it does not show as cancelled. We're aware it's confusing not to receive a clear message about the account's status and just get an error back, though. This is an area of our product we're still actively working on.

What you can do is use the API to revoke the subscription, which is fine to do now that you have confirmation that the account is gone. Then it will read as cancelled and will no longer throw an error when making an API call.