public PaymentAttemptJson(final PaymentAttempt paymentAttempt, final String paymentExternalKey, @Nullable final List<AuditLog> attemptsLogs) {
this(paymentAttempt.getAccountId(),
paymentAttempt.getPaymentMethodId(),
paymentExternalKey,
paymentAttempt.getTransactionId(),
paymentAttempt.getTransactionExternalKey(),
paymentAttempt.getTransactionType(),
paymentAttempt.getEffectiveDate(),
paymentAttempt.getStateName(),
paymentAttempt.getAmount(),
paymentAttempt.getCurrency() != null ? paymentAttempt.getCurrency() : null,
paymentAttempt.getPluginName(),
paymentAttempt.getPluginProperties() == null ? null : toPluginPropertyJson(paymentAttempt.getPluginProperties()),
toAuditLogJson(attemptsLogs));
}