Jump to content

Building Payment Gateways


Guest

Recommended Posts

OK, this is something I said I wouldn't be doing because at the time I was trying to install CubeCart 3.0b + things weren't going well to put it lightly..

Anyway, my apologies to those who were after this gateway for the latest version of CubeCart, who feel let down by me, + for keeping y'all waiting s'long...

First things:

Goto the folderwhereyouinstalledcubecart -> modules -> gateway folder + create a folder called PPPay (+ NO it doesn't need to be called that if you want to be akward :blink: ).

Create a notepad file here + name it transfer.inc.php (NOT transfer.inc.php.txt +, yes, it should be in plain text!!)

Secondly:

You need another folder called PPPay in admin -> modules -> gateway (if you named the last folder something else then change the name on this to match).

There should be 2 files in here:

index.php

logo.gif

The index.php can basically be copied straight from any of the other gateway folders. The code below is the slightly tweaked code I am using:

<?php

/*

+--------------------------------------------------------------------------

|   CubeCart v3.0.0

|   ========================================

|   by Alistair Brookbanks

| CubeCart is a Trade Mark of Devellion Limited

|   © 2005 Devellion Limited

|   Devellion Limited,

|   Westfield Lodge,

|   Westland Green,

|   Little Hadham,

|   Nr Ware, HERTS.

|   SG11 2AL

|   UNITED KINGDOM

|   http://www.devellion.com

| UK Private Limited Company No. 5323904

|   ========================================

|   Web: http://www.cubecart.com

|   Date: Friday, 1 July 2005

|   Email: [email protected]

| License Type: CubeCart is NOT Open Source Software and Limitations Apply

|   Licence Info: http://www.cubecart.com/site/faq/license.php

+--------------------------------------------------------------------------

| index.php

|   ========================================

| Configure PPPay

+--------------------------------------------------------------------------

*/

include("../../../../includes/ini.inc.php");

include("../../../../includes/global.inc.php");

include("../../../../classes/db.inc.php");

$db = new db();

include_once("../../../../includes/functions.inc.php");

$config = fetchDbConfig("config");

include_once("../../../../language/".$config['defaultLang']."/lang.inc.php");

$enableSSl = 1;

include_once("../../../../includes/sslSwitch.inc.php");

include("../../../includes/auth.inc.php");

include("../../../includes/header.inc.php");

if(permission("settings","read")==FALSE){

header("Location: ".$GLOBALS['rootRel']."admin/401.php");

exit;

}

if(isset($_POST['module'])){

include("../../status.php");

include("../../../includes/functions.inc.php");

$module = fetchDbConfig($_GET['folder']);

$msg = writeDbConf($_POST['module'], $_GET['folder'], $module);

}

$module = fetchDbConfig($_GET['folder']);

?>

<p><a href="http://www.pppay.com/"><img src="logo.gif" alt="" border="0" /></a></p>

<?php

if(isset($msg)){

echo $msg;

}

?>

<p class="copyText">&quot;Receive & Send Payments In $, £, + €&quot;</p>

<form action="<?php echo $GLOBALS['rootRel'];?>admin/modules/<?php echo $_GET['module']; ?>/<?php echo $_GET['folder']; ?>/index.php?module=<?php echo $_GET['module']; ?>&amp;folder=<?php echo $_GET['folder']; ?>" method="post" enctype="multipart/form-data">

<table border="0" cellspacing="0" cellpadding="3" class="mainTable">

  <tr>

    <td colspan="2" class="tdTitle">Configuration Settings </td>

  </tr>

  <tr>

    <td align="left" class="tdText"><strong>Status:</strong></td>

    <td class="tdText">

<select name="module[status]">

  <option value="1" <?php if($module['status']==1) echo "selected='selected'"; ?>>Enabled</option>

  <option value="0" <?php if($module['status']==0) echo "selected='selected'"; ?>>Disabled</option>

    </select>

</td>

  </tr>

   <tr>

   <td align="left" class="tdText"><strong>Description:</strong>

</td>

    <td class="tdText"><input type="text" name="module[desc]" value="<?php echo $module['desc']; ?>" class="textbox" size="30" /></td>

  </tr>

  <tr>

  <td align="left" class="tdText"><strong>Email Address:</strong></td>

    <td class="tdText"><input type="text" name="module" value="<?php echo $module['email']; ?>" class="textbox" size="30" /></td>

  </tr>

  <td align="left" class="tdText"><strong>Default:</strong></td>

      <td class="tdText">

<select name="module[default]">

  <option value="1" <?php if($module['default'] == 1) echo "selected='selected'"; ?>>Yes</option>

  <option value="0" <?php if($module['default'] == 0) echo "selected='selected'"; ?>>No</option>

</select>

</td>

  </tr>

  <tr>

    <td align="right" class="tdText">&nbsp;</td>

    <td class="tdText"><input type="submit" class="submit" value="Edit Config" /></td>

  </tr>

</table>

</form>

<?php include("../../../includes/footer.inc.php"); ?>

Just create a text file, copy the above code into it, + name it index.php before placing it with the logo.gif.

The logo.gif can be found here (ready formatted to the correct size :D !).

Finally, the transfer.inc.php that I mentionned before carries all the important variables that you need to make the gateway work. - I have not completed this for PPPay yet, but at least now you know how to get going with a new payment gateway.

As far as I can tell there is no messing-around with SQL required for most of the gateways, this being no exception. I will post more just as soon as I have more. Meantime if have Gold level of membership with PPPay + want the gateway to cover that please tell me, otherwise you will just get the straighforward version :) !

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.

×
×
  • Create New...