update
This commit is contained in:
parent
347e171849
commit
f4d9bc7b73
@ -105,12 +105,15 @@ async def create_order(request: CreateOrderRequest,
|
||||
|
||||
class NotifyRequest(BaseModel):
|
||||
merchantOrderNo: str
|
||||
status: str
|
||||
|
||||
@router.post("/notify")
|
||||
async def notify(notify: NotifyRequest, session: Session = Depends(get_db)):
|
||||
try:
|
||||
# 更新订单状态
|
||||
subscription_order_manager = SubscriptionOrderManager(session)
|
||||
## 订单完成
|
||||
if notify.status == "1":
|
||||
# 更新订单状态
|
||||
subscription_order_manager.update_order_status(notify.merchantOrderNo, 2)
|
||||
|
||||
order = subscription_order_manager.get_order_by_id(notify.merchantOrderNo)
|
||||
@ -137,6 +140,8 @@ async def notify(notify: NotifyRequest, session: Session = Depends(get_db)):
|
||||
time_type,
|
||||
notify.merchantOrderNo,
|
||||
expire_time)
|
||||
else:
|
||||
subscription_order_manager.update_order_status(notify.merchantOrderNo, 4)
|
||||
|
||||
return "ok"
|
||||
except Exception as e:
|
||||
|
||||
@ -29,7 +29,7 @@ services:
|
||||
cryptoai-api:
|
||||
build: .
|
||||
container_name: cryptoai-api
|
||||
image: cryptoai-api:0.2.8
|
||||
image: cryptoai-api:0.2.9
|
||||
restart: always
|
||||
ports:
|
||||
- "8000:8000"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user