Donations? Now that LM_PayPal and MoneyScripts can't co-exist peacefully...

7 replies [Last post]
vector84
Offline
Joined: 04/01/2010
Status: 
Answered

So I noticed that LM_PayPal and MoneyScripts can't co-exist peacefully now that MS overrides '/lm_paypal/ipn'...

I realize that I could just cut a few lines out of ms_paypal_wps.module to prevent this from happening, but considering only the latest dev snapshots of LM_PayPal are even functional at this point

(and quite buggy... at the moment, I cannot, for the life of me, get LM_PayPal working again after uninstalling it, even though I had it peacefully co-existing with MS before uninstalling it for more testing...)

To that end, I think a good feature recommendation would be a new order type Donation

I'd imagine with the considerable amount of documentation in MS 6.0 that writing this module shouldn't be all that difficult, and I'll probably take a stab at creating something workable when I can, but I figured I'd throw it out there too.

Leighton Whiting
Offline
Joined: 06/02/2009
Vector, I could add a

Vector,
I could add a donation module, and it should be fairly easy to write. What would the feature set need to include?

Sincerely,
Leighton Whiting

bkbetts
Offline
Joined: 03/29/2010
Donation module

I started another thread about this a while ago. I decided yesterday that I should write the module myself.

Based on Leighton's recommendations, I copied the ms_coupons directory into the main modules directory, so when the MembershipSuite gets updated, my changes won't get wiped out. I then started by simply replacing all of the coupon references to donation. I removed and added fields as I needed. My donations need just an ID, a code, status (true/false), and the donation fund name (text field) for display. However, my orders also get a donor name (text field) and the donation amount.

Unfortunately, I wrote the code to use the ms_core adjustments functionality, but found I needed to add a separate product, not modify an existing one. I don't want to modify the membership's price based on the donation amount. I then found the ms_core way to add a product to the cart. Now I just need to figure out how to make the membership and the donation appear as two items on the PayPal invoice. I think people may want that distinction for tax purposes. The order shows up packaged together, as one line item, which is fine for one item, but when you start adjusting the amounts, and adding donation items, one order item on the invoice is probably not explicit enough for the user to reference.

I can forward what work I have to Leighton and he can figure out if he can use anything, even though he can probably start from scratch and make something cleaner, in less time. Also, I don't use it for recurring memberships, it won't work with them as I have written it. I read somewhere in the PayPal API that you can somehow package non-recurring with recurring items, but I don't have time to look into it. I don't need it right now anyway.

I have to launch a site in about a week and a half, so I had to get this started myself.

vector84
Offline
Joined: 04/01/2010
So, my personal required

So, my personal required features are pretty basic:

I just need a new order type that takes one-time donations, with user entered amount, ideally using PayPal cmd '_donation' instead of '_xclick' for slightly more appropriate PayPal theming, and tracking some sort of order history, preferably with donation history on the user account page.

However, I think a more complete feature request for a proper Donations module might go something like this:

Donation Plans are probably necessary if we want to be able to add a donation item to a Membership Plan purchase form, since we can't package recurring and non-recurring items together, which is why I tossed that in there...
I don't really particularly need that feature, though including recurring donations just seems more complete... and I think the only way that gracefully happens is with them being managed by Donation Plans, just like Memberships?

* Defines a new order type Donation managed by Donation Plans.
* Donation Plans may be one-time or recurring.
* Option to add Donation Plan item to Membership Plan purchase page. (bkbetts?)
* Option to add Donation Plan item to User Account page (like Purchase Membership)
* Option to display Donation History / Recurring Donations on User Account page
* Donation Plans allow pricing options: user defined, admin defined select list
* One-time Donations not packaged with another order item use PayPal cmd '_donation'

Donation Plans allowing a third pricing option - select list + other selector for user input - would be cool but depends on your opinion of JS

The option to add a block level element to display a widget for a 'Buy Now' sort of thing for a Donation Plan would also be neat, but could be done with PHP in a block too, so I'll tack that on as an extra thought too

Also, bkbetts: would this proposed feature set cover what you're looking for?
I think I understood what you wanted... but if I missed the mark, please let me know.

bkbetts
Offline
Joined: 03/29/2010
I think you've covered it

I think you've covered it all. I have specific requirements to make sure the donation includes a freeform area for the person to write in a donor name, in case they want it to be credited to a certain person, organization, or "anonymous".

At the moment, I'm using an ubercart donation plugin to handle donations in a dedicated area of the site. I was planning on doing some sort of "bridge" module to copy any payment data to the MS order table, posing as a regular order, as if it had been done through moneyscripts. Then I'd be able to view all payment info, whether it be from ubercart donations or membership suite orders in one area. Then, I'm using MS to prompt the user for donations at user signup.

In other words, I have:
1) Donate as a menu / tab for the user, going to a page that lists a few different funds that can be donated to. The user chooses which fund to donate to and then pays via the ubercart donation module and paypal. lm_paypal would've covered this part, but I never actually tried it out. I don't think it's compatible anymore with MS, but I could be wrong. The stipulation here is that a non-member could donate in this area. This area doesn't have anything to do with adding a membership.

2) Donations on user signup, with the membership suite handling the membership management, including the donation module for MS that I made today.

I'm now wondering if I don't need the ubercart stuff for item #1 above, as I already sort of define donation plans from the donation module I made for MS MembershipSuite. I'd just need to figure out how to go from a donation button or link to invoke creating a new MS order and adding the donation to that.

At the moment, the user sees a form that contains:
- Select donation - HTML select field, behind the scenes, this is made up from the donation display name and then an associated donation code
- Donor name - HTML text field, to write who is making the donation
- Value - HTML text field, for numeric amount to donate (e.g., 50.00)
- Submit - button to add the donation to order/cart

vector84
Offline
Joined: 04/01/2010
I suppose a few more features

I suppose a few more features for completion then:

Option to allow Anonymous donations from logged in users (checkbox?)
Option to allow Anonymous users to enter a name / organization to credit
Option to allow Anonymous users to enter a username to credit ?

And that should cover everything?

bkbetts
Offline
Joined: 03/29/2010
Yes. All I'm doing now for

Yes. All I'm doing now for anonymous is to provide a text field for the donor name. They can write in anonymous or the organization name or whoever they wish to credit the donation to. Keeps things simple!

bkbetts
Offline
Joined: 03/29/2010
I've restarted work on the

I've restarted work on the module for donations that I need for my project. It's based off of the ms_coupons code, as mentioned previously in this thread. I had an issue with getting the PayPal invoice to show individual items. I need the membership to show up as its own item on the PayPal invoice page and then the donation as a second item. I thought I may have been using the ms_core calls incorrectly, but after reading this PayPal link:

https://www.paypal.com/cgi-bin/webscr?cmd=p/pdn/howto_checkout-outside#m...

I think the PayPal gateway would roughly need to be changed as follows, for "one-time" carts with more than one item:
- Set cmd variable to "_cart".
- Add another hidden input field named "upload" with value "1".
- Each item in the cart would have a class variable with _suffix where suffix is a number of the item, such as 1, 2, etc. For example, instead of just "item_name" as a variable, as in the past, the variable would be "item_name_1" for the first item, "item_name_2" for the second, and so on. Other variables such as amount would be changed in a similar manner.

Twitter Feed