fix: Stripe payment not working

This commit is contained in:
Vincent Young 2023-10-26 01:02:45 -04:00
parent 0ca47622a5
commit 4250032318
No known key found for this signature in database
GPG Key ID: 84A0830C90354A56
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];
}
}