Merge 4250032318a12fddf20321f566102cc8b0aa61c5 into 0ca47622a50116d0ddd7ffb316b157afb57d25e8

This commit is contained in:
Vincent Young 2023-10-26 01:04:39 -04:00 committed by GitHub
commit 70e654270c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 8 deletions

View File

@ -110,8 +110,10 @@ class StripeAlipay {
private function exchange($from, $to)
{
$result = file_get_contents('https://api.exchangerate.host/latest?symbols=' . $to . '&base=' . $from);
$from = strtolower($from);
$to = strtolower($to);
$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];
}
}

View File

@ -132,8 +132,10 @@ class StripeCheckout {
private function exchange($from, $to)
{
$result = file_get_contents('https://api.exchangerate.host/latest?symbols=' . $to . '&base=' . $from);
$from = strtolower($from);
$to = strtolower($to);
$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];
}
}

View File

@ -117,8 +117,10 @@ class StripeCredit {
private function exchange($from, $to)
{
$result = file_get_contents('https://api.exchangerate.host/latest?symbols=' . $to . '&base=' . $from);
$from = strtolower($from);
$to = strtolower($to);
$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];
}
}

View File

@ -110,8 +110,10 @@ class StripeWepay {
private function exchange($from, $to)
{
$result = file_get_contents('https://api.exchangerate.host/latest?symbols=' . $to . '&base=' . $from);
$from = strtolower($from);
$to = strtolower($to);
$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];
}
}