Skip to content

Commit

Permalink
fix: Prospective members without checkout session are also failed
Browse files Browse the repository at this point in the history
  • Loading branch information
rinkp authored Dec 13, 2024
1 parent f19c8ad commit f9acc81
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions module/Database/src/Mapper/ProspectiveMember.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,16 @@ public function search(
$qbc->select('MAX(css.id)')
->from(CheckoutSessionModel::class, 'css')
->where('css.prospectiveMember = m.lidnr');
$qb->andWhere($qb->expr()->eq('cs.id', '(' . $qbc->getDQL() . ')'));
$qb->andWhere($qb->expr()->orX(
$qb->expr()->eq('cs.id', '(' . $qbc->getDQL() . ')'),
$qb->expr()->isNull('cs.id'),
));

if ('paid' === $type) {
$qb->andWhere('cs.state = :paid')
->setParameter('paid', CheckoutSessionStates::Paid);
} elseif ('failed' === $type) {
$qb->andWhere('cs.state = :expired OR cs.state = :failed')
$qb->andWhere('cs.state = :expired OR cs.state = :failed OR cs.state IS NULL')
->setParameter('expired', CheckoutSessionStates::Expired)
->setParameter('failed', CheckoutSessionStates::Failed);
} else {
Expand Down

0 comments on commit f9acc81

Please sign in to comment.