chore: refactor settings
This commit is contained in:
+9
-3
@@ -41,14 +41,18 @@ def webhook(request, transaction):
|
||||
try:
|
||||
amount_paid = validate_payment_for_transaction(request, transaction)
|
||||
pay_transaction(transaction, amount_paid)
|
||||
redsys_payment_accepted.send_robust(PaymentTransaction.__class__, hash=transaction.hash)
|
||||
redsys_payment_accepted.send_robust(
|
||||
PaymentTransaction.__class__, hash=transaction.hash
|
||||
)
|
||||
|
||||
return HttpResponse(status=200)
|
||||
except Exception as e:
|
||||
transaction.status = PaymentTransaction.StatusChoices.ERROR
|
||||
transaction.observations = str(e)
|
||||
transaction.save()
|
||||
redsys_payment_rejected.send_robust(PaymentTransaction.__class__, hash=transaction.hash)
|
||||
redsys_payment_rejected.send_robust(
|
||||
PaymentTransaction.__class__, hash=transaction.hash
|
||||
)
|
||||
|
||||
return HttpResponse(status=409)
|
||||
|
||||
@@ -64,7 +68,9 @@ def transaction_created(request, transaction):
|
||||
template_name="tpv/order_created.html",
|
||||
context={
|
||||
"form": UpdateEmailForm({"contact_email": transaction.contact_email}),
|
||||
"action": reverse("tpv:order_created", kwargs={"transaction": transaction.hash}),
|
||||
"action": reverse(
|
||||
"tpv:order_created", kwargs={"transaction": transaction.hash}
|
||||
),
|
||||
"order": transaction,
|
||||
"signature_version": parameters.get("Ds_SignatureVersion"),
|
||||
"merchant_parameters": parameters.get("Ds_MerchantParameters"),
|
||||
|
||||
Reference in New Issue
Block a user