fix(pay): 支付校验参数错误
This commit is contained in:
@@ -60,7 +60,7 @@ async def create_order(
|
|||||||
if product is None:
|
if product is None:
|
||||||
raise HTTPException(status.HTTP_404_NOT_FOUND, detail='产品不存在')
|
raise HTTPException(status.HTTP_404_NOT_FOUND, detail='产品不存在')
|
||||||
|
|
||||||
if product.number != payload.total_fee:
|
if product.price != payload.total_fee:
|
||||||
raise HTTPException(status.HTTP_400_BAD_REQUEST, detail='产品费用不合法')
|
raise HTTPException(status.HTTP_400_BAD_REQUEST, detail='产品费用不合法')
|
||||||
|
|
||||||
client_ip = (
|
client_ip = (
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ class Product(BaseModel):
|
|||||||
category: ProductCategory
|
category: ProductCategory
|
||||||
price: int
|
price: int
|
||||||
number: int
|
number: int
|
||||||
description: str | None
|
description: str | None = None
|
||||||
|
|
||||||
|
|
||||||
class ProductOut(Product):
|
class ProductOut(Product):
|
||||||
gift_product: Product | None
|
gift_product: Product | None = None
|
||||||
|
|||||||
Reference in New Issue
Block a user