mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-01 08:26:47 +00:00
Don't try to update a cancelled stripe subscription
This commit is contained in:
1 parent
176a15dace
commit
3b4d445ca8
1 file changed
+6
+6
@@ -316,6 +316,12 @@ public class StripeManager implements SubscriptionPaymentProcessor {
|
||||
|
||||
final Subscription subscription = getSubscription(subscriptionObj);
|
||||
|
||||
if (getSubscriptionStatus(subscription.getStatus()) == SubscriptionStatus.CANCELED) {
|
||||
// If the existing subscription is cancelled, just create a new subscription rather than trying to update a
|
||||
// cancelled subscription (which stripe forbids)
|
||||
return createSubscription(subscription.getCustomer(), priceId, level, subscription.getCreated());
|
||||
}
|
||||
|
||||
return CompletableFuture.supplyAsync(() -> {
|
||||
List<SubscriptionUpdateParams.Item> items = new ArrayList<>();
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user