diff --git a/src/main/java/com/shippo/model/Rate.java b/src/main/java/com/shippo/model/Rate.java index b9bc013..362136e 100644 --- a/src/main/java/com/shippo/model/Rate.java +++ b/src/main/java/com/shippo/model/Rate.java @@ -7,6 +7,7 @@ import com.shippo.exception.AuthenticationException; import com.shippo.exception.InvalidRequestException; import com.shippo.net.APIResource; +import com.shippo.Shippo; public class Rate extends APIResource { String objectId; @@ -23,6 +24,7 @@ public class Rate extends APIResource { Object provider_image_200; Object servicelevel; Object days; + Object estimated_days; Object durationTerms; Object messages; @@ -139,9 +141,13 @@ public Object getServicelevel() { public void setServicelevel(Object servicelevel) { this.servicelevel = servicelevel; } - + public Object getDays() { - return days; + if ( Shippo.apiVersion.compareTo("2017-08-01") < 0) { + return days; + } else { + return estimated_days; + } } public void setDays(Object days) {