fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
missing chunk
[wolnelektury.git]
/
src
/
club
/
payu
/
models.py
diff --git
a/src/club/payu/models.py
b/src/club/payu/models.py
index
10dd60a
..
b025bfc
100644
(file)
--- a/
src/club/payu/models.py
+++ b/
src/club/payu/models.py
@@
-8,7
+8,7
@@
from django.contrib.sites.models import Site
from django.db import models
from django.urls import reverse
from django.utils.timezone import now
from django.db import models
from django.urls import reverse
from django.utils.timezone import now
-from django.utils.translation import
u
gettext_lazy as _
+from django.utils.translation import gettext_lazy as _
from . import POSS
from . import POSS
@@
-77,6
+77,9
@@
class Order(models.Model):
def get_notify_url(self):
raise NotImplementedError
def get_notify_url(self):
raise NotImplementedError
+ def get_thanks_url(self):
+ raise NotImplementedError
+
def status_updated(self):
pass
def status_updated(self):
pass
@@
-85,6
+88,11
@@
class Order(models.Model):
def get_pos(self):
return POSS[self.pos_id]
def get_pos(self):
return POSS[self.pos_id]
+ def get_continue_url(self):
+ return "https://{}{}".format(
+ Site.objects.get_current().domain,
+ self.get_thanks_url())
+
def get_representation(self, token=None):
rep = {
"notifyUrl": self.get_notify_url(),
def get_representation(self, token=None):
rep = {
"notifyUrl": self.get_notify_url(),
@@
-141,7
+149,7
@@
class Order(models.Model):
self.order_id = response['orderId']
self.save()
self.order_id = response['orderId']
self.save()
- return response.get('redirectUri', self.
schedule.
get_thanks_url())
+ return response.get('redirectUri', self.get_thanks_url())
class Notification(models.Model):
class Notification(models.Model):