paypal_adaptive 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -91,7 +91,7 @@ this location exists, otherwise falling back to the cacert.pem file included wit
91
91
  ## Changelog
92
92
  0.2.0
93
93
  Thanks to seangaffney for set payment option support.
94
- Thanks to gaelian for https default cert support.
94
+ Thanks to gaelian for ssl cert support.
95
95
  Changed tests to use relative paths.
96
96
 
97
97
  0.1.0
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -54,7 +54,7 @@ module PaypalAdaptive
54
54
  elsif File.exists?("/etc/ssl/certs")
55
55
  @ssl_cert_path = "/etc/ssl/certs"
56
56
  else
57
- @ssl_cert_file = "../cacert.pem"
57
+ @ssl_cert_file = File.join(File.dirname(__FILE__), "..", "cacert.pem")
58
58
  end
59
59
  end
60
60
  end
@@ -17,7 +17,7 @@ module PaypalAdaptive
17
17
  @@ssl_cert_path ||= @@config.ssl_cert_path
18
18
  @@ssl_cert_file ||= @@config.ssl_cert_file
19
19
  end
20
-
20
+
21
21
  def validate
22
22
  #TODO the receiverList field not validating properly
23
23
 
@@ -33,7 +33,14 @@ module PaypalAdaptive
33
33
  response_data = call_api(data, "/AdaptivePayments/Pay")
34
34
  PaypalAdaptive::Response.new(response_data, @env)
35
35
  end
36
-
36
+
37
+ def set_payment_options(data)
38
+ raise NoDataError unless data
39
+
40
+ response_data = call_api(data, "/AdaptivePayments/SetPaymentOptions")
41
+ PaypalAdaptive::Response.new(response_data, @env)
42
+ end
43
+
37
44
  def payment_details(data)
38
45
  raise NoDataError unless data
39
46
 
@@ -87,4 +94,4 @@ module PaypalAdaptive
87
94
  end
88
95
  end
89
96
 
90
- end
97
+ end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{paypal_adaptive}
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Tommy Chheng"]
12
- s.date = %q{2011-04-25}
12
+ s.date = %q{2011-05-21}
13
13
  s.description = %q{Lightweight wrapper for Paypal's Adaptive Payments API.}
14
14
  s.email = %q{tommy.chheng@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -31,7 +31,6 @@ Gem::Specification.new do |s|
31
31
  "lib/response.rb",
32
32
  "paypal_adaptive.gemspec",
33
33
  "templates/paypal_ipn.rb",
34
- "test/data/dummy_cacert.pem",
35
34
  "test/data/invalid_chain_pay_request.json",
36
35
  "test/data/invalid_parallel_pay_request.json",
37
36
  "test/data/invalid_preapproval.json",
@@ -1,15 +1,15 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class ConfigTest < Test::Unit::TestCase
4
- def test_ssl_cert_logic
5
- @config = PaypalAdaptive::Config.new("test", { "ssl_cert_file" => "" })
6
-
7
- assert_equal File.join("..","cacert.pem"), @config.ssl_cert_file
4
+ def test_set_ssl_cert_file
5
+ @config = PaypalAdaptive::Config.new("test", { "ssl_cert_file" => "/path/to/cacert.pem" })
6
+ assert_equal "/path/to/cacert.pem", @config.ssl_cert_file
7
+ assert_equal nil, @config.ssl_cert_path
8
8
  end
9
9
 
10
- def test_ssl_cert_file
11
- @config = PaypalAdaptive::Config.new("test", { "ssl_cert_file" => "data/dummy_cacert.pem" })
12
- assert_equal File.join("data", "dummy_cacert.pem"), @config.ssl_cert_file
10
+ def test_default_ssl_cert_file
11
+ @config = PaypalAdaptive::Config.new("test", { "ssl_cert_file" => "" })
12
+ assert File.exists?(@config.ssl_cert_file)
13
13
  assert_equal nil, @config.ssl_cert_path
14
14
  end
15
15
  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.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,12 +9,12 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-04-25 00:00:00.000000000 -07:00
12
+ date: 2011-05-21 00:00:00.000000000 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json
17
- requirement: &2161705900 !ruby/object:Gem::Requirement
17
+ requirement: &2153461880 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :development
24
24
  prerelease: false
25
- version_requirements: *2161705900
25
+ version_requirements: *2153461880
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: jsonschema
28
- requirement: &2161705420 !ruby/object:Gem::Requirement
28
+ requirement: &2153461300 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *2161705420
36
+ version_requirements: *2153461300
37
37
  description: Lightweight wrapper for Paypal's Adaptive Payments API.
38
38
  email: tommy.chheng@gmail.com
39
39
  executables: []
@@ -56,7 +56,6 @@ files:
56
56
  - lib/response.rb
57
57
  - paypal_adaptive.gemspec
58
58
  - templates/paypal_ipn.rb
59
- - test/data/dummy_cacert.pem
60
59
  - test/data/invalid_chain_pay_request.json
61
60
  - test/data/invalid_parallel_pay_request.json
62
61
  - test/data/invalid_preapproval.json
@@ -1 +0,0 @@
1
- # Dummy file for testing.