Showing posts with label web design. Show all posts
Showing posts with label web design. Show all posts

Wednesday, July 8, 2009

How to Survive Authorize.Net Outages

I was inspired to write this by the recent heavily reported Authorize.net outage. Credit card processing is one aspect of web site development that you have no choice but to out-source (unless you happen to be a bank). There are several out there, and Authorize.net is one of the biggest. No matter how robust the system is, there are bound to be periodic problems. Over nine years of business, and multiple processors, we saw many of them. Some outages were over in minutes, some lasted hours. Your customers, ready to make a purchase, don't want to hear that your credit card processor is having problems. It is possible to code your website to stay in business during an outage.

At RegionalHelpWanted.com (RHW), we were doing tens of thousands of dollars a day in credit card sales of help wanted advertising, none of which we wanted to lose during an outage by the processor. In the US, our credit card processor was Authorize.net. In Canada, it was Verisign. (We used separate services because we ran the businesses as separate companies.)

On Cupid.com, the problem was similar: we were selling online dating subscriptions; I think our processor was iPay.

In both cases, we were selling electronic services, but the method we used to survive a payment gateway outage with minimum business interruption is applicable to online businesses that are shipping tangible goods.

On your website, your customer should not receive any kind of error message saying that there is a problem with the payment system. The customer does not care about your problems, even if you are not to blame.

When Authorize.net is down, typically your web application will time out when trying to connect to them to make a sale. In a minority of cases, the connection will not time out but will give an invalid response, one that does not fit the normal specification. I don't remember any cases where a processor outage occurred and the processor sent back a valid response with a valid error code like "We're down! Try agin later!" In all of these cases, your web application should behave the same way:

- Capture the order information, and store it for later processing.
- Give the customer a success message
- Use an asynchronous process to retry these transaction until they are completed.

Capture the order information
On RHW, we let users opt-in to storing their credit card information to speed future orders, so we had already done the work necessary to do this safely and securely. On Cupid.com, the whole business was built on reoccurring billing, so same deal there. Your Terms of Use must allow you to always retain order information for enough time to process that order, even if the user does not opt in to longer information retention. While your at it, log any response that you did get from the payment gateway, scrubbed of any security sensitive info like credit card number, as it might help with forensics later.

Give the customer a success message
Error messages are the opposite of user friendly. Tell the customer that you have the order information, that it typically only takes a moment to process and that they will receive an email its done. And then let them be on their way.

On Cupid.com, we'd let the user start using the site with all the privileges of a paying member. If they sent any messages to other members, those messages would be queued until their order was successful.

On RHW, we would post the help wanted advertising. If it later turned out that the credit card was rejected, the ad would be removed. But this also could have been setup so that the ad was not posted until the credit card was accepted.

Process the transactions asynchronously
Queuing is a great way to handle any work that the user should not have to wait around for. You could use it just when there is a connection timeout or for every single transaction.

Cupid.com was a .net application, so it made sense to use Microsoft Message Queqing (MSMQ) for this functionality. The web application writes a message containing the order ID. A queue runner reads the queue, using the order ID to select the order and payment info from the database. It attempts to process the order. If Auth.net times out or returns an unexpected response, the message is sent to back of the queue. It is trivial to build a time delay into the queue runner, otherwise you may find yourself making hundreds of attempts per minute for the same transaction. And it's not nice to kick your credit card processor THAT often when they are down.

RHW was a ColdFusion application, and now it is very easy to do queuing in ColdFusuion too. Our need pre-existed this functionality, so we used MSMQ. We wrote the queue runner in VisualBasic, and the connection to Authorize.net was done as a CF web service.

Once the payment is either accepted or rejected, do make sure you follow up with the customer. On RHW, if a card was declined after waiting in the queue because of a gateway outage, we would call the customer and try to receive alternate payment before we removed their posting.

The queue runner needs to also delete the payment info unless the customer authorized retaining it.

That's it. Once we had that coding in place, Authorize.net outages (or Verisign or iPay) were non-events to the development team. There was some alerting built in so that we'd know if the queue was building up, otherwise we might not even know that Auth.net was down. That is, until the accounting department came over and complained that they couldn't log into the payment gateway.

Wednesday, March 25, 2009

Audible.com Web Site is Lousy (To Be Polite)

My wife was surprised this week when I told her Audible.com has been charging her $14.95 every month for almost a year. She checked into it and realized she had signed up for a monthly subscription without even know it. That's a problem right there. Before closing the account, she wanted to redeem six book credits her account had accumulated. We decided to divide them evenly.

When it was my turn to select books, I was expecting an experience similar to Amazon.com. First of all, the Audible.com web site is very slow. Not snappy like Amazon.com, or any other website I use by choice for that matter. Seconds lagged each time I clicked a link.

Secondly, the category navigation is not very intuitive.

Thirdly, it looks like the site is quite different depending on if you are signed in or not. The site is more appealing when they are trying to lure you into registration, and frankly it's faster too. Tolerably fast. Audible.com offers fewer categories, perhaps to remove clutter and reduce load times.

Once you log in, its the slow site. Clicking on "Science Fiction & Fantasy" now and you can feel the delay before the page loads. You get to a page that displays, among other sub-categories for fantasy etc:

# Sci-Fi: Classic (217)
# Sci-Fi: Contemporary (555)

That is not a great number of titles. It gets more frustrating after clicking around twenty pages or so, the amount it took me to figure out "Contemporary" means anything since 1980. There is no way to browse with multiple filters, for example all "contemporary" sci-fi that was also on the New York Times best sellers list. The closest thing Audible.com offers is all 555 titles, sorted by how often they are sold on Audible.com.

I clicked on that link, got frustrated at how long the page was taking to load and was able to type "I'm composing this" before the page loaded.

Suffice it to say, Audible.com: now that Amazon.com has entered the audio book market place, you web site needs a huge overhaul to be competitive:

1) Speed. The competition is a click away.
2) Breadth of content: I understand sci-fi may be your weak area, but if you don't have what I want for all my audio book needs, I'll go elsewhere.
3) Navigation. Browsing a book store is easy and pleasurable. You're website needs to be even easier. Let me go to sci-fi, and then narrow down to New York Times best sellers. Then let me sort by newest first. By letting me narrow in, and showing me what path I am on, you would let me feel like I am getting closer to the perfect purchase. Otherwise I'm lost in the woods, and leave.

Thursday, February 7, 2008

Google for Error Messages

I'm a total geek -- if you are, you may, like me, find this page completely hillarious: http://extension.usu.edu/?q=error

I stumbled upon that while exploring the problem of displaying error messages. To often people forget to turn of debug output in their production environments, revealing *way* too much to the public about their innards.

So, take the default error message for the code of your choice, and Google it. Find a lot of sites at their worst, if Googlebot happened to be spidering them then.

Saturday, January 26, 2008

Huppahs.com launched

My sister Maria and I launched her web site this week (on her birthday, in fact). It's very basic php and for now the only method of payment is thru PayPal -- kudos to Maria for that idea and for coding hooks for their cart.

The final version will be fully LAMP. My friend/employee Jeremy Price is hosting for us on his Linux box. Apache (duh), pHp 5 and mySQL on its way, after we get the credit card processor account set up.

So check out Huppahs.com, even if you not currently planning a Jewish wedding.

Tuesday, November 20, 2007

The Aesthetics of Hex Rounding

~~ In which I coin a phrase, "hex rounding," as applied to color selection for the web ~~

A web project underway is for a Floridian audience, and needs to have a local feel. In choosing a color palette, the obvious first choice is "orange." But you can't use the Orange and Blue of the University of Florida fans w/ offending Seminole sensibilities. Similar issue for Orange Green of University of Miami. Can't use Miami Dolphins colors either. Note: I lived in Orlando for seven years, and graduated from UCF.

I was inspired by rainbow sherbet: the orange and green from that, plus a very light yellow, seemed Floridian to me. Please don't argue that with me, blogoshpere; I know its subjective, it's not the point of this blog, just the setup.

Working with a very talented web designer, we google-imaged "rainbow sherbet" and got enough results to color sample a few. Dropping them into the page layout and tweaking for readability netted the following palette:

orange #FB9E03 (251,158,3)
green #B7DF40 (183,223,64)
yellow #FEFF95 (254,255,149)



I have no training in color theory, but I grok the basics of color families. Color families can be colors that have the same hue, in different saturations. Or different tints. Whatever, you change some values but keep others the same and you'll get colors that "go well together." In computers, these colors are expressed in numbers that share similarities. In hex, base 8. Math aesthetics, you see?

And I remember my days of teaching "web design" back in ~1996, before CSS, when we had to worry about "web safe colors". Web safe colors were in the 256 color "Windows palette" of 8 bit graphics. Web safe octets were 00,33,66,99,CC, and FF. In decimal, that is 0, 51, 102, 153, 204, and 255. So the first round of my "hex rounding" netted:

orange #FF9900 (255,153,0)
green #B7DF00 (183,223,51)
yellow #FFFF99 (255,255,153)

So my orange and yellow were now "web safe", and the last octet of my green was "safe". But I'm not really caring about web safe these days. I'm just using it as the most convenient direction to push them, mathematically, into the same color family.

I like working in http://www.colourlovers.com for web palettes, only because it is easy to share successful results with remote people. And this is color picking, not just math. But COLOURlovers doesnt let you input RGB, only hex. I imagine they think people are mostly clicking and dragging around the color picker.

I continue to work on the green. 183 is between my 153 and 204. I test pushing it all the way to 204, and the color works for me. Somewhat lighter. RGB = colors of light, so bigger numbers = "more lights on" and (no pun here, thats where the word comes from:) lighter color.

223 I push to 255 but now my color is yucky bright lime. Lets add blue: from hex 00 go to 33, still yuck, 66, 99 oops too far. I'm now at pistachio ice cream and I'm still aiming for lime sherbet so lets split the difference. Translating to decimal, I need a number between 102 and 153. 127.5 splits the difference. 7F. Check it, yes that works.

orange #FF9900 (255, 153, 0)
green #CCFF7F (204, 255, 127)
yellow #FFFF99 (255, 255, 153)

And here is my palette, hex rounded. Not necessarily better, just mathematically based. Sorta:

Wednesday, November 7, 2007

Loving Ubuntu 7.10

When my sister asked me to help her with a web site in April, I took the opportunity to expand my professional skills by developing it in LAMP: Linux, Apache, MySQL, and pHp. I'd dabbled with Cygwin when I knew shell scripting was best suited to the task at hand, but that was the extent of my open source skills.

So I took a laptop that was past its prime -- the network card only worked intermittently, and the graphics capability meager -- and installed Ubuntu Feisty on it. It's worked pretty well, and I've been able to muddle through the learning curve to get the project underway.

I'm an update-aholic, so when Ubuntu 7.10 "Gutsy Gibbon" was released, I was edgy and feisty (lol) to get it. There were several kinks: first attempt failed because duh! I ran out of battery power. Second attempt: my network card went on vacation again. Sigh.

I tried the Live CD, then got back on track with the Alternate version. Luckily plenty of other computers around to allow for sneaker-netting.

The Apache upgrade was another hiccup: I had to re-configure pHp and chmod permissions.

I brought it into work and one of my IT guys wrestled with the wireless NIC to get that on our office network. I never could get that done under Feisty. But now I can easily roam, connecting to my home or office network without intervention whenever I'm in range.

But I confess: I love Ubuntu 7.10 for the eye candy. Transparent terminal. Clearlooks, Darklooks depending on mood. Transparent panels top and bottom. I'm a sucker for transparency, it seems.

Friday, August 31, 2007

New code? Bah.

I found myself telling one of my developers yesterday "We've been doing this for years now. If you find yourself coding anything from scratch, you're probably doing something wrong."

In that vain, props to the War of Stuff blog for the code necessary to add Digg, del.icio.us, reddit onto my blog.