dbalatero-remit 0.0.2.6 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE +20 -0
- data/README.markdown +91 -0
- metadata +29 -27
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2007-2009 Tyler Hunt
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.markdown
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
Remit
|
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
|
+
|
41
|
+
Using with Rails
|
42
|
+
----------------
|
43
|
+
|
44
|
+
To use Remit in a Rails application, you must first specify a dependency on the
|
45
|
+
Remit gem in your config/environment.rb file:
|
46
|
+
|
47
|
+
config.gem 'remit', :version => '~> 0.0.1'
|
48
|
+
|
49
|
+
Then you should create an initializer to configure your Amazon keys. Create the
|
50
|
+
file config/initializers/remit.rb with the following contents:
|
51
|
+
|
52
|
+
config_file = File.join(Rails.root, 'config', 'amazon_fps.yml')
|
53
|
+
config = YAML.load_file(config_file)[RAILS_ENV].symbolize_keys
|
54
|
+
|
55
|
+
FPS_ACCESS_KEY = config[:access_key]
|
56
|
+
FPS_SECRET_KEY = config[:secret_key]
|
57
|
+
|
58
|
+
Then create the YAML file config/amazon_fps.yml:
|
59
|
+
|
60
|
+
development: &sandbox
|
61
|
+
access_key: <your sandbox access key>
|
62
|
+
secret_key: <your sandbox secret key>
|
63
|
+
|
64
|
+
test:
|
65
|
+
<<: *sandbox
|
66
|
+
|
67
|
+
production:
|
68
|
+
access_key: <your access key>
|
69
|
+
secret_key: <your secret key>
|
70
|
+
|
71
|
+
To instantiate and use the Remit API in your application, you could define a
|
72
|
+
method in your ApplicationController like this:
|
73
|
+
|
74
|
+
def remit
|
75
|
+
@remit ||= begin
|
76
|
+
sandbox = !Rails.env.production?
|
77
|
+
Remit::API.new(FPS_ACCESS_KEY, FPS_SECRET_KEY, sandbox)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
|
82
|
+
Sites Using Remit
|
83
|
+
-----------------
|
84
|
+
|
85
|
+
The following production sites are currently using Remit:
|
86
|
+
|
87
|
+
* http://www.storenvy.com/
|
88
|
+
* http://www.obsidianportal.com/
|
89
|
+
|
90
|
+
|
91
|
+
Copyright (c) 2007-2009 Tyler Hunt, released under the MIT license
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dbalatero-remit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tyler Hunt
|
@@ -9,28 +9,30 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-04-27 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
16
|
+
name: relax
|
17
17
|
type: :runtime
|
18
18
|
version_requirement:
|
19
19
|
version_requirements: !ruby/object:Gem::Requirement
|
20
20
|
requirements:
|
21
|
-
- -
|
21
|
+
- - ~>
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 0.0.7
|
23
|
+
version: 0.0.7
|
24
24
|
version:
|
25
|
-
description:
|
26
|
-
email:
|
25
|
+
description:
|
26
|
+
email: tyler@tylerhunt.com
|
27
27
|
executables: []
|
28
28
|
|
29
29
|
extensions: []
|
30
30
|
|
31
|
-
extra_rdoc_files:
|
32
|
-
|
31
|
+
extra_rdoc_files:
|
32
|
+
- LICENSE
|
33
|
+
- README.markdown
|
33
34
|
files:
|
35
|
+
- lib/remit.rb
|
34
36
|
- lib/remit/common.rb
|
35
37
|
- lib/remit/data_types.rb
|
36
38
|
- lib/remit/error_codes.rb
|
@@ -64,21 +66,13 @@ files:
|
|
64
66
|
- lib/remit/operations/unsubscribe_for_caller_notification.rb
|
65
67
|
- lib/remit/operations/write_off_debt.rb
|
66
68
|
- lib/remit/pipeline_response.rb
|
67
|
-
-
|
68
|
-
-
|
69
|
-
|
70
|
-
|
71
|
-
- spec/spec_helper.rb
|
72
|
-
- spec/units/get_pipeline_spec.rb
|
73
|
-
- spec/units/get_results_spec.rb
|
74
|
-
- spec/units/ipn_request_spec.rb
|
75
|
-
- spec/units/pay_spec.rb
|
76
|
-
- spec/units/units_helper.rb
|
77
|
-
has_rdoc: false
|
78
|
-
homepage: http://github.com/tylerhunt/remit/tree/master
|
69
|
+
- LICENSE
|
70
|
+
- README.markdown
|
71
|
+
has_rdoc: true
|
72
|
+
homepage: http://github.com/tylerhunt/remit
|
79
73
|
post_install_message:
|
80
|
-
rdoc_options:
|
81
|
-
|
74
|
+
rdoc_options:
|
75
|
+
- --charset=UTF-8
|
82
76
|
require_paths:
|
83
77
|
- lib
|
84
78
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -95,10 +89,18 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
89
|
version:
|
96
90
|
requirements: []
|
97
91
|
|
98
|
-
rubyforge_project:
|
92
|
+
rubyforge_project: remit
|
99
93
|
rubygems_version: 1.2.0
|
100
94
|
signing_key:
|
101
95
|
specification_version: 2
|
102
|
-
summary:
|
103
|
-
test_files:
|
104
|
-
|
96
|
+
summary: An API for using the Amazon Flexible Payment Service (FPS).
|
97
|
+
test_files:
|
98
|
+
- spec/integrations/get_account_activity_spec.rb
|
99
|
+
- spec/integrations/get_tokens_spec.rb
|
100
|
+
- spec/units/get_pipeline_spec.rb
|
101
|
+
- spec/units/get_results_spec.rb
|
102
|
+
- spec/units/ipn_request_spec.rb
|
103
|
+
- spec/units/pay_spec.rb
|
104
|
+
- spec/integrations/integrations_helper.rb
|
105
|
+
- spec/spec_helper.rb
|
106
|
+
- spec/units/units_helper.rb
|