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())));
}