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.
-
Field Summary
Fields inherited from class de.hybris.platform.travelservices.strategies.payment.impl.AbstractPaymentInfoStrategy
SCALE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate(AbstractOrderModel abstractOrder) Create list.protected doubleCalculates total price of all the entries in a group.protected DoublegetGuaranteeAmount(Double amountPercent, Double totalPrice) protected RatePlanServiceprotected DoublegetRoomRatesTotalWithDiscounts(AbstractOrderModel abstractOrder, Double paymentTotal, AccommodationOrderEntryGroupModel group) The global discount in the cart is distributed on each entry in the cart.protected de.hybris.platform.servicelayer.time.TimeServiceprotected DoublegetTotalToPay(GuaranteeModel guaranteeToApply, AccommodationOrderEntryGroupModel group, AbstractOrderModel abstractOrder) Calculates total to pay at booking time, applying guarantee to the rate plan total.protected voidhandlePrePayment(List<GuaranteeModel> guarantees, EntryTypePaymentInfo paymentInfo, AccommodationOrderEntryGroupModel group, Double appliedGuaranteeAmount, AbstractOrderModel abstractOrder) Calculates prepayment value, if neededprotected booleanisGroupBeingAmended(AccommodationOrderEntryGroupModel group, AbstractOrderModel abstractOrder) Determines if the group is being amended.protected booleanprotected voidsetAmounts(List<GuaranteeModel> guarantees, AccommodationOrderEntryGroupModel group, EntryTypePaymentInfo paymentInfo, AbstractOrderModel abstractOrder) Calculates amounts to be populated against the EntryTypePaymentInfo.voidsetRatePlanService(RatePlanService ratePlanService) voidsetTimeService(de.hybris.platform.servicelayer.time.TimeService timeService) Methods inherited from class de.hybris.platform.travelservices.strategies.payment.impl.AbstractPaymentInfoStrategy
calculateTaxes, createPayInAdvancePaymentInfoForEntryType, getAmendedTotalToPay, getBookingService, getBookingTimeAmount, getEntriesAmount, getEntriesAmountByEntryType, getGlobalDiscountCalculationStrategyMap, getTaxCompensationStrategy, getTotalWithDiscounts, getTotalWithDiscounts, getTravelCartService, setBookingService, setGlobalDiscountCalculationStrategyMap, setTaxCompensationStrategy, setTravelCartService
-
Constructor Details
-
AccommodationDelayedPaymentInfoStrategy
public AccommodationDelayedPaymentInfoStrategy()
-
-
Method Details
-
create
Description copied from interface:EntryTypePaymentInfoCreationStrategyCreate list.- Specified by:
createin interfaceEntryTypePaymentInfoCreationStrategy- 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
-
getGuaranteeAmount
-
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
Calculates total price of all the entries in a group.- Parameters:
group-- Returns:
-
getRatePlanService
- Returns:
- ratePlanService
-
setRatePlanService
- 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
-