Exemplo n.º 1
0
        /// <summary>
        /// Transaction id bulunur
        /// </summary>
        /// <param name="mscMcomPool"></param>
        /// <returns></returns>
        private MscMcomTransaction GetMscMcomTransactionId(MscMcomPool mscMcomPool)
        {
            MscMcomTransaction mscMcomTransactionId = _iTransactionData.GetTransactionId(mscMcomPool.ProvisionRefKey);

            if (mscMcomTransactionId == null)
            {
                //presenment kaydı alınır
                var presentmentData = _iTransactionData.GetIssuerData(mscMcomPool);
                //transaction search yapılarak transaction id bulunur.
                TransactionSearchRequest transactionSearchRequest = new TransactionSearchRequest();
                transactionSearchRequest.primaryAccountNum = presentmentData.F002;
                transactionSearchRequest.acquirerRefNumber = presentmentData.Arn;
                transactionSearchRequest.tranStartDate     = presentmentData.TxnDate.AddDays(-2).ToString("yyyy-MM-dd");
                transactionSearchRequest.tranEndDate       = presentmentData.TxnDate.ToString("yyyy-MM-dd");
                var transactionSearchResponse = _iTransactions.Search(mscMcomPool.ClearingRefKey, transactionSearchRequest);
                if (Convert.ToInt16(transactionSearchResponse.authorizationSummaryCount) > 0)
                {
                    mscMcomTransactionId = new MscMcomTransaction();
                    mscMcomTransactionId.ClearingTransactionId       = transactionSearchResponse.authorizationSummary[0].clearingSummary[0].transactionId;
                    mscMcomTransactionId.AuthenticationTransactionId = transactionSearchResponse.authorizationSummary[0].transactionId;
                    mscMcomTransactionId.ClrRefKey  = mscMcomPool.ClearingRefKey;
                    mscMcomTransactionId.AuthRefKey = mscMcomPool.ProvisionRefKey;
                    _iTransactionData.CreateTransactionId(mscMcomTransactionId);
                }
            }
            return(mscMcomTransactionId);
        }