in

AlertPay Developers Community

IPN Not Working

Last post 01-20-2009 11:27 AM by AlertPay_Phoun. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 01-16-2009 11:44 AM

    IPN Not Working

    Subscription-Payment-Success|xxxxxxxxxxxxxxxxx|HOAP Club Membership|1|20.00|USD|S-49943-0A35F-5AFD9|||
    Success|xxxxxxxxxxxxxxxxx|HOAP Club Membership|1|20.00|USD|S-49943-0A35F-5AFD9|||
    |||||||||

    When I test a purchase I get access denied in my program, which is what I should get

    if the ap_status or the ap_securitycode don't match their $. However, when I print the IPN post
    to a file to see what I'm getting, it is returning two posts as you can see above. The xxx's are the security code
    and they are the same on both lines.
    Am I supposed to be getting both posts?
    Could that be a reason my script is not accepting the codes, and denying access?

    Here is the section that is checking the variables:

    $ap_SecurityCode = $q->param('ap_securitycode');
    $ap_Status = $q->param('ap_status');
    $ap_ItemName = $q->param('ap_itemname');
    $ap_Quantity = $q->param('ap_quantity');
    $ap_Amount = $q->param('ap_amount');
    $ap_Currency = $q->param('ap_currency');
    $ap_SubscriptionReferenceNumber = $q->param('ap_subscriptionreferencenumber');
    open (FILE, ">>$datapath/veppy.dat");
    flock(FILE, 1);
    print FILE "$ap_Status|";
    print FILE "$ap_SecurityCode|";
    print FILE "$ap_ItemName|";
    print FILE "$ap_Quantity|";
    print FILE "$ap_Amount|";
    print FILE "$ap_Currency|";
    print FILE "$ap_SubscriptionReferenceNumber|";
    print FILE "$time|";
    print FILE "$julian| ";
    flock(FILE, 8);
    close (FILE);
    if (($ap_Status eq "Success")&&($ap_SecurityCode eq "xxxxxxxxxxxxxxxxxxx")){
    $paidmembership = "1";
    $user_status = "Paid Membership";
    }


    elsif (($ap_Status ne "Success")&&($alowfree eq "1")){
    $paidmembership = "0";
    $amount = 0;
    $user_status = "Free Membership";
    }

    else {
        print $q->header;
        print("<br><br><h2><center>Access Denied</center></h2>");
        exit;

    }

     

     

  • 01-20-2009 11:27 AM In reply to

    Re: IPN Not Working

    In the case of a subscription, you will receive two IPN post for the first payment of a subscription. In the case of a recurring subscription, you will receive one IPN post.

    The "ap_status" that you will receive when a user first subscribes will have a value of "Success". Then you will also receive an "ap_status" with value "Subscription-Payment-Success".

    Here are few suggestions to avoid getting "Access Denied" in the flow of your IF statement.

    You should check for "ap_purchasetype" to be "Subscription", to make sure that the IPN data you are receiving is for a subscription and not for an item for example.

    You might want to handle the different "ap_status" that we are sending in case of a subscription
    ex: if (($ap_Status eq "Subscription-Payment-Success")

    Please refer to page 49 of our integration guide for the other possible statuses.

    Since your code only checks for "Success" then it will go to "Access Denied" because the status is actually "Subscription-Payment-Success".

    ***This is a Developers Forum, any other questions should be addressed to our Customer Support department or you can find the answers in our FAQ page.***
Page 1 of 1 (2 items)

  AlertPay - Verified by Visa AlertPay - secure credit card and checking services BBBOnline Reliability Program