Skip to content

Commit

Permalink
Merge pull request #9 from cryptochangements34/master
Browse files Browse the repository at this point in the history
Adjusts $xmr_live_price - $rate_cookie comparison
  • Loading branch information
serhack authored Aug 6, 2017
2 parents af89e20 + 5d043b0 commit 1f80f9c
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 1f80f9c

Please sign in to comment.