- Home /
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:
Initiate purchase
(user completes purchase with store UI, payment, etc)
ProcessPurchase(PurchaseEventArgs e)
is called, details of transaction are sent to server I returnPurchaseProcessingResult.Pending
Server verification is successful
Call
ConfirmPendingPurchase(product)
after looking up product by idError 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
Answer by Binouze · Jan 19, 2021 at 09:18 AM
Hi, 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 : https://forum.unity.com/threads/bug-unity-iap-2-2-5-cannot-confirmpendingpurchase.1023700/
IPA 2.2.6 was released yesterday and appears to have solved the issue.
Answer by Volcore · Jan 14, 2021 at 06:23 AM
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.
Answer by mobyjames · Jan 14, 2021 at 06:41 PM
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.