igzard/php-unas-webhook
最新稳定版本:v0.1.1
Composer 安装命令:
composer require igzard/php-unas-webhook
包简介
Unas Webhook Processor
关键字:
README 文档
README
🛍️ Use this package to process incoming webhooks from Unas.
Requires PHP 8.3+
Getting started
Get Hmac Secret from UNAS
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
Installation
composer require igzard/php-unas-webhook
Usage
//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...
Contributing
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.
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-11-03