Solved

Incorporating Paypal IPN with Database Updates

Posted on 2013-11-01
4
317 Views
Last Modified: 2016-03-24
I have membership processing that has been working for some time.
1. User enters information
2. Data is passed to a VBScript page which:
    a. logs member info to a text file
    b. updates an Access database
    c. emails member confirming receipt of information
    d. passes application fees to Paypal

It all works well, but there is often an issue with the payment not completing, so the client has requested that I incorporate IPN to verify that the payment completed. I have the listener working, but at that point have no idea if I've lost all reference to the original form data.

Is there a way to activate Paypal with IPN first and if the payment is successful then update the database and send the appropriate emails?
0
Comment
Question by:slegy
  • 2
  • 2
4 Comments
 
LVL 11

Expert Comment

by:Andrew Angell
Comment Utility
You could use IPN to do everything you're doing with database updates, etc.  IPN is nothing more than a POST of all the transaction data included in a transaction.  As such, you could set it up to grab all the data you need from the transaction and add it to your database, update your text file, send the email, etc. all within that one script.  

So no, you won't lose reference to the original form data.  It will be included in the IPN POST, unless you had some custom data that wasn't included in the actual PayPal button/standard checkout code.  If so, you'll need to throw that in the "custom" parameter so that it will be included in the IPN.

What I like to do when I have a lot of custom data I need access to is go ahead and save a record in my DB that includes everything I'll need (that PayPal won't be providing) and then pass the record ID in the invoice or custom parameter for PayPal.  That way, the IPN data will include that ID so I can easily update the record with the data PayPal returns, as well as pull out any data I needed that was previously saved.

Hope that makes sense.
0
 

Author Comment

by:slegy
Comment Utility
Thank you for your very thoughtful response. The problem is that there is a great deal of custom, non-Paypal data that should go into the database only if the payment was completed and verified (up to 200 variables). I just checked and the custom parameter is limited to 255 characters. I was looking into session variables. Is that a possibility? If not, I may have to use the approach you described in your last paragraph.
0
 
LVL 11

Accepted Solution

by:
Andrew Angell earned 500 total points
Comment Utility
Session variables won't work because the IPN will happen completley separate from your checkout.  It would be an entirely different session.  You're going to need to save it to your DB and then pull it back out like I mentioned.
0
 

Author Closing Comment

by:slegy
Comment Utility
Thank you so much for your help. You saved me a lot of time from going down the wrong path. I'm having a little trouble with the listener, but I will submit separate questions.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Often people are aiming at development of perfect Magento websites. Though, it is easier said than done. You know what’s much easier? To ruin everything. It can be done in seconds. Many of us experimented with design, tried to change some values dir…
SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now