will_paypal 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -1
- data/Rakefile +1 -0
- data/lib/will_paypal.rb +2 -2
- data/spec/will_paypal_spec.rb +12 -2
- data/will_paypal.gemspec +1 -1
- metadata +3 -26
- data/.rvmrc +0 -1
- data/Gemfile.lock +0 -26
- data/will_paypal-0.1.0.gem +0 -0
data/.gitignore
CHANGED
data/Rakefile
CHANGED
data/lib/will_paypal.rb
CHANGED
@@ -28,9 +28,9 @@ class WillPaypal
|
|
28
28
|
data.merge!(self.config[:params])
|
29
29
|
query = []
|
30
30
|
data.each do |key, value|
|
31
|
-
query << "#{key.to_s.upcase}=#{
|
31
|
+
query << "#{key.to_s.upcase}=#{CGI.escape(value.to_s)}"
|
32
32
|
end
|
33
|
-
query.join("&")
|
33
|
+
query.sort.join("&")
|
34
34
|
end
|
35
35
|
|
36
36
|
def hash_from_query_string(query_string)
|
data/spec/will_paypal_spec.rb
CHANGED
@@ -24,6 +24,16 @@ describe "WillPaypal" do
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
+
describe "Converting query strings back and forth" do
|
28
|
+
let(:paypal) { WillPaypal.new }
|
29
|
+
it 'should succeed' do
|
30
|
+
hash = {'NAME' => 'Barnes & Noble', 'TITLE' => 'Barnes and Noble'}
|
31
|
+
convertible = paypal.hash_from_query_string(paypal.query_string_for(hash))
|
32
|
+
convertible['NAME'].should eql(hash['NAME'])
|
33
|
+
convertible['TITLE'].should eql(hash['TITLE'])
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
27
37
|
describe "Request to Paypal" do
|
28
38
|
|
29
39
|
describe "Query String" do
|
@@ -88,7 +98,7 @@ describe "WillPaypal" do
|
|
88
98
|
http_response = double("response")
|
89
99
|
http_response.should_receive(:code)
|
90
100
|
http_response.should_receive(:body)
|
91
|
-
http.should_receive(:request_post).with("/nvp", "USER=team_1220115929_biz_api1.example.com&
|
101
|
+
http.should_receive(:request_post).with("/nvp", "PWD=&SIGNATURE=&USER=team_1220115929_biz_api1.example.com&VERSION=72.0").and_return(http_response)
|
92
102
|
http.should_receive(:use_ssl=).with(true)
|
93
103
|
http.should_receive(:verify_mode=).with(OpenSSL::SSL::VERIFY_PEER)
|
94
104
|
http.should_receive(:ca_path=).with('/etc/ssl/certs')
|
@@ -111,7 +121,7 @@ describe "WillPaypal" do
|
|
111
121
|
http_response.should_receive(:code)
|
112
122
|
http_response.should_receive(:body)
|
113
123
|
http.should_receive(:use_ssl=).with(true)
|
114
|
-
http.should_receive(:request_post).with("/nvp", "USER=team_1220115929_biz_api1.example.com&
|
124
|
+
http.should_receive(:request_post).with("/nvp", "PWD=&SIGNATURE=&USER=team_1220115929_biz_api1.example.com&VERSION=72.0").and_return(http_response)
|
115
125
|
http.should_receive(:verify_mode=).with(OpenSSL::SSL::VERIFY_NONE)
|
116
126
|
paypal.call_paypal({})
|
117
127
|
end
|
data/will_paypal.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: will_paypal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 25
|
5
4
|
prerelease:
|
6
|
-
|
7
|
-
- 0
|
8
|
-
- 1
|
9
|
-
- 1
|
10
|
-
version: 0.1.1
|
5
|
+
version: 0.1.2
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
8
|
- Michael Bumann - Railslove
|
@@ -16,7 +11,7 @@ autorequire:
|
|
16
11
|
bindir: bin
|
17
12
|
cert_chain: []
|
18
13
|
|
19
|
-
date:
|
14
|
+
date: 2012-01-13 00:00:00 +01:00
|
20
15
|
default_executable:
|
21
16
|
dependencies:
|
22
17
|
- !ruby/object:Gem::Dependency
|
@@ -27,11 +22,6 @@ dependencies:
|
|
27
22
|
requirements:
|
28
23
|
- - ~>
|
29
24
|
- !ruby/object:Gem::Version
|
30
|
-
hash: 23
|
31
|
-
segments:
|
32
|
-
- 2
|
33
|
-
- 6
|
34
|
-
- 0
|
35
25
|
version: 2.6.0
|
36
26
|
type: :development
|
37
27
|
version_requirements: *id001
|
@@ -43,9 +33,6 @@ dependencies:
|
|
43
33
|
requirements:
|
44
34
|
- - ">="
|
45
35
|
- !ruby/object:Gem::Version
|
46
|
-
hash: 3
|
47
|
-
segments:
|
48
|
-
- 0
|
49
36
|
version: "0"
|
50
37
|
type: :development
|
51
38
|
version_requirements: *id002
|
@@ -62,15 +49,12 @@ extra_rdoc_files:
|
|
62
49
|
- README.rdoc
|
63
50
|
files:
|
64
51
|
- .gitignore
|
65
|
-
- .rvmrc
|
66
52
|
- Gemfile
|
67
|
-
- Gemfile.lock
|
68
53
|
- README.rdoc
|
69
54
|
- Rakefile
|
70
55
|
- lib/will_paypal.rb
|
71
56
|
- spec/spec_helper.rb
|
72
57
|
- spec/will_paypal_spec.rb
|
73
|
-
- will_paypal-0.1.0.gem
|
74
58
|
- will_paypal.gemspec
|
75
59
|
has_rdoc: true
|
76
60
|
homepage: https://github.com/railslove/Will-Paypal
|
@@ -91,24 +75,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
91
75
|
requirements:
|
92
76
|
- - ">="
|
93
77
|
- !ruby/object:Gem::Version
|
94
|
-
hash: 3
|
95
|
-
segments:
|
96
|
-
- 0
|
97
78
|
version: "0"
|
98
79
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
80
|
none: false
|
100
81
|
requirements:
|
101
82
|
- - ">="
|
102
83
|
- !ruby/object:Gem::Version
|
103
|
-
hash: 11
|
104
|
-
segments:
|
105
|
-
- 1
|
106
|
-
- 2
|
107
84
|
version: "1.2"
|
108
85
|
requirements: []
|
109
86
|
|
110
87
|
rubyforge_project: will_paypal
|
111
|
-
rubygems_version: 1.
|
88
|
+
rubygems_version: 1.6.2
|
112
89
|
signing_key:
|
113
90
|
specification_version: 3
|
114
91
|
summary: Paypal NVP API Class.
|
data/.rvmrc
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
rvm use --create ree@nvp
|
data/Gemfile.lock
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
will_paypal (0.1.0)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: http://rubygems.org/
|
8
|
-
specs:
|
9
|
-
diff-lcs (1.1.2)
|
10
|
-
fakeweb (1.3.0)
|
11
|
-
rspec (2.6.0)
|
12
|
-
rspec-core (~> 2.6.0)
|
13
|
-
rspec-expectations (~> 2.6.0)
|
14
|
-
rspec-mocks (~> 2.6.0)
|
15
|
-
rspec-core (2.6.0)
|
16
|
-
rspec-expectations (2.6.0)
|
17
|
-
diff-lcs (~> 1.1.2)
|
18
|
-
rspec-mocks (2.6.0)
|
19
|
-
|
20
|
-
PLATFORMS
|
21
|
-
ruby
|
22
|
-
|
23
|
-
DEPENDENCIES
|
24
|
-
fakeweb
|
25
|
-
rspec (~> 2.6.0)
|
26
|
-
will_paypal!
|
data/will_paypal-0.1.0.gem
DELETED
Binary file
|