1. Go to this page and download the library: Download burcev-alex/kaspi-qr-sdk 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/ */
burcev-alex / kaspi-qr-sdk example snippets
use KaspiQrSdk\Config;
use KaspiQrSdk\KaspiScheme;
use KaspiQrSdk\KaspiQrClient;
$config = new Config(
'ORG_BIN',
'DEVICE_TOKEN',
KaspiScheme::EASY,
'API_KEY',
'https://qrapi-cert-ip.kaspi.kz'
);
$client = new KaspiQrClient($config);
$config = new Config(
'ORG_BIN',
'DEVICE_TOKEN',
KaspiScheme::STRONG,
'API_KEY',
'https://qrapi-cert-ip.kaspi.kz'
);
$config->setCaPath('combined_ca.pem');
$config->setCertPath('public.cer');
$config->setKeyPath('private.key');
$config->setKeyPass('asd123456');
$client = new KaspiQrClient($config);
$config = new Config(
'ORG_BIN',
'DEVICE_TOKEN',
KaspiScheme::EASY,
'API_KEY',
'https://qrapi-cert-ip.kaspi.kz'
);
$config->setTestMode(true);
$client = new KaspiQrClient($config);
// Создать инвойс
$invoice = $client->merchant->create('ORDER-123', 1000.0);
// Получить информацию о платеже
$info = $client->merchant->getPaymentInfo($invoice->getId());
// Отменить инвойс
$cancel = $client->merchant->cancel($invoice->getId());
// Возврат платежа
$refund = $client->merchant->refund($invoice->getId(), 500.0);
// Получить список торговых точек
$tradePoints = $client->partner->tradePoints();
// Зарегистрировать устройство
$register = $client->partner->register('DEVICE_ID', 123456);
// Удалить устройство
$client->partner->delete('DEVICE_TOKEN');