fixed the item ids
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Failing after 3m31s
Build and deploy the backend to staging / Deploy to staging (pull_request) Has been skipped
Run linting on the backend code / Build (pull_request) Failing after 2m24s
Run testing on the backend code / Build (pull_request) Failing after 2m28s
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Failing after 3m31s
Build and deploy the backend to staging / Deploy to staging (pull_request) Has been skipped
Run linting on the backend code / Build (pull_request) Failing after 2m24s
Run testing on the backend code / Build (pull_request) Failing after 2m28s
This commit is contained in:
@@ -78,7 +78,7 @@ class OrderRequest(BaseModel):
|
|||||||
self.total_price = 0
|
self.total_price = 0
|
||||||
self.total_credits = 0
|
self.total_credits = 0
|
||||||
for basket_item in self.basket:
|
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.items.append(item)
|
||||||
self.total_price += item.unit_price * basket_item.quantity # increment price
|
self.total_price += item.unit_price * basket_item.quantity # increment price
|
||||||
self.total_credits += item.unit_credits * basket_item.quantity # increment credit balance
|
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):
|
for basket_item, item in zip(self.basket, self.items):
|
||||||
item_list.append({
|
item_list.append({
|
||||||
'id': item.id,
|
'id': item.item_id,
|
||||||
'name': item.name,
|
'name': item.name,
|
||||||
'description': item.description,
|
'description': item.description,
|
||||||
'quantity': str(basket_item.quantity),
|
'quantity': str(basket_item.quantity),
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import logging
|
import logging
|
||||||
from typing import Literal
|
|
||||||
|
|
||||||
from fastapi import APIRouter, Query, Body
|
from fastapi import APIRouter, Query, Body
|
||||||
from fastapi.responses import RedirectResponse
|
from fastapi.responses import RedirectResponse
|
||||||
from ..payments import PaypalClient, OrderRequest
|
|
||||||
|
from .payment_handler import PaypalClient, OrderRequest
|
||||||
from ..supabase.supabase import SupabaseClient
|
from ..supabase.supabase import SupabaseClient
|
||||||
from ..cache import CreditCache, make_credit_cache_key
|
from ..cache import CreditCache, make_credit_cache_key
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user