Skip to content

Instantly share code, notes, and snippets.

@Ceda
Created November 1, 2017 16:46
Show Gist options
  • Save Ceda/36b0ef1344444ec018d8fcdfa683418e to your computer and use it in GitHub Desktop.
Save Ceda/36b0ef1344444ec018d8fcdfa683418e to your computer and use it in GitHub Desktop.
EET
require 'eet_cz'
client = EET_CZ::Client.new.tap do |c|
c.endpoint = EET_CZ::PG_EET_URL #EET_CZ::PROD_EET_URL
c.ssl_cert_file = Rails.root.join('EET_CA1_Playground-CZ00000019.p12')
c.ssl_cert_key_file = Rails.root.join('EET_CA1_Playground-CZ00000019.p12')
c.ssl_cert_key_password = 'eet'
c.overovaci_mod = true # It sends attribute: overeni='true' Or explicitly specify 'false'. `default: true`
c.debug_logger = Logger.new('log/eet.log') # or Logger.new($stdout) in tests?
c.dic_popl = 'CZ00000019' # dic_popl
c.id_provoz = '555' # id_provoz
c.zjednoduseny_rezim = false # `default: false`
end
receipt = client.build_receipt(dat_trzby: Time.current,
id_pokl: '/4432/D12',
porad_cis: '4/541/FR34',
celk_trzba: 25.5,
zakl_nepodl_dph: '', # Optional
zakl_dan1: '', # Optional
dan1: '' # Optional
)
request = client.build_request(receipt, prvni_zaslani: false) # default true
response = EET_CZ::Request.real! do
request.run
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment