Commit 7f205197 by Yvon Kerdoncuff

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

parent 807a021d
...@@ -63,12 +63,16 @@ class PaymentRepository extends ServiceEntityRepository ...@@ -63,12 +63,16 @@ class PaymentRepository extends ServiceEntityRepository
$p->setStartingPaymentAnalysisStatus('NOT CONCERNED'); $p->setStartingPaymentAnalysisStatus('NOT CONCERNED');
continue; continue;
} }
$createdAt = clone $p->getCreatedAt(); //don't modify original object if (!$p->getCreatedAt()) {
$timeout = $createdAt->add(\DateInterval::createFromDateString("10 minutes"));
if ($timeout < new \DateTime()) {
$p->setStartingPaymentAnalysisStatus('TIMEOUT'); $p->setStartingPaymentAnalysisStatus('TIMEOUT');
} else { } 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. //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