I am working on an UWP version of our app. In-app purchases have generally been setup, a test app version has been published, in-app purchase details are queried for and in-app purchases can (with problems, see below) be bought. So, the setup seems fine.
When buying a non-consumable (durable), we are calling ConfirmPendingPurchase (as this also needs to be called for non-consumables according to out interpretation of the Unity docs). However, this results in an ServerError (see logs).
The transaction is then continuously processed by Unity and tried to be fulfilled. This results in another error, as Unity now somehow uses a fake transactionId when fulfilling the transaction (see logs).
Does anyone have any ideas what is going on? Is this “simply” a bug in UnityIAP?
As a side note: buying a consumable for the first time works fine. Buying it the seconds time without restarting the app lets Unity deliver this second purchase twice (by calling ProcessPurchase with the ids of the second purchase). This might be related to the non-consumable having a problem, but might be an independent bug as well.
Here is some shortened log from the non-consumable purchase:
purchase({0}): IAP_ID
UnityEngine.Purchasing.PurchasingManager:InitiatePurchase(Product, String)
UnityEngine.Purchasing.PurchasingManager:InitiatePurchase(String, String)
UnityIAPWin8: Purchase IAP_STORE_ID status:Succeeded
UnityEngine.Purchasing.<>c__DisplayClass16_0:b__0()
System.Action:Invoke()
UnityEngine.Purchasing.Extension.UnityUtil:Update()
PURCHASE SUCCEEDED!:{0}: 2
UnityEngine.Purchasing.<>c__DisplayClass19_0:b__0()
System.Action:Invoke()
UnityEngine.Purchasing.Extension.UnityUtil:Update()
Just for your information. The Receipt:
{“Store”:“WinRT”,“TransactionID”:“9a1378c9-a6fd-45d8-b1a2-86d5eae20f93”,“Payload”:"
<Receipt Version="2.0" CertificateId="XXX" xmlns="http://schemas.microsoft.com/windows/2012/store/receipt\">
<ProductReceipt PurchasePrice="EUR0" PurchaseDate="2019-01-08T08:22:36.301Z" Id="9a1378c9-a6fd-45d8-b1a2-86d5eae20f93" AppId="XXXX" ProductId="IAP_STORE_ID" ProductType="Durable" PublisherUserId="XXX" MicrosoftProductId="XXX" MicrosoftAppId="XXX" ExpirationDate="2019-01-09T08:22:32.817Z" OfferId="" />
<Signature xmlns="XML-Signature Syntax and Processing}
UnityIAPWin8:Fulfilment result for IAP_STORE_ID - 9a1378c9-a6fd-45d8-b1a2-86d5eae20f93 : ServerError
UnityEngine.Purchasing.<>c__DisplayClass16_0:b__0()
System.Action:Invoke()
UnityEngine.Purchasing.Extension.UnityUtil:Update()
Unity now tries to fulfil and fulfil:
UnityIAPWin8:Fake transactionID: Set transactionMap[IAP_STORE_ID] = 190501192
UnityEngine.Purchasing.<>c__DisplayClass16_0:b__0()
System.Action:Invoke()
UnityEngine.Purchasing.Extension.UnityUtil:Update()
Fulfilling transaction 190501192
UnityEngine.Purchasing.<>c__DisplayClass16_0:b__0()
System.Action:Invoke()
UnityEngine.Purchasing.Extension.UnityUtil:Update()
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 45)
ProductID IAP_STORE_ID
UnityEngine.Purchasing.<>c__DisplayClass16_0:b__0()
System.Action:Invoke()
UnityEngine.Purchasing.Extension.UnityUtil:Update()
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 45)
UnityIAPWin8:Consuming: IAP_STORE_ID
UnityEngine.Purchasing.<>c__DisplayClass16_0:b__0()
System.Action:Invoke()
UnityEngine.Purchasing.Extension.UnityUtil:Update()
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 45)
UnityIAPWin8:Exception consuming IAP_STORE_ID : Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). (non-fatal)
UnityEngine.Purchasing.<>c__DisplayClass16_0:b__0()
System.Action:Invoke()
UnityEngine.Purchasing.Extension.UnityUtil:Update()