Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/259101-help-required-paypal-integration/
Share on other sites

can we see your code please so we can further assist :confused:

 

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';
}

}

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

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

 

 

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

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".

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.