package com.braintree.order.adjust.authorization;

import com.braintree.command.result.BrainTreeAbstractTransactionResult;
import com.braintree.command.result.BrainTreeAdjustedAuthorizationResult;
import com.braintree.exceptions.BraintreeErrorException;
import de.hybris.platform.core.model.order.OrderModel;
import de.hybris.platform.payment.model.PaymentTransactionEntryModel;
import de.hybris.platform.payment.model.PaymentTransactionModel;

import java.math.BigDecimal;

public interface BraintreeAdjustAuthorizationService {

    BrainTreeAdjustedAuthorizationResult adjustAuthorization(OrderModel orderModel, String transactionId,
                                                             BigDecimal amount) throws BraintreeErrorException;

    boolean isAdjustAuthorizationPossible(OrderModel order, PaymentTransactionModel transaction);

    PaymentTransactionEntryModel getTransactionEntryById(final OrderModel orderModel, final String transactionId);

    void checkAndProcessHardDeclineError(BrainTreeAbstractTransactionResult transactionResult,
                                         PaymentTransactionEntryModel transactionEntry);
}
