Class: SignatureDfe::NFe
- Inherits:
-
Object
- Object
- SignatureDfe::NFe
- Defined in:
- lib/signature_dfe/nfe.rb,
lib/signature_dfe/evento_nfe.rb
Defined Under Namespace
Classes: Event
Class Method Summary collapse
Class Method Details
.digest_value(xml) ⇒ Object
5 6 7 |
# File 'lib/signature_dfe/nfe.rb', line 5 def self.digest_value(xml) SignatureDfe::Xml.calc_digest_value('infNFe', xml) end |
.sign(xml) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/signature_dfe/nfe.rb', line 9 def self.sign(xml) digest_value_ = digest_value xml ch_nfe = SignatureDfe::Xml.namespace_value('Id', xml).scan(/\d{44}/)[0] = { id: "NFe#{ch_nfe}", digest_value: digest_value_, signature_value: signature_value(ch_nfe, digest_value_) } SignatureDfe::Xml.build_signature() end |
.signature_value(ch_nfe, digest_value) ⇒ Object
20 21 22 |
# File 'lib/signature_dfe/nfe.rb', line 20 def self.signature_value(ch_nfe, digest_value) SignatureDfe::Xml.build_signed_info("NFe#{ch_nfe}", digest_value) end |