103 lines
3.7 KiB
HTML
103 lines
3.7 KiB
HTML
{% extends 'tpv/base.html' %}
|
|
|
|
{% block body %}
|
|
|
|
<div class="h-screen bg-gray-100 pt-10">
|
|
|
|
<header class="mb-10 text-center">
|
|
<h1 class="text-2xl font-bold p-4">Resumen de pedido</h1>
|
|
|
|
{% if order.status == 'PAI' %}
|
|
<span
|
|
class="bg-green-100 text-green-800 text-large font-large me-2 px-2.5 py-0.5 rounded-full dark:bg-green-400 dark:text-green-900">Pagado</span>
|
|
{% elif order.status == 'PEN' %}
|
|
<span
|
|
class="bg-yellow-100 text-yellow-800 text-large font-large me-2 px-2.5 py-0.5 rounded-full dark:bg-yellow-400 dark:text-yellow-900">Pendiente de pago</span>
|
|
{% else %}
|
|
<span
|
|
class="bg-red-100 text-red-800 text-large font-large me-2 px-2.5 py-0.5 rounded-full dark:bg-red-400 dark:text-red-900">Error de pago</span>
|
|
{% endif %}
|
|
|
|
</header>
|
|
|
|
<div class="mx-auto max-w-5xl justify-center px-6 md:flex md:space-x-6 xl:px-0">
|
|
<div class="rounded-lg md:w-2/3">
|
|
|
|
{% for item in order.metadata.items %}
|
|
{% include 'tpv/cart_item.html' %}
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
<div class=" md:w-1/3">
|
|
{% if order.status == 'PEN' %}
|
|
<!-- Formulario de email -->
|
|
|
|
<section class="mt-6 rounded-lg border bg-white shadow-md md:mt-0 mb-4">
|
|
<div class="flex flex-col items-center justify-center mx-auto">
|
|
<div
|
|
class="w-full rounded-lg md:mt-0 sm:max-w-md xl:p-0">
|
|
<div class="p-6 space-y-4 md:space-y-6 sm:p-8">
|
|
<form class="space-y-4 md:space-y-6" action="{{ action }}" method="POST">
|
|
{% csrf_token %}
|
|
|
|
{% for field in form %}
|
|
<label class="font-bold" for="{{ field.auto_id }}">{{ field.label }}</label>
|
|
{{ field }}
|
|
|
|
{% endfor %}
|
|
|
|
<button type="submit" class="mt-6 w-full rounded-md bg-blue-500 py-1.5 font-medium text-blue-50 hover:bg-blue-600 cursor-pointer">
|
|
Enviar
|
|
</button>
|
|
</form>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
{% endif %}
|
|
|
|
<section class="mt-6 rounded-lg border bg-white p-6 shadow-md md:mt-0">
|
|
<div class="mb-2 flex justify-between">
|
|
<p class="text-gray-700">Subtotal</p>
|
|
<p class="text-gray-700">{{ order.amount }} €</p>
|
|
</div>
|
|
|
|
<hr class="my-4"/>
|
|
<div class="flex justify-between">
|
|
<p class="text-lg font-bold">Total</p>
|
|
<div class="">
|
|
<p class="mb-1 text-lg font-bold">{{ order.amount }} €</p>
|
|
<p class="text-sm text-gray-700">Impuestos incluidos</p>
|
|
</div>
|
|
</div>
|
|
|
|
{% if order.status == 'PEN' %}
|
|
<form name="from" action="{{ redsys_target_url }}" method="POST">
|
|
{% csrf_token %}
|
|
<input type="hidden" name="Ds_SignatureVersion" value="{{ signature_version }}"/>
|
|
<input type="hidden" name="Ds_MerchantParameters" value="{{ merchant_parameters }}"/>
|
|
<input type="hidden" name="Ds_Signature" value="{{ signature }}"/>
|
|
|
|
{% if order.contact_email != '' %}
|
|
<input
|
|
class="mt-6 w-full rounded-md bg-blue-500 py-1.5 font-medium text-blue-50 hover:bg-blue-600 cursor-pointer"
|
|
type="submit" value="Ir a pagar">
|
|
{% else %}
|
|
<input
|
|
class="mt-6 w-full rounded-md bg-blue-500 py-1.5 font-medium text-blue-50 hover:bg-blue-600 cursor-pointer"
|
|
type="submit" value="Ir a pagar" disabled>
|
|
{% endif %}
|
|
</form>
|
|
{% endif %}
|
|
</section>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
{% endblock %}
|