Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Missing CancelPendingPurchase ?

Discussion in 'Unity IAP' started by Spuddicus, Jul 17, 2019.

  1. Spuddicus


    Aug 11, 2014
    I've just started implementing Unity IAP in my current game. I understand that when ProcessPurchase is called, I can either return PurchaseProcessingResult.Complete to complete the purchase immediately or return PurchaseProcessingResult.Pending if I want my server to validate the receipt or check for other forms of hacking. My question is this .... if my server finds that the receipt has been tampered with or maybe I want to cancel the purchase for some other reason, how do I do that ? I can call CompletePendingPurchase when my server has validated the receipt but there's no mention of what I should do if I want to cancel the pending purchase. Surely, I don't just leave the purchase pending forever? One other question .... once the purchase is pending, it sounds like ProcessPurchase will be called again the next time the App is restarted. This is very rare these days as most Apps go to sleep in the background. Will ProcessPurchase be called again when the App becomes active again or is it literally when it's restarted (which might not happen for a long time)? Maybe Unity should call ProcessPurchase every day while it's pending? Thanks!
  2. JeffDUnity3D


    Unity Technologies

    May 2, 2017
    You can re-initialize IAP any time you want, which will trigger ProcessPurchase for any Pending purchases. If you detect fraud, you can return Complete but just not assign the IAP product to the user.