diff --git a/Application/Helper/Payment.php b/Application/Helper/Payment.php index 67c066f..d0f14b3 100644 --- a/Application/Helper/Payment.php +++ b/Application/Helper/Payment.php @@ -52,7 +52,7 @@ class Payment 'mollieapplepay' => array('title' => 'Apple Pay', 'model' => \Mollie\Payment\Application\Model\Payment\ApplePay::class), 'mollieprzelewy24' => array('title' => 'Przelewy24', 'model' => \Mollie\Payment\Application\Model\Payment\Przelewy24::class), 'molliemybank' => array('title' => 'MyBank', 'model' => \Mollie\Payment\Application\Model\Payment\MyBank::class), - 'molliein3' => array('title' => 'in3', 'model' => \Mollie\Payment\Application\Model\Payment\In3::class), + 'molliein3' => array('title' => 'iDEAL in3', 'model' => \Mollie\Payment\Application\Model\Payment\In3::class), 'molliebillie' => array('title' => 'Billie', 'model' => \Mollie\Payment\Application\Model\Payment\Billie::class), ); diff --git a/Core/Events.php b/Core/Events.php index 0c3fc87..97a955e 100644 --- a/Core/Events.php +++ b/Core/Events.php @@ -47,6 +47,15 @@ class Events 'mollieinghomepay', ); + /** + * List of all payment methods to rename + * + * @var array + */ + public static $aRenamePaymentMethods = array( + 'molliein3' => 'iDeal in3', + ); + /** * Execute action on activate event. * @@ -57,6 +66,7 @@ public static function onActivate() self::addDatabaseStructure(); self::addData(); self::deleteRemovedPaymentMethods(); + self::renamePaymentMethods(); self::regenerateViews(); self::clearTmp(); } @@ -306,4 +316,28 @@ protected static function deactivePaymentMethods() $aInValues = array_keys(self::getMolliePaymentMethods()); DatabaseProvider::getDb()->Execute("UPDATE oxpayments SET oxactive = 0 WHERE oxid IN ".Database::getInstance()->getPreparedInStatement($aInValues), $aInValues); } + + /** + * Rename payment methods + * + * @return void + */ + protected static function renamePaymentMethods() + { + foreach (self::$aRenamePaymentMethods as $sPaymentId => $sNewPaymentName) { + self::renamePaymentMethod($sPaymentId, $sNewPaymentName); + } + } + + /** + * Rename payment method in database + * + * @param string $sPaymentId + * @param string $sNewPaymentName + * @return void + */ + protected static function renamePaymentMethod($sPaymentId, $sNewPaymentName) + { + DatabaseProvider::getDb()->Execute("Update oxpayments set oxdesc= ? WHERE oxid = ?", array($sNewPaymentName, $sPaymentId)); + } } diff --git a/metadata.php b/metadata.php index db27f3d..53d3036 100644 --- a/metadata.php +++ b/metadata.php @@ -88,7 +88,7 @@ ", ], 'thumbnail' => 'img/mollie_logo.png', - 'version' => '1.0.0', + 'version' => '1.1.0_RC1', 'author' => 'Fatchip GmbH', 'email' => 'info@mollie.com', 'url' => 'https://www.mollie.com/',