Beispiel #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);
        }
Beispiel #2
0
        public void Create(MscMcomPool mscMcomPool)
        {
            //yapılan chargeback datası alınmakta.
            ChargebackFillRequest chargebackFillRequest = GetChargebackData(mscMcomPool);
            //Chargeback yapılacak transaction mastrercom tarafından bulunur. Clearingtransaction id alınır.
            MscMcomTransaction mscMcomTransactionId = GetMscMcomTransactionId(mscMcomPool);
            //claim bulunur.
            MscMcomClaim mscMcomClaim = GetMscMcomClaim(mscMcomPool, chargebackFillRequest, mscMcomTransactionId);

            //chargeback üretilir.
            mscMcomPool.ResponseStatus = "INITIAL";
            mscMcomPool.ClaimId        = mscMcomClaim.ClaimId;
            mscMcomPool.McomRefNo      = _iChargebacks.Create(mscMcomPool.ClearingRefKey, mscMcomClaim.ClaimId, chargebackFillRequest);
        }
Beispiel #3
0
        public void Create_NotTakenClaim_GetChargebackIdInMcomRefNo()
        {
            //arrange  9
            var mscMcomTransactionId = new MscMcomTransaction
            {
                ClearingTransactionId = clearingTransactionId
            };

            chargebacks.Setup(f => f.Create(It.IsAny <long>(), claimId, It.IsAny <ChargebackFillRequest>())).Returns(chargebackId);
            transactionData.Setup(f => f.GetTransactionId(mscMcomPool.ProvisionRefKey)).Returns(mscMcomTransactionId);
            transactionData.Setup(f => f.GetClaim(mscMcomTransactionId.ClaimId)).Returns((MscMcomClaim)null);
            claims.Setup(f => f.CreateClaim(It.IsAny <long>(), It.IsAny <ClaimRequest>())).Returns(claimId);
            //act
            createChargeback.Create(mscMcomPool);
            //assert
            Assert.That(mscMcomPool.McomRefNo, Is.Not.Null);
            Assert.That(mscMcomPool.McomRefNo, Is.EqualTo(chargebackId));
            Assert.That(mscMcomTransactionId.ClaimId, Is.EqualTo(claimId));
            transactionData.Verify(f => f.GetIssuerData(mscMcomPool));
            transactionData.Verify(f => f.GetClaim(mscMcomTransactionId.ClaimId), Times.Never(), "MscMcomTransactionId claim id null ise GetClaim fonksiyonu cagırılmayacak.");
            transactionData.Verify(f => f.CreateClaim(It.IsAny <MscMcomClaim>()));
            transactionData.Verify(f => f.UpdateClaimId(mscMcomTransactionId));
        }
Beispiel #4
0
        /// <summary>
        ///  claim bulunur database de varsa o alınır yoksa yeni bir claim yaratılır.
        ///  transaction tanımında claim varsa alır yoksa mastercard sistemden claim numarası alır.
        ///  alınan claim transaction uzerine kaydeder.
        /// </summary>
        /// <param name="mscMcomPool"></param>
        /// <param name="chargebackFillRequest"></param>
        /// <param name="mscMcomTransactionId"></param>
        /// <returns></returns>
        private MscMcomClaim GetMscMcomClaim(MscMcomPool mscMcomPool, ChargebackFillRequest chargebackFillRequest, MscMcomTransaction mscMcomTransactionId)
        {
            MscMcomClaim mscMcomClaim = null;

            if (!String.IsNullOrWhiteSpace(mscMcomTransactionId.ClaimId))
            {
                mscMcomClaim = _iTransactionData.GetClaim(mscMcomTransactionId.ClaimId);
            }

            if (mscMcomClaim == null)
            {
                mscMcomClaim = new MscMcomClaim();

                var claimRequest = new ClaimRequest();
                claimRequest.clearingTransactionId = mscMcomTransactionId.ClearingTransactionId;
                claimRequest.disputedAmount        = chargebackFillRequest.amount;
                claimRequest.disputedCurrency      = chargebackFillRequest.currency;
                claimRequest.claimType             = "Standard";
                mscMcomClaim.ClaimId = _iClaims.CreateClaim(mscMcomPool.ClearingRefKey, claimRequest);
                mscMcomClaim.ClearingTransactionId = mscMcomTransactionId.ClearingTransactionId;
                mscMcomClaim.ClrKey     = mscMcomPool.ClearingRefKey;
                mscMcomClaim.AuthKey    = mscMcomPool.ProvisionRefKey;
                mscMcomClaim.ClaimStatu = "OPEN";
                _iTransactionData.CreateClaim(mscMcomClaim);
                mscMcomTransactionId.ClaimId = mscMcomClaim.ClaimId;
                _iTransactionData.UpdateClaimId(mscMcomTransactionId);
            }

            return(mscMcomClaim);
        }
 public void CreateTransactionId(MscMcomTransaction mscMcomTransactionId)
 {
     mscMcomTransactionId.Create();
 }
 public void UpdateClaimId(MscMcomTransaction mscMcomTransactionId)
 {
     mscMcomTransactionId.Update();
 }