Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Incorporating Paypal IPN with Database Updates

Posted on 2013-11-01
4
Medium Priority
?
347 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
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 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This article was initially published on Monitis Blog, you can read it here . When it comes to deciding which approach to website performance monitoring is best for your business, unfortunately, like so many options in life . . . it depends. In th…
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.

972 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