nBill Community nBill Home Page
21/May/2012, 10:45:41 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Click Here for the nBill home page, or take a tour.  
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Sending a Cookie ID with IPN/Callback URL for affiliate Tracking  (Read 4167 times)
TheBelgarion
Jr. Member
**
Offline Offline

Posts: 30


View Profile WWW
« on: 19/December/2009, 03:34:59 PM »

Hello folx,

I just tried to integrate an affilate programm (AMIGOS - affiliate tracking).

I guess the best way would be to add an Event for the Tracking at

com_netinvoice/events/payment_received/payment_received.amigos.php
Code:
if (!empty($_REQUEST['amigosid'])) {
//Initialise

$amigos_params['amigos_id'] = $_REQUEST['amigosid'];
$amigos_params['amigos_ordertype']  = 'xxx';
$amigos_params['amigos_orderid'] = $params["order_ids"];
$amigos_params['amigos_orderamount'] = format_number($params["amount"], 2);
$amigos_params['task'] = 'sale';
$amigos_params['option'] = 'com_amigos';
$amigos_host = 'http://myhost';
$amigos_page = 'index2.php';
nbGetHTTP($amigos_host,$amigos_page,$amigos_params);

But the Problem is the IPN/Callback gets called from the payment provider e.g. Paypal ... so they dont have the ID COOKIE.

So I thought why not simple add &amigosid=$_COOKIE['amigosid'] to the IPN/Callback URL so the callback should have the
correct Value for the ID field so I could count the affiliate Lead.

Is there a "simple" way to do so?? or there to start.

thx a lot
Thomas
Logged

B2B Import & Export Portal www.europrompt.com
netshine
Administrator
Hero Member
*****
Offline Offline

Posts: 4,563


View Profile
« Reply #1 on: 19/December/2009, 08:04:55 PM »

The Post Affiliate Pro extension for nBill faces a similar problem. I got round it by saving the cookie data in the gateway transaction table, then re-loading it on the callback. If you examine the code for the PAP extension (it is open source), you should be able to use a similar method.
Logged
TheBelgarion
Jr. Member
**
Offline Offline

Posts: 30


View Profile WWW
« Reply #2 on: 22/December/2009, 01:48:55 PM »

Ah it just uses gateway activated event for the storing .. and retrieves the data on the payment received event sounds easy ...

thx a lot


and merry X-mas to you!
Logged

B2B Import & Export Portal www.europrompt.com
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!