/** * Check - method is enabled or not * * @param \XLite\Model\Payment\Method $method Method * * @return boolean */ public function isMethodEnabled(\XLite\Model\Payment\Method $method) { return (bool) $method->getEnabled(); }
/** * Do something when payment method is enabled or disabled * * @param \XLite\Model\Payment\Method $method Payment method * * @return void */ public function enableMethod(\XLite\Model\Payment\Method $method) { $methods = array(Paypal\Main::PP_METHOD_PPA, Paypal\Main::PP_METHOD_PFL); // Add Express Checkout if the admin enables PPA or PFL methods if (in_array($method->getServiceName(), $methods) && $method->getEnabled()) { $m = Paypal\Main::getPaymentMethod(Paypal\Main::PP_METHOD_EC); if ($m) { $m->setAdded(true); $m->setEnabled(true); } } $methods[] = Paypal\Main::PP_METHOD_EC; // Add Paypal Credit if the admin enables PPA or PFL methods if (in_array($method->getServiceName(), $methods) && $method->getEnabled()) { $m = Paypal\Main::getPaymentMethod(Paypal\Main::PP_METHOD_PC); if ($m) { $m->setAdded(true); $m->setEnabled(true); } } }
/** * {@inheritDoc} */ public function getEnabled() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getEnabled', array()); return parent::getEnabled(); }