clickbank 短信提醒代碼及設置方法
2010-09-15有人在尋找設置Clickbank產生銷售時手機短信提醒的設置方法,很多說測試不成功,onlyqian把代碼發我測試了一下,是可以用的。
原理簡述:cb產生sale以后,根據自己后臺提供的secret key和mail.php,使用mail函數發郵件至指定郵箱,郵箱為139郵箱或qq郵箱綁定手機,即可收到cb產生銷售的手機短信提醒。
代碼如下:點擊下載 (此代碼cb后臺可獲取)
- <?php
- function cbValid() {
- $key='7009';
- $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("[email protected]", "ClickBank - " . $_REQUEST['ctransaction'],"Product: " . $_REQUEST['cprodtitle'] . "\nPublisher: " . $_REQUEST['ctranspublisher'] . "\nAffiliate: " . $_REQUEST['ctransaffiliate'] . "\nTransaction: " . $_REQUEST['ctransaction'] . "\nAmount: " . $_REQUEST['ctransamount']);
- ?>
用法:
1、命名以上代碼為mail.php,修改mail.php中的Secret Key 改為任意的大寫字母或數字,郵箱改為你的郵箱,保存,然后上傳到你的空間上。
2、打開CB賬號,進入 ACCOUNT SETTINGS - My site – Advanced Tools – Edit
Secret Key: 填上剛才PHP文件中的“任意的大寫字母或數字”
Instant Notification URL: 點 (request access)
3、出來一列問題,你都選 YES,然后下面的Terms of Use 拉下來, I understand and agree to the Terms of Use. * 打勾,保存。
4、然后 Instant Notification URL 填上你剛才那個PHP文件的地址,如 XXX.COM/mail.php 點后面的 TEST,如果有收到信件就代表成功了!
不成功的原因:
1、存放mail.php的webhosting不支持mail函數。
2、郵箱對沒有反向解析過的郵件發送,默認設為垃圾郵件件,推薦使用qq郵箱。
3、test的時候,選擇2.0,本人測試1.0成功。
另外refund也會提醒。