Solved

Incorporating Paypal IPN with Database Updates

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Autosum input type=text when checkbox is true 28 85
two submit buttons one form 15 76
Need help editing script 3 67
Select2 jquery help 9 74
E-commerce is quite a gambling world, and you should never entrust your business to a lucky chance. In order to outrun your competitors in a race to attract as many customers as possible, you need to have a well thought-out strategy under your belt.…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
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.

863 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

23 Experts available now in Live!

Get 1:1 Help Now