use of org.killbill.billing.payment.plugin.api.PaymentTransactionInfoPlugin in project killbill by killbill.
the class MockPaymentProviderPlugin method overridePaymentPluginStatus.
public void overridePaymentPluginStatus(final UUID kbPaymentId, final UUID kbTransactionId, final PaymentPluginStatus status) {
final List<PaymentTransactionInfoPlugin> existingTransactions = paymentTransactions.remove(kbPaymentId.toString());
final List<PaymentTransactionInfoPlugin> newTransactions = new LinkedList<PaymentTransactionInfoPlugin>();
paymentTransactions.put(kbPaymentId.toString(), newTransactions);
for (final PaymentTransactionInfoPlugin existingTransaction : existingTransactions) {
if (existingTransaction.getKbTransactionPaymentId().equals(kbTransactionId)) {
final PaymentTransactionInfoPlugin newTransaction = new DefaultNoOpPaymentInfoPlugin(existingTransaction.getKbPaymentId(), existingTransaction.getKbTransactionPaymentId(), existingTransaction.getTransactionType(), existingTransaction.getAmount(), existingTransaction.getCurrency(), existingTransaction.getEffectiveDate(), existingTransaction.getCreatedDate(), status, existingTransaction.getGatewayErrorCode(), existingTransaction.getGatewayError());
newTransactions.add(newTransaction);
} else {
newTransactions.add(existingTransaction);
}
}
}
Aggregations