- 在应用中注册支付蓝图(payment_bp)以支持支付接口 - 配置支付宝相关秘钥、回调地址及环境选项 - 新增订单模型(Order),支持订单数据存储与管理 - 管理后台接口添加订单列表查询功能,支持超级管理员访问 - 购买页面与表单修改,支持不同套餐的购买提交 - 支付成功页面提示,显示订单编号及积分到账信息 - 移除买积分按钮禁用逻辑,开放购买功能
31 lines
1.0 KiB
Python
31 lines
1.0 KiB
Python
from typing import Union, Callable, Optional
|
|
from typing_extensions import Protocol
|
|
|
|
from Cryptodome.PublicKey.RSA import RsaKey
|
|
|
|
|
|
class Hash(Protocol):
|
|
def digest(self) -> bytes: ...
|
|
def update(self, bytes) -> None: ...
|
|
|
|
|
|
class HashModule(Protocol):
|
|
@staticmethod
|
|
def new(data: Optional[bytes]) -> Hash: ...
|
|
|
|
|
|
MaskFunction = Callable[[bytes, int, Union[Hash, HashModule]], bytes]
|
|
RndFunction = Callable[[int], bytes]
|
|
|
|
class PSS_SigScheme:
|
|
def __init__(self, key: RsaKey, mgfunc: MaskFunction, saltLen: int, randfunc: RndFunction) -> None: ...
|
|
def can_sign(self) -> bool: ...
|
|
def sign(self, msg_hash: Hash) -> bytes: ...
|
|
def verify(self, msg_hash: Hash, signature: bytes) -> None: ...
|
|
|
|
|
|
MGF1 : MaskFunction
|
|
def _EMSA_PSS_ENCODE(mhash: Hash, emBits: int, randFunc: RndFunction, mgf:MaskFunction, sLen: int) -> str: ...
|
|
def _EMSA_PSS_VERIFY(mhash: Hash, em: str, emBits: int, mgf: MaskFunction, sLen: int) -> None: ...
|
|
def new(rsa_key: RsaKey, **kwargs: Union[MaskFunction, RndFunction, int]) -> PSS_SigScheme: ...
|