Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recurring billing with Rails - what are my options?

Before jumping in I'd like to know what all of my options are, and, if possible their pros and cons.

The two I know of are using ActiveMerchant, or the paypal_recurring gem, but will they satisfy these requirements?

  • Ability to accommodate monthly and annual billing
  • Ability to suspend, cancel accounts etc
  • Deal with out-of-date card details or failed payments

The to-do list for the paypal_recurring gem includes 'adding support for IPN' - how will not having this impact functionality?

I know there is the railskit SaaS but I'd rather code something myself as the railskit is still on 3.2.1.

I know there are services like cheddergedder/chargify etc, but do they tie you in? Are they US only? Are they worth considering - or are they usually just aimed at non-developers?

Thanks in advance.

like image 314
A4J Avatar asked Mar 16 '12 22:03

A4J


People also ask

What does turn on recurring billing mean?

When recurring billing is turned on for Microsoft 365, you'll be billed for your subscription on your renewal date. If you turn off recurring billing, your subscription will expire on the date shown and you won't be billed in the future.

How do I set up recurring billing?

Example of how to set up recurring paymentsSelect the customer you want to bill automatically. Select the product or service you want to bill them for on an ongoing basis. Choose a credit card as the payment method and enter the customer's payment details. Choose “make recurring” and enter a name for your template.

How do I stop recurring charges?

Even if you have not revoked your authorization with the company, you can stop an automatic payment from being charged to your account by giving your bank a "stop payment order" . This instructs your bank to stop allowing the company to take payments from your account.

What is a recurring membership?

Here's a simple recurring billing definition: it's a subscription. Or more precisely, the recurring billing definition is an ongoing payment on a periodic basis for a product or service. A subscriber will provide their credit card information to pay for the goods or services on a periodic basis.


2 Answers

I just finished going through this, so I'll try to shed some light on your options. I ended up using Paypal Express Checkout for all recurring purchases through Paypal. We had a custom-rolled recurring billing setup that charges a customer's credit card monthly through Authnet, but had to switch because we needed an international solution, and Paypal was one of the only ones that supported the currencies we needed, and wasn't entirely a nightmare to code.

You can use ActiveMerchant for recurring billing with this plugin, though keep in mind that it is not officially a part of ActiveMerchant, and therefore is subject to break if ActiveMerchant changes how it handles certain things. Because of that, I ended up using the paypal-recurring to handle communication through Paypal, and then rolled my own IPN parser, with help from Railscasts. Another link that helped me a lot was this, though all the :txn_type values ended up being different.

With regards to that last link, here are the 4 :txn_types that I specifically watch out for:

  1. express_checkout - first postback.
  2. recurring_payment_profile_created - sent on first postback when the user first subscribes.
  3. recurring_payment_profile_cancel - sent if user cancels subscription from Paypal's site.
  4. recurring_payment - Money has been transferred to your account. This is what I wait for before I renew their subscription on a monthly. This post also comes with payment_status, which needs to be completed.

The other stuff you mentioned, like handling failed payments and out-of-date cards, is handled through your Paypal account.

Just a word of warning - the only reason I ended up using Paypal is because it is universally recognized and trusted, and it accepted international currencies. There is an enormous amount of documentation on their site, and most of it is redundant, confusing, and entirely too long. My recommendation is to make sure you really want/need to deal with recurring payments, as they are difficult to implement correctly and can be more trouble than they're worth.

like image 128
jnevelson Avatar answered Sep 20 '22 04:09

jnevelson


I'm currently looking at Ryan Bates example of Stripe. They are a California based company that uses/offers the features you have listed.

www.stripe.com

They only charge when you receive money. I think that they are 3% plus $0.30 per successful transaction. Much better than some other companies that have a monthly minimum. Right now you have to have a bank in the USA to use their services as a merchant. However, anyone can use your site with out of the country credit cards.

like image 31
kobaltz Avatar answered Sep 20 '22 04:09

kobaltz