Ejemplo n.º 1
0
        public BillPayData BillerSearchByCode(BillPayData billPayData)
        {
            billPayData.Set(BillPayBillerSearchRequestFactory.BillerSearchRequestByCodeForEP(billPayData.BillPayRequest.Biller.Code));
            billPayData.Set(_acIntegration.BillerSearch(billPayData.BillPayRequest.AgentId, billPayData.BillPayRequest.AgentPos, billPayData.BillerSearchRequest));

            return(billPayData);
        }
Ejemplo n.º 2
0
        public BillPayData ConsumerHistoryLookupForExistingCustomer(BillPayData billPayData)
        {
            billPayData.Set(ConsumerHistoryLookupRequestFactory.ConsumerHistoryLookupRequestExisting);
            billPayData.ConsumerHistoryLookupRequest.MgiSessionType = SessionType.BP;
            billPayData.Set(_acIntegration.ConsumerHistoryLookup(billPayData.BillPayRequest.AgentId, billPayData.BillPayRequest.AgentPos, true));

            return(billPayData);
        }
Ejemplo n.º 3
0
        public BillPayData ConsumerHistoryLookupForNonExistingCustomer(BillPayData billPayData)
        {
            var consumerHistoryLookupRequest = ConsumerHistoryLookupRequestFactory.ConsumerHistoryLookupRequestNonExisting;

            consumerHistoryLookupRequest.AgentID       = billPayData.BillPayRequest.AgentId;
            consumerHistoryLookupRequest.AgentSequence = billPayData.BillPayRequest.AgentPos;
            billPayData.Set(consumerHistoryLookupRequest);
            billPayData.ConsumerHistoryLookupRequest.MgiSessionType = SessionType.BP;
            billPayData.Set(_acIntegration.ConsumerHistoryLookup(billPayData.ConsumerHistoryLookupRequest));

            return(billPayData);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        private BillPayData InitialValidation(BillPayData billPayData)
        {
            var feeInfo    = billPayData.FeeLookup.FeeLookupResp.Payload.FeeInfos.FirstOrDefault();
            var billerInfo = billPayData.BillerSearchResponse.Payload.BillerInfo.FirstOrDefault();

            var validationRequest = BillPayValidationRequestFactory.InitialValidationForEp(feeInfo, billerInfo);

            if (billPayData.BillPayRequest.Staging)
            {
                validationRequest.TransactionStaging = true;
            }
            validationRequest.AgentID       = billPayData.BillPayRequest.AgentId;
            validationRequest.AgentSequence = billPayData.BillPayRequest.AgentPos;
            var validationResponse = _acIntegration.BPValidation(validationRequest);

            billPayData.Set(validationRequest);
            billPayData.Set(validationResponse);

            return(billPayData);
        }
Ejemplo n.º 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);
        }