1
This commit is contained in:
parent
77366f1e23
commit
9cf4e6ad49
@ -1,20 +1,47 @@
|
||||
<?php
|
||||
|
||||
require 'phpcommon/tglog.php';
|
||||
|
||||
class PayController {
|
||||
|
||||
protected function getMysql($accountid)
|
||||
public function preOrder()
|
||||
{
|
||||
if (!phpcommon\isValidSessionId($_REQUEST['account_id'], $_REQUEST['session_id'])) {
|
||||
phpcommon\sendError(ERR_USER_BASE + 1, 'session无效');
|
||||
return;
|
||||
}
|
||||
$channel = phpcommon\extractChannel($_REQUEST['account_id']);
|
||||
if (!empty($_REQUEST['poly_sdk_channel'])) {
|
||||
$channel = $_REQUEST['poly_sdk_channel'];
|
||||
}
|
||||
if (!empty($_REQUEST['unified_channel'])) {
|
||||
$channel = $_REQUEST['unified_channel'];
|
||||
}
|
||||
$sdk = sdkwarpper\createSdkByChannel($channel);
|
||||
if (!$sdk) {
|
||||
echo 'is null';
|
||||
} else {
|
||||
$sdk->preOrder();
|
||||
}
|
||||
}
|
||||
|
||||
public function payNotify()
|
||||
{
|
||||
error_log(json_encode($_REQUEST));
|
||||
$channel = '';
|
||||
if (isset($_REQUEST['_poly_sdk_channel'])) {
|
||||
$channel = $_REQUEST['_poly_sdk_channel'];
|
||||
} else {
|
||||
$channel = $_REQUEST['_channel'];
|
||||
}
|
||||
$sdk = sdkwarpper\createSdkByChannel($channel);
|
||||
if (!$sdk) {
|
||||
echo 'is null';
|
||||
} else {
|
||||
$sdk->payNotify();
|
||||
}
|
||||
}
|
||||
|
||||
public function queryOrderInfo()
|
||||
{
|
||||
$mysql_conf = getMysqlConfig(crc32($accountid));
|
||||
$conn = new phpcommon\Mysql(array(
|
||||
'host' => $mysql_conf['host'],
|
||||
'port' => $mysql_conf['port'],
|
||||
'user' => $mysql_conf['user'],
|
||||
'passwd' => $mysql_conf['passwd'],
|
||||
'dbname' => 'paydb'
|
||||
));
|
||||
return $conn;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,20 +0,0 @@
|
||||
<?php
|
||||
|
||||
require 'phpcommon/tglog.php';
|
||||
|
||||
class PayNotifyController {
|
||||
|
||||
protected function getMysql($accountid)
|
||||
{
|
||||
$mysql_conf = getMysqlConfig(crc32($accountid));
|
||||
$conn = new phpcommon\Mysql(array(
|
||||
'host' => $mysql_conf['host'],
|
||||
'port' => $mysql_conf['port'],
|
||||
'user' => $mysql_conf['user'],
|
||||
'passwd' => $mysql_conf['passwd'],
|
||||
'dbname' => 'paydb'
|
||||
));
|
||||
return $conn;
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user