mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-20 01:28:03 +01:00
Return subscription status string in GET
This commit is contained in:
@@ -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())));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user