pesovo / erecept
捷克共和国SUKL eRecept门户客户端
dev-master / 1.x-dev
2017-11-21 14:56 UTC
Requires
- php: ^7.1
- ext-openssl: *
- ext-soap: *
- consistence/consistence: ^1.0.0
- ramsey/uuid: ^3.5
- robrichards/xmlseclibs: ^2.0
Requires (Dev)
- composer/ca-bundle: ^1.0
- consistence/coding-standard: ^2.0.0
- guzzlehttp/guzzle: ^6.2
- jakub-onderka/php-parallel-lint: ^0.9.2
- phing/phing: ^2.16
- phpstan/phpstan: ^0.7.0
- phpunit/phpunit: ^6.2.0
- slevomat/coding-standard: ^3.0
Suggests
- guzzlehttp/guzzle: For usage of bundled GuzzleSoapClientDriver
This package is not auto-updated.
Last update: 2024-09-29 04:20:21 UTC
README
> composer require pesovo/erecept
使用方法
$configuration = new Configuration( Environment::get(Environment::CUER_DOCTOR), EreceptVersion::get(EreceptVersion::V_201704A), '1234567890', 'cesta k ssl certifikatu', 'heslo k ssl certifikatu' ); $userPersonalData = new UserPersonalData( 'cesta k privatnimu klici', 'heslo k privatnimu klici', 'cesta k uzivatelskemu certfikatu', 'SUKL uzivatelske uid', 'SUKL uzivatelske heslo' ); $client = new Client( $configuration, new GuzzleSoapClientDriver( new \GuzzleHttp\Client( [ \GuzzleHttp\RequestOptions::VERIFY => \Composer\CaBundle\CaBundle::getBundledCaBundlePath(), \GuzzleHttp\RequestOptions::CERT => [$configuration->getHttpsCertificate() , $configuration->getHttpsCertificatePassword()], ] ), 'BASIC ' . \base64_encode(\sprintf('%s:%s', $userPersonalData->getUserUid(), $userPersonalData->getUserPassword())) ), new CryptographyService($userPersonalData), true ); $appPingZep = new AppPingZEP( new Message( $configuration->getVersion(), new \DateTimeImmutable('now', new \DateTimeZone('Europe/Prague')), '0123456789AB' ) ); try { $response = $client->send(new AppPingZepRequest($appPingZep)); print_r($response); } catch (\Throwable $th) { echo 'error ' . $th->getMessage() . PHP_EOL; }
首次设置用于测试
- 将ssl证书上传到erecept/cert文件夹
- 将私钥和个人证书上传到erecept/cert文件夹
- 将erecept/tests/erecept.neon.example复制到erecept/tests/erecept.neon
- 在erecept/tests/erecept.neon中设置变量
启动docker和测试
> cd /erecept
> docker-compose up -d
> docker exec -it php7.1_erecet bash
> cd /srv
> php vendor/bin/phing
证书转换
Sukl会发送pfx文件,对于PHP,我们需要将其转换为PEM格式。命令如下:
> openssl pkcs12 -in cuer_lekar.pfx -out cuer_lekar.pem -clcerts