feat: Add transaction code generation for orders and update receipt templates

This commit is contained in:
2026-04-09 08:51:12 +02:00
parent a570c542c2
commit a3eae63587
7 changed files with 76 additions and 10 deletions
+8 -2
View File
@@ -57,12 +57,18 @@ def enviar_correo_recuperacion(email: str):
# Purchased items should be a list of dictionary, the dictionary must follow this tags: amount, product name, price (each)
@shared_task
def process_purchase(user_id: int, purchased_items: list, payment_method: str):
def process_purchase(user_id: int, purchased_items: list, payment_method: str, transaction_code: str):
user = User.objects.get(id=user_id)
total = 0
for i in purchased_items:
total += i["price"]*i["amount"]
pdf_data = pdf.generar_recibo(user.get_full_name(), total, purchased_items, payment_method)
pdf_data = pdf.generar_recibo(
user.get_full_name(),
total,
purchased_items,
payment_method,
transaction_code,
)
email = EmailMessage(
subject="Tu recibo de compra",