Search Unity

consumable product already purchased

Discussion in 'Unity IAP' started by domdev, Mar 16, 2018.

  1. domdev

    domdev

    Joined:
    Feb 2, 2015
    Posts:
    260
    I have consumable product, 1st buy was success by in 2nd "product already purchased" why? its consumable where I can buy again and again.. any solution? also in PurchaseProcessingResult ProcessPurchase.. I have
    return PurchaseProcessingResult.Complete; after purchase
     
    Kiroxas likes this.
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,944
    I was just able to purchase a consumable product a second time on Android, using Unity 2017.3 and IAP 1.17. Please provide a screenshot of your product configuration in the Play store, and your purchase script.
     
  3. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    665
    JeffDUnity3D, this just happened to me in iOS, a user says that he purchased a consumable and never got the product and he gets the "This In-App Purchase has already been bought. It will be restored for free" message. Hasn't happened before and the game has been out there for around a month.

    My products are set in both Google Store and Apple Store as consumable. I am using Unity 2018.2.15f1 and the latest Unity Services IAP codeless api Apple_IAP_Setting.jpg IAP_Button_Settings.jpg .

    Attached is the image of my Apple Store IAP setting And the button using Codeless api. Wondering about the "Consume Purchase" should it be checked or not? Could that be the problem?

    Any help is very much appreciated.

    Regards,
    Carlos
     
  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,944
    @strongbox3d Yes, you should keep it checked. What are your methods for purchase success and fail? It currently has No Function in the screenshot, you should always handle these conditions. And if you haven't made any changes or releases to the game in a month, it is likely not a code issue. Does the user get the product after it says it will be restored for free? Did the user receive an updated Terms of Service popup from Apple by chance, during the purchase flow?
     
  5. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    665
    Hello JeffDUnity3D,

    I think I found the problem, I have the iap purchase fulfillment function in the product buttons within a canvas that users can close, so what happened was that the user closed the canvas before the purchase was completed.

    What I really wanted is to have an IAPListener in the scene to handle the purchases, but I can't figure out how to get the product from the OnPurchaseCompleted(product) in the IAPListener to tell my fulfillment function what product should be given to the user.

    Could you show me how should I go about getting the "(product") from the OnPurchaseComplete event in the IAPListener, so I can use it in my fulfillment function to give the right product to the player? I would appreciate it very much!

    Regards,
    Carlos
     
  6. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,944
    You could edit Assets/Plugins/UnityPurchasing/script/CodelessIAPStoreListener.cs. Look for the ProcessPurchase method, the product is contained in the e parameter. I'll check with the team here to see if there might be another way.
     
  7. Taninty

    Taninty

    Joined:
    Dec 22, 2013
    Posts:
    2
    My IAP button is enabled and it’s active ( including parent object even after transaction completed. But still I get an dialog states that Inapp already bought and on