public override ITransactionResult Transaction(object parameters)
        {
            var billPayParams = (BillPayParameters)parameters;

            TestConfig.TestSettings = new IntegrationTestSettingsModel {
                AcEnvironment = billPayParams.Environment
            };

            var amtRangeParsed = Enum.TryParse(billPayParams.AmtRange, true, out AmountRange amtRange);
            var billPayRequest = new BillPayOperationRequest
            {
                Biller = new TestBiller {
                    Code = billPayParams?.BillerCode, ValidAccountNumber = billPayParams?.BillerAccountNumber
                },
                AmtRange       = amtRangeParsed ? amtRange : AmountRange.CustomAmount,
                Amount         = (double)billPayParams.CustomAmount,
                AgentState     = billPayParams.GetAgentState(),
                ThirdPartyType = billPayParams.ThirdPartyType,
                AgentId        = billPayParams.AgentId,
                AgentPos       = billPayParams.AgentPos
            };

            billPayRequest.PopulateAgentData(billPayParams.AgentState);
            var billPayData = new BillPayData(billPayRequest);

            _billPayOperations.CompleteStagedSession(billPayData);

            return(new TransactionResult {
                Result = billPayData
            });
        }
Пример #2
0
        public void BillPay_ConsumerHistoryLookup_ConsumerDoesNotExist()
        {
            var request = new BillPayOperationRequest
            {
                AgentState     = AgentLocation.MN,
                ThirdPartyType = TestThirdPartyType.None
            };

            request.PopulateAgentData(request.AgentState);

            var billPayData = new BillPayData(request);

            _billPayOperations.ConsumerHistoryLookupForNonExistingCustomer(billPayData);

            Assert.IsNull(billPayData.ConsumerHistoryLookupResponse.Payload.SenderInfos);
        }
Пример #3
0
        public void BillPay_BillerSearchByReceiveCode()
        {
            var request = new BillPayOperationRequest
            {
                AgentState     = AgentLocation.MN,
                Biller         = Billers.Ford,
                ThirdPartyType = TestThirdPartyType.None
            };

            request.PopulateAgentData(request.AgentState);

            var billPayData = new BillPayData(request);

            _billPayOperations.BillerSearchByCode(billPayData);

            Assert.IsTrue(billPayData.BillerSearchResponse.Payload.BillerInfo.Any());
        }
Пример #4
0
        [Ignore] //test dependent on AC and currently failing
        public void TrainingMode_BillPay_CompleteRequest()
        {
            var request = new BillPayOperationRequest
            {
                AgentState = AgentLocation.MN,
                Biller = Billers.HubbardAttorney,
                AmtRange = AmountRange.NoIdsNoThirdParty,
                ThirdPartyType = TestThirdPartyType.None
            };
            request.PopulateAgentData(request.AgentState, true);
            var billPayData = new BillPayData(request);
            _billPayOperations.CompleteSession(billPayData);

            var completeSessionResponse = billPayData.CompleteSessionResponse;

            Assert.IsFalse(string.IsNullOrEmpty(completeSessionResponse.Payload.ReferenceNumber));
        }
Пример #5
0
        public void BillPay_FeeLookup()
        {
            var request = new BillPayOperationRequest
            {
                AgentState     = AgentLocation.MN,
                Biller         = Billers.HubbardAttorney,
                AmtRange       = AmountRange.NoIdsNoThirdParty,
                ThirdPartyType = TestThirdPartyType.None
            };

            request.PopulateAgentData(request.AgentState);

            var billPayData = new BillPayData(request);

            _billPayOperations.FeeLookupForReceiveCode(billPayData);

            Assert.IsTrue(billPayData.FeeLookup.FeeLookupResp.Payload.FeeInfos.Any());
        }
Пример #6
0
        public void BillPay_ValidationUntilReadyForCommit()
        {
            var request = new BillPayOperationRequest
            {
                AgentState     = AgentLocation.MN,
                Biller         = Billers.HubbardAttorney,
                AmtRange       = AmountRange.NoIdsNoThirdParty,
                ThirdPartyType = TestThirdPartyType.None
            };

            request.PopulateAgentData(request.AgentState);
            var billPayData = new BillPayData(request);

            _billPayOperations.ValidateUntilReadyForCommit(billPayData);

            var validationResponse = billPayData.BillPayValidationResponseList.Last();

            Assert.IsTrue(validationResponse.Payload.ReadyForCommit);
        }
Пример #7
0
        public void BillPay_ValidateShouldReturnFieldsToCollectWithNoIdsOrThirdParty()
        {
            var request = new BillPayOperationRequest
            {
                AgentState     = AgentLocation.MN,
                Biller         = Billers.HubbardAttorney,
                AmtRange       = AmountRange.NoIdsNoThirdParty,
                ThirdPartyType = TestThirdPartyType.None
            };

            request.PopulateAgentData(request.AgentState);
            var billPayData = new BillPayData(request);

            _billPayOperations.SingleValidate(billPayData);

            var validationResponse = billPayData.BillPayValidationResponseList.First();

            Assert.IsTrue(validationResponse.Payload.FieldsToCollect.Any());
        }
Пример #8
0
        public void StagingBillPay_TwoId()
        {
            var request = new BillPayOperationRequest
            {
                AgentState     = AgentLocation.MN,
                Biller         = Billers.HubbardAttorney,
                AmtRange       = AmountRange.TwoIds,
                ThirdPartyType = TestThirdPartyType.None
            };

            request.PopulateAgentData(request.AgentState);
            var billPayData = new BillPayData(request);

            _billPayOperations.CompleteStagedSession(billPayData);

            var completeSessionResponse = billPayData.CompleteSessionResponse;

            Assert.IsFalse(billPayData.BillPayValidationResponseList.First().Errors.Any(), $" {Environment.NewLine}Errors: {Environment.NewLine}{billPayData.BillPayValidationResponseList.First().Errors?.Log()}");
            Assert.IsFalse(completeSessionResponse.Errors.Any(), $" {Environment.NewLine}Errors: {Environment.NewLine}{completeSessionResponse.Errors?.Log()}");
        }
Пример #9
0
        public void BillPay_ValidateShouldReturnFieldsToCollectWithThirdPartyType()
        {
            var request = new BillPayOperationRequest
            {
                AgentState     = AgentLocation.MN,
                Biller         = Billers.HubbardAttorney,
                AmtRange       = AmountRange.ThirdParty,
                ThirdPartyType = TestThirdPartyType.None
            };

            request.PopulateAgentData(request.AgentState);
            var billPayData = new BillPayData(request);

            _billPayOperations.SingleValidate(billPayData);

            var validationResponse = billPayData.BillPayValidationResponseList.First();

            var containsThirdPartyCategory = ContainsCategory(validationResponse.Payload.FieldsToCollect,
                                                              "billPayTPSenderInformationSet");

            Assert.IsTrue(containsThirdPartyCategory, "Ensure that profile editor limits for bill pay are configured properly in the current environment");
        }