*
 * @category	Adyen
 * @package	Adyen_Payment
 * @copyright	Copyright (c) 2011 Adyen (http://www.adyen.com)
 * @license	http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
/**
 * @category   Payment Gateway
 * @package    Adyen_Payment
 * @author     Adyen
 * @property   Adyen B.V
 * @copyright  Copyright (c) 2014 Adyen BV (http://www.adyen.com)
 */
/*
 * clear the field payment/adyen_hpp/allowspecific because this is not a setting anymore
 */
$notificationPath = "payment/adyen_hpp/allowspecific";
updateConfigValue($notificationPath);
function updateConfigValue($path)
{
    try {
        $collection = Mage::getModel('core/config_data')->getCollection()->addFieldToFilter('path', array('like' => $path));
        if ($collection->count() > 0) {
            foreach ($collection as $coreConfig) {
                $coreConfig->setValue('0')->save();
            }
        }
    } catch (Exception $e) {
        Mage::log($e->getMessage(), Zend_Log::ERR);
    }
}
/**
 * @category   Payment Gateway
 * @package    Adyen_Payment
 * @author     Adyen
 * @property   Adyen B.V
 * @copyright  Copyright (c) 2014 Adyen BV (http://www.adyen.com)
 */
/*
 * update the notification_password, ws_password_test and ws_password_live to a secure password
 */
$notificationPath = "payment/adyen_abstract/notification_password";
updateConfigValue($notificationPath);
$wsPasswordTestPath = "payment/adyen_abstract/ws_password_test";
updateConfigValue($wsPasswordTestPath);
$wsPasswordLivePath = "payment/adyen_abstract/ws_password_live";
updateConfigValue($wsPasswordLivePath);
function updateConfigValue($path)
{
    try {
        $collection = Mage::getModel('core/config_data')->getCollection()->addFieldToFilter('path', array('like' => $path));
        if ($collection->count() > 0) {
            foreach ($collection as $coreConfig) {
                $oldValue = $coreConfig->getValue();
                //encrypt the data and save this
                $encryptedValue = Mage::helper('core')->encrypt($oldValue);
                $coreConfig->setValue($encryptedValue)->save();
            }
        }
    } catch (Exception $e) {
        Mage::log($e->getMessage(), Zend_Log::ERR);
    }