IAP 2.2.2 - Error with PurchaseProcessingResult.Pending

I made a game with server side. I purchase IAP(com.abc.0.99) , it perform successfully, then i send TransitionID to server to verify.
In function
public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args), i return PurchaseProcessingResult.Pending

During that time, i wait from server, I made the same purchase(com.abc.0.99), It perform successfully too. I think it will be failed still i confirm first purchase

Other users are saying that they receive two ProcessPurchase calls when they return Pending, can you confirm that is what you are seeing? Mentioned here also [Solved] Unity IAP 2.2.2 Duplicate PurchaseEventArg

No, in my case, i see only 1 success purchase as i describe above

Please describe the issue that you are seeing, are you receiving an error message?

I updated the newest version of Unity IAP. I describe step by step my issue

  1. I open app and receive log about Init Unity IAP success like Image 1
  2. I purchase consumable product “com.gameg.windyvillage.0.99” successfully, it has log like Image 2
  3. I purchase product “com.gameg.windyvillage.0.99” again, it show message like Image 3. It’s ok because i return PurchaseProcessingResult.Pending in function public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args)
  4. My issue is step 4, i close app and reopen it. UnityIAP show log like Image 4. The product “com.gameg.windyvillage.0.99” don’t have Receive ( TransactionID: - Receipt: - Has Receipt: False ). I think UnityIAP must store the transaction of purchase that not complete. In this case, i will use StoreController.ConfirmPendingPurchase to complete Pending Transaction




Hello @fire1991man

Before answering, if you don’t mind I’d like to confirm my understanding of the issue.

So basically you have a purchase that you have returned Pending in the ProcessPurchase method. Then when you open the app again, you don’t see a receipt for your product and you didn’t call ConfirmPendingPurchase on the purchase.

Is that correct?

that’s right

Do you see ProcessPurchase triggered for this Pending transaction on app restart?

1 Like

I tested again, ProcessPurchase is not trigger. Only OnInitialized triggered

Do you typically call ConfirmPendingPurchase in ProcessPurchase? Or elsewhere? I’m testing now.

I want to call ConfirmPendingPurchase in OnInitialized if any product have a receipt. MatthieuSmith_Unity3D describe exactly my issue

No, you would not want to do that. If they have a receipt, they are already confirmed.

because i develop with server side. I need verify receipt from server. I want to manually ConfirmPendingPurchase

Yes, I understand you are doing server side receipt validation. We do have an issue to be clear. But you don’t confirm all products in initialization, you would expect ProcessPurchase to trigger and that’s where you do it, but that’s not happening. But you’re likely seeing the same thing. Was this working previously for you? I’m using the Sample IAP project here to test, it was designed for this scenario. You can click Toggle to return Pending from ProcessPurchase at runtime https://discussions.unity.com/t/700293

yah, sorry for scenario, i don’t use ConfirmPendingPurchase in initialization. What i want is pending receipt in initialization. In the case, server don’t receive my receipt or any bug when i purchased successfully. When app restart, i wil check and send again that receipt is not verify

Yes, you would do this check in ProcessPurchase not initialization on app restart. We are working on sorting this out.

1 Like