Class: Ebics::User::Initiator

Inherits:
Client
  • Object
show all
Defined in:
lib/ebics/user/initiator.rb

Constant Summary

Constants inherited from Client

Client::BANK_NAME, Client::URL_EBICS_SERVER

Instance Attribute Summary

Attributes inherited from Client

#banks, #conf, #partners, #users

Instance Method Summary collapse

Methods inherited from Client

#create_bank, #create_partner, #create_user_directories, #initialize, #load_user, #log, #messages, #require_product, #require_user, #require_user_and_product, #t

Constructor Details

This class inherits a constructor from Ebics::Client

Instance Method Details

#run(options) ⇒ Object



25
26
27
28
29
# File 'lib/ebics/user/initiator.rb', line 25

def run(options)
  require_user_and_product(options)
  send_init_request(@user, @product)
  send_hia_request(@user, @product)
end

#send_hia_request(user, product) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/ebics/user/initiator.rb', line 15

def send_hia_request(user, product)
  return if user.initialized_hia?
  session = Java::OrgKopiEbicsSession.EbicsSession.new(user,conf)
  session.product = product
  keymanager = Java::OrgKopiEbicsClient.KeyManagement.new(session)
  conf.trace_manager.trace_directory = conf.get_transfer_trace_directory(user)
  keymanager.sendHIA nil
  user.initialized_hia = true
end

#send_init_request(user, product) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/ebics/user/initiator.rb', line 5

def send_init_request(user, product)
  return if user.initialized?
  session = Java::OrgKopiEbicsSession.EbicsSession.new(user,conf)
  session.product = product
  keymanager = Java::OrgKopiEbicsClient.KeyManagement.new(session)
  conf.trace_manager.trace_directory = conf.get_transfer_trace_directory(user)
  keymanager.sendINI nil
  user.initialized = true
end