package org.killbill.billing.payment.core.sm;
import org.killbill.automaton.OperationResult;
import org.killbill.billing.osgi.api.OSGIServiceRegistration;
import org.killbill.billing.payment.api.DirectPayment;
import org.killbill.billing.payment.api.PaymentApiException;
import org.killbill.billing.payment.core.DirectPaymentProcessor;
import org.killbill.billing.payment.dispatcher.PluginDispatcher;
import org.killbill.billing.retry.plugin.api.PaymentControlPluginApi;
import org.killbill.commons.locker.GlobalLocker;
public class RetryPurchaseOperationCallback extends RetryOperationCallback {
public RetryPurchaseOperationCallback(final GlobalLocker locker, final PluginDispatcher<OperationResult> paymentPluginDispatcher, final RetryableDirectPaymentStateContext directPaymentStateContext, final DirectPaymentProcessor directPaymentProcessor, final OSGIServiceRegistration<PaymentControlPluginApi> retryPluginRegistry) {
super(locker, paymentPluginDispatcher, directPaymentStateContext, directPaymentProcessor, retryPluginRegistry);
}
@Override
protected DirectPayment doCallSpecificOperationCallback() throws PaymentApiException {
return directPaymentProcessor.createPurchase(retryableDirectPaymentStateContext.isApiPayment(),
retryableDirectPaymentStateContext.getAccount(),
retryableDirectPaymentStateContext.getPaymentMethodId(),
retryableDirectPaymentStateContext.getDirectPaymentId(),
retryableDirectPaymentStateContext.getAmount(),
retryableDirectPaymentStateContext.getCurrency(),
retryableDirectPaymentStateContext.getDirectPaymentExternalKey(),
retryableDirectPaymentStateContext.getDirectPaymentTransactionExternalKey(),
false,
retryableDirectPaymentStateContext.getProperties(),
retryableDirectPaymentStateContext.getCallContext(),
retryableDirectPaymentStateContext.getInternalCallContext());
}
}