uxf / energo-kalkulator-sdk
1.14.0
2024-08-29 16:18 UTC
Requires
- php: ^8.3
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
- uxf/storage: ^3.31.1
README
Install
$ composer req uxf/energo-kalkulator-sdk
// bundles.php
return [
UXFCoreBundle::class => ['all' => true];
UXFHydratorBundle::class => ['all' => true];
EnergokalkulatorBundle::class => ['all' => true];
];
Config
// packages/energo_kalkulator.php
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->extension('energo_kalkulator', [
'base_url' => 'https://xxx.com', // optional
'api_key' => env('API_KEY'),
]);
};
Usage
use EnergoKalkulator\EnergoKalkulatorService;
class MagicService
{
public function __construct(private readonly EnergoKalkulatorService $service)
{
}
public function run()
{
$data = $service->getGasEstimateWithPrepaid(
currentPartner: 1,
currentProduct: 1,
distributor: 85,
prepaid: 3333,
);
}
}