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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fcb750e0620421f6471e7a56e0731dd29bd9f4c5
4
- data.tar.gz: 563dbccf9231cf740ea3830e168b556c4509f205
3
+ metadata.gz: a2771a6b2642324f620dc68ba55d840818867e98
4
+ data.tar.gz: 3d466785679cf8fe88b0aa41b22ae4c8e154ccf1
5
5
  SHA512:
6
- metadata.gz: 7fa2adfe086ccac32eeb55820304feb6b78ab0ad6a4404abf03510c4402ba7e8a57226bcbbb21e37b26c146dd4c186117edaf5b4ab5e03f33f1ecc7bf7be173c
7
- data.tar.gz: 836b58d9dfee0bb08e59aa2afb3b047d4949f9357878deca9982d5246f93c8c8fb63abaad4df92ddf33aca837da2f306f4b41a99ad2cad90f7cc63a3ed570cdb
6
+ metadata.gz: 882fe5df9d95f185755e8dbb69ce55922b18e041bf3c7c79cf449c4ce46cb16ab5acd368f5a7c0ac35098c8f9b91ec066fc5a3be52da3fc6749eb063346772c4
7
+ data.tar.gz: e4ee43b3a4bcf0d048e2e5e01fe6435be6f826709e7293f232eeeaf8b6ade3427a964e4d9b4da76098797adf29e0eb661cbbae8ce35de3a8de6d17b6b8e9dedd
data/README.md CHANGED
@@ -2,8 +2,6 @@
2
2
  Simple implementation of pushing orders to Heureka.cz API
3
3
 
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
6
-
7
5
  ## Installation
8
6
 
9
7
  Add this line to your application's Gemfile:
@@ -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; charset=UTF-8'}
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, self::HEADER)
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
- response = http.request(request)
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
@@ -1,3 +1,3 @@
1
1
  module RubyHeurekaOverenoZakazniky
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_heureka_overeno_zakazniky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jiří Beneš