Commit 3851052d by Yvon

when checking existence of recurring payments, do not take into account failed ones

parent 85a9eecd
...@@ -10,6 +10,7 @@ use App\Entity\CotisationTavReversement; ...@@ -10,6 +10,7 @@ use App\Entity\CotisationTavReversement;
use App\Entity\CotisationTavPrelevement; use App\Entity\CotisationTavPrelevement;
use App\Enum\MoyenEnum; use App\Enum\MoyenEnum;
use App\Utils\CustomEntityManager; use App\Utils\CustomEntityManager;
use Payum\Core\Request\GetHumanStatus;
use Symfony\Component\Security\Core\Security; use Symfony\Component\Security\Core\Security;
class TAVCotisationUtils class TAVCotisationUtils
...@@ -54,9 +55,11 @@ class TAVCotisationUtils ...@@ -54,9 +55,11 @@ class TAVCotisationUtils
$res = ""; $res = "";
foreach($recurringPayments as $p) { foreach($recurringPayments as $p) {
$reason = ""; if ($p->getStatus() !== GetHumanStatus::STATUS_FAILED) { //filter out failed payments
if($p->isRecurringPaymentEndedOrExpired($reason) !== true) { $reason = "";
$res .= ($reason . " "); if($p->isRecurringPaymentEndedOrExpired($reason) !== true) {
$res .= ($reason . " ");
}
} }
} }
return $res; return $res;
......
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