Beispiel #1
0
        public async Task <IActionResult> AmendBankDetails(AmendBankDetailsViewModel model)
        {
            var confirmationActionUrl = Url.Action("Index", "Hub", new { model.AccountId, model.AccountLegalEntityId });
            var returnUrl             = $"{Request.Scheme}://{Request.Host}{Request.PathBase}{confirmationActionUrl}";
            var achieveServiceUrl     = await _verificationService.BuildAchieveServiceUrl(model.AccountId, model.AccountLegalEntityId, model.ApplicationId, returnUrl, amendBankDetails : true);

            return(Redirect(achieveServiceUrl));
        }
Beispiel #2
0
        public async Task <IActionResult> AmendBankDetails(string accountId, Guid applicationId)
        {
            var application = await _applicationService.Get(accountId, applicationId, false, includeSubmitted : true);

            var legalEntity = await _legalEntitiesService.Get(accountId, application.AccountLegalEntityId);

            var model = new AmendBankDetailsViewModel(accountId, application.AccountLegalEntityId, applicationId, legalEntity.Name);

            return(View(model));
        }
        public async Task Then_the_redirect_to_the_achieve_service_is_generated_for_the_amend_vendor_journey()
        {
            // Arrange
            var application = _fixture.Create <ApplicationModel>();

            _applicationService.Setup(x => x.Get(_accountId, _applicationId, false, true)).ReturnsAsync(application);
            var legalEntity = _fixture.Create <LegalEntityModel>();

            var achieveServiceUrl = _fixture.Create <string>();

            _verificationService.Setup(x => x.BuildAchieveServiceUrl(_accountId, _accountLegalEntityId, _applicationId, It.IsAny <string>(), true)).ReturnsAsync(achieveServiceUrl);

            var model = new AmendBankDetailsViewModel(_accountId, _accountLegalEntityId, _applicationId, legalEntity.Name);

            // Act
            var redirectResult = await _sut.AmendBankDetails(model) as RedirectResult;

            // Assert
            redirectResult.Should().NotBeNull();
            redirectResult.Url.Should().Be(achieveServiceUrl);
        }