From 01e44cf97f09af9b6a06c6033d0f3fd7a01da4c6 Mon Sep 17 00:00:00 2001 From: serhack Date: Wed, 26 Jul 2017 21:52:48 +0200 Subject: [PATCH] Update monero_payments.php --- monero/include/monero_payments.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/monero/include/monero_payments.php b/monero/include/monero_payments.php index 27c97b5..4294e62 100644 --- a/monero/include/monero_payments.php +++ b/monero/include/monero_payments.php @@ -15,6 +15,7 @@ class Monero_Gateway extends WC_Payment_Gateway $this->icon = apply_filters('woocommerce_offline_icon', ''); $this->has_fields = false; + $this->log = new WC_Logger(); $this->init_form_fields(); $this->host = $this->get_option('daemon_host'); @@ -141,6 +142,9 @@ class Monero_Gateway extends WC_Payment_Gateway { $xmr_price = file_get_contents('https://min-api.cryptocompare.com/data/price?fsym=XMR&tsyms=BTC,USD,EUR&extraParams=your_app_name'); $l = json_decode($xmr_price, TRUE); + if(isset($l)){ + $this->log->add('Monero_Gateway', 'API ERROR: Unable to get a price '); + } if ($currency == 'USD') { return $l['USD']; } @@ -208,7 +212,9 @@ class Monero_Gateway extends WC_Payment_Gateway $payment_id = bin2hex(openssl_random_pseudo_bytes(8)); $uri = "monero:$address?amount=$amount?payment_id=$payment_id"; $array_integrated_address = $this->monero_daemon->make_integrated_address($payment_id); - + if(isset($array_integrated_address)){ + $this->log->add('Monero_Gateway', 'Error. Unable to getting integrated address '); + } // Generate a QR code echo "";