Class: BrNfe::Base
Instance Attribute Summary collapse
Instance Method Summary
collapse
#emitente, #emitente=
#assign_attributes, #default_values, #initialize
Instance Attribute Details
#certificate_pkcs12_password ⇒ Object
Returns the value of attribute certificate_pkcs12_password.
6
7
8
|
# File 'lib/br_nfe/base.rb', line 6
def certificate_pkcs12_password
@certificate_pkcs12_password
end
|
#certificate_pkcs12_path ⇒ Object
Returns the value of attribute certificate_pkcs12_path.
7
8
9
|
# File 'lib/br_nfe/base.rb', line 7
def certificate_pkcs12_path
@certificate_pkcs12_path
end
|
#certificate_pkcs12_value ⇒ Object
Caso não tenha o certificate_pkcs12 salvo em arquivo, pode setar a string do certificate_pkcs12 direto pelo atributo certificate_pkcs12_value Caso tenha o certificate_pkcs12 em arquivo, basta setar o atributo certificate_pkcs12_path e deixar o atributo certificate_pkcs12_value em branco
20
21
22
|
# File 'lib/br_nfe/base.rb', line 20
def certificate_pkcs12_value
@certificate_pkcs12_value
end
|
#env ⇒ Object
Returns the value of attribute env.
24
25
26
|
# File 'lib/br_nfe/base.rb', line 24
def env
@env
end
|
Instance Method Details
#certificado_obrigatorio? ⇒ Boolean
Método que deve ser sobrescrito para as ações que necessitam do certificate_pkcs12 para assinatura
14
15
16
|
# File 'lib/br_nfe/base.rb', line 14
def certificado_obrigatorio?
false
end
|
#certificate ⇒ Object
96
97
98
|
# File 'lib/br_nfe/base.rb', line 96
def certificate
@certificate ||= certificate_pkcs12.try :certificate
end
|
#certificate=(value) ⇒ Object
92
93
94
|
# File 'lib/br_nfe/base.rb', line 92
def certificate=(value)
@certificate = value
end
|
#certificate_key ⇒ Object
100
101
102
|
# File 'lib/br_nfe/base.rb', line 100
def certificate_key
@certificate_key ||= certificate_pkcs12.try :key
end
|
#certificate_key=(value) ⇒ Object
104
105
106
|
# File 'lib/br_nfe/base.rb', line 104
def certificate_key=(value)
@certificate_key = value
end
|
#certificate_pkcs12 ⇒ Object
63
64
65
66
|
# File 'lib/br_nfe/base.rb', line 63
def certificate_pkcs12
@certificate_pkcs12 ||= OpenSSL::PKCS12.new(certificate_pkcs12_value, certificate_pkcs12_password)
rescue
end
|
#certificate_pkcs12=(value) ⇒ Object
68
69
70
|
# File 'lib/br_nfe/base.rb', line 68
def certificate_pkcs12=(value)
@certificate_pkcs12 = value
end
|
#client_wsdl ⇒ Object
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
# File 'lib/br_nfe/base.rb', line 76
def client_wsdl
@client_wsdl ||= Savon.client({
namespaces: namespaces,
env_namespace: env_namespace,
wsdl: wsdl,
namespace_identifier: namespace_identifier,
encoding: wsdl_encoding,
log: BrNfe.client_wsdl_log,
pretty_print_xml: BrNfe.client_wsdl_pretty_print_xml,
ssl_verify_mode: BrNfe.client_wsdl_ssl_verify_mode,
ssl_cert_file: BrNfe.client_wsdl_ssl_cert_file,
ssl_cert_key_file: BrNfe.client_wsdl_ssl_cert_key_file,
ssl_cert_key_password: BrNfe.client_wsdl_ssl_cert_key_password
})
end
|
#env_namespace ⇒ Object
43
44
45
|
# File 'lib/br_nfe/base.rb', line 43
def env_namespace
:soapenv
end
|
#method_wsdl ⇒ Object
47
48
49
|
# File 'lib/br_nfe/base.rb', line 47
def method_wsdl
raise "Não implementado."
end
|
#namespace_identifier ⇒ Object
55
56
57
|
# File 'lib/br_nfe/base.rb', line 55
def namespace_identifier
raise 'Não implementado.'
end
|
#namespaces ⇒ Object
59
60
61
|
# File 'lib/br_nfe/base.rb', line 59
def namespaces
{}
end
|
#original_response ⇒ Object
30
31
32
|
# File 'lib/br_nfe/base.rb', line 30
def original_response
@original_response
end
|
#response ⇒ Object
35
36
37
|
# File 'lib/br_nfe/base.rb', line 35
def response
@response
end
|
#wsdl ⇒ Object
39
40
41
|
# File 'lib/br_nfe/base.rb', line 39
def wsdl
raise "Não implementado."
end
|
#wsdl_encoding ⇒ Object
72
73
74
|
# File 'lib/br_nfe/base.rb', line 72
def wsdl_encoding
"UTF-8"
end
|
#xml_builder ⇒ Object
51
52
53
|
# File 'lib/br_nfe/base.rb', line 51
def xml_builder
raise "Não implementado."
end
|