'公众号内支付获取H5调起JS API参数
Dim e As RequestEventArgs = args(0)
Dim productid As String = e.PlainText
Dim wb As New WeUI
Dim dr As DataRow = DataTables("JSAPI").Find("product_id='" & productid & "'") '查询是否存在此业务订单
If dr IsNot Nothing Then
If Functions.Execute("api_QueryOrder",dr("out_trade_no"),0) = True Then
e.WriteString( "订单查询正常...")
甜老师,下面这个跳转不过去,是不是因为js里写着接收结果
wb.InsertHTML("<meta http-equiv='Refresh' c>") '那么直接跳转到登录页面
e.WriteString(wb.Build) '生成网页
Else
e.WriteString( "订单查询异常...")
End If
Else
e.WriteString("错误:不存在此业务订单号【" & productid & "】,无法发起支付!")
End If
js:
//支付接口调用
function jsApiCall() {
var result = sendAjaxText(document.getElementById("订单编号").value, "getWxJsApiParam.htm", "", false); //通过订单编号从服务器获取JS接口需要的参数
if (result == ""){
showDialog('dlg1', '错误', "业务后台出错!");
return;
}
if (result.substring(0, 2) == "错误") {
showDialog('dlg1', '错误', result);
return;
}
var wxJsApiParam = JSON.parse(result);
WeixinJSBridge.invoke(
'getBrandWCPayRequest',
wxJsApiParam, //josn串
function (res) {
WeixinJSBridge.log(res.err_msg);
js在这里查询订单是否有效。
var result2 = sendAjaxText(document.getElementById("订单编号").value, "QueryOrder.htm", "", false); //通过订单编号从服务器获
if (result2 == "") {
showDialog('dlg1', '错误', "业务后台出错!");
return;
}
}
);
}