feat(wechat): use wx.tenpay.com payment page instead of third-party QR
This commit is contained in:
parent
c96da0af11
commit
a95c548f84
@ -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)
|
||||
qr_img_url = 'https://api.qrserver.com/v1/create-qr-code/?size=280x280&data=' + urllib.parse.quote(code_url, safe='')
|
||||
# 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')
|
||||
return {
|
||||
"widgettype":"NewWindow",
|
||||
"options":{
|
||||
"url": qr_img_url,
|
||||
"height": "340",
|
||||
"width":"340"
|
||||
"url": pay_url,
|
||||
"height": "100%",
|
||||
"width":"100%"
|
||||
}
|
||||
}
|
||||
except Exception as e:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user