paypal-express 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -17,6 +17,5 @@ tmtags
17
17
  coverage
18
18
  rdoc
19
19
  pkg
20
- Gemfile.lock
21
20
 
22
21
  ## PROJECT::SPECIFIC
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ rvm:
2
+ - 1.8.7
3
+ - 1.9.2
4
+ - 1.9.3
5
+ - jruby
data/Gemfile CHANGED
@@ -1,2 +1,7 @@
1
1
  source 'http://rubygems.org'
2
+
3
+ platform :jruby do
4
+ gem 'jruby-openssl', '>= 0.7'
5
+ end
6
+
2
7
  gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,50 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ paypal-express (0.4.0)
5
+ activesupport (>= 2.3)
6
+ attr_required (>= 0.0.3)
7
+ i18n
8
+ restclient_with_cert
9
+
10
+ GEM
11
+ remote: http://rubygems.org/
12
+ specs:
13
+ activesupport (3.1.0)
14
+ multi_json (~> 1.0)
15
+ attr_required (0.0.3)
16
+ bouncy-castle-java (1.5.0146.1)
17
+ diff-lcs (1.1.3)
18
+ fakeweb (1.3.0)
19
+ i18n (0.6.0)
20
+ jruby-openssl (0.7.4)
21
+ bouncy-castle-java
22
+ mime-types (1.16)
23
+ multi_json (1.0.3)
24
+ rake (0.9.2)
25
+ rcov (0.9.10)
26
+ rcov (0.9.10-java)
27
+ rest-client (1.6.7)
28
+ mime-types (>= 1.16)
29
+ restclient_with_cert (0.0.8)
30
+ rest-client (>= 1.6)
31
+ rspec (2.6.0)
32
+ rspec-core (~> 2.6.0)
33
+ rspec-expectations (~> 2.6.0)
34
+ rspec-mocks (~> 2.6.0)
35
+ rspec-core (2.6.4)
36
+ rspec-expectations (2.6.0)
37
+ diff-lcs (~> 1.1.2)
38
+ rspec-mocks (2.6.0)
39
+
40
+ PLATFORMS
41
+ java
42
+ ruby
43
+
44
+ DEPENDENCIES
45
+ fakeweb (>= 1.3.0)
46
+ jruby-openssl (>= 0.7)
47
+ paypal-express!
48
+ rake (>= 0.8)
49
+ rcov (>= 0.9)
50
+ rspec (>= 2)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.4.1
@@ -8,7 +8,15 @@ module Paypal
8
8
  else
9
9
  response
10
10
  end
11
- super 'PayPal API Error'
11
+ end
12
+
13
+ def message
14
+ if response.respond_to?(:short_messages) && response.short_messages.any?
15
+ "PayPal API Error: " <<
16
+ response.short_messages.map{ |m| "'#{m}'" }.join(", ")
17
+ else
18
+ "PayPal API Error"
19
+ end
12
20
  end
13
21
 
14
22
  class Response
@@ -75,6 +83,10 @@ module Paypal
75
83
  Paypal.log "Ignored Parameter (#{self.class}): #{key}=#{value}", :warn
76
84
  end
77
85
  end
86
+
87
+ def short_messages
88
+ details.map(&:short_message).compact
89
+ end
78
90
  end
79
91
  end
80
92
  end
@@ -9,15 +9,26 @@ describe Paypal::Exception::APIError do
9
9
  :VERSION=>"66.0",
10
10
  :TIMESTAMP=>"2011-03-03T06:33:51Z",
11
11
  :CORRELATIONID=>"758ebdc546b9c",
12
+ :BUILD=>"1741654",
13
+ :ACK=>"Failure",
12
14
  :L_SEVERITYCODE0=>"Error",
13
15
  :L_ERRORCODE0=>"10411",
14
16
  :L_LONGMESSAGE0=>"This Express Checkout session has expired. Token value is no longer valid.",
15
- :BUILD=>"1741654",
16
- :ACK=>"Failure",
17
- :L_SHORTMESSAGE0=>"This Express Checkout session has expired."
17
+ :L_SHORTMESSAGE0=>"This Express Checkout session has expired.",
18
+ :L_SEVERITYCODE1=>"Error",
19
+ :L_ERRORCODE1=>"2468",
20
+ :L_LONGMESSAGE1=>"Sample of a long message for the second item.",
21
+ :L_SHORTMESSAGE1=>"Second short message.",
18
22
  }
19
23
  end
20
24
 
25
+ describe "#message" do
26
+ it "aggregates short messages" do
27
+ error.message.should ==
28
+ "PayPal API Error: 'This Express Checkout session has expired.', 'Second short message.'"
29
+ end
30
+ end
31
+
21
32
  describe '#subject' do
22
33
  subject { error.response }
23
34
  its(:raw) { should == params }
@@ -55,11 +66,13 @@ describe Paypal::Exception::APIError do
55
66
  subject { error.response }
56
67
  its(:raw) { should == params }
57
68
  end
69
+ its(:message) { should == "PayPal API Error" }
58
70
  end
59
71
 
60
72
  context 'otherwise' do
61
73
  subject { error }
62
74
  let(:params) { 'Failure' }
63
75
  its(:response) { should == params }
76
+ its(:message) { should == "PayPal API Error" }
64
77
  end
65
78
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: paypal-express
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.4.0
5
+ version: 0.4.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - nov matake
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-08-08 00:00:00 Z
13
+ date: 2011-10-31 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -113,7 +113,9 @@ files:
113
113
  - .document
114
114
  - .gitignore
115
115
  - .rspec
116
+ - .travis.yml
116
117
  - Gemfile
118
+ - Gemfile.lock
117
119
  - LICENSE
118
120
  - README.rdoc
119
121
  - Rakefile
@@ -210,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
210
212
  requirements: []
211
213
 
212
214
  rubyforge_project:
213
- rubygems_version: 1.8.5
215
+ rubygems_version: 1.8.10
214
216
  signing_key:
215
217
  specification_version: 3
216
218
  summary: PayPal Express Checkout API Client for Instance, Recurring and Digital Goods Payment.