Recurring subscription payments

Posts: 60
Joined: 09/07/2007
Bug Finder

Hello all,

I'd like to be able to create a product that is a monthly recurring subscription. The customer's credit card would be automatically billed the same amount each month until they cancel their subscription (or their credit card expires, etc).

I've seen this request come up before in the forums, but I didn't see any solutions. Has anyone come up with a good way to do this? Or is this under development anywhere? In my searches, I did come across a Google cache of a forum post referencing an Authorize.net recurring payment module. Does that still exist anywhere??

Thanks in advance for pointing me in the right direction!
Xerxes

Website subscription/recurring payment product type
Submitted by Lifeischoice on Wed, 06/27/2007 - 17:27
Lifeischoice

Posts: 41
Joined: 03/22/2007
Uber DonorBug Finder

I am creating this thread with the hope that someone will develop new or modify an existing module to round out one of the major functions of ubercart... In addition, I am listing the following module requirements so others can add other funtions as needed:

Able to create recurring subscription type products with price - $, expiration - select single, monthly, Bi-annual, annual payment options and other features/parameters.

Able to handle protected files for paid download.

Ability for members to maintain multiple subscriptions simultaneously (for different subscription products) with same username/password.

Provide automated account expiration while members still able to login and renew their subscriptions and also visit other free areas of the site.

Send E-mail notification (username/password) to the subscriber after payment

Send E-mail notification before or after subscription expires

Thanks in advance for taker(s)...

* Add new comment

permalinkWed, 07/04/2007 - 10:23
uberPaduan

Posts: 1
Joined: 07/03/2007
Getting busy with the Ubercode.

Hello World!

First off, let me express my utmost respect for the Ubercart developers. Ubercart absolutely rocks!

I've been hacking away at the Authorize.net payment gateway module the last few days and seem to have a working solution for the Automatic Recurring Billing (ARB) service that that gateway provides.

I emphasize that I am a mere uberPaduan and am nowhere near the skills and power of the UberDudes Jedi Masters. Laughing out loud

As such, I ask for guidance in making this code worthy of "live" and "general use" status. I suspect it's pretty messy and maybe lots of things aren't coded in the Drupal or Ubercart way. Let me know and I'll be glad to fix. I'm a spare-time coder so have patience.

This modified uc_authorizenet.module adds some fields to the settings form. Specifically to separate credentials for production and test accounts, and differentiate between transactions with test mode set to "on" and transactions going to the test site which most likely should have test mode set to "off". (I know, it can drive one crazy trying to figure it all out!)

To have a product treated as a subscription, you must assign it an attribute that has the word "Subscription" anywhere in its name. For example, I used an attribute named "Subscription Length (months)" that specifies the total months duration of the subscription. At checkout time, this attribute's selected value will thus set the number of months duration for the subscription. A.Net only allows days and months as units of time and I used months hard-coded because that's what I currently need (selfish, I know). Any transaction to be processed that has such an attribute will be directed to the ARB service with the transaction data formatted accordingly. PRoducts without such an attribute are treated as "normal" AIM one-time payments.

Once again, there's no pride in ownership here so feel free to let me know what should be different. Hey, that's what Open Source is all about, no?

Oh, I forgot to mention that you should backup your existing file and test this on a non-production site.
Attachment Size
uc_authorizenet.module.zip 3.42 KB

* reply

permalinkWed, 07/04/2007 - 17:14
Ryan

Posts: 1671
Joined: 09/26/2006
AdministratorCode Monkey Head - I eat bugs.

Awesome! Glad to have the help for sure. I'll try and check this out tomorrow, though my list of "try and check this out"s is growing larger and larger. Thanks for posting it back, and have yourself a badge. Eye-wink

Posts: 26
Joined: 10/17/2007

You may want to also check out the PFP recurring for the payflow pro contrib module.

Posts: 60
Joined: 09/07/2007
Bug Finder

Thanks - that looks like a great option (and great timing!)

I installed the module and it looks like several tables where not created:

# user warning: Table 'drupal.uc_payflowpro_recurring_products' doesn't exist
# user warning: Table 'drupal.uc_payflowpro_recurring_schedules' doesn't exist

I saw here (http://www.ubercart.org/forum/development/1462/payflow_pro_full_integrat... that you're going to release a patch soon, so I'll keep my eyes out for that. I'd be happy to help test it out. Smiling

I'd also be curious to hear any of your reasoning for going with Payflow over other gateways for a recurring product application. I am fairly new to payment gateways, but have noticed that Payflow, Authorize.net, Linkpoint, and several others all offer recurring payment API's. Is there any particular reason you chose Payflow?

Thanks,
Xerxes

Posts: 992
Joined: 08/14/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.

Would love to see recurring payments go into UC myself. I think it would be best (if at all possible) to make a solution based maybe on CRON (and a subscriptions table) that could be made gateway-independent. We don't use PFP (We use Authorize) so the PFP won't work for us at this time.

Definitely willing to help test it if /when it gets offered in Ubercart!

--

"Pain don't hurt." - Dalton

Mike Nelson's RiffTrax! www.rifftrax.com

Posts: 78
Joined: 08/09/2007
Bug Finder

My vote is for the automatic creation of an order based on a previous order that has expired products. The order would be created, invoice emailed to customer and they would be able to login, see the order and also submit payment using gateway of choice from the user/*/order/* screen.

--

Biodiesel * (ubercart + drupal) = Sundays Energy

Posts: 26
Joined: 10/17/2007

WMK,

That's the approach I went with for the PFP recurring.
1. Setup avail "schedules" on the admin screen.
2. Link certain "schedules" to certain "products/models" through the admin screen.

User Experience
1. Add a product to your shopping cart.
2. Add checkout there is another box/pane that has listed the items in your cart that can be "renewed". The user checks the items they want renewed, and the number of terms they want renewed.

At checkout, the item is purchased as a regular sale item, and a recurring profile (on the PFP side) is setup for the remaining n-1 payments.

I like this loose coupling of recurring items. A user is really just saying "Hey, could you just purchase this same item X times at Y intervals?".
This them also seperates the logic of what happends when a certain "item" is purchased.

Posts: 3898
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

I have plans to centralize some of this through the core payment and product features APIs, no word on a release yet for that.

Also, just want to second the fact that install files are missing or inefficient, as I'm getting the same table not found errors.

Posts: 60
Joined: 09/07/2007
Bug Finder

I would certainly love to see this centralized in core. Having looked very briefly at Authorize.net, PFP, and Linkpoint recurring API's, it does seem that they are similar enough that it would make sense to put the business logic in core and the specific gateway calls in their individual modules.

I haven't been able to test souvent's PFP module yet, but the basic logic of it sounds good to me. I would like to see some way to disable the user's options about the renewable product though. For example, in the cart and at checkout the user could be told for the recurring product "You will be billed once a month until you cancel" and not be able to choose how many times it will renew. In my mind these are "recurring" as opposed to "renewable". Perhaps this exists in the PFP module already...

It would also be great to have some events generated by the recurring payments that our custom modules can use. For example:

-Recurring payment received
-Recurring payment failed (error code)
-Credit card expiring in < 1 month

Some of this may need to be done in cron, since I'm not sure what the payment gateways will push out to us for each recurring payment.

Finally, I think we would want to have some hooks for canceling and updating recurring payments (i.e., raising or lowering prices).

I hope these thoughts are helpful!

Best,
Xerxes

Posts: 3
Joined: 11/14/2007

Hi xerbutter,

I am looking for a similar module for my Drupal site and I am wondering if you have been able to make it work?

Any help, tips or ideas are highly appreciated!

Posts: 1
Joined: 11/15/2007

I have a question about the ubercart with recurring payments (payflow pro). Specifically costs???

What will it cost to use this solution?
Paypal website says:
250 setup fee, 60 dollars/month for Payflow
40 setup fee, 30 dollars/month for recurring payments.
Then, I need a merchant account who will take another 2-3% per transaction.

Are those numbers correct? Are there any cheaper solutions out there?

Thanks!

Posts: 60
Joined: 09/07/2007
Bug Finder

Hi cardsup,

I haven't done anything on this just yet. I think that Ryan is working on putting support for recurring payments into core and the developer of the Payflow module may be improving that module. I still have a little time before I need this, so I figured I'd wait to see those rather than head in off my own direction. (Though I would certainly be happy to help them, if there's anything I can do).

Sorry that I'm not more help yet...

Posts: 60
Joined: 09/07/2007
Bug Finder

dwag71,

Yes, I think those prices are correct, except that above 1,000 transaction per month you'd also owe $0.10 per transaction to Payflow.

You might look into Authorize.net and Linkpoint. I don't haven exact pricing, but I do remember reading that they were less expensive that Payflow. They both have recurring payment support, though neither has been integrated with Ubercart yet, as far as I know. There was an Authorize.net recurring module at some point, but I'm not sure what happened to it.

Please let me know what you find out. When recurring payments are integrated into core, I'd be up for trying to help update the most cost effective payment module for recurring payments.

Best,
Xerxes

Posts: 78
Joined: 08/09/2007
Bug Finder

Expect to see an update to http://www.ubercart.org/contrib/81
We are working on an update that will create a new order with the expiring products from a previous order. It will also be able to re-process the credit card as if the user created the order.

--

Biodiesel * (ubercart + drupal) = Sundays Energy

Posts: 26
Joined: 10/17/2007

Hello. I released an update to the uc_payflowpro module. It has recurring architectured into it in a manner that I think is much better than a "recurring" product. I just released an update to the module today, complete with a "Account Panel" under /user for the user to control their recurring subscription.

Instead of a "product" being recurring; during checkout, items that have been enabled as having the option to be renwed are shown in a separate checkout pane with a checkbox, and a drop down of the number of times that one would like the item renwed for the "terms" that have been specified by the administrator (months, years, etc.).

The order is processed as a normal order. However, a recurring profile is setup on PFP, and when their next payment date comes around, if the payment is successful, the EXACT same order is created with the recurring product selected, and it is processed behind the scenes.

Thus the recurring system is a separate system that just re-purchases a product by doing another order instead of having a product try and keep "state" of its recurring status. This is MUCH easier to deal with, easier, ans safer ( from a programming stand point ).

I'd like to hear thoughts and feed back on this approach.

Posts: 3898
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Earnest, I think it may still be missing an appropriate install file. I've been trying to get a very loose product feature in core that folks can use to attach recurring fees to products, though it may be best for Payflow Pro to ride along as an individual solution... seems to have quite a robust API to handle them already.

I'm still trying to weigh the merits of a system like you're using against one that just continues to enter payments for the original order for my default recurring fee handler (for use w/ the credit module). It seems your way could confuse product/order reports by showing each membership purchase say 12 times in a year, whereas my way would cause order balances to go into the negatives pretty fast. I've considered letting charges be made that don't get logged to the payment receipts table and makes a note in the order comments every time payment is collected, but then we've got no way to report revenue. Too many choices.. Puzzled

Posts: 48
Joined: 12/05/2007

I'm new to Ubercart and have several questions and comments to post regarding alpha8. I' think I'll start with this topic of recurring subscription payments ...

Whether it's core or contributed, I intend to use a Paypal and credit card solution. I have the contributed Payflow Pro module installed but haven't fiddled with it yet to see what it's capable of. There have been some other Ubercart errors with our Postgres installation that we've been chasing in the meantime. Anyhow, to get to the point, I like the idea of a membership being a product but in my case the site I'm building has two memberships: 1) Free Membership and 2) Uber Membership (seriously). I'm currently using Role Signup and Nodeprofile for user registration. What I'm not quite certain about is how to best integrate the Uber Membership purchase as a recurring subscription product and the Free Membership registration as a non-product (since $0 products doesn't appear to be supported. If anyone has any ideas, I would very much appreciate any expect advice.

Posts: 60
Joined: 09/07/2007
Bug Finder

Hi Ryan and Earnest,

I've been wrestling with these issues too. I haven't made much progress yet, but here are some reactions, in case they are helpful:

1) Users and administrators should easily be able to see their "monthly bill" (or whatever time period). If I order a monthly subscription as a user, I'd expect to be able to see each in my order history to make sure i'm being billed the right amount at the right time.

2) Administrators should be able to easily track subscription metrics like # of subscribers, gross adds, net adds, and churn.

3) If a subscription payment fails, it should be possible to automatically notify the user and/or admin, and also cancel or pause subscription benefits. (seems like a good use of Workflow-ng)

Best,
Xerxes

Posts: 26
Joined: 10/17/2007

Hmm....bad install file still? K, i'll check the .install file. that's strange.

As far as the accounting question goes. I dont' think it would be a problem. The actual transactions wouldn't be entered until the specified date (assuming we're doing Cash accounting and not Accrual accounting).
Say it was a monthly membership renewal, with my system, the person gets "setup" in the PFP to be "renewed" each month. So if it starts in Jan, and you pull a report in June, the reciepts table woudln't show payments in Sep., just the ones the person made up until June.
The system is just re-purchasing the same order, and the order is created on the fly. Order's are not "pre-placed" into the system for later processing....if that makes sense.

Posts: 26
Joined: 10/17/2007

Ryan,

Yeah, there was a space in the globals "$_GLOBALS" instead of "$GLOBALS".
Anyway, version .81 should be good now. Lemme know. How did the EDI check go?

- Earnest

Posts: 46
Joined: 10/02/2007
Bug FinderGetting busy with the Ubercode.

I just posted the first release of a module for handling products as subscriptions. This module provides an administrator and user interface for managing subscriptions, as well as the beginnings of a system for automatic renewals (recurring payments). Please give it a try and let me know how it works for you:

http://www.ubercart.org/contrib/2851