Added property for recurringBillingMode in PlanJSON which an inner class in CatalogJSON
@@ -29,6 +29,7 @@ import java.util.Map;
import org.joda.time.DateTime;
import org.killbill.billing.catalog.api.BillingPeriod;
+import org.killbill.billing.catalog.api.BillingMode;
import org.killbill.billing.catalog.api.CatalogApiException;
import org.killbill.billing.catalog.api.Currency;
import org.killbill.billing.catalog.api.CurrencyValueNull;
@@ -392,6 +393,7 @@ public class CatalogJson {
private final String name;
private final String prettyName;
+ private final BillingMode recurringBillingMode;
private final BillingPeriod billingPeriod;
private final List<PhaseJson> phases;
@@ -404,6 +406,7 @@ public class CatalogJson {
this.name = plan.getName();
this.prettyName = plan.getPrettyName();
+ this.recurringBillingMode = plan.getRecurringBillingMode();
this.billingPeriod = plan.getRecurringBillingPeriod();
this.phases = phases;
}
@@ -411,10 +414,12 @@ public class CatalogJson {
@JsonCreator
public PlanJson(@JsonProperty("name") final String name,
@JsonProperty("prettyName") final String prettyName,
+ @JsonProperty("recurringBillingMode") final BillingMode recurringBillingMode,
@JsonProperty("billingPeriod") final BillingPeriod billingPeriod,
@JsonProperty("phases") final List<PhaseJson> phases) {
this.name = name;
this.prettyName = prettyName;
+ this.recurringBillingMode = recurringBillingMode;
this.billingPeriod = billingPeriod;
this.phases = phases;
}
@@ -431,6 +436,10 @@ public class CatalogJson {
return billingPeriod;
}
+ public BillingMode getRecurringBillingMode() {
+ return recurringBillingMode;
+ }
+
public List<PhaseJson> getPhases() {
return phases;
}
@@ -440,6 +449,7 @@ public class CatalogJson {
final StringBuilder sb = new StringBuilder("PlanJson{");
sb.append("name='").append(name).append('\'');
sb.append("prettyName='").append(prettyName).append('\'');
+ sb.append("recurringBillingMode='").append(recurringBillingMode).append('\'');
sb.append("billingPeriod='").append(billingPeriod).append('\'');
sb.append(", phases=").append(phases);
sb.append('}');
@@ -460,6 +470,9 @@ public class CatalogJson {
if (name != null ? !name.equals(planJson.name) : planJson.name != null) {
return false;
}
+ if (recurringBillingMode != null ? !recurringBillingMode.equals(planJson.recurringBillingMode) : planJson.recurringBillingMode != null) {
+ return false;
+ }
if (billingPeriod != null ? !billingPeriod.equals(planJson.billingPeriod) : planJson.billingPeriod != null) {
return false;
}
