I'm running a payment gateway in Django and I'm trying to split the procedure into two views, one makes the call and gets the answer and the second processes the response.
Right now my code is something like this:
def comprar(self):
...
result = realizar_compra(pedido,perfil,tarjeta_data,request)
print(result)
return redirect('confirmacion-compra',args={'respuesta':result,'perfil':perfil,'producto':producto})
and there is my answer view:
@login_required
def confirmacion_pago(request):
...
return render(request, 'intranet/confirmacion_comprar.html',{'mensaje':'Pago realizado correctamente.','perfil':perfil,'producto':producto})
I want to send the result variable to the second function so that it checks the data and maps the response page so that there is no way to go back to the previous screen or by default reload the page and make the payment again.