fix(payment): rely on Huihui callback for status
This commit is contained in:
@@ -85,42 +85,6 @@ def update_order_status(order_no: str, body: dict = Body(...)):
|
||||
db.close()
|
||||
|
||||
|
||||
@router.post("/orders/{order_no}/refund")
|
||||
def request_refund(order_no: str, body: dict = Body(...)):
|
||||
try:
|
||||
data = finance_service.request_refund(
|
||||
order_no,
|
||||
reason=str(body.get("reason") or "").strip(),
|
||||
operator=str(body.get("operator") or "后台管理员").strip(),
|
||||
)
|
||||
return ApiResponse(data=data, message="退款申请已提交")
|
||||
except FinanceServiceError as exc:
|
||||
_raise(exc)
|
||||
|
||||
|
||||
@router.get("/refunds")
|
||||
def refunds(
|
||||
page: int = Query(1, ge=1),
|
||||
page_size: int = Query(20, ge=1, le=100),
|
||||
status: str = Query(""),
|
||||
):
|
||||
db = _session()
|
||||
try:
|
||||
total, items = finance_service.list_refunds(db, page=page, page_size=page_size, status=status)
|
||||
return ApiResponse(data={"total": total, "page": page, "page_size": page_size, "items": items})
|
||||
finally:
|
||||
db.close()
|
||||
|
||||
|
||||
@router.post("/refunds/{refund_no}/confirm")
|
||||
def confirm_refund(refund_no: str, body: dict = Body(...)):
|
||||
try:
|
||||
data = finance_service.confirm_refund(refund_no, body)
|
||||
return ApiResponse(data=data, message="退款结果已登记")
|
||||
except FinanceServiceError as exc:
|
||||
_raise(exc)
|
||||
|
||||
|
||||
@router.get("/invoices")
|
||||
def invoices(
|
||||
page: int = Query(1, ge=1),
|
||||
|
||||
Reference in New Issue
Block a user