PHP code example of kaankilic / omnipay-iyzico
1. Go to this page and download the library: Download kaankilic/omnipay-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/ */
kaankilic / omnipay-iyzico example snippets
composer
$gateway = Omnipay::create('Iyzico');
$formInputData = array(
'name' => 'Bobby',
'lastname' => 'Tables',
'number' => '4131111111111117',
'expiryMonth' => '08',
'expiryYear' => '2023',
'cvv' => '001',
'billingCity' => 'Amsterdam',
'billingAddress1' => 'test address',
'billingCountry' => 'Nederlands',
'email' => '[email protected] ',
'postCode' => 'NL11100'
);
$card = new CreditCard($formInputData);
$request = $gateway->authorize(['identityNumber'=>'IDENTITY_NUMBER','callbackUrl' => 'https://pos.app/']);
$request->setCard($card);
$request->setApiKey('sandbox-API-KEY');
$request->setSecretKey('sandbox-SECRET-KEY');
$basket = new \Omnipay\Common\ItemBag();
$item = new \Omnipay\Common\Item(['name' => 'item name 1', 'price'=> '40.00']);
$basket->add($item);
$request->setItems($basket);
$response = $request->send();
if($response->isSuccessful()){
...
}