github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

tylerhunt / remit

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 83
    • 13
  • Source
  • Commits
  • Network (13)
  • Issues (0)
  • Downloads (2)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (2)
    • v0.0.4
    • v0.0.3
Sending Request…
Click here to lend your support to: remit and make a donation at www.pledgie.com ! Edit Pledgie Setup

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

An API for using the Amazon Flexible Payment Service (FPS). — Read more

  cancel

http://rubyforge.org/projects/remit/

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Regenerated gemspec for version 0.0.5 
tylerhunt (author)
Mon Jan 11 09:24:09 -0800 2010
commit  5361e35b4d0282756547e20868a16aa5ecd1ef69
tree    e375e161a88371ab2dc53f98e441d04ffe1e33d8
parent  bbf069084c1f7ffb2b2b2935c7e1ba4e25749ed2
remit /
name age
history
message
file .gitignore Mon Jan 11 09:09:38 -0800 2010 Cleaned up ignore list. [tylerhunt]
file CHANGELOG Mon Jan 11 09:15:49 -0800 2010 Updated changelog. [tylerhunt]
file LICENSE Tue Feb 03 11:14:54 -0800 2009 Updated documentation. Converted README to Mar... [tylerhunt]
file README.markdown Tue Feb 03 13:44:15 -0800 2009 Fixed another typo in the documentation. [tylerhunt]
file Rakefile Mon Apr 27 09:47:12 -0700 2009 Updated Rakefile to use Jeweler. [tylerhunt]
file VERSION.yml Mon Jan 11 09:16:37 -0800 2010 Version bump to 0.0.5 [tylerhunt]
directory lib/ Mon Jan 11 09:14:50 -0800 2010 Cleaned up CancelSubscriptionAndRefund operation. [tylerhunt]
file remit.gemspec Mon Jan 11 09:24:09 -0800 2010 Regenerated gemspec for version 0.0.5 [tylerhunt]
directory spec/ Mon Apr 27 11:56:13 -0700 2009 Fixed the ipn request to finally work correctly... [tylerhunt]
README.markdown

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(Rails.root, 'config', 'amazon_fps.yml')
config = YAML.load_file(config_file)[RAILS_ENV].symbolize_keys

FPS_ACCESS_KEY = config[:access_key]
FPS_SECRET_KEY = config[:secret_key]

Then create the YAML file config/amazon_fps.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>

To instantiate and use the Remit API in your application, you could define a method in your ApplicationController like this:

def remit
  @remit ||= begin
    sandbox = !Rails.env.production?
    Remit::API.new(FPS_ACCESS_KEY, FPS_SECRET_KEY, sandbox)
  end
end

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

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server