ruby_heureka_overeno_zakazniky 0.1.2 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -2
- data/lib/ruby_heureka_overeno_zakazniky.rb +8 -3
- data/lib/ruby_heureka_overeno_zakazniky/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2771a6b2642324f620dc68ba55d840818867e98
|
4
|
+
data.tar.gz: 3d466785679cf8fe88b0aa41b22ae4c8e154ccf1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 882fe5df9d95f185755e8dbb69ce55922b18e041bf3c7c79cf449c4ce46cb16ab5acd368f5a7c0ac35098c8f9b91ec066fc5a3be52da3fc6749eb063346772c4
|
7
|
+
data.tar.gz: e4ee43b3a4bcf0d048e2e5e01fe6435be6f826709e7293f232eeeaf8b6ade3427a964e4d9b4da76098797adf29e0eb661cbbae8ce35de3a8de6d17b6b8e9dedd
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ require "ruby_heureka_overeno_zakazniky/version"
|
|
7
7
|
module RubyHeurekaOverenoZakazniky
|
8
8
|
|
9
9
|
HOST = 'https://api.heureka.cz/shop-certification/v2/'
|
10
|
-
HEADER = {'Content-Type': 'application/json;
|
10
|
+
HEADER = {'Content-Type': 'application/json;charset=UTF-8'}
|
11
11
|
|
12
12
|
def self.order_log apiKey, email, orderId = nil, productItemIds = [], debug = false
|
13
13
|
|
@@ -30,10 +30,15 @@ module RubyHeurekaOverenoZakazniky
|
|
30
30
|
http.verify_mode = OpenSSL::SSL::VERIFY_NONE if Rails.env.development?
|
31
31
|
http.set_debug_output($stdout) if debug
|
32
32
|
|
33
|
-
request = Net::HTTP::Post.new(uri.request_uri
|
33
|
+
request = Net::HTTP::Post.new(uri.request_uri)
|
34
34
|
request.body = body.to_json
|
35
|
+
request["Content-Type"] = 'application/json;charset=UTF-8'
|
35
36
|
|
36
|
-
|
37
|
+
begin
|
38
|
+
response = http.request(request)
|
39
|
+
rescue OpenSSL::SSL::SSLError, Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError, Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError => e
|
40
|
+
puts "HEUREKA ERROR: #{e.inspect}"
|
41
|
+
end
|
37
42
|
|
38
43
|
end
|
39
44
|
end
|