Skip to content

Commit 913cf9f

Browse files
committed
DEBUG
1 parent 0734efb commit 913cf9f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

+10
Original file line numberDiff line numberDiff line change
@@ -2054,15 +2054,21 @@ export class GitpodServerEEImpl extends GitpodServerImpl {
20542054
}
20552055

20562056
async createOrUpdateStripeCustomerForTeam(ctx: TraceContext, teamId: string, currency: string): Promise<void> {
2057+
log.warn(`XXXX: createOrUpdateStripeCustomerForTeam ${teamId} ${currency}`);
20572058
const user = this.checkAndBlockUser("createOrUpdateStripeCustomerForTeam");
20582059
const team = await this.guardTeamOperation(teamId, "update");
20592060
await this.ensureStripeApiIsAllowed({ team });
20602061
try {
2062+
log.warn("XXXX: looking for existing customer");
20612063
let customer = await this.stripeService.findCustomerByTeamId(team!.id);
20622064
if (!customer) {
2065+
log.warn("XXXX: no customer, creating one...");
20632066
customer = await this.stripeService.createCustomerForTeam(user, team!);
2067+
log.warn("XXXX: created");
20642068
}
2069+
log.warn("XXXX: setting the currency...");
20652070
await this.stripeService.setPreferredCurrencyForCustomer(customer, currency);
2071+
log.warn("XXXX: currency set");
20662072
} catch (error) {
20672073
log.error(`Failed to update Stripe customer profile for team '${teamId}'`, error);
20682074
throw new ResponseError(
@@ -2074,15 +2080,19 @@ export class GitpodServerEEImpl extends GitpodServerImpl {
20742080

20752081
protected defaultSpendingLimit = 100;
20762082
async subscribeTeamToStripe(ctx: TraceContext, teamId: string, setupIntentId: string): Promise<void> {
2083+
log.warn(`XXXX: subscribeTeamToStripe ${teamId}`);
20772084
this.checkAndBlockUser("subscribeUserToStripe");
20782085
const team = await this.guardTeamOperation(teamId, "update");
20792086
await this.ensureStripeApiIsAllowed({ team });
20802087
try {
2088+
log.warn("XXXX: sub looking for existing customer");
20812089
let customer = await this.stripeService.findCustomerByTeamId(team!.id);
20822090
if (!customer) {
20832091
throw new Error(`No Stripe customer profile for team '${team.id}'`);
20842092
}
2093+
log.warn("XXXX: sub setting default payment method");
20852094
await this.stripeService.setDefaultPaymentMethodForCustomer(customer, setupIntentId);
2095+
log.warn("XXXX: sub creating subscription");
20862096
await this.stripeService.createSubscriptionForCustomer(customer);
20872097

20882098
const attributionId = AttributionId.render({ kind: "team", teamId });

0 commit comments

Comments
 (0)