|
|
@@ -17,16 +17,14 @@ class WithdrawalPayoutMonitor
|
|
|
}
|
|
|
|
|
|
$changed = WithdrawalAgentRatioConfig::disableAgent($agent);
|
|
|
- if ($changed) {
|
|
|
- self::sendInsufficientBalanceNotice($agent, $orderId, $message);
|
|
|
- }
|
|
|
+ self::sendInsufficientBalanceNotice($agent, $orderId, $message, $changed);
|
|
|
|
|
|
return $changed;
|
|
|
}
|
|
|
|
|
|
private static function isInsufficientBalance($message)
|
|
|
{
|
|
|
- return preg_match('/insufficient\s*(balance|funds)|balance\s*(is\s*)?(not\s*)?enough|not\s*enough\s*balance|\x{4F59}\x{989D}\x{4E0D}\x{8DB3}/iu', $message) === 1;
|
|
|
+ return preg_match('/insufficien\w*|insufficent|not\s*sufficient|balance\s*(is\s*)?(not\s*)?enough|not\s*enough\s*balance|\x{4F59}\x{989D}\x{4E0D}\x{8DB3}/iu', $message) === 1;
|
|
|
}
|
|
|
|
|
|
private static function callbackText($callback)
|
|
|
@@ -38,7 +36,7 @@ class WithdrawalPayoutMonitor
|
|
|
return strval($callback);
|
|
|
}
|
|
|
|
|
|
- private static function sendInsufficientBalanceNotice($agent, $orderId, $message)
|
|
|
+ private static function sendInsufficientBalanceNotice($agent, $orderId, $message, $changed)
|
|
|
{
|
|
|
$agentName = DB::table('agent.dbo.admin_configs')
|
|
|
->where('type', 'cash')
|
|
|
@@ -48,7 +46,7 @@ class WithdrawalPayoutMonitor
|
|
|
$content = "Insufficient balance\n"
|
|
|
. "Payout channel: " . ($agentName ?: $agent) . "({$agent})\n"
|
|
|
. "Order ID: " . ($orderId ?: '-') . "\n"
|
|
|
- . "Auto payout ratio for this channel has been set to 0\n"
|
|
|
+ . "Auto payout ratio status: " . ($changed ? 'set to 0' : 'already 0') . "\n"
|
|
|
. "Callback: " . mb_substr($message, 0, 800);
|
|
|
|
|
|
try {
|