paypal_adaptive 0.2.9 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown
CHANGED
@@ -91,6 +91,9 @@ for each environment, e.g.:
|
|
91
91
|
The ssl_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.
|
92
92
|
|
93
93
|
## Changelog
|
94
|
+
0.3.0
|
95
|
+
ssl_cert_file fixes from eddroid. get_verified_status function from bundacia.
|
96
|
+
|
94
97
|
0.2.9
|
95
98
|
Fixed cert issues in last release. Exception handling for connection.
|
96
99
|
|
@@ -21,9 +21,10 @@ module PaypalAdaptive
|
|
21
21
|
http.ca_path = @ssl_cert_path unless @ssl_cert_path.nil?
|
22
22
|
|
23
23
|
if @ssl_cert_file
|
24
|
-
cert = File.read(@ssl_cert_file)
|
25
|
-
http.cert = OpenSSL::X509::Certificate.new(cert)
|
26
|
-
http.key = OpenSSL::PKey::RSA.new(cert)
|
24
|
+
# cert = File.read(@ssl_cert_file)
|
25
|
+
# http.cert = OpenSSL::X509::Certificate.new(cert)
|
26
|
+
# http.key = OpenSSL::PKey::RSA.new(cert)
|
27
|
+
http.ca_file = @ssl_cert_file
|
27
28
|
end
|
28
29
|
|
29
30
|
path = "#{@paypal_base_url}/cgi-bin/webscr"
|
@@ -69,6 +69,10 @@ module PaypalAdaptive
|
|
69
69
|
wrap_post(data, "/AdaptivePayments/ExecutePayment")
|
70
70
|
end
|
71
71
|
|
72
|
+
def get_verified_status(data)
|
73
|
+
wrap_post(data, "/AdaptiveAccounts/GetVerifiedStatus")
|
74
|
+
end
|
75
|
+
|
72
76
|
def wrap_post(data, path)
|
73
77
|
raise NoDataError unless data
|
74
78
|
|
@@ -76,7 +80,7 @@ module PaypalAdaptive
|
|
76
80
|
end
|
77
81
|
|
78
82
|
def rescue_error_message(e, message = nil)
|
79
|
-
{"
|
83
|
+
{"responseEnvelope" => {"ack" => "Failure"}, "error" => [{"message" => (message ||= e)}]}
|
80
84
|
end
|
81
85
|
|
82
86
|
def post(data, path)
|
@@ -88,9 +92,10 @@ module PaypalAdaptive
|
|
88
92
|
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
89
93
|
|
90
94
|
if @ssl_cert_file
|
91
|
-
cert = File.read(@ssl_cert_file)
|
92
|
-
http.cert = OpenSSL::X509::Certificate.new(cert)
|
93
|
-
http.key = OpenSSL::PKey::RSA.new(cert)
|
95
|
+
#cert = File.read(@ssl_cert_file)
|
96
|
+
#http.cert = OpenSSL::X509::Certificate.new(cert)
|
97
|
+
#http.key = OpenSSL::PKey::RSA.new(cert)
|
98
|
+
http.ca_file = @ssl_cert_file
|
94
99
|
end
|
95
100
|
http.ca_path = @ssl_cert_path unless @ssl_cert_path.nil?
|
96
101
|
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class GetVerifiedStatusTest < Test::Unit::TestCase
|
4
|
+
def setup
|
5
|
+
@get_verified_status_request = PaypalAdaptive::Request.new("test")
|
6
|
+
end
|
7
|
+
|
8
|
+
def test_get_verified_status
|
9
|
+
puts "-------"
|
10
|
+
puts "get_verified_status"
|
11
|
+
|
12
|
+
data_filepath = File.join(File.dirname(__FILE__),"..", "data","verified_get_verified_status_request.json")
|
13
|
+
|
14
|
+
data = read_json_file(data_filepath)
|
15
|
+
pp_response = @get_verified_status_request.get_verified_status(data)
|
16
|
+
|
17
|
+
puts "account status: #{pp_response['accountStatus']}"
|
18
|
+
assert_equal true, pp_response.success?
|
19
|
+
end
|
20
|
+
|
21
|
+
def read_json_file(filepath)
|
22
|
+
File.open(filepath, "rb"){|f| JSON.parse(f.read)}
|
23
|
+
end
|
24
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paypal_adaptive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,12 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-05-16 00:00:00.000000000 -07:00
|
13
|
+
default_executable:
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: json
|
16
|
-
requirement: &
|
17
|
+
requirement: &70348762688600 !ruby/object:Gem::Requirement
|
17
18
|
none: false
|
18
19
|
requirements:
|
19
20
|
- - ~>
|
@@ -21,10 +22,10 @@ dependencies:
|
|
21
22
|
version: 1.6.0
|
22
23
|
type: :runtime
|
23
24
|
prerelease: false
|
24
|
-
version_requirements: *
|
25
|
+
version_requirements: *70348762688600
|
25
26
|
- !ruby/object:Gem::Dependency
|
26
27
|
name: jsonschema
|
27
|
-
requirement: &
|
28
|
+
requirement: &70348762687300 !ruby/object:Gem::Requirement
|
28
29
|
none: false
|
29
30
|
requirements:
|
30
31
|
- - ~>
|
@@ -32,10 +33,10 @@ dependencies:
|
|
32
33
|
version: 2.0.0
|
33
34
|
type: :runtime
|
34
35
|
prerelease: false
|
35
|
-
version_requirements: *
|
36
|
+
version_requirements: *70348762687300
|
36
37
|
- !ruby/object:Gem::Dependency
|
37
38
|
name: rake
|
38
|
-
requirement: &
|
39
|
+
requirement: &70348762702680 !ruby/object:Gem::Requirement
|
39
40
|
none: false
|
40
41
|
requirements:
|
41
42
|
- - ~>
|
@@ -43,7 +44,7 @@ dependencies:
|
|
43
44
|
version: '0.8'
|
44
45
|
type: :runtime
|
45
46
|
prerelease: false
|
46
|
-
version_requirements: *
|
47
|
+
version_requirements: *70348762702680
|
47
48
|
description: Lightweight wrapper for Paypal's Adaptive Payments API
|
48
49
|
email:
|
49
50
|
- tommy.chheng@gmail.com
|
@@ -81,15 +82,18 @@ files:
|
|
81
82
|
- test/data/valid_preapproval.json
|
82
83
|
- test/data/valid_set_payment_options_request.json
|
83
84
|
- test/data/valid_simple_pay_request_1.json
|
85
|
+
- test/data/verified_get_verified_status_request.json
|
84
86
|
- test/test_helper.rb
|
85
87
|
- test/unit/config_test.rb
|
86
88
|
- test/unit/get_shipping_addresses_test.rb
|
89
|
+
- test/unit/get_verified_status_test.rb
|
87
90
|
- test/unit/pay_request_schema_test.rb
|
88
91
|
- test/unit/pay_request_test.rb
|
89
92
|
- test/unit/payment_details_test.rb
|
90
93
|
- test/unit/payment_options_test.rb
|
91
94
|
- test/unit/preapproval_test.rb
|
92
95
|
- test/unit/request_test.rb
|
96
|
+
has_rdoc: true
|
93
97
|
homepage: http://github.com/tc/paypal_adaptive
|
94
98
|
licenses: []
|
95
99
|
post_install_message:
|
@@ -110,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
114
|
version: '0'
|
111
115
|
requirements: []
|
112
116
|
rubyforge_project: paypal_adaptive
|
113
|
-
rubygems_version: 1.
|
117
|
+
rubygems_version: 1.6.2
|
114
118
|
signing_key:
|
115
119
|
specification_version: 3
|
116
120
|
summary: Lightweight wrapper for Paypal's Adaptive Payments API
|
@@ -129,9 +133,11 @@ test_files:
|
|
129
133
|
- test/data/valid_preapproval.json
|
130
134
|
- test/data/valid_set_payment_options_request.json
|
131
135
|
- test/data/valid_simple_pay_request_1.json
|
136
|
+
- test/data/verified_get_verified_status_request.json
|
132
137
|
- test/test_helper.rb
|
133
138
|
- test/unit/config_test.rb
|
134
139
|
- test/unit/get_shipping_addresses_test.rb
|
140
|
+
- test/unit/get_verified_status_test.rb
|
135
141
|
- test/unit/pay_request_schema_test.rb
|
136
142
|
- test/unit/pay_request_test.rb
|
137
143
|
- test/unit/payment_details_test.rb
|