zmbakh / nurkassa-php-sdk
A PHP SDK for working with the API of Nurkassa. Created by the owner company.
Installs: 156
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/zmbakh/nurkassa-php-sdk
Requires
- php: >=7.1
- ext-json: *
- ext-mbstring: *
Requires (Dev)
- guzzlehttp/guzzle: ~6.0
- phpunit/phpunit: 8.*
This package is auto-updated.
Last update: 2021-02-10 04:48:48 UTC
README
Installation
The Nurkassa PHP SDK can be installed with Composer. Run this command:
composer require zmbakh/nurkassa-php-sdk
Please be aware, that SDK only works with cURL or Guzzle 6.x out of the box.
Usage
Note: The SDK requires PHP 7.2 or greater.
Simple GET example of a list of the POSes.
require_once __DIR__ . '/vendor/autoload.php'; // change path as needed $nurkassa = new Nurkassa\Nurkassa(); $nurkassa->setAccessToken('h2rOjGoWhofLZHLO9K0xW3h8Pyfml7RG7ikLXSemHNhmaSgBrgDXNu5NMNs6'); //Example token. $pos = new \Nurkassa\Models\ProgrammingMode\PosModel(); $request = $pos->index(); $response = $nurkassa->handleRequest($request);
The $response variable in the expample above contains headers, body and status code of the response.
The Models return a NurkassaRequest instance and were made to make easier request building. See here to introduce with all the Models.