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 String currency;
|
||||
private final BigDecimal amount;
|
||||
private final String status;
|
||||
|
||||
public Subscription(
|
||||
@JsonProperty("level") long level,
|
||||
|
@ -614,7 +615,8 @@ public class SubscriptionController {
|
|||
@JsonProperty("active") boolean active,
|
||||
@JsonProperty("cancelAtPeriodEnd") boolean cancelAtPeriodEnd,
|
||||
@JsonProperty("currency") String currency,
|
||||
@JsonProperty("amount") BigDecimal amount) {
|
||||
@JsonProperty("amount") BigDecimal amount,
|
||||
@JsonProperty("status") String status) {
|
||||
this.level = level;
|
||||
this.billingCycleAnchor = billingCycleAnchor;
|
||||
this.endOfCurrentPeriod = endOfCurrentPeriod;
|
||||
|
@ -622,6 +624,7 @@ public class SubscriptionController {
|
|||
this.cancelAtPeriodEnd = cancelAtPeriodEnd;
|
||||
this.currency = currency;
|
||||
this.amount = amount;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public long getLevel() {
|
||||
|
@ -651,6 +654,10 @@ public class SubscriptionController {
|
|||
public BigDecimal getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
private final Subscription subscription;
|
||||
|
@ -691,7 +698,8 @@ public class SubscriptionController {
|
|||
Objects.equals(subscription.getStatus(), "active"),
|
||||
subscription.getCancelAtPeriodEnd(),
|
||||
price.getCurrency().toUpperCase(Locale.ROOT),
|
||||
price.getUnitAmountDecimal()
|
||||
price.getUnitAmountDecimal(),
|
||||
subscription.getStatus()
|
||||
))).build())));
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue