feat(users): normalize center routes and withdrawal limits
This commit is contained in:
@@ -438,16 +438,18 @@ class PaymentRuntime {
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array{min_amount:int,service_charge_rate:int,text:string}
|
||||
*/
|
||||
/** @return array{min_amount:float,service_charge_rate:int,daily_count:int,daily_limit:float,reset_time:string} */
|
||||
public static function get_withdrawal_settings(): array {
|
||||
$s = Settings::get_all();
|
||||
|
||||
return [
|
||||
'min_amount' => max(1, min(99999, (int) ($s['pay_rebate_withdraw_lowest_money'] ?? 50))),
|
||||
'service_charge_rate' => max(0, min(50, (int) ($s['withdraw_service_charge'] ?? 0))),
|
||||
'text' => sanitize_textarea_field((string) ($s['pay_rebate_withdraw_text_details'] ?? '')),
|
||||
'min_amount' => max(0, min(99999, (float) ($s['pay_rebate_withdraw_lowest_money'] ?? 50))),
|
||||
'service_charge_rate' => max(0, min(50, (int) ($s['withdraw_service_charge'] ?? 5))),
|
||||
'daily_count' => max(0, min(99999, (int) ($s['withdraw_daily_count'] ?? 3))),
|
||||
'daily_limit' => max(0, min(999999, (float) ($s['withdraw_daily_limit'] ?? 50))),
|
||||
'reset_time' => preg_match('/^(?:[01]\\d|2[0-3]):[0-5]\\d$/', (string) ($s['withdraw_reset_time'] ?? '00:00'))
|
||||
? (string) $s['withdraw_reset_time']
|
||||
: '00:00',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user