PDA

View Full Version : Donations / Paypal IPN Integration


Cloudrunner
06-02-2003, 11:43 AM
Well, after searching and searching for a donation system that works, I've come to the realization that although there are a few good contribution / donation hacks out there, none of them are compatible with Paypal's IPN feature. That being the case I went experimenting, and got the IPN to work properly with VB.

So now I'm dealing with options and features that you all want to see in this type of hack. I am willing to put forth the effort to get this hack to be the best one there is on the market for this. After I get all the coding and stuff done with paypal and the "look & feel" of the hack for the rest of your VB site, I'll work on integrating it with Authorize.net as well. But for now, since the IPN is working, I need your input on what you would like to see included with this hack.

So far, I'm looking at a notification on the memberlist, one in the postbit for members of the top ten donators club, possible rewards for certain levels of donations, the option to show total amount collected, and exactly where the $$$ is going to (this is needed for me personally since my site is not-for-profit, so may be helpful to you as well), with the main donations page showing all the above with an information page for explanations of where the $$$ goes, etc.

The IPN backend is running via Paypal's recommended procedures and should any suspicious activities be seen by either the script or Paypal's server, the script will not add the information into the main database, but into a separate table for further investigation by the admin.

One thing that I am missing that I need help on is verifying Paypal's Verisign Digital Signature, When it comes to that, I'm dumber than Jim Carrey on LSD. If I could get help on that one, we will all be appreciative as this will increase the security of the system.

Please, let me know your ideas for this hack, and I will get them on my "ToDo" list. Please be understanding and patient though, as I am about to have a second child born into the world within the next few weeks, so may drop off working on this one for abit, but I will continue to code for it during my free time.

Until then, Enjoy!

)O( Cloudrunner )O(

Cloudrunner
06-03-2003, 03:24 AM
Update:

Okay, working on the main page for this little integration a bit at a time.

I've attached a small initial screen for the page to give a basic idea of where I'm going with this.

Today I finished the dynamic donation buttons, so you can make an unlimited number of different donation level buttons. Later I'll be adding "prizes" per donation level button chosen. There is also a button there to allow your users to choose the amount they wish to contribute to you.

I'll start working on the member's integration portion of this over the next week or so (provided that my wife does not give birth during this time, if that occurs, of course, then it'll be abit longer).

I'm still looking for assistance in the verisign digital check portion of this whole thing. If you have the time and know how this would work, please contact me.

Enjoy!

)O( Cloudrunner )O(

Cloudrunner
06-03-2003, 03:27 AM
Button Clicked with a set amount:

Cloudrunner
06-03-2003, 03:28 AM
Button clicked without a set amount:

kaotic
06-03-2003, 05:16 AM
I might just start drooling over my keyboard if I don't install this soon! :D Lookin' good! :cool:

noppid
06-03-2003, 04:32 PM
Maybe this can help...
http://www.perl-studio.com/php/paypal/

kaotic
06-03-2003, 04:38 PM
That one looks a bit more complicated than what I would've hoped for. I'll wait for Cloudrunner's version before I try that one.

noppid
06-03-2003, 04:55 PM
That was a suggestion for him to see example code on the digital signature, not a suggestion for an alternative. :)

Cloudrunner
06-03-2003, 04:56 PM
Not only that, but the information there is misleading, as one doesn't really need to use an ssl socket to connect to paypal, as there is no financial information (i.e. credit cards, bank accounts, etc) being passed during the IPN exchange. Therefore, since vBulletin uses PHP, using a perl script to integrate would be alot more code involved to get perl to talk to the vb php backend properly.

That, and that script doesn't help me in the versign signature authentication, and that's the #1 thing I'm worried about right now, because I can "spoof" the script with a proxied form using the right variables (i.e. it will accept the variables and such, but when talking to paypal for verification of the data, paypal will always send an INVALID string since it did not initiate the call.) With the verification of paypal's verisign sig, I wouldn't be able to do that.

Thanks for the help though ;)

)O( Cloudrunner )O(

Cloudrunner
06-03-2003, 05:16 PM
ah crap!

I just realized that to verify paypal's digital server ID, one MUST be using SSL transport. CRAP!

PHP will not transport via SSL, well let's find another way to verify proper server access....is there a better way than using $_SERVER['HTTP_REFERER']?

Cloudrunner
06-03-2003, 06:02 PM
UPDATE:

I finished the Total Funds Contributed portion of the main page.

It takes all of your total funds contributed and separates them into funds contributed in the last 30 days, 6 months, Year To Date, and total amount since the start. This is dynamically updated whenever you receive an IPN with the payment_status of: "Completed", and a verification status of: "VERIFIED".

Attached is another screener.

Cloudrunner
06-03-2003, 07:37 PM
UPDATE:

I've finished the code and layout for the "where did we spend the money" section of the site. (this is not yet an option as I haven't even started on the admin portion of this hack).

I've decided to use another of my installed styles to show how it loads into different styles on different boards. Basically the only replacement this hack uses is #13486D. You can adjust that as needed by you when you install it once it's released.

This section will need to be manually updated whenever you spend the money from this account. Just FYI.

Enjoy!

)O( Cloudrunner )O(

Cloudrunner
06-03-2003, 10:02 PM
UPDATE:

Finished the Top Ten Listing of contributors.

If the contributor has an avatar on file with your board, then it will display in the listing. If not, then it simply contains their username, date of last donation, and the total amount they've donated.

Enjoy!

)O( Cloudrunner )O(

Cloudrunner
06-03-2003, 10:04 PM
UPDATE:

Reused some code to get the listing for ALL of the contributors to show up. There is no avatar display for this part of the page.

I find myself wondering if this should even be a part of the script. I don't really wanna worry about having to split the page if the board gets alot of donations, ya know? Sides, it's kind of redundant as the top ten is already listed.

Oh well...lemme know what you think I should do.

Enjoy!

)O( Cloudrunner )O(

ap0c
06-03-2003, 11:38 PM
looks awesome so far!
Top 10 would seem good enough.

shri
06-03-2003, 11:49 PM
FYI.

fopen will work with https in 4.3.0 and above, IF compiled with OPENSSL.

Going to try it out in a few minutes.

Shri

Cloudrunner
06-03-2003, 11:58 PM
Thanks for the info, unfortunately, my server / host is running 4.1.3 with very little chance of upgrade in the near future. They're kinda adamant about that point.

Thus, my ability to integrate SSL into this hack is nill. Once I release the hack into beta, I'll be open to any code adjustments necessary for it to talk via SSL to verify paypal's verisign sig.

)O( Cloudrunner )O(

shri
06-04-2003, 01:00 AM
Ok. I'm installing php 4.3.2 with SSL as we speak. Let me know if you need me to test / help you code anything.

:)

Skyline_GT
06-04-2003, 01:48 AM
Wow Great!!
maybe make someone like that board.
Like in the index some where put currently we have an amount of money. and we need an amount money.

Cloudrunner
06-04-2003, 01:59 AM
// ****** ToDo List ******
// 1) Update memberlist and postbit of user when donation is 'Completed'
// 2) Modify Memberlist to show contribution statuses
// 3) Modify postbit to show contributions statuses
// 4) Modify index to show current money saved vs. needed
// 5) Do the adminCP side of the hack
// 6) Write installation text and pages for database etc
// 7) Add postbit awards for certain donation levels
// 8) Figure out how to integrate SSL verification of Paypal's Server ID sig

Anything else to add while I'm at it?

shri
06-04-2003, 02:45 AM
I'm willing to work on part 8 for ya. Just got everything installed.

Now going to install curl and see what would be the best mechanism to get this done.

Shri

trafix
06-04-2003, 05:15 AM
8 is easy, lol .... it took me a week to work that out for the trader

Erwin
06-04-2003, 05:21 AM
Add points to the member according to how much they donated. :)

Cloudrunner
06-04-2003, 11:02 AM
via Lesane's Store? I can work that in, but for other points systems, I don't use them, so it would have to be an addon from someone who has one of those installed.

Erwin
06-04-2003, 11:28 PM
You can do it for Lesane, and I will convert it for my custom poinst system. :)

Cloudrunner
06-04-2003, 11:34 PM
no problem, will drop that in the "ToDo".

Gonna work on the memberlist and postbit now though...I've a few minnows avalable tonight surprisingly...The wife has crashed....thank the gods!

Cloudrunner
06-05-2003, 01:03 AM
UPDATE:

Finished integration into the memberlist. Will update toys and graphics later. This requires a small addition to the user table. One TINYINT(1) field that is merely a 1 if donated or a 0 if not donated.

Cloudrunner
06-05-2003, 01:49 AM
Okay, one question...

Where's the best place to add a bit of code for it to show up in the postbit?

I tried this code in the showthreads.php, but that didn't work.

($donated is the variable called by the postbit template)

edit: Nevermind...Found it!

Cloudrunner
06-05-2003, 02:22 AM
UPDATE:

Finished the postbit. Again, I'll be working on toys and ++++ later.

On that note, anyone care to design me up three postbit graphics simply to show three levels of appreciation for donations? I'll let you have free artistic creativity on them, and you'll have full credit for them in the release. They will be used on the postbit and the memberlist.

Thanks, and for the screen:

Cloudrunner
06-05-2003, 02:22 AM
here ya go

Cloudrunner
06-05-2003, 02:48 AM
Updated "ToDo":

// ****** ToDo List ******
// 1) Modify index to show current money saved vs. needed
// 2) Do the adminCP side of the hack
// 3) Integrate Lesane's point system as an option
// 4) Write installation text and pages for database etc
// 5) Add postbit awards for certain donation levels
// 6) Figure out how to integrate SSL verification of Paypal's Server ID sig
// 7) **add more ++++ here**
// 8) **add more ++++ here**
// 9) **add more ++++ here**
// 10) **add more ++++ here**

Cloudrunner
06-05-2003, 03:47 AM
UPDATE:

Getting ever so closer to release guys (unless of course ya'll come up with some more stuff to add, LOL)!

Anyways, finished the requested feature for adding totals and stuff to the index page. This adds two queries to your index.

Anyways...To the BatScreen Robin!

Cloudrunner
06-05-2003, 03:50 AM
So are we agreed that the top ten contributors is good enough on the main donations page? I REALLY don't wanna code for multiple pages for contributors....I REALLY REALLY REALLY don't wanna...

Cloudrunner
06-05-2003, 03:58 AM
yack!!! Just realized my math is all screwed up....

oh well...that's what happens when you're losing your mind!

It's fixed in the code, just not the screener.

Koutaru
06-05-2003, 05:16 AM
:) It's looking nice Cloudrunner, I think having this hack on my site will help out a lot, especially emphasizing donations and recognizing members who have donated

Skyline_GT
06-05-2003, 05:46 AM
Great this hack will be good and useful
well at least for me:D

kaotic
06-05-2003, 01:02 PM
Today at 05:50 AM Cloudrunner said this in Post #33 (https://vborg.vbsupport.ru/showthread.php?postid=404624#post404624)
So are we agreed that the top ten contributors is good enough on the main donations page? I REALLY don't wanna code for multiple pages for contributors....I REALLY REALLY REALLY don't wanna...

A top ten list will suffice. :)

Cloudrunner
06-06-2003, 03:34 AM
I'm currently working on the AdminCP of this hack...It's taking abit longer for this portion of the hack than I had hoped for it too, cus I keep coming up with new things for the admins to be able to do with the hack ;)

Anyways, I'll keep you updated as usual.

)O( Cloudrunner )O(

Andrus
06-06-2003, 07:12 PM
Awe Man, this is going to be great! Can't wait! Thanks Cloudrunner. :)

Cloudrunner
06-06-2003, 11:35 PM
UPDATE:

Almost done with the AdminCP, once I finish it the hack goes to version 0.7, and I'll go through some coding issues and tweaks to the system. When I finish that, the code goes to 0.8, where a select group of hackers gets a copy of the hack prior to release for "Alpha" testing. This will go on for approx. 1 week. Then I will release 0.9 "beta" to the public. I will be supporting this little gem for awhile, but remember please that my wife is due Friday, so I will be falling off the face of the planet soon, for a few days anyway.

Anyways, some more screeners for you.

Cloudrunner
06-06-2003, 11:35 PM
Viewing Contributors

Cloudrunner
06-06-2003, 11:36 PM
Editing Custom Buttons

Cloudrunner
06-06-2003, 11:36 PM
Making custom buttons

Cloudrunner
06-06-2003, 11:36 PM
(this is not completed yet)

Editing the options.

Cloudrunner
06-07-2003, 03:52 AM
UPDATE:

I'm friggin tired....so I'm going to bed....

Let me know if there's anything I missed that you know of that's not in the todo up top there.

I've removed the code for the contributors on the main donations page...for obvious reasons.

And I'm not gonna start the awards addition until I figure out how I'm gona implement it.

For now, I just gotta tweak and write the installation scripts and such, but it's close to alpha.

Thanks to everyone who has support me in this one.

Dean C
06-07-2003, 11:38 AM
Well i must say this look really good. I have a similar hack working but it is far more simple. And doesn't rely on paypal's IPN system simply because it is too open to fraud :)

- miSt

Cloudrunner
06-07-2003, 01:04 PM
1) Care to elaborate on how the IPN is open to fraud?

The reason I ask is this, The verification system is hardcoded (i.e. you cannot send it dynamic data to try to *spoof* my script into thinking that you are paypal's IPN server) to send the information only to one server, Papal's IPN verfier, if that server did not send the information, it returns an INVALID response, if my hack receives ANY INVALID response, or if it receives any suspicious information, the information is dumped into a seperate table for questionable transactions.

So the long and short of the matter is that the information HAS to come from Paypal's server, or it won't be added to the contributions.

2) This is the second post where someone has basically said, they've a better system....however, I did search the the site here, and found nothing that comes close to what has been requested, and what I need specifically for my site.

While I appreciate the fact that the users should have a choice of what hacks they can use, etc, and if there is a better hack somewhere, they should know about it...What I don't appreciate is when someone posts they've a better hack than the one I'm trying to build within this thread. If you've a better hack, kewl, post that with a link to where we can find it so we can make the choice.

3) While currently the hack relies on Paypal's IPN, it is in no way the only system that will be used once this goes into full release. I have plans in the works for you to be able to use any number of payment gateways that use and instant notification system. But that goes into the code later on. I simply want to get the system working first off. The other gateways will be added as simple code upgrades that will require nothing more to upgrade than simply uploading a new file.

Thanks.

Sorry if I sound irritated, but I am slightly...I hope you can understand.

Love and light to you all

)O( Cloudrunner )O(

Cloudrunner
06-07-2003, 08:30 PM
WE'RE HAVING THE BABY!!!

No really, My wife is in the hospital now, unfortunately, she's not yet far enough into labor to pop....but she's in active labor right now.

YAY!!!

Will post pics later.

Dean C
06-08-2003, 09:00 AM
I wish you all the best but it was someone who told me about the IPN system being open to fraud... I myself haven't had time to fully investigate into it as last time i took a look at using it i almost died from the complicatedness of it ;)

- miSt

Cloudrunner
06-09-2003, 03:31 AM
Actually, it's not complicated at all, IPN sends a notification, your server sends the info back to the server, if everything checks out, paypal sends a "VERIFIED" response, and you know it's a good payment.

Anyways, Pre-Alpha is finished. Gonna do some tweaks, then the invites for testers for alpha.

Cloudrunner
06-09-2003, 03:43 AM
Alpha Stage is reached...lol...

It's running on my server, and running well....

// ****** ToDo List ******
// 1) Finish Install.txt
// 2) Integrate Lesane's point system as an option
// 3) Add postbit awards for certain donation levels
// 4) Figure out how to integrate SSL verification of Paypal's Server ID sig
// 5) Finish the Successful transaction return page
// 6) Finish the Canceled transaction return page

Cloudrunner
06-09-2003, 07:15 AM
Invites have been sent. Will update again when release goes beta.

Cloudrunner
06-09-2003, 07:36 PM
yep! Check the lounge.

Cloudrunner
06-09-2003, 07:37 PM
Today at 01:36 PM Cloudrunner said this in Post #53 (https://vborg.vbsupport.ru/showthread.php?postid=406813#post406813)
yep! Check the lounge.

Skyline_GT
06-09-2003, 09:30 PM
I have replied your pm.

ap0c
06-09-2003, 10:29 PM
kind of going off topic for a second,did your wife have the baby?

Dean C
06-10-2003, 02:36 PM
Yep check the lounge ;) ^^

ap0c
06-10-2003, 10:31 PM
found it, kind of odd how the posts got out of order

Cloudrunner
06-11-2003, 09:55 AM
yeah, it was strange, every time I posted it showed up directly below the last post I did instead of at the end of the thread....oh well....

gmarik
06-11-2003, 10:04 AM
Is there any code to test, download?

Theutus
06-11-2003, 10:29 AM
Yes i am very interrested in running this hack also!! :)

Cloudrunner
06-11-2003, 10:46 AM
When I finish that, the code goes to 0.9, where a select group of hackers gets a copy of the hack prior to release for "Alpha" testing. This will go on for approx. 1 week. Then I will release 1.0 "beta" to the public.

The invites have been sent, and alpha is in full swing. I figure a week or two and Beta will be released to the public.

Sorry to keep ya'll waiting like this, but I really don't wanna release a buggy hack ya know?

)O( Cloudrunner )O(

gmarik
06-11-2003, 03:07 PM
Oh, ok. Just keep in touch!

Crazy Pete
06-12-2003, 02:36 AM
This looks awesome!! I can't wait to try it out, thanks so much for taking this thing on, Cloudrunner, and congratulations on the baby! :)

Cloudrunner
06-12-2003, 04:05 AM
Thank you! I hope to release the hack within the next week or so. With VB3's beta release, I'll be looking into recoding it for that as well. So I'll be releasing two hacks, one for vb2 and one for vb3.

The vb3 release I hope to have coded to coincide with the full release of vb3, and not the beta. We'll see though.

vB-Host.com
06-12-2003, 10:19 AM
I would like to alpha test this :)

Cloudrunner
06-13-2003, 12:26 AM
Well, after a few days of testing, we've already ID'd a few small bugs, they have been fixed. I am still waiting on a few folks to beat the hell out of this script, but right now we're sitting at 0.8.2-Alpha.

If you have posted to this thread, previous to the alpha stage, then you should have an invite in your PMs. Check them for information on grabbing the code for testing.

Enjoy!
)O( Cloudrunner )O(

Cloudrunner
06-14-2003, 09:58 PM
Up to 0.8.4-Alpha...still waiting on a few suggestions and bugs (if any are left).

I'd like to thank ap0c for kick me in the butt over the last day or two with bugs found!

Theutus
06-14-2003, 10:14 PM
Any update on the release date? Should it be within the next week? I can't wait to get this one up and running! :)

Cloudrunner
06-15-2003, 01:05 AM
Just an FYI:

With the release of VB3, I will NOT be doing any changeover of this hack to vb3 UNTIL it reaches RC stage. It is just too buggy to be a reliable test platform for me as of yet. Don't expecting anything from this hack for VB3 until probably AFTER vb3 goes gold.

Erwin
06-15-2003, 04:24 AM
Doesn't vB3 have it's own IPN connection to Paypal inbuilt?

Cloudrunner
06-15-2003, 04:47 AM
yes, but it is for subscription based transactions only as far as I can tell. Correct me if I'm wrong of course...but after going through the code, I don't think it will do what I'm trying to do, which is recognizing contributors and also requesting donations. I'll probably be using bits and pieces of the paypal code already built into vb3 so I don't have to take as much time to do this hack for it, but for the most part this is a setup for donations and recognizing those donators to your site.

Theutus
06-15-2003, 07:29 PM
Still can't wait.

Cloudrunner
06-15-2003, 09:21 PM
Check yer PM's there Theutus...

Cloudrunner
06-15-2003, 10:09 PM
I'll be waiting until Tuesday (21 June 2003) for any more Alpha suggestions and bugs. On Tuesday if there are no major fixes needed, Paypal Donations will go public Beta.

Thank you to everyone who has helped me with this hack. I could not have gotten this far without the inspiration and help from you all.

Cloudrunner
06-17-2003, 06:37 AM
Paypal Donations has gone BETA!

https://vborg.vbsupport.ru/showthread.php?s=&threadid=54436

Thank you to all of you who have supported me in this and provided feedback for me!

Cloudrunner
06-17-2003, 06:43 AM
Mods, you can close this thread now...Thank you for the use of it ;)