2017 © Pedro Peláez
 

library hootkigrosh

Working with Hutki Grosh API (www.hutkigrosh.by)

image

alexantr/hootkigrosh

Working with Hutki Grosh API (www.hutkigrosh.by)

  • Wednesday, April 19, 2017
  • by alexantr
  • Repository
  • 3 Watchers
  • 2 Stars
  • 91 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 3 Versions
  • 10 % Grown

The README.md

HootkiGrosh

Класс для работы с API сервиса «Хуткі Грош», (*1)

Описание API, (*2)

Установка

Установка через Composer:, (*3)

composer require alexantr/hootkigrosh "~1.0"

Пример использования

Инициализация:, (*4)

require 'HootkiGrosh.php';

$user = 'user@org.com'; // имя пользователя
$pwd = 'paSSwo_rd'; // пароль
$is_test = true; // тестовый api

$hg = new \Alexantr\HootkiGrosh\HootkiGrosh($is_test);

Авторизация:, (*5)

$res = $hg->apiLogIn($user, $pwd);

// Ошибка авторизации
if (!$res) {
    echo $hg->getError();
    $hg->apiLogOut(); // Завершаем сеанс
    exit;
}

Добавление нового счета в систему:, (*6)

$data = array(
    'eripId' => '40000001',
    'invId' => 'C-1234',
    'fullName' => 'Пупкин Василий Иванович',
    'mobilePhone' => '+333 33 3332221',
    'email' => 'pupkin@org.com',
    'fullAddress' => 'г.Минск, пр.Победителей, д.1, кв.1',
    'amt' => 120000,
    'products' => array(
        array(
            'invItemId' => 'Артикул 123',
            'desc' => 'Услуга, за которую производят оплату',
            'count' => 1,
            'amt' => 119000,
        ),
        array(
            'invItemId' => '-нет-',
            'desc' => 'Доставка',
            'count' => 1,
            'amt' => 1000,
        ),
    ),
);

$billID = $hg->apiBillNew($data);
if (!$billID) {
    echo $hg->getError();
    $hg->apiLogOut(); // Завершаем сеанс
    exit;
}
echo 'bill ID: ' . $billID . '<br>';

Статус счета:, (*7)

$status = $hg->apiBillStatus($billID);
if (!$status) {
    echo $hg->getError();
    $hg->apiLogOut(); // Завершаем сеанс
    exit;
}
echo 'Статус: ' . $status . ' (' . $hg->getPurchItemStatus($status) . ')<br>';

Информация о счете:, (*8)

$info = $hg->apiBillInfo($billID);
if (!$info) {
    echo $hg->getError();
    $hg->apiLogOut(); // Завершаем сеанс
    exit;
}
echo '<pre>' . print_r($info, true) . '</pre>';

Удаление счета:, (*9)

$res = $hg->apiBillDelete($billID);
if (!$res) {
    echo $hg->getError();
    $hg->apiLogOut(); // Завершаем сеанс
    exit;
}

Список последних платежей:, (*10)

$info = $hg->apiPayedBills($eripID, $lastBillID);
if (!$info) {
    echo $hg->getError();
    $hg->apiLogOut(); // Завершаем сеанс
    exit;
}
echo '<pre>' . print_r($info, true) . '</pre>';

Дамп ответа:, (*11)

$response = $hg->getResponse();
echo '<hr><pre>' . htmlspecialchars($response) . '</pre>';

Завершение сеанса:, (*12)

$res = $hg->apiLogOut();

The Versions

19/04 2017

dev-master

9999999-dev https://github.com/alexantr/HootkiGrosh

Working with Hutki Grosh API (www.hutkigrosh.by)

  Sources   Download

MIT

The Requires

  • php >=5.3.3
  • ext-curl *

 

api payments hootkigrosh hutkigrosh

19/04 2017

v1.1

1.1.0.0 https://github.com/alexantr/HootkiGrosh

Working with Hutki Grosh API (www.hutkigrosh.by)

  Sources   Download

MIT

The Requires

  • php >=5.3.3
  • ext-curl *

 

api payments hootkigrosh hutkigrosh

23/01 2016

v1.0

1.0.0.0 https://github.com/alexantr/HootkiGrosh

Working with Hutki Grosh API (www.hutkigrosh.by)

  Sources   Download

MIT

The Requires

  • php >=5.3.3
  • ext-curl *

 

api payments hootkigrosh hutkigrosh