1. Go to this page and download the library: Download archee-nic/ketkz-api 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/ */
archee-nic / ketkz-api example snippets
// Пример транспорта c использованием Curl\Curl:
// ----------------------------
class MyTransport implements \KetkzApi\TransportInterface
{
private $curl;
/**
* MyTransport constructor.
*
* @throws ErrorException
*/
public function __construct()
{
$this->curl = new \Curl\Curl();
}
/**
* @param string $url
* @param null $postData
* @param array $options
*
* @return string
* @throws ErrorException
*/
public function send($url, $postData = null, $options = [])
{
$this->curl->post($url,$postData);
return $this->curl->response;
}
public function getHttpCode()
{
return $this->curl->httpStatusCode;
}
public function getDebugInfo()
{
return ['info'=>$this->curl->getInfo()];
}
}
use KetkzApi;
// Иницилизируем API
$api = new KetkzApi($transport, 'uid', 'secret');
// Пример отправки данных:
// ----------------------------
// Готовим данные
$requestOrder = new RequestSendOrder();
$requestOrder->phone = '79017777777';
$requestOrder->country = 'kz';
$requestOrder->offer = 'brutalin - 2';
$requestOrder->secret = '1';
// получаем данные
$data = $api->sendOrder($requestOrder);
// Пример отправки данных:
// ----------------------------
// готовим id заказов
$ids=[1,2];
// получаем данные
$data = $api->getOrders($ids);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.