protected AuditLog getPaymentCreationAuditLog(final UUID paymentId, final AccountAuditLogs accountAuditLogs) throws OSGIServiceNotAvailable { final List<AuditLog> auditLogsForPayment = accountAuditLogs.getAuditLogsForPayment(paymentId); for (final AuditLog auditLog : auditLogsForPayment) { if (auditLog.getChangeType().equals(ChangeType.INSERT)) { return auditLog; } } logService.log(LogService.LOG_WARNING, "Unable to find payment creation audit log for id " + paymentId); return null; }
private List<AuditLog> getAuditLogForPayment(final Payment payment, final TenantContext context) { return auditUserApi.getAccountAuditLogs(payment.getAccountId(), AuditLevel.FULL, context).getAuditLogsForPayment(payment.getId()); }
public PaymentJson(final Payment dp, @Nullable final AccountAuditLogs accountAuditLogs) { this(dp.getAccountId(), dp.getId(), dp.getPaymentNumber().toString(), dp.getExternalKey(), dp.getAuthAmount(), dp.getCapturedAmount(), dp.getPurchasedAmount(), dp.getRefundedAmount(), dp.getCreditedAmount(), dp.getCurrency() != null ? dp.getCurrency() : null, dp.getPaymentMethodId(), getTransactions(dp.getTransactions(), dp.getExternalKey(), accountAuditLogs), getAttempts(dp.getPaymentAttempts(), dp.getExternalKey(), accountAuditLogs), toAuditLogJson(accountAuditLogs == null ? null : accountAuditLogs.getAuditLogsForPayment(dp.getId()))); }