Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have been looking at subscriptions a lot today for a client, and I think that the subscriptions could be completely moved to a stand a lone module by using the nodeapi, the formapi, and some of the other e-commerce api's that exist.
This would make the core a lot cleaner, and easier to maintain.
Comment | File | Size | Author |
---|---|---|---|
#81 | role_membership_0.zip | 2.82 KB | scoonz |
#80 | role_membership_2.tar.gz | 1.46 KB | kbahey |
#76 | role_membership_1.patch.txt | 2.85 KB | kbahey |
#75 | role_membership_1.tar.gz | 1.48 KB | kbahey |
#67 | role_membership.zip | 1.94 KB | marcoBauli |
Comments
Comment #1
neclimdulIf your saying that subscriptions would be a separate checkout and payment process in a separate module I believe I'm going to have to disagree as I am working on a website that will be offering both and I don't think we'll be wanting them to have to checkout through separate processes.
Comment #2
alext-1 CreditAttribution: alext-1 commentedI am just about to create the ability to have subscriptions. I had just decided to go with ecommerce module as I need a way to accept a gateway that doesnt have any payment module written for it yet: cybersource.
I had decided to use ecommerce because I needed address info also in the subscription model.
I am about to very very actively plunge into this, so would love to be working on something people will find use ful in the future or are currently working on...
-
Comment #3
gordon CreditAttribution: gordon commented@neclimdul - No I am not talking about moving this into a new process. If will work as it is now.
ATM the code for the subsciptions is scattered though the store, product, and payments modules. But now with the new api's that have been developed this no longer needs to be scattered though the ecommerce modules, but instead moved to it's own module that can be activated when needed and be all in 1 place when we need to find any problems.
Comment #4
coupet CreditAttribution: coupet commentedexcellent idea, will allow for easier maintenance and feature enhancements
Comment #5
neclimdulOh, then right on. I agree 100% :)
Comment #6
coupet CreditAttribution: coupet commentedWill this task be implemented in 4.7 port release?
Comment #7
gordon CreditAttribution: gordon commentedI would like it to be.
Comment #8
wpd CreditAttribution: wpd commentedIs anyone actively working on this?
There are two distinct features to the current code:
The feature I am most interested is a membership product were the user receives an additional role for a specified time period. At the end of the subscription time period, the user role is removed or replaced with a different specified role. I am currently working on a site that would like the user role 'current member' to be added at the time of purchase and then the role 'former member' applied at the end of the time period.
I am planning on building something like this for my own use. If you have requests you can add them here. (Although, I am not promising anything... )
Comment #9
gordon CreditAttribution: gordon commentedI think Ogredude and someone else were working on subscriptions and recurring products.
1 thing I would also like to see the ability to subscribe to a product and use a different product to renew. So in the case of selling software with ongoing maintenace/free upgrades you may pay an initial price and then later pay the ongoing maintenance which will be a different price, and a different node.
Comment #10
coupet CreditAttribution: coupet commentedwpd,
presently, nobody is working on it!
If you decide to code it, then I suggest moving the code to a new module as gordon suggested, with existing functionality and the new ones that you require.
Further features can be added later.
Comment #11
wpd CreditAttribution: wpd commentedAn idea:
-The ability to buy a membership should not be restricted to upgrading the account that purchases the product.
-By uncoupling the user/the purchase/and the role upgrade this allows for gift subscriptions, etc.
I will try to work on this task over the weekend.
Comment #12
gordon CreditAttribution: gordon commentedThis should all depend on the product that is purchased. Gift subscriptions are really a different beast. But really the same result in the end.
It all depends on the product that is purchased. Gift subscriptions would just create a gift certificate that can be redeemed via a different page.
I would like to see the role that is allocated based upon the role, then you could sell different levels of membership to customers.
Have a talk to Orgedude as I am pretty sure that he is doing something with subscriptions.
Comment #13
wpd CreditAttribution: wpd commentedOrgedude does not have his contact form enabled.
I am planning on everything being product based with some global configuration settings.
Comment #14
coupet CreditAttribution: coupet commentedProducts & Categories
--------------------------
One-time products are charged just once on purchase.
Recurring products are charged on purchase, along with any setup costs, and are also billed on the schedule selected by the user from the defined list of available schedules: weekly, monthly, quarterly, semi-annually, annual, and bi-yearly. Recurring products can be configured to allow/disallow user cancellations and billing schedule changes (upgrades/downgrades).
Trial products allow a special introductory rate for a recurring product, after which the normal rates apply.
Each product can be assigned a tiered pricing structure based on the user’s group access. So group A gets the product for $10/month + $5/setup fee, while group B gets the same product for $5/month + free setup.
Each product can be assigned unlimited attributes to collect information from the user and/or charge for optional services. The pricing for attributes can also be tiered in the same fashion as products can.
Products can have associations that do any of the following:
1. Require that a user have purchased a specific product prior to purchasing the current product.
2. Grant free access to another product with the purchase of this product.
3. Grant access to a group or groups for a specified period of time with the purchase of this product.
Products can be defined to create a discount for the user when purchased.
Comment #15
coupet CreditAttribution: coupet commentedInvoicing and Autobilling
----------------------------
Generate all recurring charges for subscriptions, trials, etc., including:
* Invoice Generation Notice
* Payment Due / Overdue Notice
* Service Cancellation / Suspension Notice
* Payment Decline Notice
* Payment Received Notice
Comment #16
marcoBauli CreditAttribution: marcoBauli commentedi guess this task is (was?) carried on by ogredude here.
ae2000 hired him as developer, and is (was?) coordinating this and collecting donations to carry on the job.
if what you guys are talking about different features, than pardon me, but things about ecommerce and subscriptions are still very scattered/confusing...
Comment #17
wpd CreditAttribution: wpd commentedThe link you referred to is a seperate task (http://drupal.org/node/51181). They are working on 4.6 and it works without the ecommerce module.
This work is for 4.7 (ecommerce) and is take code that is scattered across several modules and refactor it into a new module.
There are a couple of other differences:
-this is for any payment form (not paypal specific)
-the membership/role changing features do not have to be associated with a recurring payment
Anyway, I am still working on it when I can find the time. I think I have identified most of the code and moved it into to new modules. My current plan is to not add any functionality until the new modules are separate and in CVS.
Comment #18
marcoBauli CreditAttribution: marcoBauli commentedWpd, just knew some news about the 'other' paypal subscriptions module. It looks like the current developer couldn't see a way around the email address problem and the timezone problem, so they may shift the focus over to 4.7 and ecommerce module framework instead of 4.6 and paypal framework module.
Any comment or feature request can be left at drupalecommerce.com here.
Also, anyone willing to donate for the cause can contact ae2005.
Thank you
Comment #19
wpd CreditAttribution: wpd commentedDoes anyone know what the db field ec_product.auto_charge is for?
I can find a reference to it. I just want make sure I am not leaving anything out of the reccuring module.
Comment #20
neclimdulMy guess would be that it would imply a reacurring payment. More importantly that we are to automatically try to charge them. This may not be true for all reacurring payments as some may just warn the user or something. That would be my take but like I said its just a guess.
Comment #21
wpd CreditAttribution: wpd commentedThat is my guess as well, but as far as I can tell it is never set or used.
Comment #22
coupet CreditAttribution: coupet commentedI can help with testing with ready.
Comment #23
Jeff Veit CreditAttribution: Jeff Veit commentedI've done a little work on it. Mail me.
Comment #24
sym CreditAttribution: sym commentedSo...is anyone working on this? I need to sell a role on a site, so should I make my own module (I don't think it will be that hard with the ecommerce and user apis) or wait for someone to do this?
Can I help anyone?
Comment #25
coupet CreditAttribution: coupet commentedsym,
I strongly suggest giving it a try!, also given your recent experience with auction module, this might be a breeze. gordon suggested it, wpd did some work but never published. I have contacted smoothstr as suggested but no response.
we do not want to forget about this one.
Darly
Comment #26
sym CreditAttribution: sym commentedI've never touched the auction module....
If I make a module that will allow you to make a new product, selet the role that the user is assigned and then assign it on payment, would that do it? I think the apis would make that easy. I will give it a go, and post it for someone else to polish.
Comment #27
sime"also given your recent experience with auction module, this might be a breeze"
sym <> sime
:-)
Comment #28
coupet CreditAttribution: coupet commentedAgree, excellent knowledge of the new APIs is the key, also initially a module with core functionality as described should be perfect, further enhancements as needed can be implemented later.
understand and sorry in referenece to sym <> sime !
Comment #29
neclimdulI talked to gordon about this and he mentioned it was probably too late to make in the 4.7 release. He wanted to hold of the core changes till after 4.7 release(very soon) and then once they're sorted out backport. I tend to agree as they will probably require reworking a lot of code across a lot of modules.
That doesn't mean we can't get something useable started. I'm also interested in working on this, mainly from the sense of getting it out of core, but also in getting the module working as I'll be wanting something like this eventually. I haven't looked into the funtionality we'll be wanting to much but you're welcome to contact me offlist.
Comment #30
sym CreditAttribution: sym commentedRight, I have made a module that allows me to make a sellable role. When the payment is complete the role selected in the product is assigned to the user. This is working fine, but I now need to think about other options.
For example:
How to I check if the payment cycle has expired (if using it)?
I want to un-publish all of the users posts once they are demoted, and republish them after they buy another year. (I think this is easy)
Do the users have to wait until the last cycle runs out before they can buy another one? Or can they just buy it again a week before it runs out and have it topped up? Also, could they buy 2 years or more at the same time?
I want to start removing the old code from the core modules, but I don’t think I know enough about it at the moment to do so. Would someone be willing to go though it with me (over IM/IRC) so we can look at what’s needed and what should be a new module?
I think the recurring payment could be a module in itself, but would that start to dilute the core too much?
I’m looking for guidance more than tech knowledge here.
I will be working on this over the weekend, and I would really like to have something up and running by Monday, is anyone about over the weekend for me to talk to?
Thanks :)
Comment #31
coupet CreditAttribution: coupet commentedRecurring products are billed on the schedule selected by the user from the defined list of available schedules: weekly, monthly, quarterly, semi-annually, annual, and bi-yearly.
Recurring products can be configured to allow/disallow user cancellations and billing schedule changes (upgrades/downgrades).
APIs are the core in Ecommerce, Non-API code could be rearranged to allow for modularity and easier future enhancements. Agree, code unique to Recurring products should be moved to new module.
Notes:
Scheduler module can Publish/Unpublish nodes, but it is not automated.
Actions module allows the configuration of Drupal actions.
Comment #32
edrupalec CreditAttribution: edrupalec commentedsym,
just wanted to make sure you knew about the mailing list and the irc channel since you wrote about getting a hold of someone
http://www.drupalecommerce.com/drupal_ecommerce
thanks so much for working on it
Comment #33
sym CreditAttribution: sym commentedhehe, thanks!
We are actually the same person! Sym = screen name Simon Roe = real name.
Thanks for letting me know though, I will follow up tomorrow (UK time)
Comment #34
jasonwhat CreditAttribution: jasonwhat commentedI'm confused. According to this statement in the thread some role by product purchase features already exist:
Where are these options within the normal ecommerce module?
Also, Sym, you say you have some working code that does this. Is your module available?
Comment #35
sym CreditAttribution: sym commentedAt the moment, I think that if recurring payments are activated, then the role is granted automaticlly (settings under product settings?)
I have made a module that will allow you to buy in to a role, but that not the same as being added to a role when you buy any product. You're welcome to look at it, but I've not tested it for a while so it might not work with CVS/4.7 any more.
Let me know if you find any problems - I've not made an install file for it, so you'll have to add the tables yourself...sorry, I'll get to this soon.
Comment #36
coupet CreditAttribution: coupet commented@ sym, does the module provide option to assign duration of role assignment?
also, tables referenced are not attached!
Comment #37
sym CreditAttribution: sym commentedNo it doesn't - the point being that the two shoudn't be tied. If you want recurring payments then there should be another module that will deal with it for any product type IMHO.
I did say the tables wern't attached - I wasn't really ready to post it, but jasonwhat asked to see some code. I though this might be a starting point for him.
I will package it up with an install after the weekend.
Comment #38
behindthepage CreditAttribution: behindthepage commentedI tried your module and it is an excellent start. This is something I am interested in working on so I will keep an eye on this thread. I am looking for a system where people can buy different levels of advertising on a site. With this module they can but a role then I will have to develop access rules so for level 1 they can post 5 adds, level 2 - 3 adds etc. This module seems like a good basis for that system.
Thanks for your work so far.
gpdinoz
Comment #39
behindthepage CreditAttribution: behindthepage commentedTo get default value working Line 45 should be
gpdinoz
Comment #40
coupet CreditAttribution: coupet commented@sym, interesting idea, then there will be a need to assign a schedule and automate process
1. create a module that fires an action instance at appropriate times when you want. (requires Actions module)
Schedule or Scheduler are 2 modules that could be used to assign schedule.
Comment #41
marcoBauli CreditAttribution: marcoBauli commentedjust for you guys to know, a list of desirable functions for ecommerce paid role subscriptions (gathered from different posts about this subject on Drupal forum) has been posted at http://www.drupalecommerce.com/node/734
cheers
Comment #42
gordon CreditAttribution: gordon commentedThis is not an official respository for information on Drupals E-Commerce. The information gathered here will most likely not get to the developers who are creating the next release.
Any wish lists, or other information please use the groups.drupal.org to post and discuss this information.
Comment #43
paddywwoof CreditAttribution: paddywwoof commentedSym, This looks to be just what I need, thanks. I have installed your module and put a table {ec_product_role} (nid, rid) into the database. It seems to work, at least doesn't give any errors to press. I didn't get any roles in my select box and saw there was a TODO so I put this in, which did what I thought ought to be happening. The default value doesn't pick up the previous value which needs fixing.
I will try buying some roles and see if it works.
Paddy
Comment #44
fbomb CreditAttribution: fbomb commentedI think we're all on the right track here. My inital idea was to clone the generic product module, but add in the option to specify which role to elevate the user to once they've purchased that subscription. I'm working on a site where we want to sell monthly and yearly subscriptions to acces content, but also have a "premium" level which gives you access to additional content and discounts when buying regular items.
Comment #45
sym CreditAttribution: sym commentedThanks for the help with the default vaule!
After writing that module I have changed tack a bit. I think we should have a way of adding "actions" to any product, and then doing something when the state changes.
Any module could make an action and it would show on any product page.
For example, simplenews could have one that would allow you to sign someone up to a newsletter when they buy a product with it selected. the same with roles and subscriptions. That way to make a role subscription you would create any sort of product (generic would fit best), write your text and select the actions that sute you:
on payment: Assign role: "paid user"
on payment: Subscribe to newsletter: "Members news"
on payment: start recurring payment: 30 days
on expire: remove role: "paid user:
on expire: remove newsletter: "Members news"
I would like to hear some feedback on this. I've not written any code yet, but I will get on it soon if people like it. I know that all this can be done with the APIs at the moment, but making a fieldset on every product type would change the way ecommerce works quite a lot I think.
Comment #46
coupet CreditAttribution: coupet commentedComment #47
edrupalec CreditAttribution: edrupalec commentedI think it's good to call this "paid membership" module and not "subscriptions." There are already (1) subscription and (2) subscriptionS modules, for email subscriptions to topics. If we call this subscriptions also it'll get very confusing.
Comment #48
marcoBauli CreditAttribution: marcoBauli commenteddefinitely good idea! that was pretty confusing to figure out
Comment #49
marcoBauli CreditAttribution: marcoBauli commentedJust quoting a reply on a forum thread that might be usefull:
Comment #50
kbahey CreditAttribution: kbahey commentedHere is a working module called "role_membership" based on the module above.
I tidied up the code, added a settings page that allows changing the description, and a .install file to create the database table.
It works well with 4.7.
Comment #51
edrupalec CreditAttribution: edrupalec commentedThank you very much for submitting this. I installed it into the modules directory. (Should I have installed it into contrib for ecomm?)
I got this warning.
user warning: Table 'mysitename_drupal.ec_product_role' doesn't exist query: INSERT INTO ec_product_role (nid, rid) VALUES (1070, 5) in /home/mysitename/public_html/drupalecommerce/includes/database.mysql.inc on line 120.
user warning: Table 'mysitename_drupal.ec_product_role' doesn't exist query: UPDATE ec_product_role SET rid = 5 WHERE nid = 1070 in /home/mysitename/public_html/drupalecommerce/includes/database.mysql.inc on line 120.
user warning: Table 'mysitename_drupal.ec_product_role' doesn't exist query: SELECT * FROM ec_product_role WHERE nid = 1070 in /home/mysitename/public_html/drupalecommerce/includes/database.mysql.inc on line 120.
Comment #52
marcoBauli CreditAttribution: marcoBauli commented@edrupalec: the .install file failed for me as well, try running the database query manually from phpMyAdmin.
Also be sure you have installed the required ecommerce modules:
. cart
. payment
. product
. shipping
. store
Comment #53
marcoBauli CreditAttribution: marcoBauli commented@kbahey: you are the man, many of us non-coders were waiting for this!
I got the following error when i submit a new role product:
warning: in_array(): Wrong datatype for second argument in /home/kiteatla/public_html/drupal/modules/ecommerce/product/product.module on line 703.
Comment #54
kbahey CreditAttribution: kbahey commentedToo bad. What happened is that I had the .install file working fine, and then as I was bundling for upload, it got accidentally overwritten, so I coded another one, but it was untested.
The client is not using this after all, and going for a Paypal oriented solution. Going this route with him.
Try the attached version.
(Another thing, I have not tested if this will expire roles properly or not. Can someone test that?)
Comment #55
marcoBauli CreditAttribution: marcoBauli commentedgreat, that warning (#53) vanished with above version!
BUG: if i go to administer >> settings >> content types >> product i do NOT see the roles_membership product type in the 'configure product types' fieldset at the top of the page...
(i happened in this trying to disable comments for role_membership content-type, any other way to solve this?!)
thank you
Comment #56
kbahey CreditAttribution: kbahey commentedI am not using this module anymore (not even ecommerce) since the client is asking for an alternative solution that will not use ecommerce (Paypal Membership).
If I recall correctly, the settings for the module are under the store -> settings menu.
The actual settings are when you do create content -> product then you should be able to see a "Role Membership" product.
Comment #57
drupalec-1 CreditAttribution: drupalec-1 commentedkbahey, do you know if it is possible to run Paypal membership along side ecommerce? It has always been presumed that they conflict due to IPN's returning to the same place (or something) but perhaps there is a quick one-line fix to run them side by side. ecommerce can be used for intergration with userpoints, and Paypal membership can be used for role assignment.
Comment #58
mwu CreditAttribution: mwu commentedwhich module is supposed to create ec_product_role? Is there a module that needs to be patched to create this field?
Comment #59
kbahey CreditAttribution: kbahey commented@drupalec
kbahey, do you know if it is possible to run Paypal membership along side ecommerce? It has always been presumed that they conflict due to IPN's returning to the same place (or something) but perhaps there is a quick one-line fix to run them side by side. ecommerce can be used for intergration with userpoints, and Paypal membership can be used for role assignment.
"Paypal membership" is still under development.
But yes, they would conflict if you enable the paypal module and the paypal_framework module at the same time. Even if you create two unique IPNs (e.g. paypal/ipn and paypalfwk/ipn), your Paypal account can only be pointed to one IPN URL at any time.
The issue is that ecommerce has no way of using Paypal subscriptions which do automated renewal.
@maric
which module is supposed to create ec_product_role? Is there a module that needs to be patched to create this field?
When you enable the role_membership module, there is an .install file that goes with it that should create the table.
Comment #60
drupalec-1 CreditAttribution: drupalec-1 commentedThank you. The new .install still didn't work for me. I had to use a very stripped down one .mysql file.
CREATE TABLE ec_product_role (
nid int NOT NULL ,
rid int NOT NULL ,
PRIMARY KEY (nid)
) /*!40100 DEFAULT CHARACTER SET utf8 */
;
Comment #61
drupalec-1 CreditAttribution: drupalec-1 commentedAnd then I got these 2 errors. However, to pay, I am using the userpoints module. So it could be an issue with the (extremely useful) userpoints module.
user warning: Duplicate entry '9-shipping-0' for key 1 query: INSERT INTO ec_transaction_misc (txnid, type, vid, description, weight) VALUES('9', 'shipping', '0', 'Shipping', '9') in /home/public_html/drupalecommerce/includes/database.mysql.inc on line 120.
user warning: Duplicate entry '1-5' for key 1 query: INSERT INTO users_roles (uid, rid) VALUES (1, 5) in /home/public_html/drupalecommerce/includes/database.mysql.inc on line 120.
Thank you.
Comment #62
drupalec-1 CreditAttribution: drupalec-1 commentedThe good news is that despite the warnings/errors, the buyer was promoted to the correct role. Tomorrow I can see if the person will be correctly demoted.
Comment #63
drupalec-1 CreditAttribution: drupalec-1 commentedMore good news. Multiple roles seems to be working correctly. Also, this works even when address module is disabled.
Now if we can get rid of the duplicate error, have a "Your transaction was sucessful" type message in place of the error message, (and assuming demotion and payment with real money work) then the module is done!
Thank you.
Comment #64
kbahey CreditAttribution: kbahey commentedThis one is not from the role_membership module.
This one is from that module, but maybe the users already had that role before the transaction?
The message is easy to do, but remember that the user may not come back immediately to the site ... An email is better.
Comment #65
drupalec-1 CreditAttribution: drupalec-1 commentedI just checked. The user did not have the role before. I did it 2 times. Thank you. But the role does upgrade correctly.
Comment #66
drupalec-1 CreditAttribution: drupalec-1 commentedWith address disabled, the notification email says "Dear ,".
Comment #67
marcoBauli CreditAttribution: marcoBauli commented30/06 scoonz wrote:
please find attached .zip file.
thx
Comment #68
sym CreditAttribution: sym commentedYou are doing great work, however I was thinking about doing something different.
I think we should make a recurring payments module that could be used on ANY product. I also want to make a role module that can also be used on any product.
I am finishing a project at the moment so I can't do anything, but next week I will start working on these ideas so you can get an idea of what I am talking about.
Comment #69
kbahey CreditAttribution: kbahey commentedsym is right, long term. I still see value in what we are doing though, at least as a short term solution.
kiteatlas, the expiry cron will be very heavy on a large database due to many joins in it. It is better to have a variable that will prevent it to run at every cron invocation, and only once a day or so (parameter).
Also, another parameter is whether a warning email that has to be sent before the role expires, and how many days before it expires.
Comment #70
mwu CreditAttribution: mwu commentedsym, your idea of recurring payments that apply to any product is just fantastic!
Comment #71
kbahey CreditAttribution: kbahey commentedWhat needs to happen is this:
1. Remove the recurring payment logic from the payment.module to a more generic product.
2. The roles would not span all products, but would be product specific (i.e. each product can have a different role to be granted, like the role_membership.module that I attached earlier). The duration for this role is already per product, so that part is OK.
3. Roles should be expired based on the duration. This is already per transaction (and hence per product).
4. The final area would be for Paypal as a payment method to have more processing for subscriptions (check txn_type, and if it is subscr_payment then grant the role, if subscr_cancel or subscr_eot, then revoke the role).
This would mean that users can be granted roles instantly if they pay by credit card (for example), and when the payment status is moved to completed by the site admin when they get a cheque (using the COD module). It would also mean that automated renewals are possible via Paypal as well.
Comment #72
drupalec-1 CreditAttribution: drupalec-1 commentedkbahey, the role_membership (paid_membership) module is now promoting correctly with Paypal sandbox. Tomorrow I'll see if it demotes correctly.
I think I know the source of the duplicate error. What role to promote to is set in 2 places. First, in admin--store--settings--recurring payments (there you can only set one role.) Secondly, when you create a product. I removed any choices from admin--store--settings--recurring payments. I also disabled userpoints. (I do hope to get userpoints working with ecommerce error-free eventually.) Then role_membership promoted correctly without returning any error messages.
Comment #73
coupet CreditAttribution: coupet commented@ sym in reference to comment #45
could also add:
on payment: Publish n CCK nodes for x days
on expire: UnPublish CCK nodes after x days
also as mentioned in #71, removing the recurring payment logic from the payment.module to a more generic product would greatly facilitate further development in subscription module.
Comment #74
kbahey CreditAttribution: kbahey commentedWhat I meant is that it does proper Paypal Subscriptions, and not just payment via Paypal. With PP Subscriptions, the renewal is automatic and no action is needed from either the customer or the site owner. This is a major requirement for some sites since people forget to renew and sites lose revenue.
It will not demote. I have a patch to store.module and payment.module to streamline this more and hopefully expire things properly.
I have that fixed too in my version. I will test more and then post the patches.
In the patch I am developing, I removed the recurring payment from payment.module, and rely on it in role_membership.module only. However, it is not yet generic enough to add the role to any product.
Comment #75
kbahey CreditAttribution: kbahey commentedHere is a version of role membership that should work with expiration correctly.
The trick is to let ecommerce do the role granting via its existing mechanism, which also does role revocation. You will not see duplicates any more.
This requires a patch to payment.module and store.module so as not to use global roles, and make them per product.
I would like to restrict this module to one item per cart, and a quantity of only 1. This paves the way for Paypal subscriptions using IPN, since they cannot be done with multiple products in the same checkout. I put in code for this in role_membership, but that hook is not firing properly.
Comment #76
kbahey CreditAttribution: kbahey commentedAnd here is the patch, against 4.7.
It is hackish in nature, and therefore I don't expect it to be committed as is, but it does work for those who need this.
Comment #77
gordon CreditAttribution: gordon commentedJust so you know, do not rely on any of the existing functionality that is in core, because as soon as we have something that can replace core, we will be removing all the current subscription stuff from core.
Comment #78
kbahey CreditAttribution: kbahey commentedI missed what you are trying to say. Maybe because it is past midnight, and I have a parsing error.
Not sure what core here means: ecommerce core? Why replace core? And with what?
Comment #79
gordon CreditAttribution: gordon commentedAs soon as I have a contrib module which can be used as a replacement for what currently in E-Commerce Core, I will be removing the current subscripts from E-Commerce core, and using the replacement module.
Comment #80
kbahey CreditAttribution: kbahey commentedThanks gordon for the clarification ...
Here is a version that makes sure that no quantity can be assigned for a role membership item.
It also prevents the user from adding more than one role membership item in the cart.
Now, the paypal module can be expanded to process Paypal Subscriptions payments ...
Comment #81
scoonz CreditAttribution: scoonz commentedHere is also my modification of role_membership.
1. Quantity is considered as number paid billing cycles so that expiration date gets procrastinated (I wonder nobody requested this feature before), but this requires a patch for cart.module (included) in order to consider all reccuring payment products quatities are number of billing cycles.
2. If user is/was already subscribed to the certain subsciption while adding it to cart, it converts to renewal (prolonging expiration date). E.g. lets consider billing cycle = 1month. Then simply 'buying' the subscription in quantity of 3 and next day 'buying' the same subscription in quantity of 2 will make it expire only in 5 months.
3. Ofcourse, it removes the role when the subscription gets expired.
Comment #82
sym CreditAttribution: sym commentedI am making a new module called 'recurring_payments' that will handle recurring payments for any product type. I hope to include a basic API that will include 'expire' and 'renew' cases that things like the role membership module should use. (I would like to unpublish all nodes made by someone who has just been demoted, but that should be done with a 'demote' hook in role membership I guess).
Anyway, my question is; what do people think about removing the is_recurring, price_interval, price_unit, price_cycle and auto_charge fields from the ec_product table in favor if a ec_recurring_payment table?
Comment #83
kbahey CreditAttribution: kbahey commentedscoonz and sym both have good ideas. sym's goes well with a standalone module to replace what is in core ecommerce now.
One thing to take into account is Paypal subscriptions. This is the most convenient way to get automatic hands-off renewals for both the customer and the site owner. No one needs to do anything.
If the payment is via the paypal module and it is a recurring product, we can make it a subscription. What we need is to send the appropriate data to paypal and handle the txn_type having subscr_* in the IPN.
Sym, if you have code, pass it my way (use the contact/feedback form on 2bits.com), and I will see what I can do.
Comment #84
sym CreditAttribution: sym commentedI don't have any working code yet, but it's coming.
I am very keen to stay within ecommerce and drupal for these modules. ecommerce is nice because it doesn't tie in to any 1 payment system. I don't use paypal and I have no plans to do so at all....therefore I would like to leave the payment up to ecommerce.
Comment #85
gordon CreditAttribution: gordon commentedI have taken a quick look.
1. I would like for subscriptions to be completely external. I would prefer for all the fields to be removed from Core. including the tables.
2. There should be no changes to core, which includes the patch included in the #81 as it will not be required as this line will not be there.
3. I do not want to directly implement paypal subscriptions. This is good, but I want a payment subscriptions framework included in E-Commerce which will allow the use of any subscription system like what Authorize.net has, and many others.
I think the progress so far is great, and I am glad that it is being activetly worked on by so many people.
Keep up the good work everyone, this will make a great addition to 4.8
Comment #86
kbahey CreditAttribution: kbahey commentedThanks gordon.
The role_membership is mainly to allow "buy-a-role", and even that module wants the subscription to be external to it.
Regarding paypal subscriptions, I agree with you that subscriptions should not be tied into any payment form. This is one beauty of Drupal's ecommerce: its open nature.
Having said that, I have too many clients asking for subscriptions to be handled by Paypal since people forget to renew if reminded by email. This is why paypal_framework and paypal_subscriptions exist, but they leave a lot to be desired (e.g. if some people want to pay by cheque, there is no mechanism for that at all, while in ecommerce this could be handled by the COD module).
The best way of handling this is to incorporate the paypal subscriptions in the ec paypal module (or split this into two: paypal and paypal_subscription?), so when we get an IPN of the subscription (subscr_payment), we use the item_number as the txn id and renew the subscription. We can also act on subscr_cancel and subsc_eot (End or Term). Those who pay by credit card can continue to renew the way they want.
Comment #87
mwu CreditAttribution: mwu commentedThanks everyone for all the active development
Re #82 from sym, I would NOT want to unpublish nodes by people whose memberships have expired. However, having that as a configurable option would be nice.
Scenario 1: Say, it's a travel site. Someone subscribes for 3 months, writes some good pieces, and then let's their membership expire. I don't want their contributions to go away.
Scenario 2: Someone posts jobs. Their listings are only active while they are members.
If it's not configurable, I'd want scenario 1. I don't want to lose content.
I agree with sym's other ideas.
Comment #88
mwu CreditAttribution: mwu commentedI agree with kbahey that it would be nice to have a paypal subscription (or paypal membership) module as long as it doesn't conflict with ecommerce.
Comment #89
mwu CreditAttribution: mwu commentedAnyone interested in integrating this with Google Checkout?
Comment #90
kbahey CreditAttribution: kbahey commentedRegarding unpublishing of content from those who do not renew the subscription, this is better handled as a hook. The hook fires at the event of unsibscribing, and then contrib modules can do what they want (e.g. unpublish articles, revoke roles, send email to the person, send emails to the site admin, ...etc.) This way it is a totally open architecture.
Regarding Google Checkout, it is currently a US only product, unlike Paypal.
Comment #91
sym CreditAttribution: sym commentedkbahey, see my comment #45 for my thoughts on that. I think that recurring payment should be a module with some hooks in it (like 'on expire' 'on renew' etc) and role adding and anything else that might want to use recurring payment can do anything from there.
As mariun pointed out, there are many cases where one wouldn't want content unpublished, but in my case (a site where text is showcased after paying, and read by people in another role) I do would need it. Having a setting of the role payment module or even another simple module to do this would be the best option IMHO.
Comment #92
sammys CreditAttribution: sammys commentedGreat to see some progress on these long desired features. You've all had some great ideas and i'm very excited that we're going to finally have some decent support for roles and subscriptions.
As promised on the mailing list i've amended my specification document by adding some of the good feature requests noted in this task thread. I'm yet to go through Jeff Veit's document (34 pages!). I'm sure there is a large amount of good stuff in there too.
You'll find a link to the specification in the d.g.o thread dedicated to this. I'm looking forward to reviewing your modules. I'll most likely be the one ripping the old stuff out of core so keep me posted in IRC when something is ready (hopefully you'll check the specification to see that it matches first :).
--
Sammy Spets
Synerger Pty Ltd
http://www.synerger.com
Comment #93
mwu CreditAttribution: mwu commentedSammy's document is excellent. I want to encourage everyone to comment on the specs it details. (It's for 4.8, not 4.7)
Sammy is planning not to offer support for credit card payments, only via paypal (regular, not pro). I've heard paypal is terrible, because they can freeze your account at any time. I'm interested in using authorize.net for recurring payments. I've posted a question about that on the other thread.
Thanks to scoonz and kbahey for posting new versions. I'll try to test those today.
Comment #94
mwu CreditAttribution: mwu commentedHere is a good list of payment gateways and whether they offer a recurring payment option. (Has anyone tried amember?)
http://www.amember.com/paysystems.php
It appears that authorize.net does not support recurring payments if the credit card is not stored (the authorize.net SIM option).
Comment #95
mwu CreditAttribution: mwu commentedOn the above list, these payment gateways do NOT store the credit card data but do support recurring payments: ccbill, chronopay, egspay, ipayment.de, paypal (not pro), standardpay, verotel, worldpay, yowcow. Drupal has modules for worldpay, and paypal only.
Comment #96
sym CreditAttribution: sym commenteddrupal has modules for:
COD
paypal
paypal pro
authorize.net
eway
exact
itransact
linkpoint
payflow
worldpay
and no doubt many more.
Making a payment module isn't all that hard, so you can extend it to include almost anything. Where did you get the idea that "Drupal has modules for worldpay, and paypal only."?
Comment #97
mwu CreditAttribution: mwu commentedI meant of the list I gave of gateways that offer recurrent billing and does not store the credit card, Drupal only has modules for 2 of those.
Comment #98
mwu CreditAttribution: mwu commentedRight now it looks like Verisign is my best option. It offers recurrent billing without storing the credit card. It's a well-known trusted brand (and is actually a subsidiary of paypal now.) It costs quite a bit less than the others. Verisign is sold under 2 names: payflow pro, and payflow link. CVS shows 4 dead files for payflow link, 4.6. There is a thread with a 4.7 prototype for the much more expensive payflow pro. Can I interest anyone in doing a 4.7 module for payflow link for recurrent membership billing? I don't know how to code. If it's very simple (basically doing a global replace on the authorize.net module where I replace authorize.net with the correct payflow link url) I can attempt something like that. Thank you.
Comment #99
mwu CreditAttribution: mwu commentedI tried to install scoonz' 0.zip version. When I applied the patch to store.module, I got an error Hunk #1 failed.
Comment #100
scoonz CreditAttribution: scoonz commentedHmmm... I get "Hunk #1 succeeded at 1008 (offset 5 lines)" with the HEAD version of store.module.
Try simply locating line
$item['expires'] = strtotime($item['price_interval']. ' '.product_unit_nice_name($item['price_unit'], $item['price_interval']), time());
and replacing it with
$item['expires'] = strtotime(($item['price_interval']*$item['qty']). ' '.product_unit_nice_name($item['price_unit'], $item['price_interval']), time());
Comment #101
mwu CreditAttribution: mwu commentedscoonz, thank you. I'm using the 4.7 version of store. When I tried to manually change the line, I seem to have introduced some sort of syntax error, because then the admin/module page won't load. But it will load if I remove store.module. Maybe I made a typo somewhere (that I can't find) or the 4.7 version is not compatible with the patch.
Comment #102
mwu CreditAttribution: mwu commentedNews hot off the press
New Drupal 4.7 module to allow paid subscriptions using PayPal - testers wanted
LeeMcL - July 14, 2006 - 09:12
I'm completing a Drupal 4.7 module to allow paid subscriptions using PayPal. I'm currently still testing against PayPal Sandbox and am looking for some volunteers to help complete testing. Also I've writen it to provide the features I need but it would be good if it was more comprehensive. So I would like to have input on features required.
I did have a look at various other solutions but none seemed both appropriate for my needs and known to work with 4.7
This module has been writen from scratch using only the documentation and examples available from PayPal. I should also point out that this is my first Drupal module - so there may be some inellegant code!
If anyone is interested and has the time to help out please post a followup to this article.
http://drupal.org/node/73727
Comment #103
neclimdulThis is being handled in the 4.7.x-3.x release series and most of the large changes are committed so any problems can be handled in separate issues from here.