Gateways

GameCP can support almost any type of payment gateway. From SMS payments to IPN style payments its possible to integrate any solution using PHP.

Contents

Required Files

GameCP uses a return file and a form file.

  • includes/gateways/GatwayName/return.php
  • includes/template/default/smarty/GatewayName/form.tpl

return.php

The return.php file processes your gateways results and determins the status of the payment, if it was completed, pending or failed.

Example

$gatewayinfo = mysql_query("SELECT * FROM gateways WHERE name='GatewayName' LIMIT 1;") or die(mysql_error());
$gateway = mysql_fetch_array($gatewayinfo);

$responseMessage="";
$orderStatus = "Pending";


$orderStatus

  • Pending
  • Completed
  • Failed


$paidPrice

This is the total price paid


$paidFee

This is the total fee charged for the transaction


$responseMessage

This should be any error, warning or successful message.




 

form.tpl

This is the template used for your gateway. May variables are available for your use.

  • {$value1} - value from the gateway setting
  • {$value2} - value from the gateway setting
  • {$value3} - value from the gateway setting
  • {$value4} - value from the gateway setting
  • {$info[0].gross} - the total due
  • {$currencyName}

Required Variables

Some fields are required for GameCP to process your order better.

The field bid or field qid are required to POST back to return.php

{if $orderform == "true"} 
 	<input type=text name=qid value={$info[0].qid}>
{else}
	<input type=text name=bid value={$bid}>
{/if}

Order Form

These are not available for bill payment

  • {$info[0].username}
  • {$info[0].packageName}
  • {$info[0].packageSlots}
  • {$info[0].packageTerm}
  • {$info[0].qid}

Profile

These are not always defined so dont rely 100% on then, if they are required - ask for the user to input them.

  • {$info[0].email}
  • {$info[0].phone}
  • {$info[0].zip}
  • {$info[0].firstname}
  • {$info[0].lastname}
  • {$info[0].country}{$info[0].address}
  • {$info[0].address2}




(wiki tools)
Personal tools
Views
Actions




Need help? Chat with us!