HTTP error
"); } else { fputs ($fp, $header . $req); // read the body data $res = ''; $headerdone = false; while (!feof($fp)) { $line = fgets ($fp, 1024); if (strcmp($line, "\r\n") == 0) { // read the header $headerdone = true; } else if ($headerdone) { // header has been read. now read the contents $res .= $line; } } $res = trim($res); // parse the data // echo ("res= " . $res . "
"); $lines = explode("\n", $res); $keyarray = array(); // echo ("Line1: " . $lines[1] . "
"); if (strcmp ($lines[0], "SUCCESS") == 0) { for ($i=1; $iYour transaction has been completed successfully and a receipt for your purchase and instructions how to register your license has been emailed to " . $payeremail .".
"); echo ("If you have not received this email (please also check the spam folder) or experience any system issues, please contact us at licensing@uplinx.com.
"); echo (""); echo (""); } elseif (strcmp ($payment_status, "Pending") == 0) { // Payment pending echo('Transaction succeeded but Paypal needs to verify the payment.
'); echo(''); echo ("
You should receive an update by email within 12 hours."); } else { // catch all other failures echo('
Transaction not successful.
'); echo(''); echo ("
Please contact us at licensing@uplinx.com including more details about the transaction."); $txt = "Transaction not successful."; // Write to log (must be inline) $fp=fopen($ipn_log_file,'a'); fwrite($fp, $ts . $txt . "\n\n"); fclose($fp); // close file mail($strError,"Transaction not successful.","Check Paypal",$headers); } } else if (strcmp ($lines[0], "FAIL") == 0) { // FAIL log for manual investigation echo('
Transaction failed.
'); echo(''); echo ("
Please contact us at licensing@uplinx.com including more details about the transaction."); } else { // catch all other failures echo('
Transaction not successful!
'); echo(''); echo ("
Please contact us at licensing@uplinx.com including more details about the transaction."); } } } else { // testmode true print('
==========test=========
'); // test mode $firstname = 'first'; $lastname= 'last'; $itemname= 'itemname'; $payeremail = 'payeremail@bla.com'; $payment_amount = '590'; echo('Thank you for your purchase!
'); echo ("Your transaction has been completed successfully and a receipt for your purchase and instructions how to register your license has been emailed to " . $payeremail .".
"); echo ("If you have not received this email or experience any system issues, please contact us at licensing@uplinx.com.
"); echo (""); echo (""); echo ("