Do not log coupon code (#533)
This commit is contained in:
parent
ebee851b23
commit
11076592d1
@ -70,7 +70,9 @@ export class SubscriptionController {
|
|||||||
value: JSON.stringify(coupons)
|
value: JSON.stringify(coupons)
|
||||||
});
|
});
|
||||||
|
|
||||||
Logger.log(`Coupon with code '${couponCode}' has been redeemed`);
|
Logger.log(
|
||||||
|
`Subscription for user '${this.request.user.id}' has been created with coupon`
|
||||||
|
);
|
||||||
|
|
||||||
res.status(StatusCodes.OK);
|
res.status(StatusCodes.OK);
|
||||||
|
|
||||||
@ -82,10 +84,12 @@ export class SubscriptionController {
|
|||||||
|
|
||||||
@Get('stripe/callback')
|
@Get('stripe/callback')
|
||||||
public async stripeCallback(@Req() req, @Res() res) {
|
public async stripeCallback(@Req() req, @Res() res) {
|
||||||
await this.subscriptionService.createSubscriptionViaStripe(
|
const userId = await this.subscriptionService.createSubscriptionViaStripe(
|
||||||
req.query.checkoutSessionId
|
req.query.checkoutSessionId
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Logger.log(`Subscription for user '${userId}' has been created via Stripe`);
|
||||||
|
|
||||||
res.redirect(`${this.configurationService.get('ROOT_URL')}/account`);
|
res.redirect(`${this.configurationService.get('ROOT_URL')}/account`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,8 +75,6 @@ export class SubscriptionService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Logger.log(`Subscription for user '${aUserId}' has been created`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async createSubscriptionViaStripe(aCheckoutSessionId: string) {
|
public async createSubscriptionViaStripe(aCheckoutSessionId: string) {
|
||||||
@ -90,6 +88,8 @@ export class SubscriptionService {
|
|||||||
await this.stripe.customers.update(session.customer as string, {
|
await this.stripe.customers.update(session.customer as string, {
|
||||||
description: session.client_reference_id
|
description: session.client_reference_id
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return session.client_reference_id;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Logger.error(error);
|
Logger.error(error);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user