Null receipt but valid purchase [Android]

Hi there,

we are having an issue with some payments successfully completing while Unity IAP returns a null receipts with PurchaseFailureReason.Unknown.

We are able to reproduce it (while not often, it’s very hard) with the following procedure:

  • Start purchase
  • Go though google play checkout
  • Disconnect the phone just before google processes the payment, it yields a success
  • Unity generates the aforementioned error

Even if we restart the phone the purchase is gone and is not recoverable, is there a way to force a restore?

When this happens we get the following error:

2020-03-17 10:22:01.072 30305-30305/? I/UnityIAP: onActivityResult
2020-03-17 10:22:01.072 30305-30305/? I/UnityIAP: Purchase data: null
2020-03-17 10:22:01.072 30305-30305/? I/UnityIAP: Data signature: null
2020-03-17 10:22:01.072 30305-30305/? I/UnityIAP: Purchase canceled - Response: 2:Unknown
2020-03-17 10:22:01.073 30305-30305/? I/UnityIAP: onIabPurchaseFinished: false
2020-03-17 10:22:01.073 30305-30305/? I/UnityIAP: 2:Unknown (response: 2:Unknown)
2020-03-17 10:22:01.073 30305-30305/? I/UnityIAP: Purchase response code:2
2020-03-17 10:22:01.119 1318-9294/? E/ActivityTrigger: activityResumeTrigger: not whiteListedcom.mola.playspace.android.bingo/com.playspace.common.PSUnityActivity/662
2020-03-17 10:22:01.120 1318-9294/? E/ActivityTrigger: activityResumeTrigger: not whiteListedcom.mola.playspace.android.bingo/com.playspace.common.PSUnityActivity/662
2020-03-17 10:22:01.231 30305-30374/? I/Unity: onPurchaseFailedEvent({0}): com.playspace.bingo.coins_pack_a_1_2
UnityEngine.Purchasing.PurchasingManager:OnPurchaseFailed(PurchaseFailureDescription)
UnityEngine.Purchasing.JSONStore:OnPurchaseFailed(PurchaseFailureDescription, String)
System.Action:Invoke()
UnityEngine.Purchasing.Extension.UnityUtil:Update() (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 48)

Thanks in advanced.

Kind regards

Can you see the transaction ID of this purchase in the Google Play Console? Also, please try clearing Google Play’s cache to see if you can restore the purchase.

Yes we can see the transactionID in our google play console, that was the way to award the user with the reward from our backend.

I will ask QA to clear the cache but that is not a very good solution to tell our users. Is there a way to restore purchases in that case so could verify them again with our backend? Having a list of all purchases from GPlay would be enough to check on our backend the state of each of them.

The current workaround is to clear the Google Play cache. This issue seems related to the IAP restore issue, which was confirmed as a Google Play bug.
https://discussions.unity.com/t/737714 page-5#post-5573119

For now we got some user feedback plus a direct contact button with our customer support to resolve any missing cases.

1 Like