Class PaymentMethodCheckoutStepController

All Implemented Interfaces:
CheckoutStepController
Direct Known Subclasses:
HopPaymentResponseController, SopPaymentResponseController

@Controller @RequestMapping("/checkout/multi/payment-method") public class PaymentMethodCheckoutStepController extends AbstractCheckoutStepController
The type Payment method checkout step controller.
  • Field Details

    • CYBERSOURCE_SOP_CARD_TYPES

      protected static final Map<String,String> CYBERSOURCE_SOP_CARD_TYPES
  • Constructor Details

    • PaymentMethodCheckoutStepController

      public PaymentMethodCheckoutStepController()
  • Method Details

    • getBillingCountries

      @ModelAttribute("billingCountries") public Collection<CountryData> getBillingCountries()
    • getCardTypes

      @ModelAttribute("cardTypes") public Collection<CardTypeData> getCardTypes()
    • getMonths

      @ModelAttribute("months") protected List<AbstractCheckoutController.SelectOption> getMonths()
    • getStartYears

      @ModelAttribute("startYears") public List<AbstractCheckoutController.SelectOption> getStartYears()
    • getExpiryYears

      @ModelAttribute("expiryYears") public List<AbstractCheckoutController.SelectOption> getExpiryYears()
    • initCheck

      @RequestMapping(value="/select-flow", method=GET) public String initCheck(org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel, @RequestParam(value="pci",required=false) String pci) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Throws:
      de.hybris.platform.commerceservices.order.CommerceCartModificationException
    • enterStep

      @RequestMapping(value="/add", method=GET) public String enterStep(org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) throws de.hybris.platform.cms2.exceptions.CMSItemNotFoundException
      Description copied from interface: CheckoutStepController
      Swapping the parameter order might break the validation aspect from working.
      Returns:
      returns the result for entering the checkout step
      Throws:
      de.hybris.platform.cms2.exceptions.CMSItemNotFoundException
    • add

      @RequestMapping(value="/add", method=POST) public String add(org.springframework.ui.Model model, @Valid @Valid PaymentDetailsForm paymentDetailsForm, org.springframework.validation.BindingResult bindingResult) throws de.hybris.platform.cms2.exceptions.CMSItemNotFoundException
      Throws:
      de.hybris.platform.cms2.exceptions.CMSItemNotFoundException
    • remove

      @RequestMapping(value="/remove", method=POST) public String remove(@RequestParam("paymentInfoId") String paymentMethodId, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) throws de.hybris.platform.cms2.exceptions.CMSItemNotFoundException
      Throws:
      de.hybris.platform.cms2.exceptions.CMSItemNotFoundException
    • doSelectPaymentMethod

      @RequestMapping(value="/choose", method=GET) public String doSelectPaymentMethod(@RequestParam("selectedPaymentMethodId") String selectedPaymentMethodId, org.springframework.web.servlet.mvc.support.RedirectAttributes model)
      This method gets called when the "Use These Payment Details" button is clicked. It sets the selected payment method on the checkout facade and reloads the page highlighting the selected payment method.
      Parameters:
      selectedPaymentMethodId - - the id of the payment method to use.
      Returns:
      - a URL to the page to load.
    • back

      @RequestMapping(value="/back", method=GET) public String back(org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
      Returns:
      checkoutstep link for navigating back
    • next

      @RequestMapping(value="/next", method=GET) public String next(org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
      Returns:
      checkoutstep link for navigating next
    • isPaymentOptionSelected

      @RequestMapping(value="/check-payment-options", method=GET, produces="application/json") @ResponseBody public SelectPaymentOptionResponseData isPaymentOptionSelected(org.springframework.ui.Model model)
    • buildResponseData

      protected SelectPaymentOptionResponseData buildResponseData(boolean valid, String error)
    • createCardTypeData

      protected CardTypeData createCardTypeData(String code, String name)
    • getReservationCode

      @ModelAttribute("reservationCode") public String getReservationCode()
    • setupAddPaymentPage

      protected void setupAddPaymentPage(org.springframework.ui.Model model) throws de.hybris.platform.cms2.exceptions.CMSItemNotFoundException
      Throws:
      de.hybris.platform.cms2.exceptions.CMSItemNotFoundException
    • setupSilentOrderPostPage

      protected void setupSilentOrderPostPage(SopPaymentDetailsForm sopPaymentDetailsForm, org.springframework.ui.Model model)
    • refund

      protected String refund(org.springframework.ui.Model model, PriceData totalToPay)
      Creates a refund transaction to demonstrate refund process for the order
      Parameters:
      model -
      totalToPay - - for refund it will be a negative value stating how much should be refunded to customer
      Returns:
      booking confirmation if refund was successful, payment details with errors otherwise
    • placeOrder

      protected String placeOrder(org.springframework.ui.Model model)
      Skips the payment part of order process to place order in case there was nothing to pay or refund in amendment journey
      Parameters:
      model -
      Returns:
      booking confirmation if placing order was successful, payment details with errors otherwise
    • redirectToOrderConfirmationPage

      protected String redirectToOrderConfirmationPage(OrderData orderData)
      Overrides:
      redirectToOrderConfirmationPage in class AbstractCheckoutController
    • definePaymentAction

      protected String definePaymentAction(PriceData totalToPay)
      Checks the toPay value to define if user needs to pay or be refunded
      Parameters:
      totalToPay -
      Returns:
      PAY, NO_ACTION or REFUND
    • setModelWithCartVouchers

      protected void setModelWithCartVouchers(org.springframework.ui.Model model)
      Method to retrieve and set all the applied cart vouchers in the model.
      Parameters:
      model -
    • getSopCardTypes

      protected Collection<CardTypeData> getSopCardTypes()
    • getCheckoutStep

      protected CheckoutStep getCheckoutStep()
    • getEnumerationService

      protected de.hybris.platform.enumeration.EnumerationService getEnumerationService()
      Returns:
      the enumerationService
    • setEnumerationService

      public void setEnumerationService(de.hybris.platform.enumeration.EnumerationService enumerationService)
      Parameters:
      enumerationService - the enumerationService to set
    • getTravelCartFacade

      protected TravelCartFacade getTravelCartFacade()
      Returns:
      the travelCartFacade
    • setTravelCartFacade

      public void setTravelCartFacade(TravelCartFacade travelCartFacade)
      Parameters:
      travelCartFacade - the travelCartFacade to set
    • getReservationFacade

      protected ReservationFacade getReservationFacade()
      Returns:
      the reservationFacade
    • setReservationFacade

      public void setReservationFacade(ReservationFacade reservationFacade)
      Parameters:
      reservationFacade - the reservationFacade to set
    • getSessionService

      public de.hybris.platform.servicelayer.session.SessionService getSessionService()
      Overrides:
      getSessionService in class AbstractPageController
      Returns:
      the sessionService
    • setSessionService

      public void setSessionService(de.hybris.platform.servicelayer.session.SessionService sessionService)
      Parameters:
      sessionService - the sessionService to set
    • getBookingFacade

      protected BookingFacade getBookingFacade()
      Returns:
      the bookingFacade
    • setBookingFacade

      public void setBookingFacade(BookingFacade bookingFacade)
      Parameters:
      bookingFacade - the bookingFacade to set