Admins eHow SysAdmin Tips & Tricks

August 1, 2009

WHCMS 4.x integration with Jrox Affiliate Management System (JAM)

Filed under: General — Tags: , , , — admin @ 7:19 pm

In order to integrate WHMCS 4.x with Jrox Affiliate Management (JAM) system , create a file named jam.php in whmcs/includes/hooks with following content :

<?
function actionhook_InvoicePaid($vars) {
    if (!empty($_COOKIE['jrox'])){
        $result=mysql_query("SELECT * FROM tblorders WHERE invoiceid = '".$vars."' LIMIT 1");
        $row = mysql_fetch_array($result);
		$JAMIntegrate = file_get_contents("http://www.domain.com/affiliates/sale.php?amount=".$row['amount']."&trans_id=".$vars."&custom_mid=".$_COOKIE['jrox']);
    }
}
add_hook("InvoicePaid",0,"actionhook_InvoicePaid","");
?>

Make sure to point www.domain.com/affiliates to your JAM installation URL.

Powered by WordPress