giorgigrdzelidze / laravel-rsge
Laravel 12 client for Georgian Revenue Service (rs.ge) e-services: cash register Z-reports today, waybills and invoices next.
v1.0.0
2026-04-20 14:08 UTC
Requires
- php: ^8.2
- ext-simplexml: *
- ext-soap: *
- illuminate/contracts: ^12.0 || ^13.0
- illuminate/support: ^12.0 || ^13.0
- psr/log: ^3.0
Requires (Dev)
- laravel/pint: ^1.18
- mockery/mockery: ^1.6
- orchestra/testbench: ^10.0 || ^11.0
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^11.0
README
π¬πͺ Laravel RSGE
A production-grade Laravel package for the Georgian Revenue Service (rs.ge) SOAP API. Fetch cash register Z-reports today β waybills, taxpayer info, and more coming soon.
β¨ Features
- π§Ύ Cash Register Z-Reports β fetch daily Z-report details & sums
- π Basic Auth β username/password authentication out of the box
- π Retry with Backoff β automatic retry on transient rs.ge system errors
- π§ͺ FakeTransport β deterministic unit testing without hitting rs.ge
- ποΈ Extensible Architecture β add new rs.ge services in minutes
- π‘οΈ Typed Exceptions β
RsgeAuthenticationException,RsgeNotFoundException,RsgeSystemException,RsgeTransportException - π¦ Zero Config β Laravel auto-discovery, sensible defaults
π Requirements
| Requirement | Version |
|---|---|
| PHP | 8.2+ |
| Laravel | 12.x / 13.x |
| Extensions | ext-soap, ext-simplexml |
π Installation
composer require giorgigrdzelidze/laravel-rsge
Publish the config file (optional):
php artisan vendor:publish --tag=rsge-config
βοΈ Configuration
Add to your .env:
RSGE_USERNAME=your_username RSGE_PASSWORD=your_password
π§ Optional settings
RSGE_CASH_REGISTER_WSDL=https://services.rs.ge/taxservice/taxpayerservice.asmx?WSDL RSGE_LOGGING_ENABLED=true RSGE_LOG_CHANNEL=stack
π Usage
π§Ύ Fetch Z-Report Details
use Rsge\Laravel\Facades\Rsge; $reports = Rsge::cashRegister()->getZReportDetails( startDate: '2025-01-01', endDate: '2025-01-31', ); foreach ($reports as $report) { echo "{$report->deviceNumber}: {$report->paidAmount} GEL ({$report->quantity} receipts)\n"; }
π Using Carbon Dates
use Carbon\CarbonImmutable; use Rsge\Laravel\Facades\Rsge; $start = CarbonImmutable::now()->startOfMonth(); $end = CarbonImmutable::now()->endOfMonth(); $reports = Rsge::cashRegister()->getZReportDetails($start, $end);
π‘οΈ Exception Handling
use Rsge\Laravel\Exceptions\RsgeAuthenticationException; use Rsge\Laravel\Exceptions\RsgeNotFoundException; use Rsge\Laravel\Exceptions\RsgeSystemException; use Rsge\Laravel\Exceptions\RsgeTransportException; use Rsge\Laravel\Facades\Rsge; try { $reports = Rsge::cashRegister()->getZReportDetails('2025-01-01', '2025-01-31'); } catch (RsgeAuthenticationException $e) { // β Invalid username or password } catch (RsgeNotFoundException $e) { // π No data for the given date range } catch (RsgeSystemException $e) { // β οΈ Transient rs.ge system error } catch (RsgeTransportException $e) { // π Network or SOAP protocol failure }
π Retry on Transient Errors
use Rsge\Laravel\Facades\Rsge; use Rsge\Laravel\Support\Retry; $reports = Retry::onSystemError( operation: fn () => Rsge::cashRegister()->getZReportDetails('2025-01-01', '2025-01-31'), attempts: 3, baseDelayMs: 200, );
ποΈ Architecture
src/
βββ Contracts/ # π Interfaces (Transport, Credentials, Service)
βββ Auth/ # π Authentication (BasicCredentials)
βββ Transport/ # π SoapTransport + FakeTransport for testing
βββ Exceptions/ # π₯ Typed exceptions mapped from rs.ge error codes
βββ Support/ # π οΈ ErrorMapper, Retry helper
βββ Services/
β βββ AbstractService # π§© Base class for all services
β βββ CashRegister/ # π§Ύ Z-Report service, DTOs, request objects
βββ Facades/ # π Rsge facade
βββ Rsge.php # π Manager (service factory)
βββ RsgeServiceProvider # π¦ Laravel service provider
πΊοΈ Roadmap
| Service | SOAP Method | Status |
|---|---|---|
| Cash Register Z-Report Details | Get_Z_Report_Details |
β Done |
| Cash Register Z-Report Sum | Get_Z_Report_Sum |
π Planned |
| Taxpayer Public Info | GetTPInfoPublic |
π Planned |
| Taxpayer Public Contacts | GetTPInfoPublicContacts |
π Planned |
| Payer Info | Get_Payer_Info |
π Planned |
| Legal Person Info | Get_LegalPerson_Info |
π Planned |
| Waybill Month Amount | Get_Waybill_Month_Amount |
π Planned |
| Income Amount | Get_Income_Amount |
π Planned |
| Comparison Act | Get_comp_act_new |
π Planned |
| Payer NACE Info | Get_Payer_Nace_Info |
π Planned |
| QuickCash Info | Get_QuickCash_Info |
π Planned |
π§© Adding a New Service
- Create DTOs in
src/Services/YourService/DTOs/withfromSoap()method - Create Requests in
src/Services/YourService/Requests/withtoSoap()method - Create a Service class extending
AbstractService - Register in
RsgeServiceProvideras a singleton - Add accessor to
Rsgemanager + update facade PHPDoc - Write tests using
FakeTransport
π§ͺ Testing & QA
# π Full QA pipeline (lint + static analysis + tests) composer qa # Individual commands composer pint:test # βοΈ Code style (Pint) composer stan # π Static analysis (PHPStan level max) composer test # β Tests (PHPUnit)
π License
MIT β see LICENSE file.
Made with β€οΈ in Georgia π¬πͺ