We will work on Apr 26th (Saturday) and will be off from Apr 30th (Wednesday) until May 2nd (Friday) for public holiday in our country

Commit 488161ba authored by Rik ter Beek's avatar Rik ter Beek Committed by GitHub

Merge pull request #141 from Adyen/develop

Merge "Develop"
parents 41f072c6 4737c28a
......@@ -224,8 +224,17 @@ class Cron
// create collection
$notifications = $this->_notificationFactory->create();
$notifications->addFieldToFilter('done', 0);
$notifications->addFieldToFilter('processing', 0);
$notifications->addFieldToFilter('created_at', $dateRange);
foreach ($notifications as $notification) {
// set Cron processing to true
$dateEnd = new \DateTime();
$notification->setProcessing(true);
$notification->setUpdatedAt($dateEnd);
$notification->save();
}
// loop over the notifications
$count = 0;
foreach ($notifications as $notification) {
......@@ -322,6 +331,7 @@ class Cron
// set done to true
$dateEnd = new \DateTime();
$notification->setDone(true);
$notification->setProcessing(false);
$notification->setUpdatedAt($dateEnd);
$notification->save();
$this->_adyenLogger->addAdyenNotificationCronjob(
......
......@@ -59,6 +59,10 @@ class UpgradeSchema implements UpgradeSchemaInterface
$this->updateSchemaVersion204($setup);
}
if (version_compare($context->getVersion(), '2.0.7', '<')) {
$this->updateSchemaVersion207($setup);
}
$setup->endSetup();
}
......@@ -262,4 +266,32 @@ class UpgradeSchema implements UpgradeSchemaInterface
]
);
}
/**
* Upgrade to 2.0.7
*
* @param SchemaSetupInterface $setup
* @return void
*/
public function updateSchemaVersion207(SchemaSetupInterface $setup)
{
$connection = $setup->getConnection();
$tableName = $setup->getTable('adyen_notification');
$adyenNotificationProcessingColumn = [
'type' => Table::TYPE_BOOLEAN,
'length' => 1,
'nullable' => true,
'default' => 0,
'comment' => 'Adyen Notification Cron Processing',
'after' => \Adyen\Payment\Model\Notification::DONE
];
$connection->addColumn(
$tableName,
'processing',
$adyenNotificationProcessingColumn
);
}
}
\ No newline at end of file
......@@ -24,7 +24,7 @@
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Adyen_Payment" setup_version="2.0.6">
<module name="Adyen_Payment" setup_version="2.0.7">
<sequence>
<module name="Magento_Sales"/>
<module name="Magento_Quote"/>
......
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