Module: Eet

Defined in:
lib/eet.rb,
lib/eet/utils.rb,
lib/eet/sender.rb,
lib/eet/message.rb,
lib/eet/version.rb

Defined Under Namespace

Modules: Utils Classes: Message, Sender

Constant Summary collapse

VERSION =
'0.2.2'

Class Method Summary collapse

Class Method Details

.playground_certificateObject



25
26
27
28
# File 'lib/eet.rb', line 25

def self.playground_certificate
  cert = File.join(File.dirname(__dir__), 'spec', 'fixtures', 'EET_CA1_Playground-CZ00000019.p12')
  OpenSSL::PKCS12.new(File.open(cert), 'eet')
end

.test_playgroundObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/eet.rb', line 7

def self.test_playground
  data = { celk_trzba: '0.00',
           dic_popl: 'CZ00000019',
           id_pokl: 'p1',
           id_provoz: '11',
           porad_cis: '1' }

  message = Message.new(data)

  message.pkp = Utils.create_pkp(message, playground_certificate)
  message.bkp = Utils.create_bkp(message.pkp)

  signed_message = Utils.sign(message.to_xml, playground_certificate)

  sender = Sender.new
  response = sender.send_to_playground(signed_message)
end