aknevrnky / perfect-panel
Perfect panel API SDK
Requires
- php: >=8.1
- guzzlehttp/guzzle: ^7.7
- illuminate/support: ^10.15
Requires (Dev)
- pestphp/pest: ^2.9
- phpstan/phpstan: ^1.10
README
AknEvrnky\PerfectPanel\Client is a PHP library for interacting with the PerfectPanel API. The library provides a simple, fluent PHP interface for communicating with PerfectPanel.
Installation
The package can be installed via composer:
composer require aknevrnky/perfect-panel
Usage
The library provides several methods to interact with the PerfectPanel API.
First, you need to instantiate the PerfectPanel
class with your API URI and API Key:
use AknEvrnky\PerfectPanel\Client\PerfectPanel; $perfectPanel = new PerfectPanel($apiUri, $apiKey);
Get Available Services
$services = $perfectPanel->getServices();
Create an Order
$orderID = $perfectPanel->order($service, $link, $quantity);
Get Order Status
$status = $perfectPanel->status($orderID);
Get Multiple Order Statuses
$orderIDs = [1, 2, 3]; $statuses = $perfectPanel->statuses($orderIDs); $otherIds = '3,76,32'; $statuses = $perfectPanel->statuses($otherIds);
Check Balance
$balance = $perfectPanel->balance();
Refill Order
$perfectPanel->refill($orderID);
Check Refill Status
$perfectPanel->refillStatus($orderID);
Error Handling
The library will throw an ApiErrorException
if the API returns an error.
You should use try-catch blocks to handle these exceptions.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Tests
To run tests:
composer test
License
AknEvrnky\PerfectPanel\Client is open-sourced software licensed under the MIT license.