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 +4 -4
- data/.gitignore +3 -1
- data/Gemfile +3 -0
- data/lib/Mollie/API/Client.rb +4 -1
- data/lib/Mollie/API/Client/Version.rb +7 -0
- data/lib/Mollie/API/Exception.rb +2 -1
- data/mollie.gemspec +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84f1ae9b94a9c37a487dc2ebcb00904525c5ea60
|
4
|
+
data.tar.gz: a75d837cc11c60412879706dca731b6d9c892e68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e0c4d4aa69213b2c7ec633fee73143b283416381ffdaed8a3878b47be51398daf611029bf471a67c87a0870a5772351935b1024244b9dbc406c5d6f14589a7c
|
7
|
+
data.tar.gz: 8dd28054cefae5ead2568870fbfabe515dacfe638abb2e3e1a4226509d691f08059828cf9dea1cbff9092b5498a884ce102a53a2a8565a402c35def486d51b95
|
data/.gitignore
CHANGED
data/Gemfile
ADDED
data/lib/Mollie/API/Client.rb
CHANGED
@@ -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
|
data/lib/Mollie/API/Exception.rb
CHANGED
data/mollie.gemspec
CHANGED
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
|
+
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-
|
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
|