Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Kaffeekasse 2000XT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lehrstuhl für Informatik 4 (Systemsoftware)
PASST
Projekte
Kaffeekasse 2000XT
Commits
11d2291c
Commit
11d2291c
authored
5 years ago
by
Fabian Krüger
Browse files
Options
Downloads
Patches
Plain Diff
add function description
parent
c66fe18f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
store/backend.py
+8
-2
8 additions, 2 deletions
store/backend.py
with
8 additions
and
2 deletions
store/backend.py
+
8
−
2
View file @
11d2291c
...
...
@@ -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
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment