Some background first:
I have been involved in running a paid membership site for few years and have used amember (http://www.amember.com/) for this. While this program is not ideal it does work and handles recurring payments and assignment of roles fairly well. We really needed to upgrade to something more flexible (and something I can actually extend and tweak to suit our needs) and since I am already using Drupal it made sense to give ubercart a run for its money. I am using an unsupported payment gateway so I have already written my own module based on the uc_authorizenet module - and it all basically works.
Having played around in the ubercart code a little now I have run into a few thing I would like changed and was wondering whether there are design decisions I should be aware of or if they are possible areas for improvement.
The issues:
- 1. Why are recurring payments not treated as a new order?
-
Advantages of treating a recurring payment as a new order:
- Each payment gets its own invoice
- Invoice would then get emailed to the person as normal
- Other modules like uc_roles could automatically handle the extending the expiration of a role, since you can just invoke the hooks to allow other modules to jump in a do what ever they would normally do on a new order
If there is some reason why its not treated as a separate order now then I guess this could be done as an option ie: in the setting have an option: "treat recurring payment as new order [yes|no]" - although I think it should just be done by default for the above reasons.
- 2. Rather then have the option in the settings of which module should handle recurring payments, uc_recurring should handle everything and just have it call hooks in the payment gateways that process recurring fees
-
If a payment gateway exposed the right hooks then it is registered as be able to handing recurring payments otherwise its not. Everything about a recurring fee should first go through uc_recurring which calls the payment gateway responsible for handling that fee.
As an example: uc_recurring_cron - it would just check the order if it was charged by say uc_authorizenet then it invoked a hook provided by uc_authorizenet to process anything it wants to do on the renewal.
This allows ubercart to support more then one payment gateway for recurring payment. ie: I want to give my customers the option of paying for subscription via credit card though my current payment gateway as well as paypal subscription (at the moment i have to choose one or the other).
- 3. Nothing is setup to handle recurring payments failing?
- A payment failing should be registered with uc_recurring and then it handles it in what everway is setup in ubercart. What I would like to happen (and this is how amember works) is that the current order is extended for a few days and an email sent to the member notifying them of the error (so they have a chance to updated expired CC detail or fix what ever the problem is before they are locked out). Ususally you would give the subscriber a two extra attempt so to that on the 3rd try it suspends their subscription.
This probably would also need a function/hook added to uc_roles so it can extending role(s) associated with an order for a set number of days - actually uc_roles should support this by default, if they purchase a role for 1month and then purchase another separately (or though some other product) this should give them 2months access by default.
Related to this I would also like to have uc_recurring check details like CC expiry and if it detects ahead of schedule that a payment is going to fail because credit card details will be out of date at the time of renewal, a reminder is sent to that user to prompt them to update their CC details (this is going to be gateway specific).
- 4. Trial memberships and showing more information on the display price as to what that price is for...
- I would like to have the option to add things like a 2 week free trial and I have seen there is a free product module, but this is not what i need, as I still want to collect payment details and setup up the recurring payment schedule, the easiest way to set this up at the moment is to make the product price $0 and then add the recurring fee, but this is still not idea as then it displays the price as being $0 (nothing about how long until the first payment kicks in).
I think the simplest fix is if there is a recurring payment then in general there should be something shown by default as to when the first payment kicks in, something small under the display price.. so it shows $X.xx (X days/weeks/months)
- 5. Members being able to changing renewal options? (something thats on my wishlist of features)
- With the particular site I am working on members have the option to subscribe on different renewal terms e.g. monthly/6monthly/yearly - the longer you renew the cheaper it works out etc...
I have this setup using an attribute to select month/yearly and it works well, but it would be good to give members the option to change this at anytime or for administrators of the site to change it for a member, so as an example upgrading them from month -> yearly - this is going to be gateway specific as I know you can't change Paypal subscription, but if a gateway supports changing the payment terms it would be good if uc_recurring could handle changing the fee for future payments
I have already implemented some of the above (e.g. recurring payments as new orders) as part of my recurring payment gateway module, but it really shouldn't be in that module, I would like to make these changes in uc_recurring which would then allow me to support multiple payment gateway options (e.g. paypal/credit card) on the subscription products.
I guess I am just looking for comments/thoughts/suggestions before I really hack into the uc_recurring code (particularly if things have been done a certain way for a reason)
Also I am only looking forward so I only intending to work on the Drupal 6.x-2.x codebase.


Or any recuring billing solutions which do. Speaking of which, are there perhaps other open source projects, who's recurring billing solutions we should be looking at?