public ReceiveValidationResponse ReceiveValidation(ReceiveValidationRequest receiveValidationReq)
        {
            var agent    = AuthIntegration.GetAgent();
            var response = _agentConnect.ReceiveValidation(agent, receiveValidationReq);

            CheckFlagsForDataChange(response.Payload?.Flags, agent);
            return(response);
        }
Beispiel #2
0
 public override ReceiveValidationResponse ReceiveValidation(Agent agent, ReceiveValidationRequest receiveValidationRequest)
 {
     if (agent.IsInTrainingMode)
     {
         bool isOnDt4 = GetProfileItem(agent, UseOurPaperKey);
         return(_traingModeRepository.MockReceiveValidationResponse(receiveValidationRequest.MgiSessionID, receiveValidationRequest.FieldValues, isOnDt4));
     }
     return(base.ReceiveValidation(agent, receiveValidationRequest));
 }
        public static ReceiveValidationRequest FromTransactionLookup(this ReceiveValidationRequest recvValReq, TransactionLookupResponsePayload transactionResponsePayload)
        {
            var sessionId = transactionResponsePayload.MgiSessionID;
            var currency  = transactionResponsePayload.ReceiveAmounts;

            recvValReq.ReceiveAmount   = currency.ReceiveAmount.Value;
            recvValReq.ReceiveCurrency = currency.ReceiveCurrency;
            recvValReq.MgiSessionID    = sessionId;
            return(recvValReq);
        }
        private static ReceiveValidationRequest MapFieldValues(ReceiveValidationRequest recvValReq, List <KeyValuePairType> populatedFields, List <string> requestedInfoKeys, ReceiveValidationRequest previousRequest, List <string> monitoredListOfFieldsToCollect)
        {
            if (populatedFields == null)
            {
                return(recvValReq);
            }
            var availableKeys = populatedFields.Select(x => x.InfoKey).ToList();
            var keysToMap     = availableKeys.Union(requestedInfoKeys);

            foreach (var key in keysToMap)
            {
                if (availableKeys.Contains(key))
                {
                    var pairToAdd = populatedFields.Where(k => k.InfoKey == key).FirstOrDefault();
                    if (!recvValReq.FieldValues.Any(x => x.InfoKey == pairToAdd.InfoKey))
                    {
                        if (!string.IsNullOrWhiteSpace(pairToAdd.Value))
                        {
                            recvValReq.FieldValues.Add(pairToAdd);
                            if (monitoredListOfFieldsToCollect != null && monitoredListOfFieldsToCollect.Contains(pairToAdd.InfoKey))
                            {
                                monitoredListOfFieldsToCollect.Remove(pairToAdd.InfoKey);
                            }
                        }
                    }
                }
            }
            if (previousRequest != null && previousRequest.FieldValues.Any())
            {
                foreach (var keyPair in previousRequest.FieldValues)
                {
                    if (!recvValReq.FieldValues.Any(x => x.InfoKey == keyPair.InfoKey))
                    {
                        recvValReq.FieldValues.Add(keyPair);
                        if (monitoredListOfFieldsToCollect != null && monitoredListOfFieldsToCollect.Contains(keyPair.InfoKey))
                        {
                            monitoredListOfFieldsToCollect.Remove(keyPair.InfoKey);
                        }
                    }
                }
            }
            return(recvValReq);
        }
Beispiel #5
0
 public virtual async Task <ReceiveValidationResponse> ReceiveValidationAsync(Agent agent, ReceiveValidationRequest receiveValidationRequest)
 {
     return(await AgentConnect.ReceiveValidationAsync(agent, receiveValidationRequest));
 }
Beispiel #6
0
 public virtual ReceiveValidationResponse ReceiveValidation(Agent agent, ReceiveValidationRequest receiveValidationRequest)
 {
     return(AgentConnect.ReceiveValidation(agent, receiveValidationRequest));
 }
        public IHttpActionResult ReceiveValidation([FromBody] ReceiveValidationRequest req)
        {
            var recvValidateRespVm = _receiveBusiness.ReceiveValidation(req);

            return(Ok(recvValidateRespVm));
        }
        public IHttpActionResult ReceiveValidation(ReceiveValidationRequest receiveValidationRequest)
        {
            var receiveValidateRespVm = _receiveBusiness.ReceiveValidation(receiveValidationRequest);

            return(Ok(receiveValidateRespVm));
        }
        public AcApiResponse <ReceiveValidationResponse, ReceiptsApiData> ReceiveValidation(ReceiveValidationRequest req)
        {
            // AgentConnect Validate call for RECV
            var resp = _agentConnectIntegration.ReceiveValidation(req);

            var additionalData = ReceiptHelper.GenerateAdditionalDataReceipts(resp.Payload?.Receipts, _receiptIntegration);

            // Map: Response Domain->Response View Model
            var apiResp = new AcApiResponse <ReceiveValidationResponse, ReceiptsApiData>
            {
                BusinessMetadata = MapperHelper.SetResponseProperties(resp.Payload?.Flags, DataSource.AgentConnect),
                ResponseData     = resp,
                AdditionalData   = additionalData
            };

            return(apiResp);
        }