PHPackages                             quesoft/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. quesoft/ntak-php

ActiveLibrary[API Development](/categories/api)

quesoft/ntak-php
================

An easy to use NTAK PHP Api (for PHP 7.1)

v1.3(2y ago)115MITPHPPHP ^7.1

Since Jun 20Pushed 1y agoCompare

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

READMEChangelog (4)Dependencies (8)Versions (5)Used By (0)

NTAK RMS PHP API / SDK (FOR PHP 7.1)
====================================

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

**This is a fork from  repostitory. We want to extend it some other functions. I hope it helps others. Readme.md is maintained. I left the other parts in their original form. We will merge the new developments of original repo.**

**Orginal repo , thanks for sharing the solution**

---

This helps you make NTAK RMS requests like a boss.

Table of Contents:

- [Installation](#installation)
- [Usage](#usage)
    - [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)
    - [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)
- [Contribution](#contribution)
- [Last Words](#last-words)

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

[](#installation)

```
composer require quesoft/ntak-php
```

Usage
-----

[](#usage)

### Instances

[](#instances)

#### Create an API Client Instance

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

```
use QueSoft\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 QueSoft\Ntak\Enums\NTAKAmount;
use QueSoft\Ntak\Enums\NTAKCategory;
use QueSoft\Ntak\Enums\NTAKSubcategory;
use QueSoft\Ntak\Enums\NTAKVat;
use QueSoft\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()
);
```

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

#### Create a Payment Instance

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

```
use QueSoft\Ntak\Enums\NTAKPaymentType;
use QueSoft\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 QueSoft\Ntak\Enums\NTAKOrderType;
use QueSoft\Ntak\Enums\NTAKAggregateCause;
use QueSoft\Ntak\Models\NTAKOrderItem;
use QueSoft\Ntak\Models\NTAKOrder;
use QueSoft\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',

    aggregated: false, // Is order aggregated
    aggregatedCause: NTAKAggregateCause::UZEMSZUNET_ARAMSZOLGALTATAS_TERVEZETT_KIMARADASA_MIATT(), // If aggregated, It's cause. Defaults to null

    tip_amount: 0, //added to order as BORRAVALO type. Calculation order is items total, then discount, then service fee + tip_amount
);
```

> 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 QueSoft\Ntak\Models\NTAKOrder;
use QueSoft\Ntak\Models\NTAKPayment;
use QueSoft\Ntak\NTAK;

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

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

#### Resend Message (Újraküldés - Rendelésösszesítők/Napzárás)

[](#resend-message-újraküldés---rendelésösszesítőknapzárás)

> Resend previously sent message. Requires decoded array contents from previously sent request's lastRequest message. Useful when you need to resend order or close by verify request. IMPORTANT to set message object when parameter to exactly the same timestamp of previous message!

```
use Carbon\Carbon;
use QueSoft\Ntak\NTAK;

$processId = NTAK::message($client, Carbon::parse($lastSentRequestData["uzenetAdatok"]["uzenetKuldesIdeje"]))
    ->resendMessage(["zarasiInformaciok" => $lastSentRequestData["zarasiInformaciok"]], false);

$processId = NTAK::message($client, Carbon::parse($lastSentRequestData["uzenetAdatok"]["uzenetKuldesIdeje"]))
    ->resendMessage(["zarasiInformaciok" => $lastSentRequestData["zarasiInformaciok"]]);
```

> Returns the NTAK process ID string.

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

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

```
use Carbon\Carbon;
use QueSoft\Ntak\Enums\NTAKDayType;
use QueSoft\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 QueSoft\Ntak\Enums\NTAKDayType;
use QueSoft\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.

Enums
-----

[](#enums)

Namespace of the enums:

```
namespace QueSoft\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\_KULDENDO### NTAKAggregateCause

[](#ntakaggregatecause)

namevalue ***string***UZEMSZUNET\_ARAMSZOLGALTATAS\_TERVEZETT\_KIMARADASA\_MIATTUZEMSZUNET\_ARAMSZOLGALTATAS\_TERVEZETT\_KIMARADASA\_MIATTUZEMSZUNET\_INTERNETSZOLGALTATAS\_TERVEZETT\_KIMARADASA\_MIATTUZEMSZUNET\_INTERNETSZOLGALTATAS\_TERVEZETT\_KIMARADASA\_MIATTUZEMZAVAR\_ARAMSZOLGALTATAS\_ATMENETI\_KIMARADASA\_MIATTUZEMZAVAR\_ARAMSZOLGALTATAS\_ATMENETI\_KIMARADASA\_MIATTUZEMZAVAR\_INTERNETSZOLGALTATAS\_ATMENETI\_KIMARADASA\_MIATTUZEMZAVAR\_INTERNETSZOLGALTATAS\_ATMENETI\_KIMARADASA\_MIATTUZEMZAVAR\_TERMESZETI\_KATASZTROFA\_MIATTUZEMZAVAR\_TERMESZETI\_KATASZTROFA\_MIATTUZEMZAVAR\_LEJART\_TANUSITVANY\_MIATTUZEMZAVAR\_LEJART\_TANUSITVANY\_MIATTUZEMZAVAR\_MUSZAKI\_HIBA\_MIATTUZEMZAVAR\_MUSZAKI\_HIBA\_MIATTContribution
------------

[](#contribution)

```
git clone git@github.com:quesoft-it/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
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~3 days

Total

4

Last Release

1053d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9beb1b3654e3009a415ebfe040685a36719a797f957e69038ceeba801ec357fe?d=identicon)[quesoft-it](/maintainers/quesoft-it)

---

Top Contributors

[![KsimonQS](https://avatars.githubusercontent.com/u/265216824?v=4)](https://github.com/KsimonQS "KsimonQS (7 commits)")[![kiralyta](https://avatars.githubusercontent.com/u/66921954?v=4)](https://github.com/kiralyta "kiralyta (4 commits)")[![Natsu007](https://avatars.githubusercontent.com/u/21281260?v=4)](https://github.com/Natsu007 "Natsu007 (3 commits)")[![fodi](https://avatars.githubusercontent.com/u/1785582?v=4)](https://github.com/fodi "fodi (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.2M720](/packages/statamic-cms)[netflie/whatsapp-cloud-api

The first PHP SDK to send and receive messages using a cloud-hosted version of the WhatsApp Business Platform

640431.7k4](/packages/netflie-whatsapp-cloud-api)[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)

PHPackages © 2026

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