支付宝手机网站支付,微信扫描二维码支付

时间:2024-03-21 06:57:24

支付宝手机网站支付

支付宝文档
在这里插入图片描述
响应示例

<form name="punchout_form" method="post" action="https://openapi.alipay.com/gateway.do?charset=UTF-8&method=alipay.trade.wap.pay&format=json&sign=ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE&version=1.0&app_id=2017060101317939&sign_type=RSA2&timestamp=2014-07-24+03%3A07%3A50">
<input type="hidden" name="biz_content" value="{&quot;time_expire&quot;:&quot;2016-12-31 10:05:00&quot;,&quot;extend_params&quot;:&quot;&quot;,&quot;query_options&quot;:&quot;[\&quot;hyb_amount\&quot;,\&quot;enterprise_pay_info\&quot;]&quot;,&quot;quit_url&quot;:&quot;http://www.taobao.com/product/113714.html&quot;,&quot;settle_info&quot;:&quot;&quot;,&quot;subject&quot;:&quot;大乐透&quot;,&quot;product_code&quot;:&quot;QUICK_WAP_WAY&quot;,&quot;body&quot;:&quot;Iphone6 16G&quot;,&quot;passback_params&quot;:&quot;merchantBizType%3d3C%26merchantBizNo%3d2016010101111&quot;,&quot;specified_channel&quot;:&quot;pcredit&quot;,&quot;goods_detail&quot;:&quot;&quot;,&quot;merchant_order_no&quot;:&quot;20161008001&quot;,&quot;enable_pay_channels&quot;:&quot;pcredit,moneyFund,debitCardExpress&quot;,&quot;out_trade_no&quot;:&quot;70501111111S001111119&quot;,&quot;ext_user_info&quot;:&quot;&quot;,&quot;total_amount&quot;:&quot;9.00&quot;,&quot;business_params&quot;:&quot;{\&quot;mc_create_trade_ip\&quot;:\&quot;127.0.0.1\&quot;}&quot;,&quot;timeout_express&quot;:&quot;90m&quot;,&quot;disable_pay_channels&quot;:&quot;pcredit,moneyFund,debitCardExpress&quot;,&quot;auth_token&quot;:&quot;appopenBb64d181d0146481ab6a762c00714cC27&quot;}">
<input type="submit" value="立即支付" style="display:none" >
</form>
<script>document.forms[0].submit();</script>

vue 代码

 const div = document.createElement('div');
 div.innerHTML = data.qrcodeRs;
 document.body.appendChild(div);
 document.forms[0].submit();

微信生成二维码支付

后端生成支付二维码,轮询查询是否支付成功

let timerId: NodeJS.Timeout | null = null;
function startTask() {
  timerId = setInterval(() => {
    setTimeout(() => {
      console.log('11 start');
    }, 0);
  }, 1000 * 3);
}
function clearTask() {
  if (timerId) {
    clearInterval(timerId);
    timerId = null;
  }
}
onUnmounted(() => {
  clearTask();
});