From 5d043b0150e1511e858f6825092161ec45fc099c Mon Sep 17 00:00:00 2001 From: cryptochangements34 Date: Sat, 5 Aug 2017 12:12:57 -0500 Subject: [PATCH] Adjusts $xmr_live_price - $rate_cookie comparison This adjusts the comparison in favor of the merchant --- monero/include/monero_payments.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monero/include/monero_payments.php b/monero/include/monero_payments.php index 03fa45b..359d52c 100644 --- a/monero/include/monero_payments.php +++ b/monero/include/monero_payments.php @@ -165,7 +165,7 @@ class Monero_Gateway extends WC_Payment_Gateway { $rate_cookie = $_COOKIE['rate']; $xmr_live_price = $this->retriveprice($currency); - if($xmr_live_price - $rate_cookie >= 1) //reset rate if there is a difference of 1 EURO/DOLLAR/ETC between the live rate and the cookie rate + if($xmr_live_price - $rate_cookie >= 1 || $xmr_live_price - $rate_cookie >= -1) //reset rate if there is a difference of 1 EURO/DOLLAR/ETC between the live rate and the cookie rate { //this is so that the merchant does not lose money from exchange market forces or cookie tampering $new_amount = $amount / $rate_cookie; $rounded_amount = round($new_amount, 12);