romatr Posted October 17, 2008 Share Posted October 17, 2008 Hi, I have a little trouble with activating my gateway module. I made it from template, uploaded, but is is not visible under list of available modules. No any errors show/log to me. 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted October 17, 2008 Share Posted October 17, 2008 More information needed for someone to be able to help you 0 Quote Link to comment Share on other sites More sharing options...
romatr Posted October 20, 2008 Author Share Posted October 20, 2008 This are steps I did: 1. Renamed template.php to mygateway.php and replaces all occurences of "template" in this new file. This is a short listing of my new file: <?php // Set the Gateway Variables $GATEWAYMODULE = array( 'templatename' => "mygateway", 'templatevisiblename' => "My Gateway", 'templatetype' => "Invoices", # Invoices or CC ); function mygateway_activate() { // Here you need to define the fields required to configure your gateway - vars: template, type, name, default value, friendly name, size, description defineGatewayField("mygateway", "text", "username", "", "Customer ID", "20", "Your customer ID number assigned to you by Gateway"); defineGatewayField("mygateway", "text", "password", "", "Password for Customer ID", "20", "The password for your custid as assigned by Gateway"); defineGatewayField("mygateway", "yesno", "testmode", "", "Test Mode", "", "When set to \"y\", the transaction will be a test transaction only"); } function mygateway_link($params) { // This was not changed. I use _capture function } function mygateway_capture($params) { // Here is code of MyGateway } ?> 2. I uploaded mygateway.php to the modules/gateways folder. 3. Opened from admin panel page Configuration -> Payment Gateways. There is a list of available gateways to activate. But there isn't "My Gateway" in the list. And no any errors/messages on page or apache log files. 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted October 20, 2008 Share Posted October 20, 2008 (edited) Try this... but instead of me telling you what was wrong, You tell me!! <?php # Set the Gateway Variables $GATEWAYMODULE = array( "mygatewayname" => "mygateway", "mygatewayvisiblename" => "My Gateway", "mygatewaytype" => "Invoices", # Invoices or CC ); function mygateway_activate() { # Here you need to define the fields required to configure your gateway - vars: mygateway, type, name, default value, friendly name, size, description defineGatewayField("mygateway", "text", "username", "", "Customer ID", "20", "Your customer ID number assigned to you by Gateway"); defineGatewayField("mygateway", "text", "password", "", "Password for Customer ID", "20", "The password for your custid as assigned by Gateway"); defineGatewayField("mygateway", "yesno", "testmode", "", "Test Mode", "", "When set to \"y\", the transaction will be a test transaction only"); } function mygateway_link($params) { } function mygateway_capture($params) { } ?> HINT: There was 2 main problems 1st was three instances of it 2nd only 1 instance Edited October 20, 2008 by sparky 0 Quote Link to comment Share on other sites More sharing options...
romatr Posted October 20, 2008 Author Share Posted October 20, 2008 Ok, I understood $GATEWAYMODULE = array( "mygatewayname" => "mygateway", "mygatewayvisiblename" => "My Gateway", "mygatewaytype" => "Invoices", # Invoices or CC ); I thought that only full term "template" needs to be replaced. Thank you Sparky. Yet one little question. What values has gateway field type "yesno": yes/no, y/n, 1/0 or something else? 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted October 20, 2008 Share Posted October 20, 2008 I thought that only full term "template" needs to be replaced. No... As it says replace ALL instances of template Yet one little question. What values has gateway field type "yesno": yes/no, y/n, 1/0 or something else? 1/0 or true/false The second problem was that there was a space after the ?> at the end of the file which would have caused a blank screen 0 Quote Link to comment Share on other sites More sharing options...
romatr Posted October 20, 2008 Author Share Posted October 20, 2008 Thank you for your advise Sparky. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.