ASP微信支付v4.0版本,最新的asp微信公众号支付源码

ASP微信支付v4.0版本,最新的asp微信公众号支付源码,不需要安装证书,只要一个文件用到.net环境就可以用

<!--#include file="wxpay.Api.asp" --> <!--#include file="WxApi.asp" -->

<%
SET Wx = New WxAPI
If Session("openid")="" Then
Code = Trim(Request.QueryString("code"))
If Code = "" Then
wx.get_redirect_uri = "http://"&request.ServerVariables("HTTP_HOST")&request.ServerVariables("URL")&"?"&request.QueryString
Response.Redirect(Wx.GetAuthorization_Code)
Else
Call Wx.GetAccess_Token(Code)
End If
End If
Set Wx=Nothing
set wxpay = New WxPayApi
Dim body,out_trade_no,attach,total_fee,Arr,sUrl
body = "微信支付测试(WxPay)"
out_trade_no = wxpay.GetDateTime
attach = "呵呵目于网络"'商户自定义数据包.
total_fee = "0.01"

wxpay.setParameter "openid",Session("openid")'"oiQ6Bs4Vo0OWAAiHxVSbry7z6yzE"
wxpay.setParameter "body",body
wxpay.setParameter "out_trade_no",out_trade_no
wxpay.setParameter "attach",attach
wxpay.setParameter "total_fee",(total_fee)*100
wxpay.setParameter "trade_type","JSAPI"
wxpay.setParameter "spbill_create_ip","127.0.0.1"
wxpay.setParameter "notify_url",NOTIFY_URL
wxpay.setParameter "device_info","WEB"

jsApiParameters = wxpay.get_Parameters
EditAddressParameters = wxpay.GetEditAddressParameters
'xml= wxpay.Get_Return_Xml()
'wxpay.Die jsApiParameters

set wxpay = Nothing

%>

<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>微信安全支付</title> <script type="text/javascript"> //调用微信JS api 支付 function jsApiCall() { WeixinJSBridge.invoke( 'getBrandWCPayRequest', <%= jsApiParameters %>, function(res){ WeixinJSBridge.log(res.err\_msg); //alert(res.err\_code+res.err\_desc+res.err\_msg); if(res.err\_msg.indexOf("ok")>0){ alert("付款成功!"); window.location.href='./'; }else if(res.err\_msg.indexOf("cancel")>0){ alert("取消付款!"); window.location.href='./'; }else{ alert(res.err\_code+res.err\_desc+res.err\_msg); } } ); }

function callpay()
{
if (typeof WeixinJSBridge == "undefined"){
if( document.addEventListener ){
document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
}else if (document.attachEvent){
document.attachEvent('WeixinJSBridgeReady', jsApiCall);
document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
}
}else{
jsApiCall();
}
}
</script>

<script type="text/javascript"> //获取共享地址 function editAddress() { WeixinJSBridge.invoke( 'editAddress', <%= EditAddressParameters %>, function(res){ var value1 = res.proviceFirstStageName; var value2 = res.addressCitySecondStageName; var value3 = res.addressCountiesThirdStageName; var value4 = res.addressDetailInfo; var tel = res.telNumber; //alert(value1 + value2 + value3 + value4 + ":" + tel); var addrval = value1 + value2 + value3 + value4 + ":" + tel; var addr = document.querySelector('#addr'); if(addrval !='NaN:undefined'){ addr.innerHTML = "收货地址:<br/>" + value1 + value2 + value3 + value4 + ":" + tel; } } ); } </script> </head> <body> <br/> <font color="#9ACD32"><b>订单号:<span style="color:#f00;font-size:20px"><%= out\_trade\_no %></span></b></font><br/> <font color="#9ACD32"><b>商品名称:<span style="color:#f00;font-size:20px"><%= body %></span></b></font><br/> <font color="#9ACD32"><b>付款金额:<span style="color:#f00;font-size:50px"><%= total\_fee %></span>元</b></font><br/> <div align="center"> <button style="width:45%; height:50px; border-radius: 15px;background-color:#FE6714; border:0px #FE6714 solid; cursor: pointer; color:white; font-size:16px;" type="button" onClick="editAddress()" >使用微信地址</button> <button style="width:45%; height:50px; border-radius: 15px;background-color:#FE6714; border:0px #FE6714 solid; cursor: pointer; color:white; font-size:16px;" type="button" onClick="callpay()" >立即支付</button> </div> <div id="addr" style="color:#9ACD32;font-size:20px; margin-top:10px"></div> </body>

=============================================

互相学习电话微信:18611436777(加微信注明事由)

点赞
收藏

评论区

加载中...

相关推荐

MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

MySQL部分从库上面因为大量的临时表tmp_table造成慢查询

背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_

皕杰报表之UUID

​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

thinkcmf+jsapi 实现微信支付

首先从小程序端接收订单号、金额等参数,然后后台进行统一下单,把微信支付的订单号返回,在把订单号发送给前台,前台拉起支付,返回参数后更改支付状态。。。回调publicfunctionnotify(){$wechatDb::name('wechat')where('status',1)find();