This commit is contained in:
yumoqing 2025-12-16 21:14:47 +08:00
parent 4bda7bc81a
commit b2f61e6e3b

View File

@ -11,13 +11,13 @@ from ..core import Gateway
def guess_charset(msg): def guess_charset(msg):
charset = msg.get_charset() charset = msg.get_charset()
if charset is None: if charset is None:
content_type = msg.get('Content-Type', '').lower() content_type = msg.get('Content-Type', '').lower()
pos = content_type.find('charset=') pos = content_type.find('charset=')
if pos >= 0: if pos >= 0:
charset = content_type[pos + 8:].strip() charset = content_type[pos + 8:].strip()
return charset return charset
class EmailClient: class EmailClient:
def __init__(self, pop3_server, emailaddress, password): def __init__(self, pop3_server, emailaddress, password):
@ -70,15 +70,15 @@ class TransferPay(Gateway):
self.running = False self.running = False
async def create_payment(self, payload: Dict[str, Any]) -> str: async def create_payment(self, payload: Dict[str, Any]) -> str:
""" """
返回一个可以在 H5 里直接重定向的支付宝支付 URL 返回一个可以在 H5 里直接重定向的支付宝支付 URL
""" """
ns = { ns = {
"id": payload["out_trade_no"], "id": payload["out_trade_no"],
"customerid": payload['customerid'], "customerid": payload['customerid'],
"amount": payload["amount"], "amount": payload["amount"],
"tcode": self.gen_mailcode(), "tcode": self.gen_mailcode(),
"curdate": curDateString(), "curdate": curDateString(),
"curtime": timestampstr(), "curtime": timestampstr(),
"status": '0' "status": '0'
} }