@Test public void doHandleBankTransferHopFailureShouldRedirectToPaymentPageWithErrorMessage() { when(redirectAuthoriseResultConverterMock.convert(anyMapOf(String.class, String.class))).thenReturn(redirectAuthoriseResultMock); final String result = testObj.doHandleBankTransferHopFailure(mockHttpServletRequest, redirectAttributesMock); verify(redirectAttributesMock).addFlashAttribute(PAYMENT_STATUS_PARAMETER_NAME, REFUSED.name()); assertEquals(REDIRECT_URL_CHOOSE_PAYMENT_METHOD, result); }
@RequireHardLogIn @RequestMapping(value = "bank-transfer/hop-failure", method = RequestMethod.GET) public String doHandleBankTransferHopFailure(final HttpServletRequest request, final RedirectAttributes redirectAttributes) { final Map<String, String> requestParameterMap = getRequestParameterMap(request); LOG.info(format("Failed to complete bank transfer for selected payment method. request params {0}", requestParameterMap)); redirectAttributes.addFlashAttribute(PAYMENT_STATUS_PARAMETER_NAME, REFUSED.name()); return REDIRECT_URL_CHOOSE_PAYMENT_METHOD; }
WorldpayHopResponseController extends WorldpayChoosePaymentMethodCheckoutStepController { @RequireHardLogIn @RequestMapping(value = "bank-transfer/hop-failure", method = RequestMethod.GET) public String doHandleBankTransferHopFailure(final HttpServletRequest request, final RedirectAttributes redirectAttributes) { final Map<String, String> requestParameterMap = getRequestParameterMap(request); LOG.info(format("Failed to complete bank transfer for selected payment method. request params {0}", requestParameterMap)); redirectAttributes.addFlashAttribute(PAYMENT_STATUS_PARAMETER_NAME, REFUSED.name()); return REDIRECT_URL_CHOOSE_PAYMENT_METHOD; } }
WorldpayHopResponseController extends WorldpayChoosePaymentMethodCheckoutStepController { @RequireHardLogIn @RequestMapping(value = "bank-transfer/hop-failure", method = RequestMethod.GET) public String doHandleBankTransferHopFailure(final HttpServletRequest request, final RedirectAttributes redirectAttributes) { final Map<String, String> requestParameterMap = getRequestParameterMap(request); LOG.info(format("Failed to complete bank transfer for selected payment method. request params {0}", requestParameterMap)); redirectAttributes.addFlashAttribute(PAYMENT_STATUS_PARAMETER_NAME, REFUSED.name()); return REDIRECT_URL_CHOOSE_PAYMENT_METHOD; }  }
WorldpayHopResponseController extends WorldpayChoosePaymentMethodCheckoutStepController { @RequireHardLogIn @RequestMapping(value = "bank-transfer/hop-failure", method = RequestMethod.GET) public String doHandleBankTransferHopFailure(final HttpServletRequest request, final RedirectAttributes redirectAttributes) { final Map<String, String> requestParameterMap = getRequestParameterMap(request); LOG.info(format("Failed to complete bank transfer for selected payment method. request params {0}", requestParameterMap)); redirectAttributes.addFlashAttribute(PAYMENT_STATUS_PARAMETER_NAME, REFUSED.name()); return REDIRECT_URL_CHOOSE_PAYMENT_METHOD; }  @RequireHardLogIn @RequestMapping(value = "/hop-response", method = RequestMethod.GET) String doHandleHopResponse(final HttpServletRequest request, final Model model, final RedirectAttributes redirectAttributes); @RequireHardLogIn @RequestMapping(value = "/hop-pending", method = RequestMethod.GET) String doHandlePendingHopResponse(final HttpServletRequest request, final Model model, final RedirectAttributes redirectAttributes); @RequireHardLogIn @RequestMapping(value = "bank-transfer/hop-response", method = RequestMethod.GET) String doHandleBankTransferHopResponse(final HttpServletRequest request, final Model model, final RedirectAttributes redirectAttributes); @RequireHardLogIn @RequestMapping(value = "bank-transfer/hop-failure", method = RequestMethod.GET) String doHandleBankTransferHopFailure(final HttpServletRequest request, final RedirectAttributes redirectAttributes); @RequestMapping(value = "/hop-cancel", method = RequestMethod.GET) @RequireHardLogIn String doCancelPayment(); @RequestMapping(value = "/error", method = RequestMethod.GET) @RequireHardLogIn String doHostedOrderPageError(@RequestParam(value = "paymentStatus", required = false) final String paymentStatus, final RedirectAttributes redirectAttributes); @RequestMapping(value = "/billingaddressform", method = RequestMethod.GET) String getCountryAddressForm(@RequestParam("countryIsoCode") final String countryIsoCode,
                                        @RequestParam("useDeliveryAddress") final boolean useDeliveryAddress, final Model model); }
WorldpayHopResponseController extends WorldpayChoosePaymentMethodCheckoutStepController { @RequireHardLogIn @RequestMapping(value = "bank-transfer/hop-failure", method = RequestMethod.GET) public String doHandleBankTransferHopFailure(final HttpServletRequest request, final RedirectAttributes redirectAttributes) { final Map<String, String> requestParameterMap = getRequestParameterMap(request); LOG.info(format("Failed to complete bank transfer for selected payment method. request params {0}", requestParameterMap)); redirectAttributes.addFlashAttribute(PAYMENT_STATUS_PARAMETER_NAME, REFUSED.name()); return REDIRECT_URL_CHOOSE_PAYMENT_METHOD; }  @RequireHardLogIn @RequestMapping(value = "/hop-response", method = RequestMethod.GET) String doHandleHopResponse(final HttpServletRequest request, final Model model, final RedirectAttributes redirectAttributes); @RequireHardLogIn @RequestMapping(value = "/hop-pending", method = RequestMethod.GET) String doHandlePendingHopResponse(final HttpServletRequest request, final Model model, final RedirectAttributes redirectAttributes); @RequireHardLogIn @RequestMapping(value = "bank-transfer/hop-response", method = RequestMethod.GET) String doHandleBankTransferHopResponse(final HttpServletRequest request, final Model model, final RedirectAttributes redirectAttributes); @RequireHardLogIn @RequestMapping(value = "bank-transfer/hop-failure", method = RequestMethod.GET) String doHandleBankTransferHopFailure(final HttpServletRequest request, final RedirectAttributes redirectAttributes); @RequestMapping(value = "/hop-cancel", method = RequestMethod.GET) @RequireHardLogIn String doCancelPayment(); @RequestMapping(value = "/error", method = RequestMethod.GET) @RequireHardLogIn String doHostedOrderPageError(@RequestParam(value = "paymentStatus", required = false) final String paymentStatus, final RedirectAttributes redirectAttributes); @RequestMapping(value = "/billingaddressform", method = RequestMethod.GET) String getCountryAddressForm(@RequestParam("countryIsoCode") final String countryIsoCode,
                                        @RequestParam("useDeliveryAddress") final boolean useDeliveryAddress, final Model model);  }