40 |
40 |
from django.template.response import TemplateResponse
|
41 |
41 |
from django.urls import reverse
|
42 |
42 |
from django.utils import dateparse
|
43 |
|
from django.utils.encoding import force_str, smart_text
|
|
43 |
from django.utils.encoding import force_str, smart_str
|
44 |
44 |
from django.utils.http import urlencode
|
45 |
45 |
from django.utils.translation import gettext_lazy as _
|
46 |
46 |
from django.views.decorators.csrf import csrf_exempt
|
... | ... | |
304 |
304 |
|
305 |
305 |
amount = LocaleDecimal(request.GET['amount'])
|
306 |
306 |
|
307 |
|
logger.info('validating amount %s for transaction %s', amount, smart_text(transaction.id))
|
|
307 |
logger.info('validating amount %s for transaction %s', amount, smart_str(transaction.id))
|
308 |
308 |
try:
|
309 |
309 |
result = transaction.make_eopayment(request=request).backend.validate(
|
310 |
310 |
amount, transaction.bank_data
|
... | ... | |
343 |
343 |
|
344 |
344 |
amount = LocaleDecimal(request.GET['amount'])
|
345 |
345 |
|
346 |
|
logger.info('cancelling amount %s for transaction %s', amount, smart_text(transaction.id))
|
|
346 |
logger.info('cancelling amount %s for transaction %s', amount, smart_str(transaction.id))
|
347 |
347 |
try:
|
348 |
348 |
result = transaction.make_eopayment(request=request).backend.cancel(amount, transaction.bank_data)
|
349 |
349 |
except eopayment.ResponseError as e:
|
... | ... | |
464 |
464 |
return HttpResponseRedirect(get_payment_status_view(next_url=next_url))
|
465 |
465 |
logger.info(
|
466 |
466 |
'emitted payment request with id %s',
|
467 |
|
smart_text(order_id),
|
468 |
|
extra={'eopayment_order_id': smart_text(order_id), 'eopayment_data': repr(data)},
|
|
467 |
smart_str(order_id),
|
|
468 |
extra={'eopayment_order_id': smart_str(order_id), 'eopayment_data': repr(data)},
|
469 |
469 |
)
|
470 |
470 |
transaction.order_id = order_id
|
471 |
471 |
transaction.save()
|
472 |
|
-
|