Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 126 lines (88 sloc) 4.743 kb
4daeaf6 Peter Boling Added CodeClimate badge
pboling authored
1 Remit [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/tylerhunt/remit)
c8b9005 Tyler Hunt Updated documentation.
authored
2 =====
3
4 This API provides access to the Amazon Flexible Payment Service (FPS). After
5 trying to get the SOAP version of the API written, I began working on this REST
6 version to provide a cohesive means of access to all of the functionality of
7 the FPS without having to get dirty dealing with SOAP requests.
8
9 I hope you enjoy using it as much as I've enjoyed writing it. I'm interested to
10 hear what sort of uses you find for it. If you find any bugs, let me know (or
11 better yet, submit a patch).
12
13
14 Sandbox
15 -------
16
17 Amazon provides a testing environment for the FPS called a sandbox. You may
18 (and should) use the sandbox while testing your application. It can be enabled
19 by passing a value of true to the last argument of the API constructor.
20
21
22 Getting Started
23 ---------------
24
25 The following example shows how to load up the API, initialize the service, and
26 make a simple call to get the tokens stored on the account:
27
28 gem 'remit'
29 require 'remit'
30
31 ACCESS_KEY = '<your AWS access key>'
32 SECRET_KEY = '<your AWS secret key>'
33
34 # connect using the API's sandbox mode
35 remit = Remit::API.new(ACCESS_KEY, SECRET_KEY, true)
36
37 response = remit.get_tokens
38 puts response.tokens.first.token_id
39
40
e32c64c Peter Boling VerifySignature blurb in readme
pboling authored
41 VerifySignature API
42 -------------------
43 See spec/integrations/verify_signature_spec.rb for examples on correct and incorrect usage!
44
45
c8b9005 Tyler Hunt Updated documentation.
authored
46 Using with Rails
47 ----------------
48
49 To use Remit in a Rails application, you must first specify a dependency on the
930ed1d John Bachir Improvements to documentation, including configuring Bundler to point to...
jjb authored
50 Remit gem in your Gemfile:
c8b9005 Tyler Hunt Updated documentation.
authored
51
06c5ae7 John Bachir adjust documentation to reflect the gem's dramatic return home
jjb authored
52 gem 'remit'
c8b9005 Tyler Hunt Updated documentation.
authored
53
54 Then you should create an initializer to configure your Amazon keys. Create the
55 file config/initializers/remit.rb with the following contents:
56
ce85dcc Tyler Hunt Fixed a typo in the documentation.
authored
57 config_file = File.join(Rails.root, 'config', 'amazon_fps.yml')
c8b9005 Tyler Hunt Updated documentation.
authored
58 config = YAML.load_file(config_file)[RAILS_ENV].symbolize_keys
59
875a41b Tyler Hunt Rewrote a portion of the Rails instructions.
authored
60 FPS_ACCESS_KEY = config[:access_key]
61 FPS_SECRET_KEY = config[:secret_key]
c8b9005 Tyler Hunt Updated documentation.
authored
62
de19117 Tyler Hunt Fixed another typo in the documentation.
authored
63 Then create the YAML file config/amazon_fps.yml:
c8b9005 Tyler Hunt Updated documentation.
authored
64
65 development: &sandbox
66 access_key: <your sandbox access key>
67 secret_key: <your sandbox secret key>
68
69 test:
70 <<: *sandbox
71
72 production:
73 access_key: <your access key>
74 secret_key: <your secret key>
75
875a41b Tyler Hunt Rewrote a portion of the Rails instructions.
authored
76 To instantiate and use the Remit API in your application, you could define a
77 method in your ApplicationController like this:
78
79 def remit
80 @remit ||= begin
81 sandbox = !Rails.env.production?
82 Remit::API.new(FPS_ACCESS_KEY, FPS_SECRET_KEY, sandbox)
83 end
84 end
85
c8b9005 Tyler Hunt Updated documentation.
authored
86
87 Sites Using Remit
88 -----------------
89
90 The following production sites are currently using Remit:
91
930ed1d John Bachir Improvements to documentation, including configuring Bundler to point to...
jjb authored
92 * [Storyenvy](http://www.storenvy.com/)
93 * [ObsidianPortal](http://www.obsidianportal.com/)
792795a Peter Boling Tweaked Readme
pboling authored
94 * [TimePerks](https://www.timeperks.com/about)
c8b9005 Tyler Hunt Updated documentation.
authored
95
96
930ed1d John Bachir Improvements to documentation, including configuring Bundler to point to...
jjb authored
97 Amazon API Compliance
98 ---------------------
792795a Peter Boling Tweaked Readme
pboling authored
99 These are the changes summarized by Amazon from the previous API, and the level of compliance in this gem:
ad74f06 Peter Boling Improving compatibility with 2008-09-17 API & Marketplace
pboling authored
100
101 1. You don't have to use InstallPaymentInstruction API to create Caller and Recipient tokens for your account. A Recipient token is now required only in Marketplace applications. We have completely removed the Caller token.
102 Compliance: Caller token references removed.
103 2. We removed parameters that are not being used by you today. For example, we removed metadata and recipient description, but we retained sender description and caller description.
104 Compliance: DONE! recipient_description and metadata have been removed from the code.
105 3. We simplified the transaction response object.
106 Compliance: The former Remit::TransactionResponse object has been accordingly simplified.
107 4. We simplified the GetTransaction response by removing unnecessary parameters.
108 Compliance: ?
109 5. By default, implicit retry and cancel will be the method used to handle temporary declines rather than the current explicit retry process.
110 Compliance: Removed deprecated statuses
111 6. GetResults, DiscardResults are replaced with GetTransactionStatus API.
112 Compliance: GetResults and Discard Results are gone. GetTransactionStatus takes their place.
113 7. Temporary decline status is not exposed to customers as we provide a simpler way to handle this status.
114 Compliance: Temporary decline status can no longer be tested for, as it will never be a status.
115 8. Web Service notification is removed and replaced with simplified IPN (Instant Payment Notification) mechanism.
116
09ec58b John Bachir instructions for running specs
jjb authored
117 Running Specification Suite
118 ---------------------------
119 1. Copy test.sh.example to test.sh
120 2. Edit test.sh to have valid Amazon developer account access and secret keys
121 3. Run ./test.sh from the command line.
ad74f06 Peter Boling Improving compatibility with 2008-09-17 API & Marketplace
pboling authored
122
792795a Peter Boling Tweaked Readme
pboling authored
123 Copyright (c) 2010-2012 Peter Boling, released under the MIT license
4daeaf6 Peter Boling Added CodeClimate badge
pboling authored
124
c8b9005 Tyler Hunt Updated documentation.
authored
125 Copyright (c) 2007-2009 Tyler Hunt, released under the MIT license
Something went wrong with that request. Please try again.