@Override public int compare(final PaymentAttempt o1, final PaymentAttempt o2) { return o1.getEffectiveDate().compareTo(o2.getEffectiveDate()); } });
public PaymentJson(final Payment payment, final String bundleExternalKey, final List<RefundJson> refunds, final List<ChargebackJson> chargebacks, @Nullable final List<AuditLog> auditLogs) { this(payment.getAmount(), payment.getPaidAmount(), payment.getAccountId().toString(), payment.getInvoiceId().toString(), payment.getId().toString(), payment.getPaymentNumber().toString(), payment.getPaymentMethodId().toString(), payment.getEffectiveDate(), payment.getEffectiveDate(), payment.getAttempts().size(), payment.getCurrency().toString(), payment.getPaymentStatus().toString(), payment.getAttempts().get(payment.getAttempts().size() - 1).getGatewayErrorCode(), payment.getAttempts().get(payment.getAttempts().size() - 1).getGatewayErrorMsg(), bundleExternalKey, refunds, chargebacks, toAuditLogJson(auditLogs)); }
assertNotNull(paymentAttempt.getId()); } catch (PaymentApiException e) { if (expectedAmount != null) {
if (i < attempts.size() - 1) { if (failureType == FailureType.PAYMENT_FAILURE) { assertEquals(cur.getPaymentStatus(), PaymentStatus.PAYMENT_FAILURE); } else { assertEquals(cur.getPaymentStatus(), PaymentStatus.PLUGIN_FAILURE); assertEquals(cur.getPaymentStatus(), PaymentStatus.SUCCESS); assertEquals(payment.getPaymentStatus(), PaymentStatus.SUCCESS); } else { if (failureType == FailureType.PAYMENT_FAILURE) { assertEquals(cur.getPaymentStatus(), PaymentStatus.PAYMENT_FAILURE_ABORTED); assertEquals(payment.getPaymentStatus(), PaymentStatus.PAYMENT_FAILURE_ABORTED); } else { assertEquals(cur.getPaymentStatus(), PaymentStatus.PLUGIN_FAILURE_ABORTED); assertEquals(payment.getPaymentStatus(), PaymentStatus.PLUGIN_FAILURE_ABORTED);