Skip to content

Commit

Permalink
fix: do not process receipts nor billing for removed
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Nov 13, 2023
1 parent 6b2c8db commit 3c0f20b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions jobs/billing.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ async function mapper(id) {
// ensure not banned
if (user[config.userFields.isBanned]) return;

// ensure not removed
if (user[config.userFields.isRemoved]) return;

// if on free plan then ignore
if (user.plan === 'free') return;

Expand Down
4 changes: 2 additions & 2 deletions jobs/payment-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ async function mapper(id) {

const user = await Users.findOne({
_id: payment.user,
// NOTE: we want to send refund receipts even to banned customers
// [config.userFields.isBanned]: false,
// TODO: we want to send refund receipts even to banned customers (see below note)
[config.userFields.isBanned]: false,
[config.userFields.hasVerifiedEmail]: true
})
.lean()
Expand Down

0 comments on commit 3c0f20b

Please sign in to comment.