code: @RequestMapping(value = "/hosted/create-payment", method = RequestMethod.POST)
      public String createPaymentHostedJson(HttpServletRequest request, @RequestParam("performCheckout") Boolean performCheckout) throws PaymentException {
          Payment createdPayment = paymentService.createPayPalPaymentForCurrentOrder(performCheckout);
          String redirect = getApprovalLink(createdPayment);
          if (isAjaxRequest(request)) {
              return "ajaxredirect:" + redirect;
          }
          return "redirect:" + redirect;
      }
docs: ***********************************************