{"id":21262811,"url":"https://github.com/michaelfranzl/ruby-insika","last_synced_at":"2025-03-15T07:43:55.636Z","repository":{"id":147443788,"uuid":"38901479","full_name":"michaelfranzl/ruby-insika","owner":"michaelfranzl","description":"Ruby library implementing the API of INSIKA (Cryptographic Tamper-proofing of Electronic Cash Registers) project","archived":false,"fork":false,"pushed_at":"2015-07-10T20:51:34.000Z","size":128,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-21T22:43:05.203Z","etag":null,"topics":["ruby-insika","ruby-library","sales","tim"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michaelfranzl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-10T20:49:15.000Z","updated_at":"2024-05-14T07:42:08.000Z","dependencies_parsed_at":"2023-03-31T13:13:15.784Z","dependency_job_id":null,"html_url":"https://github.com/michaelfranzl/ruby-insika","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelfranzl%2Fruby-insika","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelfranzl%2Fruby-insika/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelfranzl%2Fruby-insika/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelfranzl%2Fruby-insika/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaelfranzl","download_url":"https://codeload.github.com/michaelfranzl/ruby-insika/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243701314,"owners_count":20333616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ruby-insika","ruby-library","sales","tim"],"created_at":"2024-11-21T04:59:26.216Z","updated_at":"2025-03-15T07:43:55.599Z","avatar_url":"https://github.com/michaelfranzl.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"ruby-insika\n===========\n\nA Ruby library/gem implementing the full TIM (Tax Identification Module) API of the INSIKA (Cryptographic Tamper-proofing of Electronic Cash Registers) project. See http://insika.de/en for more information.\n\nCode maturity: Working alpha release without code documentation.\n\nCode has been tested on Debian Jessie with a physical INSIKA TIM smartcard, but should work in Windows too since the only dependency is the `smartcard` Ruby gem, which is a raw FFI interface to function calls in `winSCard.dll` (Windows) and `libpcsclite1` (Debian-like Linux distros). Latter Linux library has the same function calls as the Windows library.\n\nInstallation\n------------\n\nThis gem is not yet on rubygems.org. Development installs only by cloning this git repository.\n\nDependencies\n------------\n\nIn Linux:\n\n    apt-get install libpcsclite1\n    bundle install\n    \nIn Windows:\n\n    bundle install\n    \nExamples\n--------\n\nThe full TIM API has been implemented. See method calls and responses below.\n\n    git clone {path_to_github_repo}\n    cd ruby-insika\n    \n    irb\n    load './lib/insika.rb'\n    \n    t = Insika::Tim.new\n    =\u003e #\u003cInsika::Tim:0x00000002878b90\u003e\n    \n    t.open\n    =\u003e #\u003cSmartcard::PCSC::Card:0x00000002872470 @context=#\u003cSmartcard::PCSC::Context:0x000000028728a8 @_handle=2115169342\u003e, @sharing_mode=:exclusive, @_handle=964158434, @protocol=:t1, @send_pci=#\u003cFFI::Library::Symbol name=g_rgSCardT1Pci address=0x007ff4ace37940\u003e\u003e\n    \n    t.select_tim_application\n    =\u003e [\"NO_ERROR\", nil]\n    \n    t.get_data_tim_status\n    =\u003e [\"NO_ERROR\", {:lifecycle=\u003e:personalized}]\n    \n    t.activate(\"your_pin_here\")\n    =\u003e {:lifecycle=\u003e:activated, :tax_payer_id=\u003e\"INSIKA_TEST_LEPR\", :consecutive_number=\u003e1, :sequence_reports=\u003e1, :sequence_transaction_first=\u003e0, :sequence_transaction_last=\u003e0, :signature=\u003e\"TCGN-YFXB-YYKA-T3PL-KNJS-MBKZ-245R-KUZI-UDSG-GSXM-XB56-AMJ2-UF3E-FI4C-NZWZ-KFUG-T2DI-K2KI-GVJS-O===-\"}\n    \n    t.get_data_tim_status\n    =\u003e [\"NO_ERROR\", {:lifecycle=\u003e:activated}]\n    \n    t.get_data_tim_status_extended\n    =\u003e [\"NO_ERROR\", {:lifecycle=\u003e:activated, :version=\u003e\"T.1.1.0\", :tax_payer_id=\u003e\"INSIKA_TEST_LEPR\", :consecutive_number=\u003e1, :serial_number=\u003e\"01234567890123456789012345678901\", :currency_code=\u003e978, :date=\u003e\"2025-06\", :sequence_transactions=\u003e1, :sequence_reports=\u003e2}]\n    \n    t.get_data_booked_months\n    =\u003e [\"NO_ERROR\", {:date=\u003e\"2015-06\", :months_with_turnover=\u003e[1]}]\n    \n    t.read_certificate\n    =\u003e [\"NO_ERROR\", \"MIIDEzC....]\n\nNext, load the variables `example1` and `example2` from `example.rb` into your Ruby console to test a transaction.\n\n    t.transact(example1)\n    =\u003e [\"NO_ERROR\", {:tax_payer_id=\u003e\"INSIKA_TEST_LEPR\", :consecutive_number=\u003e1, :sequence_transactions=\u003e2, :signature=\u003e\"QUBU-UX65-PSPA-V6J2-ES66-L7SP-3IR2-T2TU-UOLA-CXCV-N7SR-2JGM-BUE7-AJ5H-ULUF-NQWL-EDSH-7AFZ-DBTU-M===-\"}]\n \n\n    t.report_unsigned\n    =\u003e [\"NO_ERROR\", {:lifecycle=\u003e:activated, :tax_payer_id=\u003e\"INSIKA_TEST_LEPR\", :consecutive_number=\u003e1, :sequence_reports=\u003e2, :sequence_transaction_first=\u003e1, :sequence_transaction_last=\u003e2, :containers=\u003e{:standard=\u003e{:turnover=\u003e89.82, :turnover_negative=\u003e9.98, :turnover_vat_rate=\u003e19.0}, :reduced1=\u003e{:turnover=\u003e9.44, :turnover_negative=\u003e0.0, :turnover_vat_rate=\u003e7.0}}}\n    \n    \n    t.report_signed(\"blah\")\n    =\u003e [\"NO_ERROR\", {:lifecycle=\u003e:activated, :tax_payer_id=\u003e\"INSIKA_TEST_LEPR\", :consecutive_number=\u003e1, :sequence_reports=\u003e3, :sequence_transaction_first=\u003e1, :sequence_transaction_last=\u003e2, :containers=\u003e{:standard=\u003e{:turnover=\u003e89.82, :turnover_negative=\u003e9.98, :turnover_vat_rate=\u003e19.0}, :reduced1=\u003e{:turnover=\u003e9.44, :turnover_negative=\u003e0.0, :turnover_vat_rate=\u003e7.0}}, :signature=\u003e\"LP4E-AGQ6-CQAM-MWQV-AY7H-PTXH-JTAD-YCHD-QTPN-CT77-BASL-E2NX-QCYH-O4A5-SLRU-CCAJ-KHKO-EW5G-K2MV-A===-\"}]\n    \n    t.report_span(\"201507\", \"201508\")\n    =\u003e [\"NO_ERROR\", {:lifecycle=\u003e:activated, :tax_payer_id=\u003e\"INSIKA_TEST_LEPR\", :consecutive_number=\u003e1, :sequence_reports=\u003e3, :sequence_transaction_first=\u003e1, :sequence_transaction_last=\u003e2, :containers=\u003e{:standard=\u003e{:turnover=\u003e89.82, :turnover_negative=\u003e9.98, :turnover_vat_rate=\u003e19.0}, :reduced1=\u003e{:turnover=\u003e9.44, :turnover_negative=\u003e0.0, :turnover_vat_rate=\u003e7.0}}}]\n    \n    t.hash(\"test\")\n    =\u003e [\"NO_ERROR\", \"a94a8fe5ccb19ba61c4c0873d391e987982fbbd3\"]\n    \n    t.close\n    =\u003e nil\n\n    \n    \nLicence\n----------------------\n\nCopyright (C) 2015  Red (E) Tools Ltd. \u003coffice@thebigrede.net\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelfranzl%2Fruby-insika","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelfranzl%2Fruby-insika","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelfranzl%2Fruby-insika/lists"}