public PaymentTransaction createChargeback(final Account account,
final UUID kbPaymentId,
final BigDecimal amount,
final Currency currency,
final String paymentTransactionExternalKey,
final CallContext context) throws PaymentApiException {
final DateTime effectiveDate = context.getCreatedDate();
final Payment chargeback;
final PaymentOptions paymentOptions = getPaymentOptions(kbPaymentId, context);
if (paymentOptions == null) {
chargeback = osgiKillbillAPI.getPaymentApi().createChargeback(account,
kbPaymentId,
amount,
currency,
effectiveDate,
paymentTransactionExternalKey,
context);
} else {
chargeback = osgiKillbillAPI.getPaymentApi().createChargebackWithPaymentControl(account,
kbPaymentId,
amount,
currency,
effectiveDate,
paymentTransactionExternalKey,
paymentOptions,
context);
}
return filterForLastTransaction(chargeback);
}