d2736d1ef6
- AI routing rules now stored in system_configs DB table instead of hardcoded config - Multi-model support via name|model composite key for same-provider routing - UnifiedPayService with HMAC-SHA256 gateway integration (alipay/wechat) - Admin payment panel: list, stats, search, filter, refund - WeChat mini-program CI/CD via miniprogram-ci (v1.0.9) - Translation quota extended to LLM provider tier - SearchService with DB-driven provider config (bing/google_cse/searxng) - Footer cleanup across admin/workspace/uni-app - Private key excluded from git tracking
40 lines
1.0 KiB
Python
40 lines
1.0 KiB
Python
from abc import ABC, abstractmethod
|
|
from typing import Optional, Dict, Any
|
|
|
|
|
|
class PaymentGateway(ABC):
|
|
name: str = ""
|
|
|
|
@abstractmethod
|
|
async def create_order(self, order_no: str, amount: int, description: str,
|
|
**kwargs) -> Dict[str, Any]:
|
|
...
|
|
|
|
@abstractmethod
|
|
async def query_order(self, order_no: str) -> Dict[str, Any]:
|
|
...
|
|
|
|
@abstractmethod
|
|
async def refund(self, order_no: str, amount: int, reason: str = "") -> Dict[str, Any]:
|
|
...
|
|
|
|
@abstractmethod
|
|
async def query_refund(self, order_no: str) -> Dict[str, Any]:
|
|
...
|
|
|
|
@abstractmethod
|
|
def verify_callback(self, headers: dict, body: str) -> bool:
|
|
...
|
|
|
|
@abstractmethod
|
|
def parse_callback(self, body: str, headers: dict) -> Dict[str, Any]:
|
|
...
|
|
|
|
async def close_order(self, order_no: str) -> Dict[str, Any]:
|
|
raise NotImplementedError
|
|
|
|
def supports(self, pay_type: str) -> bool:
|
|
return pay_type in self.supported_types
|
|
|
|
supported_types: list = []
|