# Self managed recurring billing

**URL:** <https://www.ruby-forum.com/t/self-managed-recurring-billing/88231>\
**Category:** Rails\
**Created:** [March 9, 2007, 1:46am UTC](https://www.ruby-forum.com/t/self-managed-recurring-billing/88231 "2007-03-09T01:46:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonlog](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/db5fbb/32.png) [@jonlog](https://www.ruby-forum.com/u/jonlog)\
**Post date:** [March 9, 2007, 1:46am UTC](https://www.ruby-forum.com/t/self-managed-recurring-billing/88231/1 "2007-03-09T01:46:40Z")

</div>

I’m working on setting up the credit card processing part of a rails app  
for my company and running into some issues. I’m currently working  
with the ActiveMerchant plugin and connecting to our account at  
[Authorize.net](http://Authorize.net). Everything’s been relatively easy to setup, until I got  
to the recurring billing part. The problems I’m finding are…

A. ActiveMerchant doesn’t appear (yet?) to support [Authorize.net](http://Authorize.net)’s _new_  
Automatic Recurring Billing (ARB) API.

B. ARB doesn’t appear to directly notify our application about what  
charges failed or succeeded, instead sending a daily email that a  
person would have to read and then manually go take appropriate actions  
on user accounts, which completely surprises me. I wrote a recurring  
billing interface to Paypal in Perl over two years ago, and this was a  
standard part of the interface for them all the way back then.

C. ARB doesn’t allow the kind of control we need for deciding when and  
how much to charge people. ARB wants us to setup a schedule to charge  
card X Y times at Z frequency. However, our system would be a little  
more akin to allowing users to use a card already on file for future  
purchases without having to re-enter the card. The amounts and  
frequencies are going to change a lot. We don’t want to store the card  
info on our sever, but would rather store in on the gateway and just  
send them a key referencing the previously used card and tell them to,  
“charge that one again for this new amount, and respond with the  
status.”

Has anybody else run into any of these issues, and if so, how did you  
deal with it. We’re not married to ActiveMerchant or [Authorize.net](http://Authorize.net), so  
if there are alternatives to either/both that would allow the kind of  
control we need, I’d love to hear about them.

To summarize, we need to charge irregular amounts at irregular intervals  
to a specific card keyed to a specific customer _without_ storing the  
credit card info on our server _or_ requiring the customer to re-enter  
their card info every time, and find out immediately (_not_ via email)  
if the charge succeeded or failed. Pipe dream?

---

<div class="post-metadata">

**Author:** ![jonlog](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/db5fbb/32.png) [@jonlog](https://www.ruby-forum.com/u/jonlog)\
**Post date:** [May 30, 2007, 7:02pm UTC](https://www.ruby-forum.com/t/self-managed-recurring-billing/88231/2 "2007-05-30T19:02:30Z")

</div>

I’m working on the same thing right now. Has anyone integrated the  
Automatic Recurring Billing into their rails application? Is there an  
easy way to do it?

---

<div class="post-metadata">

**Author:** ![jonlog](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/db5fbb/32.png) [@jonlog](https://www.ruby-forum.com/u/jonlog)\
**Post date:** [May 30, 2007, 7:20pm UTC](https://www.ruby-forum.com/t/self-managed-recurring-billing/88231/3 "2007-05-30T19:20:02Z")

</div>

On 5/30/07, Joe P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’m working on the same thing right now. Has anyone integrated the  
> Automatic Recurring Billing into their rails application? Is there an  
> easy way to do it?

Joe,

I wrote a ruby library for interacting with the recurring billing API  
for TrustCommerce ([www.trustcommerce.com](http://www.trustcommerce.com)). You could write one for  
the ARB API. It’s really not that hard. Take a look at  
[http://trustcommerce.rubyforge.org](http://trustcommerce.rubyforge.org) for the code. Maybe you can use it  
as a template for building an ARB one…

–  
Zack C.  
[http://depixelate.com](http://depixelate.com)

---

<div class="post-metadata">

**Author:** ![jonlog](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/db5fbb/32.png) [@jonlog](https://www.ruby-forum.com/u/jonlog)\
**Post date:** [May 31, 2007, 3:35pm UTC](https://www.ruby-forum.com/t/self-managed-recurring-billing/88231/4 "2007-05-31T15:35:30Z")

</div>

I’m fine with the customer being billed on, say, the first of the month  
each month. I just want to have the ability to update the subscription  
or cancel it, and I think I can do that with Automatic Recurring Billing  
from [Authorize.net](http://Authorize.net). They provide some Ruby samples, so hopefully I can  
work off of that.

If anyone has experience using ARB from [Authorize.net](http://Authorize.net) please post here.

---

<div class="post-metadata">

**Author:** ![jonlog](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/db5fbb/32.png) [@jonlog](https://www.ruby-forum.com/u/jonlog)\
**Post date:** [May 31, 2007, 4:31pm UTC](https://www.ruby-forum.com/t/self-managed-recurring-billing/88231/5 "2007-05-31T16:31:24Z")

</div>

On 5/31/07, Joe P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’m fine with the customer being billed on, say, the first of the month  
> each month. I just want to have the ability to update the subscription  
> or cancel it, and I think I can do that with Automatic Recurring Billing  
> from [Authorize.net](http://Authorize.net). They provide some Ruby samples, so hopefully I can  
> work off of that.
> 
> If anyone has experience using ARB from [Authorize.net](http://Authorize.net) please post here.

I wrote about my experiences with using Paypal Payflow for Lighthouse:  
[http://activereload.net/2007/5/17/dealing-with-subscription-payments](http://activereload.net/2007/5/17/dealing-with-subscription-payments)

Those basic subscription services are fine, except there’s no way to  
tell when a payment fails. You just have to watch the emails and  
close accounts manually, or write something to parse the returned  
emails. I’d love it if they had something similar to Paypal IPN.

–  
Rick O.  
[http://lighthouseapp.com](http://lighthouseapp.com)  
[http://weblog.techno-weenie.net](http://weblog.techno-weenie.net)  
[http://mephistoblog.com](http://mephistoblog.com)

---

<div class="post-metadata">

**Author:** ![jonlog](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/db5fbb/32.png) [@jonlog](https://www.ruby-forum.com/u/jonlog)\
**Post date:** [May 30, 2007, 11:56pm UTC](https://www.ruby-forum.com/t/self-managed-recurring-billing/88231/6 "2007-05-30T23:56:31Z")

</div>

Jon G. wrote:

> To summarize, we need to charge irregular amounts at irregular intervals  
> to a specific card keyed to a specific customer _without_ storing the  
> credit card info on our server _or_ requiring the customer to re-enter  
> their card info every time, and find out immediately (_not_ via email)  
> if the charge succeeded or failed. Pipe dream?

I worked with these issues about a month ago, only with PayPal Payflow  
Pro.

My conclusion was that the regular recurring billing wouldn’t work for  
my client, for reasons similar to yours.

However, Payflow Pro supports performing transactions by reference to a  
previous transaction. So we were able to accomplish our goal (at least  
in testing; the project isn’t live yet:-) by saving the transaction  
reference from the original transaction (i.e., the one made with the CC  
number etc.).

This way, we can do transactions for arbitrary amounts, at arbitrary  
times, without the original CC information.

–Al Evans
