From 63a0a7b23469243d0943eb3350555b65202676fa Mon Sep 17 00:00:00 2001 From: sdcwdcee Date: Tue, 9 Jan 2018 14:09:43 +0100 Subject: [PATCH 01/10] #26 Sofort renammed in Pay now. --- app/code/community/Wirecard/CheckoutPage/Helper/Data.php | 2 +- app/code/community/Wirecard/CheckoutPage/etc/config.xml | 4 ++-- app/code/community/Wirecard/CheckoutPage/etc/system.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/community/Wirecard/CheckoutPage/Helper/Data.php b/app/code/community/Wirecard/CheckoutPage/Helper/Data.php index ed9433d..aee68c5 100644 --- a/app/code/community/Wirecard/CheckoutPage/Helper/Data.php +++ b/app/code/community/Wirecard/CheckoutPage/Helper/Data.php @@ -33,7 +33,7 @@ class Wirecard_CheckoutPage_Helper_Data extends Mage_Payment_Helper_Data { - protected $_pluginVersion = '4.2.6'; + protected $_pluginVersion = '4.2.7'; protected $_pluginName = 'Wirecard/CheckoutPage'; /** diff --git a/app/code/community/Wirecard/CheckoutPage/etc/config.xml b/app/code/community/Wirecard/CheckoutPage/etc/config.xml index 97ab596..ebf7e2d 100644 --- a/app/code/community/Wirecard/CheckoutPage/etc/config.xml +++ b/app/code/community/Wirecard/CheckoutPage/etc/config.xml @@ -34,7 +34,7 @@ - 4.2.6 + 4.2.7 @@ -212,7 +212,7 @@ 0 wirecard_checkoutpage/sofortbanking - Online bank transfer. + Pay now. Online bank transfer 0 diff --git a/app/code/community/Wirecard/CheckoutPage/etc/system.xml b/app/code/community/Wirecard/CheckoutPage/etc/system.xml index bb375c0..08272d9 100644 --- a/app/code/community/Wirecard/CheckoutPage/etc/system.xml +++ b/app/code/community/Wirecard/CheckoutPage/etc/system.xml @@ -886,7 +886,7 @@ - + text 1080 1 From 46a901c542f284c4751114e6d84c8fe0c2f689e9 Mon Sep 17 00:00:00 2001 From: sdcwdcee Date: Thu, 25 Jan 2018 14:28:08 +0100 Subject: [PATCH 02/10] Revert "#26 Sofort renammed in Pay now." This reverts commit 63a0a7b23469243d0943eb3350555b65202676fa. --- app/code/community/Wirecard/CheckoutPage/Helper/Data.php | 2 +- app/code/community/Wirecard/CheckoutPage/etc/config.xml | 4 ++-- app/code/community/Wirecard/CheckoutPage/etc/system.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/community/Wirecard/CheckoutPage/Helper/Data.php b/app/code/community/Wirecard/CheckoutPage/Helper/Data.php index aee68c5..ed9433d 100644 --- a/app/code/community/Wirecard/CheckoutPage/Helper/Data.php +++ b/app/code/community/Wirecard/CheckoutPage/Helper/Data.php @@ -33,7 +33,7 @@ class Wirecard_CheckoutPage_Helper_Data extends Mage_Payment_Helper_Data { - protected $_pluginVersion = '4.2.7'; + protected $_pluginVersion = '4.2.6'; protected $_pluginName = 'Wirecard/CheckoutPage'; /** diff --git a/app/code/community/Wirecard/CheckoutPage/etc/config.xml b/app/code/community/Wirecard/CheckoutPage/etc/config.xml index ebf7e2d..97ab596 100644 --- a/app/code/community/Wirecard/CheckoutPage/etc/config.xml +++ b/app/code/community/Wirecard/CheckoutPage/etc/config.xml @@ -34,7 +34,7 @@ - 4.2.7 + 4.2.6 @@ -212,7 +212,7 @@ 0 wirecard_checkoutpage/sofortbanking - Pay now. Online bank transfer + Online bank transfer. 0 diff --git a/app/code/community/Wirecard/CheckoutPage/etc/system.xml b/app/code/community/Wirecard/CheckoutPage/etc/system.xml index 08272d9..bb375c0 100644 --- a/app/code/community/Wirecard/CheckoutPage/etc/system.xml +++ b/app/code/community/Wirecard/CheckoutPage/etc/system.xml @@ -886,7 +886,7 @@ - + text 1080 1 From b44962b2c548d45fdd18dc3cfbbc75f13a33ef87 Mon Sep 17 00:00:00 2001 From: sdcwdcee Date: Thu, 25 Jan 2018 14:28:44 +0100 Subject: [PATCH 03/10] #31 Ratepay script only when Ratepay is provider --- .../Block/Additional/Installment.php | 20 +++++++++++++++++++ .../CheckoutPage/Block/Additional/Invoice.php | 20 +++++++++++++++++++ .../CheckoutPage/Block/Additional/Script.php | 15 -------------- .../checkoutpage/additional/installment.phtml | 15 ++++++++++++++ .../checkoutpage/additional/invoice.phtml | 15 ++++++++++++++ .../checkoutpage/additional/script.phtml | 14 ------------- 6 files changed, 70 insertions(+), 29 deletions(-) diff --git a/app/code/community/Wirecard/CheckoutPage/Block/Additional/Installment.php b/app/code/community/Wirecard/CheckoutPage/Block/Additional/Installment.php index f94b8d8..ddb3a66 100644 --- a/app/code/community/Wirecard/CheckoutPage/Block/Additional/Installment.php +++ b/app/code/community/Wirecard/CheckoutPage/Block/Additional/Installment.php @@ -79,4 +79,24 @@ public function getCustomerDobDay() return $this->getCustomerDobPart('dd'); } + public function getPaymentProvider() + { + $invoice = new Wirecard_CheckoutPage_Model_Installment(); + return $invoice->getConfigData('provider'); + } + + public function getConsumerDeviceId() { + $session = Mage::getModel('customer/session'); + + if (strlen($session->getData('wirecard_cp_consumerDeviceId'))) { + return $session->getData('wirecard_cp_consumerDeviceId'); + } + else { + $timestamp = microtime(); + $consumerDeviceId = md5(Mage::helper('wirecard_checkoutpage')->getConfigData('settings/customer_id') . "_" . $timestamp); + $session->setData('wirecard_cp_consumerDeviceId', $consumerDeviceId); + return $consumerDeviceId; + } + } + } \ No newline at end of file diff --git a/app/code/community/Wirecard/CheckoutPage/Block/Additional/Invoice.php b/app/code/community/Wirecard/CheckoutPage/Block/Additional/Invoice.php index a52203c..176b228 100644 --- a/app/code/community/Wirecard/CheckoutPage/Block/Additional/Invoice.php +++ b/app/code/community/Wirecard/CheckoutPage/Block/Additional/Invoice.php @@ -73,4 +73,24 @@ public function getCustomerDobMonth() { public function getCustomerDobDay() { return $this->getCustomerDobPart('dd'); } + + public function getPaymentProvider() + { + $invoice = new Wirecard_CheckoutPage_Model_Invoice(); + return $invoice->getConfigData('provider'); + } + + public function getConsumerDeviceId() { + $session = Mage::getModel('customer/session'); + + if (strlen($session->getData('wirecard_cp_consumerDeviceId'))) { + return $session->getData('wirecard_cp_consumerDeviceId'); + } + else { + $timestamp = microtime(); + $consumerDeviceId = md5(Mage::helper('wirecard_checkoutpage')->getConfigData('settings/customer_id') . "_" . $timestamp); + $session->setData('wirecard_cp_consumerDeviceId', $consumerDeviceId); + return $consumerDeviceId; + } + } } \ No newline at end of file diff --git a/app/code/community/Wirecard/CheckoutPage/Block/Additional/Script.php b/app/code/community/Wirecard/CheckoutPage/Block/Additional/Script.php index 21a25d3..a27a5c7 100644 --- a/app/code/community/Wirecard/CheckoutPage/Block/Additional/Script.php +++ b/app/code/community/Wirecard/CheckoutPage/Block/Additional/Script.php @@ -39,19 +39,4 @@ protected function _construct() $this->setTemplate('wirecard/checkoutpage/additional/invoice.phtml'); } - - - public function getConsumerDeviceId() { - $session = Mage::getModel('customer/session'); - - if (strlen($session->getData('wirecard_cp_consumerDeviceId'))) { - return $session->getData('wirecard_cp_consumerDeviceId'); - } - else { - $timestamp = microtime(); - $consumerDeviceId = md5(Mage::helper('wirecard_checkoutpage')->getConfigData('settings/customer_id') . "_" . $timestamp); - $session->setData('wirecard_cp_consumerDeviceId', $consumerDeviceId); - return $consumerDeviceId; - } - } } \ No newline at end of file diff --git a/app/design/frontend/base/default/template/wirecard/checkoutpage/additional/installment.phtml b/app/design/frontend/base/default/template/wirecard/checkoutpage/additional/installment.phtml index 84097da..9c1693e 100644 --- a/app/design/frontend/base/default/template/wirecard/checkoutpage/additional/installment.phtml +++ b/app/design/frontend/base/default/template/wirecard/checkoutpage/additional/installment.phtml @@ -65,6 +65,21 @@ +getConsumerDeviceId() && $this->getPaymentProvider() == "ratepay") { ?> + + + + + + + + + + + + + + + + + + + - - - - - - - - \ No newline at end of file From 5576224ba3e143db7a02f1f584e2f4223f470dbc Mon Sep 17 00:00:00 2001 From: sdcwdcee Date: Thu, 25 Jan 2018 14:30:07 +0100 Subject: [PATCH 04/10] #31 Version number increase --- app/code/community/Wirecard/CheckoutPage/Helper/Data.php | 2 +- app/code/community/Wirecard/CheckoutPage/etc/config.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/community/Wirecard/CheckoutPage/Helper/Data.php b/app/code/community/Wirecard/CheckoutPage/Helper/Data.php index ed9433d..aee68c5 100644 --- a/app/code/community/Wirecard/CheckoutPage/Helper/Data.php +++ b/app/code/community/Wirecard/CheckoutPage/Helper/Data.php @@ -33,7 +33,7 @@ class Wirecard_CheckoutPage_Helper_Data extends Mage_Payment_Helper_Data { - protected $_pluginVersion = '4.2.6'; + protected $_pluginVersion = '4.2.7'; protected $_pluginName = 'Wirecard/CheckoutPage'; /** diff --git a/app/code/community/Wirecard/CheckoutPage/etc/config.xml b/app/code/community/Wirecard/CheckoutPage/etc/config.xml index 97ab596..62e472a 100644 --- a/app/code/community/Wirecard/CheckoutPage/etc/config.xml +++ b/app/code/community/Wirecard/CheckoutPage/etc/config.xml @@ -34,7 +34,7 @@ - 4.2.6 + 4.2.7 From 27f1ad7d271999d7802c003a8e219ab67fdcb44d Mon Sep 17 00:00:00 2001 From: sdcwdcee Date: Thu, 25 Jan 2018 14:39:25 +0100 Subject: [PATCH 05/10] #31 Variable name fixed --- .../Wirecard/CheckoutPage/Block/Additional/Installment.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/community/Wirecard/CheckoutPage/Block/Additional/Installment.php b/app/code/community/Wirecard/CheckoutPage/Block/Additional/Installment.php index ddb3a66..6282035 100644 --- a/app/code/community/Wirecard/CheckoutPage/Block/Additional/Installment.php +++ b/app/code/community/Wirecard/CheckoutPage/Block/Additional/Installment.php @@ -81,8 +81,8 @@ public function getCustomerDobDay() public function getPaymentProvider() { - $invoice = new Wirecard_CheckoutPage_Model_Installment(); - return $invoice->getConfigData('provider'); + $installment = new Wirecard_CheckoutPage_Model_Installment(); + return $installment->getConfigData('provider'); } public function getConsumerDeviceId() { From 2e40e2fd0646e2575ead1d6696f7485f6f746fd3 Mon Sep 17 00:00:00 2001 From: sdcwdcee Date: Thu, 25 Jan 2018 15:03:15 +0100 Subject: [PATCH 06/10] #31 Ratepay script only when Ratepay is provider v2 --- .../Block/Additional/Installment.php | 20 ------------------- .../CheckoutPage/Block/Additional/Invoice.php | 19 ------------------ .../CheckoutPage/Block/Additional/Script.php | 20 +++++++++++++++++++ .../checkoutpage/additional/installment.phtml | 15 -------------- .../checkoutpage/additional/invoice.phtml | 15 -------------- .../checkoutpage/additional/script.phtml | 14 +++++++++++++ 6 files changed, 34 insertions(+), 69 deletions(-) diff --git a/app/code/community/Wirecard/CheckoutPage/Block/Additional/Installment.php b/app/code/community/Wirecard/CheckoutPage/Block/Additional/Installment.php index 6282035..f94b8d8 100644 --- a/app/code/community/Wirecard/CheckoutPage/Block/Additional/Installment.php +++ b/app/code/community/Wirecard/CheckoutPage/Block/Additional/Installment.php @@ -79,24 +79,4 @@ public function getCustomerDobDay() return $this->getCustomerDobPart('dd'); } - public function getPaymentProvider() - { - $installment = new Wirecard_CheckoutPage_Model_Installment(); - return $installment->getConfigData('provider'); - } - - public function getConsumerDeviceId() { - $session = Mage::getModel('customer/session'); - - if (strlen($session->getData('wirecard_cp_consumerDeviceId'))) { - return $session->getData('wirecard_cp_consumerDeviceId'); - } - else { - $timestamp = microtime(); - $consumerDeviceId = md5(Mage::helper('wirecard_checkoutpage')->getConfigData('settings/customer_id') . "_" . $timestamp); - $session->setData('wirecard_cp_consumerDeviceId', $consumerDeviceId); - return $consumerDeviceId; - } - } - } \ No newline at end of file diff --git a/app/code/community/Wirecard/CheckoutPage/Block/Additional/Invoice.php b/app/code/community/Wirecard/CheckoutPage/Block/Additional/Invoice.php index 176b228..64c43b2 100644 --- a/app/code/community/Wirecard/CheckoutPage/Block/Additional/Invoice.php +++ b/app/code/community/Wirecard/CheckoutPage/Block/Additional/Invoice.php @@ -74,23 +74,4 @@ public function getCustomerDobDay() { return $this->getCustomerDobPart('dd'); } - public function getPaymentProvider() - { - $invoice = new Wirecard_CheckoutPage_Model_Invoice(); - return $invoice->getConfigData('provider'); - } - - public function getConsumerDeviceId() { - $session = Mage::getModel('customer/session'); - - if (strlen($session->getData('wirecard_cp_consumerDeviceId'))) { - return $session->getData('wirecard_cp_consumerDeviceId'); - } - else { - $timestamp = microtime(); - $consumerDeviceId = md5(Mage::helper('wirecard_checkoutpage')->getConfigData('settings/customer_id') . "_" . $timestamp); - $session->setData('wirecard_cp_consumerDeviceId', $consumerDeviceId); - return $consumerDeviceId; - } - } } \ No newline at end of file diff --git a/app/code/community/Wirecard/CheckoutPage/Block/Additional/Script.php b/app/code/community/Wirecard/CheckoutPage/Block/Additional/Script.php index a27a5c7..8af097c 100644 --- a/app/code/community/Wirecard/CheckoutPage/Block/Additional/Script.php +++ b/app/code/community/Wirecard/CheckoutPage/Block/Additional/Script.php @@ -39,4 +39,24 @@ protected function _construct() $this->setTemplate('wirecard/checkoutpage/additional/invoice.phtml'); } + public function isRatepayPaymentProvider() + { + $installment = new Wirecard_CheckoutPage_Model_Installment(); + $invoice = new Wirecard_CheckoutPage_Model_Invoice(); + return ($installment->getConfigData('provider') == "ratepay" || $invoice->getConfigData('provider') == "ratepay"); + } + + public function getConsumerDeviceId() { + $session = Mage::getModel('customer/session'); + + if (strlen($session->getData('wirecard_cp_consumerDeviceId'))) { + return $session->getData('wirecard_cp_consumerDeviceId'); + } + else { + $timestamp = microtime(); + $consumerDeviceId = md5(Mage::helper('wirecard_checkoutpage')->getConfigData('settings/customer_id') . "_" . $timestamp); + $session->setData('wirecard_cp_consumerDeviceId', $consumerDeviceId); + return $consumerDeviceId; + } + } } \ No newline at end of file diff --git a/app/design/frontend/base/default/template/wirecard/checkoutpage/additional/installment.phtml b/app/design/frontend/base/default/template/wirecard/checkoutpage/additional/installment.phtml index 9c1693e..84097da 100644 --- a/app/design/frontend/base/default/template/wirecard/checkoutpage/additional/installment.phtml +++ b/app/design/frontend/base/default/template/wirecard/checkoutpage/additional/installment.phtml @@ -65,21 +65,6 @@ -getConsumerDeviceId() && $this->getPaymentProvider() == "ratepay") { ?> - - - - - - - - - - - - - - - - - - - + + + + + + + + \ No newline at end of file From 3870315dc6a160a6dafa93c746bfff3d2840558f Mon Sep 17 00:00:00 2001 From: sdcwdcee Date: Thu, 25 Jan 2018 15:18:30 +0100 Subject: [PATCH 07/10] #31 Check for activated payment method --- .../Wirecard/CheckoutPage/Block/Additional/Script.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/code/community/Wirecard/CheckoutPage/Block/Additional/Script.php b/app/code/community/Wirecard/CheckoutPage/Block/Additional/Script.php index 8af097c..cadb6c5 100644 --- a/app/code/community/Wirecard/CheckoutPage/Block/Additional/Script.php +++ b/app/code/community/Wirecard/CheckoutPage/Block/Additional/Script.php @@ -43,7 +43,10 @@ public function isRatepayPaymentProvider() { $installment = new Wirecard_CheckoutPage_Model_Installment(); $invoice = new Wirecard_CheckoutPage_Model_Invoice(); - return ($installment->getConfigData('provider') == "ratepay" || $invoice->getConfigData('provider') == "ratepay"); + $payments = Mage::getSingleton('payment/config')->getActiveMethods(); + + + return (($installment->getConfigData('provider') == "ratepay" && in_array("installment", $payments))|| ($invoice->getConfigData('provider') == "ratepay" && in_array("invoice", $payments))); } public function getConsumerDeviceId() { From 362417f161200b1f5e12a5180e2537feb2ea751f Mon Sep 17 00:00:00 2001 From: sdcwdcee Date: Thu, 25 Jan 2018 15:50:10 +0100 Subject: [PATCH 08/10] #31 Check for activated payment method v2 --- .../CheckoutPage/Block/Additional/Script.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/code/community/Wirecard/CheckoutPage/Block/Additional/Script.php b/app/code/community/Wirecard/CheckoutPage/Block/Additional/Script.php index cadb6c5..f473d59 100644 --- a/app/code/community/Wirecard/CheckoutPage/Block/Additional/Script.php +++ b/app/code/community/Wirecard/CheckoutPage/Block/Additional/Script.php @@ -43,10 +43,23 @@ public function isRatepayPaymentProvider() { $installment = new Wirecard_CheckoutPage_Model_Installment(); $invoice = new Wirecard_CheckoutPage_Model_Invoice(); + $payments = Mage::getSingleton('payment/config')->getActiveMethods(); + $methods = array(array('value'=>'', 'label'=>Mage::helper('adminhtml')->__('--Please Select--'))); + + foreach ($payments as $paymentCode=>$paymentModel) { + $paymentTitle = Mage::getStoreConfig('payment/'.$paymentCode.'/title'); + $methods[$paymentCode] = array( + 'label' => $paymentTitle, + 'value' => $paymentCode, + ); + } + + $installment_active = in_array(array('label' => 'Installment', 'value' => 'wirecard_checkoutpage_installment'), $methods); + $invoice_active = in_array(array('label' => 'Invoice', 'value' => 'wirecard_checkoutpage_invoice'), $methods); - return (($installment->getConfigData('provider') == "ratepay" && in_array("installment", $payments))|| ($invoice->getConfigData('provider') == "ratepay" && in_array("invoice", $payments))); + return (($installment->getConfigData('provider') == "ratepay" && $installment_active) || ($invoice->getConfigData('provider') == "ratepay" && $invoice_active)); } public function getConsumerDeviceId() { From 500640892baf346d91104a07fbbdcb8034b59047 Mon Sep 17 00:00:00 2001 From: sdcwdcee Date: Thu, 25 Jan 2018 15:50:19 +0100 Subject: [PATCH 09/10] #35 Changes to composer.json license --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7cfe072..79a226c 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "wirecard/magento-wcp", - "license": "GPL-2.0", + "license": "GPL-2.0-only", "type": "magento-module", "description": "Wirecard Checkout Page extension for Magento", "keywords": ["wirecard", "checkout", "page", "payment", "magento"], From bac005d589d0cff1613618e6f0494c0de046654c Mon Sep 17 00:00:00 2001 From: sdcwdcee Date: Thu, 25 Jan 2018 16:27:00 +0100 Subject: [PATCH 10/10] #31 Check for activated payment method v3 --- .../CheckoutPage/Block/Additional/Script.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/app/code/community/Wirecard/CheckoutPage/Block/Additional/Script.php b/app/code/community/Wirecard/CheckoutPage/Block/Additional/Script.php index f473d59..c8c613b 100644 --- a/app/code/community/Wirecard/CheckoutPage/Block/Additional/Script.php +++ b/app/code/community/Wirecard/CheckoutPage/Block/Additional/Script.php @@ -45,18 +45,14 @@ public function isRatepayPaymentProvider() $invoice = new Wirecard_CheckoutPage_Model_Invoice(); $payments = Mage::getSingleton('payment/config')->getActiveMethods(); - $methods = array(array('value'=>'', 'label'=>Mage::helper('adminhtml')->__('--Please Select--'))); + $methods = array(); foreach ($payments as $paymentCode=>$paymentModel) { - $paymentTitle = Mage::getStoreConfig('payment/'.$paymentCode.'/title'); - $methods[$paymentCode] = array( - 'label' => $paymentTitle, - 'value' => $paymentCode, - ); + $methods[] = $paymentCode; } - $installment_active = in_array(array('label' => 'Installment', 'value' => 'wirecard_checkoutpage_installment'), $methods); - $invoice_active = in_array(array('label' => 'Invoice', 'value' => 'wirecard_checkoutpage_invoice'), $methods); + $installment_active = in_array('wirecard_checkoutpage_installment', $methods); + $invoice_active = in_array('wirecard_checkoutpage_invoice', $methods); return (($installment->getConfigData('provider') == "ratepay" && $installment_active) || ($invoice->getConfigData('provider') == "ratepay" && $invoice_active));