paypal_adaptive 0.3.9 → 0.3.10
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/README.markdown +3 -0
- data/lib/paypal_adaptive/config.rb +3 -3
- data/lib/paypal_adaptive/ipn_notification.rb +2 -2
- data/lib/paypal_adaptive/request.rb +2 -2
- data/lib/paypal_adaptive/version.rb +1 -1
- data/paypal_adaptive.gemspec +0 -1
- data/test/test_helper.rb +0 -1
- data/test/unit/config_test.rb +6 -0
- metadata +3 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7d29ebb60621de3f59a9b04196514055919a811
|
4
|
+
data.tar.gz: a6dc95ce352efb590a3d10b94c543a16972d64a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb3462103c5a3c4c5e8cce3ce5c307ef5df1fab8345bd0d6a83b8d28fde4a109b0bc746a35adf7a3b688f3bef8ac2d5d9b5385fa0ecaeac8dce7371d06588824
|
7
|
+
data.tar.gz: 2c5a762eb1f151b93c9773adbf7477051d7790f6763fe0ab9ccd506d798e9964595edc415d02333c51cd7d0ea4533296538566f867cd731a0ddb84d8bca21c93
|
data/README.markdown
CHANGED
@@ -96,6 +96,9 @@ for each environment, e.g.:
|
|
96
96
|
The api_cert_file should point to your cert_key_pem.txt that is downloaded through the paypal developer interface. It will contain a section that specifies the RSA private key and another section that specifies a certificate. If this is left empty, paypal_adaptive will attempt to use the signature method of validation with PayPal, so your signature config must not be nil.
|
97
97
|
|
98
98
|
## Changelog
|
99
|
+
0.3.10
|
100
|
+
Remove Rails dependent gems thanks @ rchekaluk
|
101
|
+
|
99
102
|
0.3.9
|
100
103
|
Ensure POST response is not decompressed under Ruby 2.0 thanks @rchekaluk
|
101
104
|
|
@@ -46,9 +46,9 @@ module PaypalAdaptive
|
|
46
46
|
"X-PAYPAL-RESPONSE-DATA-FORMAT" => "JSON"
|
47
47
|
}
|
48
48
|
@headers.merge!({"X-PAYPAL-SECURITY-SIGNATURE" => config['signature']}) if config['signature']
|
49
|
-
@ssl_cert_path = config['ssl_cert_path'] unless config['ssl_cert_path'].
|
50
|
-
@ssl_cert_file = config['ssl_cert_file'] unless config['ssl_cert_file'].
|
51
|
-
@api_cert_file = config['api_cert_file'] unless config['api_cert_file'].
|
49
|
+
@ssl_cert_path = config['ssl_cert_path'] unless config['ssl_cert_path'].nil? || config['ssl_cert_path'].length == 0
|
50
|
+
@ssl_cert_file = config['ssl_cert_file'] unless config['ssl_cert_file'].nil? || config['ssl_cert_file'].length == 0
|
51
|
+
@api_cert_file = config['api_cert_file'] unless config['api_cert_file'].nil? || config['api_cert_file'].length == 0
|
52
52
|
@verify_mode = if pp_env == :sandbox
|
53
53
|
OpenSSL::SSL::VERIFY_NONE
|
54
54
|
else
|
@@ -29,8 +29,8 @@ module PaypalAdaptive
|
|
29
29
|
http.cert = OpenSSL::X509::Certificate.new(cert)
|
30
30
|
http.key = OpenSSL::PKey::RSA.new(cert)
|
31
31
|
end
|
32
|
-
http.ca_path = @ssl_cert_path unless @ssl_cert_path.
|
33
|
-
http.ca_file = @ssl_cert_file unless @ssl_cert_file.
|
32
|
+
http.ca_path = @ssl_cert_path unless @ssl_cert_path.nil? || @ssl_cert_path.length == 0
|
33
|
+
http.ca_file = @ssl_cert_file unless @ssl_cert_file.nil? || @ssl_cert_file.length == 0
|
34
34
|
|
35
35
|
req = Net::HTTP::Post.new(url.request_uri)
|
36
36
|
# we don't want #set_form_data to create a hash and get our
|
@@ -110,8 +110,8 @@ module PaypalAdaptive
|
|
110
110
|
http.cert = OpenSSL::X509::Certificate.new(cert)
|
111
111
|
http.key = OpenSSL::PKey::RSA.new(cert)
|
112
112
|
end
|
113
|
-
http.ca_path = @ssl_cert_path unless @ssl_cert_path.
|
114
|
-
http.ca_file = @ssl_cert_file unless @ssl_cert_file.
|
113
|
+
http.ca_path = @ssl_cert_path unless @ssl_cert_path.nil? || @ssl_cert_path.length == 0
|
114
|
+
http.ca_file = @ssl_cert_file unless @ssl_cert_file.nil? || @ssl_cert_file.length == 0
|
115
115
|
|
116
116
|
begin
|
117
117
|
response_data = http.post(path, api_request_data, @headers)
|
data/paypal_adaptive.gemspec
CHANGED
@@ -15,7 +15,6 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.add_dependency("json", "~>1.0")
|
16
16
|
s.add_dependency("jsonschema", "~>2.0.0")
|
17
17
|
s.add_development_dependency("rake")
|
18
|
-
s.add_development_dependency("activesupport", "~> 3.2.0")
|
19
18
|
s.add_development_dependency("webmock")
|
20
19
|
|
21
20
|
s.rubyforge_project = "paypal_adaptive"
|
data/test/test_helper.rb
CHANGED
data/test/unit/config_test.rb
CHANGED
@@ -7,6 +7,12 @@ class ConfigTest < Test::Unit::TestCase
|
|
7
7
|
assert_equal nil, @config.ssl_cert_path
|
8
8
|
end
|
9
9
|
|
10
|
+
def test_blank_ssl_cert_file
|
11
|
+
@config = PaypalAdaptive::Config.new("test", { "ssl_cert_file" => "" })
|
12
|
+
assert_equal nil, @config.ssl_cert_file
|
13
|
+
assert_equal nil, @config.ssl_cert_path
|
14
|
+
end
|
15
|
+
|
10
16
|
def test_erb_tags
|
11
17
|
ENV['paypal.username'] = 'account@email.com'
|
12
18
|
ENV['paypal.password'] = 's3krit'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paypal_adaptive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tommy Chheng
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -52,20 +52,6 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: activesupport
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 3.2.0
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: 3.2.0
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: webmock
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -177,3 +163,4 @@ test_files:
|
|
177
163
|
- test/unit/payment_options_test.rb
|
178
164
|
- test/unit/preapproval_test.rb
|
179
165
|
- test/unit/request_test.rb
|
166
|
+
has_rdoc:
|