moh4git/maystro-webhook

Maystro Webhook

v0.2.6 2022-12-02 12:45 UTC

This package is auto-updated.

Last update: 2024-09-08 18:05:54 UTC


README

Maystro 交付 webhook 特性包

如何使用

安装

您可以通过 composer 安装此包

composer require moh4git/maystro-webhook

现在运行这个 php artisan 命令

php artisan webhook:install

此命令将在 : app\Http\Controllers\MaystroDelivery 内部创建一个控制器

namespace App\Http\Controllers\MaystroDelivery;

use App\Http\Controllers\Controller;
use MaystroWebhook\MaystroWebhook;
use Illuminate\Http\Request;

class MaystroDeliveryController extends Controller
{
    use MaystroWebhook;
    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest');
    }

    public function responseData()
    {
        \Log::debug(['log_type' => 'test1', 'data' => $this->response_data]);
        return response('OK', 200);
    }
}

用法

在你的 Maystro 账户中,在 webhook 标签页内注册路由 https://yourdomainname.com/maystro/webhook/endpoint