sorted out most things but if anyone knew how to add different card types that would be grand - I need to add 3 UK based cards (although they’re just maestro I believe) SWITCH/Solo and visa electron. Point is I can just pass the card code I choose to the payment gateway (protx) but am having issues adding additional options to this drop down.
If you have nay hints, it would be much apreciated.
Thanks!
hi,
open config.xml of your payment module and add between <global></global>
I also am having a hard time with this.. i’ve tried for days now to just get this to show up in the “payment methods” options but so far it will only show in the advanced area as “Mage_MZHeidelpay” and it says its enabled. Can someone please look at this code and tell me where im going wrong just to get the basic thing to display. I took it from posts earlier in this and if i get some help ill post the final as a template for anyone that is trying to create there own payment module cause thats all im trying to do at this point is get a template that shows up.. then ill go and add all the code/logic but this part is proving to be far more difficult then it should and i know php and xml very well.. just not well enough i guess. any help would be great.
here it is..answered my own question.. no idea why that other doesnt work but the concept was the same.. i really think it had to do with the names and some not being the same case. anyways here is a working template for the latest verison of magento.. just gives you the basic to develop off of.
here it is..answered my own question.. no idea why that other doesnt work but the concept was the same.. i really think it had to do with the names and some not being the same case. anyways here is a working template for the latest verison of magento.. just gives you the basic to develop off of.
Scott
Hi Scott.
Thanks for posting this, this looks the closest to a working ProTX module that I’ve seen. I’ve copied the files into app/code/community to play around with, what else do I need to do to make it show up in Admin?
edit: sorry, got it. Protx.xml needs to be in app/etc/modules. =)
edit 2: produces errors on the checkout page. I’m sure I’ve put stuff in the wrong folders…
edit 3: can’t figure it out. Here’s my error which I get when accessing the checkout. Module appears fine in the admin backend:
Warning: include(Protx.php) [function.include]: failed to open stream: No such file or directory in C:\xampp\htdocs\magento\app\code\core\Mage\Core\functions.php on line 44
[0] in __autoload() in C:\xampp\htdocs\magento\app\code\core\Mage\Core\functions.php on line 44
[1] in __autoload("Protx")
[2] in class_exists("Protx") in C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\Config.php on line 607
[3] in Mage_Core_Model_Config->getModelInstance("Protx", Array[0]) in C:\xampp\htdocs\magento\app\Mage.php on line 289
[4] in Mage::getModel("Protx") in C:\xampp\htdocs\magento\app\code\core\Mage\Payment\Helper\Data.php on line 68
[5] in Mage_Payment_Helper_Data->getStoreMethods(NULL, Mage_Sales_Model_Quote) in C:\xampp\htdocs\magento\app\code\core\Mage\Payment\Block\Form\Container.php on line 85
[6] in Mage_Payment_Block_Form_Container->getMethods() in C:\xampp\htdocs\magento\app\code\core\Mage\Payment\Block\Form\Container.php on line 37
[7] in Mage_Payment_Block_Form_Container->_prepareLayout() in C:\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Abstract.php on line 192
[8] in Mage_Core_Block_Abstract->setLayout(Mage_Core_Model_Layout) in C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\Layout.php on line 425
[9] in Mage_Core_Model_Layout->addBlock("Mage_Checkout_Block_Onepage_Payment_Methods", “checkout.payment.methods") in C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\Layout.php on line 220
[10] in Mage_Core_Model_Layout->_generateBlock(Mage_Core_Model_Layout_Element, Mage_Core_Model_Layout_Element) in C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\Layout.php on line 186
[11] in Mage_Core_Model_Layout->generateBlocks(Mage_Core_Model_Layout_Element) in C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\Layout.php on line 187
[12] in Mage_Core_Model_Layout->generateBlocks(Mage_Core_Model_Layout_Element) in C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\Layout.php on line 187
[13] in Mage_Core_Model_Layout->generateBlocks(Mage_Core_Model_Layout_Element) in C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\Layout.php on line 191
[14] in Mage_Core_Model_Layout->generateBlocks() in C:\xampp\htdocs\magento\app\code\core\Mage\Core\Controller\Varien\Action.php on line 277
[15] in Mage_Core_Controller_Varien_Action->generateLayoutBlocks() in C:\xampp\htdocs\magento\app\code\core\Mage\Core\Controller\Varien\Action.php on line 214
[16] in Mage_Core_Controller_Varien_Action->loadLayout() in C:\xampp\htdocs\magento\app\code\core\Mage\Checkout\controllers\OnepageController.php on line 94
[17] in Mage_Checkout_OnepageController->indexAction() in C:\xampp\htdocs\magento\app\code\core\Mage\Core\Controller\Varien\Action.php on line 341
[18] in Mage_Core_Controller_Varien_Action->dispatch("index") in C:\xampp\htdocs\magento\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php on line 150
[19] in Mage_Core_Controller_Varien_Router_Standard->match(Mage_Core_Controller_Request_Http) in C:\xampp\htdocs\magento\app\code\core\Mage\Core\Controller\Varien\Front.php on line 147
[20] in Mage_Core_Controller_Varien_Front->dispatch() in C:\xampp\htdocs\magento\app\Mage.php on line 421
[21] in Mage::run("default") in C:\xampp\htdocs\magento\index.php on line 29
public function getMethodInstance($code) { $key = self::XML_PATH_HPCC_METHODS.'/'.$code.'/model'; $class = Mage::getStoreConfig($key); if (!$class) { Mage::throwException($this->__('Can not configuration for payment method with code: %s', $code)); } return Mage::getModel($class); }
and add following code to your model class
/** * Retrieve model helper * * @return Mage_Payment_Helper_Data */ protected function _getHelper() { return Mage::helper('protx'); }
/** * Retrieve information from payment configuration * * @param string $field * @return mixed */ public function getConfigData($field) { $path = 'payment/'.$this->getCode().'/'.$field; $config = Mage::getStoreConfig($path, $this->getStore());
Thanks. It might be something I’m doing wrong, but as far as I know I just copied the files right over. Protx appears in Admin, but the checkout page just crashes with the error above.
The community folder is in my include_path, so it’s not that.
Look at my Module, its posted as zip 9 posts before that. please excuse my really bad english, last english lesson was about 10 years ago, i can read and understand nearly everythink, but writing, omg…
Look at my Module, its posted as zip 9 posts before that. please excuse my really bad english, last english lesson was about 10 years ago, i can read and understand nearly everythink, but writing, omg…
cheers
Seems to have fixed the bug, thank you. At least now I can try and make progress. Thanks again!