1.调用下单接口返回对应的表单的html,js 代码
"<form id='alipay_submit' name='alipay_submit' action='https://openapi.alipay.com/gateway.do?charset=utf-8' method='POST'><input type='hidden' name='app_id' value='2021003185676030'/><input type='hidden' name='format' value='JSON'/><input type='hidden' name='charset' value='utf-8'/><input type='hidden' name='sign_type' value='RSA2'/><input type='hidden' name='version' value='1.0'/><input type='hidden' name='return_url' value='https://zy.wan-sun.com/addons/epay/index/returnx/paytype/alipay/out_trade_no/2023062010154575'/><input type='hidden' name='notify_url' value='https://zy.wan-sun.com/addons/epay/index/notifyx/paytype/alipay'/><input type='hidden' name='timestamp' value='2023-06-20 09:54:54'/><input type='hidden' name='biz_content' value='{"out_trade_no":"2023062010154575","total_amount":"0.01","subject":"VIP\u8d2d\u4e70\u5957\u9910\u8ba2\u5355","product_code":"QUICK_WAP_WAY"}'/><input type='hidden' name='method' value='alipay.trade.wap.pay'/><input type='hidden' name='sign' value='ETeMnNkyVd097f+Qp/06/Aww8HI7vqKgugt27OlpA//OFwvnC16b8X0Clll44GcAVgrQyJm3EkP4Q7qCWJEV9O99dWYgi2HnzvoYoNnP6Lfi7aOMsB9hZVCRY5lPgTsf7zh6AM2Aud7z1wJxjlO38orVhuYqcHxDHsLFtfj7deC+b732wY/dDSWh1O/yg31UUfN/tJKO63Y6Md4JV0VnU9cqiZGKQTLgV+SIA0IPNt+eWdiNgaNzOWrDWlWdDYIfBf9szdOfTCW0ZZicUaQAXfjUwvlLbloKLJ4edbePXGNSIPMbgtPXx/rT9gwlihLYbphjX2pF06oMusaCJcPzDw=='/><input type='submit' value='ok' style='display:none;'></form><script>document.forms['alipay_submit'].submit();</script>
2.将代码放在对应的一个路由的html文件,里面,将当前请求的这个页面的链接生成一个支付的二维码,用支付宝扫描这个二维码就可以跳转到对应的支付宝页面去付款,前提是支付的方式选项选择wap类型