protected override void DidFinishBillingTransaction (string _dataStr) { IDictionary _dataDict = (IDictionary)JSONUtility.FromJSON(_dataStr); string _error = _dataDict.GetIfAvailable<string>(kErrorKey); if (_error != null) { DidFinishBillingTransaction(null, _error); return; } else { IList _transactionsJSONList = _dataDict.GetIfAvailable<IList>(kTransactionsKey); BillingTransaction[] _transactionsList = null; if (_transactionsJSONList != null) { _transactionsList = new AndroidBillingTransaction[_transactionsJSONList.Count]; int _iter = 0; foreach (IDictionary _transactionInfoDict in _transactionsJSONList) { _transactionsList[_iter++] = new AndroidBillingTransaction(_transactionInfoDict); } } DidFinishBillingTransaction(_transactionsList, null); return; } }
protected override void ExtractTransactionResponseData(string _dataStr, out BillingTransaction[] _transactions, out string _error) { // Set default values _transactions = null; _error = null; // Parse and fetch properties from JSON object IDictionary _dataDict = (IDictionary)JSONUtility.FromJSON(_dataStr); _error = _dataDict.GetIfAvailable <string>(kErrorKey); if (_error == null) { IList _transactionsJSONList = _dataDict.GetIfAvailable <IList>(kTransactionsKey); if (_transactionsJSONList != null) { int _count = _transactionsJSONList.Count; _transactions = new AndroidBillingTransaction[_count]; for (int _iter = 0; _iter < _count; _iter++) { _transactions[_iter] = new AndroidBillingTransaction((IDictionary)_transactionsJSONList[_iter]); } } } }
protected override void DidFinishBillingTransaction(string _dataStr) { IDictionary _dataDict = (IDictionary)JSONUtility.FromJSON(_dataStr); string _error = _dataDict.GetIfAvailable <string>(kErrorKey); if (_error != null) { DidFinishBillingTransaction(null, _error); return; } else { IList _transactionsJSONList = _dataDict.GetIfAvailable <IList>(kTransactionsKey); BillingTransaction[] _transactionsList = null; if (_transactionsJSONList != null) { _transactionsList = new AndroidBillingTransaction[_transactionsJSONList.Count]; int _iter = 0; foreach (IDictionary _transactionInfoDict in _transactionsJSONList) { _transactionsList[_iter++] = new AndroidBillingTransaction(_transactionInfoDict); } } DidFinishBillingTransaction(_transactionsList, null); return; } }
private IDictionary JSONObject() { #if UNITY_ANDROID return(AndroidBillingTransaction.CreateJSONObject(this)); #else return(iOSBillingTransaction.CreateJSONObject(this)); #endif }
protected override void ParseTransactionData(IDictionary _transactionDict, out BillingTransaction _transaction) { _transaction = new AndroidBillingTransaction(_transactionDict); }
protected override void ParseTransactionData (IDictionary _transactionDict, out BillingTransaction _transaction) { _transaction = new AndroidBillingTransaction(_transactionDict); }