public async Task ThenTheCallToHmrcIsPerformed()
        {
            //Act
            await _employerAccountPayeOrchestrator.GetPayeConfirmModel("1", "1", "", null);

            //Assert
            _mediator.Verify(x => x.SendAsync(It.Is <GetHmrcEmployerInformationQuery>(c => c.AuthToken.Equals("1"))), Times.Once);
        }
Exemple #2
0
        public async Task <ActionResult> ConfirmPayeScheme(string hashedAccountId)
        {
            var gatewayResponseModel = await _employerAccountPayeOrchestrator.GetPayeConfirmModel(hashedAccountId, Request.Params["code"], Url.Action("ConfirmPayeScheme", "EmployerAccountPaye", new { hashedAccountId }, Request.Url.Scheme), System.Web.HttpContext.Current?.Request.QueryString);

            if (gatewayResponseModel.Status == HttpStatusCode.NotAcceptable)
            {
                gatewayResponseModel.Status = HttpStatusCode.OK;

                var model = await _employerAccountPayeOrchestrator.Get(hashedAccountId, OwinWrapper.GetClaimValue(@"sub"));

                model.FlashMessage = gatewayResponseModel.FlashMessage;

                return(View("Index", model));
            }
            return(View(gatewayResponseModel));
        }
        public async Task <ActionResult> ConfirmPayeScheme(string hashedAccountId)
        {
            var gatewayResponseModel = await _employerAccountPayeOrchestrator.GetPayeConfirmModel(
                hashedAccountId,
                Request.Params[ControllerConstants.CodeKeyName],
                Url.Action(ControllerConstants.ConfirmPayeSchemeActionName, ControllerConstants.EmployerAccountPayeControllerName, new { hashedAccountId }, Request.Url?.Scheme),
                System.Web.HttpContext.Current?.Request.QueryString);

            if (gatewayResponseModel.Status == HttpStatusCode.NotAcceptable)
            {
                gatewayResponseModel.Status = HttpStatusCode.OK;

                var model = await _employerAccountPayeOrchestrator.Get(hashedAccountId, OwinWrapper.GetClaimValue(ControllerConstants.UserRefClaimKeyName));

                model.FlashMessage = gatewayResponseModel.FlashMessage;

                return(View(ControllerConstants.IndexActionName, model));
            }
            return(View(gatewayResponseModel));
        }