Solved

Incorporating Paypal IPN with Database Updates

Posted on 2013-11-01
4
336 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 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
age from date of birth 4 57
ebay messages api 6 17
Load data upon clicking a button 8 48
Prevent certain words from being typed in a form 6 28
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.
Learn about the eCommerce marketing trends for the year ahead.
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…

756 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