I am Using Unity 2022.3.37f1 with Unity IAP 4.12.2.
Similar to this other thread, I have been experiencing an issue where I see a purchase error system modal that says “You already own this item” when attempting to purchase my consumable product. Here’s how I reproduced it.
- Purchase the item with the “Test card, always approves”.
- Immediately while it loads the next modal saying that it is successful, go back to the home screen and turn off wifi.
- Return to the app and notice that the purchase appears to succeed and the user gets the benefit (ProcessPurchase is called).
- After dismissing the success message, it shows a purchase failed modal with message "An internal error occurred. {code: NetworkError, M: GPSFTS.HFT})
- If the user attempts to purchase the same product again, it will display a system modal with message “You already own this item.” and then the purchase fails.
- It will keep doing 5) for a while if you attempt to do it repeatedly. Eventually, the purchase will be cancelled because it is unacknowledged, and the user can purchase the product again. However, it would also refund the money spent, which means that the user can get the purchase benefit and a refund.
Here are some of the relevant log messages:
2024/12/12 20:32:22.652 12321 12649 Warn BillingClient Error consuming purchase with token. Response code: 12
2024/12/12 20:32:22.660 1199 2413 Verbose sec_audio_hw sec_dev_close_audio_stream: enter
2024/12/12 20:32:22.660 1199 2413 Verbose sec_audio_hw sec_dev_close_audio_stream: close sec audio stream for handle 2189, type 0
2024/12/12 20:32:22.660 1199 2413 Verbose sec_audio_hw sec_dev_close_audio_stream: exit
2024/12/12 20:32:22.660 1347 1770 Verbose APM_AudioPolicyManager selectOutputForMusicEffects selected output 13
2024/12/12 20:32:22.666 12321 12355 Warn Unity onPurchaseFailedEvent(productId:my_product message:An internal error occurred. {code: NetworkError, M: GPSFTS.HFT})
2024/12/12 21:15:55.470 23715 23901 Warn Unity onPurchaseFailedEvent(productId:my_product message: - Google BillingResponseCode = ItemAlreadyOwned)
2024/12/12 21:15:55.470 23715 23901 Warn Unity UnityEngine.Purchasing.PurchasingManager:OnPurchaseFailed(PurchaseFailureDescription)