Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated documentation.

Converted README to Markdown format.
Changed default Rake task to spec.
  • Loading branch information...
commit c8b9005ac3b4937d43d7f51716e2222ae50539af 1 parent c0be796
@tylerhunt tylerhunt authored
Showing with 90 additions and 85 deletions.
  1. +1 −1  LICENSE
  2. +0 −79 README
  3. +84 −0 README.markdown
  4. +5 −5 Rakefile
View
2  LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2007-2008 Tyler Hunt
+Copyright (c) 2007-2009 Tyler Hunt
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
View
79 README
@@ -1,79 +0,0 @@
-Remit
-=====
-
-This API provides access to the Amazon Flexible Payment Service (FPS). After
-trying to get the SOAP version of the API written, I began working on this REST
-version to provide a cohesive means of access to all of the functionality of
-the FPS without having to get dirty dealing with SOAP requests.
-
-I hope you enjoy using it as much as I've enjoyed writing it. I'm interested to
-hear what sort of uses you find for it. If you find any bugs, let me know (or
-better yet, submit a patch).
-
-Setup
-------
-Requires a config file located at #{RAILS_ROOT}/config/amazon_fps.yml. Use the following format.
-
- development:
- access_key: <your sandbox access key>
- secret_access_key: <your sandbox secret access key>
- return_base: <your development return url>
- endpoint: 'https://fps.sandbox.amazonaws.com/'
- pipeline: 'https://authorize.payments-sandbox.amazon.com/cobranded-ui/actions/start'
- sandbox: true
- version: '2007-01-08'
-
- test:
- access_key: <your sandbox access key>
- secret_access_key: <your sandbox secret access key>
- return_base: <your development return url>
- endpoint: 'https://fps.sandbox.amazonaws.com/'
- pipeline: 'https://authorize.payments-sandbox.amazon.com/cobranded-ui/actions/start'
- sandbox: true
- version: '2007-01-08'
-
- production:
- access_key: <your real access key>
- secret_access_key: <your real secret access key>
- return_base: <your production return url>
- version: '2007-01-08'
- endpoint: 'https://fps.amazonaws.com/'
- pipeline: 'https://authorize.payments.amazon.com/cobranded-ui/actions/start'
- sandbox: false
-
-
-
-Users
------
-
-The following sites are using Remit:
-
- * http://www.storenvy.com/
- * http://www.obsidianportal.com/
-
-
-Sandbox
--------
-Amazon provides a testing environment for the FPS called a sandbox. You may
-(and should) use the sandbox while testing your application. It can be enabled
-by passing a value of true to the last argument of the API constructor.
-
-
-Example
--------
-The following example shows how to load up the API, initialize the service, and
-make a simple call to get the tokens stored on the account:
-
- require 'remit'
-
- ACCESS_KEY = '<your AWS access key>'
- SECRET_KEY = '<your AWS secret key>'
-
- # connect using the API's sandbox mode
- remit = Remit::API.new(ACCESS_KEY, SECRET_KEY, true)
-
- response = remit.get_tokens
- puts response.tokens.first.token_id
-
-
-Copyright (c) 2007-2008 Tyler Hunt, released under the MIT license
View
84 README.markdown
@@ -0,0 +1,84 @@
+Remit
+=====
+
+This API provides access to the Amazon Flexible Payment Service (FPS). After
+trying to get the SOAP version of the API written, I began working on this REST
+version to provide a cohesive means of access to all of the functionality of
+the FPS without having to get dirty dealing with SOAP requests.
+
+I hope you enjoy using it as much as I've enjoyed writing it. I'm interested to
+hear what sort of uses you find for it. If you find any bugs, let me know (or
+better yet, submit a patch).
+
+
+Sandbox
+-------
+
+Amazon provides a testing environment for the FPS called a sandbox. You may
+(and should) use the sandbox while testing your application. It can be enabled
+by passing a value of true to the last argument of the API constructor.
+
+
+Getting Started
+---------------
+
+The following example shows how to load up the API, initialize the service, and
+make a simple call to get the tokens stored on the account:
+
+ gem 'remit'
+ require 'remit'
+
+ ACCESS_KEY = '<your AWS access key>'
+ SECRET_KEY = '<your AWS secret key>'
+
+ # connect using the API's sandbox mode
+ remit = Remit::API.new(ACCESS_KEY, SECRET_KEY, true)
+
+ response = remit.get_tokens
+ puts response.tokens.first.token_id
+
+
+Using with Rails
+----------------
+
+To use Remit in a Rails application, you must first specify a dependency on the
+Remit gem in your config/environment.rb file:
+
+ config.gem 'remit', :version => '~> 0.0.1'
+
+Then you should create an initializer to configure your Amazon keys. Create the
+file config/initializers/remit.rb with the following contents:
+
+ config_file = File.join(root, 'config', 'remit.yml')
+ config = YAML.load_file(config_file)[RAILS_ENV].symbolize_keys
+
+ access_key = config[:access_key]
+ secret_key = config[:secret_key]
+ sandbox = !Rails.env.production?
+
+ REMIT = Remit::API.new(access_key, secret_key, sandbox)
+
+Then create the YAML file config/remit.yml:
+
+ development: &sandbox
+ access_key: <your sandbox access key>
+ secret_key: <your sandbox secret key>
+
+ test:
+ <<: *sandbox
+
+ production:
+ access_key: <your access key>
+ secret_key: <your secret key>
+
+
+Sites Using Remit
+-----------------
+
+The following production sites are currently using Remit:
+
+ * http://www.storenvy.com/
+ * http://www.obsidianportal.com/
+
+
+Copyright (c) 2007-2009 Tyler Hunt, released under the MIT license
View
10 Rakefile
@@ -4,8 +4,8 @@ require 'rake/gempackagetask'
require 'rake/rdoctask'
require 'spec/rake/spectask'
-desc 'Default: package gem.'
-task :default => :gem
+desc 'Default: run specs.'
+task :default => :spec
spec = Gem::Specification.new do |spec|
spec.name = 'remit'
@@ -20,7 +20,7 @@ spec = Gem::Specification.new do |spec|
spec.require_path = 'lib'
spec.test_files = FileList['{spec}/**/{*spec.rb,*helper.rb}'].to_a
spec.has_rdoc = true
- spec.extra_rdoc_files = ['README', 'LICENSE']
+ spec.extra_rdoc_files = ['README.markdown', 'LICENSE']
spec.add_dependency('relax', '>= 0.0.5')
end
@@ -30,9 +30,9 @@ end
Rake::RDocTask.new do |rdoc|
rdoc.title = 'Remit Documentation'
- rdoc.main = 'README'
+ rdoc.main = 'README.markdown'
rdoc.rdoc_dir = 'rdoc'
- rdoc.rdoc_files.include('README', 'LICENSE', 'lib/**/*.rb')
+ rdoc.rdoc_files.include('README.markdown', 'LICENSE', 'lib/**/*.rb')
rdoc.options << '--inline-source'
rdoc.options << '--line-numbers'
end
Please sign in to comment.
Something went wrong with that request. Please try again.