Jump to content

Activating Custom gateway module


romatr

Recommended Posts

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.

Link to comment
Share on other sites

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 by sparky
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated