public CCProcTran UpdateTransaction(CCProcTran procTran)
 {
     if (procTran.TransactionID.GetValueOrDefault() == 0)
     {
         throw new ArgumentNullException(nameof(procTran.TransactionID));
     }
     using (var scope = new PXTransactionScope())
     {
         ExternalTransaction extTran = _externalTran.GetExternalTransaction(procTran.TransactionID);
         if (extTran == null)
         {
             throw new Exception($"Could not find External transaction record by TransactionID = {procTran.TransactionID}");
         }
         if (procTran.ProcStatus != CCProcStatus.Opened)
         {
             if (procTran.AuthNumber != null)
             {
                 extTran.AuthNumber = procTran.AuthNumber;
             }
             if (procTran.ExpirationDate != null)
             {
                 extTran.ExpirationDate = procTran.ExpirationDate;
             }
             if (procTran.CVVVerificationStatus != null)
             {
                 extTran.CVVVerification = procTran.CVVVerificationStatus;
             }
             if (procTran.PCTranNumber != null)
             {
                 extTran.TranNumber = procTran.PCTranNumber;
             }
             if (procTran.Amount != null)
             {
                 extTran.Amount = procTran.Amount;
             }
             extTran.PMInstanceID     = procTran.PMInstanceID;
             extTran.ProcessingStatus = ExtTransactionProcStatusCode.GetStatusByTranStatusTranType(procTran.TranStatus, procTran.TranType);
             extTran.LastActivityDate = procTran.EndTime;
             extTran.Active           = CCProcTranHelper.IsActiveTran(procTran);
             extTran.Completed        = CCProcTranHelper.IsCompletedTran(procTran);
             _externalTran.UpdateExternalTransaction(extTran);
             UpdateParentTransaction(extTran, procTran);
         }
         procTran = _cctranRepository.UpdateCCProcTran(procTran);
         Save();
         scope.Complete();
         return(procTran);
     }
 }
 public CCProcTran UpdateCCProcTran(CCProcTran transaction)
 {
     return(_cctranRepository.UpdateCCProcTran(transaction));
 }