Search Unity

Question How do I acknowledge purchases for android? My IAPs sometimes get refunded automatically.

Discussion in 'Unity IAP' started by Kofiro, Mar 22, 2023.

  1. Kofiro

    Kofiro

    Joined:
    Feb 3, 2017
    Posts:
    34
    So I am aware if you don't acknowledge a purchase on Android it gets refunded.

    upload_2023-3-22_12-34-23.png
    I just want to know if there's anything I could do to let Google Play know I have acknowledged the purchase?

    I followed the IAP Sample from the PureRockets IAP project, but I still had this prompt in my Google Play Console.

    upload_2023-3-22_12-36-52.png

    I also keep having a lot of my purchases being refunded exactly after 3 days. It's a bit disheartening.
    Below are some screenshots.

    upload_2023-3-22_12-40-27.png

    upload_2023-3-22_12-40-37.png

    upload_2023-3-22_12-40-51.png


    I would appreciate any help. Below is a look at my ProcessPurchase method


    Code (CSharp):
    1. public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args)
    2.         {
    3.    
    4.     var product = args.purchasedProduct;
    5.    
    6.     if (googlePlayStoreExtensions.IsPurchasedProductDeferred(product))
    7.     {
    8.         //The purchase is Deferred.
    9.         //Therefore, we do not unlock the content or complete the transaction.
    10.         //ProcessPurchase will be called again once the purchase is Purchased.
    11.         return PurchaseProcessingResult.Pending;
    12.     }
    13.  
    14.     var isPurchaseValid = IsPurchaseValid(product);
    15.  
    16.     if (isPurchaseValid)
    17.     {
    18.  
    19.         if (String.Equals(args.purchasedProduct.definition.id, GOOGLE_PLAY_PRODUCT_ID_NO_ADS, StringComparison.Ordinal))
    20.         {
    21.        
    22.             // Remove ads code here
    23.         }
    24.        
    25.     }
    26.            
    27.     return PurchaseProcessingResult.Complete;
    28. }
    29.  
    30. bool IsPurchaseValid(Product product)
    31.         {
    32.     if (IsCurrentStoreSupportedByValidator())
    33.     {
    34.         try
    35.         {
    36.             var result = validator.Validate(product.receipt);
    37.             // The validator returns parsed receipts.
    38.             LogReceipts(result);
    39.         }
    40.  
    41.         catch(IAPSecurityException reason)
    42.         {
    43.             Debug.Log($"Invalid receipt: {reason}");
    44.             return false;
    45.         }
    46.     }
    47.  
    48.     return true;
    49. }

    Any help would be greatly appreciated.
     
  2. NoPants_

    NoPants_

    Joined:
    Apr 23, 2014
    Posts:
    59
    Oh, so this actually happened to me a few days ago, I had a huge block of orders get stuck. It might be related. I opened a support ticket, and after it got escalated, they were able to get all the pending orders to the completed state. I would open a ticket with google.
     
  3. Kofiro

    Kofiro

    Joined:
    Feb 3, 2017
    Posts:
    34
    Where and how would I have to go to open a ticket with google? My orders usually stay as pending and get canceled later on. Was it only a few days issue for you? Because I have this every week at least once.
     
  4. NoPants_

    NoPants_

    Joined:
    Apr 23, 2014
    Posts:
    59
    It only happened to me for a few hours a few days ago.

    You can start here to open a ticket.
    https://support.google.com/googleplay/android-developer/gethelp
     
  5. Kofiro

    Kofiro

    Joined:
    Feb 3, 2017
    Posts:
    34
    Thanks. I opened a ticket.

    Is my IAP implementation in Unity okay though?