Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejnov committed Jul 18, 2016
0 parents commit f44e80b
Show file tree
Hide file tree
Showing 9 changed files with 613 additions and 0 deletions.
108 changes: 108 additions & 0 deletions EETServiceSOAP.wsdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://fs.mfcr.cz/eet/schema/v2"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsp="http://www.w3.org/ns/ws-policy"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"
name="EET" targetNamespace="http://fs.mfcr.cz/eet/schema/v2">
<wsdl:documentation>
Ucel : Sluzba pro odeslani datove zpravy evidovane trzby
Verze : 2.0
Vlastnik : Generalni financni reditelstvi
</wsdl:documentation>
<wsdl:types>
<xsd:schema>
<xsd:import namespace="http://fs.mfcr.cz/eet/schema/v2" schemaLocation="EETXMLSchema.xsd"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="OdeslaniTrzbyRequest">
<wsdl:part element="tns:Trzba" name="parameters"/>
</wsdl:message>
<wsdl:message name="OdeslaniTrzbyResponse">
<wsdl:part element="tns:Odpoved" name="parameters"/>
</wsdl:message>
<wsdl:portType name="EET">
<wsdl:operation name="OdeslaniTrzby">
<wsdl:input message="tns:OdeslaniTrzbyRequest"/>
<wsdl:output message="tns:OdeslaniTrzbyResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="EETSOAP" type="tns:EET">
<wsp:PolicyReference URI="#wsp-cd3761cf-7408-48c2-be1b-e6ccf07c68cc" />
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="OdeslaniTrzby">
<soap:operation soapAction="http://fs.mfcr.cz/eet/OdeslaniTrzby"/>
<wsdl:input>
<wsp:PolicyReference URI="#wsp-f9a904ba-aea7-4681-8ea5-fd52defa71ee"/>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<wsp:PolicyReference URI="#wsp-f9a904ba-aea7-4681-8ea5-fd52defa71ee"/>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="EETService">
<wsdl:port binding="tns:EETSOAP" name="EETServiceSOAP">
<!--
Na nasledujicim radku je doplnena adresa "playground"
1. "pg.eet.cz" domenove jmeno
2. "443" cislo portu
Tato adresa plati pouze pro neprodukcni prostredi!
-->
<soap:address location="https://pg.eet.cz:443/eet/services/EETServiceSOAP/v2"/>
</wsdl:port>
</wsdl:service>
<wsp:Policy wsu:Id="wsp-cd3761cf-7408-48c2-be1b-e6ccf07c68cc">
<sp:AsymmetricBinding>
<wsp:Policy>
<sp:InitiatorToken>
<wsp:Policy>
<sp:X509Token sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Always">
<wsp:Policy>
<sp:RequireDirectReference/>
<!--
Web Services Security X.509 Certificate Token Profile 1.0
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0.pdf
-->
<sp:WssX509V3Token10/>
</wsp:Policy>
</sp:X509Token>
</wsp:Policy>
</sp:InitiatorToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<!--
Algorithm suite : Basic256Sha256
Digest : Sha256
Encryption : Aes256
Symmetric Key Wrap : KwAes256
Asymmetric Key Wrap : KwRsaOaep
Encryption key Derivation : PSha1L256
Signature key Derivation : PSha1L192
Minimum Symmetric Key Length : 256
http://specs.xmlsoap.org/ws/2005/07/securitypolicy/ws-securitypolicy.pdf
-->
<sp:Basic256Sha256/>
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<!--
Defines the layout of the security header.
Lax = Order of contents can vary
-->
<sp:Lax/>
</wsp:Policy>
</sp:Layout>
</wsp:Policy>
</sp:AsymmetricBinding>
</wsp:Policy>
<wsp:Policy wsu:Id="wsp-f9a904ba-aea7-4681-8ea5-fd52defa71ee">
<sp:SignedParts>
<sp:Body/>
</sp:SignedParts>
</wsp:Policy>
</wsdl:definitions>
200 changes: 200 additions & 0 deletions EETXMLSchema.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://fs.mfcr.cz/eet/schema/v2" elementFormDefault="qualified" targetNamespace="http://fs.mfcr.cz/eet/schema/v2" version="2.0">

<xs:element name="Trzba" type="tns:TrzbaType"/>

<xs:complexType name="TrzbaType">
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="1" name="Hlavicka" type="tns:TrzbaHlavickaType"/>
<xs:element maxOccurs="1" minOccurs="1" name="Data" type="tns:TrzbaDataType"/>
<xs:element maxOccurs="1" minOccurs="1" name="KontrolniKody" type="tns:TrzbaKontrolniKodyType"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="TrzbaHlavickaType">
<xs:attribute name="uuid_zpravy" type="tns:UUIDType" use="required"/>
<xs:attribute name="dat_odesl" type="tns:dateTime" use="required"/>
<xs:attribute name="prvni_zaslani" type="xs:boolean" use="required"/>
<xs:attribute name="overeni" type="xs:boolean" use="optional"/>
</xs:complexType>

<xs:complexType name="TrzbaDataType">
<xs:attribute name="dic_popl" type="tns:CZDICType" use="required"/>
<xs:attribute name="dic_poverujiciho" type="tns:CZDICType" use="optional"/>
<xs:attribute name="id_provoz" type="tns:IdProvozType" use="required"/>
<xs:attribute name="id_pokl" type="tns:string" use="required"/>
<xs:attribute name="porad_cis" type="tns:string" use="required"/>
<xs:attribute name="dat_trzby" type="tns:dateTime" use="required"/>
<xs:attribute name="celk_trzba" type="tns:CastkaType" use="required"/>
<xs:attribute name="zakl_nepodl_dph" type="tns:CastkaType" use="optional"/>
<xs:attribute name="zakl_dan1" type="tns:CastkaType" use="optional"/>
<xs:attribute name="dan1" type="tns:CastkaType" use="optional"/>
<xs:attribute name="zakl_dan2" type="tns:CastkaType" use="optional"/>
<xs:attribute name="dan2" type="tns:CastkaType" use="optional"/>
<xs:attribute name="zakl_dan3" type="tns:CastkaType" use="optional"/>
<xs:attribute name="dan3" type="tns:CastkaType" use="optional"/>
<xs:attribute name="cest_sluz" type="tns:CastkaType" use="optional"/>
<xs:attribute name="pouzit_zboz1" type="tns:CastkaType" use="optional"/>
<xs:attribute name="pouzit_zboz2" type="tns:CastkaType" use="optional"/>
<xs:attribute name="pouzit_zboz3" type="tns:CastkaType" use="optional"/>
<xs:attribute name="urceno_cerp_zuct" type="tns:CastkaType" use="optional"/>
<xs:attribute name="cerp_zuct" type="tns:CastkaType" use="optional"/>
<xs:attribute name="rezim" type="tns:RezimType" use="required"/>
</xs:complexType>

<xs:complexType name="TrzbaKontrolniKodyType">
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="1" name="pkp" type="tns:PkpElementType"/>
<xs:element maxOccurs="1" minOccurs="1" name="bkp" type="tns:BkpElementType"/>
</xs:sequence>
</xs:complexType>

<xs:complexType mixed="true" name="PkpElementType">
<xs:simpleContent>
<xs:extension base="tns:PkpType">
<xs:attribute name="digest" type="tns:PkpDigestType" use="required"/>
<xs:attribute name="cipher" type="tns:PkpCipherType" use="required"/>
<xs:attribute name="encoding" type="tns:PkpEncodingType" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>

<xs:complexType mixed="true" name="BkpElementType">
<xs:simpleContent>
<xs:extension base="tns:BkpType">
<xs:attribute name="digest" type="tns:BkpDigestType" use="required"/>
<xs:attribute name="encoding" type="tns:BkpEncodingType" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>

<xs:element name="Odpoved" type="tns:OdpovedType"/>

<xs:complexType name="OdpovedType">
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="1" name="Hlavicka" type="tns:OdpovedHlavickaType"/>
<xs:choice maxOccurs="1" minOccurs="1">
<xs:element name="Potvrzeni" type="tns:OdpovedPotvrzeniType"/>
<xs:element name="Chyba" type="tns:OdpovedChybaType"/>
</xs:choice>
</xs:sequence>
</xs:complexType>

<xs:complexType name="OdpovedHlavickaType">
<xs:attribute name="uuid_zpravy" type="tns:UUIDType" use="optional"/>
<xs:attribute name="bkp" type="tns:BkpType" use="optional"/>
<xs:attribute name="dat_prij" type="tns:dateTime" use="optional"/>
<xs:attribute name="dat_odmit" type="tns:dateTime" use="optional"/>
</xs:complexType>

<xs:complexType name="OdpovedPotvrzeniType">
<xs:attribute name="fik" type="tns:FikType" use="required"/>
<xs:attribute name="test" type="xs:boolean" use="optional"/>
</xs:complexType>

<xs:complexType mixed="true" name="OdpovedChybaType">
<xs:attribute name="kod" type="xs:int" use="required"/>
<xs:attribute name="test" type="xs:boolean" use="optional"/>
</xs:complexType>

<xs:simpleType name="string">
<xs:restriction base="xs:string">
<xs:pattern value="[0-9a-zA-Z\.,:;/#\-_ ]{1,20}"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="dateTime">
<xs:restriction base="xs:dateTime">
<xs:pattern value="\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(Z|[+\-]\d\d:\d\d)"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="CastkaType">
<xs:restriction base="xs:decimal">
<xs:minExclusive value="-100000000" />
<xs:maxExclusive value="100000000" />
<xs:pattern value="((0|-?[1-9]\d{0,7})\.\d\d|-0\.(0[1-9]|[1-9]\d))" />
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="IdProvozType">
<xs:restriction base="xs:int">
<xs:minInclusive value="1" />
<xs:maxInclusive value="999999" />
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="RezimType">
<xs:restriction base="xs:int">
<xs:enumeration value="0"/>
<xs:enumeration value="1"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="UUIDType">
<xs:restriction base="xs:string">
<xs:pattern value="[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}">
</xs:pattern>
<xs:length value="36"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="CZDICType">
<xs:restriction base="xs:string">
<xs:pattern value="CZ[0-9]{8,10}"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="PkpType">
<xs:restriction base="xs:base64Binary">
<xs:length value="256"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="PkpDigestType">
<xs:restriction base="xs:string">
<xs:enumeration value="SHA256"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="PkpCipherType">
<xs:restriction base="xs:string">
<xs:enumeration value="RSA2048"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="PkpEncodingType">
<xs:restriction base="xs:string">
<xs:enumeration value="base64"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="BkpType">
<xs:restriction base="xs:string">
<xs:pattern value="[0-9a-fA-F]{8}-[0-9a-fA-F]{8}-[0-9a-fA-F]{8}-[0-9a-fA-F]{8}-[0-9a-fA-F]{8}">
</xs:pattern>
<xs:length value="44"></xs:length>
<xs:whiteSpace value="collapse"></xs:whiteSpace>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="BkpDigestType">
<xs:restriction base="xs:string">
<xs:enumeration value="SHA1"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="BkpEncodingType">
<xs:restriction base="xs:string">
<xs:enumeration value="base16"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="FikType">
<xs:restriction base="xs:string">
<xs:pattern value="[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}-[0-9a-fA-F]{2}">
</xs:pattern>
<xs:length value="39"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Ukázka implementace EET v PHP.

### Závislosti
Testováno na PHP 5.6
V adresáří vendor se očekává knihovna https://github.com/robrichards/wse-php

### Licence
Kód je poskytován tak jak stojí a leží, můžete s ním dělat co chcete, klidně použít i pro EET. Za chyby nezodpovídám.

### Reklama
Komu se nechce do implementace, tak může použít on-line službu <a href="https://www.eetapp.cz/?utm_source=git&utm_medium=link&utm_campaign=eet">EETApp.cz</a>, která má pokročilejší správu účtenek včetně tisku na tiskárnu.

**Bitcoin Donate**
1LZuWFUHeVMrYvZWinxFjjkZtuq56TECot

28 changes: 28 additions & 0 deletions eet.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDgXC8qJcGllKal
yB3rNcp8eGcIMl7I24EmxnsFyhU/yiTlpnpmErN/oFaPVCh+Nzn1id3ksHRZtLF1
G8OIGobRN+NHsGOUS4MPDciSzzeZBOpH2CgB0dyM0UTNx65RBWCX0Gu5K5KGDeph
iCFjZVWX8waoXxBRZTNywn3P5bZdSmsY6M2SVQAge5KnsOz05Q1rsCVE7o8hTGQ4
1fQ48TukbyHCMpQr1WPZXc9a0AUt/5JPi1Xs7VHBP0zUE5CPiex6S+DrqgGbZq2q
XKSZwq1HQPe6DXSnYRGQFojh+Wj3x66uY+OuDxlJphfCwNLXedMheDZgmmlXT22t
TAuTKktTAgMBAAECggEAG3WM3Da0xaQ05TNh3gi+WI+P5KPtj921p95A7kt2YFFI
RMckUdvWFje0gGRHdHMj59ZQzw19oAEKew/D1aORfoe9jGedOGgpiS0hsD4mStcc
KWDePKLHwIBYUGsw/X+P++SpWodnrnqDhh5YH8cmO6ul0/OWlq+xJUmChnBR6obX
e2SYi/HZZctgDNItvGpmcyGfiohxgjjHY9x4NLdEUMJaAprqCwtXO6qHBIPNa01v
ORskmQF3gsjgpUlsq3pqlwyN9hzIZF4djFadZFqY8rQRzYypZD5gZGiDaplRmFoN
bwvg7xKnz/9QKRpC4NbOsW3IdAvTUPxhn0vD/acwMQKBgQDy6jOTLwUQVHb4KDqR
bzQygjugWtB+0x0lViTeoDe0DUJkkq1DZC149bDA6MiIeaeMuHzosEM3kk4LPElO
UL9XL57gPanAo05cUYAcfkLdlt4G5gm/ekSCcsy5h9JKfR6FArFRXXdaa6BV2bbX
Li/grQRKoZCyEZt+dAT9QhzsWQKBgQDschzMUtSyf0xzrne2Tg54Pe9gC9p2vDj1
55RTYWYZgroineOz+hJA50Idgi9BwHoHGtOlgCIfaNuinO0lA1xPeeARem67TJfL
OH5Cf8fF0TpLlAH0RxEc3HgwmOiWyCokn/FBcM8wDaMx9HOYLNuIKpVfcq96KKMI
CG7xKerPiwKBgQDWO9UmnpZhs4yFCb21nBS14wPBRbaR05Dl59Z2fWkDI5qFZpLm
V4h/IHg1ele5fUlWozKOaT2u2hp4cD/akP5fX0FIVTnMCnrGkp5hAr3n/fFsth6s
v6GCRsrlabL+PODYv+owbzUfCsKKVIubtUFGbnDVfS5GzZ6MZLgtv8wQaQKBgDKi
wX4UYw6S6nl/rI1zK/AeO2xTPYbeCkjHPmGY4zelYl1VeNUrQct6exM8tQgcw0VQ
PnEb/rLBTwAFIVgi3xr6G71CfgJIhd10jL2LBepcQ2K6IK0CpyyKHocxx+W6miPb
yNvd39EHqqJhGnxFZwJDNFgLhH7hwwBOZgvpkSq/AoGBANokoUlgah4SlPv8d8LQ
+NAPix+98RC3MQlm6W8//Mx5vwQVxHzOMJc7zT5XjNdtLwdyh9NHfoOY+t49P1Is
TcC9GOhjuatj4X0J8gAXaMc0rNXJsPYdKnsbobUUll5stDA6UJ/0CnTuLByMvuHB
q/FlkWGSGyG5I93y789RSctM
-----END PRIVATE KEY-----
23 changes: 23 additions & 0 deletions eet.pem
Original file line number Diff line number Diff line change
@@ -0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PN144iOY7zvoWuueXCEBcJBpurp37j/D3cufMinMZ6RAGfFAEsCkLCq+GzMeiPh
5N3kwk+1Ss4iw/FfkW19d6g9Yi+bU/NTNALgjj4kREgQO5Rr42BVFEoVz0K0Jvhl
XmQ0H3gzx/RlCwfqpwiSQkEVdI8wT2dPYt1lLNGkI0xukVdmjovYRDWMOl9r4r/H
LMuAesjTlTuKJ9CAawPJoyT0iEet/gFpAkrUnis5PZbdcVqfvnqbIs1d9C/i+8Of
MoyOmuoFQePCQjzIa4XETafvjVgZ4jKM/WaBTTY7lkd6d1K312Tz3MCQhlEL4hI=
-----END CERTIFICATE-----
Loading

0 comments on commit f44e80b

Please sign in to comment.