Class DefaultNDCPaymentService
java.lang.Object
de.hybris.platform.ndc182shoppingservices.services.impl.DefaultNDCPaymentService
- All Implemented Interfaces:
NDCPaymentService
Concrete implementationof
NDCPaymentService-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreatePaymentTransaction(AbstractOrderModel order, List<AbstractOrderEntryModel> orderEntries, BigDecimal paymentInfoAmount, boolean isPayLater) Create payment transactions from ndc offer data list.protected List<PaymentTransactionEntryModel>createPaymentTransactionEntries(BigDecimal amount, CurrencyModel currency) Creates the list of paymentTransactionEntries.protected de.hybris.platform.commerceservices.order.CommerceCheckoutServiceGets commerce checkout service.protected de.hybris.platform.servicelayer.model.ModelServiceGets model service.booleanChecks if there is at least one order entries in the order which has been not associated to any payment transaction.booleanVerifies if the payment transaction list does not contains empty payment transactions entries.voidsetCommerceCheckoutService(de.hybris.platform.commerceservices.order.CommerceCheckoutService commerceCheckoutService) Sets commerce checkout service.voidsetModelService(de.hybris.platform.servicelayer.model.ModelService modelService) Sets model service.voidvalidatePaymentTimeLimit(List<AbstractOrderEntryModel> orderEntries) Validate payment time limit.voidvalidateTotalOrderAmountAgainstPaymentInfo(AbstractOrderModel order, BigDecimal totalPaymentInfoAmount) Validates the total amount of the order against the paymentInfos.
-
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:
createPaymentTransactionin interfaceNDCPaymentService- Parameters:
order- the orderorderEntries- the order entriespaymentInfoAmount- the payment info amountisPayLater- true if orderCreate RQ does not have any payment info.- Throws:
NDCException- the ndc exception
-
isAnyOrderEntryWithoutPaymentTransaction
Checks if there is at least one order entries in the order which has been not associated to any payment transaction.- Specified by:
isAnyOrderEntryWithoutPaymentTransactionin interfaceNDCPaymentService- 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:NDCPaymentServiceValidate payment time limit.- Specified by:
validatePaymentTimeLimitin interfaceNDCPaymentService- Parameters:
orderEntries- the order entries- Throws:
NDCException- the ndc exception
-
isOriginalOrderPaid
Verifies if the payment transaction list does not contains empty payment transactions entries.- Specified by:
isOriginalOrderPaidin interfaceNDCPaymentService- 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:
validateTotalOrderAmountAgainstPaymentInfoin interfaceNDCPaymentService- Parameters:
order- the ordertotalPaymentInfoAmount- 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
-