Class AccommodationDelayedPaymentInfoStrategy

java.lang.Object
de.hybris.platform.travelservices.strategies.payment.impl.AbstractPaymentInfoStrategy
de.hybris.platform.travelservices.strategies.payment.impl.AccommodationDelayedPaymentInfoStrategy
All Implemented Interfaces:
EntryTypePaymentInfoCreationStrategy

public class AccommodationDelayedPaymentInfoStrategy extends AbstractPaymentInfoStrategy implements EntryTypePaymentInfoCreationStrategy
The type Accommodation delayed payment info strategy.
  • Constructor Details

    • AccommodationDelayedPaymentInfoStrategy

      public AccommodationDelayedPaymentInfoStrategy()
  • Method Details

    • create

      public List<EntryTypePaymentInfo> create(AbstractOrderModel abstractOrder)
      Description copied from interface: EntryTypePaymentInfoCreationStrategy
      Create list.
      Specified by:
      create in interface EntryTypePaymentInfoCreationStrategy
      Parameters:
      abstractOrder - the abstract order
      Returns:
      the list
    • setAmounts

      protected void setAmounts(List<GuaranteeModel> guarantees, AccommodationOrderEntryGroupModel group, EntryTypePaymentInfo paymentInfo, AbstractOrderModel abstractOrder)
      Calculates amounts to be populated against the EntryTypePaymentInfo. Is the group is being amended, an amended total to pay is calculated then the booking amount is calculated as difference between this value and the total already paid. In the normal order journey calculating the guarantee amount is enough. After calculating the booking time amount, if the applied guarantee is not a prepayment, a search is performed along rate plan's guarantees and if a valid prepayment is found it's eventually used to populate the prepayment amount along with the relative deadline.
      Parameters:
      guarantees -
      group -
      paymentInfo -
      abstractOrder -
    • getTotalToPay

      protected Double getTotalToPay(GuaranteeModel guaranteeToApply, AccommodationOrderEntryGroupModel group, AbstractOrderModel abstractOrder)
      Calculates total to pay at booking time, applying guarantee to the rate plan total.
      Parameters:
      guaranteeToApply -
      group -
      abstractOrder -
      Returns:
    • handlePrePayment

      protected void handlePrePayment(List<GuaranteeModel> guarantees, EntryTypePaymentInfo paymentInfo, AccommodationOrderEntryGroupModel group, Double appliedGuaranteeAmount, AbstractOrderModel abstractOrder)
      Calculates prepayment value, if needed
      Parameters:
      guarantees -
      paymentInfo -
      group -
      appliedGuaranteeAmount -
      abstractOrder -
    • isGroupWithEntriesOfSameAmendStatus

      protected boolean isGroupWithEntriesOfSameAmendStatus(AccommodationOrderEntryGroupModel group)
    • getGuaranteeAmount

      protected Double getGuaranteeAmount(Double amountPercent, Double totalPrice)
    • isGroupBeingAmended

      protected boolean isGroupBeingAmended(AccommodationOrderEntryGroupModel group, AbstractOrderModel abstractOrder)
      Determines if the group is being amended. A group in considered amended if an original order exists (that is the order is being amended), among all the groups associated with the original order there is a group sharing the same room stay reference number with the current group, and the current group has at least one entry in CHANGED or NEW status.
      Parameters:
      group -
      abstractOrder -
      Returns:
    • getRoomRatesTotalWithDiscounts

      protected Double getRoomRatesTotalWithDiscounts(AbstractOrderModel abstractOrder, Double paymentTotal, AccommodationOrderEntryGroupModel group)
      The global discount in the cart is distributed on each entry in the cart. Calculate the roomRate total by applying the distributed discount and compensating the total Tax value.
      Parameters:
      abstractOrder -
      paymentTotal -
      group -
      Returns:
    • getGroupTotalPrice

      protected double getGroupTotalPrice(AccommodationOrderEntryGroupModel group)
      Calculates total price of all the entries in a group.
      Parameters:
      group -
      Returns:
    • getRatePlanService

      protected RatePlanService getRatePlanService()
      Returns:
      ratePlanService
    • setRatePlanService

      public void setRatePlanService(RatePlanService ratePlanService)
      Parameters:
      ratePlanService - the ratePlanService to set
    • getTimeService

      protected de.hybris.platform.servicelayer.time.TimeService getTimeService()
      Returns:
      the timeService
    • setTimeService

      public void setTimeService(de.hybris.platform.servicelayer.time.TimeService timeService)
      Parameters:
      timeService - timeService to set