PDA

View Full Version : Payment_gateway.php variables


mambomouth
02-25-2007, 07:19 PM
Hello All I have question I’m trying to add an affiliate program to my VB forum subscriptions.

I have Idea a few files but I think this the one to do it in.

The Affiliate software needs two variables.
1. $id_transaction // transaction id
2. $amount // the amount of the sale

VB 3.6.4 version

Payment_gateway.php
Around Line 81
// if ($apiobj->verify_payment())

My question is would these two VB calls work to give my affiliate program variables the proper
values per transaction ?

$apiobj->transaction_id
$apiobj->paymentinfo['amount']

// Affiliate Variables assigned
1. $idaff_transaction = $apiobj->transaction_id;
2. $aff_amount = $apiobj->paymentinfo['amount'];

Then inside the if condition in line number 105
// if ($apiobj->type == 1){

/* I would add the affiliate link code * /

}

And for returned funds line number 120
// if ($apiobj->type == 2){

/* I would add the affiliate link code for refund updates * /

}

If someone could please verify it would make my day.
Cheers and thank you in advance.
Brian

dxguru
04-13-2007, 01:52 PM
That is what I had also ... not yet working completely because the payment processor triggers the payment_gateway.php, which means that the tracking token for the affiliate script is not present.

Currently I am looking at other ways including having a successful payment send the actual user back through the payment_gateway.php script.

bada_bing
04-13-2007, 03:17 PM
Good luck getting someone to actually answer this, I asked a simular question months ago as im trying to get idev working with the vb subscription system and cant get no response from anyone

mambomouth
04-13-2007, 08:26 PM
I have been coding a ton I have not had time to implement my hack.
But I think there is an easier way to do this.

Thru the email phrase for the subscription

Any Affiliate script works by a user clicking the ad at your affiliate partner site.
That link makes a cookie and sends the user to your product page.

If the buy something you need

1. Order ID
2. Affiliate ID
3. Amount
4. If the transaction is ok or not.

All the variables needed are used in both the Phrases email body?s bellow.

So all you have to do is to make a custom email link because you are the only person who sees this email not the client. When you get a sale that is thru an affiliate you click the link in your email client approving the sale via the custom link added to the email body this would act like the trigger to give credit to the affiliate.

// Admin CP look for the Languages & Phrases > Phrase Manager

Inside the phrase ?email body ?
1. payment_ received
2. payment_ reversed

// approve the Affiliate transaction
1. payment_ received

The Var?s needed
$userid
Username : $username Subscription :
$subscription Amount: $amount
Processor: $processor
Transaction ID: $transactionid

// affiliate snippet code
{Add your affiliate script link http://www.localhost123.com?var1& var2&var3}

// If it?s a charge back take back the credit from the Affiliate.
payment_ reversed

The Var?s needed
$userid
Username : $username Subscription :
$subscription Amount: $amount
Processor: $processor
Transaction ID: $transactionid

// affiliate snippet code
{Add your affiliate script link http://www.localhost123.com?var1& var2&var3}

I have not tested it but it should work I?m going to use it soon.
I?m give back to this site because it helped me with my Vbulletin Custom code to get an Idea of what was what.

Thanks vbulletin.org and it members!

Cheers,
Brian Diaz
Media 65

P.S Guys don?t steal my credit.
bada_bing => Say hello to ?Joey Scoppetta? Hey

mambomouth
07-24-2008, 06:52 PM
I have found this vbulletin affiliate integration.

http://jam.jrox.com/docs/index.php?article=187

I have not gotten it to work right but every little bit helps.

Cheers,
Brian