creative-paypal-express 1.3.0 → 1.4.0
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/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/VERSION +1 -1
- data/creative-paypal-express.gemspec +2 -2
- data/lib/paypal/nvp/request.rb +0 -8
- data/spec/paypal/express/request_spec.rb +9 -10
- data/spec/paypal/nvp/request_spec.rb +14 -9
- metadata +17 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5c8dd08fe5bc551e2a9813b1a85459cd1f9535d
|
4
|
+
data.tar.gz: 59701ce1bfce55e33a6b768bd7243e96228ee2e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 269e60921f1cf82405379ee8fa14a19c0e17aa96ee8ab1d70c4599fd2769f95b5f6b7cc33eb487e4e9de730a1f2e997493cd20971853f6a3afeb0a8c3995fa94
|
7
|
+
data.tar.gz: 22a5a303da2121d6af991a850e272262a8b944f418f3d2231d48b5f7266b4265db3dd9391a914c560102d91d269a3035d320a43c33cae51814b1f8706fef653c
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
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
|
-
|
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"
|
data/lib/paypal/nvp/request.rb
CHANGED
@@ -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
|
249
|
-
response.should be_instance_of
|
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 '
|
263
|
-
|
264
|
-
|
265
|
-
|
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
|
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!
|
280
|
-
response.should be_instance_of
|
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
|
82
|
-
end.to request_to
|
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
|
-
|
87
|
-
|
88
|
-
end
|
86
|
+
subject { instance.request(:SetExpressCheckout) }
|
87
|
+
before { fake_response 'SetExpressCheckout/failure' }
|
89
88
|
|
90
|
-
it '
|
91
|
-
expect
|
92
|
-
|
93
|
-
|
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.
|
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-
|
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.
|
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
|