Solved

Incorporating Paypal IPN with Database Updates

Posted on 2013-11-01
4
340 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 11

Expert Comment

by:Andrew Angell
ID: 39617854
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
ID: 39617902
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
ID: 39617954
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
ID: 39620396
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

Database Solutions Engineer FAQs

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller single-server environments.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Read about how to choose the best possible content marketing agency to suit your needs. Content marketing has become an integral part of running a successful tech business, so it is wise to be informed.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

634 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