paypal_nvp 0.1.8 → 0.1.9
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/Manifest +3 -3
- data/lib/paypal_nvp.rb +13 -13
- data/paypal_nvp.gemspec +2 -2
- metadata +5 -7
data/Manifest
CHANGED
data/lib/paypal_nvp.rb
CHANGED
@@ -9,7 +9,7 @@ class PaypalNVP
|
|
9
9
|
def initialize(sandbox = false, extras = {})
|
10
10
|
type = sandbox ? "sandbox" : "live"
|
11
11
|
config = YAML.load_file("#{RAILS_ROOT}/config/paypal.yml") rescue nil
|
12
|
-
@require_ssl_certs =
|
12
|
+
@require_ssl_certs = extras[:require_ssl_certs].nil?
|
13
13
|
if config
|
14
14
|
@url = config[type]["url"]
|
15
15
|
@user = config[type]["user"]
|
@@ -29,24 +29,24 @@ class PaypalNVP
|
|
29
29
|
data.merge!(@extras)
|
30
30
|
qs = []
|
31
31
|
data.each do |key, value|
|
32
|
-
qs << "#{key.to_s.upcase}=#{URI.escape(value)}"
|
32
|
+
qs << "#{key.to_s.upcase}=#{URI.escape(value.to_s)}"
|
33
33
|
end
|
34
34
|
qs = "#{qs * "&"}"
|
35
35
|
|
36
36
|
uri = URI.parse(@url)
|
37
37
|
http = Net::HTTP.new(uri.host, uri.port)
|
38
38
|
http.use_ssl = true
|
39
|
-
#
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
39
|
+
# http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
40
|
+
rootCA = '/etc/ssl/certs'
|
41
|
+
if File.directory? rootCA
|
42
|
+
http.ca_path = rootCA
|
43
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
44
|
+
http.verify_depth = 5
|
45
|
+
else
|
46
|
+
#raise "missing ssl certs. Cannot secure paypal communication" if @require_ssl_certs == true
|
47
|
+
puts "WARNING: no ssl certs found. Paypal communication will be insecure. DO NOT DEPLOY"
|
48
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
49
|
+
end
|
50
50
|
|
51
51
|
response = http.start {
|
52
52
|
http.request_post(uri.path, qs) {|res|
|
data/paypal_nvp.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{paypal_nvp}
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.9"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Olivier BONNAURE - Direct Interactive LLC"]
|
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Paypal_nvp", "--main", "README.rdoc"]
|
16
16
|
s.require_paths = ["lib"]
|
17
17
|
s.rubyforge_project = %q{paypal_nvp}
|
18
|
-
s.rubygems_version = %q{1.
|
18
|
+
s.rubygems_version = %q{1.7.2}
|
19
19
|
s.summary = %q{Paypal NVP API Class.}
|
20
20
|
|
21
21
|
if s.respond_to? :specification_version then
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paypal_nvp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 9
|
10
|
+
version: 0.1.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Olivier BONNAURE - Direct Interactive LLC
|
@@ -15,8 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-05-28 00:00:00
|
19
|
-
default_executable:
|
18
|
+
date: 2010-05-28 00:00:00 Z
|
20
19
|
dependencies: []
|
21
20
|
|
22
21
|
description: Paypal NVP API Class.
|
@@ -35,7 +34,6 @@ files:
|
|
35
34
|
- Rakefile
|
36
35
|
- README.rdoc
|
37
36
|
- paypal_nvp.gemspec
|
38
|
-
has_rdoc: true
|
39
37
|
homepage: http://github.com/solisoft/paypal_nvp
|
40
38
|
licenses: []
|
41
39
|
|
@@ -71,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
69
|
requirements: []
|
72
70
|
|
73
71
|
rubyforge_project: paypal_nvp
|
74
|
-
rubygems_version: 1.
|
72
|
+
rubygems_version: 1.7.2
|
75
73
|
signing_key:
|
76
74
|
specification_version: 3
|
77
75
|
summary: Paypal NVP API Class.
|