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

Notification.php 1.75 KB
Newer Older
1
<?php
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
/**
 *                       ######
 *                       ######
 * ############    ####( ######  #####. ######  ############   ############
 * #############  #####( ######  #####. ######  #############  #############
 *        ######  #####( ######  #####. ######  #####  ######  #####  ######
 * ###### ######  #####( ######  #####. ######  #####  #####   #####  ######
 * ###### ######  #####( ######  #####. ######  #####          #####  ######
 * #############  #############  #############  #############  #####  ######
 *  ############   ############  #############   ############  #####  ######
 *                                      ######
 *                               #############
 *                               ############
 *
 * 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>
 */
23 24 25

namespace Adyen\Payment\Model\Resource;

26
class Notification extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
27
{
28

29 30 31 32
    public function _construct()
    {
        $this->_init('adyen_notification', 'entity_id');
    }
33 34 35 36 37 38 39 40 41 42

    /**
     * @desc get Notification for duplicate check
     * @param $pspReference
     * @param $eventCode
     * @param $success
     * @return array
     */
    public function getNotification($pspReference, $eventCode, $success)
    {
43
        $select = $this->getConnection()->select()
44 45 46 47
            ->from(['notification' => $this->getTable('adyen_notification')])
            ->where('notification.pspreference=?', $pspReference)
            ->where('notification.event_code=?', $eventCode)
            ->where('notification.success=?', $success);
48
        return $this->getConnection()->fetchAll($select);
49 50
    }

51
}