Class OrderChangePaymentInfoFieldValidator

java.lang.Object
de.hybris.platform.ndc182shoppingwebservices.validators.impl.AbstractOrderValidator
de.hybris.platform.ndc182shoppingwebservices.validators.impl.OrderChangePaymentInfoFieldValidator
All Implemented Interfaces:
NDCFieldValidator<IATAOrderChangeRQ,List<ErrorType>>

public class OrderChangePaymentInfoFieldValidator extends AbstractOrderValidator implements NDCFieldValidator<IATAOrderChangeRQ,List<ErrorType>>
The Ndc order change payment info field validator. Checks if the list of paymentInfos are present. If yes, checks if the paymentInfos contain the amount, the payment method and the payment type.
  • Constructor Details

    • OrderChangePaymentInfoFieldValidator

      public OrderChangePaymentInfoFieldValidator()
  • Method Details

    • validate

      public void validate(IATAOrderChangeRQ request, List<ErrorType> errors)
      Description copied from interface: NDCFieldValidator
      Validate.
      Specified by:
      validate in interface NDCFieldValidator<IATAOrderChangeRQ,List<ErrorType>>
      Parameters:
      request - the request
      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
    • 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
    • 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 -
    • 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