We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

Commit 37f8a7d5 authored by attilak's avatar attilak

Replace $minutesUntilProcessing calculation to use timestamps

The minute formatter only returned the minutes but not the hours, days,
etc
parent 1f507047
......@@ -352,9 +352,9 @@ class Cron
// Remove OFFER_CLOSED notifications arrived in the last 10 minutes from the list to process to ensure it
// won't close any order which has an AUTHORISED notification arrived a bit later than the OFFER_CLOSED one.
$createdAt = \DateTime::createFromFormat('Y-m-d H:i:s', $notification['created_at']);
// Difference between $offerClosedMinDate and $createdAt in minutes is the time until processing the
// notification in minutes
$minutesUntilProcessing = $offerClosedMinDate->diff($createdAt)->i;
// To get the difference between $offerClosedMinDate and $createdAt, $offerClosedMinDate time in seconds is
// deducted from $createdAt time in seconds, divided by 60 and rounded down to integer
$minutesUntilProcessing = floor(($createdAt->getTimestamp() - $offerClosedMinDate->getTimestamp()) / 60);
if ($notification['event_code'] == Notification::OFFER_CLOSED && $minutesUntilProcessing > 0) {
$this->_adyenLogger->addAdyenNotificationCronjob(
sprintf('OFFER_CLOSED notification %s skipped! Wait %s minute(s) before processing.',
......
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