mollie-api-ruby 1.1.4 → 1.1.5

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: 3ab9bd15a6bf961d4a38cf82fc9d66ce3c7e7b7e
4
- data.tar.gz: e3a3b6cec31c08f365a465cd130f0fa395f82cda
3
+ metadata.gz: 84f1ae9b94a9c37a487dc2ebcb00904525c5ea60
4
+ data.tar.gz: a75d837cc11c60412879706dca731b6d9c892e68
5
5
  SHA512:
6
- metadata.gz: 84be0808645c95383e8c174e09341981bdf83358feacb109bbfe25246d26fd37729bae8238aa271e4df8bc049b2e3f9e01cd64e5eb139f382b7b52b388a7eca5
7
- data.tar.gz: 68aa434859c9db37762c6c3959279c00a514eff280f747cd2eca7621e63a389ab13f0d5266f38ba392499fb94cbf8585d6e8518f79cbde2c34d8dce81986c241
6
+ metadata.gz: 3e0c4d4aa69213b2c7ec633fee73143b283416381ffdaed8a3878b47be51398daf611029bf471a67c87a0870a5772351935b1024244b9dbc406c5d6f14589a7c
7
+ data.tar.gz: 8dd28054cefae5ead2568870fbfabe515dacfe638abb2e3e1a4226509d691f08059828cf9dea1cbff9092b5498a884ce102a53a2a8565a402c35def486d51b95
data/.gitignore CHANGED
@@ -1,3 +1,5 @@
1
1
  /.idea
2
2
  .DS_Store
3
- mollie-api-ruby*.gem
3
+ mollie-api-ruby*.gem
4
+ Gemfile.lock
5
+ .ruby-gemset
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
@@ -2,6 +2,7 @@ require "json"
2
2
  require "rest_client"
3
3
 
4
4
  ["Exception",
5
+ "Client/Version",
5
6
  "Resource/Base",
6
7
  "Resource/Payments",
7
8
  "Resource/Payments/Refunds",
@@ -17,7 +18,6 @@ require "rest_client"
17
18
  module Mollie
18
19
  module API
19
20
  class Client
20
- CLIENT_VERSION = "1.1.4"
21
21
  API_ENDPOINT = "https://api.mollie.nl"
22
22
  API_VERSION = "v1"
23
23
 
@@ -73,6 +73,7 @@ module Mollie
73
73
  http_body.delete_if { |k, v| v.nil? }
74
74
  end
75
75
 
76
+ http_code = nil
76
77
  begin
77
78
  request_url = "#{@api_endpoint}/#{API_VERSION}/#{api_method}/#{id}".chomp "/"
78
79
  rest_client = _getRestClient request_url, request_headers
@@ -87,12 +88,14 @@ module Mollie
87
88
  end
88
89
  response = JSON.parse response, :symbolize_names => true
89
90
  rescue RestClient::ExceptionWithResponse => e
91
+ http_code = e.http_code
90
92
  response = JSON.parse e.response, :symbolize_names => true
91
93
  raise e if response[:error].nil?
92
94
  end
93
95
 
94
96
  unless response[:error].nil?
95
97
  exception = Mollie::API::Exception.new response[:error][:message]
98
+ exception.code = http_code
96
99
  exception.field = response[:error][:field] unless response[:error][:field].nil?
97
100
  raise exception
98
101
  end
@@ -0,0 +1,7 @@
1
+ module Mollie
2
+ module API
3
+ class Client
4
+ CLIENT_VERSION = "1.1.5"
5
+ end
6
+ end
7
+ end
@@ -2,8 +2,9 @@ module Mollie
2
2
  module API
3
3
  class Exception < StandardError
4
4
  @field = nil
5
+ @code = nil
5
6
 
6
- attr_accessor :field
7
+ attr_accessor :field, :code
7
8
  end
8
9
  end
9
10
  end
data/mollie.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  $:.unshift(File.join(File.dirname(__FILE__), 'lib'))
2
2
 
3
- require 'Mollie/API/Client'
3
+ require 'Mollie/API/Client/Version'
4
4
 
5
5
  spec = Gem::Specification.new do |s|
6
6
  s.name = 'mollie-api-ruby'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mollie-api-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rick Wong
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-10 00:00:00.000000000 Z
11
+ date: 2015-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -48,6 +48,7 @@ extensions: []
48
48
  extra_rdoc_files: []
49
49
  files:
50
50
  - ".gitignore"
51
+ - Gemfile
51
52
  - LICENSE
52
53
  - README.mdown
53
54
  - examples/1-new-payment.rb
@@ -60,6 +61,7 @@ files:
60
61
  - examples/app.rb
61
62
  - examples/orders/.gitignore
62
63
  - lib/Mollie/API/Client.rb
64
+ - lib/Mollie/API/Client/Version.rb
63
65
  - lib/Mollie/API/Exception.rb
64
66
  - lib/Mollie/API/Object/Base.rb
65
67
  - lib/Mollie/API/Object/Issuer.rb