Intro
I am in the process of creating a subscription module for enabling drupal sites to set up paid subscriptions and then the user's can subscribe and post content which is enforced by the subscription rules.
There are 2 typical kinds of subscription sites, 1) Paid access and 2) Pay to Submit. Mine is the latter meaning that everyone can view the content for free but you have to pay to post your content. What the subscriber is paying for is visibility, marketing, maybe advertising as well.
Brief History
We first did this with searcy.com (now under different ownership) where we used lm_paypal to set up subscriptions for posting directory listings. It worked decently well but we couldn't really modify the subscriptions very easily, and paypal forces you to get a paypal account. But this is the concept I was to use.
Basic functionality
The basic idea is that you subscribe, and then can submit content. There are rules that enforce visibility, so premium levels have better visibility and maybe more fields.
Core Modules
In every drupal site I rely on these 2 crucial modules and for subscription sites it would be no different:
1) CCK
2) Views
Additional Modules
My thought is to set up roles and for those roles to be granted/removed based on their subscription.
1) CCK Field Permissions? - for granting access to certain fields based on your role
2) Maybe some form of access control?
3) Quota by role - I think this should accomplish allowing certain roles to submit only a certain number of content
Payment
I would like to use Authorize.net ARB as the backend payment module but try to make it plugable so that possibly other types could be used later. ARB requires SSL and collecting the payment info, but it's easy to create and manage a subscription and the user doesn't have to have an account.
More discussion
I think most of the sites we launch will have a few subscription "buckets" and then a few levels within each. The user can subscribe to multiple subscriptions but only one level within each.
It seems the simplest way would be rely on user roles. When you subscribe you are granted a user role. For each view that is created it looks at the content type and user role to determine whether or not it gets displayed. Say you create some block views on the homepage for premium users. Using the "author role" filter in the view setup you filter which roles you allow.
And in the .tpl view for the content you can again view the content author's role to decide which fields get viewed and maybe how it's viewed.
So roles/access control + views sounds pretty good. Using the quota by role module I can assign limits to how much content can be submitted by each role. I don't like that it shows the "quota by role" page to all users by default, I may have to make some changes.
Obstacles
To me the main obstacle is how to treat content as subscriptions are modified. Here are the cases for content changing:
1) Subscription is upgraded
2) Subscription is downgraded
3) Subscription is cancelled
I think for simplicity there should be a 1-1 relationship between a subscription and a content type.
Upgrades
If the subscription is upgraded, you just remove the previous role, add the new role and usually the new role has more visibility and let's you post more content (views+quota by role handle that). And you're probably not having to touch the existing content out there.
Cancellations
If the subscription is cancelled, you remove the role and a job or trigger function looks for any nodes of that content type which is bound to the subscription and "unpublishes" it. The user cannot republish it without subscribing again.
Downgrades
Downgrades
I think this is tricky only for deciding which nodes get unpublished. If you were allowed 10 nodes for a content type and now only 5, then which get hid? My thought is that upon downgrading the user has to select which nodes to unpublish and that once they do that in their content section they will see 10 nodes but only 5 are published. They still will not be able to publish any more content without deleting existing content.
Conclusion
This is my idea for a subscription/configured drupal site. Ideas, comments, suggestions? I might create a drupal project at some point if I think it's built in a way that is reusable.
So in review the modules utilized are the staples 1) views and 2) CCK, with a perhaps modified 1) Quota by role and 2) CCK field permissions. The only custom module would be the "subscription" module which allow the user to create subscriptions and levels. Each level would be tied to a role. Each subscription level also would have payment properties: price, duration, etc. Each subscription bucket would have to be tied to a content type, CCK or otherwise.
The subscription module really wouldn't do much enforcing of the rules, which is kind of nice that the rules of the subscription would be "decoupled" from the subscription module itself. The rules are tied to the role that the subscription levels grant. So access control determines what the role can do, CCK determines the visibility, quota by role determines quantity, CCK field perms determines fields that can be posted.
How's all that sound? Thanks for your help, -Jay
Comments
Surprised no one commented
Surprised no one commented yet.
I think the module is good and you have a solid idea of what to create. I think the idea to use Authorize is good, though you may want to have an option to select other payment gateways (that's for site owners, mostly).
As for me, I'd rather see a module to be used for people to pay to see content. That's the module that I would probably use sooner or later.
Sadly, I am not a developer, so I can only help with ideas/usability.
Ya there are those types
There are a lot of sites where you pay for content, but the sites we're building are the reverse, where we charge to post the content.
Trials
I'd also like to see trials...I've seen plenty of pay for content sites that allow the person to enter their credit info, and have access for 7 to 14 days. If they don't cancel before then, their subscription starts, and recurring billing happens each month. I'd love to see this in the module as that's what I need.
Authorize ARB supports trials
We're using the authorize ARB which supports trials. That will be the only gateway we support at first, we might add more later. The only hesitation is all gateways work differently and I don't want billing to get too complex to deal with bc we're going to be launching a bunch of sites.
I'm interested in this
Great idea - and you've put a fair bit of thought into it already. I can't believe how few modules are available for what you have described. There seems to be an ecommerce module, but I have no interest in installing a full on e-commerce system just to use one module. There is http://drupal.org/project/lm_paypal which hasn't actually been released, but there is code in HEAD that might give you some nice starting points.
Oh - definately agree with Trials as well.
I assume you would start development on version 5? Keep us updated on your progress!
Used lm paypal
Man I've tried to play with e-commerce it's just kind of clunky. I actually do plan on using it if we build a sports photo site in the future which is on the back burner. I like it for 1 time transactions but it's subscription support is non existent. It supports recurring invoicing which for those of us in the biz is worthless. It's a pain for subscribers and the way to keep subscribers is not to make them re-decide to continue every month. It's much better for them to just keep getting billed until they cancel.
I used lm paypal for a site we sold searcy.com, which was our first drupal e-commerce site. I used a pretty early version but it worked decently well. I thought we would use it for most of our billing but as it turns out a lot of our orders where by invoicing. I am basing some of my ideas off of lm paypal. For one I like using roles as the centerpiece for subscriptions which may seem obvious but there are other ways of doing it. I just like the idea that the subscription module just cares about granting and removing user roles based on their subscription status. In that way it's kind of "loosely coupled" with everything else that's going on.
I am using version 5 for development bc it's got the most module support. I will start development this month. I might start a project for it, we'll see. It might be tightly integrated with authorize just for the sake of being easier to deal with. I will try to abstract that out, but I've got timelines I've got to keep though as well.
Well, I might be starting up a project here soon
I know what code I need to accomplish this but the only thing I'm having trouble with is knowing the "drupal" way of making the payment engine modular. Right now I only care ab using authorize as a backend but I'd like to have additional support later on, like say paypal or other subscription engines. I think I need to create hooks, and I think I do that with invoke, but it's confusing. I don't know if I need to buy a drupal book or if the docs here will suffice. Any advice out there?
Jay
The project is underway
Hold on to your hats people. I am launching the project hopefully this weekend. I've got a lot of the code already.
I have to figure out whether or not I'm going to mess with subscription "levels". Anyways stay tuned...
any news????
Anything new mate??
Hey sorry
Ya I'm working on it, I wanted to get it up sooner but the target date now is probably next week.
Basically here's the functionality so far
-You can configure the default payment engine, the authorize.net arb payment engine
-You can set up role subscriptions which when paid for grant you a particular role and if canceled remove that role
-Role subscriptions are grouped. So you first create a group, then place role subscriptions inside of them, you can think of the subscriptions as levels. Each level grants a different role, typically has different prices but all subscriptions within a group have the same terms
-On the public side it shows your role subscriptions in the groups you set up and you click on a subscription, then you go to the payment screen and confirmation screen and that triggers your new role if the payment was successful.
There's still a lot of error checking, logging, documentation, and cleanup I need to add over the next week. One of the big things I have to focus on is having ways of fixing subscriptions if say a web service call fails or something.
There's much to do but it's going pretty well. Hopefully I'll get it cleaned up enough next week to get it out there so ppl can look at it.
Module coming soon...
Working on launching the alpha version this weekend.
Having trouble with Authorize ARB. If people want to start signing up for developer accounts at http://www.authorize.net/arb/ that would be good and try out the sample SOAP php code they have. It shouldn't work for you either bc my gut feeling is a couple weeks ago they modified the web service without updating the WSDL so now I'm passing it the same data I've been passing for 2 months but now it's saying the CC number and expiration date aren't there. If ppl who want to use this module in the future would sign up, test that code and if it doesn't work (which it shouldn't) bug authorize I think eventually we'll get them to fix it. I've swapped half a dozen emails with them and haven't gotten anywhere yet so the more ppl I can get to bug them the better I think.
Launching the module this weekend
Here is the new thread I'm starting to track feedback on the module: http://drupal.org/node/262370