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 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 ...@@ -224,8 +224,17 @@ class Cron
// create collection // create collection
$notifications = $this->_notificationFactory->create(); $notifications = $this->_notificationFactory->create();
$notifications->addFieldToFilter('done', 0); $notifications->addFieldToFilter('done', 0);
$notifications->addFieldToFilter('processing', 0);
$notifications->addFieldToFilter('created_at', $dateRange); $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 // loop over the notifications
$count = 0; $count = 0;
foreach ($notifications as $notification) { foreach ($notifications as $notification) {
...@@ -322,6 +331,7 @@ class Cron ...@@ -322,6 +331,7 @@ class Cron
// set done to true // set done to true
$dateEnd = new \DateTime(); $dateEnd = new \DateTime();
$notification->setDone(true); $notification->setDone(true);
$notification->setProcessing(false);
$notification->setUpdatedAt($dateEnd); $notification->setUpdatedAt($dateEnd);
$notification->save(); $notification->save();
$this->_adyenLogger->addAdyenNotificationCronjob( $this->_adyenLogger->addAdyenNotificationCronjob(
......
...@@ -59,6 +59,10 @@ class UpgradeSchema implements UpgradeSchemaInterface ...@@ -59,6 +59,10 @@ class UpgradeSchema implements UpgradeSchemaInterface
$this->updateSchemaVersion204($setup); $this->updateSchemaVersion204($setup);
} }
if (version_compare($context->getVersion(), '2.0.7', '<')) {
$this->updateSchemaVersion207($setup);
}
$setup->endSetup(); $setup->endSetup();
} }
...@@ -262,4 +266,32 @@ class UpgradeSchema implements UpgradeSchemaInterface ...@@ -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 @@ ...@@ -24,7 +24,7 @@
--> -->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <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> <sequence>
<module name="Magento_Sales"/> <module name="Magento_Sales"/>
<module name="Magento_Quote"/> <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