Closed jngbng closed 6 years ago
Hello
Thank you for reaching out. I will have a look at this!
Cheers
@jngbng
After looking into this response with 410
. It seems that Google is telling us the subscription is no longer valid. I think it should still be treated as an error.
If you think otherwise, would you please provide an example case where you would want this to be treated otherwise?
Cheers!
Hi, @voltrue2 - we just stumbled upon this in our production code (got 410 and mishandled it).
If 410 isn't to be treated as "end-of-subscription", perhaps small changes should still be made:
@jngbng @eranpolo My apologies for taking forever to get to this. I just added an error check for this case and now it returns a specific error when the library sees status 410 from Google.
Cheers!
@voltrue2 In my opinion, 'error' should be for exceptional cases which has nothing to do with business logic, such as network error or authentication errors. In this case, I think the response is not temporally unhandleable error and the subscription would not be logically valid for good. Therefore, we would better treat it as 'end-of-subscription' or another logically valid response (not an error). I wonder why google designed this way, though. :(
I'm just encountering this issue as I've only recently started querying older receipts (expired subscriptions). Do we not receive any data for expired subscriptions from Google? It would be very helpful to query data for older receipts.
Thoughts @voltrue2?
It seems there’s no way to query for expired receipts with Google at the moment. I will go through the documentation again to make sure I haven’t missed anything. In the meantime, do you think it helps to have a way of mass-validating receipts for expired receipts? Something like iap.areExpired(receipts)?
On Aug 15, 2018 at 16:11, <Anshul Koka (mailto:notifications@github.com)> wrote:
I'm just encountering this issue as I've only recently started querying older receipts (expired subscriptions). Do we not receive any data for expired subscriptions from Google? It would be very helpful to query data for older receipts.
Thoughts @voltrue2 (https://github.com/voltrue2) ?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub (https://github.com/voltrue2/in-app-purchase/issues/153#issuecomment-413113784), or mute the thread (https://github.com/notifications/unsubscribe-auth/ACKY4esN_SDYdnWlteRCREZZhQQ5mgx_ks5uQ8mmgaJpZM4R8B4l).
I verified the docs and you're right @voltrue2. I implemented a very hack way to retrieve expiration dates of old receipts. It's a bummer that Google won't provide us data on old receipts.
Regarding mass validation, my particular use case doesn't quite require it. Does Google expose an API to do this or are you considering a wrapper function? A wrapper function won't bring much value IMO as most developers should be able to accomplish this themselves.
Please refer to https://stackoverflow.com/questions/45688494/google-android-publisher-api-responds-with-410-purchasetokennolongervalid-erro