Class DefaultNDCPaymentService

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

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

    • DefaultNDCPaymentService

      public DefaultNDCPaymentService()
  • Method Details

    • removeEmptyPaymentTransactions

      public void removeEmptyPaymentTransactions(OrderModel order)
      Retrieves all the empty payment transactions from the order and remove them.
      Specified by:
      removeEmptyPaymentTransactions in interface NDCPaymentService
      Parameters:
      order - the order
    • 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(OrderModel 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(OrderModel 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.
    • isOriginalOrderPaid

      public boolean isOriginalOrderPaid(OrderModel 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.
    • validateOrderTotalAgainstTotalAmountPaymentInfos

      public boolean validateOrderTotalAgainstTotalAmountPaymentInfos(BigDecimal totalAmountOrder, BigDecimal totalAmountPaymentInfos)
      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 NDCPaymentService
      Parameters:
      totalAmountOrder - the total price of the order
      totalAmountPaymentInfos - the total price of all the payment infos
      Returns:
      true if the totals are equal
    • validateTotalorderAmountAgainstPaymentInfo

      public void validateTotalorderAmountAgainstPaymentInfo(OrderModel 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