Help with ClickBank API Instant Email Notification Script
(documentation HERE: Instant Notification Service)
Here's the working script for CB Instant Notification V1.0
<?php function cbValid() { $key='YOUR_SECRET_KEY_HERE'; $ccustname = $_REQUEST['ccustname']; $ccustemail = $_REQUEST['ccustemail']; $ccustcc = $_REQUEST['ccustcc']; $ccuststate = $_REQUEST['ccuststate']; $ctransreceipt = $_REQUEST['ctransreceipt']; $cproditem = $_REQUEST['cproditem']; $ctransaction = $_REQUEST['ctransaction']; $ctransaffiliate = $_REQUEST['ctransaffiliate']; $ctranspublisher = $_REQUEST['ctranspublisher']; $cprodtype = $_REQUEST['cprodtype']; $cprodtitle = $_REQUEST['cprodtitle']; $ctranspaymentmethod = $_REQUEST['ctranspaymentmethod']; $ctransamount = $_REQUEST['ctransamount']; $caffitid = $_REQUEST['caffitid']; $cvendthru = $_REQUEST['cvendthru']; $cbpop = $_REQUEST['cverify']; $xxpop = sha1("$ccustname|$ccustemail|$ccustcc|$ccuststate|$ctransreceipt |$cproditem|$ctransaction|" ."$ctransaffiliate|$ctranspublisher|$cprodtype|$cprodtitle|$ctranspaymentmethod |$ctransamount|$caffitid|$cvendthru|$key"); $xxpop=strtoupper(substr($xxpop,0,8)); if ($cbpop==$xxpop) return 1; else return 0; } if (cbValid()) mail("YOUR_EMAIL_ADDRESS_HERE", "ClickBank - " . $_REQUEST['ctransaction'],"Product: " . $_REQUEST['cprodtitle'] . "\nPublisher: " . $_REQUEST['ctranspublisher'] . "\nAffiliate: " . $_REQUEST['ctransaffiliate'] . "\nTransaction: " . $_REQUEST['ctransaction'] . "\nAmount: " . $_REQUEST['ctransamount']); ?>
<?php function cbValid() { $key='SECRET KEY'; $ccustfullname = $_REQUEST['ccustfullname']; $ccustfirstname = $_REQUEST['ccustfirstname']; $ccustlastname = $_REQUEST['ccustlastname']; $ccuststate = $_REQUEST['ccuststate']; $ccustzip = $_REQUEST['ccustzip']; $ccustcc = $_REQUEST['ccustcc']; $ccustaddr1 = $_REQUEST['ccustaddr1']; $ccustaddr2 = $_REQUEST['ccustaddr2']; $ccustcity = $_REQUEST['ccustcity']; $ccustcounty = $_REQUEST['ccustcounty']; $ccustshippingstate = $_REQUEST['ccustshippingstate']; $ccustshippingzip = $_REQUEST['ccustshippingzip']; $ccustshippingcountry = $_REQUEST['ccustshippingcountry']; $ccustemail = $_REQUEST['ccustemail']; $cproditem = $_REQUEST['cproditem']; $cprodtitle = $_REQUEST['cprodtitle']; $cprodtype = $_REQUEST['cprodtype']; $ctransaction = $_REQUEST['ctransaction']; $ctransaffiliate = $_REQUEST['ctransaffiliate']; $caccountamount = $_REQUEST['caccountamount']; $corderamount = $_REQUEST['corderamount']; $ctranspaymentmethod = $_REQUEST['ctranspaymentmethod']; $ccurrency = $_REQUEST['ccurrency']; $ctranspublisher = $_REQUEST['ctranspublisher']; $ctransreceipt = $_REQUEST['ctransreceipt']; $ctransrole = $_REQUEST['ctransrole']; $cupsellreceipt = $_REQUEST['cupsellreceipt']; $crebillamnt = $_REQUEST['crebillamnt']; $cprocessedpayments = $_REQUEST['cprocessedpayments']; $cfuturepayments = $_REQUEST['cfuturepayments']; $cnextpaymentdate = $_REQUEST['cnextpaymentdate']; $crebillstatus = $_REQUEST['crebillstatus']; $ctid = $_REQUEST['ctid']; $cvendthru = $_REQUEST['cvendthru']; $cverify = $_REQUEST['cverify']; $ctranstime = $_REQUEST['ctranstime']; $xxpop = sha1("$ccustfullname|$ccustfullname|$ccustfirstname|$ccustlastname|$ccuststate|$ccustzip|$ccustcc|$ccustaddr1|$ccustaddr2|$ccustcity|$ccustcounty|$ccustshippingstate|$ccustshippingzip|$ccustshippingcountry|$ccustemail|$cproditem|$cprodtitle|$cprodtype|$ctransaction|$ctransaffiliate|$caccountamount|$corderamount|$ctranspaymentmethod|$ccurrency|$ctranspublisher|$ctransreceipt|$ctransrole|$cupsellreceipt|$crebillamnt|$cprocessedpayments|$cfuturepayments|$cnextpaymentdate|$crebillstatus|$ctid|$cvendthru|$ctranstime|$key"); $xxpop=strtoupper(substr($xxpop,0,8)); if ($cverify==$xxpop) return 1; else return 0; } if (cbValid()) mail("ENTER YOUR EMAIL", "ClickBank - " . $_REQUEST['ctransaction'],"Product: " . $_REQUEST['cprodtitle'] . "\nPublisher: " . $_REQUEST['ctranspublisher'] . "\nItem Number: " . $_REQUEST['cproditem'] . "\n\nTransaction: " . $_REQUEST['ctransaction'] . "\nRecurring or 1-Time: " . $_REQUEST['cprodtype'] . "\nAmount: " . $_REQUEST['caccountamount'] . "\n\nIf Rebill Amt: " . $_REQUEST['crebillamnt'] . "\nMembership Staus: " . $_REQUEST['crebillstatus'] . "\nMonth as Member: " . $_REQUEST['cprocessedpayments'] . "\n\nCust Name: " . $_REQUEST['ccustfullname'] ."\nCust Email: " . $_REQUEST['ccustemail'] . "\nCust State: " . $_REQUEST['ccuststate'] . "\nCust Zip: " . $_REQUEST['ccustzip'] . "\nCust County: " . $_REQUEST['ccustcc'] . "\n\nAffiliate: " . $_REQUEST['ctransaffiliate'] . "\nTrackingID: " . $_REQUEST['ctid']); ?>
Again, here's the documentation from CB: Instant Notification Service
Thanks!
Eddie Spradley