Skip to content

Commit

Permalink
chore: add more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
aalemayhu committed Jun 27, 2024
1 parent 391fee3 commit 2dfbcad
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/controllers/StripeController/StripeController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ export class StripeController {
const loggedInUser = await authService.getUserFrom(token);
const sessionId = req.query.session_id as string;

console.log('loggedInUser', loggedInUser);
console.log('sessionId', sessionId);
if (loggedInUser && sessionId) {
const stripe = getStripe();
const session = await stripe.checkout.sessions.retrieve(sessionId);
const email = session.customer_email;

console.log('cmp', loggedInUser.email, ' ', email);
if (loggedInUser.email !== email && email) {
await usersService.updateSubScriptionEmailUsingPrimaryEmail(
email.toLowerCase(),
Expand Down

0 comments on commit 2dfbcad

Please sign in to comment.