Currently I use a server to receive GCP Pub/Sub messages, and I'd like to perform a Purchase.Subscriptions:acknowledge
call to acknowledge the subscription that has not been acknowledged as the server received the notification.
Here is the scenario ...
A user buy subscription A, which is 30-day-period, and then upgrade to 1-year-period.
On the server side, will receive the notification with the upgraded transaction when the 30-day-period subscription is about to be expired. As the server retrieve the information by using Purchase.Subscription:Get
you can see the acknowledgeState of this upgraded transaction is 0, so the server calls Purchase.Subscription:Acknowledge
to acknowledge this transaction, but the problem is it returns an error message saying "The subscription purchase not is owned by the use".
Here is what the error message looks like:
{
"error": {
"errors": [
{
"domain": "androidpublisher",
"reason": "subscriptionNotOwnedByUser",
"message": "The subscription purchase not is owned by the user."
}
],
"code": 400,
"message": "The subscription purchase not is owned by the user."
}
}
Does anyone have the same issue ?
The other information is that in the Android App, I set proration mode to DEFERRED
in the BillingFlowParams class, that is why I can't acknowledge the new transaction in the App immediately since the state of the new transaction is not yet been PURCHASED, I can only do the acknowledgement on the server side.
You can acknowledge a purchase by using one of the following methods: For consumable products, use consumeAsync(), found in the client API. For products that aren't consumed, use acknowledgePurchase(), found in the client API. A new acknowledge() method is also available in the server API.
If you're implementing Purchase.Subscription:Acknowledge
the Purchase object now includes an isAcknowledged()
method that indicates whether a purchase has been acknowledged. In addition, the server-side API now includes acknowledgement boolean values for Product.purchases.get()
and Product.subscriptions.get()
. Before acknowledging a purchase, be sure to use these methods to determine if the purchase has already been acknowledged.
How to integrate this is mentioned here
Have a look at links below, these might give you more information on this.
https://developers.google.com/android-publisher/api-ref/purchases/subscriptions/acknowledge
https://developers.google.com/android-publisher/api-ref/purchases/subscriptions/get
We were facing the same issue. We tried calling the acknowledgement API immediately after the user exercises the change of subscription in deferred mode, and also once the new subscription is activated at the store. In both the cases we were getting the same productNotOwnedByUser
error. Ultimately, 3 days later the subscription would be revoked owing to the lack of acknowledgement.
We contacted Google Support team and they have confirmed it is an issue on their side. They are also working on a fix for this. Meanwhile, they have disabled refunds for us, which means if the changed subscription is not acknowledged, it wouldn't be revoked but the user would continue to use the same. Although, I am not sure if they have enabled this specific to our account or globally.
Update: Google has confirmed they have fixed the issue and it is available now. We have tested and verified the same and it works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With