public PaymentTransaction createChargebackReversal(final Account account,
final UUID kbPaymentId,
final PaymentTransaction chargeback,
final CallContext context) throws PaymentApiException {
final DateTime effectiveDate = context.getCreatedDate();
final String paymentTransactionExternalKey = chargeback.getExternalKey();
final Payment chargebackReversal;
final PaymentOptions paymentOptions = getPaymentOptions(kbPaymentId, context);
if (paymentOptions == null) {
chargebackReversal = osgiKillbillAPI.getPaymentApi().createChargebackReversal(account,
kbPaymentId,
effectiveDate,
paymentTransactionExternalKey,
context);
} else {
chargebackReversal = osgiKillbillAPI.getPaymentApi().createChargebackReversalWithPaymentControl(account,
kbPaymentId,
effectiveDate,
paymentTransactionExternalKey,
paymentOptions,
context);
}
return filterForLastTransaction(chargebackReversal);
}