From 5fb60e129d0fb78f83eab9b52b0f7304ec243528 Mon Sep 17 00:00:00 2001 From: Roman Fadeev Date: Sat, 17 Oct 2015 03:16:13 +0300 Subject: [PATCH] Fix incorrect purchase object construction in OnPurchaseSucceeded for iOS. Sku field was inited with store sku of the product instead of mapped sku. This resulted consuming product not working on iOS. --- .../unity_src/Assets/Plugins/OpenIAB/OpenIABEventManager.cs | 2 +- unity_plugin/unity_src/Assets/Plugins/OpenIAB/Purchase.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/unity_plugin/unity_src/Assets/Plugins/OpenIAB/OpenIABEventManager.cs b/unity_plugin/unity_src/Assets/Plugins/OpenIAB/OpenIABEventManager.cs index efd5b52..81ab08e 100644 --- a/unity_plugin/unity_src/Assets/Plugins/OpenIAB/OpenIABEventManager.cs +++ b/unity_plugin/unity_src/Assets/Plugins/OpenIAB/OpenIABEventManager.cs @@ -218,7 +218,7 @@ private void OnPurchaseSucceeded(string json) { if (purchaseSucceededEvent != null) { - purchaseSucceededEvent(new Purchase(json)); + purchaseSucceededEvent(new Purchase(new JSON(json))); } } diff --git a/unity_plugin/unity_src/Assets/Plugins/OpenIAB/Purchase.cs b/unity_plugin/unity_src/Assets/Plugins/OpenIAB/Purchase.cs index fb2b214..46c4557 100644 --- a/unity_plugin/unity_src/Assets/Plugins/OpenIAB/Purchase.cs +++ b/unity_plugin/unity_src/Assets/Plugins/OpenIAB/Purchase.cs @@ -108,6 +108,7 @@ public Purchase(JSON json) { OriginalJson = json.ToString("originalJson"); Signature = json.ToString("signature"); AppstoreName = json.ToString("appstoreName"); + Receipt = json.ToString("receipt"); Sku = OpenIAB_iOS.StoreSku2Sku(Sku); }