second try
This commit is contained in:
parent
2818eb7f38
commit
13041dd63e
@ -9,7 +9,7 @@ import PIL.Image
|
|||||||
import random
|
import random
|
||||||
|
|
||||||
from .models import User, ALKATOR_CHOICES_DICT
|
from .models import User, ALKATOR_CHOICES_DICT
|
||||||
from alkator.settings import COMGATE_MERCHANT, COMGATE_TEST, COMGATE_SECRET
|
from alkator.settings import COMGATE_MERCHANT, COMGATE_SECRET
|
||||||
|
|
||||||
|
|
||||||
@csrf_exempt
|
@csrf_exempt
|
||||||
@ -51,16 +51,19 @@ def register(request):
|
|||||||
|
|
||||||
payment_data = {
|
payment_data = {
|
||||||
'merchant': COMGATE_MERCHANT,
|
'merchant': COMGATE_MERCHANT,
|
||||||
'test': COMGATE_TEST,
|
|
||||||
'price': 69000,
|
'price': 69000,
|
||||||
'curr': 'CZK',
|
'curr': 'CZK',
|
||||||
|
'method': 'ALL',
|
||||||
'label': 'Startovné',
|
'label': 'Startovné',
|
||||||
|
'email': request.POST['email'],
|
||||||
|
'fullName': f"{request.POST['first_name']} {request.POST['last_name']}",
|
||||||
'refId': f'{user.id}',
|
'refId': f'{user.id}',
|
||||||
'secret': COMGATE_SECRET,
|
'secret': COMGATE_SECRET,
|
||||||
|
'prepareOnly': True,
|
||||||
}
|
}
|
||||||
result = requests.post('https://payments.comgate.cz/v1.0/create', data=payment_data)
|
result = requests.post('https://payments.comgate.cz/v1.0/create', data=payment_data)
|
||||||
|
|
||||||
raise Exception(result)
|
raise Exception(result.text)
|
||||||
|
|
||||||
return HttpResponse('{"success":"Úspěšná registrace."}', content_type='application/json')
|
return HttpResponse('{"success":"Úspěšná registrace."}', content_type='application/json')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user