Web application developmers and consultants
Electric Function, Inc. develops and operates web applications for online businesses (with a few side-projects picked up along the way). This is the blogging home of Brock Ferguson, Lead Developer.
Membership Website Software PHP Billing Platform Build membership websites with ExpressionEngine Compare Food Nutritional Values Business Web App Dashboard

How to keep query strings from breaking your site’s default page in CodeIgniter  Aug 28

CodeIgniter’s out-of-the-box handling of query strings leaves a bit to be desired.  There are a few quirks noted in forums and bug reports that suggest that CodeIgniter was never meant to power sites that pass or receive data via the common method of query strings (i.e., those little ?name=value appendages in URL’s).

However, one of the biggest issues with query strings + CodeIgniter is that, by default on many setups of CodeIgniter, adding a query string to the URL of your default page (e.g., example.com or yoursite.com) will throw a 404 error.  Essentially, CodeIgniter thinks that the query string is specifying a controller file which obviously doesn’t exist.  I found this out – like others – when Google was adding “?gclid=random_id_number” to my AdWords referral URL’s and thus every clickthrough was seeing a 404 Error instead of my site’s homepage.

I have fixed this problem.  And, in doing so, I’ve also eliminated many of the quirks of query strings in CodeIgniter.  Want to implement these fixes in your setup?  It’s easy.  Instructions and files are below.

Note #1: This how-to will work with both CodeIgniter 1.x and CodeIgniter 2.x but keep in mind folder locations as they differ for these versions.

Note #2: These likely only work on Apache servers but I haven’t tested elsewhere.

Step 1: Modify the URI Library

We need to stop CodeIgniter from thinking the query string is a controller while also retaining the query string for use later when retrieving $_GET data with $this->input->get().  This URI library extension will do both of these things.  First, it strips the query string out of the URL so that CodeIgniter doesn’t get confused.  Second, it stores the query string in a defined PHP variable for our use later, when retrieving $_GET data.

Download the extended URI library.

For CodeIgniter 1.x, upload as application/libraries/MY_URI.php.

For CodeIgniter 2.x, upload as app/core/MY_URI.php.

Step 2: Modify the Input Library

In step 1, we eliminated the query strings from the stored URL so that CodeIgniter wouldn’t confuse them as controller names.  However, in doing so, we also broke the ability to extract $_GET data with $this->input->get().  So, this modified input library will use the constant we defined in step 1 to retrieve $_GET data via the Input library.

Download the extended Input library.

For CodeIgniter 1.x, upload as application/libraries/MY_Input.php.

For CodeIgniter 2.x, upload as app/core/MY_Input.php.

Success!

Your pages won’t break and you can now access $_GET data easily via CodeIgniter’s standard methods.  Enjoy!

End of Development Life: Membrr for EE1.6.x  Aug 24

Membrr has, since launch, been available for both Membrr EE2 and EE1.6.x.  However, with Membrr’s growing popularity and feature requests rolling in from all directions, I have chosen to cease active development of Membrr for EE1.6.x except for bug fixes and minor tweaks.  This means that, going forward, Membrr for EE2.x will have a faster turnaround for new features and bugfixes.

Membrr for EE1.6.x will continue to be supported in the OpenGateway support forums.

Membrr for EE2.1 lives on stronger than ever!  If you are looking for the easiest and most powerful subscription/membership website solution for ExpressionEngine, check out Membrr today.

Hiring: CodeIgniter PHP Developer  Aug 18

Electric Function, Inc. is hiring a skilled CodeIgniter PHP developer to lead new internal web app development projects as well as – in the future – working on client consulting jobs.

For more information, please check out the posting here:

http://electricfunction.theresumator.com/apply/ars2H1/

Release: Membrr 1.11 for ExpressionEngine 2.1 and 1.6.8  Aug 17

Coinciding with today’s major update to OpenGateway is a major update to Membrr.  Here’s what the update brings:

Update Credit Card Details linked to a Subscription

Taking advantage of OpenGateway’s new UpdateCreditCard API call, your Membrr control panel now has an option to update the credit card details for an ongoing, active subscription.  Furthermore, you can build your own customer-facing billing information update form with the new {exp:membrr:update_form} template tag.

Offline Payment

Use the new Offline payment gateway in OpenGateway to record offline payments in OpenGateway.  You can select the gateway to use at checkout in the {exp:membrr:order_form} template tag or in your Membrr settings in your ExpressionEngine control panel.

Invoicing with FreshBooks

Do you want your subscribers to receive invoices for their subscription and manually pay them online?  Or do you just want a more advanced method of receiving offline payments (whether your customers receive the invoices or not)?  If so, this new payment gateway supported by OpenGateway + Membrr is for you.  Connect OpenGateway with FreshBooks via a new FreshBooks payment gateway to have online invoicing and manual online or offline payments.

Sound good to you? Membrr is the best system for subscription payments, membership websites, and paid channel or weblog postings in ExpressionEngine.  Click here to purchase and download Membrr.  Already a licensee?  Download this free update from your Licensees area.

Release: OpenGateway v1.5.1 – Offline Payment Support, Invoicing with FreshBooks, Subscription Updating  Aug 17

I am happy to announce the release of a major update to the OpenGateway billing platform, version 1.5.1.  OpenGateway is a billing server and API built for developers to integrate into their web sites and applications.  It provides a variety of features that make traditionally difficult things like recurring billing and records management very easy across a variety of payment gateways.

This new release brings some major new features to the platform that have been requested since its release:

Offline Payment Support
OpenGateway was originally built to facilitate credit card payments across multiple gateways.  However, since its launch, it has become apparent that not all users want to use it like that.  Since launch, we’ve added PayPal Express Checkout support (where users leave your site to complete payment).  Now, finally, we’ve added Offline payment support!By creating an “Offline” gateway in Settings > Gateways, you are able to use OpenGateway as a records keeping application.  This is useful if you take cheques, money orders, or bank transfers.  You want the user’s payment to be with the rest of your records but you don’t require a credit card processing gateway.

The Offline gateway also makes an easy way to test OpenGateway without signing up for a merchant account or developer account with a traditional payment processor.

Online Invoicing with FreshBooks
The offline payment gateway described above works for some.  It’s a simple way to track payments with OpenGateway.  However, some people requested an invoicing system for OpenGateway.  This was never in OpenGateway’s future – until today!

By harnessing the power of FreshBooks, we give you the ability to create invoices and receive payments via other methods.  FreshBooks has been integrated just like any other payment gateway and can be setup at Settings > Gateways.  If you use this gateway, all of your customer records will be inserted and maintained in your FreshBooks account.  Furthermore, all your charges will appear as invoices in FreshBooks, linked to these customer records.  Then, you can mark the invoices as paid or offer manual online payment when you send out the invoice to your customers.

This is a beautiful alternative to rapid autorecurring billing with credit cards and perfect for companies who have large subscription fees, receive offline payments, want to offer manual online payments, or who already use FreshBooks!

Update Credit Card Info Related to a Subscription
Previously, if a user received a new credit card or wanted to change their card expiry date, they would have to cancel and re-subscribe to the subscription (or you would have to perform some fancy API trickery).  Now, there’s a simple API method (UpdateCreditCard) and control panel interface for updating the credit card linked to a subscription.

Date Formatting in Email Triggers
You can now customize the format of date variables that are sent out in automated system emails.  For example, if you want to tell the person the date that they will next be charged but don’t want an ugly system date in the email, you can use: “[[NEXT_CHARGE_DATE|"M d, Y"]].  That second parameter in the variable specifies the format of the date.  You can specify any date format using either of PHP’s date() and strftime() formatting styles.

Click here to purchase and download OpenGateway!  Licensees: This upgrade is available form the Licensees area and upgrading is as easy as uploading all the new files over the old ones.

Updating a form’s “action” attribute with jQuery  Jun 24

If you are trying to modify the “action” attribute of a form dynamically with jQuery, beware this little gem:

While calling $(‘form#yourform’).attr(‘action’) successfully retrieves the current action of the form, you must set the action with $(‘form#yourform’).attr(‘ACTION’,'http://www.example.com/newformaction’).

So, as I found out, this will not work:

$(document).ready(function () {
$(‘input.action’).click(function () {
var form_url = $(‘#base_url’).html() + ’store/product_actions’;
$(‘form#dataset_form’).attr(“action”,form_url);
});
});

This will work:

$(document).ready(function () {
$(‘input.action’).click(function () {
var form_url = $(‘#base_url’).html() + ’store/product_actions’;
$(‘form#dataset_form’).attr(“ACTION”,form_url);
});
});

jQuery is usually pretty programmer-friendly.  This: not so much.

Version 1.4.8: Foreign character support in OpenGateway  May 31

If you were having troubles with foreign characters (accents, etc.) in OpenGateway, the latest release – version 1.4.8 – supports these.  Also included in this release is an updated PHP library which automatically encodes values properly for their XML transmission.  Licensees can download from the OpenGateway licenseee area.

Membrr for ExpressionEngine released!  May 26

Another week – another release!  Electric Function, Inc. is announcing the release of Membrr for ExpressionEngine.

Here’s what Membrr brings to your ExpressionEngine install:

  • Subscription billing
  • Membership website features (members-only content, subscribers-only membergroups)
  • Payment via Authorize.net, PayPal Standard, PayPal Pro, E-xact, Pacnet, SagePay, and Wirecard (more gateways are always being added)
  • A complete billing API for total control over your subscription billing

Membrr costs just $145 and does not include any monthly fees or transaction fees.  Build membership websites with ExpressionEngine.

Integrating the Wirecard payment gateway with OpenGateway  May 18

Wirecard AG (based in Germany) provide credit card processing solutions for companies around the world.   They offer very competitive rates and a full-featured gateway with recurring billing, refunds, and one-time charges (of course).

The OpenGateway billing engine makes integrating Wirecard payments into your website as a snap.  If you are an OpenGateway licensee (download the software for $95 for a lifetime license), all you need to know to accept payments on your website with OpenGateway is:

  • Your API username
  • Your API password
  • Your Business Case Signature
  • Your API URL

You will enter this data in the Setup Gateway screen at Settings > Gateways > Setup New Gateway.   OpenGateway will handle all currency, client, customer, and transactional information automatically.  To begin processing transactions, you can manually enter them in the OpenGateway control panel or integrate OpenGateway into your website with the OpenGateway API Documentation.  You don’t need to worry about autorecurring billing, customer records, or even open the Wirecard API manual.  OpenGateway will handle it all for you.

The argument against SaaS, part 2 (featuring ZenDesk)  May 18

ZenDesk is a new but popular knowledgebase and support ticket software that operates in the cloud as a Software-as-a-Service (SaaS) application.  Business owners pay a monthly fee to have access to the application.  Monthly fees are usually acceptable because they can actually be more predictable than operating your own software when you never know when a bug fix or upgrade is necessary and you may have to pay development fees.  However, last night, ZenDesk emailed all of their customers (myself included) and told them that their monthly fee is going to go up – significantly.  And what can their clients do about it?  Not much.  All of their data is in the system and lots of time has been used in configuring their helpdesks.  Here’s some responses on their blog:

From Charles:

We currently have 41 agents and would have been up to 50 by mid-June. Not anymore.

Our monthly bill is going to increase from $1503 to $2419. That is an annual increase of approx $11,000. A roughly %62 increase.

One MAJOR factor in choosing Zendesk over an on-premises application was cost. With these massive cost increases, Zendesk is no longer the prefered choice when you look at ROI and TCO.

We strongly object to these price increases and urge Zendesk to reconsider before we are forced to move elsewhere.

From David:

I tweeted #zendesk and found mentions of alternatives..this is a real pain,  your right Rob, we are in a recession trying to grow our business.. I guess unless there is some sort of backdown or a commitment to honour existing clients price points, we’ll be growing our business without zendesk… My wife is sitting next to me and commented that all of a sudden I look really stressed..Damn right I do, we have invested a lot of time and energy in getting zendesk to work with our business and they spring this on us… awful,, really awful

From Jamie:

It’s quite a neat business plan:

  1. Aim to attract 5000 customers paying reasonable fees, they spread the word…
  2. Hit the 5000 customers mark.
  3. Valuation of company = X.
  4. Increase charges by 60-300%
  5. Valuation of company = 3X
  6. Sell, sell, sell.

When pricing changes like this come without a hint of warning, it makes you really reconsider letting someone else host your software “as a service”.  I’m a light user of Zendesk and I’ll stay simply because my data is already in there.  However, with some users now paying $2500 per month, you have to wonder:  Why not download your own helpdesk software (e.g., Kayako) or build your own?