creative-paypal-express 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5dd169c91e9532a067b8d075e4b2024b5780026c
4
- data.tar.gz: 61519d004da8d2b51dc79cd5f832dec82fd711e1
3
+ metadata.gz: b5c8dd08fe5bc551e2a9813b1a85459cd1f9535d
4
+ data.tar.gz: 59701ce1bfce55e33a6b768bd7243e96228ee2e1
5
5
  SHA512:
6
- metadata.gz: b9b3991b6e6fd62441d38beac1d41324be5716a18ce3199beb11e37d5dee2f375cc4db841c1e477c540b6fcd25b3a4e96f3629875334117093156d8ea9948f0b
7
- data.tar.gz: fd01eee4f2c878d650543b690f910a07eb43adfb14819e9191e2a9f824ffedfbe3d27774ed157d722a25113495726b3b63c356d384d45dea79e8e81f5e7c4948
6
+ metadata.gz: 269e60921f1cf82405379ee8fa14a19c0e17aa96ee8ab1d70c4599fd2769f95b5f6b7cc33eb487e4e9de730a1f2e997493cd20971853f6a3afeb0a8c3995fa94
7
+ data.tar.gz: 22a5a303da2121d6af991a850e272262a8b944f418f3d2231d48b5f7266b4265db3dd9391a914c560102d91d269a3035d320a43c33cae51814b1f8706fef653c
@@ -1,3 +1,7 @@
1
+ ## v1.4.0
2
+ __Updated:__
3
+ - Responses no longer raise if ACK is not success, allows you to inspect and handle fails yourself.
4
+
1
5
  ## v1.2.1
2
6
  __Updated:__
3
7
  - Subscription amendment now takes mandatory currency_code option.
data/README.md CHANGED
@@ -7,7 +7,7 @@ Express Checkout for Digital Goods is also supported.
7
7
  ## Installation
8
8
 
9
9
  ```rb
10
- gem "creative-paypal-express", "~> 1.2.1"
10
+ gem "creative-paypal-express", "~> 1.4.0"
11
11
  ```
12
12
 
13
13
  ## Usage
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.0
1
+ 1.4.0
@@ -15,11 +15,11 @@ Gem::Specification.new do |s|
15
15
  s.files = `git ls-files`.split("\n")
16
16
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
17
17
 
18
- s.add_dependency "activesupport", ">= 4"
18
+ # s.add_dependency "activesupport", ">= 4"
19
19
  s.add_dependency "rest-client", "~> 2.0.0"
20
20
  s.add_dependency "attr_required", ">= 0.0.5"
21
21
 
22
- # s.add_development_dependency "activesupport", "4.1" # uses this for development, but will probably work with higher versions
22
+ s.add_development_dependency "activesupport", "~> 4.2" # uses this for development, but will probably work with higher versions
23
23
  s.add_development_dependency "rake", "~> 10.5.0"
24
24
  s.add_development_dependency "simplecov"
25
25
  s.add_development_dependency "rspec", "< 2.99"
@@ -59,14 +59,6 @@ module Paypal
59
59
  response = CGI.parse(response).inject({}) do |res, (k, v)|
60
60
  res.merge!(k.to_sym => v.first.to_s)
61
61
  end
62
-
63
- case response[:ACK]
64
- when 'Success', 'SuccessWithWarning'
65
- response
66
- else
67
- raise Exception::APIError.new(response)
68
- end
69
-
70
62
  rescue RestClient::Exception => e
71
63
  raise Exception::HttpError.new(e.http_code, e.message, e.http_body)
72
64
  end
@@ -245,8 +245,8 @@ describe Paypal::Express::Request do
245
245
  describe '#transaction_details' do
246
246
  it 'should return Paypal::Express::Response' do
247
247
  fake_response 'GetTransactionDetails/success'
248
- response = instance.transaction_details 'transaction_id'
249
- response.should be_instance_of Paypal::Express::Response
248
+ response = instance.transaction_details('transaction_id')
249
+ response.should be_instance_of(Paypal::Express::Response)
250
250
  end
251
251
 
252
252
  it 'should call GetTransactionDetails' do
@@ -259,25 +259,24 @@ describe Paypal::Express::Request do
259
259
  }
260
260
  end
261
261
 
262
- it 'should fail with bad transaction id' do
263
- expect do
264
- fake_response 'GetTransactionDetails/failure'
265
- response = instance.transaction_details 'bad_transaction_id'
266
- end.to raise_error(Paypal::Exception::APIError)
262
+ it 'does not fail with bad transaction id' do
263
+ fake_response 'GetTransactionDetails/failure'
264
+ response = instance.transaction_details('bad_transaction_id')
265
+ response.should be_instance_of(Paypal::Express::Response)
267
266
  end
268
267
 
269
268
  it 'should handle all attributes' do
270
269
  Paypal.logger.should_not_receive(:warn)
271
270
  fake_response 'GetTransactionDetails/success'
272
- response = instance.transaction_details 'transaction_id'
271
+ response = instance.transaction_details('transaction_id')
273
272
  end
274
273
  end
275
274
 
276
275
  describe "#capture!" do
277
276
  it 'should return Paypal::Express::Response' do
278
277
  fake_response 'DoCapture/success'
279
- response = instance.capture! 'authorization_id', 181.98, :BRL
280
- response.should be_instance_of Paypal::Express::Response
278
+ response = instance.capture!('authorization_id', 181.98, :BRL)
279
+ response.should be_instance_of(Paypal::Express::Response)
281
280
  end
282
281
 
283
282
  it 'should call DoExpressCheckoutPayment' do
@@ -78,19 +78,24 @@ describe Paypal::NVP::Request do
78
78
  describe '#request' do
79
79
  it 'should POST to NPV endpoint' do
80
80
  expect do
81
- instance.request :RPCMethod
82
- end.to request_to Paypal::NVP::Request::ENDPOINT[:production], :post
81
+ instance.request(:RPCMethod)
82
+ end.to request_to(Paypal::NVP::Request::ENDPOINT[:production], :post)
83
83
  end
84
84
 
85
85
  context 'when got API error response' do
86
- before do
87
- fake_response 'SetExpressCheckout/failure'
88
- end
86
+ subject { instance.request(:SetExpressCheckout) }
87
+ before { fake_response 'SetExpressCheckout/failure' }
89
88
 
90
- it 'should raise Paypal::Exception::APIError' do
91
- expect do
92
- instance.request :SetExpressCheckout
93
- end.to raise_error(Paypal::Exception::APIError)
89
+ it 'does not raise, returns the response object to be handled' do
90
+ expect{ subject }.to_not raise_error
91
+ expect(subject).to eq({
92
+ :ACK => "Failure",
93
+ :CORRELATIONID => "379d1b7f97afb",
94
+ :L_ERRORCODE0 => "10001",
95
+ :L_LONGMESSAGE0 => "Timeout processing request",
96
+ :L_SHORTMESSAGE0 => "Internal Error",
97
+ :TIMESTAMP => "2011-02-02T02:16:50Z"
98
+ })
94
99
  end
95
100
  end
96
101
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: creative-paypal-express
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - nov matake
@@ -9,22 +9,8 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-10-12 00:00:00.000000000 Z
12
+ date: 2017-12-28 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: activesupport
16
- requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - ">="
19
- - !ruby/object:Gem::Version
20
- version: '4'
21
- type: :runtime
22
- prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- version: '4'
28
14
  - !ruby/object:Gem::Dependency
29
15
  name: rest-client
30
16
  requirement: !ruby/object:Gem::Requirement
@@ -53,6 +39,20 @@ dependencies:
53
39
  - - ">="
54
40
  - !ruby/object:Gem::Version
55
41
  version: 0.0.5
42
+ - !ruby/object:Gem::Dependency
43
+ name: activesupport
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '4.2'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '4.2'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rake
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -238,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
238
  version: 1.3.6
239
239
  requirements: []
240
240
  rubyforge_project:
241
- rubygems_version: 2.5.2.1
241
+ rubygems_version: 2.2.2
242
242
  signing_key:
243
243
  specification_version: 4
244
244
  summary: PayPal Express Checkout API Client for Instance, Recurring and Digital Goods