Jump to content

JROX and WHMC Integratration


WHMCS Mark

Recommended Posts

Hi

I have searched all the threads here and on JAM, and still can;t figure out why JAM doesn't want to behave with WHMS.

 

I have used this in /includes/hooks with some obvious changes to send the info via email so I can see if the cookie stuff is working.

<?php
function actionhook_InvoicePaid() {
 $vars = func_get_args();
 ob_start();
print_r($_GET);
print_r($_POST);
print_r($vars);
$contents = ob_get_clean();
mail("email@xtra.co.nz","ifam 1",$contents);
  if (!empty($_COOKIE['jrox']))
   {
$result=mysql_query("SELECT * FROM tblorders WHERE invoiceid = '" . $vars["InvoiceID"] ."' LIMIT 1");
$row = mysql_fetch_array($result);
$JAMIntegrate = file_get_contents("http://www.xxx.com/affiliates/sale.php?amount=".$row['amount']."&trans_id=".$vars["InvoiceID"]."&custom_mid=".$_COOKIE['jrox']);
 }

}
add_hook("InvoicePaid",0,"actionhook_InvoicePaid","");

?>

which spits back this to my email (credit card numbers changed)
GET

Array
(
)
POST

Array
(
   [action] => submit
   [invoiceid] => 25
   [firstname] => xx
   [lastname] => xxan
   [address1] => 4080 Paradise Rd., #15-357
   [address2] =>
   [city] => Las Vegas
   [state] => NV
   [postcode] => 89169
   [country] => US
   [phonenumber] => 12345678
   [ccinfo] => new
   [cccvv2] =>
   [cctype] => MasterCard
   [ccnumber] =>  xxx 5xxx xx xx
   [ccexpirymonth] => 11
   [ccexpiryyear] => 10
   [cccvv] => xxx
)
Vars
Array
(
   [0] => 25
)
COOKIE

Array
(
   [jrox] => 1###1###0###0###Unknown
   [phpSESSID] => 9eab73f015438858d1454197595d3d00
   [jam_protect] => 84cb37edf7612a1ed426efd5885c04c7
)
ROW

This is as far as I have got, what I am trying to do is:

JAM and WHMCS on same domain, affilate links to remote site, so have turned on append cookie to url in JAM and used the suggested php in the remote site header.

 

Cookie works at that stage and JAM tracks the click - the user then clicks on a join now button on the remote site which redirects them back into WHMS cart i.e to purchase product - which is where I lose all the tracking. I complete the sale etc but no comissions are being recorded.

 

Has anyone got WHMCS and JAM working together correctly?

 

Thanks in advance for some advice

 

Scott

Link to comment
Share on other sites

  • 1 year later...
  • 1 year later...

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