mfkessai-ruby 1.0.0.beta1 → 1.0.0.beta2
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/Gemfile.lock +2 -2
- data/README.md +1 -42
- data/lib/mfkessai/client.rb +6 -12
- data/lib/mfkessai/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0faa2fb854fc43d9b4f825b2727d21376d4cfc66d5554cb59f577162f7d40aca
|
|
4
|
+
data.tar.gz: 1f2d116db1c4abf5e85323b1814bb8a61d748dae807c1290e4c38dc5d2e5bcfe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 010d7150067183373e2309acf71d1347fdbffa19e0505b188b8525334bb5fe18eab30dacc3a91c47c031e983ab94598e39f37a79c99417164c282215f8184c34
|
|
7
|
+
data.tar.gz: e4a719ba2745c4167e95f68975feb3f3cf26eb26a756191e1da0ca23ccdddb9a011e3cec07f0e29cd9239a26fc22f92b07f59d2de3eddf4a2a2a59de652796e0
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -18,7 +18,7 @@ mfkessaiのapiを使用するための便利なアクセスをRubyで提供し
|
|
|
18
18
|
## Installation
|
|
19
19
|
|
|
20
20
|
```
|
|
21
|
-
$ gem install mfkessai-ruby -v 1.0.0.
|
|
21
|
+
$ gem install mfkessai-ruby -v 1.0.0.beta2 --pre
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
## Usage
|
|
@@ -278,47 +278,6 @@ Mfkessai.api_key = "mfkessai_test_..."
|
|
|
278
278
|
Mfkessai::Transaction.cancel("transation_test_123")
|
|
279
279
|
```
|
|
280
280
|
|
|
281
|
-
## Handling errors
|
|
282
|
-
|
|
283
|
-
```
|
|
284
|
-
begin
|
|
285
|
-
# Use Mfkessai's library to make requests...
|
|
286
|
-
rescue Mfkessai::BadRequestError => e
|
|
287
|
-
puts "Status is: #{e.http_status}"
|
|
288
|
-
puts "Message is: #{e.message}"
|
|
289
|
-
puts "http_body is: #{e.http_body}"
|
|
290
|
-
puts "json_body is: #{e.json_body}"
|
|
291
|
-
rescue Mfkessai::AuthenticationError => e
|
|
292
|
-
puts "Status is: #{e.http_status}"
|
|
293
|
-
puts "Message is: #{e.message}"
|
|
294
|
-
puts "http_body is: #{e.http_body}"
|
|
295
|
-
puts "json_body is: #{e.json_body}"
|
|
296
|
-
rescue Mfkessai::ForbiddenError => e
|
|
297
|
-
puts "Status is: #{e.http_status}"
|
|
298
|
-
puts "Message is: #{e.message}"
|
|
299
|
-
puts "http_body is: #{e.http_body}"
|
|
300
|
-
puts "json_body is: #{e.json_body}"
|
|
301
|
-
rescue Mfkessai::NotFoundError => e
|
|
302
|
-
puts "Status is: #{e.http_status}"
|
|
303
|
-
puts "Message is: #{e.message}"
|
|
304
|
-
puts "http_body is: #{e.http_body}"
|
|
305
|
-
puts "json_body is: #{e.json_body}"
|
|
306
|
-
rescue Mfkessai::APIConnectionError => e
|
|
307
|
-
puts "Status is: #{e.http_status}"
|
|
308
|
-
puts "Message is: #{e.message}"
|
|
309
|
-
puts "http_body is: #{e.http_body}"
|
|
310
|
-
puts "json_body is: #{e.json_body}"
|
|
311
|
-
rescue Mfkessai::ServerError => e
|
|
312
|
-
puts "Status is: #{e.http_status}"
|
|
313
|
-
puts "Message is: #{e.message}"
|
|
314
|
-
puts "http_body is: #{e.http_body}"
|
|
315
|
-
puts "json_body is: #{e.json_body}"
|
|
316
|
-
rescue => e
|
|
317
|
-
# Something else happened, completely unrelated to Mfkessai
|
|
318
|
-
end
|
|
319
|
-
|
|
320
|
-
```
|
|
321
|
-
|
|
322
281
|
## Development
|
|
323
282
|
|
|
324
283
|
Run all tests:
|
data/lib/mfkessai/client.rb
CHANGED
|
@@ -124,38 +124,32 @@ module Mfkessai
|
|
|
124
124
|
case error_response[:status]
|
|
125
125
|
when 400
|
|
126
126
|
data = JSON.parse(error_response[:body], symbolize_names: true)
|
|
127
|
-
raise BadRequestError.new(
|
|
128
|
-
http_status: error_response[:status],
|
|
127
|
+
raise BadRequestError.new(http_status: error_response[:status],
|
|
129
128
|
http_body: error_response[:body],
|
|
130
129
|
json_body: data)
|
|
131
130
|
when 401
|
|
132
131
|
data = JSON.parse(error_response[:body], symbolize_names: true)
|
|
133
|
-
raise AuthenticationError.new(
|
|
134
|
-
http_status: error_response[:status],
|
|
132
|
+
raise AuthenticationError.new(http_status: error_response[:status],
|
|
135
133
|
http_body: error_response[:body],
|
|
136
134
|
json_body: data)
|
|
137
135
|
when 403
|
|
138
136
|
data = JSON.parse(error_response[:body], symbolize_names: true)
|
|
139
|
-
raise ForbiddenError.new(
|
|
140
|
-
http_status: error_response[:status],
|
|
137
|
+
raise ForbiddenError.new(http_status: error_response[:status],
|
|
141
138
|
http_body: error_response[:body],
|
|
142
139
|
json_body: data)
|
|
143
140
|
when 404
|
|
144
141
|
data = JSON.parse(error_response[:body], symbolize_names: true)
|
|
145
|
-
raise NotFoundError.new(
|
|
146
|
-
http_status: error_response[:status],
|
|
142
|
+
raise NotFoundError.new(http_status: error_response[:status],
|
|
147
143
|
http_body: error_response[:body],
|
|
148
144
|
json_body: data)
|
|
149
145
|
when 500
|
|
150
146
|
data = JSON.parse(error_response[:body], symbolize_names: true)
|
|
151
|
-
raise ServerError.new(
|
|
152
|
-
http_status: error_response[:status],
|
|
147
|
+
raise ServerError.new(http_status: error_response[:status],
|
|
153
148
|
http_body: error_response[:body],
|
|
154
149
|
json_body: data)
|
|
155
150
|
when 503
|
|
156
151
|
data = JSON.parse(error_response[:body], symbolize_names: true)
|
|
157
|
-
raise ServerError.new(
|
|
158
|
-
http_status: error_response[:status],
|
|
152
|
+
raise ServerError.new(http_status: error_response[:status],
|
|
159
153
|
http_body: error_response[:body],
|
|
160
154
|
json_body: data)
|
|
161
155
|
else
|
data/lib/mfkessai/version.rb
CHANGED