Clickbank instant notification version 6
I am new to this
I just read https://support.clickbank.com/entries/22803622-Instant-Notification-Service
As I understand, if there is a payment, Clickbank calls a script on my server (the one I have set up under Instant Notification URL).
Now my question is what is the difference between these 2 scripts?
function ipnVerification() {
$secretKey="YOUR SECRET KEY";
$pop = "";
$ipnFields = array();
foreach ($_POST as $key => $value) {
if ($key == "cverify") {
continue;
}
$ipnFields[] = $key;
}
sort($ipnFields);
foreach ($ipnFields as $field) {
// if Magic Quotes are enabled $_POST[$field] will need to be
// un-escaped before being appended to $pop
$pop = $pop . $_POST[$field] . "|";
}
$pop = $pop . $secretKey;
$calcedVerify = sha1(mb_convert_encoding($pop, "UTF-8"));
$calcedVerify = strtoupper(substr($calcedVerify,0,8));
return $calcedVerify == $_POST["cverify"];
}
// NOTE: the mcrypt libraries need to be installed and listed as an available extension in
// your phpinfo() to be able to use this method of decryption.
$secretKey = "BEHNAM"; // secret key from your ClickBank account
// get JSON from raw body...
$message = json_decode(file_get_contents('php://input'));
// Pull out the encrypted notification and the initialization vector for
// AES/CBC/PKCS5Padding decryption
$encrypted = $message->{'notification'};
$iv = $message->{'iv'};
error_log("IV: $iv");
// decrypt the body...
$decrypted = trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_128,substr(sha1($secretKey), 0, 32),base64_decode($encrypted),MCRYPT_MODE_CBC,base64_decode($iv)), "\0..\32");
error_log("Decrypted: $decrypted");
// convert the decrypted string to a JSON object...
$order = json_decode($decrypted);
// Ready to rock and roll - If the decoding of the JSON string wasn't successful,
//
Thanks
Too lazy to write something clever here, so check out my marketing blog and learn from a REAL Super Affiliate at JeffLenney.com
Sid Hale
Coming Soon... Rapid Action Profits (Pro)
Sid Hale
Coming Soon... Rapid Action Profits (Pro)
Sid Hale
Coming Soon... Rapid Action Profits (Pro)
Sid Hale
Coming Soon... Rapid Action Profits (Pro)