TheSerpSlayer
Registered Member
- Sep 28, 2017
- 75
- 8
I am making a script from scratch that uses PHP and paypal buttons. The script is for a site that does IQ tests. So, the way it works is someone clicks a paypal button and makes a payment and then pp takes their name, address and email and validates their payment.
After payment, pp then redirects the buyer to mysite.com/thankyou.php(after they click the return to merchant link on PP) and then PP separately and simultaneously sends an http POST with lots of metadata gathered from the payment in the post parameters to a fixed url also, which could be mysite.com/success.php.
What I want to do is when they land on thankyou.php to redirect them to mysite.com/take-the-quiz.php?foo=bar where bar is a pseudorandom number to make the URL unique.
I ran an http sniffer on the site while clicking the button and making the payment and picked up stuff including in the header:
Content-Type: application/x-www-form-urlencoded
User-Agent: PayPal IPN ( https://www.paypal.com/ipn )
and in the body stuff like:
mc_gross=2.00&protection_eligibility=Eligible&address_status=confirmed&payer_id=92NT7TFMWKU76&address_street=1+Main+St&payment_date=22%3A33%3A38+Nov+21%2C+2017+PST&payment_status=Completed&charset=windows-1252&address_zip=95131&first_name=
which I assume is part of an http POST send by paypal?
My noob question is, how do I capture all the parameters of the http POST data that pp sends to mysite.com/success.php such as address_street= address_country= address_zip= and then send it to a mysql table?
After payment, pp then redirects the buyer to mysite.com/thankyou.php(after they click the return to merchant link on PP) and then PP separately and simultaneously sends an http POST with lots of metadata gathered from the payment in the post parameters to a fixed url also, which could be mysite.com/success.php.
What I want to do is when they land on thankyou.php to redirect them to mysite.com/take-the-quiz.php?foo=bar where bar is a pseudorandom number to make the URL unique.
I ran an http sniffer on the site while clicking the button and making the payment and picked up stuff including in the header:
Content-Type: application/x-www-form-urlencoded
User-Agent: PayPal IPN ( https://www.paypal.com/ipn )
and in the body stuff like:
mc_gross=2.00&protection_eligibility=Eligible&address_status=confirmed&payer_id=92NT7TFMWKU76&address_street=1+Main+St&payment_date=22%3A33%3A38+Nov+21%2C+2017+PST&payment_status=Completed&charset=windows-1252&address_zip=95131&first_name=
which I assume is part of an http POST send by paypal?
My noob question is, how do I capture all the parameters of the http POST data that pp sends to mysite.com/success.php such as address_street= address_country= address_zip= and then send it to a mysql table?