1. Go to this page and download the library: Download eren-seyfi/php-iyzico library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
eren-seyfi / php-iyzico example snippets
use Eren\PhpIyzico\Config;
use Eren\PhpIyzico\Iyzico;
// 1) Temel yapılandırma
$cfg = new Config(
apiKey: 'sandbox-xxxxx',
secretKey: 'sandbox-xxxxx',
baseUrl: 'https://sandbox-api.iyzipay.com',
locale: \Iyzipay\Model\Locale::TR,
conversationId: 'order-123' // benzersiz üret
);
// 2) Facade üzerinden servisler
$iyz = new Iyzico($cfg);
// Örnek: Non-3D ödeme
$payment = $iyz->non3ds()->pay(
order: ['price'=>'1.00','paidPrice'=>'1.20','basketId'=>'B67832'],
card: (new \Iyzipay\Model\PaymentCard())
->setCardHolderName('John Doe')
->setCardNumber('5528790000000008')
->setExpireMonth('12')
->setExpireYear('2030')
->setCvc('123'),
buyer: $buyerArray,
shipAddress: $shipAddressArray,
billAddress: $billingAddressArray,
basketItems: $basketItemsArray
);