CfdiProcessor
Extracts the information from the CFDI (Mexico) and converts it into a hash.
Installation
Add this line to your application's Gemfile:
gem 'cfdi_processor'
And then execute:
$ bundle
Or install it yourself as:
$ gem install cfdi_processor
Usage
Extract CFDI Data
Create an instance of CfdiProcessor::StampedExtractor
and pass to it a xml string.
xml_data = CfdiProcessor::StampedExtractor.new(xml_string)
To access to the data extracted.
# => Execute the instance methods
xml_data.receipt
xml_data.issuer
xml_data.receiver
xml_data.concepts
xml_data.taxes
To access to the XML string and Nokogiri document.
# =>
xml_data.xml
# =>
xml_data.nokogiri_xml
Contributing
Bug report or pull request are welcome. Make a pull request:
- Clone the repo
- Create a new feature branch
- Commit your changes
- Push the new branch
- Create new pull-request
Please write tests if necessary.
License
The gem is available as open source under the terms of the MIT License.