Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

IAP Android with refunds

Discussion in 'Unity IAP' started by drizztfun, Apr 8, 2018.

  1. drizztfun

    drizztfun

    Joined:
    Jul 2, 2013
    Posts:
    25
    hello,

    i am having a problem with refunds on android test purchases. I strongly suspect the problem to be on google side, but maybe somebody has some idea:

    1. Release on alpha/beta channel, with not consumable product. Assigned Testbuyer, License testing : respond_normally
    2. Install app, Buy item, in app : .hasreceipt
    3. Issue refund, status at google : refunded
    4. IAP says i still own the item
    5. wait 24h+ : same result, still owned
    6. use adb shell pm clear com.android.vending -> NOT owned, but trying to purchase will say "Duplicate Transaction"
    7. after some minutes IAP will say again i own it, even its clearly refunded...

    If i check the receipt, it will say "purchasestate : 0".. meaning purchased

    To me it looks like unity IAP is working well, but google keeps telling my device that the item is owned...
    Could anybody direct me to a solution to this? Because i cannot purchase the item anymore for testing the process unless i keep making new products...

    - Unity 2018.1.0b12
    - IAP 1.18.0
    - HTC U11, Android 8, Stock rom, no root
    - used google account for purchasing is registered as tester, but not same like publisher account

    Apr 6 2018 21:18:51 UTC+2
    Payment pending
    Google received a new order.

    Apr 6 2018 21:18:51 UTC+2
    Chargeable
    The customer's form of payment was authorised for €0.00 and passed all risk checks. (Expires Friday, 13 April 2018 12:18:51 o'clock PDT).

    Apr 6 2018 21:23:52 UTC+2
    Charged
    The customer's form of payment was successfully charged for €0.00.

    Apr 7 2018 16:21:37 UTC+2
    Refunding
    A refund of €1.99 was initiated on this order. Reason: buyer's remorse.

    Apr 7 2018 16:26:37 UTC+2
    Refunded
    Google processed your request and applied a refund of €1.99 to this order.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,130
    I suspect this is behavior in the Google test environment, but I will check with others in the IAP team.
     
  3. kobyle

    kobyle

    Joined:
    Feb 23, 2015
    Posts:
    88
    It started to happen to me too after switching from iAP 1.16.0 to 1.18.0 so maybe it does have to do with the Unity api?
     
  4. drizztfun

    drizztfun

    Joined:
    Jul 2, 2013
    Posts:
    25
    I moved to production release with my game.
    The issue still persists sadly..
     
  5. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,130
    @drizztfun In Step 4 above, "IAP says i still own the item", can you elaborate how you are making this check?
     
  6. drizztfun

    drizztfun

    Joined:
    Jul 2, 2013
    Posts:
    25
    @Jeff
    I simply check
    .hasreceipt
    if that works, i even tried the receipt validation, and it returns a success.
    The CrossPlatformValidator, as described in the documentation.
    If i look at the receipt data, i will still see "purchasestate : 0"

    What i tried now:
    1. Remove my second account from the tester list (no alpha/beta available anymore, just release anyway)
    2. factory reset my test phone
    3. install the game

    Its still saying i bought it.. heh.. i am lost

    p.s. since my game is an epic fail anyway :p there is no rush for me now anymore.. just wondering if others have the problem too like kobyle

    Thats my first time to use unity iap. so i cannot say if the issue is new or related to the 1.18 iap
     
  7. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,130
    @drizztfun What process did you follow to issue the refund? We will test here also.
     
  8. drizztfun

    drizztfun

    Joined:
    Jul 2, 2013
    Posts:
    25
    @JeffDUnity3D
    I used the google play console
    Order management
    And there i issued a refund and had to give a reason too.

    I just attached a screenshot of the order, maybe it helps
     

    Attached Files:

  9. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,130
    Upon discussion with the IAP team, Google refunds is not something that we currently support. I have brought it up with the team as a feature request, and hopefully we will see it supported in a future release, no ETA at this time. Apologies on the inconvenience. We will be looking at parsing the receipt and see if there is sufficient information contained within it to determine if a refund has been issued.
     
  10. Etsai

    Etsai

    Joined:
    Sep 12, 2014
    Posts:
    5
    Hi,
    Any progress in this area?
    I mean, is still possible to buy a non-consumable product through Unity IAP, then request a refund to Google and still take advantage of the product for free?
     
  11. JuicyPixels

    JuicyPixels

    Joined:
    Sep 18, 2018
    Posts:
    4
    I'm having the same problem, I purchased a product "remove_ads" and it was marked as non-consumable. Now I'd like to remove that purchase and I'm stuck. I already refunded purchase 14 days ago but it is still persistent, I was also searching for a way to force consume a product but I couldn't find any references for doing that. Does anyone have any suggestions what can I do about that?
     
  12. Etsai

    Etsai

    Joined:
    Sep 12, 2014
    Posts:
    5
    In my case, when I request the receipt for the refunded product through Unity IAP (as I understand, directly from Google), the receipt has the field purchaseState set to 0. According to Google reference this means product is purchased (and always will be 0), but I read somewhere else it may be also 1 (cancelled) or 2 (refund).

    And this is the only field I think has something to do with purchase states in Unity IAP, there are other 3rd party assets that apparently have better interaction with Google native purchasing/billing API out there...
     
  13. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,130
    So you're refunding the user, AND want to remove their product? Isn't that a return instead of a refund in the real world? Generally after a refund, the polite thing to do for the customer is to let them keep the product and give them their money back. Also in reality, no one is likely going to pay to remove ads, then want a refund so they can then view ads. It is an isolated test scenario only. With that being said, I will be discussing the topic of refunds with the IAP team today and will convey your concerns. Also, it is common practice to create multiple test users instead of creating additional non-consumable products. Either way works.
     
  14. Etsai

    Etsai

    Joined:
    Sep 12, 2014
    Posts:
    5
    I don´t understand the difference between a refund and a return (when you want your money back you also lose your purchase). If a user regrets after paying to remove ads from the game, and claims a refund to google, he should again watch ads in the game... at least this is what I want in my game.
     
  15. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,130
    @Etsai Unfortunately there is not a refund API that is exposed by the stores that we can call. On Android devices, one technique that you could use during your testing is to clear the Google Play cache on your device which may clear the receipt for refunded purchases. Google search for the specific process on your device model. If your users contact you, you could recommend this approach to them also. But there is no programmatic solution at this time.
     
    Etsai likes this.
  16. JuicyPixels

    JuicyPixels

    Joined:
    Sep 18, 2018
    Posts:
    4
    A year ago I was using Prime31 plugin, where I was able to consume non-consumable products, after they were bought, and when I consumed it, I was again able to purchase another same non-consumable item. This is a usual path to test IAPs so I'm guessing that something can be done about that. Also clearing cache does not work, you always get purchases back. It would be kinda strange that there's not way to properly test IAPs on Android devices.
     
  17. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,130
    @JuicyPixels This thread is specific to the refund process. If you are concerned about a separate issue with not being able to consume a non-consumable, please open a new thread.
     
  18. Etsai

    Etsai

    Joined:
    Sep 12, 2014
    Posts:
    5
    I´ve been reading about Google´s voided purchases API, is used to have a real time refunded products info. But only in server side, it shouldn't be used directly in the app due to 500 queries per day limitation (and 30 queries during any 30-second period). Info here
     
  19. Friend123

    Friend123

    Joined:
    Sep 16, 2012
    Posts:
    19
    Same problem: refunded product (in Google Play) marked as "owned" ("SKU is owned..." when application start).
     
  20. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,130
    @Friend123 How about when you reinstall? Keep in mind, as in the real world, when you provide a refund for a product, the user still keeps the product. Otherwise, it's a return.
     
  21. Friend123

    Friend123

    Joined:
    Sep 16, 2012
    Posts:
    19
    In Google Play string of product (receipt i mean) marked as "Payment refunded." When I start the application, I check the purchased products, and for some reason this product is marked as “purchased”, although the buyer received the money for it - this is not logical. How can I check the status of receipt?
     
  22. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,130
    When are you receiving the receipt with Payment refunded? How are you checking for purchased products?
     
  23. Friend123

    Friend123

    Joined:
    Sep 16, 2012
    Posts:
    19
    Via Android SDK Monitor tool i see logs when application loading. Among the strings, it shows what products are purchased ("SKU is owned..." log). Here are CS code, where i check owned products:

    Code (CSharp):
    1.  
    2. public bool IsPackBuyedInStore(string p_productID) {
    3.     bool s_result = false;
    4.  
    5.     if (IsInitialized()) {
    6.         Product s_product = m_StoreController.products.WithID(p_productID);
    7.         s_result = (s_product != null && !string.IsNullOrEmpty(s_product.receipt)) ? true : false;
    8.     }
    9.  
    10.     return s_result;
    11. }
    12.  
     
  24. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,130
    @Friend123 Please see my previous comments. Also, please try a reinstall, and see if an updated receipt is returned during the Restore process
     
    Last edited: Dec 28, 2018
  25. Friend123

    Friend123

    Joined:
    Sep 16, 2012
    Posts:
    19
    I reinstalled the application several times, but nothing has changed.
    I repeat once again - when IAP plugin loads, he writes me that the product is purchased (SKU is owned... in logs).
     
  26. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,130
    @Friend123 Please see previous posts for the state of the issue and potential workarounds.