https://github.com/nextgen-tech/ewus-php
PHP implementation for eWUŚ API
https://github.com/nextgen-tech/ewus-php
ewus php polish-insurance
Last synced: 5 months ago
JSON representation
PHP implementation for eWUŚ API
- Host: GitHub
- URL: https://github.com/nextgen-tech/ewus-php
- Owner: nextgen-tech
- License: mit
- Created: 2020-09-18T13:54:48.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-04-26T16:57:28.000Z (about 4 years ago)
- Last Synced: 2026-01-14T15:45:49.851Z (5 months ago)
- Topics: ewus, php, polish-insurance
- Language: PHP
- Homepage:
- Size: 66.4 KB
- Stars: 1
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# PHP eWUŚ
This package is PHP implementation of eWUŚ (Elektroniczna Weryfikacja Uprawnień Świadczeniobiorców). It has coded each available operation - login, logout, check patient status and change password. It is compliment with newest version (5.0), which contans additional information about patient (e.g. information about COVID-19 quarantine and isolation).
## ToC
1. [Requirements](#Requirements)
2. [Installation](#Installation)
3. [Usage](#Usage)
## Requirements
| Version | PHP |
| ------- | ------ |
| 1.x | >= 7.3 |
This package requires ext-dom to be installed on server. Optionally HTTP connection (via Guzzle) can be switched to native SOAP Client. In this case also ext-soap must be installed.
## Installation
```sh
composer require nextgen-tech/ewus
```
## Usage
```php
// Create once handler instance
$handler = new Handler(new HttpConnection());
// (Optional) Enable sandbox mode for testing
$handler->enableSandboxMode();
// Login
$request = new LoginRequest('15', 'TEST1', 'qwerty!@#');
$login = $handler->handle($request);
// Check patient status
$request = new CheckRequest($login->getSessionId(), $login->getToken(), '12345678901');
$check = $handler->handle($request);
// Change password
$request = new ChangePasswordRequest($login->getSessionId(), $login->getToken(), '15', 'TEST1', 'qwerty!@#', 'asdfgh#@!');
$changePassword = $handler->handle($request);
// Logout
$request = new LogoutRequest($login->getSessionId(), $login->getToken());
$logout = $handler->handle($request);
```