From 903bd8b2d796fcadb4236a0e3ddb4a9f1e30bb09 Mon Sep 17 00:00:00 2001 From: cameleater <34056915+cameleater@users.noreply.github.com> Date: Fri, 18 May 2018 10:57:33 +0800 Subject: [PATCH] update monero_payments.php should now support all the woocommerce currencies as long as the currency is also supported cryptocompare api --- monero/include/monero_payments.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/monero/include/monero_payments.php b/monero/include/monero_payments.php index ab060eb..2e5fb44 100644 --- a/monero/include/monero_payments.php +++ b/monero/include/monero_payments.php @@ -583,7 +583,8 @@ class Monero_Gateway extends WC_Payment_Gateway public function retriveprice($currency) { - $xmr_price = file_get_contents('https://min-api.cryptocompare.com/data/price?fsym=XMR&tsyms=BTC,USD,EUR,CAD,INR,GBP,COP,SGD&extraParams=monero_woocommerce'); + $api_link = 'https://min-api.cryptocompare.com/data/price?fsym=XMR&tsyms=BTC,USD,EUR,CAD,INR,GBP,COP,SGD' . ',' . $currency . '&extraParams=monero_woocommerce'; + $xmr_price = file_get_contents($api_link); $price = json_decode($xmr_price, TRUE); if (!isset($price)) { $this->log->add('Monero_Gateway', '[ERROR] Unable to get the price of Monero'); @@ -603,6 +604,8 @@ class Monero_Gateway extends WC_Payment_Gateway return $price['COP']; case 'SGD': return $price['SGD']; + case $currency: + return $price[$currency]; case 'XMR': $price = '1'; return $price;