2017 © Pedro Peláez
 

library kkb-epay

A PHP client for the Qazkom Epay payment gateway

image

panda-madness/kkb-epay

A PHP client for the Qazkom Epay payment gateway

  • Thursday, April 19, 2018
  • by panda-madness
  • Repository
  • 0 Watchers
  • 0 Stars
  • 19 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 14 Versions
  • 58 % Grown

The README.md

KKB Epay

Эта библиотека предоставляет функционал для генерирования запросов для и обработки ответов от системы Epay Казкоммерцбанка., (*1)

В папке test-certs лежат тестовые сертификаты, которые используются в тестах., (*2)

Установка

Необходимо расширение php_xml., (*3)

composer require panda-madness/kkb-epay

Использование

$epay = new \KkbEpay\Epay([
    'MERCHANT_CERTIFICATE_ID' => '12345678',
    'MERCHANT_NAME' => 'Test Shop',
    'PRIVATE_KEY_FN' => './epay/cert.prv',
    'PRIVATE_KEY_PASS' => '1q2w3e4r',
    'PUBLIC_KEY_FN' => './epay/cert.cer',
    'BANK_PUBLIC_KEY_FN' => './epay/kkbca.pub',
    'MERCHANT_ID' => '12345678',
]);

// Основной запрос оплаты (Signed_Order_B64)
$request = $epay->buildRequest('payment', [
    'order_id' => 1234,
    'amount' => 1000,
    'currency' => 398,
    'fields' => [
        'RL' => 1234567,
        'abonent_id' => 1234567,
        ...
    ],
    'links' => [
        'BackLink' => '...',
        'FailureBackLink' => '...',
        'PostLink' => '...',
        'FailurePostLink' => '...',
    ]
]);

// Статус платежа
$request = $epay->buildRequest('status', ['order_id' => 1234]);
//Обработка ответов Epay

// PostLink
$response = $epay->parseResponse('payment', $_POST['response']);

// Ответ на запрос о статусе платежа
$curl = curl_init('https://testpay.kkb.kz/jsp/remote/checkOrdern.jsp?' . urlencode($request));

curl_setopt_array($curl, array(
    CURLOPT_RETURNTRANSFER => 1,
));

$result = curl_exec($curl);
curl_close($curl);

$response = $epay->parseResponse('status', $result);

//verify() проверяет подпись ответа.
if($response->verify()) {
    print_r($response->get());
    // get возвращает массив с параметрами ответа
} else {
    echo 'Response not valid';
}

Todo

  • Запросы для системы мониторинга платежей (https://testpay.kkb.kz/doc/htm/remote.html)
  • Unit тесты
  • Докблоки

The Versions

19/04 2018

dev-master

9999999-dev

A PHP client for the Qazkom Epay payment gateway

  Sources   Download

MIT

The Requires

  • php ^7.1

 

The Development Requires

by Margulan Baimbet

19/04 2018

1.0.2

1.0.2.0

A PHP client for the Qazkom Epay payment gateway

  Sources   Download

MIT

The Requires

  • php ^7.1

 

The Development Requires

by Margulan Baimbet

18/04 2018

1.0.1

1.0.1.0

A PHP client for the Qazkom Epay payment gateway

  Sources   Download

MIT

The Requires

  • php ^7.1

 

The Development Requires

by Margulan Baimbet

17/04 2018

1.0.0

1.0.0.0

A PHP client for the Qazkom Epay payment gateway

  Sources   Download

MIT

The Requires

  • php ^7.1

 

The Development Requires

by Margulan Baimbet

13/04 2018

0.1

0.1.0.0

A PHP client for the Qazkom Epay payment gateway

  Sources   Download

MIT

The Requires

  • php ^7.1

 

The Development Requires

by Margulan Baimbet

06/04 2018

0.0.9

0.0.9.0

A PHP client for the Qazkom Epay payment gateway

  Sources   Download

MIT

The Requires

  • php ^7

 

The Development Requires

by Margulan Baimbet

06/04 2018

0.0.8

0.0.8.0

A PHP client for the Qazkom Epay payment gateway

  Sources   Download

MIT

The Requires

  • php ^7

 

The Development Requires

by Margulan Baimbet

06/04 2018

0.0.7

0.0.7.0

A PHP client for the Qazkom Epay payment gateway

  Sources   Download

MIT

The Requires

  • php ^7

 

The Development Requires

by Margulan Baimbet

30/03 2018

0.0.6

0.0.6.0

A PHP client for the Qazkom Epay payment gateway

  Sources   Download

MIT

The Requires

  • php ^7.0.0

 

by Margulan Baimbet

30/03 2018

0.0.5

0.0.5.0

A PHP client for the Qazkom Epay payment gateway

  Sources   Download

MIT

The Requires

  • php ^7.0.0

 

by Margulan Baimbet

29/03 2018

0.0.4

0.0.4.0

A PHP client for the Qazkom Epay payment gateway

  Sources   Download

MIT

The Requires

  • php ^7.0.0

 

by Margulan Baimbet

29/03 2018

0.0.3

0.0.3.0

A PHP client for the Qazkom Epay payment gateway

  Sources   Download

MIT

The Requires

  • php ^7.0.0

 

by Margulan Baimbet

29/03 2018

0.0.2

0.0.2.0

A PHP client for the Qazkom Epay payment gateway

  Sources   Download

MIT

The Requires

  • php ^7.0.0

 

by Margulan Baimbet

29/03 2018

0.0.1

0.0.1.0

A PHP client for the Qazkom Epay payment gateway

  Sources   Download

MIT

The Requires

  • php ^7.0.0

 

by Margulan Baimbet