Search Unity

How should I deal with PurchaseFailureReason.DuplicateTransaction error?

Discussion in 'Unity IAP' started by _____nakj, Oct 22, 2018.

  1. _____nakj

    _____nakj

    Joined:
    Jan 24, 2015
    Posts:
    7
    Hello,

    When my app user tries to purchase a consumable item, "PurchaseFailureReason.DuplicateTransaction" error occurs.
    It appears every try to purchase. I hope to remove it.

    * Restart the app.
    * Restart the device.
    * Reinstall the app.
    * Clear Google Play store cache.

    We tried above actions but not to be improved.
    How should I deal with PurchaseFailureReason.DuplicateTransaction error?
    Should I finish the duplicated transaction obviously? If so how can I do that?
    It's happening on user's device so I can't get any more details for now.

    Thank you.
    ---
    Platform: Android OS 7.0 / API-24 (HUAWEIVNS-L22/C635B390)
    Unity version: 2017.4.5f1
    UnityIAP version: 1.16.0
    Store: Google play store

    Attached IAPManager.cs is my purchase system code based on Unity's sample.
     

    Attached Files:

  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please test with IAP 1.20.1. Keep in mind that you are likely returning Pending from ProcessPurchase. Unless you subsequently call ConfirmPendingPurchase, you would expect to see DuplicateTransaction next time you tried to purchase this product.
     
  3. _____nakj

    _____nakj

    Joined:
    Jan 24, 2015
    Posts:
    7
    Thank you very much!
    I'll try it.