Search Unity

Error in integrated purchases, please help!

Discussion in 'Unity IAP' started by lorenzostudiosok, Sep 27, 2021.

  1. lorenzostudiosok

    lorenzostudiosok

    Joined:
    Feb 3, 2020
    Posts:
    30
    Hello there,

    I have problems with in-game purchases, I am having strange behavior, I will comment on my test scenario:

    1. I do the tests both with an account declared as a Tester and also with end-user accounts and I get the same results.

    2. I have the project with Unity 2019.2.4f1 and Unity IAP 2.3.0 (I tried an older version of IAP 2.7, and the problem persists)

    3. I debug with AndroidLogcat and I get the results (which I detail below)

    4. On several occasions, starting the game, I can make the first purchase with a satisfactory result, but then it does not allow me to make any more purchases, it always gives the error "onPurchaseFailedEvent (productId: stunt3_specialoffer message: {M: GPUL.HEC} - Response Code = 6) "

    5. I have created the items manually in the Google console, and they are correct.

    6. The tests with the IAP example, I tested it and it responded ok, without errors.

    7. I also see that on some occasions, I want to buy an item a second time and it tells me that I have already bought it, but this item is defined so that it can be purchased indefinitely

    Attached here the error that gives me in the LOGcat:

    "
    09-27 14:12:25.865: I/Unity(22855): onPurchaseFailedEvent(productId:stunt3_specialoffer message: {M: GPUL.HEC} - Response Code = 6)
    09-27 14:12:25.865: I/Unity(22855): UnityEngine.Purchasing.PurchasingManager:OnPurchaseFailed(PurchaseFailureDescription)
    09-27 14:12:25.865: I/Unity(22855): System.Action:Invoke()
    09-27 14:12:25.865: I/Unity(22855): UnityEngine.Purchasing.Extension.UnityUtil:Update()
    09-27 14:12:25.865: I/Unity(22855):
    09-27 14:12:25.865: I/Unity(22855): (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    09-27 14:12:25.868: I/Unity(22855): IAPButton.OnPurchaseFailed(Product UnityEngine.Purchasing.Product, PurchaseFailureReason Unknown)
    09-27 14:12:25.868: I/Unity(22855): UnityEngine.Purchasing.IAPButton:OnPurchaseFailed(Product, PurchaseFailureReason)
    09-27 14:12:25.868: I/Unity(22855): UnityEngine.Purchasing.CodelessIAPStoreListener:OnPurchaseFailed(Product, PurchaseFailureReason)
    09-27 14:12:25.868: I/Unity(22855): System.Action:Invoke()
    09-27 14:12:25.868: I/Unity(22855): UnityEngine.Purchasing.Extension.UnityUtil:Update()
    09-27 14:12:25.868: I/Unity(22855):
    09-27 14:12:25.868: I/Unity(22855): (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    09-27 14:12:26.153: I/ViewRootImpl@762b8ca[UnityPlayerActivity](22855): MSG_RESIZED: frame=(0,0,2220,1080) ci=(0,0,126,0) vi=(0,0,0,0) or=2

    "

    Do you think what could be happening? if you need more information ask me.

    Thank you!
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you share a screenshot of your IAP Catalog settings for this product? And a screenshot of the same product as defined on your Google dashboard. Can you upgrade your Unity version and test with IAP 4.0.3? You can first try with Unity 2019.4
     
  3. lorenzostudiosok

    lorenzostudiosok

    Joined:
    Feb 3, 2020
    Posts:
    30
    Here I attach the captures

    This happens to me with several articles, it is not only this, and the error is the same.
    What I find strange is that only with some, let me buy at least 1 time, it's like the error is temporary or random.

    Console:
    upload_2021-9-27_15-16-54.png
    IAP:
    iap.PNG

    By testing with IAP 4.0.3, is the oldest compatible version of unity 2019.4?
     

    Attached Files:

  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    If the product is non-consumable as you have marked, the user can only purchase it once, like a subscription. Consumable products can be repurchased, like Gold Coins. Can you leave off the price in the catalog and/or define a pricing template?
     
  5. lorenzostudiosok

    lorenzostudiosok

    Joined:
    Feb 3, 2020
    Posts:
    30
    Yes, in this case this product should be able to be bought only once, it is correct as it is configured, but other products that are configured as consumables, on some occasions it happens randomly that indicates that I already bought it and I cannot buy again, the behavior is strange.


    Can you leave off the price in the catalog and/or define a pricing template?

    I don't understand your question, what do you mean? Sorry I'm from Argentina and with English I can make mistakes.

    The game has the prices defined in the IAP Catalog, but they are also defined in the Google Console, what do you need me to do?

    thsnks
     
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Delete the price you have shown in the IAP Catalog (99,99), just leave it blank. Otherwise you'll need to add the pricing template name. And please be specific, it would generally not occur randomly. If you have an error with a consumable product, please show the product information.
     
  7. lorenzostudiosok

    lorenzostudiosok

    Joined:
    Feb 3, 2020
    Posts:
    30
    remove some items from the price in the IAP catalog, leave the value blank, but the error persists, keeping the same version of Unity and IAP.

    Another strange behavior that I find is that, with two different email accounts, both are verifiers of the internal tests, with one I get a different behavior from the other, using the same game, from the same device, using the same credit card:

    lorenzotudiosok@gmail.com
    stunt3_nitro_40
    onPurchaseFailedEvent(productId:stunt3_nitro_40 message: {M: GPUL.HEC} - Response Code = 6)

    marianobozzone19@gmail.com
    stunt3_nitro_40
    onPurchaseFailedEvent(productId:stunt3_nitro_40 message: {M: GPUL.HEC} - Response Code = 7)

    I am even more confused

    I still have not been able to update the version of unity and IAP, because the project gives other errors.

    I attach an image of the consumable product and the messages they give me, in reference to the detail that happens to you from both accounts:

    upload_2021-9-28_16-29-22.png
    upload_2021-9-28_16-28-45.png

    What else can I do?
     
  8. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @lorenzostudiosok Unity IAP uses the user logged into the Play Store on the device, not just another email account on the phone. Where is the 1,49 price coming from in your screenshot? I had suggested to remove the price. Please do one test at a time as suggested, and attach the associated screenshot. Please start with the Sample IAP Project v2 (which uses Scripted IAP and not Codeless) and upgrade it to 4.0.3. Your first step is to upgrade IAP. If you are not able to upgrade without errors, then there is no need for further IAP testing, you'll likely continue to see the same issue. Let's get the basics working first. Have you set up the users for Licensed Testing as shown here? https://docs.unity3d.com/Packages/com.unity.purchasing@3.2/manual/UnityIAPGoogleConfiguration.html and https://forum.unity.com/threads/sample-iap-project.529555/#post-6950270
     
  9. lorenzostudiosok

    lorenzostudiosok

    Joined:
    Feb 3, 2020
    Posts:
    30
    @JeffDUnity3D Hi

    Update the game project and IAP version:
    Unity 2020.3.19f
    IAP 4.0.3


    I set up my email account, in License Proof, I can buy all the products correctly in the card mode "always approve", But when I try to do it with a real card, no, some items work initially, but then when the first one gives me an error, then I can't make more satisfactory purchases, they all give the error that I detail below

    10-04 17:25:55.706: W/Unity(18308): onPurchaseFailedEvent(productId:stunt3_notes_140_plus_coins message: {M: GPUL.HEC} - Response Code = FatalError)
    10-04 17:25:55.706: W/Unity(18308): UnityEngine.Purchasing.PurchasingManager:OnPurchaseFailed(PurchaseFailureDescription)


    upload_2021-10-4_17-18-59.png

    upload_2021-10-4_17-23-25.png

    could it be happening that a transaction is hanging or something like that?

    if I add you as an internal test user, I can make you see the debug in the game live, so you can see the behavior live.
     
  10. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    How are you testing with a "real card", did you set up a separate profile on your phone? How are you switching users?
     
  11. lorenzostudiosok

    lorenzostudiosok

    Joined:
    Feb 3, 2020
    Posts:
    30
    If I remove myself from here, when I go to make the tests of the purchases, I no longer see the test card, I see the card to make the actual purchases.

    upload_2021-10-4_20-5-6.png

    I use the same email, I also clarify that this is with the internal test version, but we have published a version in production (with unity 2019 and iap 2.30) where we also have errors with several users (I do not have the details of the errors.)

    What do you suggest I do? , the tests are correct?
     
  12. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    It looks like a store issue, the error mention there was an issue charging the payment method. I have not seen the error before. You might try using Scripted IAP instead of Codeless IAP.