Skip to content

Commit 62b578c

Browse files
committed
DEBUG
1 parent 6805549 commit 62b578c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

components/server/ee/src/user/stripe-service.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,12 @@ export class StripeService {
156156
await this.getStripe().subscriptions.del(subscriptionId);
157157
}
158158

159-
async createSubscriptionForCustomer(customerId: string): Promise<void> {
160-
const customer = await this.getStripe().customers.retrieve(customerId, { expand: ["tax"] });
159+
async createSubscriptionForCustomer(customerId: string, attributionId: string): Promise<void> {
160+
const [customer, byAttrId] = await Promise.all([
161+
this.getStripe().customers.retrieve(customerId, { expand: ["tax"] }),
162+
this.findCustomerByAttributionId(attributionId),
163+
]);
164+
log.info("creating subscription for customer", { customer, byAttrId, attributionId });
161165
if (!customer || customer.deleted) {
162166
throw new Error(`Stripe customer '${customerId}' could not be found`);
163167
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2159,7 +2159,7 @@ export class GitpodServerEEImpl extends GitpodServerImpl {
21592159
}
21602160

21612161
await this.stripeService.setDefaultPaymentMethodForCustomer(customerId, setupIntentId);
2162-
await this.stripeService.createSubscriptionForCustomer(customerId);
2162+
await this.stripeService.createSubscriptionForCustomer(customerId, attributionId);
21632163

21642164
// Creating a cost center for this team
21652165
await this.usageService.setCostCenter({

0 commit comments

Comments
 (0)