PHPackages                             nedal-network/ntak-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. nedal-network/ntak-php

ActiveLibrary[API Development](/categories/api)

nedal-network/ntak-php
======================

An easy to use NTAK PHP Api

v1.0.3(3mo ago)0219MITPHPPHP ^8.1

Since Oct 13Pushed 2mo agoCompare

[ Source](https://github.com/nedal-network/ntak-php)[ Packagist](https://packagist.org/packages/nedal-network/ntak-php)[ RSS](/packages/nedal-network-ntak-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (7)Versions (6)Used By (0)

NTAK RMS PHP API / SDK
======================

[](#ntak-rms-php-api--sdk)

Welcome to my little package, that helps you make NTAK RMS requests like a boss.

Table of Contents:

- [NTAK RMS PHP API / SDK](#ntak-rms-php-api--sdk)
    - [Installation](#installation)
    - [Usage](#usage)
        - [Instances](#instances)
            - [Create an API Client Instance](#create-an-api-client-instance)
            - [Create an Order Item Instance](#create-an-order-item-instance)
            - [Create a Payment Instance](#create-a-payment-instance)
            - [Create an Order Instance](#create-an-order-instance)
        - [Messages (Requests)](#messages-requests)
            - [Store, Update, Destroy Order (Rendelésösszesítő)](#store-update-destroy-order-rendel%C3%A9s%C3%B6sszes%C3%ADt%C5%91)
            - [Close Day (Napzárás)](#close-day-napz%C3%A1r%C3%A1s)
            - [Verify (Ellenőrzés)](#verify-ellen%C5%91rz%C3%A9s)
    - [Enums](#enums)
        - [NTAKAmount](#ntakamount)
        - [NTAKCategory](#ntakcategory)
        - [NTAKSubcategory](#ntaksubcategory)
        - [NTAKDayType](#ntakdaytype)
        - [NTAKOrderType](#ntakordertype)
        - [NTAKPaymentType](#ntakpaymenttype)
        - [NTAKVat](#ntakvat)
        - [NTAKVerifyStatus](#ntakverifystatus)
    - [Contribution](#contribution)
        - [Run Tests](#run-tests)
    - [Last Words](#last-words)

Installation
------------

[](#installation)

```
composer require kiralyta/ntak-php
```

> The package requires PHP ^8.1 since it was built around PHP enums.
>
> For PHP 7, see [Natsu007/ntak-php fork](https://github.com/Natsu007/ntak-php).

Usage
-----

[](#usage)

### Instances

[](#instances)

#### Create an API Client Instance

[](#create-an-api-client-instance)

```
use Kiralyta\Ntak\NTAKClient;

$client = new NTAKClient(
    taxNumber:         'NTAK client tax nr',         // without `-` chars
    regNumber:         'NTAK client registration nr',
    softwareRegNumber: 'NTAK RMS registration id',
    version:           'NTAK RMS version',
    certPath:          '/path/to/your.pem',
    testing:           false                         // whether to hit the test NTAK API
);
```

> Your `.pem` file is basically a concatenated file of your `.cer` and `.key` files.
>
> It is recommended to have a singleton `NTAKClient` instance during one request cycle. This means, you can create multiple requests with a single `NTAKClient` instance.

You can get the last request, response and respone time (in milliseconds) from the client.

```
$client->lastRequest();     // Returns an array
$client->lastResponse();    // Returns an array
$client->lastRequestTime(); // Returns an integer
```

#### Create an Order Item Instance

[](#create-an-order-item-instance)

```
use Carbon\Carbon;
use Kiralyta\Ntak\Enums\NTAKAmount;
use Kiralyta\Ntak\Enums\NTAKCategory;
use Kiralyta\Ntak\Enums\NTAKSubcategory;
use Kiralyta\Ntak\Enums\NTAKVat;
use Kiralyta\Ntak\Models\NTAKOrderItem;

$orderItem = new NTAKOrderItem(
    name:            'Absolut Vodka',             // Any kind of string
    category:        NTAKCategory::ALKOHOLOSITAL, // Main category
    subcategory:     NTAKSubcategory::PARLAT,     // Subcategory
    vat:             NTAKVat::C_27,
    price:           1000,
    amountType:      NTAKAmount::LITER,
    amount:          0.04,
    quantity:        2,
    when:            Carbon::now(),

    // DRS is handled automatically
    // You don't have to manually create the DRS NTAKOrderItem with vat 0
    isDrs:           false
);
```

> - [NTAKCategory](#ntakcategory)
> - [NTAKSubcategory](#ntaksubcategory)
> - [NTAKVat](#ntakvat)
> - [NTAKAmount](#ntakamount)

#### Create a Payment Instance

[](#create-a-payment-instance)

```
use Kiralyta\Ntak\Enums\NTAKPaymentType;
use Kiralyta\Ntak\Models\NTAKPayment;

$payment = new NTAKPayment(
    paymentType:     NTAKPaymentType::BANKKARTYA,
    total:           2000 // Total payed with this method type
);
```

> - [NTAKPaymentType](#ntakpaymenttype)

#### Create an Order Instance

[](#create-an-order-instance)

```
use Carbon\Carbon;
use Kiralyta\Ntak\Enums\NTAKOrderType;
use Kiralyta\Ntak\Models\NTAKOrderItem;
use Kiralyta\Ntak\Models\NTAKOrder;
use Kiralyta\Ntak\Models\NTAKPayment;

$order = new NTAKOrder(
    orderType:   NTAKOrderType::NORMAL,         // You can control whether to store, update, or destroy an order
    orderId:     'your-rms-order-id',           // RMS Order ID
    orderItems:  [new NTAKOrderItem(...)],      // Array of the order items
    start:       Carbon::now()->addMinutes(-7), // Start of the order
    end:         Carbon::now(),                 // End of the order
    payments:    [new NTAKPayment(...)],        // Array of the payments

    // Take away handled automatically
    // Vat changed to 27 in all OrderItems that have a category "Helyben készített alkoholmentes ital" in case of isAtTheSpot is false
    isAtTheSpot: true,

    // Discount and service fee are automatically managed by the package
    // You don't have to manually add the OrderItem(s) with "KEDVEZMENY" / "SZERVIZDIJ" subcategories
    // Vats are handled automatically as well
    // If both discount and service fee are provided, the service fee will be calculated from the discounted total
    // The following means 20% discount (defaults to 0) and 10% service fee (defaults to 0)
    discount:    20,
    serviceFee:  10,

    // Only on update / destroy
    ntakOrderId: 'your-previous-order-id'
);
```

> When you are updating / destroying an order, you need to provide (generate) a new `orderId` with each requests.
>
> In these cases, the `ntakOrderId` is always the last provided `orderId`.

> - [NTAKOrderType](#ntakordertype)
> - [NTAKOrderItem](#create-an-order-item-instance)
> - [NTAKPayment](#create-a-payment-instance)

### Messages (Requests)

[](#messages-requests)

#### Store, Update, Destroy Order (Rendelésösszesítő)

[](#store-update-destroy-order-rendelésösszesítő)

```
use Carbon\Carbon;
use Kiralyta\Ntak\Models\NTAKOrder;
use Kiralyta\Ntak\Models\NTAKPayment;
use Kiralyta\Ntak\NTAK;

$processId = NTAK::message($client, Carbon::now())
    ->handleOrder(new NTAKOrder(...));
```

> Returns the NTAK process ID string.
>
> - [NTAKOrder](#create-an-order-instance)

#### Close Day (Napzárás)

[](#close-day-napzárás)

```
use Carbon\Carbon;
use Kiralyta\Ntak\Enums\NTAKDayType;
use Kiralyta\Ntak\NTAK;

$processId = NTAK::message($client, Carbon::now())
    ->closeDay(
        start:   Carbon::now()->addHours(-10), // Opening time (nullable)
        end:     Carbon::now(),                // Closing time (nullable)
        dayType: NTAKDayType::NORMAL_NAP,      // Day type
        tips:    1000                          // Tips (default 0)
    );
```

> Returns the NTAK process ID string.
>
> - [NTAKDayType](#ntakdaytype)

#### Verify (Ellenőrzés)

[](#verify-ellenőrzés)

```
use Carbon\Carbon;
use Kiralyta\Ntak\Enums\NTAKDayType;
use Kiralyta\Ntak\NTAK;

$response = NTAK::message($client, Carbon::now())
    ->verify(
        processId: 'NTAK Process ID'
    );
```

> Returns an `NTAKVerifyResponse` instance

```
$response->successful();         // Check whether our message was processed successfully
$response->unsuccessful();       // Check whether our message was processed unsuccessfully
$response->status;               // Returns an NTAKVerifyStatus
$response->successfulMessages;   // Returns an array of the successful messages
$response->unsuccessfulMessages; // Returns an array of the unsuccessful messages
$response->headerErrors;         // Returns an array of the header errors
```

> If you encounter an unsuccessful message, you should further examine [NTAKVerifyStatus](#ntakverifystatus). It's recommended to wait at least 60 seconds before the first verification attempt of a processs ID. You can verify multiple order with verifyALl(array of process ids) - which returning an array of `NTAKVerifyResponse` instance

Enums
-----

[](#enums)

Namespace of the enums:

```
namespace Kiralyta\Ntak\Enums;
```

You can use the `values()` static method on any of the enums, in order to get the available values.

### NTAKAmount

[](#ntakamount)

namevalue ***string***DARABdarabLITERliterKILOGRAMMkilogrammEGYSEGegyseg### NTAKCategory

[](#ntakcategory)

namevalue ***string***ETELÉtelALKMENTESITAL\_HELYBENHelyben készített alkoholmentes italALKMENTESITAL\_NEM\_HELYBENNem helyben készített alkoholmentes italALKOHOLOSITALAlkoholos ItalEGYEBEgyéb### NTAKSubcategory

[](#ntaksubcategory)

namevalue ***string***REGGELIreggeliSZENDVICSszendvicsELOETELelőételLEVESlevesFOETELfőételKORETköretSAVANYUSAG\_SALATAsavanyúság/salátaKOSTOLOkóstolóétel, kóstolófalatPEKSUTEMENYpéksütemény, pékáruDESSZERTdesszertSNACKsnackFOETEL\_KORETTELfőétel körettelETELCSOMAGételcsomagEGYEBegyébVIZvízLIMONADE\_SZORP\_FACSARTlimonádé / szörp / frissen facsart italALKOHOLMENTES\_KOKTELalkoholmentes koktél, alkoholmentes kevert italTEA\_FORROCSOKOLADEtea, forrócsoki és egyéb tejalapú italokITALCSOMAGitalcsomagKAVEkávéROSTOS\_UDITOrostos üdítőSZENSAVAS\_UDITOszénsavas üdítőSZENSAVMENTES\_UDITOszénsavmentes üdítőKOKTELkoktél, kevert italLIKORlikőrPARLATpárlatSORsörBORborPEZSGOpezsgőSZERVIZDIJszervizdíjBORRAVALOborravalóKISZALLITASI\_DIJkiszállítási díjNEM\_VENDEGLATASnem vendéglátásKORNYEZETBARAT\_CSOMAGOLASkörnyezetbarát csomagolásMUANYAG\_CSOMAGOLASműanyag csomagolásKEDVEZMENYkedvezmény### NTAKDayType

[](#ntakdaytype)

namevalue ***string***ADOTT\_NAPON\_ZARVAAdott napon zárvaFORGALOM\_NELKULI\_NAPForgalom nélküli napNORMAL\_NAPNormál nap### NTAKOrderType

[](#ntakordertype)

namevalue ***string***NORMALNormálSZTORNOStornoHELYESBITOHelyesbítő### NTAKPaymentType

[](#ntakpaymenttype)

namevalue ***string***KESZPENZHUFKészpénz hufKESZPENZEURKészpénz eurSZEPKARTYASzépkártyaBANKKARTYABankkártyaATUTALASÁtutalásEGYEBEgyébVOUCHERVoucherSZOBAHITELSzobahitelKEREKITESKerekítés### NTAKVat

[](#ntakvat)

namevalue ***string***A\_55%B\_1818%C\_2727%D\_AJTAjtE\_00%### NTAKVerifyStatus

[](#ntakverifystatus)

namevalue ***string***BEFOGADVABEFOGADVATELJESEN\_HIBASTELJESEN\_HIBASRESZBEN\_SIKERESRESZBEN\_SIKERESTELJESEN\_SIKERESTELJESEN\_SIKERESUJRA\_KULDENDOUJRA\_KULDENDOContribution
------------

[](#contribution)

```
git clone git@github.com:kiralyta/ntak-php.git
cd ntak-php
composer install --dev
```

### Run Tests

[](#run-tests)

Put your `cer.cer` and `pem.pem` files in `./auth` directory, then run:

```
vendor/bin/phpunit src/Tests
```

Last Words
----------

[](#last-words)

I am not taking any responsiblities for the use of this package.

This is simply a personal project that could help other fellow software artisans to make requests to MTÜ.

It's still recommended to read the documentation of the RMS Interface, even in case of using this package.

Please feel free to open an issue if you encounter one.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance82

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~38 days

Total

4

Last Release

101d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1454bee0871ca3b2b52e5d05d6205d30180935ba5302f9d35d36f0156a031342?d=identicon)[yrpn](/maintainers/yrpn)

---

Top Contributors

[![kiralyta](https://avatars.githubusercontent.com/u/66921954?v=4)](https://github.com/kiralyta "kiralyta (47 commits)")[![cinege3](https://avatars.githubusercontent.com/u/106654044?v=4)](https://github.com/cinege3 "cinege3 (3 commits)")[![fodi](https://avatars.githubusercontent.com/u/1785582?v=4)](https://github.com/fodi "fodi (1 commits)")[![Pony2001](https://avatars.githubusercontent.com/u/116486946?v=4)](https://github.com/Pony2001 "Pony2001 (1 commits)")[![yrpn](https://avatars.githubusercontent.com/u/27211780?v=4)](https://github.com/yrpn "yrpn (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nedal-network-ntak-php/health.svg)

```
[![Health](https://phpackages.com/badges/nedal-network-ntak-php/health.svg)](https://phpackages.com/packages/nedal-network-ntak-php)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.2M720](/packages/statamic-cms)[ashallendesign/laravel-exchange-rates

A wrapper package for interacting with the exchangeratesapi.io API.

485677.8k](/packages/ashallendesign-laravel-exchange-rates)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[vluzrmos/slack-api

Wrapper for Slack.com WEB API.

102589.1k3](/packages/vluzrmos-slack-api)[smodav/mpesa

M-Pesa API implementation

16363.7k1](/packages/smodav-mpesa)[codebar-ag/laravel-docuware

DocuWare integration with Laravel

1221.1k](/packages/codebar-ag-laravel-docuware)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
