<?php /** * M-Market计费平台 * 外部接口Demo * 向MMarket平台服务器查询订单数据 * */ /** * 加载 MMarket.class.php */ require_once dirname(__FILE__) . '/MMarket.class.php'; /** * 创建 class MMarket */ $MMarket = new MMarket(); /** * MMarket平台地址 */ $MMarketUrl = "http://ospd.mmarket.com:8089/trust"; /** * $AppID能力应用ID */ $AppID = '300001504949'; //to do /** * $OrderID 订单ID */ $OrderID = '11131121173920560366'; //to do /**
$AppKey["26AA72014EB4B557"] = "qihoo"; $AppKey["CBE3C3C0454416C1"] = "chuangwei"; $LogDB = "10.171.194.6"; $LogDBSource = "kaixin_log"; $LogDBUsername = "******"; $LogDBPassword = "******"; $GCIp = "127.0.0.1"; $GCPort = 8003; /** * 加载 MMarket.class.php */ require_once dirname(__FILE__) . '/MMarket.class.php'; /** * 创建 class MMarket */ $MMarket = new MMarket(); function writeBilling($tradeid, $chanel, $key, $value) { global $LogDB, $LogDBUsername, $LogDBPassword, $LogDBSource; $con = mysql_connect($LogDB, $LogDBUsername, $LogDBPassword); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db($LogDBSource, $con) or die('Could not select db: ' . mysql_error()); mysql_query("\r\n\t\tCREATE TABLE IF NOT EXISTS `billings` (\r\n\t\t\t`tradeid` varchar(64) NOT NULL,\r\n\t\t\t`date` datetime NOT NULL,\r\n\t\t\t`chanel` varchar(64) NOT NULL,\r\n\t\t\t`key` varchar(64) NOT NULL,\r\n\t\t\t`value` text NOT NULL,\r\n\t\t\tPRIMARY KEY `tradeid_pk` (`tradeid`),\r\n\t\t\tINDEX `date_idx` (`date`),\r\n\t\t\tINDEX `key_idx` (`key`)\r\n\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='contains all users informations';", $con); mysql_query("INSERT IGNORE INTO `billings` SET\r\n\t\t\t`tradeid` = '" . $tradeid . "',\r\n\t\t\t`date` = NOW(),\r\n\t\t\t`chanel` = '" . $chanel . "',\r\n\t\t\t`key` = '" . $key . "',\r\n\t\t\t`value` = '" . $value . "'", $con); mysql_close($con); } function writeLog($key, $value) { global $LogDB, $LogDBUsername, $LogDBPassword, $LogDBSource;