delickate Posted March 17, 2012 Share Posted March 17, 2012 Hi, I'm integrated paypal standard integration on my website. It integrated successfully.. we collect the data on website and send all info to paypal. in database order table. I set the status to 0 which means order is pending. Now i'm confused how it'll be 1? when i'll come to know that client has paid the payment. do i need to set it flag manual in admin panel after check into my paypal account? or do i need to send some parameter on return valraible. if he i'll return to that page then query to set flag 1. Please help me on this. and let me know which one is best method??? Looking forward. Best regards Quote Link to comment https://forums.phpfreaks.com/topic/259101-help-required-paypal-integration/ Share on other sites More sharing options...
darkfreaks Posted March 17, 2012 Share Posted March 17, 2012 can we see your code please so we can further assist but i think you could so something like this select * from paypal WHERE status='$status' while($row=mysql_fetch_array($sql)) { // if row status equals one it ihas been paid if it does not it has not been paid echo ($row['status']==1) ? 'This has been paid' : 'this has not yet been paid for'; } } Quote Link to comment https://forums.phpfreaks.com/topic/259101-help-required-paypal-integration/#findComment-1328319 Share on other sites More sharing options...
delickate Posted March 17, 2012 Author Share Posted March 17, 2012 Hi, Thanks for the reply. My HTML Code is as Follow: <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_cart"> <input type="hidden" name="business" value="delickate@hotmail.com"> <input type="text" name="item_name" value="hat"> <input type="text" name="item_number" value="123"> <input type="text" name="amount" value="15.00"> <input type="text" name="first_name" value="sani"> <input type="text" name="last_name" value="hyne"> <input type="text" name="address1" value="9 Elm Street"> <input type="text" name="address2" value="Apt 5"> <input type="text" name="city" value="Berwyn"> <input type="text" name="state" value="PA"> <input type="text" name="zip" value="19312"> <input type="text" name="night_phone_a" value="610"> <input type="text" name="night_phone_b" value="555"> <input type="text" name="night_phone_c" value="1234"> <input type="text" name="email" value="esolbiztm@hotmail.com"> <input type="text" name="return" value="return.php?ordid=5"> <input type="image" name="submit" border="0" src="https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif" alt="PayPal - The safer, easier way to pay online"> </form> my php code is as follow: mysql_query("insert into tblOrder(feidls1, feidls1,feidls1,feidls1,feidls1, status) values ($feildvalues1, $feildvalues1, $feildvalues1, $feildvalues1, $feildvalues1, '0')"); my return .php page is if(isset(ordrid)) mysql_query("update tblename set status = '1' where ordid='".$_Request['ordrid']."'"); so please suggest... Thanks Quote Link to comment https://forums.phpfreaks.com/topic/259101-help-required-paypal-integration/#findComment-1328327 Share on other sites More sharing options...
darkfreaks Posted March 17, 2012 Share Posted March 17, 2012 if your looking to check your code you might intergrate a paypal IPN class. here is an example how to use it below....... require_once("PayPal.php"); class My_IPN_Handler extends PayPal { function status_completed(){ // Do whatever you need to do to finish // a transaction. } function check_email($email) { // Make sure $email is MY email. } // .. other methods as required .. } $paypal = new My_IPN_Handler(); // Your constructor // Call any other methods, set up databases, etc.. // Then call processIPN() to actually deal with PayPal's IPN. $errcd = $paypal->processIPN(); if($errcd){ // Error occured, Log the error, do anything else to cleanup. error_log($paypal->errstr($errcd)); }else{ //Everything went smoothly } here is the link to copy the file so you can copy and save it. http://www.geniegate.com/other/paypal/PayPal.phps Quote Link to comment https://forums.phpfreaks.com/topic/259101-help-required-paypal-integration/#findComment-1328338 Share on other sites More sharing options...
delickate Posted March 17, 2012 Author Share Posted March 17, 2012 Thanks for reply... thanks for providing me that code. actuall i just want to know that how status set to 1 when payment is paid... when i can run my query to set the flag 1. or i've to loging my pypal account first and check the payment. then i've to login my website admin and set the flag 1 manually? please guide and help... Thanks Quote Link to comment https://forums.phpfreaks.com/topic/259101-help-required-paypal-integration/#findComment-1328361 Share on other sites More sharing options...
delickate Posted March 17, 2012 Author Share Posted March 17, 2012 no one news how paypal works!!!!!!!!......... Quote Link to comment https://forums.phpfreaks.com/topic/259101-help-required-paypal-integration/#findComment-1328392 Share on other sites More sharing options...
jcbones Posted March 17, 2012 Share Posted March 17, 2012 Darkfreaks told you exactly how and when to do it. If you use the PayPal IPN, then paypal will automatically send a response to the file you designate. After you handle the IPN response (darkfreaks post), then include your database calls where "everything went smoothly". Quote Link to comment https://forums.phpfreaks.com/topic/259101-help-required-paypal-integration/#findComment-1328456 Share on other sites More sharing options...
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.