Class DefaultNDCPaymentFacade

java.lang.Object
de.hybris.platform.ndc182facades.facades.order.impl.DefaultNDCPaymentFacade
All Implemented Interfaces:
NDCPaymentFacade

public class DefaultNDCPaymentFacade extends Object implements NDCPaymentFacade
The ndc 18.2 implementation of NDCPaymentFacade interface.
  • Constructor Details

    • DefaultNDCPaymentFacade

      public DefaultNDCPaymentFacade()
  • Method Details

    • createPaymentTransactionsFromPaymentInfoNdcOfferDataAssociations

      public void createPaymentTransactionsFromPaymentInfoNdcOfferDataAssociations(OrderModel order, List<NDCOfferData> ndcOfferDataList, List<String> offerIdsAssociation, BigDecimal paymentInfoAmount) throws NDCException
      Creates payment transactions. 1) If the paymentInfo doesn't contain an offerId, it will create a paymentTransaction associated to the total of the order and to all the order entries. 2) Collects all the order entries related to the associated offers of the paymentinfo, validates the total amount against their total price and if it is valid, creates a payment transaction linked to them. Note: If the order has not been payed, the transaction will be linked to all the order entries.
      Specified by:
      createPaymentTransactionsFromPaymentInfoNdcOfferDataAssociations in interface NDCPaymentFacade
      Parameters:
      order - the order
      ndcOfferDataList - the ndc offer data list
      offerIdsAssociation - the offer ids association
      paymentInfoAmount - the payment info amount
      Throws:
      NDCException - the ndc exception
    • validateTotalorderAmountAgainstPaymentInfo

      public void validateTotalorderAmountAgainstPaymentInfo(OrderModel order, BigDecimal totalPaymentInfoAmount) throws NDCException
      Description copied from interface: NDCPaymentFacade
      Validates the total amount of the order against the paymentInfos. Checks if there are orderEntries that are not linked to any paymentTransactions.
      Specified by:
      validateTotalorderAmountAgainstPaymentInfo in interface NDCPaymentFacade
      Parameters:
      order - the order
      totalPaymentInfoAmount - the totalPaymentInfoAmount
      Throws:
      NDCException - the ndc exception
    • populatePaymentInfo

      public void populatePaymentInfo(OrderModel order, NDCPaymentCardInfoData ndcPaymentCardInfoData) throws NDCException
      Creates the creditCardPaymentInfo based on the information contained in the paymentInfos and set the paymentInfo in the order.
      Specified by:
      populatePaymentInfo in interface NDCPaymentFacade
      Parameters:
      order - the order
      ndcPaymentCardInfoData - the ndcPaymentCardInfoData
      Throws:
      NDCException - the ndc exception
    • validateOrderTotalAgainstTotalAmountPaymentInfos

      public boolean validateOrderTotalAgainstTotalAmountPaymentInfos(BigDecimal totalAmountOrder, BigDecimal totalAmountPaymentInfos)
      Description copied from interface: NDCPaymentFacade
      Validates if the total price of the order to place is equal to the total amount of all the payment infos provided.
      Specified by:
      validateOrderTotalAgainstTotalAmountPaymentInfos in interface NDCPaymentFacade
      Parameters:
      totalAmountOrder - the total price of the order
      totalAmountPaymentInfos - the total price of all the payment infos
      Returns:
      true if the totals are equal
    • isAnyOrderEntryWithoutPaymentTransaction

      public boolean isAnyOrderEntryWithoutPaymentTransaction(OrderModel order)
      Description copied from interface: NDCPaymentFacade
      Checks if there is at least one order entries in the order which has been not associated to any payment transaction.
      Specified by:
      isAnyOrderEntryWithoutPaymentTransaction in interface NDCPaymentFacade
      Parameters:
      order - the order
      Returns:
      true if the order contains any order entries with no payment transaction.
    • getMaskedCardNumber

      protected String getMaskedCardNumber(String cardNumber)
      Gets masked card number.
      Parameters:
      cardNumber - the card number
      Returns:
      masked card number
    • removeEmptyPaymentTransactions

      public void removeEmptyPaymentTransactions(OrderModel order)
      Description copied from interface: NDCPaymentFacade
      Retrieves all the empty payment transactions from the order and remove them.
      Specified by:
      removeEmptyPaymentTransactions in interface NDCPaymentFacade
      Parameters:
      order - the order
    • createPaymentTransaction

      public void createPaymentTransaction(OrderModel order, List<AbstractOrderEntryModel> orderEntries, BigDecimal paymentInfoAmount, boolean isPayLater) throws NDCException
      Description copied from interface: NDCPaymentFacade
      Create payment transactions from ndc offer data list.
      Specified by:
      createPaymentTransaction in interface NDCPaymentFacade
      Parameters:
      order - the order
      orderEntries - the order entries
      paymentInfoAmount - the payment info amount
      isPayLater - true if orderCreate RQ does not have any payment info.
      Throws:
      NDCException - the ndc exception
    • isOriginalOrderPaid

      public boolean isOriginalOrderPaid(OrderModel order)
      Description copied from interface: NDCPaymentFacade
      Verifies if the contains payment transactions. If yes, the order has already been payed.
      Specified by:
      isOriginalOrderPaid in interface NDCPaymentFacade
      Parameters:
      order - the order
      Returns:
      true if the list of payment transaction is not empty.
    • getOrderCreatePaymentTransactionStrategyMap

      protected Map<String,OrderCreatePaymentTransactionStrategy> getOrderCreatePaymentTransactionStrategyMap()
      Gets order create payment transaction strategy map.
      Returns:
      the order create payment transaction strategy map
    • setOrderCreatePaymentTransactionStrategyMap

      public void setOrderCreatePaymentTransactionStrategyMap(Map<String,OrderCreatePaymentTransactionStrategy> orderCreatePaymentTransactionStrategyMap)
      Sets order create payment transaction strategy map.
      Parameters:
      orderCreatePaymentTransactionStrategyMap - the order create payment transaction strategy map
    • getModelService

      protected de.hybris.platform.servicelayer.model.ModelService getModelService()
      Gets model service.
      Returns:
      the model service
    • setModelService

      public void setModelService(de.hybris.platform.servicelayer.model.ModelService modelService)
      Sets model service.
      Parameters:
      modelService - the model service
    • getCommerceCardTypeService

      protected de.hybris.platform.commerceservices.order.CommerceCardTypeService getCommerceCardTypeService()
      Gets commerce card type service.
      Returns:
      the commerce card type service
    • setCommerceCardTypeService

      public void setCommerceCardTypeService(de.hybris.platform.commerceservices.order.CommerceCardTypeService commerceCardTypeService)
      Sets commerce card type service.
      Parameters:
      commerceCardTypeService - the commerce card type service
    • getNdcPaymentService

      protected NDCPaymentService getNdcPaymentService()
      Gets model service.
      Returns:
      the payment service
    • setNdcPaymentService

      public void setNdcPaymentService(NDCPaymentService ndcPaymentService)
      Sets payment service.
      Parameters:
      ndcPaymentService - the payment service
    • getNdcOrderService

      protected NDCOrderService getNdcOrderService()
      Gets ndc order service.
      Returns:
      the ndc order service
    • setNdcOrderService

      public void setNdcOrderService(NDCOrderService ndcOrderService)
      Sets ndc order service.
      Parameters:
      ndcOrderService - the ndc order service