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

ActiveLibrary[API Development](/categories/api)

natsu007/ntak-php
=================

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

1.2.0(2y ago)1111↑150%1MITPHPPHP ^7.1

Since Jun 8Pushed 2y ago1 watchersCompare

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

READMEChangelog (3)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, so I can use API in php 7.1. I hope it helps others who cannot use the latest version of php due to other dependencies. Remdme.md has been partially rewritten to comply with php 7.1. I left the other parts in their original form.**

**Update: I have created a development branch into which I am constantly synchronizing the latest updates from "kiralyta / ntak-php". I will rewrite the updated code if necessary so that it runs in php 7.1. Unit tests are performed on every update. Each update gets a tag.**

Welcome to my little package, that 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 natsu007/ntak-php
```

Usage
-----

[](#usage)

### Instances

[](#instances)

#### Create an API Client Instance

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

```
use Natsu007\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 Natsu007\Ntak\Enums\NTAKAmount;
use Natsu007\Ntak\Enums\NTAKCategory;
use Natsu007\Ntak\Enums\NTAKSubcategory;
use Natsu007\Ntak\Enums\NTAKVat;
use Natsu007\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 Natsu007\Ntak\Enums\NTAKPaymentType;
use Natsu007\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 Natsu007\Ntak\Enums\NTAKOrderType;
use Natsu007\Ntak\Models\NTAKOrderItem;
use Natsu007\Ntak\Models\NTAKOrder;
use Natsu007\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 Natsu007\Ntak\Models\NTAKOrder;
use Natsu007\Ntak\Models\NTAKPayment;
use Natsu007\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 Natsu007\Ntak\Enums\NTAKDayType;
use Natsu007\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 Natsu007\Ntak\Enums\NTAKDayType;
use Natsu007\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 Natsu007\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:natsu007/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

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community11

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

Total

3

Last Release

1054d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6673d7b323ca13f0dd60471a26199361339de8cfbb31d0c47fc46cc72728a77f?d=identicon)[Sunyak](/maintainers/Sunyak)

---

Top Contributors

[![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 (4 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/natsu007-ntak-php/health.svg)

```
[![Health](https://phpackages.com/badges/natsu007-ntak-php/health.svg)](https://phpackages.com/packages/natsu007-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)
