PHPackages                             jebanany/lvlup - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. jebanany/lvlup

ActiveLibrary[API Development](/categories/api)

jebanany/lvlup
==============

API Client LVL UP

1.0.5(5y ago)69921MITPHPPHP &gt;=7.0

Since Apr 24Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Jebanany/lvlup-sdk-php)[ Packagist](https://packagist.org/packages/jebanany/lvlup)[ RSS](/packages/jebanany-lvlup/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (7)Used By (0)

lvlup-php-sdk
=============

[](#lvlup-php-sdk)

Biblioteka PHP obsługująca  oraz

Dyskusja dotycząca biblioteki dostępna na [Forum LVL UP](https://forum.lvlup.pro/t/biblioteka-php-do-obslugi-lvl-up-api-v4/14461).

Więcej o LVL UP API v4 możesz przeczytać na [Forum LVL UP](https://forum.lvlup.pro/t/panel-klienta-lvlup-pro-api-v4/14111).

Wymagania
---------

[](#wymagania)

- PHP 7+
- curl (opcjonalnie)

Instalacja
----------

[](#instalacja)

Aby zainstalować bibliotekę należy użyć Composera:

```
composer require jebanany/lvlup
```

Jak stosować
------------

[](#jak-stosować)

### Implementacja

[](#implementacja)

```
use Jebanany\Lvlup\ApiClient;
require_once('vendor/autoload.php');

// Normalne używanie
$lvlup = new ApiClient('apikey');
// bez używania cURL
$lvlup = new ApiClient('apikey', false, false);

// Sandbox
$lvlup = new ApiClient('sandboxapikey', true);
// bez używania cURL
$lvlup = new ApiClient('sandboxapikey', true, false);
```

### Przykłady

[](#przykłady)

**1. Korzystanie z Sandboxa**

Generowanie nowego konta w Sandboxie, tworzenie płatności, sprawdzenie statusu, zmiana statusu, ponowne sprawdzenie statusu.

```
use Jebanany\Lvlup\ApiClient;

require_once('vendor/autoload.php');

try {
    // Pobieramy nowe dane do konta sandbox
    // zachowaj te dane do swoich następnych testów; nie generuj ich za każdym razem!
    $lvlupSandbox = new ApiClient(false, true);
    $sanboxUser = $lvlupSandbox->sandboxAccountCreate();

    echo "";
    echo "Dane dostępowe";
    echo "\n ID: " . $sanboxUser->id;
    echo "\n Username: " . $sanboxUser->username;
    echo "\n Password: " . $sanboxUser->password;
    echo "\n Email: " . $sanboxUser->email;
    echo "\n APIkey: " . $sanboxUser->apiKey;
    // zachowaj te dane do swoich następnych testów; nie generuj ich za każdym razem!

    // Mając dane konta sandbox tworzymy nową instancję klasy, tym razem z APIkey
    $lvlupSandbox = new ApiClient($sanboxUser->apiKey, true);

    // Generujemy nową płatność
    $payment = $lvlupSandbox->paymentsCreate(25.00);

    echo "\nDane o wygenerowanej płatności";
    echo "\n url: " . $payment->url;
    echo "\n id: " . $payment->id;

    // Sprawdzamy status płatności
    $status = $lvlupSandbox->paymentsStatus($payment->id);

    echo "\nStatus płatności przed opłaceniem";
    echo "\n payed: " . ($status->payed ? 'true' : 'false'); // false
    echo "\n amountStr: " . $status->amountStr;
    echo "\n amountInt: " . $status->amountInt;
    echo "\n amountWithFeeStr: " . $status->amountWithFeeStr;
    echo "\n amountWithFeeInt: " . $status->amountWithFeeInt;

    // Zmieniamy status płatności - opłacamy / ustawiamy jako opłacone
    $lvlupSandbox->sandboxPaymentAccept($payment->id);

    // Sprawdzamy status płatności ponownie
    $status = $lvlupSandbox->paymentsStatus($payment->id);
    echo "\nStatus płatności po opłaceniu";
    echo "\n payed: " . ($status->payed ? 'true' : 'false'); // true
    echo "\n amountStr: " . $status->amountStr;
    echo "\n amountInt: " . $status->amountInt;
    echo "\n amountWithFeeStr: " . $status->amountWithFeeStr;
    echo "\n amountWithFeeInt: " . $status->amountWithFeeInt;
    echo "";

} catch (Exception $e) {
    echo 'Kod błędu: ' . $e->getCode() . ' treść błędu: ' . $e->getMessage() . '';
} catch (TypeError $e) {
    echo 'Kod błędu: ' . $e->getCode() . ' treść błędu: ' . $e->getMessage() . '';
}
```

**2. Używanie bloków catch i try**

W przypadku niepowodzenia zostaną wygenerowane `Exception` lub `TypeError` (inne niż wymagane parametry funkcji np. `string` zamiast `int`) W przypadku błędów `Exception` dostępna jest pomocnicza wiadomość (`getMessage()`) i kod odpowiedzi HTTP (`getCode()`) - jeśli zapytanie w ogóle wystąpiło, jeśli nie, `getCode()` zwróci 0.

```
use Jebanany\Lvlup\ApiClient;

require_once('vendor/autoload.php');

try {
    // Bez APIkey
    $lvlup = new ApiClient(false);
    $sanboxUser = $lvlup->userMe(); // generuje Exception

} catch (Exception $e) {
    echo 'Kod błędu: ' . $e->getCode() . ' treść błędu: ' . $e->getMessage() . '';
   //
   // Kod błędu: 401 treść błędu: Unauthorized Error (Probably invalid API key)
   //
} catch (TypeError $e) {
    echo 'Kod błędu: ' . $e->getCode() . ' treść błędu: ' . $e->getMessage() . '';
}
```

Dostępne funkcje
----------------

[](#dostępne-funkcje)

```
grafanaPing()
grafanaRawQuery(array $rawDataQuery)
grafanaTimeseriesList()
grafanaTablesList()
ordersList(int $limit = null, int $afterId = null, int $beforeId = null)
partnerIpInfo(int $id)
paymentsBalance()
paymentsCreate($amount, string $redirectUrl = '', string $webhookUrl = '')
paymentsList(int $limit = null, int $afterId = null, int $beforeId = null)
paymentsStatus($paymentId)
reportPerformanceCreate($description = '')
sandboxAccountCreate()
sandboxPaymentAccept($paymentId)
servicesAttacksList(int $vpsIds, int $limit = null, int $afterId = null, int $beforeId = null)
servicesList()
servicesProxmoxGenerateCredentials(int $vpsId)
servicesUdpFilterStatus(int $vpsId)
servicesUdpFilterStatusSet(int $vpsId, bool $changeTo)
servicesUdpFilterWhitelist(int $vpsId)
servicesUdpFilterWhitelistRuleAdd(int $vpsId, int $portFrom, int $portTo, string $protocol)
servicesUdpFilterWhitelistRuleDel(int $vpsId, int $ruleId)
servicesVpsStart(int $vpsId)
servicesVpsState(int $vpsId)
servicesVpsStop(int $vpsId)
userMe()
userLogList(int $limit = null, int $afterId = null, int $beforeId = null)
userReferralCreate()
userReferralList()
```

Opis metod
----------

[](#opis-metod)

 Rozwiń opisy metod**Grafana**

- grafanaPing() *Zwraca "OK", jeśli Grafana odpowiada*
- grafanaRawQuery(array $rawDataQuery) *Metryki kompatybilne z Grafana*
- grafanaTimeseriesList() *Dostępne serie czasowe*
- grafanaTablesList() *Dostępne tabele*

**Orders**

- ordersList *Lista zamówień z paginacją*

```
// ordersList(int $limit = null, int $afterId = null, int $beforeId = null)
// return object
$lvlup->ordersList(); //return object
```

**Partner**

- partnerIpInfo

```
// partnerIpInfo($ip)
// return object
$lvlup->partnerIpInfo('203.0.113.24');
```

**Payments**

- paymentsBalance *Ilość wirtualnych środków zgromadzona w portfelu*

```
// paymentsBalance()
// return object
$lvlup->paymentsBalance(); //object
```

- paymentsCreate *Wygenerowanie nowej płatności*

```
// paymentsCreate($amount, string $redirectUrl = '', string $webhookUrl = '')
// return object
$lvlup->paymentsCreate(1.5);
$lvlup->paymentsCreate(1);
$lvlup->paymentsCreate(1.62);
$lvlup->paymentsCreate('1.56'); // string jako kwota również działa
$lvlup->paymentsCreate(17, 'http://example.com/redirect', 'http://example.com/webhook');
```

- paymentsList *Lista przyjętych płatności*

```
// paymentsList(int $limit = null, int $afterId = null, int $beforeId = null)
// return object
$lvlup->paymentsList();
$lvlup->paymentsList(50, 5);
$lvlup->paymentsList(50, null, 5);
```

- paymentsStatus *Status istniejącej płatności*

```
// paymentsStatus($paymentId)
// return object
$lvlup->paymentsStatus('paymentId');
```

**Report**

- reportPerformanceCreate *Wysłanie raportu o nieprawidłowym działaniu usługi*

```
// reportPerformanceCreate($description = '')
// return NULL
$lvlup->reportPerformanceCreate('Problems with MC server. TPS: 9/20');
$lvlup->reportPerformanceCreate('TS packetloss: 24%');
```

**Sandbox**

- sandboxAccountCreate *Utworzenie nowego konta sandbox*

```
// sandboxAccountCreate()
// return object
$lvlup->sandboxAccountCreate();
```

- sandboxPaymentAccept *Zmiana statusu płatności na opłacone*

```
// sandboxPaymentAccept($paymentId)
// return NULL
$lvlup->sandboxPaymentAccept('paymentId');
```

**Services**

- servicesAttacksList *Lista ataków*

```
// servicesAttacksList(int $vpsIds, int $limit = null, int $afterId = null, int $beforeId = null)
// return object
$lvlup->servicesAttacksList(123);
$lvlup->servicesAttacksList(123, 50);
// etc
```

- servicesList *Lista usług*

```
// servicesList()
// return object
$lvlup->servicesList();
```

- servicesProxmoxGenerateCredentials *Generowanie danych dostępowych do panelu Proxmox*

```
// servicesProxmoxGenerateCredentials($vpsId)
// return object
$lvlup->servicesProxmoxGenerateCredentials(123);
```

- servicesUdpFilterStatus *Aktualny status filtrowania UDP*

```
// servicesUdpFilterStatus($vpsId)
// return object
$lvlup->servicesUdpFilterStatus(123);
```

- servicesUdpFilterStatusSet *Ustawienie aktualnego statusu filtrowania UDP*

```
// servicesUdpFilterStatusSet(int $vpsId, bool $changeTo)
// return object
$lvlup->servicesUdpFilterStatusSet(123, true); //true - on; false - off
```

- servicesUdpFilterWhitelist *Wyjątki filtrowania UDP*

```
// servicesUdpFilterWhitelist(int $vpsId)
// return object
$lvlup->servicesUdpFilterWhitelist(123);
```

- servicesUdpFilterWhitelistRuleAdd *Nowy wyjątek filtrowania UDP*

```
// servicesUdpFilterWhitelistRuleAdd(int $vpsId, int $portFrom, int $portTo, string $protocol)
// $allowedProtocols = ['arkSurvivalEvolved', 'arma', 'gtaMultiTheftAutoSanAndreas', 'gtaSanAndreasMultiplayerMod', 'hl2Source', 'minecraftPocketEdition', 'minecraftQuery', 'mumble', 'rust', 'teamspeak2', 'teamspeak3', 'trackmaniaShootmania', 'other'];
// return object
$lvlup->servicesUdpFilterWhitelistRuleAdd(123, 9987, 9987, 'teamspeak3');
$lvlup->servicesUdpFilterWhitelistRuleAdd(123, 9526, 10465, 'other');
```

- servicesUdpFilterWhitelistRuleDel *Usunięcie wyjątku filtrowania UDP*

```
// servicesUdpFilterWhitelistRuleDel(int $vpsId, int $ruleId)
// return object
$lvlup->servicesUdpFilterWhitelistRuleDel(123, 456);
```

- servicesVpsStart *Wystartuj VPS*

```
// servicesVpsStart(int $vpsId)
// return object
$lvlup->servicesVpsStart(123);
```

- servicesVpsState *Aktualny status VPS*

```
// servicesVpsState(int $vpsId)
// return object
$lvlup->servicesVpsState(123);
```

- servicesVpsStop *Zatrzymaj VPS*

```
// servicesVpsStop(int $vpsId)
// return object
$lvlup->servicesVpsStop(123);
```

**User**

- userMe *Informacja o aktualnym użytkowniku APIkey*

```
// userMe()
// return object
$lvlup->userMe();
```

- userLogList

```
// userLogList(int $limit = null, int $afterId = null, int $beforeId = null)
// return object
$lvlup->userLogList();
$lvlup->userLogList(50);
// etc
```

- userReferralCreate *Wygenerowanie nowego kodu polecającego*

```
// userReferralCreate()
// return object
$lvlup->userReferralCreate();
```

- userReferralList *Lista kodów polecających*

```
// userReferralList()
// return object
$lvlup->userReferralList();
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~20 days

Recently: every ~26 days

Total

6

Last Release

2103d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d47a55d8838cd4b4f45c8d5c8327eb5a8a9955cb6eac3327dc7a18094d646309?d=identicon)[jebanany](/maintainers/jebanany)

---

Top Contributors

[![Jebanany](https://avatars.githubusercontent.com/u/5436720?v=4)](https://github.com/Jebanany "Jebanany (12 commits)")[![RikoDEV](https://avatars.githubusercontent.com/u/18230443?v=4)](https://github.com/RikoDEV "RikoDEV (2 commits)")[![kapiziak](https://avatars.githubusercontent.com/u/12067650?v=4)](https://github.com/kapiziak "kapiziak (1 commits)")

### Embed Badge

![Health badge](/badges/jebanany-lvlup/health.svg)

```
[![Health](https://phpackages.com/badges/jebanany-lvlup/health.svg)](https://phpackages.com/packages/jebanany-lvlup)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M271](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
