PHPackages                             tcgunel/omnipay-paynet - 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. tcgunel/omnipay-paynet

ActiveLibrary[Payment Processing](/categories/payments)

tcgunel/omnipay-paynet
======================

Omnipay extension for Paynet

v2.0.0(3mo ago)02MITPHPPHP ^8.3CI passing

Since Mar 23Pushed 3mo agoCompare

[ Source](https://github.com/tcgunel/omnipay-paynet)[ Packagist](https://packagist.org/packages/tcgunel/omnipay-paynet)[ Docs](https://github.com/tcgunel/omnipay-paynet)[ RSS](/packages/tcgunel-omnipay-paynet/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (7)Versions (3)Used By (0)

[![License](https://camo.githubusercontent.com/a54b8c3ced1917a2c34e33e2a948c171a1ad8ab3c7cdab18398e512126bd13d2/68747470733a2f2f706f7365722e707567782e6f72672f746367756e656c2f6f6d6e697061792d7061796e65742f6c6963656e7365)](https://packagist.org/packages/tcgunel/omnipay-paynet)

Omnipay Paynet Gateway
======================

[](#omnipay-paynet-gateway)

Omnipay gateway for Paynet - REST JSON API. All available methods of Paynet implemented for easy usage.

Requirements
------------

[](#requirements)

PHPPackage^8.0v1.0.0Installation
------------

[](#installation)

```
composer require tcgunel/omnipay-paynet

```

Usage
-----

[](#usage)

### Gateway Initialization

[](#gateway-initialization)

```
use Omnipay\Omnipay;

$gateway = Omnipay::create('Paynet');

$gateway->setSecretKey('YOUR_BASE64_ENCODED_SECRET_KEY');
$gateway->setTestMode(true); // Use test environment
```

### Authentication

[](#authentication)

Paynet uses **Basic Authentication** with a base64-encoded secret key. Set this via `setSecretKey()`.

- **Test URL:** `https://pts-api.paynet.com.tr`
- **Live URL:** `https://api.paynet.com.tr`

Methods
-------

[](#methods)

### Payment Services

[](#payment-services)

#### Direct Sale (Non-3D)

[](#direct-sale-non-3d)

```
$response = $gateway->purchase([
    'amount'        => '150.00',
    'transactionId' => 'ORDER-12345',
    'installment'   => 1,
    'card'          => [
        'firstName'   => 'Test',
        'lastName'    => 'User',
        'number'      => '4155650100416111',
        'expiryMonth' => '01',
        'expiryYear'  => '2030',
        'cvv'         => '123',
        'email'       => 'test@example.com',
        'phone'       => '5551234567',
    ],
])->send();

if ($response->isSuccessful()) {
    $transactionRef = $response->getTransactionReference(); // xact_id
}
```

#### 3D Secure Sale

[](#3d-secure-sale)

```
// Step 1: Initiate 3D Secure
$response = $gateway->purchase3d([
    'amount'        => '250.00',
    'transactionId' => 'ORDER-3D-12345',
    'installment'   => 3,
    'returnUrl'     => 'https://example.com/payment/callback',
    'card'          => [
        'firstName'   => 'Test',
        'lastName'    => 'User',
        'number'      => '4155650100416111',
        'expiryMonth' => '01',
        'expiryYear'  => '2030',
        'cvv'         => '123',
        'email'       => 'test@example.com',
        'phone'       => '5551234567',
    ],
])->send();

if ($response->isRedirect()) {
    $htmlContent = $response->getHtmlContent();
    // Render $htmlContent to redirect user to 3D Secure page
}
```

```
// Step 2: Complete 3D Secure (after callback)
$response = $gateway->completePurchase([
    'sessionId' => $_POST['session_id'],
    'tokenId'   => $_POST['token_id'],
])->send();

if ($response->isSuccessful()) {
    $transactionRef = $response->getTransactionReference(); // xact_id
    $orderNumber    = $response->getTransactionId();        // reference_no
}
```

#### Cancel (Void)

[](#cancel-void)

```
$response = $gateway->void([
    'xactId' => 'PAY-TXN-00001',
])->send();

if ($response->isSuccessful()) {
    echo $response->getMessage();
}
```

#### Refund

[](#refund)

```
$response = $gateway->refund([
    'xactId' => 'PAY-TXN-00001',
    'amount' => '50.00',
])->send();

if ($response->isSuccessful()) {
    echo $response->getMessage();
}
```

### Query Services

[](#query-services)

#### Installment Query (BIN Based)

[](#installment-query-bin-based)

```
$response = $gateway->installmentQuery([
    'bin'           => '415565',
    'amount'        => '100.00',
    'addCommission' => true,
])->send();

if ($response->isSuccessful()) {
    $installments = $response->getInstallments();
    $bankInfo     = $response->getBankInfo();
    $tdsRequired  = $response->isTdsRequired();

    foreach ($installments as $inst) {
        echo "Taksit: {$inst['instalment']}, Toplam: {$inst['total_amount']}\n";
    }
}
```

API Endpoints
-------------

[](#api-endpoints)

MethodEndpointDescriptionpurchase/v2/transaction/paymentDirect (non-3D) salepurchase3d/v2/transaction/tds\_initial3D Secure sale initiationcompletePurchase/v2/transaction/tds\_chargeComplete 3D Secure paymentvoid/v1/transaction/reversed\_requestCancel (void) a transactionrefund/v1/transaction/reversed\_requestRefund a transactioninstallmentQuery/v1/ratio/GetQuery installment rates by BINTest Credentials
----------------

[](#test-credentials)

Contact Paynet for sandbox credentials. Test environment is available at `https://pts-api.paynet.com.tr`.

Set `testMode` to `true` to use the test environment:

```
$gateway->setTestMode(true);
```

Tests
-----

[](#tests)

```
composer test

```

For Windows:

```
vendor\bin\paratest.bat

```

License
-------

[](#license)

MIT

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance82

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 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

Every ~0 days

Total

2

Last Release

96d ago

Major Versions

v1.0.0 → v2.0.02026-03-23

PHP version history (2 changes)v1.0.0PHP ^8.0

v2.0.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/36dffe883e88aeef07c26067af3d6a7eda1c2a81f1ae45fdd430b721665131da?d=identicon)[Mobius Studio](/maintainers/Mobius%20Studio)

---

Top Contributors

[![tcgunel](https://avatars.githubusercontent.com/u/3923425?v=4)](https://github.com/tcgunel "tcgunel (6 commits)")

---

Tags

paymentgatewayomnipaysanal-pospaynet3d-secureödemetaksit

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tcgunel-omnipay-paynet/health.svg)

```
[![Health](https://phpackages.com/badges/tcgunel-omnipay-paynet/health.svg)](https://phpackages.com/packages/tcgunel-omnipay-paynet)
```

###  Alternatives

[yasinkuyu/omnipay-iyzico

Iyzico gateway for Omnipay payment processing library

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

PHPackages © 2026

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