second try
This commit is contained in:
parent
2818eb7f38
commit
13041dd63e
@ -9,7 +9,7 @@ import PIL.Image
|
||||
import random
|
||||
|
||||
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
|
||||
@ -51,16 +51,19 @@ def register(request):
|
||||
|
||||
payment_data = {
|
||||
'merchant': COMGATE_MERCHANT,
|
||||
'test': COMGATE_TEST,
|
||||
'price': 69000,
|
||||
'curr': 'CZK',
|
||||
'method': 'ALL',
|
||||
'label': 'Startovné',
|
||||
'email': request.POST['email'],
|
||||
'fullName': f"{request.POST['first_name']} {request.POST['last_name']}",
|
||||
'refId': f'{user.id}',
|
||||
'secret': COMGATE_SECRET,
|
||||
'prepareOnly': True,
|
||||
}
|
||||
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')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user