updates
This commit is contained in:
parent
2c84576e63
commit
b0ecfc00bb
@ -88,7 +88,10 @@ COMGATE_TEST = True
|
||||
COMGATE_SECRET = '2c07bfabd1a5e4a312dc49929de60aa2'
|
||||
|
||||
|
||||
ADMINS = [('Martin Quarda', 'martin@quarda.cz')]
|
||||
|
||||
# Email
|
||||
SERVER_EMAIL = 'info@alkator.cz'
|
||||
DEFAULT_FROM_EMAIL = 'info@alkator.cz'
|
||||
EMAIL_HOST = 'smtp.seznam.cz'
|
||||
EMAIL_PORT = 465
|
||||
|
@ -88,7 +88,7 @@ def register(request):
|
||||
|
||||
if result['code'][0] != '0':
|
||||
user.delete()
|
||||
return HttpResponse('{"reason":"Chyba na straně platební brány: ' + result['message'][0] + '"}', status=400, content_type='application/json')
|
||||
return HttpResponse('{"reason":"Chyba na straně platební brány: ' + result['message'][0] + ', zkuste prosím registraci později."}', status=400, content_type='application/json')
|
||||
|
||||
user.trans_id = result['transId'][0]
|
||||
user.save()
|
||||
@ -114,7 +114,6 @@ def payment_result(request):
|
||||
f"body",
|
||||
"info@alkator.cz",
|
||||
[user.email],
|
||||
fail_silently=True,
|
||||
)
|
||||
elif paid == 'CANCELLED' and not user.paid:
|
||||
user.delete()
|
||||
@ -123,10 +122,13 @@ def payment_result(request):
|
||||
|
||||
def payment_state(request):
|
||||
invoice_id = request.GET['refId']
|
||||
try:
|
||||
if User.objects.get(invoice_id=invoice_id).paid:
|
||||
return HttpResponse('{"status":"success", "reason":"Úspěšná platba"}', content_type='application/json')
|
||||
else:
|
||||
return HttpResponse('{"status":"failed", "reason":"Zatím nemáme informace o provedené platbě. Zkuste reload nebo zkontrolujte email."}', content_type='application/json')
|
||||
except User.DoesNotExist as e:
|
||||
return HttpResponse('{"status":"failed", "reason":"Uživatel neexistuje, prosím registraci opakujte."}', content_type='application/json')
|
||||
|
||||
|
||||
def results(request):
|
||||
|
@ -31,10 +31,15 @@ class Main extends Component {
|
||||
this.setState({photos: json})
|
||||
})
|
||||
if(window.location.search){
|
||||
fetch(addr_prefix + "/api/payment_state" + window.location.search).then(resp => resp.json()).then(json =>{
|
||||
let searchParams = new URLSearchParams(window.location.search);
|
||||
for(const [key, value] of searchParams){
|
||||
if (key == "refId"){
|
||||
fetch(addr_prefix + "/api/payment_state?refId=" + value).then(resp => resp.json()).then(json =>{
|
||||
this.setState({status: json.status, text: json.reason})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
window.addEventListener("hashchange", (e) => {this.onHashChange(e)})
|
||||
}
|
||||
closePhoto = () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user