PHP code example of payconn / vakif

1. Go to this page and download the library: Download payconn/vakif 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/ */

    

payconn / vakif example snippets


use Payconn\Common\CreditCard;
use Payconn\Vakif\Token;
use Payconn\Vakif\Model\Purchase;
use Payconn\Vakif\Currency;
use Payconn\Vakif;

$token = new Token('000100000013506', 'VP000579', '123456');
$purchase = new Purchase();
$purchase->setTestMode(true);
$purchase->setCurrency(Currency::TRY);
$purchase->setAmount(100);
$purchase->setInstallment(1);
$purchase->setCreditCard(new CreditCard('4289450189088488', '2023', '04', '060'));
$response = (new Vakif($token))->purchase($purchase);
if($response->isSuccessful()){
    // success!
}