From bac005d589d0cff1613618e6f0494c0de046654c Mon Sep 17 00:00:00 2001 From: sdcwdcee Date: Thu, 25 Jan 2018 16:27:00 +0100 Subject: [PATCH] #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));