nav_online_invoice 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: bd02bc8f8dcea9cf478031dcafad1e099591e3e3098c40d4d64e0215e26f56ce
4
+ data.tar.gz: 0ac862ca1d4abfd4cf075400ba3e714dbb8fa825740f51e6f6ec10159200a49d
5
+ SHA512:
6
+ metadata.gz: cfd0c85e4486841e099ef1646a323d9bc24b29655509b59d03644279e5d04947c0466af8fb81aba9e0d391f0d101fb5d06180e651aeef12e57952732376cd7b8
7
+ data.tar.gz: 36ceb2fa32c89863216098dd1ca3c7fdd562b9f7dae0403d61399ccbed164972d42241f0ec427cf628f5dd33818430e59d361c8233fbe618a68f1d1faeb10e26
data/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented in this file.
4
+ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
5
+ and the project adheres to [Semantic Versioning](https://semver.org/).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.0.1] - 2026-11-17
10
+
11
+ ### Added
12
+
13
+ - Project skeleton: gemspec, RSpec, RuboCop, GitHub Actions CI. No public API yet.
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026 Pálfy Zoltán
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,92 @@
1
+ # nav_online_invoice
2
+
3
+ Ruby client for the Hungarian Tax Authority's (NAV) **Online Invoice API v3.0** (*Online Számla*).
4
+
5
+ > **Status: early development.** Version 0.0.1 is a project skeleton with no public API yet.
6
+ > The first usable release will provide `queryTaxpayer` (tax number lookup).
7
+
8
+ ## Goals
9
+
10
+ - **Plain Ruby, Rails optional.** Works in any Ruby process; an optional Railtie wires up the Rails logger.
11
+ - **Per-client configuration.** One process can talk to NAV on behalf of several taxpayers, each with its
12
+ own technical user. A global configuration is available as a convenience.
13
+ - **Few dependencies.** `Net::HTTP` and `openssl` from the standard library; the only runtime dependency is
14
+ `nokogiri`, which ships precompiled for Linux, macOS and Windows.
15
+ - **Safe by default.** Every request gets a fresh request ID and signature (also on retry), outgoing XML is
16
+ validated against NAV's official XSD schemas, requests are rate limited, and credentials never appear in
17
+ logs or `inspect` output.
18
+ - **Typed errors.** Errors are mapped from NAV's `errorCode`, not the HTTP status, and tell you whether a
19
+ retry makes sense.
20
+
21
+ ## Planned API
22
+
23
+ ```ruby
24
+ require "nav_online_invoice"
25
+
26
+ config = NavOnlineInvoice::Configuration.new(
27
+ environment: :test, # :test or :production
28
+ login: "...",
29
+ password: "...",
30
+ signature_key: "...",
31
+ tax_number: "12345678", # 8-digit tax number of the technical user's company
32
+ software: {
33
+ id: "HU12345678ABCDE-01", # exactly 18 characters, [0-9A-Z-]
34
+ name: "My invoicing app",
35
+ operation: :local_software, # or :online_service
36
+ main_version: "1.0",
37
+ dev_name: "...",
38
+ dev_contact: "..."
39
+ }
40
+ )
41
+
42
+ client = NavOnlineInvoice::Client.new(config)
43
+ result = client.taxpayers.query("12345678")
44
+
45
+ result.valid? # => true if the tax number exists
46
+ result.taxpayer.name
47
+ ```
48
+
49
+ The API above is a design target and may change before 0.1.0.
50
+
51
+ ## Requirements
52
+
53
+ - Ruby 3.3 or newer (tested on 3.3, 3.4 and 4.0, on Linux and Windows)
54
+ - A NAV Online Invoice technical user. Test and production users are separate; register a test user at
55
+ <https://onlineszamla-test.nav.gov.hu>.
56
+
57
+ ## Installation
58
+
59
+ ```ruby
60
+ # Gemfile
61
+ gem "nav_online_invoice"
62
+ ```
63
+
64
+ ## Development
65
+
66
+ The development environment runs in Docker; Ruby is not needed on the host.
67
+
68
+ ```sh
69
+ bin/dev bundle install
70
+ bin/dev bundle exec rake # specs + RuboCop
71
+ RUBY_VERSION=3.3 bin/dev bundle exec rspec
72
+ ```
73
+
74
+ Never commit NAV credentials. Integration tests against the NAV test environment (planned) will read them
75
+ from a git-ignored `.env` file.
76
+
77
+ ### Releasing
78
+
79
+ 1. Update `VERSION` in `lib/nav_online_invoice/version.rb` and add a matching section to `CHANGELOG.md`.
80
+ 2. Run `bin/dev bundle exec rake release:check`.
81
+ 3. Tag and push: `git tag v0.1.0 && git push origin v0.1.0`. GitHub Actions publishes the gem to RubyGems
82
+ via trusted publishing.
83
+
84
+ ## References
85
+
86
+ - NAV Online Invoice specification, schemas and samples: <https://github.com/nav-gov-hu/Online-Invoice>
87
+ - NAV common schema (`Common-1.0.RC3` tag): <https://github.com/nav-gov-hu/Common>
88
+
89
+ ## License
90
+
91
+ Released under the [MIT License](LICENSE.txt). NAV's XML schemas, once bundled, are © Nemzeti Adó- és
92
+ Vámhivatal, also under the MIT License.
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module NavOnlineInvoice
4
+ VERSION = "0.0.1"
5
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "nav_online_invoice/version"
4
+
5
+ # Each client gets its own configuration, so one application can call the
6
+ # Online Invoice API for several companies.
7
+ #
8
+ # @see https://github.com/nav-gov-hu/Online-Invoice NAV API documentation
9
+ module NavOnlineInvoice
10
+ # Base class for all errors raised by this gem.
11
+ #
12
+ # Rescue this to handle any NAV-related failure in one place.
13
+ #
14
+ # @example
15
+ # begin
16
+ # client.taxpayers.query("12345678")
17
+ # rescue NavOnlineInvoice::Error => e
18
+ # logger.error(e.message)
19
+ # end
20
+ class Error < StandardError; end
21
+ end
metadata ADDED
@@ -0,0 +1,65 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: nav_online_invoice
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Pálfy Zoltán
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: nokogiri
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '1.16'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '1.16'
26
+ description: 'A dependency-light Ruby client for the Hungarian Tax Authority''s (NAV)
27
+ Online Invoice API v3.0: request signing, XSD validation, rate limiting and typed
28
+ errors. Works without Rails; an optional Railtie is provided for Rails applications.'
29
+ email:
30
+ - 58705226+kilozdazolik@users.noreply.github.com
31
+ executables: []
32
+ extensions: []
33
+ extra_rdoc_files: []
34
+ files:
35
+ - CHANGELOG.md
36
+ - LICENSE.txt
37
+ - README.md
38
+ - lib/nav_online_invoice.rb
39
+ - lib/nav_online_invoice/version.rb
40
+ homepage: https://github.com/kilozdazolik/nav-online-invoice
41
+ licenses:
42
+ - MIT
43
+ metadata:
44
+ source_code_uri: https://github.com/kilozdazolik/nav-online-invoice
45
+ changelog_uri: https://github.com/kilozdazolik/nav-online-invoice/blob/main/CHANGELOG.md
46
+ bug_tracker_uri: https://github.com/kilozdazolik/nav-online-invoice/issues
47
+ rubygems_mfa_required: 'true'
48
+ rdoc_options: []
49
+ require_paths:
50
+ - lib
51
+ required_ruby_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '3.3'
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ requirements: []
62
+ rubygems_version: 4.0.20
63
+ specification_version: 4
64
+ summary: Ruby client for the Hungarian NAV Online Invoice (Online Számla) API v3.0
65
+ test_files: []