PHPackages                             mahony0/iyzipay-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. mahony0/iyzipay-php

ActiveLibrary[Payment Processing](/categories/payments)

mahony0/iyzipay-php
===================

iyzipay api php client

v2.0.49(5y ago)07MITPHPPHP &gt;=5.3.0

Since Feb 22Pushed 5y agoCompare

[ Source](https://github.com/mahony0/iyzipay-php)[ Packagist](https://packagist.org/packages/mahony0/iyzipay-php)[ Docs](https://www.iyzico.com)[ RSS](/packages/mahony0-iyzipay-php/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (1)Dependencies (2)Versions (45)Used By (0)

iyzipay-php
===========

[](#iyzipay-php)

[![Build Status](https://camo.githubusercontent.com/c308fcca1c6cd7ddfb6a3c54cb69cbb273d711a3d61903b09a2f0b9126dfd1de/68747470733a2f2f7472617669732d63692e6f72672f69797a69636f2f69797a697061792d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/iyzico/iyzipay-php)[![Latest Stable Version](https://camo.githubusercontent.com/a028e18be7c184b13b635766bb0eabface1dbdfe44a074ab776e09db686f76c2/68747470733a2f2f706f7365722e707567782e6f72672f69797a69636f2f69797a697061792d7068702f76657273696f6e)](https://packagist.org/packages/iyzico/iyzipay-php)[![Coverage Status](https://camo.githubusercontent.com/44522c3ae0a26d132475b4f855817e8d7e579fff6c1316d8bb74eeee4d54a44c/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f69797a69636f2f69797a697061792d7068702f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/iyzico/iyzipay-php?branch=master)

You can sign up for an iyzico account at

Requirements
============

[](#requirements)

PHP 5.3 and later.

### Note

[](#note)

Minimum TLS v1.2 will be supported after March 2018. Please upgrade your openssl version to minimum 1.0.1. If you have any questions, please open an issue on Github or contact us at .

Installation
============

[](#installation)

### Composer

[](#composer)

You can install the bindings via [Composer](http://getcomposer.org/). Run the following command:

```
composer require iyzico/iyzipay-php
```

To use the bindings, use Composer's [autoload](https://getcomposer.org/doc/00-intro.md#autoloading):

```
require_once('vendor/autoload.php');
```

### Manual Installation

[](#manual-installation)

If you do not wish to use Composer, you can download the [latest release](https://github.com/iyzico/iyzipay-php/releases). Then, to use the bindings, include the `IyzipayBootstrap.php` file.

```
require_once('/path/to/iyzipay-php/IyzipayBootstrap.php');
```

Usage
=====

[](#usage)

```
$options = new \Iyzipay\Options();
$options->setApiKey("your api key");
$options->setSecretKey("your secret key");
$options->setBaseUrl("https://sandbox-api.iyzipay.com");

$request = new \Iyzipay\Request\CreatePaymentRequest();
$request->setLocale(\Iyzipay\Model\Locale::TR);
$request->setConversationId("123456789");
$request->setPrice("1");
$request->setPaidPrice("1.2");
$request->setCurrency(\Iyzipay\Model\Currency::TL);
$request->setInstallment(1);
$request->setBasketId("B67832");
$request->setPaymentChannel(\Iyzipay\Model\PaymentChannel::WEB);
$request->setPaymentGroup(\Iyzipay\Model\PaymentGroup::PRODUCT);

$paymentCard = new \Iyzipay\Model\PaymentCard();
$paymentCard->setCardHolderName("John Doe");
$paymentCard->setCardNumber("5528790000000008");
$paymentCard->setExpireMonth("12");
$paymentCard->setExpireYear("2030");
$paymentCard->setCvc("123");
$paymentCard->setRegisterCard(0);
$request->setPaymentCard($paymentCard);

$buyer = new \Iyzipay\Model\Buyer();
$buyer->setId("BY789");
$buyer->setName("John");
$buyer->setSurname("Doe");
$buyer->setGsmNumber("+905350000000");
$buyer->setEmail("email@email.com");
$buyer->setIdentityNumber("74300864791");
$buyer->setLastLoginDate("2015-10-05 12:43:35");
$buyer->setRegistrationDate("2013-04-21 15:12:09");
$buyer->setRegistrationAddress("Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1");
$buyer->setIp("85.34.78.112");
$buyer->setCity("Istanbul");
$buyer->setCountry("Turkey");
$buyer->setZipCode("34732");
$request->setBuyer($buyer);

$shippingAddress = new \Iyzipay\Model\Address();
$shippingAddress->setContactName("Jane Doe");
$shippingAddress->setCity("Istanbul");
$shippingAddress->setCountry("Turkey");
$shippingAddress->setAddress("Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1");
$shippingAddress->setZipCode("34742");
$request->setShippingAddress($shippingAddress);

$billingAddress = new \Iyzipay\Model\Address();
$billingAddress->setContactName("Jane Doe");
$billingAddress->setCity("Istanbul");
$billingAddress->setCountry("Turkey");
$billingAddress->setAddress("Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1");
$billingAddress->setZipCode("34742");
$request->setBillingAddress($billingAddress);

$basketItems = array();
$firstBasketItem = new \Iyzipay\Model\BasketItem();
$firstBasketItem->setId("BI101");
$firstBasketItem->setName("Binocular");
$firstBasketItem->setCategory1("Collectibles");
$firstBasketItem->setCategory2("Accessories");
$firstBasketItem->setItemType(\Iyzipay\Model\BasketItemType::PHYSICAL);
$firstBasketItem->setPrice("0.3");
$basketItems[0] = $firstBasketItem;

$secondBasketItem = new \Iyzipay\Model\BasketItem();
$secondBasketItem->setId("BI102");
$secondBasketItem->setName("Game code");
$secondBasketItem->setCategory1("Game");
$secondBasketItem->setCategory2("Online Game Items");
$secondBasketItem->setItemType(\Iyzipay\Model\BasketItemType::VIRTUAL);
$secondBasketItem->setPrice("0.5");
$basketItems[1] = $secondBasketItem;

$thirdBasketItem = new \Iyzipay\Model\BasketItem();
$thirdBasketItem->setId("BI103");
$thirdBasketItem->setName("Usb");
$thirdBasketItem->setCategory1("Electronics");
$thirdBasketItem->setCategory2("Usb / Cable");
$thirdBasketItem->setItemType(\Iyzipay\Model\BasketItemType::PHYSICAL);
$thirdBasketItem->setPrice("0.2");
$basketItems[2] = $thirdBasketItem;
$request->setBasketItems($basketItems);

$payment = \Iyzipay\Model\Payment::create($request, $options);
```

See other samples under samples directory.

Development
-----------

[](#development)

Install dependencies:

```
composer install
```

### Mock test cards

[](#mock-test-cards)

Test cards that can be used to simulate a *successful* payment:

Card NumberBankCard Type5890040000000016AkbankMaster Card (Debit)5526080000000006AkbankMaster Card (Credit)4766620000000001DenizbankVisa (Debit)4603450000000000DenizbankVisa (Credit)4729150000000005Denizbank BonusVisa (Credit)4987490000000002FinansbankVisa (Debit)5311570000000005FinansbankMaster Card (Credit)9792020000000001FinansbankTroy (Debit)9792030000000000FinansbankTroy (Credit)5170410000000004Garanti BankasıMaster Card (Debit)5400360000000003Garanti BankasıMaster Card (Credit)374427000000003Garanti BankasıAmerican Express4475050000000003HalkbankVisa (Debit)5528790000000008HalkbankMaster Card (Credit)4059030000000009HSBC BankVisa (Debit)5504720000000003HSBC BankMaster Card (Credit)5892830000000000Türkiye İş BankasıMaster Card (Debit)4543590000000006Türkiye İş BankasıVisa (Credit)4910050000000006VakıfbankVisa (Debit)4157920000000002VakıfbankVisa (Credit)5168880000000002Yapı ve Kredi BankasıMaster Card (Debit)5451030000000000Yapı ve Kredi BankasıMaster Card (Credit)*Cross border* test cards:

Card NumberCountry4054180000000007Non-Turkish (Debit)5400010000000004Non-Turkish (Credit)6221060000000004IranTest cards to get specific *error* codes:

Card NumberDescription5406670000000009Success but cannot be cancelled, refund or post auth4111111111111129Not sufficient funds4129111111111111Do not honour4128111111111112Invalid transaction4127111111111113Lost card4126111111111114Stolen card4125111111111115Expired card4124111111111116Invalid cvc24123111111111117Not permitted to card holder4122111111111118Not permitted to terminal4121111111111119Fraud suspect4120111111111110Pickup card4130111111111118General error4131111111111117Success but mdStatus is 04141111111111115Success but mdStatus is 441511111111111123dsecure initialize failed### Mock APM Accounts

[](#mock-apm-accounts)

Mock APM Accounts that can be used to simulate a payment with alternative payment method:

Account Holder NameDescriptionsuccessSucceeded payment after succeeded initializefail-after-initFailed payment after succeeded initializeerrorFailed initializeTesting
=======

[](#testing)

Install dependencies as mentioned above (which will resolve [PHPUnit](http://packagist.org/packages/phpunit/phpunit)), then you can run the test suite:

```
./vendor/bin/phpunit
```

Or to run an individual test file:

```
./vendor/bin/phpunit tests/Iyzipay/Tests/Model/PaymentTest.php
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~74 days

Total

42

Last Release

2134d ago

Major Versions

v1.0.12 → v2.0.152016-06-03

### Community

Maintainers

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

---

Top Contributors

[![kurtulussahin](https://avatars.githubusercontent.com/u/16954548?v=4)](https://github.com/kurtulussahin "kurtulussahin (62 commits)")[![sotuzun](https://avatars.githubusercontent.com/u/335067?v=4)](https://github.com/sotuzun "sotuzun (36 commits)")[![iyzico-ci](https://avatars.githubusercontent.com/u/17120994?v=4)](https://github.com/iyzico-ci "iyzico-ci (20 commits)")[![nurettinbakkal](https://avatars.githubusercontent.com/u/10152061?v=4)](https://github.com/nurettinbakkal "nurettinbakkal (7 commits)")[![mehmetselim](https://avatars.githubusercontent.com/u/3019935?v=4)](https://github.com/mehmetselim "mehmetselim (7 commits)")[![can3ry](https://avatars.githubusercontent.com/u/51880555?v=4)](https://github.com/can3ry "can3ry (4 commits)")[![mahony0](https://avatars.githubusercontent.com/u/2674488?v=4)](https://github.com/mahony0 "mahony0 (4 commits)")[![mustafacantekir](https://avatars.githubusercontent.com/u/10408863?v=4)](https://github.com/mustafacantekir "mustafacantekir (3 commits)")[![yyenigun](https://avatars.githubusercontent.com/u/105900?v=4)](https://github.com/yyenigun "yyenigun (3 commits)")[![efekocabas](https://avatars.githubusercontent.com/u/24823127?v=4)](https://github.com/efekocabas "efekocabas (2 commits)")[![ramazangirgin](https://avatars.githubusercontent.com/u/3442152?v=4)](https://github.com/ramazangirgin "ramazangirgin (2 commits)")[![mgsmus](https://avatars.githubusercontent.com/u/543371?v=4)](https://github.com/mgsmus "mgsmus (1 commits)")[![ktoprakucar](https://avatars.githubusercontent.com/u/12136559?v=4)](https://github.com/ktoprakucar "ktoprakucar (1 commits)")[![KurtTaylan](https://avatars.githubusercontent.com/u/9060924?v=4)](https://github.com/KurtTaylan "KurtTaylan (1 commits)")[![alikorkmaz](https://avatars.githubusercontent.com/u/30934578?v=4)](https://github.com/alikorkmaz "alikorkmaz (1 commits)")[![muratunal](https://avatars.githubusercontent.com/u/357332?v=4)](https://github.com/muratunal "muratunal (1 commits)")[![seferov](https://avatars.githubusercontent.com/u/1233843?v=4)](https://github.com/seferov "seferov (1 commits)")[![umit](https://avatars.githubusercontent.com/u/141088?v=4)](https://github.com/umit "umit (1 commits)")

---

Tags

payment processingiyzicoiyzipayiyzico.comiyzipay phpiyzipay apiiyzipay api php clientiyzipay api php

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mahony0-iyzipay-php/health.svg)

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

###  Alternatives

[iyzico/iyzipay-php

iyzipay api php client

3271.1M27](/packages/iyzico-iyzipay-php)[omise/omise-php

A PHP library designed specifically to connect with Omise API.

71478.0k6](/packages/omise-omise-php)[cybersource/rest-client-php

Client SDK for CyberSource REST APIs

39881.3k6](/packages/cybersource-rest-client-php)[sumup/sumup-ecom-php-sdk

SumUp PHP SDK

51277.1k1](/packages/sumup-sumup-ecom-php-sdk)[unitpay/php-sdk

PHP SDK for Unitpay

4181.8k](/packages/unitpay-php-sdk)[mehdirochdi/cmi-payment-php

PHP package to communicate with the CMI payment plateform in Morocco

833.2k](/packages/mehdirochdi-cmi-payment-php)

PHPackages © 2026

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