Commit 7f205197 by Yvon Kerdoncuff

payment hot fix : $p->getCreatedAt() does not always exist

parent 807a021d
......@@ -63,12 +63,16 @@ class PaymentRepository extends ServiceEntityRepository
$p->setStartingPaymentAnalysisStatus('NOT CONCERNED');
continue;
}
$createdAt = clone $p->getCreatedAt(); //don't modify original object
$timeout = $createdAt->add(\DateInterval::createFromDateString("10 minutes"));
if ($timeout < new \DateTime()) {
if (!$p->getCreatedAt()) {
$p->setStartingPaymentAnalysisStatus('TIMEOUT');
} else {
return $timeout;
$createdAt = clone $p->getCreatedAt(); //don't modify original object
$timeout = $createdAt->add(\DateInterval::createFromDateString("10 minutes"));
if ($timeout < new \DateTime()) {
$p->setStartingPaymentAnalysisStatus('TIMEOUT');
} else {
return $timeout;
}
}
}
//Note : some fields updates are done in this method to exclude non-candidate payment from future research.
......
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