package com.braintree.converters.populators.configuration;

import com.braintree.hybris.data.BraintreeApplePayConfigurationData;
import de.hybris.platform.converters.Populator;
import de.hybris.platform.core.model.BraintreeApplePayConfigurationModel;
import de.hybris.platform.servicelayer.dto.converter.ConversionException;

public class BraintreeApplePayConfigurationPopulator implements Populator<BraintreeApplePayConfigurationModel, BraintreeApplePayConfigurationData> {

    @Override
    public void populate(BraintreeApplePayConfigurationModel source, BraintreeApplePayConfigurationData target) throws ConversionException {
       target.setEnabled(source.isEnabled());
       target.setExpressCheckout(source.isEnabled() ? source.isExpressCheckout() : false);
    }
}
