simplepay-rails4 0.4.0 → 0.4.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -7
- data/README.md +50 -39
- data/lib/simplepay/engine.rb +4 -0
- data/lib/simplepay/service.rb +0 -6
- data/lib/simplepay/version.rb +1 -1
- data/lib/simplepay.rb +12 -3
- data/simplepay.gemspec +5 -3
- data/test/simplepay/{test_authentication.rb → test_signature.rb} +3 -3
- data/test/simplepay/test_validator.rb +3 -3
- metadata +7 -7
- data/lib/simplepay/rails.rb +0 -2
- /data/app/helpers/{rails_helper.rb → simplepay/rails/simplepay_helper.rb} +0 -0
- /data/lib/simplepay/{authentication.rb → signature.rb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bef46ea6bb69dc3366398b471120553cfbec077f
|
4
|
+
data.tar.gz: 3e7084f940dafe07a7104aab5b6127c3082097b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d98dfc5e5901720bd17acae15784d3613e6ad29aa99772917037b02d551739b72c8048ec1f263d820df531f1557b3d1755b55433c43f4da0847e8f268f6f7c6
|
7
|
+
data.tar.gz: 5558772269c4af90c94583bc5f6895903866d5a76301be09f0fd0b109a1445852f01f95718239f91bb7aebbb1cde397e59c74a9a92406011f06e9e172ec0e2a9
|
data/CHANGELOG.md
CHANGED
@@ -1,33 +1,34 @@
|
|
1
|
-
|
1
|
+
## 0.4.0 2014-07-05
|
2
2
|
|
3
3
|
* Stripping gem to bare essentials
|
4
|
+
* Updating to work on ruby 2+ testing framework
|
4
5
|
|
5
|
-
|
6
|
+
## 0.2.3 2011-2-10
|
6
7
|
|
7
8
|
* Supports Amazon Signature Version 2
|
8
9
|
* Updated for Rails 3
|
9
10
|
|
10
|
-
|
11
|
+
## 0.2.2 2009-06-07
|
11
12
|
|
12
13
|
* Added Donation service support.
|
13
14
|
|
14
|
-
|
15
|
+
## 0.2.1 2009-01-06
|
15
16
|
|
16
17
|
* Maintenance release for missing files.
|
17
18
|
|
18
|
-
|
19
|
+
## 0.2.0 2009-01-03
|
19
20
|
|
20
21
|
* Added Marketplace Service support [Nick Plante (zapnap)]
|
21
22
|
* Added Standard and Subscription documentation.
|
22
23
|
* Added a submit tag override to simplepay_form_for helper.
|
23
24
|
* Added a Simplepay::ResponseStatusCode::All shortcut.
|
24
25
|
|
25
|
-
|
26
|
+
## 0.1.1 2008-12-11
|
26
27
|
|
27
28
|
* Added a NotificationHelper to aid with Amazon IPN validation.
|
28
29
|
* Updated the Rails helper and added more detailed documentation.
|
29
30
|
|
30
|
-
|
31
|
+
## 0.1.0 2008-12-05
|
31
32
|
|
32
33
|
* Initial release
|
33
34
|
* Supports Amazon Simple Pay Standard and the-soon-to-be-released Subscriptions
|
data/README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
|
1
|
+
# simplepay (Rails Amazon Simple Pay Interface)
|
2
2
|
|
3
|
-
|
3
|
+
## DESCRIPTION:
|
4
4
|
|
5
5
|
This gem provides a Rails 4 interface to the Amazon Simple Pay payment service.
|
6
6
|
|
7
|
-
|
7
|
+
## FEATURES/PROBLEMS:
|
8
8
|
|
9
9
|
Supports the following Amazon Simple Pay services:
|
10
10
|
|
@@ -13,22 +13,27 @@ Supports the following Amazon Simple Pay services:
|
|
13
13
|
* Marketplace
|
14
14
|
* Donation
|
15
15
|
|
16
|
-
|
16
|
+
## SYNOPSIS:
|
17
17
|
|
18
18
|
Add simplepay to your Bundler Gemfile
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
```ruby
|
21
|
+
#in Gemfile
|
22
|
+
|
23
|
+
gem "simplepay-rails4", :require => 'simplepay'
|
24
|
+
```
|
23
25
|
|
24
26
|
Configure the gem with your Amazon Web Services credentials:
|
25
27
|
|
26
|
-
|
27
|
-
|
28
|
-
Simplepay.aws_access_key_id = 'MYAMAZONACCESSKEYID'
|
29
|
-
Simplepay.aws_secret_access_key = 'MYAMAZONSECRETACCESSKEY'
|
28
|
+
```ruby
|
29
|
+
#in config/initializers/simplepay.rb
|
30
30
|
|
31
|
-
|
31
|
+
Simplepay.aws_access_key_id = 'MYAMAZONACCESSKEYID'
|
32
|
+
Simplepay.aws_secret_access_key = 'MYAMAZONSECRETACCESSKEY'
|
33
|
+
Simplepay.use_sandbox = true # defaulted to true
|
34
|
+
```
|
35
|
+
|
36
|
+
### Obtaining Amazon Web Services Credentials
|
32
37
|
|
33
38
|
1) Create an Amazon Payments Personal Account
|
34
39
|
https://payments.amazon.com/sdui/sdui/basicaccount
|
@@ -48,26 +53,27 @@ Configure the gem with your Amazon Web Services credentials:
|
|
48
53
|
|
49
54
|
Note that the AWS Access Key ID and Secret Access Key is good for both testing in the sandbox and for production use.
|
50
55
|
|
51
|
-
|
56
|
+
### Generating your Simple Pay forms
|
52
57
|
|
53
58
|
Generally, this library will then be used directly from one (or more) of your
|
54
59
|
views. Depending on the type of Simple Pay service you're using (see
|
55
60
|
Simplepay::Services), some form values will be required, while others may be
|
56
61
|
optional. This is done like so:
|
57
62
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
<%= simplepay_form_for(:subscription, {
|
64
|
-
:amount => 10.95,
|
65
|
-
:description => "MORE Profit!",
|
66
|
-
:recurring_frequency => "1 month"
|
67
|
-
}) %>
|
63
|
+
```erb
|
64
|
+
<%= simplepay_form_for(:standard, {
|
65
|
+
:amount => 10.95,
|
66
|
+
:description => "Profit!"
|
67
|
+
}) %>
|
68
68
|
|
69
|
+
<%= simplepay_form_for(:subscription, {
|
70
|
+
:amount => 10.95,
|
71
|
+
:description => "MORE Profit!",
|
72
|
+
:recurring_frequency => "1 month"
|
73
|
+
}) %>
|
74
|
+
```
|
69
75
|
|
70
|
-
|
76
|
+
### Marketplace forms
|
71
77
|
|
72
78
|
Amazon Simple Pay Marketplace makes it easy to facilitate payments between
|
73
79
|
buyers and sellers, and to charge a fee for the transaction. If you're building
|
@@ -75,12 +81,15 @@ a marketplace application, your sellers must first agree to the policy that you
|
|
75
81
|
set. You can do this by specifying the Simplepay::Services::MarketplacePolicy
|
76
82
|
service:
|
77
83
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
+
|
85
|
+
```erb
|
86
|
+
<%= simplepay_form_for(:marketplace_policy, {
|
87
|
+
:max_fixed_fee => 5.00,
|
88
|
+
:max_variable_fee => 5,
|
89
|
+
:return_url => 'http://yourservice.com',
|
90
|
+
:reference_id => '1234567890'
|
91
|
+
}) %>
|
92
|
+
```
|
84
93
|
|
85
94
|
The user will be prompted to login to their Amazon account and accept the policy
|
86
95
|
you propose. After they complete the process, they'll be returned to the return_url
|
@@ -92,15 +101,17 @@ Amazon recipient email address).
|
|
92
101
|
Only once this is done will you be able to offer marketplace checkout options for
|
93
102
|
that sellers items:
|
94
103
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
+
```erb
|
105
|
+
<%= simplepay_form_for(:marketplace, {
|
106
|
+
:amount => 34.95,
|
107
|
+
:description => "Mutual profit!",
|
108
|
+
:recipient_email => 'seller@gmail.com',
|
109
|
+
:fixed_marketplace_fee => 10.00,
|
110
|
+
:variable_marketplace_fee => 5
|
111
|
+
}) %>
|
112
|
+
```
|
113
|
+
|
114
|
+
## INSTALL:
|
104
115
|
|
105
116
|
sudo gem install simplepay-rails4
|
106
117
|
|
data/lib/simplepay/service.rb
CHANGED
@@ -125,9 +125,3 @@ module Simplepay
|
|
125
125
|
end
|
126
126
|
|
127
127
|
end
|
128
|
-
|
129
|
-
require 'simplepay/services/subscription'
|
130
|
-
require 'simplepay/services/standard'
|
131
|
-
require 'simplepay/services/donation'
|
132
|
-
require 'simplepay/services/marketplace'
|
133
|
-
require 'simplepay/services/marketplace_policy'
|
data/lib/simplepay/version.rb
CHANGED
data/lib/simplepay.rb
CHANGED
@@ -3,10 +3,17 @@ require 'active_support/dependencies'
|
|
3
3
|
|
4
4
|
module Simplepay
|
5
5
|
autoload :Constants, 'simplepay/constants'
|
6
|
-
autoload :Support, 'simplepay/support'
|
7
|
-
autoload :Authentication, 'simplepay/authentication'
|
8
6
|
autoload :Service, 'simplepay/service'
|
9
|
-
|
7
|
+
module Services
|
8
|
+
autoload :Donation, 'simplepay/services/donation'
|
9
|
+
autoload :Marketplace, 'simplepay/services/marketplace'
|
10
|
+
autoload :Marketplace_policy, 'simplepay/services/marketplace_policy'
|
11
|
+
autoload :Standard, 'simplepay/services/standard'
|
12
|
+
autoload :Subscription, 'simplepay/services/subscription'
|
13
|
+
end
|
14
|
+
autoload :Signature, 'simplepay/signature'
|
15
|
+
autoload :Support, 'simplepay/support'
|
16
|
+
autoload :Validator, 'simplepay/validator'
|
10
17
|
|
11
18
|
mattr_accessor :aws_access_key_id
|
12
19
|
@@aws_access_key_id = ''
|
@@ -27,3 +34,5 @@ module Simplepay
|
|
27
34
|
include ::Simplepay::Validator
|
28
35
|
end
|
29
36
|
end
|
37
|
+
|
38
|
+
require "simplepay/engine" if defined?(::Rails)
|
data/simplepay.gemspec
CHANGED
@@ -3,10 +3,9 @@
|
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
|
-
|
7
|
-
s.name = "simplepay-rails4"
|
8
|
-
s.version = "0.4.0"
|
6
|
+
require File.expand_path('../lib/simplepay/version', __FILE__)
|
9
7
|
|
8
|
+
Gem::Specification.new do |s|
|
10
9
|
s.authors = ["Nathaniel E. Bibler", "Derrick Parkhurst", "Charles DuBose"]
|
11
10
|
s.email = ['gem@nathanielbibler.com', 'gem@dubo.se']
|
12
11
|
|
@@ -16,6 +15,9 @@ Gem::Specification.new do |s|
|
|
16
15
|
s.homepage = 'https://github.com/Yakrware/simplepay'
|
17
16
|
s.license = 'MIT'
|
18
17
|
|
18
|
+
s.name = "simplepay-rails4"
|
19
|
+
s.version = Simplepay::VERSION
|
20
|
+
|
19
21
|
s.required_ruby_version = '>= 1.9.3'
|
20
22
|
|
21
23
|
s.files = `git ls-files`.split("\n")
|
@@ -1,9 +1,9 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/../test_helper'
|
2
|
-
require 'simplepay/
|
2
|
+
require 'simplepay/signature'
|
3
3
|
|
4
|
-
class Simplepay::
|
4
|
+
class Simplepay::TestSignature < ActiveSupport::TestCase
|
5
5
|
|
6
|
-
context 'Simplepay::
|
6
|
+
context 'Simplepay::Signature' do
|
7
7
|
|
8
8
|
setup do
|
9
9
|
@uri = URI.parse('https://authorize.payments-sandbox.amazon.com/pba/pipeline')
|
@@ -17,13 +17,13 @@ class Simplepay::TestValidatorHelper < ActiveSupport::TestCase
|
|
17
17
|
@validator = TestValidatorClass.new
|
18
18
|
end
|
19
19
|
|
20
|
-
should 'defer to Simplepay::
|
21
|
-
#Simplepay::
|
20
|
+
should 'defer to Simplepay::signature.authentic?' do
|
21
|
+
#Simplepay::signature.expects(:authentic?).with({:test => 'testing'}, 'signed').returns(true)
|
22
22
|
#assert @validator.testing({:test => 'testing', :signature => 'signed'})
|
23
23
|
end
|
24
24
|
|
25
25
|
should 'work with string hash keys' do
|
26
|
-
#Simplepay::
|
26
|
+
#Simplepay::signature.expects(:authentic?).with({:test => 'testing'}, 'signed').returns(true)
|
27
27
|
#assert @validator.testing({"test" => 'testing', "signature" => 'signed'})
|
28
28
|
end
|
29
29
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simplepay-rails4
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathaniel E. Bibler
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-07-
|
13
|
+
date: 2014-07-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
@@ -56,19 +56,19 @@ files:
|
|
56
56
|
- MIT-LICENSE
|
57
57
|
- README.md
|
58
58
|
- Rakefile
|
59
|
-
- app/helpers/
|
59
|
+
- app/helpers/simplepay/rails/simplepay_helper.rb
|
60
60
|
- lib/simplepay.rb
|
61
|
-
- lib/simplepay/authentication.rb
|
62
61
|
- lib/simplepay/constants.rb
|
62
|
+
- lib/simplepay/engine.rb
|
63
63
|
- lib/simplepay/errors.rb
|
64
64
|
- lib/simplepay/helpers/form_helper.rb
|
65
|
-
- lib/simplepay/rails.rb
|
66
65
|
- lib/simplepay/service.rb
|
67
66
|
- lib/simplepay/services/donation.rb
|
68
67
|
- lib/simplepay/services/marketplace.rb
|
69
68
|
- lib/simplepay/services/marketplace_policy.rb
|
70
69
|
- lib/simplepay/services/standard.rb
|
71
70
|
- lib/simplepay/services/subscription.rb
|
71
|
+
- lib/simplepay/signature.rb
|
72
72
|
- lib/simplepay/support.rb
|
73
73
|
- lib/simplepay/support/amount.rb
|
74
74
|
- lib/simplepay/support/billing_frequency.rb
|
@@ -95,8 +95,8 @@ files:
|
|
95
95
|
- test/simplepay/support/test_interval.rb
|
96
96
|
- test/simplepay/support/test_simple_amount.rb
|
97
97
|
- test/simplepay/support/test_subscription_period.rb
|
98
|
-
- test/simplepay/test_authentication.rb
|
99
98
|
- test/simplepay/test_service.rb
|
99
|
+
- test/simplepay/test_signature.rb
|
100
100
|
- test/simplepay/test_validator.rb
|
101
101
|
- test/test_helper.rb
|
102
102
|
- test/test_simplepay.rb
|
@@ -138,8 +138,8 @@ test_files:
|
|
138
138
|
- test/simplepay/support/test_interval.rb
|
139
139
|
- test/simplepay/support/test_simple_amount.rb
|
140
140
|
- test/simplepay/support/test_subscription_period.rb
|
141
|
-
- test/simplepay/test_authentication.rb
|
142
141
|
- test/simplepay/test_service.rb
|
142
|
+
- test/simplepay/test_signature.rb
|
143
143
|
- test/simplepay/test_validator.rb
|
144
144
|
- test/test_helper.rb
|
145
145
|
- test/test_simplepay.rb
|
data/lib/simplepay/rails.rb
DELETED
File without changes
|
File without changes
|