Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
4 changes: 2 additions & 2 deletions estonian_e_invoice.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ require 'e_invoice/version'
Gem::Specification.new do |spec|
spec.name = 'e_invoice'
spec.version = EInvoice::VERSION
spec.authors = ['Artur Beljajev', 'Maciej Szlosarczyk', 'Sergei Tsõganov']
spec.email = ['artur.beljajev@internet.ee', 'maciej.szlosarczyk@internet.ee', 'sergei.tsoganov@internet.ee']
spec.authors = ['Artur Beljajev', 'Maciej Szlosarczyk', 'Sergei Tsõganov', 'Oleg Hasjanov']
spec.email = ['artur.beljajev@internet.ee', 'maciej.szlosarczyk@internet.ee', 'sergei.tsoganov@internet.ee', 'oleg.hasjanov@internet.ee']
spec.summary = 'Ruby API for generating and delivering Estonian e-invoices'
spec.homepage = 'https://github.com/internetee/e_invoice'
spec.license = 'MIT'
Expand Down
13 changes: 10 additions & 3 deletions lib/e_invoice/providers/omniva_provider.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
require 'logger'

module EInvoice
module Providers
class OmnivaProvider
attr_reader :config, :soap_client
attr_reader :config, :soap_client, :logger

def initialize(provider_config_user)
def initialize(provider_config_user, logger = nil)
@config = OpenStruct.new(provider_config.merge(provider_config_user))
@soap_client = Savon.client(wsdl: wsdl)
@logger = logger || Logger.new($stdout)
end

def wsdl
Expand All @@ -18,7 +21,11 @@ def wsdl

def deliver(e_invoice)
message = normalize_e_invoice_xml(e_invoice.to_xml)
soap_client.call(soap_operation, attributes: soap_attributes, message: message)
logger.info("[OmnivaProvider] Sending e-invoice with message: #{message}")
logger.info("[OmnivaProvider] SOAP attributes: #{soap_attributes}")
response = soap_client.call(soap_operation, attributes: soap_attributes, message: message)
logger.info("[OmnivaProvider] Received response: #{response.body}")
response
end

private
Expand Down
2 changes: 1 addition & 1 deletion lib/e_invoice/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module EInvoice
VERSION = '0.1.5'.freeze
VERSION = '0.1.6'.freeze
end
Binary file added test/.DS_Store
Binary file not shown.
Loading