I put my test app on Google Play Store Test track and using a test account.
I have a NoAds button. It worked the first time. It showed me item Buy screen. And I chose “Always approve this test purchase option”.
Now, I can no longer see that purchase screen and the NoAds button doesn’t do anything. When I check the Debug it says. “OnPurchaseFailed,Duplicate transaction”.
If you are using Codeless, make sure you check “Consume product” checkbox. If NoAds is a non-consumable (it should be), then DuplicateTransaction would be expected. You are not permitted to purchase a non-consumable a second time.
No, a single user can only buy a non-consumable once. You can’t reset the transactionID. You don’t need a new APK, just use a different product or a different user.
Hi Jeff, I am using consumable items and when I try buying the product, the OnPurchaseFailed method gives me the duplicate transaction message. I am doing every thing by your sample on https://discussions.unity.com/t/700293 I tried to make a situation that the purchase become complete but not giving the item to user, to produce this problem.
I am just wondering that is there an option to restore these failed purchases with a similar method ?
Is my test account stuck in this duplicate transaction error for ever ?
If the purchase is failed by a user, there is no possible way to restore the purchase so it becomes purchasable again?
P.S. our app is in production, I’m using unity IAP version 3.0.2 and Unity LTS 2020.3.0
So IAP worked in your testing, but stopped working when you published live? How did the original purchase fail, can you provide steps to reproduce? Do you return Pending or Complete from ProcessPurchase? Are you using scripted or Codeless IAP?
Yes, IAP works and the app is in production for over a year but we are trying to refactor some problematic scripts.
I’m using scripted IAP.
The code implementation is alright. However, I was trying to put the purchased item in pending state until I confirm it with my Web server, so in the end of PurchaseProcessingResult ProcessPurchase(PurchaseEventArgsargs) method insted of ConfirmPendingPurchase.Complete I am setting it to ConfirmPendingPurchase.Pending and waiting for my server response and after that I use this method: m_StoreController.ConfirmPendingPurchase(product); which I believe makes the pending purchase being completed.
So, when my server response time out and the product it not consumed by user I receive duplicate transaction when trying again.
Do your purchases work correctly if you return Complete directly from ProcessPurchase (as a test, only)? I’ve heard of other reports of ConfirmPendingPurchase not marking the product as consumed, same as you. I suspect there is a problem at our end. However, I’m not able to reproduce, and it works correctly for me. I use v1 of the Sample IAP Project that was designed for this very test, and upgraded it to IAP 3.0.2 https://discussions.unity.com/t/700293
Well, in the new implementation that I am working on, I am refactoring code to return Complete in ProcessPurchase instead of using ConfirmPendingPurchase but what is killing me is the remained unconsumed products which includes all of my consumable products and I’m really concerned that our users experience the same problem at some point. So until I get a satisfiable feedback from users, would you help me to solve this duplicate transaction error?
Doesn’t IAP have a way to restore purchased and not consumed products somehow ?
Yes, that is what we are doing. Are you able to test as I suggested? It would help to troubleshoot your issue. Are you changing topics and asking about restore now? If so, note that the restore operation on Google happens automatically for non-consumable and subscription products, you’ll receive a ProcessPurchase for each such product during an app reinstall, for example. But your original error mention is regarding consumable products and the duplicate transaction error. I was hoping to troubleshoot and resolve that issue first.
I spoke with the engineering team, and it is advised not to acknowledge purchases server side. We already do that in the client code. The typical flow is to validate the receipt only, server side.
Yes, as I mentioned I have changed the implementation as you suggested. It may take a few days and bunch of different tests to see if the issue would be reproduced or not.
However, until then, I would be glad if you could help me with the restoring purchases. thank you so much.
Sorry I don’t follow. If you have a separate question regarding Restore, please open a new thread. The topic is not related. So you are not able to reproduce your duplicate transaction error? Or are you waiting to hear about errors from your users?
Hi! We are experiencing same problems as you heard of other reports. Seems that ConfirmPendingPurchase not working properly on ios, so we receive Diplicate Transaction error. Version of Unity is 2019.4.18, iap plugin version 2.1.1, iap package version is 2.2.1.
I’ve also tried updating to IAP 3.0.2, but error is still present. Everything worked well until recently, one change that we made for the last week - only uploaded build to Test Flight
I am also seeing On IOS IAP vs 3.0.2, on Consumables the Duplicate Transaction Error is being received after a purchase has been made and ConfirmPendingPurchase called for the transaction before it.