From a0bd6fb24f2a929d36f386b892c08906cd9bc0f3 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 16 Jul 2026 11:57:36 +0800 Subject: [PATCH] revert: QR code is required for Native payment, weixin:// is not a web URL Native payment code_url uses weixin:// protocol which is a WeChat deep link, not openable in browsers. QR code is the standard approach - user scans with WeChat and completes payment within the app. --- wwwroot/recharge.dspy | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wwwroot/recharge.dspy b/wwwroot/recharge.dspy index de04084..55dd515 100644 --- a/wwwroot/recharge.dspy +++ b/wwwroot/recharge.dspy @@ -1,15 +1,15 @@ +import urllib.parse params_kw.amount = float(params_kw.amount) debug(f'recharge.dspy: {params_kw=}') try: code_url = await create_payment(request, params_kw) - # weixin://wxpay/bizpayurl?pr=xxx → https://wx.tenpay.com/f2f?pr=xxx - pay_url = code_url.replace('weixin://wxpay/bizpayurl', 'https://wx.tenpay.com/f2f') + qr_url = 'https://api.qrserver.com/v1/create-qr-code/?size=280x280&data=' + urllib.parse.quote(code_url, safe='') return { "widgettype":"NewWindow", "options":{ - "url": pay_url, - "height": "100%", - "width":"100%" + "url": qr_url, + "height": "340", + "width":"340" } } except Exception as e: