pin_up 1.3.2 → 1.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/README.md +3 -0
- data/VERSION +1 -1
- data/lib/pin_up/pin_errors.rb +5 -0
- data/pin_up.gemspec +3 -3
- data/spec/errors_spec.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7928b5a023836c0ea7d2aabd6460298a7217a618
|
4
|
+
data.tar.gz: 22c4f78ceab8310d3a591bcd8562362b89c126da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d57915c372668e066c31614cf1f33e70dd11fac3f93288fd4496b8cafef834894386f0bfe90d394e811f20579735de28cd9f6b94eff575dedee36404bf8ae09e
|
7
|
+
data.tar.gz: 3712a8b4f5fd3dbe1f684daf3e533cb91e724234f2ec224586fa1d7e78577f2791fcc83e71353a326241fe7b8fd76b60d8f2631c802aead6afec163e64d64a2c
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -282,6 +282,9 @@ N.B. All of the above errors return an error object with a `message` and a `resp
|
|
282
282
|
### ClientError
|
283
283
|
An unsupported HTTP verb was used.
|
284
284
|
|
285
|
+
### Unauthorized
|
286
|
+
Authorization credentials are wrong. Most likely the authorization token needs to be checked.
|
287
|
+
|
285
288
|
## Testing locally
|
286
289
|
Create a YAML file under 'spec' called 'test_data.yml' and add in:
|
287
290
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.3.
|
1
|
+
1.3.4
|
data/lib/pin_up/pin_errors.rb
CHANGED
@@ -21,6 +21,8 @@ module Pin
|
|
21
21
|
else
|
22
22
|
raise Pin::ChargeError.new(response)
|
23
23
|
end
|
24
|
+
when 401
|
25
|
+
raise Pin::Unauthorized.new(response)
|
24
26
|
when 402
|
25
27
|
raise Pin::InsufficientPinBalance.new(response)
|
26
28
|
when 404
|
@@ -64,6 +66,9 @@ module Pin
|
|
64
66
|
end
|
65
67
|
end
|
66
68
|
|
69
|
+
class Unauthorized < SimpleError
|
70
|
+
end
|
71
|
+
|
67
72
|
class ResourceNotFound < SimpleError
|
68
73
|
end
|
69
74
|
|
data/pin_up.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: pin_up 1.3.
|
5
|
+
# stub: pin_up 1.3.4 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "pin_up"
|
9
|
-
s.version = "1.3.
|
9
|
+
s.version = "1.3.4"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Daniel Nitsikopoulos"]
|
14
|
-
s.date = "2016-08-
|
14
|
+
s.date = "2016-08-06"
|
15
15
|
s.description = "A Ruby gem wrapper for the pin-payments (pin.net.au) API"
|
16
16
|
s.email = "dnitza@gmail.com"
|
17
17
|
s.extra_rdoc_files = [
|
data/spec/errors_spec.rb
CHANGED
@@ -108,4 +108,13 @@ describe 'Errors', :vcr, class: Pin::PinError do
|
|
108
108
|
end
|
109
109
|
end
|
110
110
|
|
111
|
+
it 'should raise an Unauthorized error when token is invalid' do
|
112
|
+
Pin::Base.new('arbitrary_token', :test)
|
113
|
+
expect { Pin::Customer.charges('foo') }.to raise_error do |error|
|
114
|
+
expect(error).to be_a Pin::Unauthorized
|
115
|
+
expect(error.message).to eq 'Not authorised. (Check API Key)'
|
116
|
+
expect(error.response).to be_a Hash
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
111
120
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pin_up
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Nitsikopoulos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|