Skip to content

Commit

Permalink
Adjusts $xmr_live_price - $rate_cookie comparison
Browse files Browse the repository at this point in the history
This adjusts the comparison in favor of the merchant
  • Loading branch information
cryptochangements34 authored Aug 5, 2017
1 parent 6f90755 commit 5d043b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion monero/include/monero_payments.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public function changeto($amount, $currency)
{
$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);
Expand Down

0 comments on commit 5d043b0

Please sign in to comment.