Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
fix: stripe webhook downgrade log (#9362)
Browse files Browse the repository at this point in the history
* fix: stripe webhook downgrade log

* fix: user in webhook
  • Loading branch information
eddiejaoude authored Oct 5, 2023
1 parent b0b1547 commit a77ca17
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pages/api/system/stripe.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,9 @@ export async function webhookHandler(req, res) {
userBefore = await User.findOne({
stripeCustomerId: event.data.object.customer,
});
logger.info(
`Found user "${userBefore.email}" by stripeCustomerId: ${event.data.object.customer}`,
);
} catch (e) {
logger.error(
e,
Expand All @@ -352,6 +355,10 @@ export async function webhookHandler(req, res) {
{ type: "free" },
{ new: true },
);

logger.info(
`Downgrading user "${user.email}" by stripeCustomerId: ${event.data.object.customer}`,
);
} catch (e) {
logger.error(
e,
Expand Down

0 comments on commit a77ca17

Please sign in to comment.