nztforum/lzt-invoices-php

PHP library for the Lolzteam Market Invoices

dev-master 2025-04-14 17:06 UTC

This package is auto-updated.

Last update: 2025-08-14 18:03:01 UTC


README

PHP library for the Lolzteam Market Invoices

Requirements

PHP 8.3.0 and later.

Composer

You can install the bindings via Composer. Run the following command:

composer require nztforum/lzt-invoices-php

To use the bindings, use Composer's autoload:

require_once 'vendor/autoload.php';

Getting Started

Simple usage looks like (creating invoice):

try {
$api = new LZT\Api('YOUR_API_KEY');
$payUrl = $api->invoice([
	'currency' => 'rub',
	'amount' => 500,
	'payment_id' => random_int(100, 100000),
	'comment' => 'Test invoice',
	'url_success' => 'https://lolz.live/',
	'url_callback' => 'https://example.com/callback',
	'merchant_id' => 1,
	'lifetime' => 3600,
]);
} catch (\LZT\Exception $e) { // handle errors
	$errors = $e->getErrors();
}

// Get info by payment_id / invoice_id

$info = $api->info(paymentId: 10000);

// or

$info = $api->info(invoiceId: 500);

Webhook verify

$webhook = new LZT\Webhook('YOUR_MERCHANT_SECRET');
if ($webhook->verify()) {
	echo 'Webhook verified';
} else {
	echo 'Webhook verification failed';
}