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;
}