Ejemplo n.º 1
0
        public ReceiveData SingleValidateForReceive(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);

                // Validate Receive
                _validationOperations.RecvValidate(receiveData, receiveData.ReceiveRequest.ThirdPartyType);
                if (DataErrorHandler.CheckForNestedErrors(receiveData).Any())
                {
                    throw new AgentConnectException();
                }
            }
            catch (AgentConnectException acExp)
            {
                receiveData.Set(new BusinessError
                {
                    ErrorCategory = "AC Exception",
                    ErrorCode     = acExp.ErrorCode.ToString(),
                    Message       = acExp.Message
                });
            }
            return(receiveData);
        }
Ejemplo n.º 2
0
 public SendData SingleValidateForExistingSender(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);
         }
         // Single Validate
         _validationOperations.SendValidate(sendData);
     }
     catch (AgentConnectException acExp)
     {
         sendData.Set(new BusinessError
         {
             ErrorCategory = "AC Exception",
             ErrorCode     = acExp.ErrorCode.ToString(),
             Message       = acExp.Message
         });
     }
     return(sendData);
 }
Ejemplo n.º 3
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);
        }