2017 © Pedro Peláez
 

library atol-online

Atol.online SDK

image

payprocessing/atol-online

Atol.online SDK

  • Thursday, July 5, 2018
  • by cto
  • Repository
  • 6 Watchers
  • 12 Stars
  • 2,138 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 6 Versions
  • 31 % Grown

The README.md

Platron Atol SDK

Установка

Проект предполагает установку с использованием composer, (*1)

composer require payprocessing/atol-online

, (*2)

Тесты

Для работы тестов необходим PHPUnit, для его установки необходимо выполнить команду, (*3)

composer require phpunit/phpunit

Для того, чтобы запустить интеграционные тесты нужно скопировать файл tests/integration/MerchantSettingsSample.php удалив из названия Sample и вставив настройки магазина. После выполнить команду из корня проекта, (*4)

vendor/bin/phpunit vendor/payprocessing/atol-online/tests/integration

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

1. Запрос токена

$client = new Platron\Atol\clients\PostClient();

$tokenService = new Platron\Atol\services\GetTokenRequest('login', 'password');
$tokenResponse = new Platron\Atol\services\GetTokenResponse($client->sendRequest($tokenService));

2. Создание чека

$client = new Platron\Atol\clients\PostClient();
$receiptPosition = new Platron\Atol\data_objects\ReceiptPosition('Test product', 10.00, 2, Platron\Atol\data_objects\ReceiptPosition::TAX_VAT10);

$createDocumentService = (new Platron\Atol\services\CreateDocumentRequest('token'))
    ->addCustomerEmail('test@test.ru')
    ->addCustomerPhone('79268750000')
    ->addGroupCode('groupCode')
    ->addInn('inn')
    ->addMerchantAddress('paymentAddress')
    ->addOperationType(Platron\Atol\services\CreateDocumentRequest::OPERATION_TYPE_BUY)
    ->addPaymentType(Platron\Atol\services\CreateDocumentRequest::PAYMENT_TYPE_ELECTRON)
    ->addSno(Platron\Atol\services\CreateDocumentRequest::SNO_ESN)
    ->addExternalId('externalId')
    ->addReceiptPosition($receiptPosition);
$createDocumentResponse = new Platron\Atol\services\CreateDocumentResponse($client->sendRequest($createDocumentService));

3. Запрос статуса

$client = new Platron\Atol\clients\PostClient();
$getStatusService = new Platron\Atol\services\GetStatusRequest('groupCode', 'uuid', 'token');
$getStatusResponse = new Platron\Atol\services\GetStatusResponse($client->sendRequest($getStatusService));

The Versions

05/07 2018

dev-master

9999999-dev

Atol.online SDK

  Sources   Download

The Requires

 

The Development Requires

05/07 2018

v1.0.4

1.0.4.0

Atol.online SDK

  Sources   Download

The Requires

 

The Development Requires

25/12 2017

v1.0.3

1.0.3.0

Atol.online SDK

  Sources   Download

The Requires

 

The Development Requires

03/10 2017

v1.0.2

1.0.2.0

Atol.online SDK

  Sources   Download

The Requires

 

The Development Requires

21/08 2017

v1.0.1

1.0.1.0

Atol.online SDK

  Sources   Download

The Requires

 

The Development Requires

21/07 2017

v1.0.0

1.0.0.0

Atol.online SDK

  Sources   Download

The Requires

 

The Development Requires