google4r/checkout is a library to access the Google Checkout API.
google4r itself is distributed under an MIT style license.
However, the library includes the cacert.pem file from the Mozilla project. This file is distributed under the MPL.
Gems are hosted on rubygems.org (aka Gemcutter), so on reasonably recent versions of Rubygems, you should be able to install just like this:
gem install google4r-checkout
Or, go to our page on rubygems.org.
Our issue tracker and wiki can be found on Google Code. The best way to let us know about bugs or feature requests is to report an issue there.
We've got RDoc documentation for the google4r-checkout library generated on rdoc.info.
You can find more information on the Google Checkout API here. Note that the API documentation assumes an understanding of the Google Checkout XML API.
You have to place a file called 'frontend_configuration.rb' in the directory'test' with the configuration for the Google4R::Checkout::Frontend class to use for running the tests.
The file should contain content similar to:
# Uncomment the following line if you are using Google Checkout in Great Britain
# and adjust it if you want to test google4r-checkout against any other (future)
# Google Checkout service.
# Money.default_currency = 'GBP'
# The test configuration for the Google4R::Checkout::Frontend class.
FRONTEND_CONFIGURATION =
{
:merchant_id => '<your merchant id>',
:merchant_key => '<your merchant key>',
:use_sandbox => true
}
The unit tests use Mocha so you have to install the gem "mocha" to run the tests. You will also need the money gem library.
rake rails:freeze:gems
only works for the Rails gems. So, how do you freeze your own gems like google4r? It turns out to be pretty straightforward:
cd RAILS_ROOT
cd vendor
gem unpack google4r-checkout
ls
# ... google4r-checkout-0.1.1 ...
Then, open RAILS_ROOT/config/environment.rb in your favourite text editor and add the following lines at the top of the file just below require File.join(File.dirname(FILE), 'boot')
:
# Freeze non-Rails gem.
Dir.glob(File.join(RAILS_ROOT, 'vendor', '*', 'lib')) do |path|
$LOAD_PATH << path
end
Now you can use the following in your own code:
require 'google4r/checkout'