Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to use Purchase.Subscription:acknowledge to acknowledge a subscription

​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.

like image 901
Kevin Tu Avatar asked Sep 17 '19 09:09

Kevin Tu


People also ask

How do you acknowledge in-app purchases?

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.


2 Answers

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

like image 122
Omkar C. Avatar answered Sep 19 '22 11:09

Omkar C.


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.

like image 21
mickeymoon Avatar answered Sep 18 '22 11:09

mickeymoon