dvelopment / rksv
tool for RKSV encryption required by Austrian law for cash registers
Requires
- trafficcophp/bytebuffer: ^0.3.0
Requires (Dev)
- phpunit/phpunit: ^4.8
This package is not auto-updated.
Last update: 2024-11-23 21:46:22 UTC
README
RKSV encryption tool
This tool is meant be used in systems that implement the Austrian "Registrierkassensicherheitsverordnung" (yes, that's one word ...).
This package has been developed on request by Pocketbill.
API
createAesKey
Creates a base64 encoded, random key with 256bits length. Ready to be used as input for the encryption methods and displayed to your users for registering it in FinanzOnline.
encryptTotalInEur
Just a convenience method which converts your EUR amount to cents before passing it to encryptTotalInCents
.
See below for the input parameters
encryptTotalInCents
The actual encryption method. It will encrypt your total value, according to the regulations.
It takes in the following parameters:
totalInCents
(int) the total value you want to encryptbase64AesKey
(string) base64 encoded AES key to usereceiptNumber
(string) the receipt number of the document you're about to signregisterId
(string) the ID of the cash register your representingreceiptType
(string) the type of document you're about to sign. Possible values are:Signer::TYPE_STANDARD
just a regular receiptSigner::TYPE_CANCEL
the receipt for a cancellation of another receiptSigner::TYPE_TRAINING
a training document your users might want to create for training/testing purposesSigner::TYPE_START
a start document which is created when you start using a (new) cash registerSigner::TYPE_ZERO
a "zero document" which is created every month/year or when the signature service became available again, after having been unavailable for at least 1 other document.
Usage examples
See test/RKSV/Test/SignerTest.php
.