Class DefaultNDCPaymentService

java.lang.Object
de.hybris.platform.ndc182shoppingservices.services.impl.DefaultNDCPaymentService
All Implemented Interfaces:
NDCPaymentService

public class DefaultNDCPaymentService extends Object implements NDCPaymentService
Concrete implementationof NDCPaymentService
  • Constructor Details

    • DefaultNDCPaymentService

      public DefaultNDCPaymentService()
  • Method Details

    • createPaymentTransactionEntries

      protected List<PaymentTransactionEntryModel> createPaymentTransactionEntries(BigDecimal amount, CurrencyModel currency)
      Creates the list of paymentTransactionEntries.
      Parameters:
      amount - the amount of the paymentTransaction.
      currency - the currency
      Returns:
      the list
    • createPaymentTransaction

      public void createPaymentTransaction(AbstractOrderModel order, List<AbstractOrderEntryModel> orderEntries, BigDecimal paymentInfoAmount, boolean isPayLater) throws NDCException
      Create payment transactions from ndc offer data list.
      Specified by:
      createPaymentTransaction in interface NDCPaymentService
      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
    • isAnyOrderEntryWithoutPaymentTransaction

      public boolean isAnyOrderEntryWithoutPaymentTransaction(AbstractOrderModel order)
      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 NDCPaymentService
      Parameters:
      order - the order
      Returns:
      true if the order contains any order entries with no payment transaction.
    • validatePaymentTimeLimit

      public void validatePaymentTimeLimit(List<AbstractOrderEntryModel> orderEntries) throws NDCException
      Description copied from interface: NDCPaymentService
      Validate payment time limit.
      Specified by:
      validatePaymentTimeLimit in interface NDCPaymentService
      Parameters:
      orderEntries - the order entries
      Throws:
      NDCException - the ndc exception
    • isOriginalOrderPaid

      public boolean isOriginalOrderPaid(AbstractOrderModel order)
      Verifies if the payment transaction list does not contains empty payment transactions entries.
      Specified by:
      isOriginalOrderPaid in interface NDCPaymentService
      Parameters:
      order - the order
      Returns:
      true if the list of payment transaction is not empty.
    • validateTotalOrderAmountAgainstPaymentInfo

      public void validateTotalOrderAmountAgainstPaymentInfo(AbstractOrderModel order, BigDecimal totalPaymentInfoAmount) throws NDCException
      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 NDCPaymentService
      Parameters:
      order - the order
      totalPaymentInfoAmount - the totalPaymentInfoAmount
      Throws:
      NDCException - the ndc exception
    • getCommerceCheckoutService

      protected de.hybris.platform.commerceservices.order.CommerceCheckoutService getCommerceCheckoutService()
      Gets commerce checkout service.
      Returns:
      the commerce checkout service
    • setCommerceCheckoutService

      public void setCommerceCheckoutService(de.hybris.platform.commerceservices.order.CommerceCheckoutService commerceCheckoutService)
      Sets commerce checkout service.
      Parameters:
      commerceCheckoutService - the commerce checkout service
    • 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