One of the problems for any Clickbank marketer is how to validate payments before giving access to her/his Clickbank product download page.
Clickbank guys have given us a useful clickbank script function for PHP to help us deal with this problem. Firstly let me show you the function and later we will talk a little more about it.
Ok... the function:
-
function cbValid()
-
{ $key='YOUR SECRET KEY';
-
$rcpt=$_REQUEST['cbreceipt'];
-
$time=$_REQUEST['time'];
-
$item=$_REQUEST['item'];
-
$cbpop=$_REQUEST['cbpop'];
-
-
-
if ($cbpop==$xxpop) return 1;
-
else return 0;
-
}
This is a ready to call function to validate a buyer before grant access to our Clickbank product.
As this must be a black box for us we just need to update our key ($key='YOUR SECRET KEY') with the one defined in our Clickbank account and we're ready.
You need to add the function and the following code at the top of your Clickbank dowload page:
-
function cbValid()
-
{ $key='YOUR SECRET KEY';
-
$rcpt=$_REQUEST['cbreceipt'];
-
$time=$_REQUEST['time'];
-
$item=$_REQUEST['item'];
-
$cbpop=$_REQUEST['cbpop'];
-
-
-
if ($cbpop==$xxpop) return 1;
-
else return 0;
-
}
-
-
if ( cbValid() == 0 ) {
-
}
-
// Add from here your own download page.
This option will prevent real buyers to return to our download page for downloading their product again, so you can add them to a buyer’s database if you want to give them access for downloading the product more than once.
If you have any question do not hesitate to write a comment.













3 Comments
Clickbank says that you can get other variables like email address back from them. Is there a way to capture this info and use it on my site to create a user account?
That way I can keep a log that the user has bought the item and I can also capture contact data from them.
Steve,
Thanks for contacting us, I was implementing some testing on my own Clickbank account to give you a better answer. The $_REQUEST array that Clickbank send back to our thank you pages has the following items:
[item] => 1
[cbreceipt] => TEST4NED
[time] => 1227798981
[cbpop] => 89B4F1E2
[cbaffi] => 0
[cname] => NAME ON CARD
[cemail] => BUYER’S EMAIL
[czip] => 99999
[ccountry] => US
With these fields you can implement what you need.
I did that on one of my site calling an API to add automatically buyers to my database.
Thank you again
i am using both Clickbank and infolinks ads on my website. Clicbank generates more money than infolinks but your website should be getting lots of us traffic.