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

ActiveLibrary[Payment Processing](/categories/payments)

tcgunel/omnipay-payten
======================

Omnipay extension for Payten (Merchant Safe Unipay) - supports Payten, Paratika, VakifPays, ZiraatPay

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

Since Mar 23Pushed 3mo agoCompare

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

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

Omnipay: Payten (Merchant Safe Unipay)
======================================

[](#omnipay-payten-merchant-safe-unipay)

**Payten (MSU API v2) gateway for the Omnipay PHP payment processing library**

[![Latest Stable Version](https://camo.githubusercontent.com/b30dc269c0223c9a77300ce23bd95ed3128e9130c7de7d5639eb123c1ede8fd6/68747470733a2f2f706f7365722e707567782e6f72672f746367756e656c2f6f6d6e697061792d70617974656e2f762f737461626c65)](https://packagist.org/packages/tcgunel/omnipay-payten)[![Total Downloads](https://camo.githubusercontent.com/10926490087133628e79c6ef95f1a5088ea2991cc5fb886f9e5055022c7db159/68747470733a2f2f706f7365722e707567782e6f72672f746367756e656c2f6f6d6e697061792d70617974656e2f646f776e6c6f616473)](https://packagist.org/packages/tcgunel/omnipay-payten)[![License](https://camo.githubusercontent.com/50a40ef8d7c818dc902fc131e4d3cecc9404d0922419ca38025b7a6b1cdac355/68747470733a2f2f706f7365722e707567782e6f72672f746367756e656c2f6f6d6e697061792d70617974656e2f6c6963656e7365)](https://packagist.org/packages/tcgunel/omnipay-payten)

[Omnipay](https://github.com/thephpleague/omnipay) is a framework agnostic, multi-gateway payment processing library for PHP. This package implements Payten (Merchant Safe Unipay) support for Omnipay.

Sub-Providers
-------------

[](#sub-providers)

This package supports 4 sub-providers that share the same MSU API v2 protocol. Select the provider via the `provider` parameter:

ProviderConstantTest APILive API**Payten** (default)`Provider::PAYTEN`entegrasyon.asseco-see.com.trmerchantsafeunipay.com**Paratika**`Provider::PARATIKA`entegrasyon.paratika.com.trvpos.paratika.com.tr**VakifPays**`Provider::VAKIFPAYS`testpos.vakifpays.com.trpos.vakifpays.com.tr**ZiraatPay**`Provider::ZIRAATPAY`test.ziraatpay.com.trvpos.ziraatpay.com.trInstallation
------------

[](#installation)

```
composer require tcgunel/omnipay-payten
```

Usage
-----

[](#usage)

### Gateway Initialization

[](#gateway-initialization)

```
use Omnipay\Omnipay;
use Omnipay\Payten\Constants\Provider;

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

$gateway->setMerchantId('YOUR_MERCHANT_ID');
$gateway->setMerchantUser('YOUR_MERCHANT_USER');
$gateway->setMerchantPassword('YOUR_MERCHANT_PASSWORD');
$gateway->setMerchantStorekey('YOUR_STOREKEY'); // optional (DEALERTYPENAME)
$gateway->setProvider(Provider::PAYTEN); // payten, paratika, vakifpays, ziraatpay
$gateway->setTestMode(true); // false for production
```

### Provider Selection

[](#provider-selection)

```
// Use Paratika
$gateway->setProvider(Provider::PARATIKA);

// Use VakifPays
$gateway->setProvider(Provider::VAKIFPAYS);

// Use ZiraatPay
$gateway->setProvider(Provider::ZIRAATPAY);
```

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

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

```
$response = $gateway->purchase([
    'amount'        => '100.00',
    'currency'      => 'TRY',
    'transactionId' => 'ORDER-12345',
    'installment'   => '1',
    'secure'        => false,
    'card'          => [
        'firstName'  => 'John',
        'lastName'   => 'Doe',
        'number'     => '4355084355084358',
        'expiryMonth'=> '12',
        'expiryYear' => '2030',
        'cvv'        => '000',
        'email'      => 'john@example.com',
    ],
    'clientIp'      => '127.0.0.1',
])->send();

if ($response->isSuccessful()) {
    echo "Payment successful! Transaction ID: " . $response->getTransactionReference();
} else {
    echo "Payment failed: " . $response->getMessage();
}
```

### 3D Secure Payment

[](#3d-secure-payment)

```
$response = $gateway->purchase([
    'amount'        => '100.00',
    'currency'      => 'TRY',
    'transactionId' => 'ORDER-12345',
    'installment'   => '1',
    'secure'        => true,
    'returnUrl'     => 'https://yoursite.com/payment/callback',
    'card'          => [
        'firstName'  => 'John',
        'lastName'   => 'Doe',
        'number'     => '4355084355084358',
        'expiryMonth'=> '12',
        'expiryYear' => '2030',
        'cvv'        => '000',
        'email'      => 'john@example.com',
    ],
    'clientIp'      => '127.0.0.1',
])->send();

if ($response->isRedirect()) {
    // Redirect the customer to 3D Secure page
    $response->redirect();
}
```

### Complete Purchase (3D Callback)

[](#complete-purchase-3d-callback)

Handle the callback from the 3D Secure redirect:

```
$response = $gateway->completePurchase()->send();

if ($response->isSuccessful()) {
    echo "3D Payment successful!";
    echo "Transaction ID: " . $response->getTransactionId();
    echo "PG Reference: " . $response->getTransactionReference();
} else {
    echo "3D Payment failed: " . $response->getMessage();
    echo "Error code: " . $response->getCode();
}
```

### Refund

[](#refund)

```
$response = $gateway->refund([
    'transactionId' => 'ORDER-12345',
    'amount'        => '50.00',
    'currency'      => 'TRY',
])->send();

if ($response->isSuccessful()) {
    echo "Refund successful!";
} else {
    echo "Refund failed: " . $response->getMessage();
}
```

### Void (Cancel)

[](#void-cancel)

```
$response = $gateway->void([
    'transactionId' => 'ORDER-12345',
])->send();

if ($response->isSuccessful()) {
    echo "Void successful!";
} else {
    echo "Void failed: " . $response->getMessage();
}
```

### Installment Query

[](#installment-query)

```
$response = $gateway->installmentQuery([
    'card'     => ['number' => '435508'], // First 6 digits (BIN)
    'amount'   => '100.00',
    'currency' => 'TRY',
])->send();

if ($response->isSuccessful()) {
    $data = $response->getData();
    // $data->installmentPlanList contains available installment options
}
```

### Transaction Query

[](#transaction-query)

```
$response = $gateway->transactionQuery([
    'transactionId' => 'ORDER-12345',
])->send();

if ($response->isSuccessful()) {
    $data = $response->getData();
    echo "Amount: " . $data->amount;
    echo "Currency: " . $data->currency;
}
```

Authentication Parameters
-------------------------

[](#authentication-parameters)

ParameterMSU FieldDescription`merchantId``MERCHANT`Merchant ID`merchantUser``MERCHANTUSER`Merchant user`merchantPassword``MERCHANTPASSWORD`Merchant password`merchantStorekey``DEALERTYPENAME`Dealer type name / store key (optional)API Response Codes
------------------

[](#api-response-codes)

- `00` - Success (Approved)
- Any other code - Error (check `errorMsg` for details)

Supported Methods
-----------------

[](#supported-methods)

MethodMSU ACTIONDescription`purchase()``SALE`Direct or 3D Secure payment`completePurchase()`-Handle 3D callback`refund()``REFUND`Partial or full refund`void()``VOID`Cancel a transaction`installmentQuery()``QUERYINSTALLMENTS`Query available installments by BIN`transactionQuery()``QUERYTRANSACTION`Query transaction statusTesting
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) for details.

###  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

95d 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 (5 commits)")

---

Tags

paymentgatewayomnipay3d-secureparatikamsutaksitpaytenvakifpaysziraatpaymerchant safe unipay

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

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

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

PHPackages © 2026

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