diff --git a/Common/Server/Services/ProjectService.ts b/Common/Server/Services/ProjectService.ts index 69b6980f2f..cfad285eaf 100755 --- a/Common/Server/Services/ProjectService.ts +++ b/Common/Server/Services/ProjectService.ts @@ -347,6 +347,17 @@ export class ProjectService extends DatabaseService { " completed.", ); + // refresh subscription status. + const subscriptionState: SubscriptionStatus = + await BillingService.getSubscriptionStatus( + subscription.subscriptionId as string, + ); + + const meteredSubscriptionState: SubscriptionStatus = + await BillingService.getSubscriptionStatus( + subscription.meteredSubscriptionId as string, + ); + await this.updateOneById({ id: new ObjectID(updateBy.query._id! as string), data: { @@ -357,6 +368,9 @@ export class ProjectService extends DatabaseService { planName: SubscriptionPlan.getPlanType( updateBy.data.paymentProviderPlanId! as string, ), + paymentProviderMeteredSubscriptionStatus: + meteredSubscriptionState, + paymentProviderSubscriptionStatus: subscriptionState, }, props: { isRoot: true,