Skip to content

Commit 7b0fc32

Browse files
committed
[server] Fix PAYG notifications and tsCancel
1 parent b411e14 commit 7b0fc32

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

components/server/ee/src/workspace/gitpod-server-impl.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,15 +1718,16 @@ export class GitpodServerEEImpl extends GitpodServerImpl {
17181718

17191719
try {
17201720
const allTS = await this.teamSubscriptionDB.findTeamSubscriptionsForUser(user.id, new Date().toISOString());
1721-
if (!allTS.find((ts) => ts.id === teamSubscriptionId)) {
1721+
const ts = allTS.find((ts) => ts.id === teamSubscriptionId);
1722+
if (!ts) {
17221723
log.error({ userId: user.id }, "Cannot cancel: unknown Team Subscription (legacy)", {
17231724
teamSubscriptionId,
17241725
});
17251726
return;
17261727
}
17271728

17281729
await this.chargebeeService.cancelSubscription(
1729-
teamSubscriptionId,
1730+
ts.paymentReference,
17301731
{},
17311732
{
17321733
teamSubscriptionId,
@@ -2648,7 +2649,7 @@ export class GitpodServerEEImpl extends GitpodServerImpl {
26482649
continue;
26492650
}
26502651
const url = switchToPAYG
2651-
? `/switch-to-payg?teamSubscription2=${ownedTeamSubscription2.id}`
2652+
? `/switch-to-payg?teamSubscription2=${team.id}` /** yes, team.id */
26522653
: "https://www.gitpod.io/docs/configure/billing#configure-organization-billing";
26532654
result.unshift({
26542655
message: `Your '${plan.name}' subscription for Organization '${team.name}' will be discontinued on March, 31st.`,

0 commit comments

Comments
 (0)