1. Go to this page and download the library: Download integrify/kapitalbank 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/ */
integrify / kapitalbank example snippets
use Integrify\Environment;
use Integrify\Kapitalbank\KapitalClient;
use Integrify\Kapitalbank\KapitalConfig;
$client = new KapitalClient(KapitalConfig::fromEnvironment());
// və ya açıq şəkildə
$client = new KapitalClient(new KapitalConfig(
username: 'merchant',
password: 'secret',
environment: Environment::Prod,
redirectUrl: 'https://shop.az/done',
));
use Integrify\Kapitalbank\Exception\RequestRejected;
try {
$client->refundOrder($orderId, 10);
} catch (RequestRejected $rejection) {
$rejection->errorCode; // 'InvalidOrderState'
$rejection->code(); // ErrorCode::InvalidOrderState, tanınmasa null
$rejection->description; // bankın izahı
$rejection->details; // errorDetails, varsa
$rejection->getPrevious(); // orijinal RequestFailed — cavab burada
}
$info->status; // xam sətir — bank yeni dəyər əlavə etsə də sınmır
$info->status(); // OrderStatus|null
$result->pmoResultCode; // bankın xam kodu, məs. '1'
$result->resultMessage(); // 'Approved', tanınmayan kod üçün null
use Integrify\Http\RecordingTransport;
use Integrify\Response;
$transport = new RecordingTransport();
$client = new KapitalClient($config, $transport);
$transport->queue(Response::json([
'order' => ['id' => 1231, 'password' => 'p', 'hppUrl' => 'https://txpgtst.kapitalbank.az'],
]));
$client->createOrder(10.5, 'AZN', 'D');
$transport->lastRequest()->body['order']; // göndərilmiş payload
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.