[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [donate/master] Limit matched amount in counter to first 100k donated



commit 908a52069b793e16ffc06f895f465aab104ccfff
Author: Richard Esguerra <resguerra@xxxxxxxxxxxxxxx>
Date:   Fri Dec 11 14:20:51 2020 -0800

    Limit matched amount in counter to first 100k donated
    
    Contributions beyond $100k in the campaign period are not matched, so
    this limits the doubling logic to the appropriate amount and supplies
    the correct amount in the JSON used by the donate page counter.
    
    Issue #49798
---
 src/CampaignController.php | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/CampaignController.php b/src/CampaignController.php
index 1c795114..fd5715ca 100644
--- a/src/CampaignController.php
+++ b/src/CampaignController.php
@@ -18,7 +18,11 @@ class CampaignController extends BaseController {
       $value = $redis->get($keyName);
       $totals[$varName] = floatval($value);
     }
-    $totals['amountWithMozilla'] = $totals['totalAmount'] * 2;
+    if ($totals['totalAmount'] > 100000) {
+      $totals['amountWithMozilla'] = $totals['totalAmount'] + 100000;
+    } else {
+      $totals['amountWithMozilla'] = $totals['totalAmount'] * 2;
+    }
     return $totals;
   }
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits