Sha256: 6226f39adecb042c38416c6be8ed3d9b75914053b6c58952ac82580f20bb78c8

Contents?: true

Size: 1.1 KB

Versions: 1

Compression:

Stored size: 1.1 KB

Contents

# MoneyXmlValidator

Ruby validator for Money S3 XML documents. Takes in Money S3 XML document, validates it against official schema, and returns errors.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'money_xml_validator'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install money_xml_validator

## Usage

Valid document:
```ruby
xml = File.read('valid_invoices.xml')
errors = MoneyXmlValidator.validate(xml)
# => []
```

Invalid document:
```ruby
xml = File.read('invalid_invoices.xml')
errors = MoneyXmlValidator.validate(xml)
# => [#<Nokogiri::XML::SyntaxError: 6:0: ERROR: Element 'nonsense': This element is not expected. Expected is one of ( Doklad, ZpusobUctovani, Storno, Del, GUID, Rada, CisRada, UDoklad, Popis, Vystaveno ).>]
```

## Changelog

### 17.12.2019 - gem v 1.0.0

* update money xsd submodules

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/money_xml_validator.

## License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
money_xml_validator-1.0.0 README.md