Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Null receipt but valid purchase [Android]

Discussion in 'Unity IAP' started by playspace_seat3, Mar 23, 2020.

  1. playspace_seat3

    playspace_seat3

    Joined:
    May 24, 2017
    Posts:
    1
    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:
    1. Start purchase
    2. Go though google play checkout
    3. Disconnect the phone just before google processes the payment, it yields a success
    4. 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
     
  2. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    600
    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.
     
  3. mWundke

    mWundke

    Joined:
    Aug 30, 2017
    Posts:
    3
    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.
     
  4. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    600
    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://forum.unity.com/threads/iap-restore-issues-android.653608/page-5#post-5573119
     
  5. mWundke

    mWundke

    Joined:
    Aug 30, 2017
    Posts:
    3
    For now we got some user feedback plus a direct contact button with our customer support to resolve any missing cases.
     
    SamOYUnity3D likes this.