Ejemplo n.º 1
0
  private CustomerEntity customerEntityPoulator(
      final Customer customerModel, final MerchantStore merchantStore) {
    CustomerEntityPopulator customerPopulator = new CustomerEntityPopulator();
    try {
      CustomerEntity customerEntity =
          customerPopulator.populate(
              customerModel, merchantStore, merchantStore.getDefaultLanguage());
      if (customerEntity != null) {
        customerEntity.setId(customerModel.getId());
        LOG.info("Retunring populated instance of customer entity");
        return customerEntity;
      }
      LOG.warn(
          "Seems some issue with customerEntity populator..retunring null instance of customerEntity ");
      return null;

    } catch (ConversionException e) {
      LOG.error("Error while converting customer model to customer entity ", e);
    }
    return null;
  }