public void RequestReceiptsSuccessListener(string jsonData) { OuyaUnityPlugin.m_pendingRequestReceipts = false; //Debug.Log(string.Format("OuyaSDK.RequestReceiptsSuccessListener: jsonData={0}", jsonData)); using (JSONArray jsonArray = new JSONArray(jsonData)) { List <OuyaSDK.Receipt> receipts = new List <OuyaSDK.Receipt>(); for (int index = 0; index < jsonArray.length(); ++index) { using (JSONObject jsonObject = jsonArray.getJSONObject(index)) { //Debug.Log(string.Format("Found Receipt: {0}", jsonObject.toString())); OuyaSDK.Receipt receipt = OuyaSDK.Receipt.Parse(jsonObject); receipts.Add(receipt); } } foreach (OuyaSDK.IRequestReceiptsListener listener in OuyaSDK.getRequestReceiptsListeners()) { if (null != listener) { listener.RequestReceiptsOnSuccess(receipts); } } } }
public void ReceiptListListener(string jsonData) { if (string.IsNullOrEmpty(jsonData)) { Debug.LogError("OuyaSDK.ReceiptListListener: received empty jsondata"); return; } Debug.Log(string.Format("OuyaSDK.ReceiptListListener: jsonData={0}", jsonData)); OuyaSDK.Receipt receipt = JsonMapper.ToObject <OuyaSDK.Receipt>(jsonData); m_receipts.Add(receipt); }
public void ReceiptListListener(string jsonData) { #if !UNITY_WP8 if (string.IsNullOrEmpty(jsonData)) { Debug.Log("OuyaSDK.ReceiptListListener: received empty jsondata"); return; } Debug.Log(string.Format("OuyaSDK.ReceiptListListener: jsonData={0}", jsonData)); OuyaSDK.Receipt receipt = OuyaSDK.Receipt.Parse(jsonData); m_receipts.Add(receipt); #endif }