setChannel($channel); $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']; } if (!empty($_REQUEST['_unified_channel'])) { $channel = $_REQUEST['_unified_channel']; } $sdk = sdkwarpper\createSdkByChannel($channel); if (!$sdk) { echo 'is null'; } else { $sdk->setChannel($channel); $sdk->payNotify(); } } public function getPendingOrderList() { if (!phpcommon\isValidSessionId($_REQUEST['account_id'], $_REQUEST['session_id'])) { phpcommon\sendError(1, 'session无效'); return; } require 'classes/OrderCtrl.php'; $order_ctrl = new classes\OrderCtrl(); $order_ctrl->getPendingOrderList($_REQUEST['account_id']); } public function deliver() { if (!phpcommon\isValidSessionId($_REQUEST['account_id'], $_REQUEST['session_id'])) { phpcommon\sendError(1, 'session无效'); return; } require 'classes/OrderCtrl.php'; $order_ctrl = new classes\OrderCtrl(); $order_ctrl->deliver($_REQUEST['account_id'], $_REQUEST['cp_orderid']); } public function queryOrderInfo() { if (!phpcommon\isValidSessionId($_REQUEST['account_id'], $_REQUEST['session_id'])) { phpcommon\sendError(1, 'session无效'); return; } require 'classes/OrderCtrl.php'; $order_ctrl = new classes\OrderCtrl(); $order_info = $order_ctrl->getOrder($_REQUEST['cp_orderid']); if (!$order_info || $order_info['account_id'] != $_REQUEST['account_id']) { phpcommon\sendError(1, '订单不存在'); return; } echo json_encode(array( 'errcode' => 0, 'errmsg' => '', 'cp_orderid' => $order_info['orderid'], 'sp_orderid' => $order_info['sp_orderid'], 'status' => $order_info['status'], 'itemid' => $order_info['itemid'], )); } }