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

Core 2.2.2 and IAP 2.2.7 - Purchases appear as non-consumables on Android

Discussion in 'Unity IAP' started by eladleb4, Feb 11, 2021.

  1. eladleb4

    eladleb4

    Joined:
    Apr 25, 2016
    Posts:
    57
    Just updated and the purchase I made for a consumable appears as non-consumable showed: "you already own this item".

    After restarting the app it seemed to be running ok.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Don't change product types once you create a product. Use a new product. Otherwise please clarify your statement with steps to reproduce.
     
  3. eladleb4

    eladleb4

    Joined:
    Apr 25, 2016
    Posts:
    57
    We never changed product types (they are all consumables).

    This happened immediately after the update from a previous IAP version (2.2.1 & 1.22.0) on device.
    After I restarted the app, purchases were working correctly again.
     
  4. John_Corbett

    John_Corbett

    Unity Technologies

    Joined:
    May 17, 2019
    Posts:
    151
    Hi @eladleb4,

    Just to clarify, are you automatically consuming your (consumable) purchases? There is a way of coding it so that it doesn't automatically consume them.

    Please provide us with more information on your implementation and include some logs so that we can help identify your problem.
     
  5. eladleb4

    eladleb4

    Joined:
    Apr 25, 2016
    Posts:
    57
    @John_Corbett
    Unfortunately it seems that many of our players are now encountering this issue where the IAP is marked as non-consumable. The game has been live for 2 years and this error started happening right after the update to the latest version.

    I'm happy to share the IAP manager code asap, let me know how to do it.
     
  6. eladleb4

    eladleb4

    Joined:
    Apr 25, 2016
    Posts:
    57
    @John_Corbett @JeffDUnity3D
    We are also seeing way more incorrect Product.transactionID... So instead of GPA.XXX.XXXX
    we are seeing " jmlhhdppfdaaekhdfdehcgmb.AO-J1OxATc6UMKdXlb_c489hatdKYgcPv6Mbn-D8sDrNXlRW1KStBThW2v94nrsqw_V3-XXXXXXXXX-XXXXXX"
     
  7. eladleb4

    eladleb4

    Joined:
    Apr 25, 2016
    Posts:
    57
    So to summarize we saw a few different errors when using the latest version, so we had to revert back to our previous setup.

    Error #1: Google play recognizes a product as non-consumeable and the purchase fails but the customer is getting charged.

    Error #2: The developer payload we were getting from the receipt is NAN.

    Error #3: The transaction id is not GPA.XXXX.XXX but a different string (unsure if this is directly related but it happens more in new version).
     
  8. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please provide steps to reproduce. Also, show how you are defining your products in your script as Consumable products. Also, we are using purchaseToken now instead of TransactionID, that's why they look different.
     
  9. eladleb4

    eladleb4

    Joined:
    Apr 25, 2016
    Posts:
    57
    @JeffDUnity3D
    For the non-consumeable issue, here is what we know:
    - Update the app from a previous version (core 2.2.1 & 1.22.0) to the latest.
    - Try and make a purchase.
    - A product will be recognized as a non-consumeable and will not be processed correctly.
    - The request will not get to our server for receipt validation.
    - Sometimes Google will automatically refund a player for this invalid purchase and sometime they won't.

    For the NAN dev payload and incorrect transaction id issue, this is inconsistent but happens a lot more with the latest versions. After trying out multiple devices it will usually happen. Here is what we know:

    - Happens to both new installs and to updated ones. It happened in the past (1/50 or 1/100 times) but it happens much more with the latest version.

    - The request gets to our server but cannot be validated at the receipt appears invalid. After reopening the app and IAP inits again, we get the correct data for the process purchase and the server successfully validates the receipt.

    Attached a reduced file of our IAP management process (client).

    Finally, after reverting back to core 2.2.1 & 1.22.0, purchases are working correctly again.
     

    Attached Files:

  10. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you elaborate "A product will be recognized as a non-consumeable", where are you seeing this? A consumable will also show "You already own this item" if the previous purchase is not complete. Indeed, you are returning Pending from ProcessPurchase.
     
  11. eladleb4

    eladleb4

    Joined:
    Apr 25, 2016
    Posts:
    57
    Yes, I mean that the player will get this message.
    We don't have any non-consumable items aside from a subscription which is irrelevant here.
    The first time we saw this issue was after updating to the latest version.

    We never saw a consumable showing this message before though so I figured it was acting as a non-consumeable, I didn't know that a consumeable will show it if you are in the process as we've never seen this happen before.

    upload_2021-2-16_18-27-49.png
     
  12. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    That would be expected if you return Pending from ProcessPurchase and if you don't clear the Pending flag via ConfirmPendingPurchase. The next purchase attempt for this product will give you this message. You should see a ProcessPurchase triggered for all products still in Pending during IAP Initialization.
     
    Last edited: Feb 16, 2021
  13. eladleb4

    eladleb4

    Joined:
    Apr 25, 2016
    Posts:
    57
    Just to be clear, did you mean ConfirmPendingPurchase ?
     
  14. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Sorry, yes
     
  15. eladleb4

    eladleb4

    Joined:
    Apr 25, 2016
    Posts:
    57
    Got it, we will be investigating if we skipped a confirm pending purchase with the latest version.
    @JeffDUnity3D any thoughts on the incorrect transaction id issue? Should I start a new thread regarding this?
     
  16. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
  17. eladleb4

    eladleb4

    Joined:
    Apr 25, 2016
    Posts:
    57