Declare Tax, Shipping, and Handling Costs with Active Merchant + PayPal

I didn't see this documented anywhere but with Active Merchant + PayPal Website Payments Pro or Express, a breakdown of the order total can be specified.

gateway = ActiveMerchant::Billing::PaypalCaGateway.new(options) gateway.purchase(8475, credit_card, { :subtotal => 7500, :shipping => 0, :handling => 0, :tax => 975 })

Subtotal, shipping, handling, and tax values must all be there and they must all add up to the order total ($84.75 in this example). View the relevant code at Github

Ruby on Rails. October 09, 2011 - 04:46AM. 0 Comments

Keystone Image jQuery Plugin v0.0.1

The Pixel Perfect Firefox extension has not been working correctly for the past several Firefox releases for me. I've been looking for a suitable replacement and the closest is WebDeveloper Image Overlay for Chrome. Neither is in active development, as far as I can tell, and they have enough minor inconveniences that I created a custom solution.

Refinements

Problem: Chrome plugin cannot use images from local file system directly
Solution: Drag and drop the image into the web browser

Problem: click several times into the UI to toggle image overlay on/off
Solution: Press a key to instantly toggle

Problem: image overlay obscures webpage elements from right-click -> "Inspect Element"
Solution: Fixed via CSS (thanks ntoniazzi)

Problem: UI for fine tuning image overlay position is through mouse clicks
Solution: keyboard shortcuts to move image overlay

Downsides to my solution as it is now:

  • must add to every website project manually (though only a few lines)
  • auto saves image for later use but only the latest one per domain
  • possible key binding conflicts (though keys are easily changeable)
  • no file open dialog box, only drag/drop support
  • only works in the new versions of Firefox and Chrome (maybe eventually in Safari 6 and IE10?)

This is a barebones plugin made for my own needs. It's only 130 lines of basic javascript with nothing esoteric other than using HTML5 features. Easily patchable/forkable. Please take a look at the project hosted at Github.

Javascript Web. August 22, 2011 - 03:41AM. 0 Comments

Instantaneous CSS Updates Directly From Source Files with LiveReload

For the past month or so, I've been trying out Guard + LiveReload on a Rails project. So far I've found it to help tremendously with Pixel Perfect when matching the look specified in PSDs. It is quite seamless - to enable it amounts to running `guard` in the command line inside the project rails directory and clicking on the LR icon in the corner of the Firefox window.

Follow the installation instructions for these gems:
Guard
Guard::LiveReload

If you're like me and prefer to use Firebug, grab the Firefox extension instead of installing the LiveReload Safari/Chrome extension.

Ruby on Rails Web. July 13, 2011 - 04:05AM. 0 Comments

Search Engine Analytics and Webmaster Tools

The free website tool I use the most is Google Analytics because of its comprehensive stats. It provided answers for these recent questions I had:

  • Where is traffic generating from (search engine or more word of mouth)?
  • Which pages are popular and should influence the website's raison d'ĂȘtre? Conversely, which pages are under-performing and need a revised strategy?
  • Are users upgrading their web browsers such that I can drop IE6 support and/or start using HTML5 features?
  • Are there enough smartphone users visiting the site that warrants building a mobile website version?
  • Where are people going to when they abandon shopping carts?
  • After a major change such as a promotion, new site feature, or a link from a major website, how did users respond? Increase in traffic, stayed longer on the site, additional sales?
  • How is the website doing compared to last year?

You might not have a pressing need to look at stats but it is a good idea to at least verify that search engines are correctly indexing your website. With these tools, setup is quick, simple, and non-intrusive. They'll even explain the errors spiders encountered when crawling your site so you can fix them promptly.

Ruby on Rails Web. June 25, 2011 - 12:04AM. 0 Comments

Beats for Change: Japan Fundraiser

A few people I am working with are involved in a project to raise funds for those in need after the March 11th 9.0 earthquake. They've made a music album available with proceeds going to the Red Cross Japanese Earthquake/Tsunami Response. Already starting to receive attention but let's all do what we can to help.

Misc. March 23, 2011 - 07:44AM. 0 Comments