From 9642e603e7851c4be69e5b9d5f4d45d398edaf1e Mon Sep 17 00:00:00 2001 From: adonis Date: Sat, 1 Aug 2026 16:47:26 +0330 Subject: [PATCH] fix some show --- database/sql/deploy_settings_const.sql | 118 ++++++++++++++++++++++++- 1 file changed, 117 insertions(+), 1 deletion(-) diff --git a/database/sql/deploy_settings_const.sql b/database/sql/deploy_settings_const.sql index 76b2061..3c0cec9 100644 --- a/database/sql/deploy_settings_const.sql +++ b/database/sql/deploy_settings_const.sql @@ -769,9 +769,61 @@ INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `de SELECT 'main_metal', 'طلا', 'نام فلز اصلی (ادمین)', 0, 1, NULL, 'text' WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'main_metal' LIMIT 1); +-- --------------------------------------------------------------------------- +-- درگاه شارژ آنلاین (Montify / external_payment) — فقط تنظیمات پیشرفته (can_edit=0) +-- پیش‌فرض enabled خاموش؛ value ردیف موجود دست نخورده می‌ماند. +-- --------------------------------------------------------------------------- +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'external_payment_enabled', 'false', 'فعال‌سازی شارژ آنلاین', 0, 1, + 'روشن: در صورت کامل بودن BASE_URL و client_id و client_secret و gateway، دکمه پرداخت آنلاین در اپ نمایش داده می‌شود. خاموش: فقط واریز دستی.', + 'switch' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'external_payment_enabled' LIMIT 1); + +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'wallet_payment_provider', 'none', 'نوع درگاه شارژ آنلاین', 0, 1, + 'none=خاموش، montify=پارتنر Montify|none,montify', + 'select' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'wallet_payment_provider' LIMIT 1); + +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'external_payment_base_url', '', 'آدرس API درگاه (BASE_URL)', 0, 1, + 'آدرس پایه API سرویس Montify (بدون اسلش انتهایی)، مثلاً https://node.example.com — فقط سرور؛ در اپ کاربر ارسال نمی‌شود.', + 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'external_payment_base_url' LIMIT 1); + +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'external_payment_client_id', '', 'شناسه کلاینت (client_id)', 0, 1, + 'شناسه partner (client_id) — فقط سرور؛ در اپ کاربر یا پاسخ get_settings عمومی نیست.', + 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'external_payment_client_id' LIMIT 1); + +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'external_payment_client_secret', '', 'رمز کلاینت (client_secret)', 0, 1, + 'رمز مخفی partner (client_secret) — فقط سرور. در فرانت و Network تب کاربر دیده نمی‌شود.', + 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'external_payment_client_secret' LIMIT 1); + +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'external_payment_gateway', 'zarinpall', 'نام درگاه داخل Montify', 0, 1, + 'نام درگاه فعال داخل Montify: zarinpall، zibal، payping یا sepal|zarinpall,zibal,payping,sepal', + 'select' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'external_payment_gateway' LIMIT 1); + +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'external_payment_return_url', '', 'آدرس برگشت (return_url)', 0, 1, + 'آدرس صفحه فرانت بعد از پرداخت. خالی = دامنه سایت + /wallet/payment-result', + 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'external_payment_return_url' LIMIT 1); + +INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`, `type`) +SELECT 'external_payment_webhook_url', '', 'آدرس Webhook', 0, 1, + 'آدرس بک‌اند برای webhook (شارژ قطعی کیف). خالی = مسیر پیش‌فرض سرور.', + 'text' +WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'external_payment_webhook_url' LIMIT 1); + -- درگاه — کلیدهای اختیاری payping INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`) -SELECT 'payping_fin_sync_enabled', 'false', 'همگام‌سازی fin', 1, 1, NULL +SELECT 'payping_fin_sync_enabled', 'false', 'همگام‌سازی fin', 0, 1, NULL WHERE NOT EXISTS (SELECT 1 FROM `settings` WHERE `key` = 'payping_fin_sync_enabled' LIMIT 1); INSERT INTO `settings` (`key`, `value`, `title_fa`, `can_edit`, `is_active`, `description`) @@ -1740,6 +1792,14 @@ UPDATE `settings` SET `can_edit` = 0 WHERE `key` IN ( 'bale_bot_token', 'chart_id', 'chart_use_local_data', 'external_order_api_enabled', + 'external_payment_enabled', + 'external_payment_base_url', + 'external_payment_client_id', + 'external_payment_client_secret', + 'external_payment_gateway', + 'external_payment_return_url', + 'external_payment_webhook_url', + 'wallet_payment_provider', 'fee_deduct_from_gold', 'referral_bonus_amount', 'group_sms', @@ -1856,6 +1916,62 @@ UPDATE `settings` SET `can_edit` = 0 WHERE `key` IN ( UPDATE `settings` SET `can_edit` = 0, `is_active` = 1 WHERE `key` LIKE 'zarin_%'; UPDATE `settings` SET `type` = 'text', `can_edit` = 0 WHERE `key` IN ('zarin_api', 'zarin_token', 'zarin_name_g', 'zarin_uid_prefix'); UPDATE `settings` SET `type` = 'number', `can_edit` = 0 WHERE `key` IN ('zarin_noe_kar', 'zarin_noe_kar_tedadi', 'zarin_gorohe_kar'); + +-- درگاه شارژ آنلاین (Montify) — متادیتا + can_edit=0 (value دست نخورده) +UPDATE `settings` SET + `title_fa` = 'فعال‌سازی شارژ آنلاین', + `type` = 'switch', + `can_edit` = 0, + `description` = 'روشن: در صورت کامل بودن BASE_URL و client_id و client_secret و gateway، دکمه پرداخت آنلاین در اپ نمایش داده می‌شود. خاموش: فقط واریز دستی.' +WHERE `key` = 'external_payment_enabled'; +UPDATE `settings` SET + `title_fa` = 'نوع درگاه شارژ آنلاین', + `type` = 'select', + `can_edit` = 0, + `description` = 'none=خاموش، montify=پارتنر Montify|none,montify' +WHERE `key` = 'wallet_payment_provider'; +UPDATE `settings` SET + `title_fa` = 'آدرس API درگاه (BASE_URL)', + `type` = 'text', + `can_edit` = 0, + `description` = 'آدرس پایه API سرویس Montify (بدون اسلش انتهایی)، مثلاً https://node.example.com — فقط سرور؛ در اپ کاربر ارسال نمی‌شود.' +WHERE `key` = 'external_payment_base_url'; +UPDATE `settings` SET + `title_fa` = 'شناسه کلاینت (client_id)', + `type` = 'text', + `can_edit` = 0, + `description` = 'شناسه partner (client_id) — فقط سرور؛ در اپ کاربر یا پاسخ get_settings عمومی نیست.' +WHERE `key` = 'external_payment_client_id'; +UPDATE `settings` SET + `title_fa` = 'رمز کلاینت (client_secret)', + `type` = 'text', + `can_edit` = 0, + `description` = 'رمز مخفی partner (client_secret) — فقط سرور. در فرانت و Network تب کاربر دیده نمی‌شود.' +WHERE `key` = 'external_payment_client_secret'; +UPDATE `settings` SET + `title_fa` = 'نام درگاه داخل Montify', + `type` = 'select', + `can_edit` = 0, + `description` = 'نام درگاه فعال داخل Montify: zarinpall، zibal، payping یا sepal|zarinpall,zibal,payping,sepal' +WHERE `key` = 'external_payment_gateway'; +UPDATE `settings` SET + `title_fa` = 'آدرس برگشت (return_url)', + `type` = 'text', + `can_edit` = 0, + `description` = 'آدرس صفحه فرانت بعد از پرداخت. خالی = دامنه سایت + /wallet/payment-result' +WHERE `key` = 'external_payment_return_url'; +UPDATE `settings` SET + `title_fa` = 'آدرس Webhook', + `type` = 'text', + `can_edit` = 0, + `description` = 'آدرس بک‌اند برای webhook (شارژ قطعی کیف). خالی = مسیر پیش‌فرض سرور.' +WHERE `key` = 'external_payment_webhook_url'; +-- فقط برای ردیف تازه/خالی: پیش‌فرض خاموش (value موجود ادمین حفظ می‌شود) +UPDATE `settings` SET `value` = 'false' +WHERE `key` = 'external_payment_enabled' AND (`value` IS NULL OR TRIM(`value`) = ''); +UPDATE `settings` SET `value` = 'none' +WHERE `key` = 'wallet_payment_provider' AND (`value` IS NULL OR TRIM(`value`) = ''); + UPDATE `settings` SET `title_fa` = 'سیستم حسابداری', `type` = 'select', `description` = 'none,pargar,tahesab,zarin' WHERE `key` = 'accounting_provider'; UPDATE `settings` SET `description` = 'سیستم حسابداری: none=هیچکدام، pargar=API پرگار، tahesab=ارسال خودکار ته‌حساب، zarin=ارسال خودکار زرین.' WHERE `key` = 'accounting_provider';