package com.braintree.customersupportbackoffice.populators.transaction;

import com.braintree.command.result.BrainTreeAbstractTransactionResult;
import com.braintree.hybris.data.BrainTreeResponseResultData;
import de.hybris.platform.converters.Populator;
import de.hybris.platform.servicelayer.dto.converter.ConversionException;

public class BrainTreeTransactionMainPopulator implements Populator<BrainTreeAbstractTransactionResult, BrainTreeResponseResultData> {

    @Override
    public void populate(final BrainTreeAbstractTransactionResult source, final BrainTreeResponseResultData target)
            throws ConversionException {
        target.setSuccess(source.isSuccess());
        target.setErrorMessage(source.getErrorMessage());
        target.setErrorCode(source.getErrorCode());
        target.setTransactionId(source.getTransactionId());
    }

}
