1. Go to this page and download the library: Download quesoft/ntak-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
quesoft / ntak-php example snippets
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 // hit the test NTAK API when true
);
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',
category: NTAKCategory::ALKOHOLOSITAL,
subcategory: NTAKSubcategory::PARLAT,
vat: NTAKVat::C_27,
price: 1000,
amountType: NTAKAmount::LITER,
amount: 0.04,
quantity: 2,
when: Carbon::now(),
isDrs: false, // DRS deposit (50 Ft) when true
bypassServiceFee: false, // exclude from service fee base
discount: null, // item-level %; null → inherit order discount
);
use QueSoft\Ntak\Enums\NTAKPaymentType;
use QueSoft\Ntak\Models\NTAKPayment;
$payment = new NTAKPayment(
paymentType: NTAKPaymentType::BANKKARTYA,
total: 2000
);
use Carbon\Carbon;
use QueSoft\Ntak\Enums\NTAKAggregateCause;
use QueSoft\Ntak\Enums\NTAKOrderType;
use QueSoft\Ntak\Models\NTAKOrder;
$order = new NTAKOrder(
orderType: NTAKOrderType::NORMAL,
orderId: 'your-rms-order-id',
orderItems: [$orderItem],
start: Carbon::now()->subMinutes(7),
end: Carbon::now(),
payments: [$payment],
isAtTheSpot: true,
discount: 20, // order-level %
serviceFee: 10, // % of discounted total (respects bypassServiceFee)
ntakOrderId: null, //
use Carbon\Carbon;
use QueSoft\Ntak\NTAK;
$processId = NTAK::message($client, Carbon::now())
->handleOrder($order);