<?php
/**
* 	配置账号信息
*/
define("MY_URL","http://gl.cofco.xin/IPADService.aspx");
define("MY_USERNAME","admin");
define("MY_PASSWORD","cc1357");
define('JS_API_CALL',"http://".$_SERVER['SERVER_NAME']."/source/plugin/wxpay/wxpay/js_api_call.php");
define('NOTIFY_URL_WL',"http://".$_SERVER['SERVER_NAME']."/source/plugin/wxpay/wxpay/notify_url1.php");
$url=$_SERVER['HTTP_HOST'].'/index.php?a=get_wx';
                             $curl = curl_init(); // 启动一个CURL会话
                            curl_setopt($curl, CURLOPT_URL, $url);
                            curl_setopt($curl, CURLOPT_HEADER, 0);
                            curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
                            curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); // 跳过证书检查
                            curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);  // 从证书中检查SSL加密算法是否存在
                            $tmpInfo = curl_exec($curl);     //返回api的json对象
                            //关闭URL请求
                            curl_close($curl);
                            $res1= json_decode($tmpInfo,TRUE);    
define('APPID',$res1['app_id']);
define('MCHID',$res1['partner']);
define('KEY',$res1['key']);
define('APPSECRET',$res1['charset']);
//define('BASE_ROOT', substr(dirname(__FILE__), 0, -13));
//include_once BASE_ROOT.'source/core/ljphp.php';
//$lang=$_SESSION['lang'];
//X::__run();
//$sql = "SELECT * FROM 8cms_aplipay WHERE id='".intval(2)."'";
//$data = X::$obj->fetch_first($sql);
//print_r($data);
class WxPayConf_pub
{   
	//=======【基本信息设置】=====================================
	//微信公众号身份的唯一标识。审核通过后，在微信发送的邮件中查看
	const APPID = APPID;
	//受理商ID，身份标识
	const MCHID = MCHID;
	//商户支付密钥Key。审核通过后，在微信发送的邮件中查看
	const KEY = KEY;
	//JSAPI接口中获取openid，审核后在公众平台开启开发模式后可查看
	const APPSECRET = APPSECRET;
	
	//后台接口
	const HOUTAIURL ="http://115.29.79.59:814/Api/ExpAjax.ashx";
	//const HOUTAIURL ="http://gl.nbybzc.com/Api/ExpAjax.ashx";
	
	
	//=======【JSAPI路径设置】===================================
	//获取access_token过程中的跳转uri，通过跳转将code传入jsapi支付页面
	const JS_API_CALL_URL = JS_API_CALL;
	
	//=======【证书路径设置】=====================================
	//证书路径,注意应该填写绝对路径
	const SSLCERT_PATH = '/xxx/xxx/xxxx/WxPayPubHelper/cacert/apiclient_cert.pem';
	const SSLKEY_PATH = '/xxx/xxx/xxxx/WxPayPubHelper/cacert/apiclient_key.pem';
	
	//=======【异步通知url设置】===================================
	//异步通知url，商户根据实际开发过程设定
	const NOTIFY_URL = NOTIFY_URL_WL;
	//=======【curl超时设置】===================================
	//本例程通过curl使用HTTP POST方法，此处可修改其超时时间，默认为30秒
	const CURL_TIMEOUT = 30;
}
	
?>