Regarding PayPal IPN listener page
Hi Ray,
I looked at the IPN details on the PayPal website and ended up with more questions than answers so instead found these two examples via Google search.
Obviously these are custom and will need to be edited for my DB needs and connection, etc. I get the main idea connecting to PayPal and confirming the connection with the back and forth in both versions. I know that one of these is very stripped down and the other includes some debugging and the ability to send a custom email response. I think I can figure out how to edit either one as needed.
My question is, do you see one as being better than the other code wise? I do have 'listener.php' uploaded and working now and I can send a payment live with no issues. So that I take it is a good thing.
However, I still have not added the ability to INSERT or UPDATE my DB.
If you read the comments in the 'listener.php' on LINES 66-72 he creates a record with the payment details with a "pending" status and then once the payment is verified, updates the record to "Paid"
Could you write an example code snippet using the attached table called 'dues' where the duesID could be the PayPal 'custom' parameter session id and maybe one or two of the other like duesAmtPaid and duesPaidDate?
I am sure I could figured it out after I had an example of the structure/format needed to post/update the the DB and where it goes in that page. I assume it will go in the space occupied by the comments between the {}.
And can you confirm this using the example below:
(the variables would be my table column names and they correspond to the PayPal variables - correct? and this is what I use to INSERT/UPDATE my DB?)
$lotNumber = $_POST['item_number'];
$duesStatus = $_POST['payment_status'];
$duesAmtPaid = $_POST['mc_gross'];
$duesID = $_POST['custom'];
I know I could probably figure it out on my own if I had the time and headspace to work on it but once again I have zero time. I will of course pay you for your time and appreciate as always your help and expertise!