| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- <?php
- use Longyi\Feishu\Listeners\PaymentAlertSubscriber;
- /*
- |--------------------------------------------------------------------------
- | 飞书群自定义机器人
- |--------------------------------------------------------------------------
- |
- | 用于把需要人工介入的运营事件推送到飞书群。发送始终走队列,飞书不可用
- | 不会影响支付主流程。
- |
- */
- return [
- /*
- | 总开关。未配置 webhook_url 时即使打开也不会发送。
- */
- 'enabled' => env('FEISHU_BOT_ENABLED', false),
- /*
- | 群机器人的 Webhook 地址,形如
- | https://open.feishu.cn/open-apis/bot/v2/hook/xxxxxxxx
- */
- 'webhook_url' => env('FEISHU_BOT_WEBHOOK_URL', ''),
- /*
- | 机器人「加签」安全设置里的密钥。留空表示未开启加签。
- */
- 'secret' => env('FEISHU_BOT_SECRET', ''),
- /*
- | 单次请求超时(秒)。飞书接口很快,不要设太长,免得拖住队列。
- */
- 'timeout' => (int) env('FEISHU_BOT_TIMEOUT', 5),
- /*
- | 发送任务所在队列。
- */
- 'queue' => env('FEISHU_BOT_QUEUE', 'notifications'),
- /*
- | 同一订单的同一类告警在该时间窗内只发一次,避免对账反复扫描时刷屏。
- | 设为 0 关闭去重。
- */
- 'throttle_minutes' => (int) env('FEISHU_BOT_THROTTLE_MINUTES', 60),
- /*
- | 卡片里「查看订单」按钮的地址模板,{id} 会被订单 id 替换。
- | 留空时回退到 admin.sales.orders.view 路由。
- */
- 'admin_order_url' => env('FEISHU_BOT_ADMIN_ORDER_URL', ''),
- /*
- | 环境标识,会显示在卡片脚注,避免测试环境的告警被误当成线上。
- */
- 'environment' => env('FEISHU_BOT_ENVIRONMENT', env('APP_ENV', 'production')),
- /*
- |--------------------------------------------------------------------------
- | 告警映射
- |--------------------------------------------------------------------------
- |
- | key 为事件名,value 描述这条告警怎么呈现:
- |
- | category — 归类,manual = 需人工处理的异常单,cancelled = 超时取消单
- | title — 卡片标题
- | color — 卡片头部颜色(red / orange / carmine / blue / green / grey)
- |
- | 想停掉某类告警,注释掉对应行即可,无需改代码。
- */
- 'alerts' => [
- /* 需人工处理的异常单 */
- 'bagistoapi.payment.reconcile.approved-unsettled' => [
- 'category' => PaymentAlertSubscriber::CATEGORY_MANUAL,
- 'title' => '支付已授权但未入账,需人工确认',
- 'color' => 'red',
- ],
- 'bagistoapi.payment.reconcile.settle-failed' => [
- 'category' => PaymentAlertSubscriber::CATEGORY_MANUAL,
- 'title' => '对账发现扣款但落账失败',
- 'color' => 'red',
- ],
- 'bagistoapi.payment.amount-mismatch' => [
- 'category' => PaymentAlertSubscriber::CATEGORY_MANUAL,
- 'title' => '支付金额与订单金额不符',
- 'color' => 'red',
- ],
- 'bagistoapi.payment.capture-not-completed' => [
- 'category' => PaymentAlertSubscriber::CATEGORY_MANUAL,
- 'title' => '网关扣款未完成',
- 'color' => 'orange',
- ],
- 'bagistoapi.payment.reconcile.no-gateway-info' => [
- 'category' => PaymentAlertSubscriber::CATEGORY_MANUAL,
- 'title' => '订单缺少网关信息,无法对账',
- 'color' => 'orange',
- ],
- /* 超时取消单 */
- 'bagistoapi.payment.reconcile.cancelled' => [
- 'category' => PaymentAlertSubscriber::CATEGORY_CANCELLED,
- 'title' => '支付超时,订单已自动取消',
- 'color' => 'grey',
- ],
- ],
- ];
|