Return subscription status string in GET
This commit is contained in:
parent
279b0a51d9
commit
fb7316c9ae
|
@ -606,6 +606,7 @@ public class SubscriptionController {
|
||||||
private final boolean cancelAtPeriodEnd;
|
private final boolean cancelAtPeriodEnd;
|
||||||
private final String currency;
|
private final String currency;
|
||||||
private final BigDecimal amount;
|
private final BigDecimal amount;
|
||||||
|
private final String status;
|
||||||
|
|
||||||
public Subscription(
|
public Subscription(
|
||||||
@JsonProperty("level") long level,
|
@JsonProperty("level") long level,
|
||||||
|
@ -614,7 +615,8 @@ public class SubscriptionController {
|
||||||
@JsonProperty("active") boolean active,
|
@JsonProperty("active") boolean active,
|
||||||
@JsonProperty("cancelAtPeriodEnd") boolean cancelAtPeriodEnd,
|
@JsonProperty("cancelAtPeriodEnd") boolean cancelAtPeriodEnd,
|
||||||
@JsonProperty("currency") String currency,
|
@JsonProperty("currency") String currency,
|
||||||
@JsonProperty("amount") BigDecimal amount) {
|
@JsonProperty("amount") BigDecimal amount,
|
||||||
|
@JsonProperty("status") String status) {
|
||||||
this.level = level;
|
this.level = level;
|
||||||
this.billingCycleAnchor = billingCycleAnchor;
|
this.billingCycleAnchor = billingCycleAnchor;
|
||||||
this.endOfCurrentPeriod = endOfCurrentPeriod;
|
this.endOfCurrentPeriod = endOfCurrentPeriod;
|
||||||
|
@ -622,6 +624,7 @@ public class SubscriptionController {
|
||||||
this.cancelAtPeriodEnd = cancelAtPeriodEnd;
|
this.cancelAtPeriodEnd = cancelAtPeriodEnd;
|
||||||
this.currency = currency;
|
this.currency = currency;
|
||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getLevel() {
|
public long getLevel() {
|
||||||
|
@ -651,6 +654,10 @@ public class SubscriptionController {
|
||||||
public BigDecimal getAmount() {
|
public BigDecimal getAmount() {
|
||||||
return amount;
|
return amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private final Subscription subscription;
|
private final Subscription subscription;
|
||||||
|
@ -691,7 +698,8 @@ public class SubscriptionController {
|
||||||
Objects.equals(subscription.getStatus(), "active"),
|
Objects.equals(subscription.getStatus(), "active"),
|
||||||
subscription.getCancelAtPeriodEnd(),
|
subscription.getCancelAtPeriodEnd(),
|
||||||
price.getCurrency().toUpperCase(Locale.ROOT),
|
price.getCurrency().toUpperCase(Locale.ROOT),
|
||||||
price.getUnitAmountDecimal()
|
price.getUnitAmountDecimal(),
|
||||||
|
subscription.getStatus()
|
||||||
))).build())));
|
))).build())));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue