Skip to content

Commit

Permalink
#31 Check for activated payment method v3
Browse files Browse the repository at this point in the history
  • Loading branch information
sdcwdcee committed Jan 25, 2018
1 parent 5006408 commit bac005d
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit bac005d

Please sign in to comment.