UnityEngine.Purchasing.TransactionLog.Record C# (CSharp) Method

Record() public method

public Record ( string transactionID ) : void
transactionID string
return void
        public void Record(string transactionID)
        {
            if (!string.IsNullOrEmpty(transactionID) && !string.IsNullOrEmpty(this.persistentDataPath))
            {
                string recordPath = this.GetRecordPath(transactionID);
                try
                {
                    Directory.CreateDirectory(recordPath);
                }
                catch (Exception exception)
                {
                    this.logger.Log(exception.Message);
                }
            }
        }
    }

Usage Example

コード例 #1
0
        /// <summary>
        /// Where an Application returned ProcessingResult.Pending they can manually
        /// finish the transaction by calling this method.
        /// </summary>
        public void ConfirmPendingPurchase(Product product)
        {
            if (null == product)
            {
                m_Logger.LogError("Unity IAP", "Unable to confirm purchase with null Product");
                return;
            }

            if (string.IsNullOrEmpty(product.transactionID))
            {
                m_Logger.LogError("Unity IAP", "Unable to confirm purchase; Product has missing or empty transactionID");
                return;
            }

            if (useTransactionLog)
            {
                m_TransactionLog.Record(product.transactionID);
            }
            m_Store.FinishTransaction(product.definition, product.transactionID);
        }