ruby-eet-cz 1.0.0.pre
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 +7 -0
- data/.gitignore +12 -0
- data/.rspec +2 -0
- data/.rubocop.yml +16 -0
- data/.travis.yml +9 -0
- data/Gemfile +5 -0
- data/LICENSE.txt +21 -0
- data/README.md +76 -0
- data/Rakefile +7 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/eet_cz.rb +24 -0
- data/lib/eet_cz/akami_patch.rb +83 -0
- data/lib/eet_cz/client.rb +35 -0
- data/lib/eet_cz/concerns/available_attributes.rb +44 -0
- data/lib/eet_cz/concerns/true_value.rb +13 -0
- data/lib/eet_cz/receipt.rb +20 -0
- data/lib/eet_cz/request.rb +132 -0
- data/lib/eet_cz/response/base.rb +57 -0
- data/lib/eet_cz/response/error.rb +25 -0
- data/lib/eet_cz/response/success.rb +24 -0
- data/lib/eet_cz/response/warning.rb +13 -0
- data/lib/eet_cz/version.rb +4 -0
- data/lib/wsdl/v3/EETXMLSchema.xsd +219 -0
- data/lib/wsdl/v3/eet_wsdl.wsdl +39 -0
- data/ruby-eet-cz.gemspec +34 -0
- metadata +195 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 94d9b30755c99641ef668bf30c51f341f1c1b191
|
4
|
+
data.tar.gz: 41fea11a3e6fdc75b7b3e5d3253b6bda96b66a14
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2784f6061f4dd1a64a3ac43d3fd1b54e4a00f0f240c0fd25bba3e30b0c408f5da69c756a6a9d7d2aca1d311cca7b2717355a9f748297e2bbe4fa333727dd6ed7
|
7
|
+
data.tar.gz: 51ed47a0e7db9f8203c51640092bfd81e483fe5a71068ac164bb03f5694768584264143dc8e8d65a025ad2ab2b0358d2ce802936eb62ab645a4a25f22113c872
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.2
|
3
|
+
Include:
|
4
|
+
- '**/Gemfile'
|
5
|
+
- '**/Rakefile'
|
6
|
+
Exclude:
|
7
|
+
- 'bin/**/*'
|
8
|
+
- 'lib/eet_cz/akami_patch.rb'
|
9
|
+
Metrics/LineLength:
|
10
|
+
Max: 180
|
11
|
+
Metrics/MethodLength:
|
12
|
+
Max: 80
|
13
|
+
Documentation:
|
14
|
+
Enabled: false
|
15
|
+
Style/ClassAndModuleCamelCase:
|
16
|
+
Enabled: false
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Jan Uhlar
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
# EET_CZ [](https://travis-ci.org/ciihla/ruby-eet-cz)
|
2
|
+
|
3
|
+
EET wrapper for Ruby..
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'ruby-eet-cz'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install ruby-eet-cz
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
require 'eet_cz'
|
25
|
+
|
26
|
+
EET_CZ.configure do |c|
|
27
|
+
c.endpoint = EET_CZ::PG_EET_URL # or EET_CZ::PROD_EET_URL
|
28
|
+
c.ssl_cert_file = path_to('EET_CA1_Playground-CZ00000019.p12') # or 'pem' supported
|
29
|
+
c.ssl_cert_key_file = path_to('EET_CA1_Playground-CZ00000019.p12') # or 'pem'
|
30
|
+
c.ssl_cert_key_password = 'secret'
|
31
|
+
c.overovaci_mod = true # It sends attribute: overeni='true' Or explicitly specify 'false'. `default: true`
|
32
|
+
c.debug_logger = Logger.new('log/eet.log') # or Logger.new($stdout) in tests?
|
33
|
+
c.dic_popl = 'CZ00000019' # dic_popl
|
34
|
+
c.id_provoz = '555' # id_provoz
|
35
|
+
c.zjednoduseny_rezim = false # `default: false`
|
36
|
+
end
|
37
|
+
|
38
|
+
receipt = EET_CZ::Receipt.new(dat_trzby: Time.zone.now,
|
39
|
+
id_pokl: '/4432/D12',
|
40
|
+
porad_cis: '4/541/FR34',
|
41
|
+
celk_trzba: 25.5)
|
42
|
+
|
43
|
+
request = EET_CZ::Request.new(receipt, prvni_zaslani: false) # default true
|
44
|
+
response = request.run
|
45
|
+
|
46
|
+
response.test?
|
47
|
+
response.success?
|
48
|
+
response.fik
|
49
|
+
response.bkp
|
50
|
+
response.uuid_zpravy
|
51
|
+
response.dat_prij
|
52
|
+
response.dat_odmit
|
53
|
+
response.error
|
54
|
+
response.warnings
|
55
|
+
```
|
56
|
+
|
57
|
+
## Development
|
58
|
+
|
59
|
+
After checking out the repo, run `bin/setup` to install dependencies.
|
60
|
+
Then, run `rake spec` to run the tests.
|
61
|
+
You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
62
|
+
|
63
|
+
Use `rubocop -a` to keep the code as clean as possible.
|
64
|
+
|
65
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
66
|
+
To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
67
|
+
|
68
|
+
## Contributing
|
69
|
+
|
70
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/ciihla/ruby-eet-cz. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
71
|
+
|
72
|
+
|
73
|
+
## License
|
74
|
+
|
75
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
76
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'eet'
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require 'irb'
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/lib/eet_cz.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'active_support/all'
|
3
|
+
require 'active_model'
|
4
|
+
require 'savon'
|
5
|
+
|
6
|
+
require 'eet_cz/concerns/available_attributes'
|
7
|
+
require 'eet_cz/concerns/true_value'
|
8
|
+
require 'eet_cz/version'
|
9
|
+
require 'eet_cz/receipt'
|
10
|
+
require 'eet_cz/request'
|
11
|
+
require 'eet_cz/response/base'
|
12
|
+
require 'eet_cz/response/error'
|
13
|
+
require 'eet_cz/response/success'
|
14
|
+
require 'eet_cz/response/warning'
|
15
|
+
require 'eet_cz/client'
|
16
|
+
require 'eet_cz/akami_patch'
|
17
|
+
|
18
|
+
module EET_CZ
|
19
|
+
include ActiveSupport::Configurable
|
20
|
+
# TODO: validation for config values?
|
21
|
+
|
22
|
+
PG_EET_URL = 'https://pg.eet.cz:443/eet/services/EETServiceSOAP/v3/'.freeze
|
23
|
+
PROD_EET_URL = 'https://prod.eet.cz:443/eet/services/EETServiceSOAP/v3/'.freeze
|
24
|
+
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Akami
|
3
|
+
class WSSE
|
4
|
+
class Certs
|
5
|
+
def cert
|
6
|
+
@cert ||= case File.extname(cert_file)
|
7
|
+
when '.p12'
|
8
|
+
OpenSSL::PKCS12.new(File.read(cert_file), private_key_password).certificate
|
9
|
+
else
|
10
|
+
OpenSSL::X509::Certificate.new File.read(cert_file)
|
11
|
+
end if cert_file
|
12
|
+
end
|
13
|
+
|
14
|
+
# Returns an <tt>OpenSSL::PKey::RSA</tt> for the +private_key_file+.
|
15
|
+
def private_key
|
16
|
+
@private_key ||= case File.extname(private_key_file)
|
17
|
+
when '.p12'
|
18
|
+
OpenSSL::PKCS12.new(File.read(private_key_file), private_key_password).key
|
19
|
+
else
|
20
|
+
OpenSSL::PKey::RSA.new(File.read(private_key_file), private_key_password)
|
21
|
+
end if private_key_file
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
class Signature
|
26
|
+
# For a +Savon::WSSE::Certs+ object. To hold the certs we need to sign.
|
27
|
+
attr_accessor :certs, :digest
|
28
|
+
|
29
|
+
SHA256DigestAlgorithm = 'http://www.w3.org/2001/04/xmlenc#sha256'
|
30
|
+
RSASHA256SignatureAlgorithm = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256'
|
31
|
+
|
32
|
+
def initialize(certs = Certs.new, options = {})
|
33
|
+
@certs = certs
|
34
|
+
@digest = (options[:digest] || 'sha1').upcase
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def signed_info
|
40
|
+
{
|
41
|
+
'SignedInfo' => {
|
42
|
+
'CanonicalizationMethod/' => nil,
|
43
|
+
'SignatureMethod/' => nil,
|
44
|
+
'Reference' => [
|
45
|
+
signed_info_transforms.merge(signed_info_digest_method).merge('DigestValue' => body_digest)
|
46
|
+
],
|
47
|
+
:attributes! => {
|
48
|
+
'CanonicalizationMethod/' => { 'Algorithm' => ExclusiveXMLCanonicalizationAlgorithm },
|
49
|
+
'SignatureMethod/' => { 'Algorithm' => Signature.const_get("RSA#{digest}SignatureAlgorithm") },
|
50
|
+
'Reference' => { 'URI' => ["##{body_id}"] }
|
51
|
+
},
|
52
|
+
:order! => ['CanonicalizationMethod/', 'SignatureMethod/', 'Reference']
|
53
|
+
}
|
54
|
+
}
|
55
|
+
end
|
56
|
+
|
57
|
+
def the_signature
|
58
|
+
raise MissingCertificate, 'Expected a private_key for signing' unless certs.private_key
|
59
|
+
signed_info = at_xpath(@document, '//Envelope/Header/Security/Signature/SignedInfo')
|
60
|
+
signed_info = signed_info ? canonicalize(signed_info) : ''
|
61
|
+
signature = certs.private_key.sign(digest_class.new, signed_info)
|
62
|
+
Base64.encode64(signature).delete("\n") # TODO: DRY calls to Base64.encode64(...).gsub("\n", '')
|
63
|
+
end
|
64
|
+
|
65
|
+
def body_digest
|
66
|
+
body = canonicalize(at_xpath(@document, '//Envelope/Body'))
|
67
|
+
Base64.encode64(digest_class.digest(body)).strip
|
68
|
+
end
|
69
|
+
|
70
|
+
def signed_info_digest_method
|
71
|
+
{ 'DigestMethod/' => nil, :attributes! => { 'DigestMethod/' => { 'Algorithm' => Signature.const_get("#{digest}DigestAlgorithm") } } }
|
72
|
+
end
|
73
|
+
|
74
|
+
def uid
|
75
|
+
digest_class.hexdigest([Time.now, rand].collect(&:to_s).join('/'))
|
76
|
+
end
|
77
|
+
|
78
|
+
def digest_class
|
79
|
+
@digest_class ||= "OpenSSL::Digest::#{digest}".constantize
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module EET_CZ
|
3
|
+
class Client
|
4
|
+
def self.instance
|
5
|
+
new.client
|
6
|
+
end
|
7
|
+
|
8
|
+
def client
|
9
|
+
Savon.client(options) do
|
10
|
+
wsse_signature Akami::WSSE::Signature.new(Akami::WSSE::Certs.new(cert_file: EET_CZ.config.ssl_cert_file,
|
11
|
+
private_key_file: EET_CZ.config.ssl_cert_key_file,
|
12
|
+
private_key_password: EET_CZ.config.ssl_cert_key_password),
|
13
|
+
digest: 'sha256')
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def options
|
18
|
+
options = {
|
19
|
+
endpoint: EET_CZ.config.endpoint,
|
20
|
+
namespace: 'http://fs.mfcr.cz/eet/schema/v3',
|
21
|
+
encoding: 'UTF-8',
|
22
|
+
namespace_identifier: :eet
|
23
|
+
}
|
24
|
+
|
25
|
+
if EET_CZ.config.debug_logger
|
26
|
+
options[:log_level] = :debug
|
27
|
+
options[:log] = true
|
28
|
+
options[:pretty_print_xml] = true
|
29
|
+
options[:logger] = EET_CZ.config.debug_logger
|
30
|
+
end
|
31
|
+
|
32
|
+
options
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module EET_CZ
|
3
|
+
module Concerns
|
4
|
+
module AvailableAttributes
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
|
7
|
+
included do
|
8
|
+
attr_accessor :used_attrs
|
9
|
+
end
|
10
|
+
|
11
|
+
module ClassMethods
|
12
|
+
attr_accessor :available_attrs
|
13
|
+
|
14
|
+
def attrs_available(attrs)
|
15
|
+
self.available_attrs = attrs
|
16
|
+
end
|
17
|
+
|
18
|
+
def formatted(attr, proc)
|
19
|
+
define_method(attr) do
|
20
|
+
val = used_attrs[attr.to_sym]
|
21
|
+
return nil if val.nil? # TODO: add options to keep nil values passed to `proc`?
|
22
|
+
proc.call(val)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def initialize(attributes = {})
|
28
|
+
@used_attrs = attributes.symbolize_keys
|
29
|
+
end
|
30
|
+
|
31
|
+
def method_missing(method_sym, *arguments, &block)
|
32
|
+
if self.class.available_attrs.include?(method_sym)
|
33
|
+
used_attrs[method_sym]
|
34
|
+
else
|
35
|
+
super
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def respond_to_missing?(method_name, _include_private = false)
|
40
|
+
self.class.available_attrs.include?(method_name) || super
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module EET_CZ
|
3
|
+
class Receipt
|
4
|
+
include ActiveModel::Validations
|
5
|
+
include EET_CZ::Concerns::AvailableAttributes
|
6
|
+
|
7
|
+
VALID_FORMAT = %r(\A[0-9a-zA-Z\.,:;\/#\-_]{1,20}\z)
|
8
|
+
|
9
|
+
attrs_available %i(id_pokl porad_cis dat_trzby celk_trzba zakl_nepodl_dph zakl_dan1 dan1 zakl_dan2 dan2
|
10
|
+
zakl_dan3 dan3 cest_sluz pouzit_zboz1 pouzit_zboz2 pouzit_zboz3 urceno_cerp_zuct cerp_zuct).freeze
|
11
|
+
|
12
|
+
validates :id_pokl, presence: true, format: VALID_FORMAT # ID pokladny
|
13
|
+
validates :porad_cis, presence: true, format: VALID_FORMAT # ID dokladu/uctenky
|
14
|
+
validates :dat_trzby, presence: true
|
15
|
+
validates :celk_trzba, presence: true
|
16
|
+
|
17
|
+
formatted :celk_trzba, ->(val) { format('%.2f', val.to_f) }
|
18
|
+
formatted :dat_trzby, ->(val) { val.iso8601 }
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,132 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module EET_CZ
|
3
|
+
class Request
|
4
|
+
include EET_CZ::Concerns::TrueValue
|
5
|
+
attr_reader :receipt, :client, :options
|
6
|
+
|
7
|
+
# options:
|
8
|
+
# @prvni_zaslani: true=first try; false=retry
|
9
|
+
def initialize(receipt, options = {})
|
10
|
+
raise('certificate not found') if EET_CZ.config.ssl_cert_file.blank?
|
11
|
+
@receipt = receipt
|
12
|
+
@options = options
|
13
|
+
@client = EET_CZ::Client.instance
|
14
|
+
end
|
15
|
+
|
16
|
+
def run
|
17
|
+
response = client.call('Trzba', soap_action: 'http://fs.mfcr.cz/eet/OdeslaniTrzby', message: message)
|
18
|
+
EET_CZ::Response::Base.parse(response.doc)
|
19
|
+
# TODO: error handling (Net::HTTP, etc..)
|
20
|
+
end
|
21
|
+
|
22
|
+
def message
|
23
|
+
[header, data, footer].reduce({}, :merge)
|
24
|
+
end
|
25
|
+
|
26
|
+
def header
|
27
|
+
{
|
28
|
+
'eet:Hlavicka' => {
|
29
|
+
'@uuid_zpravy' => uuid_zpravy, # RFC 4122
|
30
|
+
'@dat_odesl' => dat_odesl, # ISO 8601
|
31
|
+
'@prvni_zaslani' => prvni_zaslani, # true=first try; false=retry
|
32
|
+
'@overeni' => overeni # true=testing mode; false=production mode!
|
33
|
+
}
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
def data
|
38
|
+
inner = {
|
39
|
+
'@dic_popl' => EET_CZ.config.dic_popl,
|
40
|
+
'@id_provoz' => id_provoz,
|
41
|
+
'@rezim' => EET_CZ.config.zjednoduseny_rezim && '1' || '0' # 0 - bezny rezim, 1 - zjednoduseny rezim
|
42
|
+
}
|
43
|
+
|
44
|
+
receipt.used_attrs.keys.each do |a|
|
45
|
+
value = receipt.send(a)
|
46
|
+
inner["@#{a}"] = value unless value.nil?
|
47
|
+
end
|
48
|
+
|
49
|
+
{ 'eet:Data' => inner }
|
50
|
+
end
|
51
|
+
|
52
|
+
def footer
|
53
|
+
{
|
54
|
+
'eet:KontrolniKody' => {
|
55
|
+
'eet:pkp' => {
|
56
|
+
'@digest' => 'SHA256',
|
57
|
+
'@cipher' => 'RSA2048',
|
58
|
+
'@encoding' => 'base64',
|
59
|
+
:content! => pkp
|
60
|
+
},
|
61
|
+
'eet:bkp' => {
|
62
|
+
'@digest' => 'SHA1',
|
63
|
+
'@encoding' => 'base16',
|
64
|
+
:content! => bkp
|
65
|
+
}
|
66
|
+
}
|
67
|
+
}
|
68
|
+
end
|
69
|
+
|
70
|
+
# @return base64 signed text from plain_text.
|
71
|
+
# plain_text consists of:
|
72
|
+
# DIC|ID_PROVOZ|ID_POKL|PORAD_CISL|DATUM|CENA
|
73
|
+
# i.e: "CZ72080043|181|00/2535/CN58|0/2482/IE25|2016-12-07T22:01:00+01:00|87988.00"
|
74
|
+
def pkp
|
75
|
+
Base64.strict_encode64(private_key.sign(OpenSSL::Digest::SHA256.new, plain_text))
|
76
|
+
end
|
77
|
+
|
78
|
+
# Digest from pkp
|
79
|
+
# i.e: '03ec1d0e-6d9f77fb-1d798ccb-f4739666-a4069bc3'
|
80
|
+
def bkp(base64_pkp = pkp)
|
81
|
+
Digest::SHA1.hexdigest(Base64.strict_decode64(base64_pkp)).upcase.scan(/.{8}/).join('-')
|
82
|
+
end
|
83
|
+
|
84
|
+
private
|
85
|
+
|
86
|
+
def uuid_zpravy
|
87
|
+
@uuid_zpravy ||= SecureRandom.uuid
|
88
|
+
end
|
89
|
+
|
90
|
+
def dat_odesl
|
91
|
+
@dat_odesl ||= Time.current.iso8601
|
92
|
+
end
|
93
|
+
|
94
|
+
def plain_text
|
95
|
+
[EET_CZ.config.dic_popl,
|
96
|
+
id_provoz,
|
97
|
+
id_pokl,
|
98
|
+
receipt.porad_cis,
|
99
|
+
receipt.dat_trzby,
|
100
|
+
receipt.celk_trzba].join('|')
|
101
|
+
end
|
102
|
+
|
103
|
+
def private_key
|
104
|
+
case cert_key_type
|
105
|
+
when 'p12'
|
106
|
+
OpenSSL::PKCS12.new(File.read(EET_CZ.config.ssl_cert_key_file), EET_CZ.config.ssl_cert_key_password).key
|
107
|
+
when 'pem'
|
108
|
+
OpenSSL::PKey::RSA.new(File.read(EET_CZ.config.ssl_cert_key_file), EET_CZ.config.ssl_cert_key_password)
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
def cert_key_type
|
113
|
+
EET_CZ.config.ssl_cert_key_file.split('.').last || 'p12'
|
114
|
+
end
|
115
|
+
|
116
|
+
def id_provoz
|
117
|
+
options[:id_provoz] || EET_CZ.config.id_provoz
|
118
|
+
end
|
119
|
+
|
120
|
+
def prvni_zaslani
|
121
|
+
true_value?(options[:prvni_zaslani])
|
122
|
+
end
|
123
|
+
|
124
|
+
def overeni
|
125
|
+
true_value?(EET_CZ.config.overovaci_mod)
|
126
|
+
end
|
127
|
+
|
128
|
+
def id_pokl
|
129
|
+
options[:id_pokl] || receipt.id_pokl || EET_CZ.config.id_pokl
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module EET_CZ
|
3
|
+
module Response
|
4
|
+
class Base
|
5
|
+
attr_reader :doc, :uuid_zpravy, :bkp, :warnings
|
6
|
+
|
7
|
+
def initialize(doc)
|
8
|
+
@doc = doc
|
9
|
+
parse_warnings
|
10
|
+
parse_header
|
11
|
+
parse_data
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.parse(response)
|
15
|
+
response.remove_namespaces!
|
16
|
+
doc = response.at('Odpoved')
|
17
|
+
|
18
|
+
if doc.at('Potvrzeni')
|
19
|
+
EET_CZ::Response::Success.new(doc)
|
20
|
+
else
|
21
|
+
EET_CZ::Response::Error.new(doc)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def success?
|
26
|
+
raise('implement')
|
27
|
+
end
|
28
|
+
|
29
|
+
# If request was sent to Playground Endpoint
|
30
|
+
def test?
|
31
|
+
@test.present?
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def parse_data
|
37
|
+
raise('implement')
|
38
|
+
end
|
39
|
+
|
40
|
+
def parse_header
|
41
|
+
@uuid_zpravy = header_attribute('uuid_zpravy')
|
42
|
+
@bkp = header_attribute('bkp')
|
43
|
+
end
|
44
|
+
|
45
|
+
def parse_warnings
|
46
|
+
@warnings = []
|
47
|
+
doc.search('Varovani').each do |warning|
|
48
|
+
@warnings << EET_CZ::Response::Warning.new(warning)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def header_attribute(attr)
|
53
|
+
doc.at('Hlavicka').attributes[attr].try(:value)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module EET_CZ
|
3
|
+
module Response
|
4
|
+
class Error < Base
|
5
|
+
attr_reader :dat_odmit, :kod, :error
|
6
|
+
|
7
|
+
def success?
|
8
|
+
test? && kod.zero?
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def parse_data
|
14
|
+
@test = inner_doc.attributes['test'].try(:value)
|
15
|
+
@kod = inner_doc.attributes['kod'].try(:value).try(:to_i)
|
16
|
+
@error = inner_doc.text
|
17
|
+
@dat_odmit = header_attribute('dat_odmit')
|
18
|
+
end
|
19
|
+
|
20
|
+
def inner_doc
|
21
|
+
@inner_doc ||= doc.at('Chyba')
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module EET_CZ
|
3
|
+
module Response
|
4
|
+
class Success < Base
|
5
|
+
attr_reader :fik, :dat_prij
|
6
|
+
|
7
|
+
def success?
|
8
|
+
true
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def parse_data
|
14
|
+
@fik = inner_doc.attributes['fik'].try(:value)
|
15
|
+
@test = inner_doc.attributes['test'].try(:value)
|
16
|
+
@dat_prij = header_attribute('dat_prij')
|
17
|
+
end
|
18
|
+
|
19
|
+
def inner_doc
|
20
|
+
@inner_doc ||= doc.at('Potvrzeni')
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,219 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://fs.mfcr.cz/eet/schema/v3" elementFormDefault="qualified" targetNamespace="http://fs.mfcr.cz/eet/schema/v3" version="3.0">
|
3
|
+
|
4
|
+
<xs:element name="Trzba" type="tns:TrzbaType"/>
|
5
|
+
|
6
|
+
<xs:complexType name="TrzbaType">
|
7
|
+
<xs:sequence>
|
8
|
+
<xs:element maxOccurs="1" minOccurs="1" name="Hlavicka" type="tns:TrzbaHlavickaType"/>
|
9
|
+
<xs:element maxOccurs="1" minOccurs="1" name="Data" type="tns:TrzbaDataType"/>
|
10
|
+
<xs:element maxOccurs="1" minOccurs="1" name="KontrolniKody" type="tns:TrzbaKontrolniKodyType"/>
|
11
|
+
</xs:sequence>
|
12
|
+
</xs:complexType>
|
13
|
+
|
14
|
+
<xs:complexType name="TrzbaHlavickaType">
|
15
|
+
<xs:attribute name="uuid_zpravy" type="tns:UUIDType" use="required"/>
|
16
|
+
<xs:attribute name="dat_odesl" type="tns:dateTime" use="required"/>
|
17
|
+
<xs:attribute name="prvni_zaslani" type="xs:boolean" use="required"/>
|
18
|
+
<xs:attribute name="overeni" type="xs:boolean" use="optional"/>
|
19
|
+
</xs:complexType>
|
20
|
+
|
21
|
+
<xs:complexType name="TrzbaDataType">
|
22
|
+
<xs:attribute name="dic_popl" type="tns:CZDICType" use="required"/>
|
23
|
+
<xs:attribute name="dic_poverujiciho" type="tns:CZDICType" use="optional"/>
|
24
|
+
<xs:attribute name="id_provoz" type="tns:IdProvozType" use="required"/>
|
25
|
+
<xs:attribute name="id_pokl" type="tns:string" use="required"/>
|
26
|
+
<xs:attribute name="porad_cis" type="tns:string" use="required"/>
|
27
|
+
<xs:attribute name="dat_trzby" type="tns:dateTime" use="required"/>
|
28
|
+
<xs:attribute name="celk_trzba" type="tns:CastkaType" use="required"/>
|
29
|
+
<xs:attribute name="zakl_nepodl_dph" type="tns:CastkaType" use="optional"/>
|
30
|
+
<xs:attribute name="zakl_dan1" type="tns:CastkaType" use="optional"/>
|
31
|
+
<xs:attribute name="dan1" type="tns:CastkaType" use="optional"/>
|
32
|
+
<xs:attribute name="zakl_dan2" type="tns:CastkaType" use="optional"/>
|
33
|
+
<xs:attribute name="dan2" type="tns:CastkaType" use="optional"/>
|
34
|
+
<xs:attribute name="zakl_dan3" type="tns:CastkaType" use="optional"/>
|
35
|
+
<xs:attribute name="dan3" type="tns:CastkaType" use="optional"/>
|
36
|
+
<xs:attribute name="cest_sluz" type="tns:CastkaType" use="optional"/>
|
37
|
+
<xs:attribute name="pouzit_zboz1" type="tns:CastkaType" use="optional"/>
|
38
|
+
<xs:attribute name="pouzit_zboz2" type="tns:CastkaType" use="optional"/>
|
39
|
+
<xs:attribute name="pouzit_zboz3" type="tns:CastkaType" use="optional"/>
|
40
|
+
<xs:attribute name="urceno_cerp_zuct" type="tns:CastkaType" use="optional"/>
|
41
|
+
<xs:attribute name="cerp_zuct" type="tns:CastkaType" use="optional"/>
|
42
|
+
<xs:attribute name="rezim" type="tns:RezimType" use="required"/>
|
43
|
+
</xs:complexType>
|
44
|
+
|
45
|
+
<xs:complexType name="TrzbaKontrolniKodyType">
|
46
|
+
<xs:sequence>
|
47
|
+
<xs:element maxOccurs="1" minOccurs="1" name="pkp" type="tns:PkpElementType"/>
|
48
|
+
<xs:element maxOccurs="1" minOccurs="1" name="bkp" type="tns:BkpElementType"/>
|
49
|
+
</xs:sequence>
|
50
|
+
</xs:complexType>
|
51
|
+
|
52
|
+
<xs:complexType mixed="true" name="PkpElementType">
|
53
|
+
<xs:simpleContent>
|
54
|
+
<xs:extension base="tns:PkpType">
|
55
|
+
<xs:attribute name="digest" type="tns:PkpDigestType" use="required"/>
|
56
|
+
<xs:attribute name="cipher" type="tns:PkpCipherType" use="required"/>
|
57
|
+
<xs:attribute name="encoding" type="tns:PkpEncodingType" use="required"/>
|
58
|
+
</xs:extension>
|
59
|
+
</xs:simpleContent>
|
60
|
+
</xs:complexType>
|
61
|
+
|
62
|
+
<xs:complexType mixed="true" name="BkpElementType">
|
63
|
+
<xs:simpleContent>
|
64
|
+
<xs:extension base="tns:BkpType">
|
65
|
+
<xs:attribute name="digest" type="tns:BkpDigestType" use="required"/>
|
66
|
+
<xs:attribute name="encoding" type="tns:BkpEncodingType" use="required"/>
|
67
|
+
</xs:extension>
|
68
|
+
</xs:simpleContent>
|
69
|
+
</xs:complexType>
|
70
|
+
|
71
|
+
<xs:element name="Odpoved" type="tns:OdpovedType"/>
|
72
|
+
|
73
|
+
<xs:complexType name="OdpovedType">
|
74
|
+
<xs:sequence>
|
75
|
+
<xs:element maxOccurs="1" minOccurs="1" name="Hlavicka" type="tns:OdpovedHlavickaType"/>
|
76
|
+
<xs:choice maxOccurs="1" minOccurs="1">
|
77
|
+
<xs:element name="Potvrzeni" type="tns:OdpovedPotvrzeniType"/>
|
78
|
+
<xs:element name="Chyba" type="tns:OdpovedChybaType"/>
|
79
|
+
</xs:choice>
|
80
|
+
<xs:element maxOccurs="10" minOccurs="0" name="Varovani" type="tns:OdpovedVarovaniType"/>
|
81
|
+
</xs:sequence>
|
82
|
+
</xs:complexType>
|
83
|
+
|
84
|
+
<xs:complexType name="OdpovedHlavickaType">
|
85
|
+
<xs:attribute name="uuid_zpravy" type="tns:UUIDType" use="optional"/>
|
86
|
+
<xs:attribute name="bkp" type="tns:BkpType" use="optional"/>
|
87
|
+
<xs:attribute name="dat_prij" type="tns:dateTime" use="optional"/>
|
88
|
+
<xs:attribute name="dat_odmit" type="tns:dateTime" use="optional"/>
|
89
|
+
</xs:complexType>
|
90
|
+
|
91
|
+
<xs:complexType name="OdpovedPotvrzeniType">
|
92
|
+
<xs:attribute name="fik" type="tns:FikType" use="required"/>
|
93
|
+
<xs:attribute name="test" type="xs:boolean" use="optional"/>
|
94
|
+
</xs:complexType>
|
95
|
+
|
96
|
+
<xs:complexType mixed="true" name="OdpovedChybaType">
|
97
|
+
<xs:attribute name="kod" type="tns:KodChybaType" use="required"/>
|
98
|
+
<xs:attribute name="test" type="xs:boolean" use="optional"/>
|
99
|
+
</xs:complexType>
|
100
|
+
|
101
|
+
<xs:complexType mixed="true" name="OdpovedVarovaniType">
|
102
|
+
<xs:attribute name="kod_varov" type="tns:KodVarovType" use="required"/>
|
103
|
+
</xs:complexType>
|
104
|
+
|
105
|
+
<xs:simpleType name="string">
|
106
|
+
<xs:restriction base="xs:string">
|
107
|
+
<xs:pattern value="[0-9a-zA-Z\.,:;/#\-_ ]{1,20}"/>
|
108
|
+
</xs:restriction>
|
109
|
+
</xs:simpleType>
|
110
|
+
|
111
|
+
<xs:simpleType name="dateTime">
|
112
|
+
<xs:restriction base="xs:dateTime">
|
113
|
+
<xs:pattern value="\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(Z|[+\-]\d\d:\d\d)"/>
|
114
|
+
</xs:restriction>
|
115
|
+
</xs:simpleType>
|
116
|
+
|
117
|
+
<xs:simpleType name="CastkaType">
|
118
|
+
<xs:restriction base="xs:decimal">
|
119
|
+
<xs:minExclusive value="-100000000" />
|
120
|
+
<xs:maxExclusive value="100000000" />
|
121
|
+
<xs:pattern value="((0|-?[1-9]\d{0,7})\.\d\d|-0\.(0[1-9]|[1-9]\d))" />
|
122
|
+
</xs:restriction>
|
123
|
+
</xs:simpleType>
|
124
|
+
|
125
|
+
<xs:simpleType name="IdProvozType">
|
126
|
+
<xs:restriction base="xs:int">
|
127
|
+
<xs:minInclusive value="1" />
|
128
|
+
<xs:maxInclusive value="999999" />
|
129
|
+
</xs:restriction>
|
130
|
+
</xs:simpleType>
|
131
|
+
|
132
|
+
<xs:simpleType name="RezimType">
|
133
|
+
<xs:restriction base="xs:int">
|
134
|
+
<xs:enumeration value="0"/>
|
135
|
+
<xs:enumeration value="1"/>
|
136
|
+
</xs:restriction>
|
137
|
+
</xs:simpleType>
|
138
|
+
|
139
|
+
<xs:simpleType name="KodChybaType">
|
140
|
+
<xs:restriction base="xs:int">
|
141
|
+
<xs:minInclusive value="-999" />
|
142
|
+
<xs:maxInclusive value="999" />
|
143
|
+
</xs:restriction>
|
144
|
+
</xs:simpleType>
|
145
|
+
|
146
|
+
<xs:simpleType name="KodVarovType">
|
147
|
+
<xs:restriction base="xs:int">
|
148
|
+
<xs:minInclusive value="1" />
|
149
|
+
<xs:maxInclusive value="999" />
|
150
|
+
</xs:restriction>
|
151
|
+
</xs:simpleType>
|
152
|
+
|
153
|
+
<xs:simpleType name="UUIDType">
|
154
|
+
<xs:restriction base="xs:string">
|
155
|
+
<xs:pattern value="[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}">
|
156
|
+
</xs:pattern>
|
157
|
+
<xs:length value="36"/>
|
158
|
+
</xs:restriction>
|
159
|
+
</xs:simpleType>
|
160
|
+
|
161
|
+
<xs:simpleType name="CZDICType">
|
162
|
+
<xs:restriction base="xs:string">
|
163
|
+
<xs:pattern value="CZ[0-9]{8,10}"/>
|
164
|
+
</xs:restriction>
|
165
|
+
</xs:simpleType>
|
166
|
+
|
167
|
+
<xs:simpleType name="PkpType">
|
168
|
+
<xs:restriction base="xs:base64Binary">
|
169
|
+
<xs:length value="256"/>
|
170
|
+
</xs:restriction>
|
171
|
+
</xs:simpleType>
|
172
|
+
|
173
|
+
<xs:simpleType name="PkpDigestType">
|
174
|
+
<xs:restriction base="xs:string">
|
175
|
+
<xs:enumeration value="SHA256"/>
|
176
|
+
</xs:restriction>
|
177
|
+
</xs:simpleType>
|
178
|
+
|
179
|
+
<xs:simpleType name="PkpCipherType">
|
180
|
+
<xs:restriction base="xs:string">
|
181
|
+
<xs:enumeration value="RSA2048"/>
|
182
|
+
</xs:restriction>
|
183
|
+
</xs:simpleType>
|
184
|
+
|
185
|
+
<xs:simpleType name="PkpEncodingType">
|
186
|
+
<xs:restriction base="xs:string">
|
187
|
+
<xs:enumeration value="base64"/>
|
188
|
+
</xs:restriction>
|
189
|
+
</xs:simpleType>
|
190
|
+
|
191
|
+
<xs:simpleType name="BkpType">
|
192
|
+
<xs:restriction base="xs:string">
|
193
|
+
<xs:pattern value="[0-9a-fA-F]{8}-[0-9a-fA-F]{8}-[0-9a-fA-F]{8}-[0-9a-fA-F]{8}-[0-9a-fA-F]{8}">
|
194
|
+
</xs:pattern>
|
195
|
+
<xs:length value="44"></xs:length>
|
196
|
+
<xs:whiteSpace value="collapse"></xs:whiteSpace>
|
197
|
+
</xs:restriction>
|
198
|
+
</xs:simpleType>
|
199
|
+
|
200
|
+
<xs:simpleType name="BkpDigestType">
|
201
|
+
<xs:restriction base="xs:string">
|
202
|
+
<xs:enumeration value="SHA1"/>
|
203
|
+
</xs:restriction>
|
204
|
+
</xs:simpleType>
|
205
|
+
|
206
|
+
<xs:simpleType name="BkpEncodingType">
|
207
|
+
<xs:restriction base="xs:string">
|
208
|
+
<xs:enumeration value="base16"/>
|
209
|
+
</xs:restriction>
|
210
|
+
</xs:simpleType>
|
211
|
+
|
212
|
+
<xs:simpleType name="FikType">
|
213
|
+
<xs:restriction base="xs:string">
|
214
|
+
<xs:pattern value="[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}-[0-9a-fA-F]{2}">
|
215
|
+
</xs:pattern>
|
216
|
+
<xs:length value="39"/>
|
217
|
+
</xs:restriction>
|
218
|
+
</xs:simpleType>
|
219
|
+
</xs:schema>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://fs.mfcr.cz/eet/schema/v3" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="EET" targetNamespace="http://fs.mfcr.cz/eet/schema/v3">
|
2
|
+
<wsdl:documentation>
|
3
|
+
Ucel : Sluzba pro odeslani datove zpravy evidovane trzby Verze : 3.1 Vlastnik : Generalni financni reditelstvi
|
4
|
+
</wsdl:documentation>
|
5
|
+
<wsdl:types>
|
6
|
+
<xsd:schema>
|
7
|
+
<xsd:import namespace="http://fs.mfcr.cz/eet/schema/v3" schemaLocation="EETXMLSchema.xsd"/>
|
8
|
+
</xsd:schema>
|
9
|
+
</wsdl:types>
|
10
|
+
<wsdl:message name="OdeslaniTrzbyRequest">
|
11
|
+
<wsdl:part element="tns:Trzba" name="parameters"/>
|
12
|
+
</wsdl:message>
|
13
|
+
<wsdl:message name="OdeslaniTrzbyResponse">
|
14
|
+
<wsdl:part element="tns:Odpoved" name="parameters"/>
|
15
|
+
</wsdl:message>
|
16
|
+
<wsdl:portType name="EET">
|
17
|
+
<wsdl:operation name="OdeslaniTrzby">
|
18
|
+
<wsdl:input message="tns:OdeslaniTrzbyRequest"/>
|
19
|
+
<wsdl:output message="tns:OdeslaniTrzbyResponse"/>
|
20
|
+
</wsdl:operation>
|
21
|
+
</wsdl:portType>
|
22
|
+
<wsdl:binding name="EETSOAP" type="tns:EET">
|
23
|
+
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
24
|
+
<wsdl:operation name="OdeslaniTrzby">
|
25
|
+
<soap:operation soapAction="http://fs.mfcr.cz/eet/OdeslaniTrzby"/>
|
26
|
+
<wsdl:input>
|
27
|
+
<soap:body use="literal"/>
|
28
|
+
</wsdl:input>
|
29
|
+
<wsdl:output>
|
30
|
+
<soap:body use="literal"/>
|
31
|
+
</wsdl:output>
|
32
|
+
</wsdl:operation>
|
33
|
+
</wsdl:binding>
|
34
|
+
<wsdl:service name="EETService">
|
35
|
+
<wsdl:port binding="tns:EETSOAP" name="EETServiceSOAP">
|
36
|
+
<soap:address location="https://pg.eet.cz:443/eet/services/EETServiceSOAP/v3/"/>
|
37
|
+
</wsdl:port>
|
38
|
+
</wsdl:service>
|
39
|
+
</wsdl:definitions>
|
data/ruby-eet-cz.gemspec
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'eet_cz/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'ruby-eet-cz'
|
8
|
+
spec.version = EET_CZ::VERSION
|
9
|
+
spec.authors = ['Jan Uhlar']
|
10
|
+
spec.email = ['ciihla@seznam.cz']
|
11
|
+
|
12
|
+
spec.summary = 'EET wrapper for ruby'
|
13
|
+
spec.description = 'EET wrapper for ruby'
|
14
|
+
spec.homepage = 'https://github.com/ciihla/ruby-eet-cz'
|
15
|
+
spec.license = 'MIT'
|
16
|
+
|
17
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
|
+
raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.' unless spec.respond_to?(:metadata)
|
20
|
+
|
21
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
22
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
|
+
spec.require_paths = ['lib']
|
24
|
+
|
25
|
+
spec.add_development_dependency 'rubocop', '~> 0.46'
|
26
|
+
spec.add_development_dependency 'bundler', '~> 1.12'
|
27
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
28
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
29
|
+
spec.add_development_dependency 'webmock', '~> 2.3'
|
30
|
+
spec.add_development_dependency 'vcr', '~> 3.0'
|
31
|
+
spec.add_runtime_dependency 'activesupport', '~> 5.0'
|
32
|
+
spec.add_runtime_dependency 'activemodel', '~> 5.0'
|
33
|
+
spec.add_runtime_dependency 'savon', '~> 2.11.0'
|
34
|
+
end
|
metadata
ADDED
@@ -0,0 +1,195 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ruby-eet-cz
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0.pre
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jan Uhlar
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-02-05 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rubocop
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.46'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.46'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.12'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.12'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: webmock
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '2.3'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '2.3'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: vcr
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '3.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '3.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: activesupport
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '5.0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '5.0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: activemodel
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '5.0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '5.0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: savon
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 2.11.0
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 2.11.0
|
139
|
+
description: EET wrapper for ruby
|
140
|
+
email:
|
141
|
+
- ciihla@seznam.cz
|
142
|
+
executables: []
|
143
|
+
extensions: []
|
144
|
+
extra_rdoc_files: []
|
145
|
+
files:
|
146
|
+
- ".gitignore"
|
147
|
+
- ".rspec"
|
148
|
+
- ".rubocop.yml"
|
149
|
+
- ".travis.yml"
|
150
|
+
- Gemfile
|
151
|
+
- LICENSE.txt
|
152
|
+
- README.md
|
153
|
+
- Rakefile
|
154
|
+
- bin/console
|
155
|
+
- bin/setup
|
156
|
+
- lib/eet_cz.rb
|
157
|
+
- lib/eet_cz/akami_patch.rb
|
158
|
+
- lib/eet_cz/client.rb
|
159
|
+
- lib/eet_cz/concerns/available_attributes.rb
|
160
|
+
- lib/eet_cz/concerns/true_value.rb
|
161
|
+
- lib/eet_cz/receipt.rb
|
162
|
+
- lib/eet_cz/request.rb
|
163
|
+
- lib/eet_cz/response/base.rb
|
164
|
+
- lib/eet_cz/response/error.rb
|
165
|
+
- lib/eet_cz/response/success.rb
|
166
|
+
- lib/eet_cz/response/warning.rb
|
167
|
+
- lib/eet_cz/version.rb
|
168
|
+
- lib/wsdl/v3/EETXMLSchema.xsd
|
169
|
+
- lib/wsdl/v3/eet_wsdl.wsdl
|
170
|
+
- ruby-eet-cz.gemspec
|
171
|
+
homepage: https://github.com/ciihla/ruby-eet-cz
|
172
|
+
licenses:
|
173
|
+
- MIT
|
174
|
+
metadata: {}
|
175
|
+
post_install_message:
|
176
|
+
rdoc_options: []
|
177
|
+
require_paths:
|
178
|
+
- lib
|
179
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
180
|
+
requirements:
|
181
|
+
- - ">="
|
182
|
+
- !ruby/object:Gem::Version
|
183
|
+
version: '0'
|
184
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
185
|
+
requirements:
|
186
|
+
- - ">"
|
187
|
+
- !ruby/object:Gem::Version
|
188
|
+
version: 1.3.1
|
189
|
+
requirements: []
|
190
|
+
rubyforge_project:
|
191
|
+
rubygems_version: 2.5.2
|
192
|
+
signing_key:
|
193
|
+
specification_version: 4
|
194
|
+
summary: EET wrapper for ruby
|
195
|
+
test_files: []
|