'', 'secret' => '', 'enabled' => true, 'events' => [ 'host.created' => true, 'host.paused' => true, 'host.unpaused' => true, 'host.renewed' => true, 'host.deleted' => true, 'order.paid' => true, ], ]; $insecure = mnbt_plugin_option_get('webhook_notify', 'insecure_ssl', 'false') === 'true'; $logs = mnbt_plugin_option_get('webhook_notify', 'delivery_log', []); if (!is_array($logs)) { $logs = []; } $eventLabels = [ 'host.created' => '主机开通', 'host.paused' => '主机暂停', 'host.unpaused' => '主机恢复', 'host.renewed' => '主机续费', 'host.deleted' => '主机删除', 'order.paid' => '订单支付成功', ]; ?>

Webhook 通知

事件发生时向指定 URL 发送 JSON(POST)。可选 HMAC-SHA256 签名头 X-MNBT-Signature。

>
签名:sha256=HMAC_SHA256(body, secret),请求头 X-MNBT-Signature
>
$lab): ?>
>

投递日志
请求体示例
{
  "event": "host.created",
  "time": "2026-07-16T12:00:00+08:00",
  "source": "mnbt",
  "payload": {
    "host": { "user": "demo001", "ssbt": "bt1", "btid": "12", "sqldz": "mnbt.1xxx", "datae": "2027-01-01" },
    "ctx": { "source": "admin" }
  }
}