Refactor payments

This commit is contained in:
v2board
2023-08-23 01:33:08 +08:00
parent 4f04eab073
commit fb338aeb96
6 changed files with 2 additions and 116 deletions

View File

@ -36,9 +36,9 @@ class Helper
public static function exchange($from, $to)
{
$result = file_get_contents('https://api.exchangerate.host/latest?symbols=' . $to . '&base=' . $from);
$result = file_get_contents("https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/latest/currencies/" . $from . "/" . $to . ".json");
$result = json_decode($result, true);
return $result['rates'][$to];
return $result[$to];
}
public static function randomChar($len, $special = false)