close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

PayPal IPN Saving and displaying

Thread began 11/20/2009 11:48 pm by Jaffa | Last modified 11/25/2009 10:30 am by Jaffa | 1013 views | 4 replies |

Jaffa

PayPal IPN Saving and displaying

** Please Urgent **
I have managed to setup the PayPal sandbox test and have the IPN setting sent to my paypal_ipn.php page. When the payment is completed and the person is sent to the checkout_success.php page I need the orders database to update with the values from the IPN.

My question is how do I display the IPN information that has been sent on the success page. Once i have the values I know how to lookup and update the database.

I know the IPN is working because i get valid post backs to the Paypal admin account.

Thank you in advanced

Sign in to reply to this post

Eric Mittman

This is a limitation and one of the problems if using IPN. Since the IPN post back occurs sometime after the order is processed and the response is sent back to your IPN page it is not possible to display the status of the transaction at the time. You will only now the status of the transaction when it is posted to your IPN page.

What I normally suggest for IPN checkouts is that you update the db on the IPN page and also send an email to your user that let's them know if their transaction was successful like a receipt. The user could then come back to the site and login to see the details of their order or download goods or whatever else you would like to do.

The limitation is just the timing of this, you cannot ensure that the status of the transaction until after the IPN posts, and this will not happen before you redirect the user to the checkout success page.

Sign in to reply to this post

Jaffa

Hi Eric,

That makes sense, But how do i update the order based on the IPN values. I have them in my IPN page like so

$item_name = $_POST['item_name'];
$item_number = $_POST['item_number'];
$payment_status = $_POST['payment_status'];
$payment_amount = $_POST['mc_gross'];
$payment_currency = $_POST['mc_currency'];
$txn_id = $_POST['txn_id'];
$receiver_email = $_POST['receiver_email'];
$payer_email = $_POST['payer_email'];
$payment_status=$_POST['payment_status'];
$last_name=$_POST['last_name'];

But how do i use say the $payment_status = $_POST['payment_status']; value to update my status value in my database, I'm not sure on the php code to update the table without a form submission.

Sorry i'm not much of a coder.

Sign in to reply to this post

Eric Mittman

I think that you would benefit from the IPN simulator that PayPal has available from their developer center.

The IPN is a form post, so you can trigger the server behaviors on the posted values that are sent via IPN. The first thing to do is to verify the post as authentic, then you can use the posted values to trigger server behaviors on this page. For the order information there should be an order id or reference id that PayPal passes back. If you need to you can use the invoice variable when sending the transaction to PayPal, this should pass through and be posted to your IPN page just as you sent it to PayPal. There is also a custom field that you can use to pass through info.

You should login to the PayPal developer center and check out some of the documentation and other resources that are available, they will do a much better job of explaining the process and how it all works together.

Sign in to reply to this post

Jaffa

Thanks for pointing me in the right direction, I have now setup a PayPal IPN page that checks that the order is valid, looks for duplicates then updates my order table with the status of the order. I then post the Tax Invoice out on form load from the checkout success page.

Fantastic!

Thank you Eric!

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...