IAP 4.10.0 ProcessPurchase Pending function not firing on UnityPurchasing.Initialize

Hello,

We have attempted to run the sample “IntegratingSelfProvidedBackendReceiptValidation” in order to understand how the ProcessPurchaseResult Pending flow works. From our understanding, if we return Pending in this function, then when we restart the application, the ProcessPurchase function should be fired again for the transaction/product that was returned as Pending.

This doesn’t seem to happen :frowning:

In the sample in IAP, we fire the function to InitiatePurchase:

public void BuyGold()
{
m_StoreController.InitiatePurchase(goldProductId);
}

and we have modified the ProcessPurchase function to simulate the pending flow:

public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args)
{
//Retrieve the purchased product
var product = args.purchasedProduct;
Debug.Log(product.definition.id);
//StartCoroutine(BackEndValidation(product));
//We return Pending, informing IAP to keep the transaction open while we validate the purchase on our side.
return PurchaseProcessingResult.Pending;
}

On restarting the app, when UnityPurchasing has officially initialised and the controller is assigned, we are expecting the Debug.Log(product.definition.id) to fire once more, in a loop. However, nothing happens.

Any ideas why this could be happening? Let us know if you require anything to help get to the bottom of it.
Cheers guys :slight_smile:

1 Like

Hi guys,

Is there any update on this?

Thanks

Facing the exact same issue today. I was testing the IAP flow, and my understanding is that after initiating a purchase:

  • if I do my backend validation and mark it as ‘complete’ then is all good. The user has access to the items.
  • if I leave it as ‘pending’ (i.e. return PurchaseProcessingResult.Pending’), these transactions is not re-checked when re-initializing. Therefore I cannot apply the item to the user account in the cloud

Did you find a solution to this as this seems quite ‘risky’