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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 106a5ddaa757a8b6dc7e7fb054a7601c9e08bf8f
4
- data.tar.gz: 74d4d89a04b0aa6e0e5b996b308caee452f7c26b
3
+ metadata.gz: 7928b5a023836c0ea7d2aabd6460298a7217a618
4
+ data.tar.gz: 22c4f78ceab8310d3a591bcd8562362b89c126da
5
5
  SHA512:
6
- metadata.gz: dcbf8164132d3e44db466ed5dbaf24b796a3787e087f51a7fca85555f0adf239305c1de996bd4b1190d1f93d945a503fb1362d6a6457020abf60a9b5816da743
7
- data.tar.gz: ca431e025611aa6e31cc69b73f147953f2a2bd898c8b989760ea11ffa41761e96979063998cfa8992e179733f3ae78dfe280821f9123bab497ac236f3ac03ef6
6
+ metadata.gz: d57915c372668e066c31614cf1f33e70dd11fac3f93288fd4496b8cafef834894386f0bfe90d394e811f20579735de28cd9f6b94eff575dedee36404bf8ae09e
7
+ data.tar.gz: 3712a8b4f5fd3dbe1f684daf3e533cb91e724234f2ec224586fa1d7e78577f2791fcc83e71353a326241fe7b8fd76b60d8f2631c802aead6afec163e64d64a2c
@@ -3,7 +3,7 @@ script: bundle exec rspec spec
3
3
  language: ruby
4
4
  sudo: false
5
5
  rvm:
6
- - 2.1.5
6
+ - 2.3.0
7
7
  addons:
8
8
  code_climate:
9
9
  repo_token: 497b5dc4169e71803c100a6a07b16356787fa137560de2a3c783e41766b3de18
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.2
1
+ 1.3.4
@@ -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
 
@@ -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.2 ruby lib
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.2"
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-04"
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 = [
@@ -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.2
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-04 00:00:00.000000000 Z
11
+ date: 2016-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty