Trying to cancel an Android test subscription gives me a 500 response code

喜夏-厌秋 提交于 2019-12-10 10:39:51

问题


I have an Android app with in-app subscriptions.

While testing, I used a google account to "buy" a test subscription - the ones that last for 24 hours and don't incur in actual billing. It worked fine a few times, but my last "purchase" is stuck and I can't cancel it.

When I try cancelling it via Google Play store, either the app or the website, I get these extremely unhelpful error messages: "An unexpected error occurred. Please try again later".

When I try cancelling it via Google Play Developers API (https://developers.google.com/android-publisher/api-ref/purchases/subscriptions/cancel) it just returns a 500 HTTP response code and no messages.

That subscription has been active for over a month. It renews itself every 24 hours and seems like it will never stop.

Also, the getPurchases() method returns me the subscription ID in the INAPP_PURCHASE_ITEM_LIST array, but its corresponding item in the INAPP_PURCHASE_DATA_LIST array is completely empty. There's no orderId, no purchaseToken, nothing. And I don't mean these fields are null or empty strings. I mean they aren't even listed in the JSON array.

Unfortunately this is happening on my main Google account. So now, every time I need to test something related to subscriptions in my app, I need to remove my main account from my device and use another Google account. Otherwise, my app will try to load this bugged subscription and give an error. It's very annoying.

Has anyone experienced this before? Any ideas how to make this test subscription disappear for good?

P.S.: I tried posting this on the official Android Developer forums, but the moderators seem to have either rejected my post or they haven't got around to it yet. It's been a month, though.

来源:https://stackoverflow.com/questions/32725519/trying-to-cancel-an-android-test-subscription-gives-me-a-500-response-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!