Thursday, 23 February 2012

Working With The authorize.net Server Integration Method (SIM) Payment Gateway, Part 1: Don’t Use JavaScript

I got an email a few days ago from a reader seeking help with the authorize.net Server Integration Method (SIM) credit card payment gateway.

Specifically, he was asking how he could use JavaScript to pass a calculated total to a PHP page that contains the SIM code.

  • A customer chooses a series of options from some select lists, radio buttons and the like;
  • the page calculates an order total;
  • the end user hits a submit button;
  • the results are posted to the SIM processing page, which acts as a “confirmation page”; and
  • The customer presses another button, which takes him to authorize.net to provide payment info and actually charge the card.

You can see an approximation of what I’m talking about here: http://www.dougv.com/demo/js_form_values. The questioner’s form is similar to this approximation in function.

I will show how to properly customize a SIM form, and submit payment requests to authorize.net via SIM, in an upcoming post. This post explores why it’s a terrible idea to process order forms with JavaScript. That is, it’s about the wrong way to use SIM. Stay tuned for the right way.

Continue reading: Working With The authorize.net Server Integration Method (SIM) Payment Gateway, Part 1: Don’t Use JavaScript »

Saturday, 27 November 2010

Chrome Just Isn’t Up To Firefox’s Snuff

Three weeks ago I decided to give Google ChromeGoogle Chrome Logo a shot at replacing Mozilla Firefox as my primary browser. And believe me, it was a fair contest: I only called upon Firefox when I could not get Chrome to work.

Unfortunately, I had to call on Firefox at least once every other day. And while I still run across the occasional Web site that requires me to use Internet Explorer — mainly, Web sites that use some Microsoft technology, such as LiveMeeting or an ActiveX control of some sort — that’s maybe once or twice a month.

(And no, I have not given IE a chance to be my primary browser. When it truly embraces Web standards, then I will consider it. Internet Explorer is barely in the neighborhood of standards compliance right now, never mind on the same street. Safari? C’mon, man. Opera? Seriously, stop now, you’re embarrassing yourself.)

So I’ve made up my mind: Chrome gets sent back to the minors to work on its skills, and Firefox — older, fatter, slower, but far more dependable and experienced — is back as my ace starting pitcher.

Continue reading: Chrome Just Isn’t Up To Firefox’s Snuff »

Thursday, 10 June 2010

It’s All Chinese To Me: Reader Has Google Translate Built-In

I really like Google Reader; one of its great features is its recommendations. As long as you choose to “like” articles and media on a fairly consistent basis, Reader can do a very good job of finding new content and sources (provided, that is, they come from a Feedburner RSS feed).

Because Google expected me to have at least a modicum of Internet savvy — perhaps from the nature of the things I “like” and share — Reader occasionally sends along to me tweets written in Chinese.

A tweet written in Chinese

Google Reader suggests a tweet, but it's all Chinese to me. Note the "not interested" tick is checked. That's because I failed to RTFM.

According to Google Translate, the tweet above reads:

RT @ aiww: Ha, yes. RT @ luanmazi: Republic of the “unsung heroes” bei RT @ june197433: “China’s Internet status” throughout the White Paper did not mention GFW, Fang Bin-Xing Academy of Engineering uncomfortable it? Http://aa.cx/r85 @ aiww

That’s clear enough: China doesn’t mention, in its recent statement on the Internet, the school where China’s infamous firewall was developed.

As the “not interested” tick indicates, previously I had been marking these Chinese tweets to disappear, but I’ve been getting 2-3 per week, despite my attempt to indicate I can’t read Chinese. It’s time-consuming to copy and paste these tweets into Translate; I already waste enough time on Reader, Twitter and Facebook.

Which sent me on a quest to find a way to translate Reader posts inline.

Being a typical programmer, my initial thought was a $10 solution to a 50-cent problem: I could use the Reader and Translate APIs to do on-the-fly translations. That, however, was quickly dismissed as a gross impracticality.

I could find, or write, a Greasemonkey script to do the translation. I did find a Greasemonkey script that translates tweets on the Twitter Web page itself. I installed that and it works great, from a technical standpoint; but the Engrish it generates is, shall we say, rough.

A Twitter translation by Google: Wait, what?

A Twitter translation by Google, from Japanese to English: Wait, what?

So I was resigned to having to live with a choice between no translation or bad translations. Until I decided to STFW one more time, and found the solution: Google has already handled translation for me. As in, translation is just a button click away.

Google Reader translation option

Oh, you mean I should click *that* button. Why didn't you say so?

Proving, once again, it’s important to read the manual.

All links in this post on delicious: http://delicious.com/dougvdotcom/its-all-chinese-to-me-reader-has-google-translate-built-in