xhash_client 0.3.4 → 0.3.5
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/lib/xhash/error.rb +8 -2
- data/lib/xhash/version.rb +1 -1
- data/spec/xhash/ocr_spec.rb +18 -0
- 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: 51cfc749e3e0033b38f6c080a3b879cb23d529d4ff2b18be8b51bb00dbaebe01
|
4
|
+
data.tar.gz: a63139c2bfe211afd2e9071577b791e194dbc5fe66512d8da5973bb8a8ddeaf4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8aa84976a5e204f2357f4be92aca1292369d8f0dab40fa89ef8e9cc4b7cdc11e7230cda637df725d5a3b7e07f4713b44bc0a7e6085d3a81201ce23da063f1df2
|
7
|
+
data.tar.gz: 64fdd3eaa5c9276b8ff27411e641e500b185d25041f672e71d7c6333019e9d40fc2e9950964a240b90af2b6f9dc979400591ed8a956a3341b6609b336e0c8a0c
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
xhash_client (0.3.
|
4
|
+
xhash_client (0.3.4)
|
5
5
|
httparty (~> 0.16.0)
|
6
6
|
json (~> 2.0)
|
7
7
|
|
@@ -21,7 +21,7 @@ GEM
|
|
21
21
|
json (2.2.0)
|
22
22
|
mime-types (3.3.1)
|
23
23
|
mime-types-data (~> 3.2015)
|
24
|
-
mime-types-data (3.
|
24
|
+
mime-types-data (3.2020.0512)
|
25
25
|
multi_xml (0.6.0)
|
26
26
|
public_suffix (4.0.1)
|
27
27
|
rspec (3.8.0)
|
data/lib/xhash/error.rb
CHANGED
@@ -3,8 +3,14 @@ module Xhash
|
|
3
3
|
attr_reader :message, :response
|
4
4
|
|
5
5
|
def initialize(options = {})
|
6
|
-
|
7
|
-
|
6
|
+
if options.is_a? Hash
|
7
|
+
@message = options[:message]
|
8
|
+
@response = options[:response]
|
9
|
+
else
|
10
|
+
@message = "Server error"
|
11
|
+
@response = options
|
12
|
+
end
|
13
|
+
|
8
14
|
super
|
9
15
|
end
|
10
16
|
end
|
data/lib/xhash/version.rb
CHANGED
data/spec/xhash/ocr_spec.rb
CHANGED
@@ -304,6 +304,24 @@ describe Xhash::OCR do
|
|
304
304
|
expect(exception).to be_a(Xhash::InvalidFieldError)
|
305
305
|
end
|
306
306
|
end
|
307
|
+
|
308
|
+
it 'fails to serialize to document with html error' do
|
309
|
+
stub_request(:post, 'https://xhash.dev/api/ocr/proof-of-address').to_return(
|
310
|
+
body: '<p>error</p>',
|
311
|
+
status: 500,
|
312
|
+
headers: { 'Content-Type' => 'text/html; charset=UTF-8' }
|
313
|
+
)
|
314
|
+
|
315
|
+
begin
|
316
|
+
ine =
|
317
|
+
Xhash::OCR.proof_of_address(
|
318
|
+
document_url:
|
319
|
+
'https://kyc-xhash.s3-us-west-2.amazonaws.com/documents/7cd6994d9ad52e8943be1ae00bac60c461430cdf2af6159afa4b9be749706472.png'
|
320
|
+
)
|
321
|
+
rescue => exception
|
322
|
+
expect(exception).to be_a(Xhash::Error)
|
323
|
+
end
|
324
|
+
end
|
307
325
|
end
|
308
326
|
|
309
327
|
describe '.ine_reverse' do
|