Problem with Unity IAP android subscription

Hello.
Actually i’m working on a mobile game, and i’m using IAP for subscriptions, what i’m figuring out is that in case i buy one month of subscription, then i pause it, and inside the game i buy 3 months, i’m able to buy it, so i’ll end with double subscriptions, there is a way to see if it’s paused or not?

Hi, there!

There isn’t a dedication feature for checking whether or not a subscription has been paused. However, you can use the Subscription Manager/getSubscriptionInfo to check the expiration date which is a helpful way to gain insights into the status of a subscription.

By keeping an eye on the expiration date, you’ll be able to determine the remaining active period of the subscription and understand whether the payment has been temporarily halted.

thank for your help!
actually in case is paused i’m not able to get the recipt with
“product.hasReceipt” where product is got from " controller.products.all "
and controller is “IStoreController”

is this a bug?

To be more clear here and give you a better understand of what i’m doing, well our game need a subscription to be played, you can buy it on google play store or in app, if you buy it on google play store and pause it this part of code will fail

        foreach (Product product in controller.products.all)
        {
#if UNITY_ANDROID
            if(product.hasReceipt == false)
            {

                isCheckOK = CheckReceiptOfGoogle(product.receipt);
            }
#elif UNITY_IOS
            isCheckOK = CheckReceiptOfApple(product.receipt);
#endif

            if (isCheckOK == true)
            {
                SubscriptionManager p = new SubscriptionManager(product, null);
                SubscriptionInfo info = p.getSubscriptionInfo();


                CheckSubscriptionInfo(info);
                break;
            }
        }

exactly fails on product.hasReceipt that will return false, but if i resume it from the paused state, then, it will be true…
i’m missing something here?

Hi,

Thank you for bringing the subscription state issue to our attention and sorry for the inconvenience. I have spoken with the rest of the team and we currently do check for the subscription state. However, we do not currently support the SUBSCRIPTION_STATE_PAUSED status in the subscriptionsv2 in the following link.

About subscriptions  |  Google Play's billing system  |  Android Developers.

I recommend reviewing the table in the provided link to determine which subscription statuses will show up as active when initializing IAP (under BillingClient.queryPurchasesAsync()) :

As noted, subscriptions that are paused are not returned on initialization. If data is being tied to a specific user then perhaps there may be a workaround that would involve keeping a history of subscriptions the user purchased in the past and saving the expiration dates before cancelled.

thank you for your help really appreciated.
actually, how we could get those information about the user logged in?

@funmirko You would want to implement a login / authentification system to retrieve the player ID for the current user, save the purchase receipts (transaction IDs) on a server and match that with the player ID to build a user inventory. This way, the user can always requests their current purchase inventory when logging in.

#AD I am offering a cloud service for this use case - the Receipt Validator Service. Not only does it validate the IAP receipts on the server by sending it to Apple/Google (the most secure way to validate purchases), it also automatically creates a user inventory for them, where you have access to the products and expiration dates in case of subscriptions. So, it will allow you to display the next renewal or expiration date in-game.