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 e63b0b71 authored by Rik ter Beek's avatar Rik ter Beek Committed by GitHub

Merge pull request #208 from Adyen/bugfix-duplicate-notifications

#204 Add duplicate check into notificaiton processing and fix formatting
parents 3b5965f5 6b75d486
This diff is collapsed.
...@@ -37,12 +37,12 @@ class Notification extends \Magento\Framework\Model\AbstractModel ...@@ -37,12 +37,12 @@ class Notification extends \Magento\Framework\Model\AbstractModel
const ERROR = 'ERROR'; const ERROR = 'ERROR';
const REFUND = 'REFUND'; const REFUND = 'REFUND';
const REFUND_FAILED = 'REFUND_FAILED'; const REFUND_FAILED = 'REFUND_FAILED';
const CANCEL_OR_REFUND = 'CANCEL_OR_REFUND'; const CANCEL_OR_REFUND = 'CANCEL_OR_REFUND';
const CAPTURE = 'CAPTURE'; const CAPTURE = 'CAPTURE';
const CAPTURE_FAILED = 'CAPTURE_FAILED'; const CAPTURE_FAILED = 'CAPTURE_FAILED';
const CANCELLATION = 'CANCELLATION'; const CANCELLATION = 'CANCELLATION';
const POSAPPROVED = 'POS_APPROVED'; const POSAPPROVED = 'POS_APPROVED';
const HANDLED_EXTERNALLY = 'HANDLED_EXTERNALLY'; const HANDLED_EXTERNALLY = 'HANDLED_EXTERNALLY';
const MANUAL_REVIEW_ACCEPT = 'MANUAL_REVIEW_ACCEPT'; const MANUAL_REVIEW_ACCEPT = 'MANUAL_REVIEW_ACCEPT';
const MANUAL_REVIEW_REJECT = 'MANUAL_REVIEW_REJECT '; const MANUAL_REVIEW_REJECT = 'MANUAL_REVIEW_REJECT ';
const RECURRING_CONTRACT = "RECURRING_CONTRACT"; const RECURRING_CONTRACT = "RECURRING_CONTRACT";
...@@ -86,11 +86,12 @@ class Notification extends \Magento\Framework\Model\AbstractModel ...@@ -86,11 +86,12 @@ class Notification extends \Magento\Framework\Model\AbstractModel
* @param $eventCode * @param $eventCode
* @param $success * @param $success
* @param $originalReference * @param $originalReference
* @return bool (true if the notification is a duplicate) * @param null $done
* @return bool
*/ */
public function isDuplicate($pspReference, $eventCode, $success, $originalReference) public function isDuplicate($pspReference, $eventCode, $success, $originalReference, $done = null)
{ {
$result = $this->getResource()->getNotification($pspReference, $eventCode, $success, $originalReference); $result = $this->getResource()->getNotification($pspReference, $eventCode, $success, $originalReference, $done);
return (empty($result)) ? false : true; return (empty($result)) ? false : true;
} }
...@@ -148,7 +149,7 @@ class Notification extends \Magento\Framework\Model\AbstractModel ...@@ -148,7 +149,7 @@ class Notification extends \Magento\Framework\Model\AbstractModel
{ {
return $this->setData(self::ORIGINAL_REFERENCE, $originalReference); return $this->setData(self::ORIGINAL_REFERENCE, $originalReference);
} }
/** /**
* Gets the Merchantreference for the notification. * Gets the Merchantreference for the notification.
* *
...@@ -315,7 +316,7 @@ class Notification extends \Magento\Framework\Model\AbstractModel ...@@ -315,7 +316,7 @@ class Notification extends \Magento\Framework\Model\AbstractModel
{ {
return $this->setData(self::LIVE, $live); return $this->setData(self::LIVE, $live);
} }
/** /**
* Gets the AdditionalData for the notification. * Gets the AdditionalData for the notification.
* *
......
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