PHPackages                             dipnot/paytr-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. dipnot/paytr-php

ActiveLibrary[Payment Processing](/categories/payments)

dipnot/paytr-php
================

Unofficial PayTR API Wrapper for PHP

1.5.0(2y ago)41.6k↓50%MITPHPPHP &gt;=5.6.36

Since Nov 16Pushed 2y ago1 watchersCompare

[ Source](https://github.com/dipnot/paytr-php)[ Packagist](https://packagist.org/packages/dipnot/paytr-php)[ Docs](https://github.com/dipnot/paytr-php)[ RSS](/packages/dipnot-paytr-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)DependenciesVersions (10)Used By (0)

PayTR API Wrapper for PHP
=========================

[](#paytr-api-wrapper-for-php)

[![Latest Stable Version](https://camo.githubusercontent.com/323277b2ad7bf4cfcbbaa1f321b8e4868df9db00d4220ccaed49476e2bbe3d4c/68747470733a2f2f706f7365722e707567782e6f72672f6469706e6f742f70617974722d7068702f76)](https://packagist.org/packages/dipnot/paytr-php) [![Total Downloads](https://camo.githubusercontent.com/08a7631e7734f239fc735b4459e9b3f3d23e4b5031dfc668845626af0acc89f7/68747470733a2f2f706f7365722e707567782e6f72672f6469706e6f742f70617974722d7068702f646f776e6c6f616473)](https://packagist.org/packages/dipnot/paytr-php)

This is an unofficial PHP wrapper for the [PayTR API](https://www.paytr.com/entegrasyon)

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

[](#requirements)

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

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

[](#installation)

To install, run the following command using [Composer](https://getcomposer.org/).

```
composer require dipnot/paytr-php
```

Examples
--------

[](#examples)

Full usage examples can be found in the [examples](https://github.com/dipnot/paytr-php/tree/main/examples) folder.

### Config

[](#config)

Before making any requests, a `Config` object must be created and set with real merchant information.

```
use Dipnot\PayTR\Config;

$config = new Config();
$config->setMerchantId("TODO");
$config->setMerchantKey("TODO");
$config->setMerchantSalt("TODO");
```

### Creating a payment form

[](#creating-a-payment-form)

```
use Dipnot\PayTR\Model\Buyer;
use Dipnot\PayTR\Model\Currency;
use Dipnot\PayTR\Model\Language;
use Dipnot\PayTR\Model\Product;
use Dipnot\PayTR\Request\CreatePaymentFormRequest;

$buyer = new Buyer();
$buyer->setEmailAddress("email@address.com");
$buyer->setFullName("Full Name");
$buyer->setAddress("The World");
$buyer->setPhoneNumber("0000000000");
$buyer->setIpAddress("0.0.0.0");

$product1 = new Product();
$product1->setTitle("Computer");
$product1->setPrice(4000);
$product1->setQuantity(1);

$product2 = new Product();
$product2->setTitle("Phone");
$product2->setPrice(5000);
$product2->setQuantity(2);

$orderId = "UNIQUEORDERCODE" . time();

$createPaymentFormRequest = new CreatePaymentFormRequest($config);
$createPaymentFormRequest->setBuyer($buyer);
$createPaymentFormRequest->setCurrency(Currency::TL);
$createPaymentFormRequest->setLanguage(Language::TR);
$createPaymentFormRequest->setAmount(9000);
$createPaymentFormRequest->setOrderId($orderId);
$createPaymentFormRequest->setSuccessUrl("http://localhost/paytr-php/examples/order.php?orderId={$orderId}&status=success");
$createPaymentFormRequest->setFailedUrl("http://localhost/paytr-php/examples/order.php?orderId={$orderId}&status=failed");
$createPaymentFormRequest->addProduct($product1);
$createPaymentFormRequest->addProduct($product2);
// $createPaymentFormRequest->addProducts([$product1, $product2]); // You can add multiple products at once
$createPaymentFormRequest->setTimeout(30);
$createPaymentFormRequest->setNoInstallment(true);
$createPaymentFormRequest->setMaxInstallment(0);

try {
  $paymentForm = $createPaymentFormRequest->execute();
  $paymentForm->printPaymentForm();
} catch(Exception $e) {
  echo $e->getMessage();
}
```

### Getting a payment (Webhook)

[](#getting-a-payment-webhook)

```
use Dipnot\PayTR\Response\GetPayment;

$getPayment = new GetPayment($config);
$getPayment->setData($_POST);

try {
  $payment = $getPayment->execute();
  exit("OK");
} catch(Exception $exception) {
  exit($exception->getMessage());
}
```

License
-------

[](#license)

[![License: MIT](https://camo.githubusercontent.com/9d5d73228024488e29bb85f36ef2cd3c20dba1cd3b66b02fda3d53148f48d575/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d253233326664636666)](https://github.com/dipnot/paytr-php/blob/main/LICENSE)

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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 ~117 days

Recently: every ~147 days

Total

9

Last Release

1070d ago

### Community

Maintainers

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

---

Top Contributors

[![ozgurg](https://avatars.githubusercontent.com/u/6717356?v=4)](https://github.com/ozgurg "ozgurg (42 commits)")

---

Tags

composerpayment-gatewaypaytrphp-librarycomposerpayment gatewayPHP Librarypaytr

### Embed Badge

![Health badge](/badges/dipnot-paytr-php/health.svg)

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

###  Alternatives

[shetabit/payment

Laravel Payment Gateway Integration Package

944330.1k5](/packages/shetabit-payment)[shetabit/multipay

PHP Payment Gateway Integration Package

291348.2k3](/packages/shetabit-multipay)[cybersource/rest-client-php

Client SDK for CyberSource REST APIs

39881.3k6](/packages/cybersource-rest-client-php)[jomweb/billplz

PHP Agnostic library for working with BillPlz API

77199.0k3](/packages/jomweb-billplz)[luigel/laravel-paymongo

A laravel wrapper for Paymongo API

7956.2k1](/packages/luigel-laravel-paymongo)[hexters/coinpayment

CoinPayment is a Laravel module for handling transactions from CoinPayment like a create transaction, history transaction, etc.

7058.0k](/packages/hexters-coinpayment)

PHPackages © 2026

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