public class DefaultCsCardPaymentService extends AbstractBusinessService implements CsCardPaymentService
CsCardPaymentService interface.AbstractService.SerializableDTOmodelService, sessionService, txManagertenant| Constructor and Description |
|---|
DefaultCsCardPaymentService() |
| Modifier and Type | Method and Description |
|---|---|
PaymentTransactionEntryModel |
authoriseCardPayment(AbstractOrderModel order,
CardInfo cardInfo,
double amount)
Authorise payment for the cart or order.
|
protected java.lang.String |
cleanupCardNumber(java.lang.String cardNumber)
Cleanup the card number.
|
protected java.lang.String |
generatePaymentInfoKey(CreditCardPaymentInfoModel paymentInfo) |
protected java.lang.String |
generatePreAuthTransactionCode(AbstractOrderModel order) |
protected CardValidator |
getCardValidator() |
protected CommonI18NService |
getCommonI18NService() |
protected CsOrderUnauthorizedTotalStrategy |
getCsOrderUnauthorizedTotalStrategy() |
protected AddressModel |
getPaymentDeliveryAddress(AbstractOrderModel order) |
protected PaymentService |
getPaymentService() |
java.util.List<CreditCardPaymentInfoModel> |
getPreviousCreditCardPaymentInfos(UserModel user)
Get previously used payment infos for the specified user.
|
java.util.List<CreditCardType> |
getSupportedCardSchemes(AbstractOrderModel order)
Get the list of available card types for the specified cart or order.
|
protected TransactionCodeGenerator |
getTransactionCodeGenerator() |
protected TransactionInfoService |
getTransactionInfoService() |
protected PaymentTransactionEntryModel |
preAuth(AbstractOrderModel order,
CardInfo cardInfo,
double amount) |
void |
setCardValidator(CardValidator cardValidator) |
void |
setCommonI18NService(CommonI18NService commonI18NService) |
void |
setCsOrderUnauthorizedTotalStrategy(CsOrderUnauthorizedTotalStrategy csOrderUnauthorizedTotalStrategy) |
void |
setPaymentService(PaymentService paymentService) |
void |
setTransactionCodeGenerator(TransactionCodeGenerator transactionCodeGenerator) |
void |
setTransactionInfoService(TransactionInfoService transactionInfoService) |
void |
validate(AbstractOrderModel order,
CardInfo cardInfo,
double amount)
Validate the order, cardInfo and amount.
|
protected void |
validateAmount(AbstractOrderModel order,
double amount,
java.util.List<ResourceMessage> errorMessages)
Validate that the amount it valid.
|
protected void |
validateBillingInfo(AbstractOrderModel order,
CardInfo cardInfo,
java.util.List<ResourceMessage> errorMessages)
Validate the the billing info in the cardInfo.
|
protected void |
validateCardInfo(AbstractOrderModel order,
CardInfo cardInfo,
java.util.List<ResourceMessage> errorMessages)
Validate the cardInfo.
|
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerafterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, setTenantScope, writeReplaceprotected TransactionCodeGenerator getTransactionCodeGenerator()
public void setTransactionCodeGenerator(TransactionCodeGenerator transactionCodeGenerator)
protected PaymentService getPaymentService()
public void setPaymentService(PaymentService paymentService)
protected TransactionInfoService getTransactionInfoService()
public void setTransactionInfoService(TransactionInfoService transactionInfoService)
protected CsOrderUnauthorizedTotalStrategy getCsOrderUnauthorizedTotalStrategy()
public void setCsOrderUnauthorizedTotalStrategy(CsOrderUnauthorizedTotalStrategy csOrderUnauthorizedTotalStrategy)
protected CardValidator getCardValidator()
public void setCardValidator(CardValidator cardValidator)
protected CommonI18NService getCommonI18NService()
public void setCommonI18NService(CommonI18NService commonI18NService)
public java.util.List<CreditCardType> getSupportedCardSchemes(AbstractOrderModel order)
CsCardPaymentServicegetSupportedCardSchemes in interface CsCardPaymentServiceorder - the cart or orderpublic java.util.List<CreditCardPaymentInfoModel> getPreviousCreditCardPaymentInfos(UserModel user)
CsCardPaymentServicegetPreviousCreditCardPaymentInfos in interface CsCardPaymentServiceuser - the userprotected java.lang.String generatePaymentInfoKey(CreditCardPaymentInfoModel paymentInfo)
public PaymentTransactionEntryModel authoriseCardPayment(AbstractOrderModel order, CardInfo cardInfo, double amount) throws PaymentException, ValidationException
CsCardPaymentServiceauthoriseCardPayment in interface CsCardPaymentServiceorder - the cart or ordercardInfo - the payment card dataamount - the amount to authorisePaymentException - thrown on error from the payment serviceValidationException - thrown if the card details are invalidprotected java.lang.String cleanupCardNumber(java.lang.String cardNumber)
cardNumber - the inputted card numberpublic void validate(AbstractOrderModel order, CardInfo cardInfo, double amount) throws ValidationException
validateCardInfo(de.hybris.platform.core.model.order.AbstractOrderModel, de.hybris.platform.payment.dto.CardInfo, java.util.List)
,
validateBillingInfo(de.hybris.platform.core.model.order.AbstractOrderModel, de.hybris.platform.payment.dto.CardInfo, java.util.List)
, and validateAmount(de.hybris.platform.core.model.order.AbstractOrderModel, double, java.util.List).validate in interface CsCardPaymentServiceorder - the ordercardInfo - the cardInfoamount - the amountValidationException - thrown on error.protected void validateCardInfo(AbstractOrderModel order, CardInfo cardInfo, java.util.List<ResourceMessage> errorMessages)
order - The ordercardInfo - The cardInfoerrorMessages - list to append error messages toprotected void validateBillingInfo(AbstractOrderModel order, CardInfo cardInfo, java.util.List<ResourceMessage> errorMessages)
order - The ordercardInfo - The cardInfoerrorMessages - list to append error messages toprotected void validateAmount(AbstractOrderModel order, double amount, java.util.List<ResourceMessage> errorMessages)
CsOrderUnauthorizedTotalStrategy.order - The orderamount - The amounterrorMessages - list to append error messages toprotected java.lang.String generatePreAuthTransactionCode(AbstractOrderModel order)
protected PaymentTransactionEntryModel preAuth(AbstractOrderModel order, CardInfo cardInfo, double amount) throws PaymentException
PaymentExceptionprotected AddressModel getPaymentDeliveryAddress(AbstractOrderModel order)
Copyright © 2018 SAP SE. All Rights Reserved.