private BillPayData CompleteStaged(BillPayData billPayData) { var mgiSessionId = billPayData.BillPayValidationResponseList.Last().Payload.MgiSessionID; var completeSessionRequest = CompleteSessionRequestFactory.CompleteBillPayRequest(mgiSessionId); completeSessionRequest.AgentID = billPayData.BillPayRequest.AgentId; completeSessionRequest.AgentSequence = billPayData.BillPayRequest.AgentPos; completeSessionRequest.Commit = false; var completeSessionResponse = _acIntegration.CompleteSession(completeSessionRequest); billPayData.Set(completeSessionRequest); billPayData.Set(completeSessionResponse); return(billPayData); }
public BillPayData CompleteSession(BillPayData billPayData) { try { BillerSearchByCode(billPayData); FeeLookup(billPayData); if (DataErrorHandler.CheckForNestedErrors(billPayData).Any()) { return(billPayData); } // Initial Validate _validationOperations.BillPayValidate(billPayData, billPayData.BillPayRequest.Biller, billPayData.BillPayRequest.ThirdPartyType); // Final Validate(s) _validationOperations.BillPayValidateUntilReadyForCommit(billPayData, billPayData.BillPayRequest.Biller, billPayData.BillPayRequest.ThirdPartyType); var mgiSessionId = billPayData.BillPayValidationResponseList.Last().Payload.MgiSessionID; var completeSessionRequest = CompleteSessionRequestFactory.CompleteBillPayRequest(mgiSessionId); completeSessionRequest.AgentID = billPayData.BillPayRequest.AgentId; completeSessionRequest.AgentSequence = billPayData.BillPayRequest.AgentPos; var completeSessionResponse = _acIntegration.CompleteSession(completeSessionRequest); billPayData.Set(completeSessionRequest); billPayData.Set(completeSessionResponse); } catch (AgentConnectException acExp) { billPayData.Errors.Add(new BusinessError { ErrorCategory = "AC Exception", ErrorCode = acExp.ErrorCode.ToString(), Message = acExp.Message }); } return(billPayData); }