private SendReversalData CompleteSession(SendReversalData sendReversalData) { var mgiSessionId = sendReversalData.ValidationResponses.Last().Payload.MgiSessionID; var completeSessionRequest = CompleteSessionRequestFactory.CompleteSendReversalRequest(mgiSessionId); completeSessionRequest.AgentID = sendReversalData.SendReversalRequest.AgentId; completeSessionRequest.AgentSequence = sendReversalData.SendReversalRequest.AgentPos; sendReversalData.Set(completeSessionRequest); var completeSessionResponse = _acIntegration.CompleteSession(completeSessionRequest); var errors = completeSessionResponse.Errors ?? new List <BusinessError>(); sendReversalData.Set(errors); sendReversalData.Set(completeSessionResponse); return(sendReversalData); }
public SendReversalData TransactionLookup(SendReversalData sendReversalData) { try { sendReversalData.Set(_tranLookupOperations.TransactionLookupForSendReversal(sendReversalData)); var errors = sendReversalData.TransactionLookup.TransactionLookupResp.Errors ?? new List <BusinessError>(); sendReversalData.Set(errors); } catch (AgentConnectException acExp) { var error = new BusinessError { ErrorCategory = "AC Exception", ErrorCode = acExp.ErrorCode.ToString(), Message = acExp.Message }; sendReversalData.Set(error); } return(sendReversalData); }
public SendReversalData SingleValidate(SendReversalData sendReversalData) { try { // Transaction Lookup TransactionLookup(sendReversalData); if (DataErrorHandler.CheckForNestedErrors(sendReversalData).Any()) { return(sendReversalData); } if (sendReversalData.TransactionLookup.TransactionLookupResp.Payload.TransactionStatus != TransactionStatusType.AVAIL) { var error = new BusinessError { ErrorCategory = "Custom Error", ErrorCode = string.Empty, Message = "Transaction not available for Send Reversal." }; sendReversalData.Set(error); } // Validate Receive _validationOperations.SendReversalValidate(sendReversalData); } catch (AgentConnectException acExp) { var error = new BusinessError { ErrorCategory = "AC Exception", ErrorCode = acExp.ErrorCode.ToString(), Message = acExp.Message }; sendReversalData.Set(error); } return(sendReversalData); }
public SendReversalData SendReversalComplete(SendReversalData sendReversalData) { try { // Transaction Lookup TransactionLookup(sendReversalData); if (DataErrorHandler.CheckForNestedErrors(sendReversalData).Any()) { return(sendReversalData); } if (sendReversalData.TransactionLookup.TransactionLookupResp.Payload.TransactionStatus != TransactionStatusType.AVAIL) { var error = new BusinessError { ErrorCategory = "Custom Error", ErrorCode = string.Empty, Message = "Transaction not available for SendReversal." }; sendReversalData.Set(error); } // Validate SendReversal _validationOperations.SendReversalValidate(sendReversalData); // Final Validate(s) _validationOperations.SendReversalValidateUntilReadyForCommit(sendReversalData); if (DataErrorHandler.CheckForNestedErrors(sendReversalData).Any()) { return(sendReversalData); } if (sendReversalData.ValidationResponses.Last().Payload.ReadyForCommit) { CompleteSession(sendReversalData); } else { var error = new BusinessError { ErrorCategory = "Custom Error", ErrorCode = string.Empty, Message = "Not ready to commit yet" }; sendReversalData.Set(error); } } catch (AgentConnectException acExp) { var error = new BusinessError { ErrorCategory = "AC Exception", ErrorCode = acExp.ErrorCode.ToString(), Message = acExp.Message }; sendReversalData.Set(error); } return(sendReversalData); }