12

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.

A4J
  • 879
  • 10
  • 24

3 Answers3

17

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.

jnevelson
  • 2,092
  • 2
  • 21
  • 31
  • Thanks for the reply Jonathan. I had a quick chat with @fnando earlier (author of paypal_recurring gem) and he gave me some tips on handling failed cards - it's too big to paste here but happy to email you if you want to take a look (@astonj on twitter) but basically if the ipn.type is equal to "recurring_payment_failed" then you can just handle that by firing off an email or flagging it up on their account. Thanks again for the help! – A4J Mar 17 '12 at 03:27
  • I would very much appreciate it if you could email that to me! My email is listed in my profile. Thanks! – jnevelson Mar 17 '12 at 04:50
  • Thanks for sharing your answer, do you have an idea how to use encryption with Paypal-recurring gem ? I know about the cmd and encrypted options when using encrypted orders and paypal certificate, but, I don't know how to do it with Paypal-recurring, can you help me please ? – simo Oct 25 '12 at 04:26
  • HTTPS encrypts the entire request, so that should be all you need. There's nothing specific to `paypal-recurring` that needs to be done - just make sure you're serving out HTTPS requests. – jnevelson Oct 25 '12 at 23:05
  • It's `recurring_payment_profile_canceled`, not cancel. Available variables can be found here: https://developer.paypal.com/webapps/developer/docs/classic/ipn/integration-guide/IPNandPDTVariables/ – shredding Nov 20 '13 at 17:02
  • @A4J can you please post via gist please. As I terribly need to look at the solution. Have tried multiple things that doesn't really work. Thanks – Jackie Chan Jan 07 '14 at 05:25
  • @JackieChan I ended up not using it, as there was no easy way for people to to change to a different plan (has to be cancelled then a new one created). Unfortunately I no longer have the conversation with Fnando anywhere - sorry. – A4J Jan 11 '14 at 22:11
  • Hi there, I know this is an old post, but, if someone reads this, are these the only `txn_types` I should be aware? is there one for `not enough funds`? – Johhan Santana Sep 25 '15 at 15:28
3

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.

Brad Mace
  • 27,194
  • 17
  • 102
  • 148
kobaltz
  • 6,980
  • 1
  • 35
  • 52
0

The SaaS Kit is now tested with Rails 3.2.2. :) It doesn't support IPN yet, but it's on to the todo list. With all the info here in one spot, I suppose I have no excuse not to get it done. :)

Benjamin Curtis
  • 1,570
  • 12
  • 13
  • Thanks Benjamin - I might email you some questions if that's ok? (PS you need to update the features tab as it still says Rails 3.1.1) – A4J Mar 27 '12 at 02:31