You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.3 KiB
39 lines
1.3 KiB
<?php
|
|
require("../../class/connect.php");
|
|
require("../../class/db_sql.php");
|
|
require("../../class/q_functions.php");
|
|
require("../../member/class/user.php");
|
|
eCheckCloseMods('pay');//关闭模块
|
|
$link=db_connect();
|
|
$empire=new mysqlquery();
|
|
|
|
header("Content-type: text/html; charset=utf-8");
|
|
$payr=$empire->fetch1("select * from {$dbtbpre}enewspayapi where paytype='pcweixin' and isclose=0 limit 1");
|
|
//AppID(应用ID)
|
|
define("pcweixinAPPID",$payr['payuser']);
|
|
//AppSecret(应用密钥)
|
|
define("pcweixinAPPSECRET",$payr['paykey']);
|
|
//微信支付商户号(MchId)
|
|
define("pcweixinMCHID",$payr['mchid']);
|
|
//商户支付密钥(API密钥)
|
|
define("pcweixinKEY",$payr['appkey']);
|
|
//证书路径,注意应该填写绝对路径
|
|
define("pcweixinSSLCERT_PATH",'cacert/apiclient_cert.pem');
|
|
define("pcweixinSSLKEY_PATH",'cacert/apiclient_key.pem');
|
|
$ddid=$_POST[tradeno];
|
|
$taocan=$_POST[taocan];
|
|
//------------------ 参数结束 ------------------
|
|
require_once("Wxclass.php");
|
|
require_once "lib/WxPay.Api.php";
|
|
$notify = new WxPayApi();
|
|
$input = new WxPayUnifiedOrder();
|
|
$input->SetOut_trade_no($ddid);
|
|
$result = $notify->orderQuery($input);
|
|
if($result[trade_state]=="SUCCESS"){
|
|
echo '{"status":1,"taocan":'.$taocan.'}';
|
|
} else {
|
|
echo '{"status":0,"taocan":'.$taocan.'}';
|
|
}
|
|
db_close();
|
|
$empire=null;
|
|
?>
|