Thursday, December 06, 2007

IATS and CiviCRM

Update, Nov 2009: I've just discovered and fixed a bug I introduced in the 2.2 branch for the IATS plugin. The bug was introduced when i updated the API files from IATS and failed to notice that the legacy method for C$ one-time donations was no longer supported.
If you're using a version greater than or equal to 2.2.7, and are using IATS for C$, non-recurring donations, then you're affected.
To fix it edit the file : CRM/Core/Payment/IATS.php, and remove the line that looks like this:


$canDollar = ($params['currencyID'] == 'CAD');  //define currency type
The full fix removes a conditional branch based on that value a little further on, but by removing this line, it'll never actually use that branch. Drop me a line if you have any questions.

Update, May 2009: This post is still getting quite a bit of traffic, which is great. Here are a few important things to note:
  1. The IATS plugin code is in CiviCRM, you don't need to add any code.
  2. You do still need to add it to the database [i think this will change soon], following the instructions below under "Install"
  3. It should work for Joomla as well, as per: http://forum.civicrm.org/index.php/topic,8032.msg35035.html#msg35035 but the urls in the install section are different.

I'm happy to report that I've taken up an abandoned project from a year ago and just finished it. Thanks to Heritage Toronto who hired Anarres Worker Co-op and Paul Newby and myself to give them a new site

My project consists of writing a 'payment processor plug-in' that allows CiviCRM websites run by non-profits to accept donation/payment/memberships using IATS.

The reason this is interesting is because:

  1. CiviCRM is a great 'CRM' (client relationship management) piece of software designed for non-profits.
  2. IATS is the best alternative for non-profits in Canada who need a transaction processor (i.e. anyone who wants to accept money on-line).
  3. There wasn't any way to use them together.

So .. the rest of this post is aimed at any of you out there who want to try it. I'm going to provide a link to my code + instructions. Note that this is ONLY for CiviCRM versions since 1.7, since the payment plug-in structure changed at that point, and I've only tested it on 1.8 and 1.9.

Code


Here's a zipped tarball, with: CRM/Core/Payment/IATS.php CRM/Contribute/Payment/IATS.php packages/Services/IATS/iatslink.php packages/Services/IATS/creditcard.php packages/Services/IATS/iats_reoccur.php just put it in your civicrm installation root and do a tar -xvzf iats.tgz
This is now updated code as of Feb 26 to fix the previous issue with extra spaces. It also has support for US$ and recurring donations.

Install

In order to test the code, you need to:
  1. Add a new payment processor type from this path (for Drupal): /civicrm/admin/paymentProcessorType?reset=1 or for Joomla: /administrator/index2.php?option=com_civicrm&task=civicrm/admin/paymentProcessorType&action=add&reset=1 As far as I know, this isn't documented.
    • Use "IATS" for Title and Name
    • Billing Mode is 1
    • "Payment_IATS" is the PHP class name
    • use "Agent Code" for the Signature Label
    • put in "https://www.iats.ticketmaster.com" for both of the live URLs
    • put in "http://www.iats.ticketmaster.com" for both of the test URLs
    • it does support recurring donations (but see below)
  2. Add a new payment processor to your site: For Drupal: /civicrm/admin/paymentProcessor?reset=1 [Check your documentation for Joomla, it'll be different]. This is better documented but I'll make it easier for you:
    • Put IATS for your Name
    • For your live payments, you can put in your Agent Code and Password, or use the test one of "TEST88" (user and pass)
    • For your tests, use the test one ... you keep the urls you put in as defaults earlier.
  3. And now add the paypage, I'll let you figure that one out.

And that's all. Please don't try this on a production server, I'm not providing any guarantees. I have tested it on CiviCRM 1.8 and 1.9, it should work on 2.

Update Feb 26 I've added in some code for US$ and recurring donations. The only problem with recurring donations is that IATS doesn't accept all the options that CiviCRM assumes it will, so you have to create a custom template to restrict this. Please RTFM to see how this is done - the file you want is: CRM/Contribute/Form/Contribution/Main.tpl

Wednesday, September 26, 2007

Ontario Election Sites: Technology =~ Politics?

I'm hosting the Ontario Green Party's site, and am also the Drupal developer for it. There's currently an Ontario election campaign taking place, so I'm keeping busy. Someone sent me a dead link on the Ontario NDP site, so I started looking at the other party's sites. It reminded me of a discussion we had at the Toronto Penguin day a couple of years ago about the relationship between open source software (and Drupal in particular) and politics. I think there's something there - for example:

  1. the Toronto Drupal Users' Group's (supposed?) left-leaning politics
  2. the Howard Dean campaign (which was the beginning of the civicspace distribution of drupal)
  3. Richard Stallman's involvement in Venezuela

I'll let you use google to confirm or deny any of the above ...but also to be noted, there's nothing that prevents any cause from making use of open source technology for nefarious and/or right-wing causes (oops, my bias is showing!).

So, I thought I'd survey what kind of technology the four parties are using and see about correlations:

  1. Liberal: Using ASP (a microsoft proprietary technology), probably a custom application judging from the urls. Hosted using Microsoft-IIS/6.0 on a machine with a bluecho.com reverse lookup - BluEcho looks like it was just bought by EntirelyDigital (http://w3.entirelydigital.com/). They seem to be located on Bloor St. here in Toronto. Using a .ca domain.
  2. Conservative Also uses ASP (but not .aspx like the Liberal party), also a custom application, also on Microsoft-IIS/6.0. No comment regarding policies... But on a magma.ca server (an Ottawa-based company, has offices in Toronto), and on a .com domain (what does that say?)
  3. NDP Using Drupal, but still using 4.7 (last full update was only 4.7.3, I hope they've installed the security patches since then!). The domain resolves to an ip with no reverse lookup, so I'm not sure who they're hosting with. Their mail is using megamailservers.com, which is a mass hosting private label company for mail. Unfortunately, the secure domain which handles their donations was broken (no response) a couple of days ago, and now gives various errors (e.g. they registered the certificate to the wrong domain...). Conclusion: I think they need some technical help, but the ideals are good. Definitely: upgrade to Drupal 5. Did they choose a .com domain because it used to be cheaper? Trying to increase mass appeal?
  4. Green Party Using Drupal 5, hosted on a virtual server out in Kelowna (rackforce.com) with good green credentials, running CentOS (open source version of RedHat Enterprise Linux). Too bad they also host Windows. I had the advantage that I started the site from scratch, no baggage to carry.

Leaving conclusions for the reader to draw. Don't get carried away.

Friday, April 20, 2007

drupal, engagement, mailing lists, email

I lived, worked and studied in Costa Rica from 1984 to 1989. Ostensibly, I was there to study Mathematics at the University, and indeed I graduated with an MSc. in Mathematics supervised by Ricardo Estrada (check that page, he even advertises me as one of his past students). And yes, I do have a nine page thesis that I wrote and defended in Spanish somewhere in my files, on a proof and extension of one of Ramanujan's theories.

But mathematics is a pretty lonely endeavour, and what drew me back to Central America (after the first visit, which was more of an accident), was the life and politics. The time I lived there was extremely interesting (for me as an outsider, though also painful and tragic for it's inhabitants) because of the various wars that were largely fuelled by US regional hegemonic interests (of the usual corporate suspects and individuals) and neglect (of the politicians and public) - the Contra war in Nicaragua, the full-scale guerrilla wars in El Salvador and Guatemala, and the low-intensity type conflicts everywhere else. My engagement was through the Friends Peace Centre, which was started and sponsored by Quakers, with whom I still nominally identify. In fact, if you visit that site, you can see there's an associated 'Ridgway House', which I helped renovate. I've got a picture somewhere of me and the Costa Rican I worked with (who actually knew what he was doing), I'll have to add it to this post.

But the original point of this post is that organizations have existed to help educate, publicize and mobilize around important issues for a long time, and (though it's easy to forget) well before computers, the Internet and the world wide web were even imagined. And I believe that technology is at its best when it enables us to do better the good things we're already doing. Activities that are created as result of technology (e.g., web development, system administration) are not inherently valuable, however fun they sometimes are, except to the degree that they provide tools for activities that provide value that exists outside their own constructed reality.

So, when thinking about Drupal, mailing lists and engaging constituencies as I am now doing with my civicrm.ca project, pbi canada, PS Kensington, the telecentre directory, ah, hmm, I guess with pretty much all my web development projects, ... it's essential to start by remembering the real purpose of all this, and ask the question - "why?" and "what are we trying to achieve". I remember that starting about 10 years ago there was a whole body of discussion adopted from the commericial world about "eyeballs" and "stickyness" (laughable in retrospect) which focussed on technology and resulted in giving the internet a bad name as a resource for social change.

Fortunately, things have settled down a lot, and web technologies no longer have to be such a waste of time (they still can be, of course). And that comes down to my plug - I've just started a Drupal project called OG2MLM, which, despite it's obscure name, has some good potential. I should start by crediting the good folks at openconcept.ca (Steve and Martin were the main developers), who have brought the project this far, and Mike Gifford who I originally met through activism at PERC and so who comes to this work with a solid perspective beyond the technology.

The goal of the project is to glue together a standard mailing list engine called SYMPA, and Drupal's Organic Groups. The reason this matters is because it enables people to do what they've now been doing for a while (mailing list discussions) and to use that to enhance the existing content (both private and/or public) to enhance the content on the web.

Okay, back to work...

Saturday, April 14, 2007

Peace Brigades International

For about 8 years, I worked with Peace Brigades International. You can still find some of my writings from those days by doing a google search (actually, there are 4 pages of links there and I think they're all me). I was recently approached by PBI in Canada to help with their website which had been hacked some time ago, so I've just done that and you can see the nice results here. Does this seem like a shameless plug? Kind of, but it's also an example of how tools have evolved so much that if you know what you're doing, you can get a nice website up with surprisingly little work. This one uses Drupal of course, and when you visit it you'll see just how much time the office is putting into keeping the content up to date, which is what really matters anyway.

Monday, April 09, 2007

Drupal Camp Toronto, version 2.


Looks like there will be another Drupal camp again this year in Toronto - visit the drupalcamptoronto site for details.
While I'm at it, here's a short update on a few of my projects:
  1. I finished the intranet portion of SHARE's website, which included a neat custom module that mashes up the signup module with CiviCRM and organic groups.
  2. I'm almost finished with The Tyee, an excellent alternative on-line news source in Vancouver. My work with them began with a module, still to be released, that integrates bricolage and drupal. That work went live in January and shortly after we migrated the site to a new server at Gossamer Threads who I can't recommend too highly. My latest task has been to finish off a module that allows for comment rating, it should be live by mid-April.
  3. I developed a custom Drupal module Peek which allows a drupal site user to provide sneek peeks to content on a drupal site that is otherwise protected.
  4. I mashed up gmaps and Civicrm as part of my work on the telecentre directory project. It's a little custom module (aha, also soon to be published ...) that generates google maps based on Civicrm groups.
  5. I registered the domain civicrm.ca and am using it for some small demonstration projects. I'm imagining it as a home for a group of developers in Canada that work with Civicrm, but it's a slow process....
  6. I'm looking forward to another round of development on the working overseas website that I built a few years ago.
I could go on, but I just did ...