Search Unity

IAP doesn't restore to some people

Discussion in 'Unity IAP' started by darkyer, Sep 24, 2018.

  1. darkyer

    darkyer

    Joined:
    Sep 11, 2013
    Posts:
    21
    Hello everyone

    We are currently experiencing some issues with IAP, some people that bought a non-consumable ítem long time ago is not restored, for people that just bought it works fine.

    For people not working we are getting a PurchaseFailureReason DuplicateTransaction.



    Thanks
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please provide steps to reproduce if you can. What version of IAP are you using? When do you receive the Duplicate Transaction error?
     
  3. darkyer

    darkyer

    Joined:
    Sep 11, 2013
    Posts:
    21
    We are using IAP 2.0.3 and we get the error when the IAP try to restore
    Code (CSharp):
    1. nity   ( 4596):
    2. I/Unity   ( 4596): IAPButton.OnPurchaseFailed(Product UnityEngine.Purchasing.Product, PurchaseFailureReason DuplicateTransaction)
    3. I/Unity   ( 4596):
    4. I/Unity   ( 4596): (Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
    5. I/Unity   ( 4596):
    6. I/Unity   ( 4596): PURCHASE FAILED
    7. I/Unity   ( 4596):
    8. I/Unity   ( 4596): (Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
    9. I/Unity   ( 4596):
    10. E/Unity   ( 4596): NullReferenceException: Object reference not set to an instance of an object
    11. E/Unity   ( 4596):   at UIRemoveAdsGameplay.OnDisable () [0x00000] in <filename unknown>:0
    12. E/Unity   ( 4596): UnityEngine.GameObject:SetActive(Boolean)
    13. E/Unity   ( 4596): UIRemoveAdsGameplay:ClosePopup()
    14. E/Unity   ( 4596): PurchaseManager:DisappearPopUp()
    15. E/Unity   ( 4596): PurchaseManager:BuyLifeAmmo()
    16. E/Unity   ( 4596): PurchaseManager:FailedToRestore(Product, PurchaseFailureReason)
    17. E/Unity   ( 4596): UnityEngine.Events.InvokableCall`2:Invoke(Product, PurchaseFailureReason)
    18. E/Unity   ( 4596): UnityEngine.Events.UnityEvent`2:Invoke(Product, PurchaseFailureReason)
    19. E/Unity   ( 4596): UnityEngine.Purchasing.IAPButton:OnPurchaseFailed(Product, PurchaseFailureReason)
    20. E/Unity   ( 4596): UnityEngine.Purchasing.CodelessIAPStoreListener:OnPurchaseFailed(Product, PurchaseFailureReason)
    21. E/Unity   ( 4596): UnityEngine.Purchasing.StoreListenerProxy:OnPurchaseFailed(Product, PurchaseFailureReason)
    22. E/Unity   ( 4596): UnityEngine.Purchasing.PurchasingManager:OnPurchaseFailed(PurchaseFailureDescription)
    23. E/Unity   ( 4596): UnityEngine.Purchasing.JSONStore:OnPurchaseFailed(PurchaseFailureDescription, String)
    24. E/Unity   ( 4596): UnityEngine.Purchasing.JSONStore:OnPurchaseFailed(String)
    25. E/Unity   ( 4596): UnityEngine.Purchasing.<>c
    26. I/Unity   ( 4596): Purchase: Free Life and Ammo!
    27. I/Unity   ( 4596):
    28. I/Unity   ( 4596): (Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
    29. I/Unity   ( 4596):
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Is only the Restore functionality not working for this set of users? Do other purchases work OK? Is this on iOS or Android?
     
  5. darkyer

    darkyer

    Joined:
    Sep 11, 2013
    Posts:
    21
    this is Android , purchasing is fine, the problem is the restore, some users didn't report any issue (users that bought recently), but users that bought it some time ago faced this error
     
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Did you generate the log yourself (which means you can reproduce)? Also, I believe I know the what the issue is and which should be addressed in the next IAP release in a few weeks. Also, the IAP plugin version is located in the changelog file in Assets/Plugins/UnityPurchasing, 2.0.3 is the Package Manager version (confusing, we know)
     
  7. darkyer

    darkyer

    Joined:
    Sep 11, 2013
    Posts:
    21
    The log is from one of my coworkers(we can reproduce it), specially in my case it works fine

    the version then is: 1.21.0
     
  8. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you try with IAP 1.19 or 1.20? What is different between your configuration and your co-workers?
     
  9. darkyer

    darkyer

    Joined:
    Sep 11, 2013
    Posts:
    21
    I'll try 1.20 and 1.19, but do you have the package for the 1.19?, I checked the sticky post of older versions but didn't find the 1.19
     
  10. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please try with 1.20 and report your findings, however I suspect you will need to wait for the update regardless.
     
  11. darkyer

    darkyer

    Joined:
    Sep 11, 2013
    Posts:
    21
    I'll try this and let you know what happened, Thanks for the time
     
  12. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Also, please try to determine what is different between the two devices that behave differently. I suspect the answer is in there.
     
  13. unityjingyao

    unityjingyao

    Unity Technologies

    Joined:
    Feb 20, 2017
    Posts:
    220
    Hi,
    I saw 'IAPButton' in your log, so I think that you're using Codeless IAP.

    For Google Play, it's an expected behavior that IAPButton.onPurchaseFailed will be fired with a reason of 'PurchaseFailureReason.DuplicateTransaction' when you try to buy an already-owned Non-Consumable product.

    And Non-Consumable and Subscription products will be restored automatically after a re-installation. In this case,
    IAPButton.onPurchaseComplete will be fired. So Non-Consumable products should be restored in IAPButton.onPurchaseComplete callback.

    When you got a 'PurchaseFailureReason.DuplicateTransaction' in IAPButton.onPurchaseFailed callback, please check the status of the Non-Consumable product:
    • If the Non-Consumable product has already been restored, you don't need to do anything.
    • If it's still locked, you should unlock it again.