question

Danielle Cox avatar image
Danielle Cox asked Danielle Cox commented

Release Notes/Functionality changes

I have been using a code snippet that included

new OrderCalc(order).getTotal(null)

Between releases 167.7 and 168 this changed from returning the order total and now returns 0. I am guessing that I can say getTotal(order.getLineItems()) but this is troubling because functionality that my app relies on has changed out from under me. How can I know what changes are being made to try to protect against this?

Danielle

Ok - this is not duplicating the same way it did last night. I will try again in a bit, but using (null) like the code you gave me last year is returning 0 in all cases I am seeing at the moment.

However the greater question still stands - are there any release notes for new versions?

4 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ commented ·

We don't intend to break public APIs and if that's the case it's a bug. If you want to submit some code showing how it works differently between releases I'll file a bug. Please include a complete runnable sample including input test data (the order). AFAICT the code hasn't change since ~2014 but I might be missing something.

0 Likes 0 ·
Danielle Cox avatar image Danielle Cox commented ·

You (Jeff) gave me the following code:

  public static long getAmountLeftToPay(Order order) {
    long paymentTotal = 0;
    if (order.isNotNullPayments()) {
      for (Payment p : order.getPayments()) {
        paymentTotal += p.getAmount();
      }
    }
    return new OrderCalc(order).getTotal(null) - paymentTotal + amountRefundedWithoutTip(order);
  }

If I set my build.gradle clover sdk to version 168, getTotal(null) returns zero and in version 167.7 it returns the item total. If I say order.getLineItems() it works

0 Likes 0 ·
Danielle Cox avatar image Danielle Cox commented ·

And as long as it works with order.getLineItems() instead of the way null used to, then I don't care about this specific instance, but I am still worried about things like this in the future.

0 Likes 0 ·
Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ commented ·

I get the same result (0) regardless of the version. That's why I need you to provide a complete example including your input data.

0 Likes 0 ·

0 Answers

Welcome to the
Clover Developer Community