PHPackages                             dipnot/ptt-akilliesnaf-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. [API Development](/categories/api)
4. /
5. dipnot/ptt-akilliesnaf-php

ActiveLibrary[API Development](/categories/api)

dipnot/ptt-akilliesnaf-php
==========================

Unofficial PHP wrapper for PTT Akıllı Esnaf API

1.0.1(3y ago)0201MITPHPPHP &gt;=5.6.36

Since May 6Pushed 3y ago1 watchersCompare

[ Source](https://github.com/dipnot/ptt-akilliesnaf-php)[ Packagist](https://packagist.org/packages/dipnot/ptt-akilliesnaf-php)[ Docs](https://www.dipnot.com.tr/)[ RSS](/packages/dipnot-ptt-akilliesnaf-php/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/a41b5c2070325e80cfe0022e667b07da23f7a8623fba66bbc9167e4e36539524/68747470733a2f2f706f7365722e707567782e6f72672f6469706e6f742f7074742d616b696c6c6965736e61662d7068702f76)](https://packagist.org/packages/dipnot/ptt-akilliesnaf-php) [![Total Downloads](https://camo.githubusercontent.com/6323aa3be12302457128325fc771de6074ea15af556688a507cfe09848b805b7/68747470733a2f2f706f7365722e707567782e6f72672f6469706e6f742f7074742d616b696c6c6965736e61662d7068702f646f776e6c6f616473)](https://packagist.org/packages/dipnot/ptt-akilliesnaf-php)

PTT Akıllı Esnaf API Wrapper for PHP
====================================

[](#ptt-akıllı-esnaf-api-wrapper-for-php)

Unofficial PHP wrapper for [PTT Akıllı Esnaf API](https://akilliesnaf.ptt.gov.tr/developer/)

We got a lot of help from the [sample codes](https://akilliesnaf.ptt.gov.tr/developer/#acik-kaynak).

Only covers `threeDSecure` (Ortak Ödeme Sayfası) and `inquiry` (Ödeme Sorgulama)

`threeDPayment` (3D ile Ödeme), `void` (İptal), `refund` (İade) or `history` (İşlem Listeleme) are not our goal currently. We would be happy to see your contributions!

Dependencies
------------

[](#dependencies)

- PHP 5.6.36 or higher
- ext-curl
- ext-json

Installation
------------

[](#installation)

You can install via [Composer](https://getcomposer.org/).

```
composer require dipnot/ptt-akilliesnaf-php

```

Usage
-----

[](#usage)

You can see the full example in [examples](https://github.com/dipnot/ptt-akilliesnaf-php/tree/main/examples) folder.

### Config

[](#config)

All request are needs a Config.

```
use Dipnot\PttAkilliEsnaf\Config;

$config = new Config(true); // Don't forget to change it to "false" in production :)
$config->setClientId("1000000032");
$config->setApiUser("Entegrasyon_01");
$config->setApiPass("gkk4l2*TY112");
```

### Making a `threeDPayment` request

[](#making-a-threedpayment-request)

```
use Dipnot\PttAkilliEsnaf\Enum\Currency;
use Dipnot\PttAkilliEsnaf\Request\ThreeDPaymentRequest;

// $config = ...;

$orderId = "ORDERCODE" . time();

$threeDPaymentRequest = new ThreeDPaymentRequest($config);
$threeDPaymentRequest->setCallbackUrl("http://localhost/ptt-akilliesnaf-php/examples/callback.php");
$threeDPaymentRequest->setOrderId($orderId);
$threeDPaymentRequest->setAmount(1000);
$threeDPaymentRequest->setCurrency(Currency::TL);
$threeDPaymentRequest->setInstallmentCount(1);

try {
    $request = $threeDPaymentRequest->execute();

    ?>
    Response:

    Payment iframe:
