Working with FoxyCart data feeds in CFML

On a couple of the sites I manage, I have employed FoxyCart to handle the shopping cart and e-commerce. It provides a simple integration into an existing site with very little fuss, and makes it easy to offload the business of running a webshop.

One of the features offered is to post back an XML data feed of each completed transaction, in real time, to your server. You may want this to maintain your own database of orders placed; in my case, it is used to handle MailChimp subscriptions if they ticked the appropriate box during checkout.

However, the encoding/encrypting of the data feed is somewhat arcane, and has taken me a couple of days, on and off, to get up and running in CFML. In fact, due to time constraints, I initially had to spin up a DigitalOcean droplet running PHP in order to handle the process until I could get it working in CFML. (There was a tried and tested PHP solution which I could get running in no time.)

This guide is to help any other poor souls in the future who have to wrestle with this...

SES URLs in Mura FW/1 plugins

The FW/1 plugin architecture for Mura CMS is a very powerful way of embedding complex applications and business logic within your Mura-based website.

However, this comes at the cost of your SES URLs. While Mura itself generates human- and search engine-friendly URLs, your embedded FW/1 app will only have this for the top level of any display object. As you drill down into the app, you will start getting URLs that look like this:

In this example, the FW/1 app is placed in Mura on the page /statistics/ as a plugin display object. In an ideal world (and how it would probably be if it were a standalone FW/1 site) your URL would be more like:

So, how can we achieve this?

30 September 2013
Mura URL Tools updated

A while back, after I submitted a code fix to Mura URL Tools, Greg Moser asked me if — since he is so busy with Slatwall — I’d be interested in taking over the maintenance and future development of URL Tools. I immediately said yes — then proceeded to do nothing for the next few months...

However, I have finally got my act together, and have been busy working on the plugin. I’ve been working through the issues list (including various pull requests and feature requests), and have brought it under a semblance of control. A few rapid release versions later, and the plugin has now progressed to version 2.8.

14 March 2012
RTFM carefully when applying CF hotfixes!

Here’s a quick tip for anyone who may be seeing some odd behaviour after applying a ColdFusion hotfix (as well as a reminder to myself to be more careful next time...).

I've just applied the latest security hotfix to my web server, and everything seemed to have worked fine - except that I suddenly started receiving a bunch of ColdFusion error notifications from a couple of my websites.

01 August 2011
How I Got Started In ColdFusion

As seems to be required now, here is my contribution to Steve Bryant’s How I Got Started In ColdFusion Day:

Having graduated from university in 1996 with a degree in Classics and – slightly more usefully – a reasonably popular Clint Eastwood fan site (”The Page With No Name”; I had a lot of spare time at uni…), I found myself an entry-level web monkey job at Future Publishing.

I started purely building the HTML pages; all the heavy lifting was done by a few techie guys, using Active Server Pages in VBScript (long before ASP .NET, so in what would now be called ASP Classic). We used various Microsoft technologies – anyone out there remember IE channels? (I think we may have been a launch partner for them…) Over the next few years I picked up bit of ASP here and there, and before long I was a techie guy myself.

22 April 2011
Server crash, possibly due to hacking attempt

This morning, I couldn’t reach my web server. Dead. Nothing.

I contacted my server company, who very quickly diagnosed that the server had blue-screened; they rebooted it and all is now well. Looking at my web logs, I think it was down for about an hour – not disastrous, but definitely inconvenient and not A Good Thing. (Note to self: set up a monitoring service so I know when it’s down!)

So I started looking at the system logs to see if I could find what caused it to crash. And there was a big clue, right in front of me.

21 April 2011
Deploy your website changes using Git

This is something I’ve been meaning to look at ever since a conversation I had at Scotch on the Rocks 2011. Many of us – even if we use the latest and greatest in source control – still use FTP to deploy our site changes to production. This causes several headaches, among them remembering which files have changed, and getting all those files deployed simultaneously.

After looking around the web, I have found several resources that helped me set up Git to deploy my site.

25 March 2011
Using CFTHREAD to speed up your web service calls

I’ve recently taken to using the excellent Postmark to send out all the transactional emails from my web sites. For just 0.15 cents per email, you get the benefits of increased deliverability and a great API to track and manage any undelivered mail.

If you like, you can send your emails simply by using Postmark’s SMTP servers – a really quick way to migrate to their system. But the real power comes when you start using their API. I’m not going to go into detail about how to set this up here, but in short you just have to send your message as a JSON object via HTTP Post.

And this is where threads come in. There are some web services you will use – for instance, payment gateways – where the returned result is critical to the continuation of the page request. But others – as well as Postmark, I also send API requests to MailChimp for mailing list subscriptions – where you really don’t need to know the outcome.

21 March 2011
Tip: Make sure your new IPs are clean

A cautionary tale for anyone running their own web server – something I’d never considered previously.

We’ve all been there – you’re setting up your web server, and request a bunch of IP addresses from your hosting provider. You then assign these IPs to your various web sites, and off you go…

But how many of you actually check the history of these IP addresses?

25 February 2011
Integrating Portcullis into FW/1 applications

If you need to protect your FW/1-based site against SQL injection and cross-site scripting (XSS) attacks – and you do! – you can do a lot worse than use John Mason’s Portcullis. It’s a single CFC which scans and sanitises your Form, URL and Cookie scopes, and optionally sets up a blacklist of repeatedly-offending IP addresses.

More Results: