From 11d2291c0635ee6cc336622f718af21b27a34b5e Mon Sep 17 00:00:00 2001 From: Fabian Krueger <fabian.krueger@fau.de> Date: Fri, 20 Sep 2019 15:37:06 +0200 Subject: [PATCH] add function description --- store/backend.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/store/backend.py b/store/backend.py index ac18309..09b3827 100644 --- a/store/backend.py +++ b/store/backend.py @@ -252,12 +252,18 @@ class ChargeLogic: def __updateUserMoney(user, amount): user.updateMoney(amount) + """ + Annulates a charge that is not older than a given number of minutes. Returns False, if the purchase is too old, + returns True else. + @param charge_id: the id of the purchase to annullate + @config-param annullable_time: depends on T_ANNULLABLE_CHARGE_M + """ @staticmethod def annullateCharge(charge_id, token): - # warning: summertime/wintertime currently is not respected in the following calculations. This should be - # implemented to avoid non-annullable transactions in the lost hour between summer- and wintertime annullable_time = config['T_ANNULLABLE_CHARGE_M'] + # warning: summertime/wintertime currently is not respected in the following calculations. This should be + # implemented to avoid non-annullable transactions in the lost hour between summer- and wintertime now = datetime.now() time_limit = datetime.now() - timedelta(minutes=annullable_time) timezone = pytz.timezone('Europe/Berlin') -- GitLab