https://github.com/mewebstudio/paytr
PayTR ödeme sistemi
https://github.com/mewebstudio/paytr
payment paytr
Last synced: about 1 year ago
JSON representation
PayTR ödeme sistemi
- Host: GitHub
- URL: https://github.com/mewebstudio/paytr
- Owner: mewebstudio
- License: mit
- Created: 2019-10-22T00:14:13.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-11-06T14:37:23.000Z (over 2 years ago)
- Last Synced: 2025-05-07T10:09:07.651Z (about 1 year ago)
- Topics: payment, paytr
- Language: PHP
- Homepage:
- Size: 27.3 KB
- Stars: 35
- Watchers: 3
- Forks: 16
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#PayTR ödeme sistemi için PHP kütüphanesi (PHP 7.1.3+)
Kurulum:
```bash
composer require mews/paytr
```
Örnek kullanım, `example` dizini içerisindedir.
```php
$payment = new Mews\PayTr\Payment(
require __DIR__ . '/../config/paytr.php'
);
```
ile oluşturulan nesnede varsayılan ayarlar kullanılır. Bu ayarlar `config/paytr.php` içerisindedir.
Buradaki ayarları projenizdeki PayTR hesabınıza uygun şekilde güncellemeniz gerekmektedir.
İstenirse farklı ayarlarla nesneyi oluşturabilirsiniz. Örnek:
```php
$payment = new Mews\PayTr\Payment([
'apiUrl' => 'https://www.paytr.com/odeme/api/get-token',
'merchantId' => 'XXXXXX',
'merchantKey' => 'XXXXXXXXXXXX',
'merchantSalt' => 'XXXXXXXXXXXX',
'successUrl' => 'https://paytr.test/example/index.php?status=success',
'failUrl' => 'https://paytr.test/example/index.php?status=fail',
]);
```
veya
```php
$payment = new Mews\PayTr\Payment();
$payment->setConfig(new Mews\PayTr\Config([
'apiUrl' => 'https://www.paytr.com/odeme/api/get-token',
'merchantId' => 'XXXXXX',
'merchantKey' => 'XXXXXXXXXXXX',
'merchantSalt' => 'XXXXXXXXXXXX',
'successUrl' => 'https://paytr.test/example/index.php?status=success',
'failUrl' => 'https://paytr.test/example/index.php?status=fail',
]));
```
* `example` dizini içerisindeki `index.php` ve `payment.php` ödeme işlemleri için örnektir.
* `callback.php` ise, ödeme sonrası PayTR' den gelecek ödeme sonucunu işleyen kısımdır.