Android IAP Cannot confirm purchase due to missing transaction id

I am implementing server-side IAP verification and having an issue when it comes time to call ConfirmPendingPurchase, which returns the following error in the logs…

Unable to confirm purchase; Product has missing or empty transactionID

Here is a step-by-step sequence of events:

  1. Initiate purchase
  2. (user completes purchase with store UI, payment, etc)
  3. ProcessPurchase(PurchaseEventArgs e) is called, details of transaction are sent to server I return PurchaseProcessingResult.Pending
  4. Server verification is successful
  5. Call ConfirmPendingPurchase(product) after looking up product by id
  6. Error and purchase it ultimately cancelled due to not being acknowledged

Logging reveals to transactionID is present and valid in all steps except #5 onward. Something is clearing the transactionID between the time Pending is returned and message is sent to server and when product is looked up for confirmation.

Any ideas welcome and appreciated!

Unity 2020.2.1f1
Unity IAP 2.2.1

I’ve just seen a similar issue on our production system (Unity 2020.2.1f1 & Unity IAP 2.2.1).

In our case, even during the server verification step the transaction id was empty, while the receipt contained the correct id. We have to use FetchAdditionalProducts though instead of initializing the products directly, as they are pushed down dynamically from the server.

I’ve implemented a work-around hack on the server, where it fetches the transaction id from the receipt if the transaction id field is empty, but this still leads to a client side bug where the client will retry this transaction indefinitely on every new application launch.

Thanks for confirming I’m not the only one. I opened a bug report with details. I guess we have to wait for a new version.

I have the same problem with unity 2020.1.17f1 / IAP plugin 2.2.5 / IAP package 2.2.1
On the previous game build there was no problem using Unity 2020.1.15f1 / IAP plugin 2.2.3 / IAP package 2.2.1

[EDIT] here is the forum link to the bug :