pay/webapp/controller/PayController.class.php
aozhiwei f715cad303 1
2020-10-19 14:18:38 +08:00

50 lines
1.3 KiB
PHP

<?php
class PayController {
public function preOrder()
{
error_log(json_encode($_REQUEST));
/*
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()
{
}
}