Class OrderCreatePaymentInfoFieldValidator
java.lang.Object
de.hybris.platform.ndc182webservices.validators.impl.AbstractOrderCreateRequestValidator
de.hybris.platform.ndc182webservices.validators.impl.OrderCreatePaymentInfoFieldValidator
- All Implemented Interfaces:
NDCFieldValidator<IATAOrderCreateRQ,List<ErrorType>>
public class OrderCreatePaymentInfoFieldValidator
extends AbstractOrderCreateRequestValidator
implements NDCFieldValidator<IATAOrderCreateRQ,List<ErrorType>>
The ndc 18.2 Order create paymentInfo field validator.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected de.hybris.platform.servicelayer.time.TimeServiceGets time service.voidsetTimeService(de.hybris.platform.servicelayer.time.TimeService timeService) Sets time service.voidvalidate(IATAOrderCreateRQ request, List<ErrorType> errors) Checks if the list of paymentInfos are present.protected voidvalidateCurrency(List<PaymentInfoType> paymentInfo, List<ErrorType> errors) Validates the currency inside the payment infos.protected voidvalidateExpirationDate(String expirationDate, List<ErrorType> errors) Validates the expiration date.protected voidvalidateOfferAssociations(List<OfferAssociationType> offerAssociation, List<ErrorType> errors) Validates offer associations.protected voidvalidateOfferAssociationsAgainstOfferRefIds(IATAOrderCreateRQ request, List<ErrorType> errors) Verifies that each paymentInfo is associated to an existing offerId and that there are exactly as many paymentInfo as the number of offerAssociations, since they must refers to a unique offer.protected voidvalidatePaymentMethod(PaymentMethodType paymentMethod, List<ErrorType> errors) Validates the payment method.Methods inherited from class de.hybris.platform.ndc182webservices.validators.impl.AbstractOrderCreateRequestValidator
addError
-
Constructor Details
-
OrderCreatePaymentInfoFieldValidator
public OrderCreatePaymentInfoFieldValidator()
-
-
Method Details
-
validate
Checks if the list of paymentInfos are present. If yes, checks if the paymentInfos contain the amount, the payment method and the payment type.- Specified by:
validatein interfaceNDCFieldValidator<IATAOrderCreateRQ,List<ErrorType>> - Parameters:
request- the requesterrors- the list of errors
-
validateOfferAssociationsAgainstOfferRefIds
protected void validateOfferAssociationsAgainstOfferRefIds(IATAOrderCreateRQ request, List<ErrorType> errors) Verifies that each paymentInfo is associated to an existing offerId and that there are exactly as many paymentInfo as the number of offerAssociations, since they must refers to a unique offer.- Parameters:
request- the requesterrors- the errors
-
validateOfferAssociations
protected void validateOfferAssociations(List<OfferAssociationType> offerAssociation, List<ErrorType> errors) Validates offer associations. A paymentInfo must be associated to offerIDs only, not to offerItems.- Parameters:
offerAssociation- the offer associationerrors- the errors
-
validateCurrency
Validates the currency inside the payment infos. If the currency is present, it must be the same for all the payments.- Parameters:
paymentInfo- the payment infoerrors- the errors
-
validatePaymentMethod
Validates the payment method. Checks if cardHolder, number and expiration date of the credit card are present.- Parameters:
paymentMethod- the payment methoderrors- the errors
-
validateExpirationDate
Validates the expiration date. It must be a future date.- Parameters:
expirationDate- the expiration dateerrors- the errors
-
getTimeService
protected de.hybris.platform.servicelayer.time.TimeService getTimeService()Gets time service.- Returns:
- the time service
-
setTimeService
public void setTimeService(de.hybris.platform.servicelayer.time.TimeService timeService) Sets time service.- Parameters:
timeService- the time service
-