From 13041dd63e50b539075f50acc250d1deda7e8223 Mon Sep 17 00:00:00 2001 From: Martin Quarda Date: Mon, 5 Aug 2024 15:09:22 +0200 Subject: [PATCH] second try --- alkatorapi/views.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/alkatorapi/views.py b/alkatorapi/views.py index 222dfe8..b2b7154 100644 --- a/alkatorapi/views.py +++ b/alkatorapi/views.py @@ -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')