Skip to content

Commit 98afd3c

Browse files
author
Andrew Farries
authored
Check enablePayment before Stripe operations (#13407)
Ensure that payment is enabled before attempting Stripe operations.
1 parent 7d04130 commit 98afd3c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Diff for: components/server/ee/src/workspace/gitpod-server-impl.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -1596,11 +1596,13 @@ export class GitpodServerEEImpl extends GitpodServerImpl {
15961596
{ teamId, chargebeeSubscriptionId },
15971597
);
15981598
}
1599-
const subscriptionId = await this.stripeService.findUncancelledSubscriptionByAttributionId(
1600-
AttributionId.render({ kind: "team", teamId: teamId }),
1601-
);
1602-
if (subscriptionId) {
1603-
await this.stripeService.cancelSubscription(subscriptionId);
1599+
if (this.config.enablePayment) {
1600+
const subscriptionId = await this.stripeService.findUncancelledSubscriptionByAttributionId(
1601+
AttributionId.render({ kind: "team", teamId: teamId }),
1602+
);
1603+
if (subscriptionId) {
1604+
await this.stripeService.cancelSubscription(subscriptionId);
1605+
}
16041606
}
16051607
}
16061608

0 commit comments

Comments
 (0)