微信、支付宝支付动态库PayApiFun.dll说明
PayApiFun.dll这个动态库中包含了:微信付款码支付、生成微信支付二维码扫码支付、按商户单号查询微信支付状态、关闭未支付的微信订单、支付宝付款码支付、生成支付宝支付二维码扫码支付、按商户单号查询支付状态、撤销支付宝支付订单等函数,只需一条语句就可以完成微信、支付宝扫码支付功能,一条语句可以返回支付订单的支付结果。
函数名一:WeiXinPayCodeEx2
功能 | 微信付款码支付,输入微信公众号、商户号、账号是否加密保护、API密钥、密钥是否加密保护、唯一的订单编号、支付金额、微信付款码就可以实现微信支付。 | |
函数原型 | function WeiXinPayCodeEx2(inappid:Pchar;inmchid:Pchar;registered:byte;inIdkey:Pchar;KeyLOck:Integer;inAuthCode:Pchar ;inNum:Pchar; inTotalFee:Pchar; inbody:Pchar;var ReturnXmlInf:Pchar):integer;stdcall; | |
输入 | 1. inappid | 微信公众号,Pchar。 |
2. inmchid | 微信商户号,Pchar。 | |
3. registered | 公众号、商户号是否加密保护, Integer 1为已加密,0为未加密。 | |
4. inIdkey | 微信API密钥,Pchar。 | |
5. KeyLOck | API密钥是否加密保护, Integer 1为已加密,0为未加密。 | |
6. inAuthCode | 18位的微信付款码,Pchar。 | |
7. inNum | 微信公众号内的唯一订单号,Pchar。 | |
8. inTotalFee | 以分为单位的支付金额,Pchar。 | |
9. inbody | 商品名称。 | |
10. ReturnXmlInf | 函数调用后,API接口返回的状态信息,Pchar。 | |
返回 | 返回integer数值,0表示支付成功,1表示正在支付中,其他表示支付失败,并将支付结果的文字描述放在* ReturnXmlInf 指向缓冲。 |
函数名二:WeiXinPayQRCodeEx2
功能 | 生成微信支付二维码扫码支付,输入微信公众号、商户号、账号是否加密保护、API密钥、密钥是否加密保护、唯一的订单编号、支付金额 就可以生成支付二维码。 | |
函数原型 | function WeiXinPayQRCodeEx2(inappid:Pchar;inmchid:Pchar; registered:byte;inIdkey:Pchar;KeyLOck:Integer;inNum:Pchar; inTotalFee:Pchar; inbody:Pchar;var ReturnXmlInf:Pchar):integer;stdcall; | |
输入 | 1. inappid | 微信公众号,Pchar。 |
2. inmchid | 微信商户号,Pchar。 | |
3. registered | 公众号、商户号是否加密保护, Integer 1为已加密,0为未加密。 | |
4. inIdkey | 微信API密钥,Pchar。 | |
5. KeyLOck | API密钥是否加密保护, Integer 1为已加密,0为未加密。 | |
6. inNum | 微信公众号内的唯一订单号,Pchar。 | |
7. inTotalFee | 以分为单位的支付金额,Pchar。 | |
8. inbody | 商品名称。 | |
9. ReturnXmlInf | 函数调用后,API接口返回的状态信息,Pchar。 | |
返回 | 返回integer数值,0表示申请支付网址成功并已生成二维码图片文件,并将支付网址放在* ReturnXmlInf 指向缓冲。 |
函数名三:WeiXinQueryEx2
功能 | 查询微信支付订单支付状态。输入微信公众号、商户号、账号是否加密保护、API密钥、密钥是否加密保护、订单编号就可以查询订单的支付结果。 | |
函数原型 | function WeiXinQueryEx2(inappid:Pchar;inmchid:Pchar; registered:byte;inIdkey:Pchar;KeyLOck:Integer;inNum:Pchar;var ReturnXmlInf:Pchar):integer;stdcall; | |
输入 | 1. inappid | 微信公众号,Pchar。 |
2. inmchid | 微信商户号,Pchar。 | |
3. registered | 公众号、商户号是否加密保护, Integer 1为已加密,0为未加密。 | |
4. inIdkey | 微信API密钥,Pchar。 | |
5. KeyLOck | API密钥是否加密保护, Integer 1为已加密,0为未加密。 | |
6. inNum | 微信公众号内的订单号,Pchar。 | |
7. ReturnXmlInf | 函数调用后,API接口返回的状态信息,Pchar。 | |
返回 | 返回integer数值,0表示支付成功,其他表示支付失败,并将支付结果的文字描述放在* ReturnXmlInf 指向缓冲。 |
函数名四:WeiXinCloseOrderEx2
功能 | 关闭已生成的微信二维码支付订单。输入微信公众号、商户号、账号是否加密保护、API密钥、密钥是否加密保护、订单编号就可以查询订单的支付结果。 | |
函数原型 | function WeiXinCloseOrderEx2(inappid:Pchar;inmchid:Pchar; registered:byte;inIdkey:Pchar;KeyLOck:byte;inNum:Pchar;var ReturnXmlInf:Pchar):integer;stdcall; | |
输入 | 1. inappid | 微信公众号,Pchar。 |
2. inmchid | 微信商户号,Pchar。 | |
3. registered | 公众号、商户号是否加密保护, Integer 1为已加密,0为未加密。 | |
4. inIdkey | 微信API密钥,Pchar。 | |
5. KeyLOck | API密钥是否加密保护, Integer 1为已加密,0为未加密。 | |
6. inNum | 微信商户号内的订单号,Pchar。 | |
7. ReturnXmlInf | 函数调用后,API接口返回的状态信息,Pchar。 | |
返回 | 返回integer数值,0表示关闭成功,其他表示关闭失败,并将微信支付服务器返回的文字描述放在* ReturnXmlInf 指向缓冲。 |
函数名五:ZhiFuBaoPayCodeEx2 注意事项:支付宝签名密钥文件rsa_private_key.pem必须放在相同目录才能正确签名
功能 | 支付宝付款码支付,输入支付宝合作者APPID、APPID是否加密保护、唯一的订单编号、支付金额、支付宝付款码就可以实现支付宝支付。 | |
函数原型 | function ZhiFuBaoPayCodeEx2(inappid:Pchar; registered:byte;inAuthCode:Pchar ;inNum:Pchar; inTotalFee:Pchar; inbody:Pchar;var ReturnXmlInf:Pchar):integer;stdcall; | |
输入 | 1. inappid | 支付宝合作者APPID,Pchar。 |
2. registered | APPID是否加密保护, Integer 1为已加密,0为未加密。 | |
3. inAuthCode | 支付宝付款码,Pchar。 | |
4. inNum | 商户唯一订单号,Pchar。 | |
5. inTotalFee | 以元为单位的支付金额,Pchar。 | |
6. inbody | 商品名称。 | |
7. ReturnXmlInf | 函数调用后,API接口返回的状态信息,Pchar。 | |
返回 | 返回integer数值,0表示订单关闭成功,其他表示关闭失败,并将服务器返回的文字描述放在* ReturnXmlInf 指向缓冲。 |
函数名六:ZhiFuBaoPayQRCodeEx2 注意事项:支付宝签名密钥文件rsa_private_key.pem必须放在相同目录才能正确签名
功能 | 生成支付宝支付二维码扫码支付,输入支付宝合作者APPID、APPID是否加密保护、唯一的订单编号、支付金额、支付宝付款码就可以实现支付宝支付。 | |
函数原型 | function ZhiFuBaoPayQRCodeEx2(inappid:Pchar; registered:byte;inNum:Pchar;inTotalFee:Pchar; inbody:Pchar;var ReturnXmlInf:Pchar):integer;stdcall; | |
输入 |
| 支付宝合作者APPID,Pchar。 |
| APPID是否加密保护, Integer 1为已加密,0为未加密。 | |
3. inNum | 商户唯一订单号,Pchar。 | |
4. inTotalFee | 以元为单位的支付金额,Pchar。 | |
5. inbody | 商品名称。 | |
6. ReturnXmlInf | 函数调用后,API接口返回的状态信息,Pchar。 | |
返回 | 返回integer数值,0表示申请二维码成功,二维码图片保存在当前目录下,1表示正在支付中,其他表示支付失败,并将支付结果的文字描述放在* ReturnXmlInf 指向缓冲。 |
函数名七:ZhiFuBaoQueryEx2 注意事项:支付宝签名密钥文件rsa_private_key.pem必须放在相同目录才能正确签名
功能 | 查询支付宝订单支付状态。输入支付宝合作者APPID、APPID是否加密保护、订单编号就可以查询订单的支付结果。 | |
函数原型 | function ZhiFuBaoQueryEx2(inappid:Pchar; registered:byte;inNum:Pchar;var ReturnXmlInf:Pchar):integer;stdcall; | |
输入 |
| 支付宝合作者APPID,Pchar。 |
| APPID是否加密保护, Integer 1为已加密,0为未加密。 | |
3. inNum | 商户订单号,Pchar。 | |
4. ReturnXmlInf | 函数调用后,API接口返回的状态信息,Pchar。 | |
返回 | 返回integer数值,0表示支付成功,其他表示支付失败,并将支付结果的文字描述放在* ReturnXmlInf 指向缓冲。 |
函数名八:ZhiFuBaoPayCancelEx2 注意事项:支付宝签名密钥文件rsa_private_key.pem必须放在相同目录才能正确签名
功能 | 撤销已生成的支付宝支付订单。输入支付宝合作者APPID、APPID是否加密保护、订单编号就可以撤销已生成的支付订单,撤销成功后,未支付的订单将不能再支付,已支付的订单会发起退款。 | |
函数原型 | function ZhiFuBaoPayCancelEx2(inappid:Pchar; registered:byte;inNum:Pchar;var ReturnXmlInf:Pchar):integer;stdcall; | |
输入 | 1. inappid | 支付宝合作者APPID,Pchar。 |
2. registered | APPID是否加密保护, Integer 1为已加密,0为未加密。 | |
3. inNum | 商户订单号,Pchar。 | |
4. ReturnXmlInf | 函数调用后,API接口返回的状态信息,Pchar。 | |
返回 | 返回integer数值,0表示撤销成功,其他表示撤销失败,并将服务器返回的结果文字描述放在* ReturnXmlInf 指向缓冲。 |
Vb6函数声明、源码下载地址:
Public DeclareFunction WeiXinPayCodeEx2 Lib "PayApiFun.dll" (ByVal appid As String, ByVal mchid As String, ByVal registered As Integer, ByVal Idkey As String, ByVal keylock As Integer, ByVal AuthCode As String, ByVal OrdNum As String, ByVal TotalFee As String, ByVal inbody As String, ByRef outinf As Any) As Integer
Public DeclareFunction WeiXinPayQRCodeEx2 Lib "PayApiFun.dll" (ByVal appid As String, ByVal mchid As String, ByVal registered As Integer, ByVal Idkey As String, ByVal keylock As Integer, ByVal OrdNum As String, ByVal TotalFee As String, ByVal inbody As String, ByRef outinf As Any) As Integer
Public DeclareFunction WeiXinQueryEx2 Lib "PayApiFun.dll" (ByVal appid As String, ByVal mchid As String, ByVal registered As Integer, ByVal Idkey As String, ByVal keylock As Integer, ByVal OrdNum As String, ByRef outinf As Any) As Integer
Public DeclareFunction WeiXinCloseOrderEx2 Lib "PayApiFun.dll" (ByVal appid As String, ByVal mchid As String, ByVal registered As Integer, ByVal Idkey As String, ByVal keylock As Integer, ByVal OrdNum As String, ByRef outinf As Any) As Integer
Public DeclareFunction ZhiFuBaoPayCodeEx2 Lib "PayApiFun.dll" (ByVal appid As String, ByVal registered As Integer, ByVal AuthCode As String, ByVal OrdNum As String, ByVal TotalFee As String, ByVal inbody As String, ByRef outinf As Any) As Integer
Public DeclareFunction ZhiFuBaoPayQRCodeEx2 Lib "PayApiFun.dll" (ByVal appid As String, ByVal registered As Integer, ByVal OrdNum As String, ByVal TotalFee As String, ByVal inbody As String, ByRef outinf As Any) As Integer
Public DeclareFunction ZhiFuBaoQueryEx2 Lib "PayApiFun.dll" (ByVal appid As String, ByVal registered As Integer, ByVal OrdNum As String, ByRef outinf As Any) As Integer
Public DeclareFunction ZhiFuBaoPayCancelEx2 Lib "PayApiFun.dll" (ByVal appid As String, ByVal registered As Integer, ByVal OrdNum As String, ByRef outinf As Any) As Integer
VFP函数声明、源码下载地址:
Declareinteger WeiXinPayCodeEx2 in PayApiFun.dll string appid,string mchid,integer registered,string Idkey,integer Idkeylock,string AuthCode,string OrdNum,string TotalFee,string inbody,integer @ outinf
Declareinteger WeiXinPayQRCodeEx2 in PayApiFun.dllstring appid,String mchid,integer registered,String Idkey,integer Idkeylock,String OrdNum,String TotalFee,string inbody,integer @outinf
Declareinteger WeiXinQueryEx2 in PayApiFun.dll string appid,string mchid,integer registered,string Idkey,integer Idkeylock, string OrdNum,integer @outinf
Declareinteger WeiXinCloseOrderEx2 in PayApiFun.dllstring appid,string mchid,integer registered,string Idkey,integer Idkeylock, string OrdNum,integer @ outinf
Declare integerZhiFuBaoPayCodeEx2 in PayApiFun.dll String appid ,integer registered,String AuthCode,String OrdNum,String TotalFee,string inbody,integer @ outinf
Declare integerZhiFuBaoPayQRCodeEx2 in PayApiFun.dll String appid,integer registered,String OrdNum ,String TotalFee,string inbody,integer @ outinf
Declare integerZhiFuBaoQueryEx2 in PayApiFun.dll String appid,integer registered,String OrdNum,integer @ outinf
Declare integerZhiFuBaoPayCancelEx2 in PayApiFun.dll String appid,integer registered,String OrdNum,integer @ outinf
Delphi函数声明、源码下载地址:
functionWeiXinQueryEx2(inappid:Pchar;inmchid:Pchar;registered:Integer;inIdkey:Pchar;IdkeyLock:Integer;inNum:Pchar;var ReturnXmlInf:Pchar):integer;stdcall external 'PayApiFun.dll';
functionWeiXinPayQRCodeEx2(inappid:Pchar;inmchid:Pchar;registered:Integer;inIdkey:Pchar;IdkeyLock:Integer;inNum:Pchar; inTotalFee:Pchar;inbody:Pchar;var ReturnXmlInf:Pchar):integer;stdcall external 'PayApiFun.dll';
functionWeiXinPayCodeEx2(inappid:Pchar;inmchid:Pchar;registered:Integer;inIdkey:Pchar;IdkeyLock:Integer;inAuthCode:Pchar ;inNum:Pchar; inTotalFee:Pchar;inbody:Pchar;var ReturnXmlInf:Pchar):integer;stdcall external 'PayApiFun.dll';
functionWeiXinCloseOrderEx2(inappid:Pchar;inmchid:Pchar;registered:Integer;inIdkey:Pchar;IdkeyLock:Integer;inNum:Pchar;var ReturnXmlInf:Pchar):integer;stdcall external 'PayApiFun.dll';
functionZhiFuBaoPayCodeEx2(inappid:Pchar;registered:Integer;inAuthCode:Pchar ;inNum:Pchar; inTotalFee:Pchar;inbody:Pchar;var ReturnXmlInf:Pchar):integer;stdcall external 'PayApiFun.dll';
function ZhiFuBaoPayQRCodeEx2(inappid:Pchar;registered:Integer;inNum:Pchar;inTotalFee:Pchar;inbody:Pchar;varReturnXmlInf:Pchar):integer;stdcall external 'PayApiFun.dll';
functionZhiFuBaoQueryEx2(inappid:Pchar;registered:Integer;inNum:Pchar;var ReturnXmlInf:Pchar):integer;stdcall external 'PayApiFun.dll';
functionZhiFuBaoPayCancelEx2(inappid:Pchar;registered:Integer;inNum:Pchar;var ReturnXmlInf:Pchar):integer;stdcall external 'PayApiFun.dll';
C#函数声明、源码下载地址:
[DllImport("PayApiFun.dll",EntryPoint = "WeiXinPayCodeEx2", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
staticextern int WeiXinPayCodeEx2(string appid, string mchid, int registered, string Idkey, int IdkeyLock, string AuthCode, string OrdNum, string TotalFee, string inbody, ref IntPtr outputstr);
[DllImport("PayApiFun.dll",EntryPoint = "WeiXinPayQRCodeEx2", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
staticextern int WeiXinPayQRCodeEx2(string appid, string mchid, int registered, string Idkey, int IdkeyLock, string OrdNum, string TotalFee, string inbody, ref IntPtr outputstr);
[DllImport("PayApiFun.dll",EntryPoint = "WeiXinQueryEx2", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
staticextern int WeiXinQueryEx2(string appid, string mchid, int registered, string Idkey, int IdkeyLock, string OrdNum, ref IntPtr outputstr);
[DllImport("PayApiFun.dll",EntryPoint = "WeiXinCloseOrderEx2", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
staticextern int WeiXinCloseOrderEx2(string appid, string mchid, int registered, string Idkey, int IdkeyLock, string OrdNum, ref IntPtr outputstr);
[DllImport("PayApiFun.dll",EntryPoint = "ZhiFuBaoPayCodeEx2", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
staticextern int ZhiFuBaoPayCodeEx2(string appid, int registered, string AuthCode, string OrdNum, string TotalFee, string inbody, ref IntPtr outputstr);
[DllImport("PayApiFun.dll",EntryPoint = "ZhiFuBaoPayQRCodeEx2", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
staticextern int ZhiFuBaoPayQRCodeEx2(string appid, int registered, string OrdNum, string TotalFee, string inbody, ref IntPtr outputstr);
[DllImport("PayApiFun.dll",EntryPoint = "ZhiFuBaoQueryEx2", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
staticextern int ZhiFuBaoQueryEx2(string appid, int registered, string OrdNum, ref IntPtr outputstr);
[DllImport("PayApiFun.dll",EntryPoint = "ZhiFuBaoPayCancelEx2", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
staticextern int ZhiFuBaoPayCancelEx2(string appid, int registered, string OrdNum, ref IntPtr outputstr);
VB.Net函数声明、源码下载地址:
Private Declare Function WeiXinPayCodeEx2 Lib"PayApiFun.dll" (ByVal appid As String, ByVal mchid As String, ByVal registered As Integer, ByVal Idkey As String, ByVal IdkeyLock As Integer, ByVal AuthCode As String, ByVal OrdNum As String, ByVal TotalFee As String, ByVal inbody As String, ByRef outinf As IntPtr) As Integer
Private Declare Function WeiXinPayQRCodeEx2 Lib"PayApiFun.dll" (ByVal appid As String, ByVal mchid As String, ByVal registered As Integer, ByVal Idkey As String, ByVal IdkeyLock As Integer, ByVal OrdNum As String, ByVal TotalFee As String, ByVal inbody As String, ByRef outinf As IntPtr) As Integer
Private Declare Function WeiXinQueryEx2 Lib"PayApiFun.dll" (ByVal appid As String, ByVal mchid As String, ByVal registered As Integer, ByVal Idkey As String, ByVal IdkeyLock As Integer, ByVal OrdNum As String, ByRef outinf As IntPtr) As Integer
Private Declare Function WeiXinCloseOrderEx2 Lib"PayApiFun.dll" (ByVal appid As String, ByVal mchid As String, ByVal registered As Integer, ByVal Idkey As String, ByVal IdkeyLock As Integer, ByVal OrdNum As String, ByRef outinf As IntPtr) As Integer
Private DeclareFunction ZhiFuBaoPayCodeEx2 Lib "PayApiFun.dll" (ByVal appid As String, ByVal registered As Integer, ByVal AuthCode As String, ByVal OrdNum As String, ByVal TotalFee As String, ByVal inbody As String, ByRef outinf As IntPtr) As Integer
Private DeclareFunction ZhiFuBaoPayQRCodeEx2 Lib "PayApiFun.dll" (ByVal appid As String, ByVal registered As Integer, ByVal OrdNum As String, ByVal TotalFee As String, ByVal inbody As String, ByRef outinf As IntPtr) As Integer
Private DeclareFunction ZhiFuBaoQueryEx2 Lib "PayApiFun.dll" (ByVal appid As String, ByVal registered As Integer, ByVal OrdNum As String, ByRef outinf As IntPtr) As Integer
Private DeclareFunction ZhiFuBaoPayCancelEx2 Lib "PayApiFun.dll" (ByVal appid As String, ByVal registered As Integer, ByVal OrdNum As String, ByRef outinf As IntPtr) As Integer