Enable gated multi-level referral profit and harden chat/SMS notify paths.
Honor enable_customer_level_profit for order referral payouts, and tighten support-chat webhook/SMS plus SuperAdmin SMS panel sync settings. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -134,16 +134,18 @@ class SupportChatNotifyController extends Controller
|
||||
|
||||
/**
|
||||
* ثبت/تازهسازی وبهوک روی ah_chat (از پنل ادمین).
|
||||
* همیشه HTTP 200 — شکست ثبت best-effort است و نباید toast خطای 422 بسازد.
|
||||
*/
|
||||
public function ensureWebhook()
|
||||
{
|
||||
$service = app(ChatWebhookService::class);
|
||||
$ok = $service->ensureRegistered();
|
||||
$result = app(ChatWebhookService::class)->ensureRegisteredDetailed();
|
||||
|
||||
return response()->json([
|
||||
'ok' => $ok,
|
||||
'webhook_url' => $service->webhookUrl(),
|
||||
'message' => $ok ? 'webhook registered' : 'webhook register skipped or failed',
|
||||
], $ok ? 200 : 422);
|
||||
'ok' => (bool) ($result['ok'] ?? false),
|
||||
'webhook_url' => (string) ($result['webhook_url'] ?? ''),
|
||||
'reason' => (string) ($result['reason'] ?? ''),
|
||||
'message' => (string) ($result['message'] ?? ''),
|
||||
'attempts' => (int) ($result['attempts'] ?? 0),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user