PHPackages                             pratikislem/trinkpos-php - 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. [Payment Processing](/categories/payments)
4. /
5. pratikislem/trinkpos-php

ActiveLibrary[Payment Processing](/categories/payments)

pratikislem/trinkpos-php
========================

TrinkPOS Sanal POS (Virtual POS) API client for PHP

v0.1.0(1mo ago)03MITPHPPHP ^8.1CI passing

Since Jul 13Pushed 1mo agoCompare

[ Source](https://github.com/hkankyilmaz/trinkpos-php)[ Packagist](https://packagist.org/packages/pratikislem/trinkpos-php)[ Docs](https://github.com/hkankyilmaz/trinkpos-php)[ RSS](/packages/pratikislem-trinkpos-php/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

trinkpos-php
============

[](#trinkpos-php)

TrinkPOS Sanal POS (Virtual POS) API'si için resmi PHP istemci kütüphanesi.

[![CI](https://github.com/hkankyilmaz/trinkpos-php/actions/workflows/ci.yml/badge.svg)](https://github.com/hkankyilmaz/trinkpos-php/actions/workflows/ci.yml)

> Durum: v0.x — API yüzeyi WooCommerce eklentisi entegrasyonu tamamlanana kadar değişebilir. 1.0.0 ile SemVer garantisi başlar.

Gereksinimler
-------------

[](#gereksinimler)

- PHP 8.1+
- `ext-curl`, `ext-json`
- Sıfır üçüncü parti runtime bağımlılığı

Kurulum
-------

[](#kurulum)

### Composer (önerilen)

[](#composer-önerilen)

```
composer require pratikislem/trinkpos-php
```

### Composer olmadan

[](#composer-olmadan)

Repoyu indirip bootstrap dosyasını dahil edin:

```
require '/path/to/trinkpos-php/TrinkposBootstrap.php';
TrinkposBootstrap::init();
```

Hızlı başlangıç
---------------

[](#hızlı-başlangıç)

```
use Trinkpos\Enum\Currency;
use Trinkpos\Enum\TransactionType;
use Trinkpos\Options;
use Trinkpos\Request\PaymentRequest;
use Trinkpos\TrinkposClient;

$client = new TrinkposClient(Options::sandbox('API_KEY', 'SECRET_KEY'));
// Canlı ortam: Options::production('API_KEY', 'SECRET_KEY')

$response = $client->payment(new PaymentRequest(
    transactionType: TransactionType::Auth,
    orderId: 'ORDER-12345',
    amount: 100.00,
    currency: Currency::TRY,
    cardNumber: '4000000000000001',
    cardHolderName: 'John Doe',
    expYear: 2030,
    expMonth: 12,
    cvv: '000',
    installment: 1,
    is3d: false,
));

if ($response->isApproved()) {
    echo $response->transactionId();
}
```

Daha fazla örnek: [`samples/`](samples/) — NonSecure satış, 3D akışı ve tüm endpoint'leri gezen [`samples/sandbox-smoke.php`](samples/sandbox-smoke.php).

3D Secure akışı
---------------

[](#3d-secure-akışı)

```
// 1) Başlat: is3d: true, okUrl/failUrl verin → müşteriyi yönlendirin.
$response = $client->payment($request3d);
header('Location: ' . $response->htmlUrl()); // 15 dakika geçerli

// 2) Banka, ok_url/fail_url'e form POST'u yapar:
$callback = \Trinkpos\ThreeD\CallbackResult::fromPost($_POST);

// 3) ⚠️ Callback İMZASIZDIR — tek başına asla güvenmeyin.
//    Onay kararını daima sunucudan-sunucuya doğrulamayla verin:
$verification = $client->verifyCallback($callback);
if ($verification->isApproved() && $callback->amountMatches($orderAmount)) {
    // siparişi onayla
}
```

Hata modeli
-----------

[](#hata-modeli)

İki katman vardır; ikisini karıştırmayın:

DurumSDK davranışıAğ hatası (DNS, TLS, timeout)`TransportException` fırlatılırJSON olmayan yanıt`InvalidResponseException` fırlatılır2xx dışı HTTP (400/401/409/422/…)`ApiException` fırlatılır — `errorCode` / `errorSubCode` taşırHTTP 200 içinde banka reddiException **fırlatılmaz** — `isApproved()` false, `gatewayCode()` red kodunu verir```
use Trinkpos\Enum\ErrorSubCodes;
use Trinkpos\Enum\GatewayCodes;
use Trinkpos\Exception\ApiException;

try {
    $response = $client->payment($request);
    if (!$response->isApproved()) {
        // Banka reddi: '51' yetersiz bakiye, '54' süresi dolmuş kart…
        $code = $response->gatewayCode();        // GatewayCodes sabitleriyle karşılaştırın
        $mesaj = $response->gatewayMessageTr();  // veya gatewayMessageEn()
    }
} catch (ApiException $e) {
    if ($e->errorSubCode === ErrorSubCodes::DUPLICATE_ORDER_ID) {
        // sipariş no zaten kullanılmış
    }
}
```

Desteklenen operasyonlar
------------------------

[](#desteklenen-operasyonlar)

MetotEndpoint`payment(PaymentRequest)`Satış — Auth/PreAuth × 3D/NonSecure × taksit`capturePreAuthorization(CaptureRequest)`Ön otorizasyon kapama`refund(RefundRequest)`İade (kısmi/tam, ertesi gün–30 gün)`void(VoidRequest)`Aynı gün iptal`query(txId)` / `queryHistory(txId)`İşlem durumu / geçmişi`verifyCallback(CallbackResult)`3D callback sunucu doğrulaması`binQuery(bin)`BIN sorgusu`paymentOptionsWithAmounts(...)` / `paymentOptions()`Taksit seçenekleri + komisyonlar`transactions(...)`İşlem listesi (filtreli, sayfalı)`balance(...)` / `balanceSummary()`Hakediş özeti / anlık bakiye`settlements(...)` / `settlementPayouts(id)`Hakediş kayıtları / ödeme detaylarıSandbox
-------

[](#sandbox)

Base URL`https://trinkpos-sandbox.pratikislem.com.tr`API Key`00000000-0000-0000-0000-000000000000`Secret`sandbox-secret-key-for-testing-purposes-only`Onay kartı`4000 0000 0000 0001`Red kartı`4000 0000 0000 0002`3D OTP`123456````
make smoke   # sandbox'a karşı uçtan uca duman testi
```

Geliştirme
----------

[](#geliştirme)

```
make install   # composer install
make test      # phpunit
make lint      # php -l
```

Lisans
------

[](#lisans)

MIT — bkz. [LICENSE](LICENSE).

###  Health Score

34

—

LowBetter than 74% of packages

Maintenance90

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

48d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4f9caa5d063fd420339067384c5aa23b66a5d17a6a0351ec2e0aca72fb9775ed?d=identicon)[pratikislem](/maintainers/pratikislem)

---

Top Contributors

[![hkankyilmaz](https://avatars.githubusercontent.com/u/99439329?v=4)](https://github.com/hkankyilmaz "hkankyilmaz (3 commits)")

---

Tags

paymentsanal-pos3d-securevirtual-postrinkpospratikislem

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pratikislem-trinkpos-php/health.svg)

```
[![Health](https://phpackages.com/badges/pratikislem-trinkpos-php/health.svg)](https://phpackages.com/packages/pratikislem-trinkpos-php)
```

###  Alternatives

[yasinkuyu/omnipay-iyzico

Iyzico gateway for Omnipay payment processing library

137.6k](/packages/yasinkuyu-omnipay-iyzico)

PHPackages © 2026

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