SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Sep 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need help translating PHP to Classic ASP

    Hi everybody, I've got this code supplied to me my Clickbank (payment processor) that handles their Instant Payment Notification service. From what I can tell, it basically reads all the POST data, stores it into some arrays, then compiles it all into a big string. Anyways, some help converting this to classic ASP would be awesome! TIA!

    PHP Code:
    function ipnVerification() {
        
    $secretKey="TEST1";
        
    $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"];

    Other programming languages (java, C#, etc) available for reference here:
    http://www.clickbank.com/help/affili...ation-service/

    Thanks!

  2. #2
    SitePoint Addict
    Join Date
    Apr 2009
    Posts
    359
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    First you will have to find a sha1() function for asp, there isn't a built-in asp sha1() function.
    Doug G
    =====
    "If you ain't the lead dog, the view is always the same - Anon

  3. #3
    SitePoint Member
    Join Date
    Sep 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Doug G View Post
    First you will have to find a sha1() function for asp, there isn't a built-in asp sha1() function.
    Yeah I've got the sha1() function covered. I found a way to handle that in ASP. It's all the other junk that I can't figure out LOL


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •