示例#1
0
 public ReceiveData ReceiveComplete(ReceiveData receiveData)
 {
     try
     {
         receiveData.ReceiveRequest.PopulateAgentData(receiveData.ReceiveRequest.AgentState);
         // Get the all fields grouping and types for generation
         receiveData.Set(_gafOperations.GetInfoKeysWithGroupTypes(receiveData.ReceiveRequest.AgentId, receiveData.ReceiveRequest.AgentPos, receiveData.GafInfoKeysWithGroups, GetAllFieldsTransactionType.Receive));
         // Transaction Lookup Request
         CreateTransactionLookupRequest(receiveData);
         // Transaction Lookup Response
         TransactionLookup(receiveData);
         // Initial Validate Receive
         _validationOperations.RecvValidate(receiveData, receiveData.ReceiveRequest.ThirdPartyType);
         if (DataErrorHandler.CheckForNestedErrors(receiveData).Any())
         {
             throw new AgentConnectException();
         }
         _validationOperations.RecvValidateUntilReadyForCommit(receiveData);
         if (DataErrorHandler.CheckForNestedErrors(receiveData).Any())
         {
             throw new AgentConnectException();
         }
         CompleteSession(receiveData);
     }
     catch (AgentConnectException acExp)
     {
         receiveData.Set(new BusinessError
         {
             ErrorCategory = "AC Exception",
             ErrorCode     = acExp.ErrorCode.ToString(),
             Message       = acExp.Message
         });
     }
     return(receiveData);
 }
示例#2
0
 public SendData ValidateUntilReadyForCommit(SendData sendData)
 {
     try
     {
         // Get the all fields grouping and types for generation
         sendData.Set(_gafOperations.GetInfoKeysWithGroupTypes(sendData.SendRequest.AgentId, sendData.SendRequest.AgentPos, sendData.GafInfoKeysWithGroups, GetAllFieldsTransactionType.Send));
         // Consumer History Lookup
         ConsumerHistoryLookupForExistingCustomer(sendData);
         if (DataErrorHandler.CheckForNestedErrors(sendData).Any())
         {
             return(sendData);
         }
         // Fee Lookup
         FeeLookup(sendData);
         if (DataErrorHandler.CheckForNestedErrors(sendData).Any())
         {
             return(sendData);
         }
         // Initial Validate
         _validationOperations.SendValidate(sendData);
         // Final Validate(s)
         _validationOperations.SendValidateUntilReadyForCommit(sendData);
     }
     catch (AgentConnectException acExp)
     {
         sendData.Set(new BusinessError
         {
             ErrorCategory = "AC Exception",
             ErrorCode     = acExp.ErrorCode.ToString(),
             Message       = acExp.Message
         });
     }
     return(sendData);
 }
示例#3
0
        public BillPayData CompleteStagedSession(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, staging: true);
                // Final Validate(s)
                _validationOperations.BillPayValidateUntilReadyForCommit(billPayData, billPayData.BillPayRequest.Biller, true, billPayData.BillPayRequest.ThirdPartyType);

                CompleteStaged(billPayData);
            }
            catch (AgentConnectException acExp)
            {
                billPayData.Errors.Add(new BusinessError
                {
                    ErrorCategory = "AC Exception",
                    ErrorCode     = acExp.ErrorCode.ToString(),
                    Message       = acExp.Message
                });
            }
            return(billPayData);
        }
示例#4
0
        public AmendData SingleValidate(AmendData amendData)
        {
            try
            {
                // Get the all fields grouping and types for generation
                amendData.Set(_gafOperations.GetInfoKeysWithGroupTypes(amendData.AmendOperationRequest.AgentId, amendData.AmendOperationRequest.AgentPos, amendData.GafInfoKeysWithGroups, GetAllFieldsTransactionType.Amend));

                // Transaction Lookup
                TransactionLookup(amendData);
                if (DataErrorHandler.CheckForNestedErrors(amendData).Any())
                {
                    return(amendData);
                }

                if (amendData.TransactionLookup.TransactionLookupResp.Payload.TransactionStatus != TransactionStatusType.AVAIL)
                {
                    var error = new BusinessError
                    {
                        ErrorCategory = "Custom Error",
                        ErrorCode     = string.Empty,
                        Message       = "Transaction not available for AMEND."
                    };

                    amendData.Set(error);
                }
                // Validate Receive
                _validationOperations.AmendValidate(amendData);
            }
            catch (AgentConnectException acExp)
            {
                var error = new BusinessError
                {
                    ErrorCategory = "AC Exception",
                    ErrorCode     = acExp.ErrorCode.ToString(),
                    Message       = acExp.Message
                };

                amendData.Set(error);
            }
            return(amendData);
        }
        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);
        }
示例#6
0
        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);
        }
示例#7
0
        public AmendData AmendComplete(AmendData amendData)
        {
            try
            {
                // Get the all fields grouping and types for generation
                _gafOperations.GetInfoKeysWithGroupTypes(amendData.AmendOperationRequest.AgentId, amendData.AmendOperationRequest.AgentPos, amendData.GafInfoKeysWithGroups, GetAllFieldsTransactionType.Amend);

                // Transaction Lookup
                TransactionLookup(amendData);
                if (DataErrorHandler.CheckForNestedErrors(amendData).Any())
                {
                    return(amendData);
                }

                if (amendData.TransactionLookup.TransactionLookupResp.Payload.TransactionStatus != TransactionStatusType.AVAIL)
                {
                    var error = new BusinessError
                    {
                        ErrorCategory = "Custom Error",
                        ErrorCode     = string.Empty,
                        Message       = "Transaction not available for AMEND."
                    };

                    amendData.Set(error);
                }

                // Validate Amend
                _validationOperations.AmendValidate(amendData);

                // Final Validate(s)
                _validationOperations.AmendValidateUntilReadyForCommit(amendData);
                if (DataErrorHandler.CheckForNestedErrors(amendData).Any())
                {
                    return(amendData);
                }
                if (amendData.ValidationResponses.Last().Payload.ReadyForCommit)
                {
                    CompleteSession(amendData);
                }
                else
                {
                    var error = new BusinessError
                    {
                        ErrorCategory = "Custom Error",
                        ErrorCode     = string.Empty,
                        Message       = "Not ready to commit yet"
                    };

                    amendData.Set(error);
                }
            }
            catch (AgentConnectException acExp)
            {
                var error = new BusinessError
                {
                    ErrorCategory = "AC Exception",
                    ErrorCode     = acExp.ErrorCode.ToString(),
                    Message       = acExp.Message
                };

                amendData.Set(error);
            }
            return(amendData);
        }
        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);
        }