We will be off on April 7th (Monday) for public holiday in our country

Notification.php 1.91 KB
<?php
/**
 *                       ######
 *                       ######
 * ############    ####( ######  #####. ######  ############   ############
 * #############  #####( ######  #####. ######  #############  #############
 *        ######  #####( ######  #####. ######  #####  ######  #####  ######
 * ###### ######  #####( ######  #####. ######  #####  #####   #####  ######
 * ###### ######  #####( ######  #####. ######  #####          #####  ######
 * #############  #############  #############  #############  #####  ######
 *  ############   ############  #############   ############  #####  ######
 *                                      ######
 *                               #############
 *                               ############
 *
 * Adyen Payment module (https://www.adyen.com/)
 *
 * Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
 * See LICENSE.txt for license details.
 *
 * Author: Adyen <magento@adyen.com>
 */

namespace Adyen\Payment\Model\Resource;

class Notification extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
{

    /**
     * Construct
     */
    public function _construct()
    {
        $this->_init('adyen_notification', 'entity_id');
    }

    /**
     * Get Notification for duplicate check
     *
     * @param $pspReference
     * @param $eventCode
     * @param $success
     * @param $originalReference
     * @return array
     */
    public function getNotification($pspReference, $eventCode, $success, $originalReference)
    {
        $select = $this->getConnection()->select()
            ->from(['notification' => $this->getTable('adyen_notification')])
            ->where('notification.pspreference=?', $pspReference)
            ->where('notification.event_code=?', $eventCode)
            ->where('notification.success=?', $success)
            ->where('notification.original_reference=?', $originalReference);
        return $this->getConnection()->fetchAll($select);
    }
}