Commit 496b7a54 by Yvon

when checking existing recurrent payment, discard not only those with FAILED…

when checking existing recurrent payment, discard not only those with FAILED status but also those with CANCELLED or EXPIRED status + add comment to explain why this is not sufficient
parent 3851052d
......@@ -55,7 +55,15 @@ class TAVCotisationUtils
$res = "";
foreach($recurringPayments as $p) {
if ($p->getStatus() !== GetHumanStatus::STATUS_FAILED) { //filter out failed payments
if (
$p->getStatus() !== GetHumanStatus::STATUS_FAILED
&& $p->getStatus() !== GetHumanStatus::STATUS_CANCELED
&& $p->getStatus() !== GetHumanStatus::STATUS_EXPIRED
) {
//Everytime payzen sends a recurring payment notification, notification is
//caught by notifyRecurringPaymentAction, which does not update payment status.
//This is why we can not rely on $p->getStatus to decide if a recurring
//payment is still active or ended or expired.
$reason = "";
if($p->isRecurringPaymentEndedOrExpired($reason) !== true) {
$res .= ($reason . " ");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment