From ec28d67fca8f181a755134044b7b6a6eff465204 Mon Sep 17 00:00:00 2001 From: kilian Date: Wed, 3 Dec 2025 21:51:03 +0100 Subject: [PATCH] fixed the item ids --- backend/src/payments/payment_handler.py | 4 ++-- backend/src/payments/payment_router.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/payments/payment_handler.py b/backend/src/payments/payment_handler.py index b01a38f..fce755a 100644 --- a/backend/src/payments/payment_handler.py +++ b/backend/src/payments/payment_handler.py @@ -78,7 +78,7 @@ class OrderRequest(BaseModel): self.total_price = 0 self.total_credits = 0 for basket_item in self.basket: - item = self.supabase_client.get_item(basket_item.id, self.currency) + item = self.supabase_client.get_item(basket_item.item_id, self.currency) self.items.append(item) self.total_price += item.unit_price * basket_item.quantity # increment price self.total_credits += item.unit_credits * basket_item.quantity # increment credit balance @@ -100,7 +100,7 @@ class OrderRequest(BaseModel): for basket_item, item in zip(self.basket, self.items): item_list.append({ - 'id': item.id, + 'id': item.item_id, 'name': item.name, 'description': item.description, 'quantity': str(basket_item.quantity), diff --git a/backend/src/payments/payment_router.py b/backend/src/payments/payment_router.py index 8c2de92..8ae680c 100644 --- a/backend/src/payments/payment_router.py +++ b/backend/src/payments/payment_router.py @@ -1,9 +1,9 @@ import logging -from typing import Literal from fastapi import APIRouter, Query, Body from fastapi.responses import RedirectResponse -from ..payments import PaypalClient, OrderRequest + +from .payment_handler import PaypalClient, OrderRequest from ..supabase.supabase import SupabaseClient from ..cache import CreditCache, make_credit_cache_key