Closed (fixed)
Project:
Recurly
Version:
7.x-1.x-dev
Component:
Documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
28 Oct 2011 at 13:27 UTC
Updated:
20 Jun 2012 at 19:01 UTC
It need to be documented somewhere (here). That Recurly's 2.0 API does not work with the model in it most patched state.
The proper file to download is the 0.25 version found here https://github.com/recurly/recurly-client-php/tags.
Comments
Comment #1
blasthaus commentedadding a tidbit to this issue. it's kind of a separate matter but until this module gets a rewrite for the new Recurly API, there is some additional functionality that may be worth patching against the Recurly 0.25 api, namely the $subscription->reactivateSubscription which can be very helpful if you want to try and make it easy to bring back customers after they cancelled their subscription.
the patch files for this function are here, its basically the same as ->create() but $data is not necessary and there is '/reactivate' appended to the $uri
Comment #2
perignon commentedI first looked at Recurly as an option for payments in Commerce. Now I'm rethinking this heavily. Especially with the Card on File module that has been released and the recurring payment module recently going live as a project here on Drupal.org.
Recurly has a lot of nice features that I like. The cost and it's maturity is in question though.
Comment #3
sanguis commentedThank you for the pointer to Card on File it looks like it could be a solution for me as well
Comment #4
perignon commented@sanguis there is also this one as well https://drupal.org/project/commerce_recurring Which uses the card on file module! I will be investigating this one within the next week before the holidays.
Comment #5
blasthaus commentedFYI I've implemented a Recurly 'card on file' functionality so subscribers can update their card. This allows for only one card per subscriber to exist in a 'recurly billing' table. When they want to update their card on file, I'm calling Recurly to get the last 4 digits on the card, etc and pre-populating a form that submits to Recurly and upon success, updates the local values as well. This is enough for me.
One thing I wanted was a complete transparency with Recurly, so user's can update their subscription SKU, credit card and billing info, etc within Drupal. Then I'm using the user->uid as a token for all the notifications that Recurly sends out, like "click
<a href="http://www.example.com/user/{{uid}}/billing/edit ">here</a>to update your billing info".I can post this 'recurly_account' module somewhere if anyone's interested. It just extends the Recurly module to provide the above.
Comment #6
lakerguy commentedAny new developments with this?
Comment #7
stevebab commented@blasthaus -- I would be interested in seeing the 'card on file' work you've done.
Comment #8
blasthaus commentedI actually went ahead and pretty much rewrote the Recurly module to use version 2 of their API along with Drupal Commerce specifically to work for a client. It just keeps track of the last card used (last 4, etc) and allows subscribers to update their card number with a credit card form on the user profile. Assuming you already know about the Commerce cardonfile module which provides this functionality (but allows for multiple card data (last 4, etc) to be stored. I'll see if I can post some cleaned up, simplified version of my Recurly module as a few more people asked to see it by now and I just haven't found the time.
Comment #9
stevebab commentedThat would be very helpful. Thanks for pioneering the work on this.
Comment #10
perignon commented@blasthaus This is so very interesting. Even thought there is the card on file and commerce_recurring I am still very interested in Recurly cause they have some nice tools. Recurring billing is a bear of a problem that I would love to offload to a service that I can use that has a robust API like Recurly has been developing.
I would be very interested in helping you with this. Possibly look into applying for co-maintainer of this module as I don't think Ryan has the cycles or requirements to devote to this project - I spoke to him in person about it at a Drupal Camp in Atlanta.
Comment #11
lakerguy commentedI have done quite a bit of research on recurring revenue solutions for D7 and came to the conclusion that Recurly offers the most complete solution (dunning management, reporting, ease of use, customer engagement etc.) out there. If anyone is interested in forming a group to pay a developer to do it let me know.
Comment #12
okeedoak commented@blasthaus Any chance you could post your module, please?
Comment #13
blasthaus commentedi'm working on it this week (since yesterday). i have to strip a bunch of stuff out since it was a custom module with about 60 functions (and i was of course lazy :-) i'm trying to make it as 'generic' as possible. Still i'm unsure it will be usable for everyone as it was developed for a specific use case. Nevertheless it would be helpful to know what people want to do with it. For example, does everyone want to use Drupal Commerce? Does everyone want full transparency from Recurly? These are two major points that this module assumes. So I would like to get this in a sandbox this week and get feedback on what everyone thinks.
Here's some text from the README draft:
Overview
Admin
Limitations:
Once I set up the sandbox, let's just move the dialogue over there. I'll post here when it's set up
Comment #14
okeedoak commentedYes and yes!
The readme seems helpful and straight forward.
Thanks for contributing!
Comment #15
perignon commented@blasthaus Thank you very much for contributing. If you do start a sandbox let me know. I want to help!
Comment #16
BenK commentedI'm also highly interested in this and would love to help, too.
--Ben
Comment #17
blasthaus commentedthanks guys. i'm close to getting this ready. spent the better part of last week and this working on a serious release. i don't want to put something up until i make a few more adjustments. the stuff that tripped me up was dealing with the fact that I built in the option to buy as an anonymous user as well as the ability to pass in the user id into the recurly acct code. headaches abound. Drupal Commerce payment submit forms are out of scope of form API, so I had to create my own table to store form['state'] type of values (like recurly acct code, user email, etc). If you are interested, some of this frustration is documented here http://drupal.org/node/1512920
Note: the reason to pass in the user id to recurly is for the purposes of using this as a token for their Dunning management emails. i.e. to edit your subscription, change your billing click
<a href="http://www.yoursite.com/user/%accountcode">here</a>So as it stands everything seems to be working as it originally did for my client and I will take the next week to wrap up the testing. There are settings also that can enable you to subscribe users to start billing on the first day (actually first second) of each month with a pro-rated fee for the current month, rather than immediately, don't know if that's important but it was for my client. i think it's pretty cool feature.
In general this will need a lot of testing from the community to make it full proof. All of the payment gateway-type functionality has been done according to the DC standards out there, however since it is a subscription, we're obviously doing a lot more stuff. Additionally I've put in several hooks for things like building the recurly account code as well as theming templates for subscription and billing info, etc.. for subscription change it's a form which just gets all products in one select list, so it's better to override this in the supplied hook as well.
thanks everyone for the patience and interest, hang tight, we're almost there. i look fwd to getting this one out there, believe me!
Comment #18
lakerguy commentedSounds good, look forward to testing it.
Comment #19
blasthaus commentedOk so let's start with the rewrite of Recurly. http://drupal.org/sandbox/blasthaus/1534668
Warning: this is a module named recurly just like the current module. i.e. name collision in a big way can spell problems unless you know what you are doing, so it would be advisable to use a fresh install of Drupal to test this out. I just cloned it into a new Commerce Kickstart and its working as expected.
This version of the module requires v2 of the Recurly API, just download the latest one. It also works well with the CTools and jQuery plugin Datatables library. Download them as sites/all/libraries/recurly and sites/all/libraries/datatables
The actual Commerce Recurly stuff is coming next and builds off of this.
Comment #20
perignon commentedAwesome! I just subscribed to your sandbox. I'll clone the repo this week and start taking a look at it. This is pretty exciting and coming at a good time.
Comment #21
quicksketchAfter committing #1289192: Recurly API changes break authentication, this module now uses the latest API again, though it still needs lots of work.
@blasthaus: I'm taking look through your sandbox and pulling/porting the code back into this project. I don't think a dependency on Datatables is really necessary, but through some minor theming it should be easy to support (since you basically just need to add the JS to the page).
Comment #22
blasthaus commentedhey thats great! I have a new commit for the sandbox which I'll try and put up today. The main reason for Datatables was to just to be able pull in all the data on active subscribers and accounts into one view. With the commerce_recurly module (soon to be a sandbox as well), I am using the links as a pager, so we integrate that approach here as an alternative too. Look fwd to being in touch on this.
Comment #23
quicksketchGreat, thanks @blasthaus! I'm pulling code liberally from your sandbox back into the project but adapting quite a bit as I go. So far I've attempted to stick with the SDK's approaches rather than falling back to doing HTTP requests directly against the API, so our approaches are diverging a bit. Still the code has been most helpful and I hope we can get all our work merged back together. :)
Comment #24
blasthaus commented@quicksketch That's fine, you'll see in the new update, that I've fallen back to that approach after discovering how to do it via their API %-) There are really only two points that I truly need for commerce_recurly. The first is the pseudo 'hooks' in the function recurly_accounts_overview for the commerce_recurly_setup module, the second is this (new) function which eliminates the following functions: recurly_get_all_data, recurly_record_by_curl, recurly_data_by_curl, and recurly_xml_to_object
As for the recurly_settings_form, I can hook into that for the commerce_recurly stuff, so you can take it out. I'll try and get this up on the sandbox today.
@EDIT just to clarify, the reason for the function above is that we definitely need headers in the case of multiple pages of results (Recurly limits to 200 per call and will not automatically fetch all results except in the case of the
Recurly_PlanList::get();) . Additionally, with commerce stuff I need the full xml payload and statusCode a lot of times, and this is not possible via their SDK.