Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved How to clear all purchase records?

Discussion in 'Unity IAP' started by letuantam96, Nov 20, 2022.

Thread Status:
Not open for further replies.
  1. letuantam96

    letuantam96

    Joined:
    Feb 6, 2020
    Posts:
    9
    Hi all,
    I am trying to clear all purchase records on NonConsumable product for testing purpose. On Android, whenever I clear app data, all NonConsumable product auto invoke ProcessPurchase() method. What I want is a button that clear all purchase records and NonConsumable not return after that. But after several try, it just not worked.
    What method I tried so far:
    Code (CSharp):
    1. UnityPurchasing.ClearTransactionLog();
    Code (CSharp):
    1.  
    2. try
    3.         {
    4.             var purchasingDataPath = Path.Combine(Path.Combine(Application.persistentDataPath, "Unity"), "UnityPurchasing");
    5.             Directory.Delete(purchasingDataPath, true);
    6.         }
    7.         catch (System.Exception e)
    8.         {
    9.             Debug.LogError($"ClearTransactionLog fail with exception {e}");
    10.         }
    Any help will be appreciated.
    Thank you!
     
  2. letuantam96

    letuantam96

    Joined:
    Feb 6, 2020
    Posts:
    9
    Still not solved...
     
  3. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    626
    letuantam96 likes this.
  4. letuantam96

    letuantam96

    Joined:
    Feb 6, 2020
    Posts:
    9
    Thanks. Turn out it 's not possible to reset all purchase record for test account.
    I ended up use different account for testing purpose.
     
  5. Arnaud_Gorain

    Arnaud_Gorain

    Unity Technologies

    Joined:
    Jun 28, 2022
    Posts:
    178
    This thread is now closed. Feel free to reach out via a new thread if you encounter further issues.
    Thanks!
     
Thread Status:
Not open for further replies.