Class OrderCreatePaymentInfoFieldValidator

java.lang.Object
de.hybris.platform.ndc182shoppingwebservices.validators.impl.AbstractOrderCreateRequestValidator
de.hybris.platform.ndc182shoppingwebservices.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 Details

    • OrderCreatePaymentInfoFieldValidator

      public OrderCreatePaymentInfoFieldValidator()
  • Method Details

    • validate

      public void validate(IATAOrderCreateRQ request, List<ErrorType> errors)
      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:
      validate in interface NDCFieldValidator<IATAOrderCreateRQ,List<ErrorType>>
      Parameters:
      request - the request
      errors - 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 request
      errors - 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 association
      errors - the errors
    • validateCurrency

      protected void validateCurrency(List<PaymentInfoType> paymentInfo, List<ErrorType> errors)
      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 info
      errors - the errors
    • validatePaymentMethod

      protected void validatePaymentMethod(PaymentMethodType paymentMethod, List<ErrorType> errors)
      Validates the payment method. Checks if cardHolder, number and expiration date of the credit card are present.
      Parameters:
      paymentMethod - the payment method
      errors - the errors
    • validateExpirationDate

      protected void validateExpirationDate(String expirationDate, List<ErrorType> errors)
      Validates the expiration date. It must be a future date.
      Parameters:
      expirationDate - the expiration date
      errors - 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