46 lines
797 B
Plaintext
46 lines
797 B
Plaintext
params_kw.amount = float(params_kw.amount)
|
|
debug(f'recharge.dspy: {params_kw=}')
|
|
try:
|
|
url = await create_payment(request, params_kw)
|
|
if params_kw.provider == 'wechat':
|
|
return {
|
|
"widgettype": "VBox",
|
|
"options": {
|
|
"css": "card",
|
|
"padding": "20px",
|
|
"width": "320"
|
|
},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "Image",
|
|
"options": {
|
|
"url": url,
|
|
"width": "280"
|
|
}
|
|
},
|
|
{
|
|
"widgettype": "Text",
|
|
"options": {
|
|
"text": "请使用微信扫描二维码完成支付",
|
|
"halign": "center"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
return {
|
|
"widgettype":"NewWindow",
|
|
"options":{
|
|
"url": url,
|
|
"height": "100%",
|
|
"width":"100%"
|
|
}
|
|
}
|
|
except Exception as e:
|
|
return {
|
|
"widgettype":"Text",
|
|
"options":{
|
|
"width":"100%",
|
|
"text":f"{e}"
|
|
}
|
|
}
|