public TranProcessingResult DoTransaction(CCTranType aTranType, TranProcessingInput inputData) { V2.ICCTransactionProcessor processor = GetProcessor <V2.ICCTransactionProcessor>(); var inputGenerator = new V2ProcessingInputGenerator(_provider); var processingInput = inputGenerator.GetProcessingInput(aTranType, inputData); V2.ProcessingResult v2Result = processor.DoTransaction(processingInput); TranProcessingResult result = V2Converter.ConvertTranProcessingResult(v2Result); V2.ICCTranStatusGetter tranStatusGetter = _plugin.CreateProcessor <V2.ICCTranStatusGetter>(null); if (tranStatusGetter != null) { V2.CCTranStatus tranStatus = tranStatusGetter.GetTranStatus(v2Result); result.TranStatus = V2Converter.ConvertTranStatus(tranStatus); } return(result); }
public static TranProcessingResult ConvertTranProcessingResult(V2.ProcessingResult processingResult) { if (processingResult == null) { throw new ArgumentNullException(nameof(processingResult)); } TranProcessingResult result = new TranProcessingResult() { AuthorizationNbr = processingResult.AuthorizationNbr, CcvVerificatonStatus = ConvertCvvStatus(processingResult.CcvVerificatonStatus), ExpireAfterDays = processingResult.ExpireAfterDays, Success = true, PCResponse = processingResult.ResponseText, PCResponseCode = processingResult.ResponseCode, PCResponseReasonCode = processingResult.ResponseReasonCode, PCResponseReasonText = processingResult.ResponseReasonText, PCTranNumber = processingResult.TransactionNumber, ResultFlag = CCResultFlag.None, TranStatus = CCTranStatus.Approved }; return(result); }