Duke 1 Posted August 13, 2014 Report Share Posted August 13, 2014 RE: ipn.php script..is the code in the book or the download have errors...? I noticed at least one discrepency between on line 8 book has if($status === 200 && $response =='VERIFIED') download has if ($status === 200 && $response === 'SUCCESS') just having trouble getting this script to work so I cannot really post a question. just wondering if there are any known errors as I have not found any posted in the forums Thank you Quote Link to post Share on other sites
Duke 1 Posted August 13, 2014 Author Report Share Posted August 13, 2014 oK... I think my error is here...it all look sgood to me... ------------------------------------------ $ch = curl_init(); //configure curl curl_setopt_array($ch, array ( CURLOPT_URL => 'https//www.paypal.com/cgi-bin/webscr', CURLOPT_POST => true, CURLOPT_POSTFIELDS => http_build_query(array('cmd' => '_notify-validate') + $_POST), CURLOPT_RETURNTRANSFER => true, CURLOPT_HEADER => false ) ); //perform curl request $response = curl_exec($ch); //get status of curl response $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); //close curl curl_close($ch); ------------------------------------- Quote Link to post Share on other sites
Larry 433 Posted August 14, 2014 Report Share Posted August 14, 2014 I'm sorry, but I'm not clear: are you still having a problem/question here or no? Quote Link to post Share on other sites
Duke 1 Posted August 14, 2014 Author Report Share Posted August 14, 2014 Yes Sorry Larry..Yes still having problem... ...I did notice in the book for the below line in the ipn.php script ... txn_type uses 'web_accept' if(($_SERVER['REQUEST_METHOD'] === 'POST') && isset($_POST['txn_id']) && ($_POST['txn_type'] === 'web_accept')) When I log into paypal and go Instant Payment Notification details (below is how to get there) Profile->My Selling tools->ipn->click-update->IPN History page->Message ID-Click I am getting back two messages. one____IPN typeTransaction made.......USES....txn_type=subscr_paymenttwo----IPN typeRecurring payment profile....USES.....txn_type=subscr_signup I tried using each still not working I also checked for all the values in the IPN Message and they are all there including the custom value(user_id) HTTP response code = 200 I was was basically just wondering if the code in my last post looked correct. Or if there are any known issues in the book or download as I have not been able to find any in the forums... Thank you for any help you can add. Quote Link to post Share on other sites
Larry 433 Posted August 17, 2014 Report Share Posted August 17, 2014 It looks okay. It'd probably help to know what the specific problem is. Is your script complaining about invalid values? If so, I'd write all the received values to a log and compare those to your conditional to see which one is the problem. Quote Link to post Share on other sites
Duke 1 Posted October 14, 2014 Author Report Share Posted October 14, 2014 I made changes in my ipn.php script ....It seems to be working now My changes:Page170 step 2Book uses : if (($_SERVER['REQUEST_METHOD'] === 'POST') && isset($_POST['txn_id']) && ($_POST['txn_type'] === 'web_accept') )I used:if (($_SERVER['REQUEST_METHOD'] === 'POST') && isset($_POST['txn_id']) && ($_POST['txn_type'] === 'subscr_payment') )Page172 step 8Book uses:if ($status === 200 && $response === 'SUCCESS')I used:if ($status === 200 && $response === 'VERIFIED')Page172 step 9Book uses:&& ($_POST['mc_gross'] === 10.00) I used:&& ($_POST['mc_gross'] === '10.00') (10.00 is in single quotes) For the above the below line may also work as I had to use either quotes or double == for a line in my login.inc.php script in chp 6 && ($_POST['mc_gross'] ==10.00) (10.00 is in single quotes) Just wanted to share this in the event it helps others....I am not sure why they work ...but they do work for me....I am using PHP5.5 Thank youi Quote Link to post Share on other sites
Larry 433 Posted October 15, 2014 Report Share Posted October 15, 2014 Kudos and thanks! Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.