๐๏ธ Use this package to process incoming webhooks from Unas.
Requires PHP 8.3+
1. First step you need to login to your unas webshop admin (https://unas.hu/belepes)
2. Navigate to Settings -> External connections -> API connection (https://shop.unas.hu/admin_config_connect_api.php)
3. Click to "Verify webhook" tab
4. Click to "HMAC key generation"
5. Copy+Paste your Hmac secret code
composer require igzard/php-unas-webhook
//Initialize Unas Webhook with your Unas shop HMAC secret and request header UNAS hmac
use Igzard\PhpUnasWebhook\UnasWebhook;
$webhook = new UnasWebhook([
'hmac' => 'your-unas-shop-hmac-secret',
'hmac_header' => 'Hmac secret from http header e.g: $_SERVER["HTTP_X_UNAS_HMAC"]'
]);
//Process incoming webhook request
$unasOrder = $webhook->process("{'message':'Unas request json'}");
//Get order data eg. order number
$orderNumber = $unasOrder->getOrderId()->getValue(); //return with unas webshop order number string
//or get customer data
$customer = $unasOrder->getCustomer(); //return with Customer data object
//etc.
//processing Unas Order with your domain logic...
We are open to contributions. If you want to fix a bug, implement a new feature or just ask a question, please feel free to open an issue or create a pull request.
๐ Install dependencies with composer:
make composer-install
โ Run Code quality check:
make code-quality
๐ท Run PHPUnit tests:
make phpunit
๐จ Run cs-fix:
make cs-fix
๐ฅ Run phpstan:
make phpstan
โป๏ธ Run rector:
make rector
PHP UNAS Webhook processor was created by Gergely Ignรกcz under the MIT license.