Hi,
After running our code for over two years in production, I’ve just encountered an issue where one of our safeguard tripwires triggered. A receipt contained not one but two (different) products.
This doesn’t seem to be supported or “make sense” with the Unity IAP system, as a transaction has a single product.
Some details:
- We are using com.unity.purchasing 4.1.3
- We are using Unity 2021.2.12f1
- This happened on Apple Testflight sandbox
- I have not seen this happen “in the wild” on production
- The error was noticed in our server-side validation
- We send the raw transaction details received from Unity IAP to the server (product is a
UnityEngine.Purchasing.Product) - Our server uses the “https://buy.itunes.apple.com/verifyReceipt” endpoint to validate the purchase
- Our code triggered on this (the count was 2)
if len(response.Receipt.InApp) != 1 {
log.WithField("response", response).
WithField("bundleId", bundleId).
WithField("productId", productId).
WithField("plainReceipt", plainReceipt).
WithField("receipt", receipt).
Errorf("IAP receipt with multiple products!")
}
- The purchased product was a “com.arvogames.gs.chapter2pack”. The receipt contained both that and “com.arvogames.gs.dailypack1” (which I do not remember testing and not receiving, but which might have happened a while ago).
- This kept happening as I purchased more IAPs, but it would always return just the most recent 2 (not all unacknowledged purchases)
Is this a known issue? Are we expected to handle multiple different products in a single transaction (even though Unity IAP system only communicates a single product)? This would provide several logistical challenges, as transaction metadata from Unity IAPs and our own system is missing on the secondary purchase.
Thanks for looking into this,
Volke