Skip to content

Commit 12bb47c

Browse files
Andrew Farriesroboquat
Andrew Farries
authored andcommitted
Update getStripePortalUrlForTeam
Implement the method in terms of the more general `getStripePortalUrl`.
1 parent 9be2634 commit 12bb47c

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

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

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2188,19 +2188,8 @@ export class GitpodServerEEImpl extends GitpodServerImpl {
21882188
}
21892189

21902190
async getStripePortalUrlForTeam(ctx: TraceContext, teamId: string): Promise<string> {
2191-
this.checkAndBlockUser("getStripePortalUrlForTeam");
2192-
const team = await this.guardTeamOperation(teamId, "update");
2193-
await this.ensureStripeApiIsAllowed({ team });
2194-
try {
2195-
const url = await this.stripeService.getPortalUrlForTeam(team!);
2196-
return url;
2197-
} catch (error) {
2198-
log.error(`Failed to get Stripe portal URL for team '${teamId}'`, error);
2199-
throw new ResponseError(
2200-
ErrorCodes.INTERNAL_SERVER_ERROR,
2201-
`Failed to get Stripe portal URL for team '${teamId}'`,
2202-
);
2203-
}
2191+
const attributionId: AttributionId = { kind: "team", teamId: teamId };
2192+
return this.getStripePortalUrl(ctx, AttributionId.render(attributionId));
22042193
}
22052194

22062195
async getUsageLimitForTeam(ctx: TraceContext, teamId: string): Promise<number | undefined> {

0 commit comments

Comments
 (0)