Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
paulorbpinho-fullstacklabs committed Aug 20, 2024
1 parent 0c65e28 commit d7f1efe
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/test/java/com/ning/billing/recurly/TestRecurlyClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -2001,19 +2001,12 @@ public void testInvoices() throws Exception {

recurlyClient.createAccountAdjustment(account.getAccountCode(), adjustmentData2);

final Adjustment adjustmentData3 = new Adjustment();
adjustmentData3.setCurrency("USD");
adjustmentData3.setUnitAmountInCents(50);
adjustmentData3.setDescription("A description of an account adjustment3");

recurlyClient.createAccountAdjustment(account.getAccountCode(), adjustmentData3);

final Invoice invoiceData = new Invoice();
invoiceData.setCollectionMethod("automatic");

final Invoice invoice = recurlyClient.postAccountInvoice(account.getAccountCode(), invoiceData).getChargeInvoice();

Assert.assertEquals(invoice.getTotalInCents(), new Integer(250));
Assert.assertEquals(invoice.getTotalInCents(), new Integer(200));

// wait for the invoice to be marked paid
// has to happen asynchronously on the server
Expand Down Expand Up @@ -2051,8 +2044,8 @@ public void testInvoices() throws Exception {
refundOptions2.setPaymentMethod("credit_card");
final Invoice refundInvoice2 = recurlyClient.refundInvoice(invoice.getId(), refundOptions2);

Assert.assertEquals(refundInvoice.getTotalInCents(), new Integer(-150));
Assert.assertEquals(refundInvoice.getSubtotalInCents(), new Integer(-150));
Assert.assertEquals(refundInvoice.getTotalInCents(), new Integer(-100));
Assert.assertEquals(refundInvoice.getSubtotalInCents(), new Integer(-100));
Assert.assertEquals(refundInvoice.getTransactions().get(0).getAction(), "refund");

// The refundInvoice should have an original_invoices of the original invoice
Expand Down

0 comments on commit d7f1efe

Please sign in to comment.