diff --git a/webapp/controller/PayController.class.php b/webapp/controller/PayController.class.php index 3d4668c..2ee5153 100644 --- a/webapp/controller/PayController.class.php +++ b/webapp/controller/PayController.class.php @@ -50,8 +50,8 @@ class PayController { public function aggregatePay() { if (!phpcommon\isValidSessionId( - $_REQUET['account_id'], - $_REQUET['session_id'] + $_REQUEST['account_id'], + $_REQUEST['session_id'] )) { echo json_encode(array( 'errcode' => 100, @@ -59,14 +59,34 @@ class PayController { )); die(); } + $nowtime = time(); $openid = phpcommon\extractOpenId($_REQUEST['account_id']); + { + $ipos = strpos($_REQUEST['data'], '_'); + $gameid = substr($_REQUEST['data'], 0, $ipos); + $rawdata = substr($_REQUEST['data'], $ipos + 1, strlen($_REQUEST['data']) - $ipos); + $rawdata = base64_decode($rawdata); + + $iv = '1dd2f605f4f8496b'; + $key = 'c868a478c81ff3c168b35d703f787d3c'; + $data = phpcommon\aesDecrypt($rawdata, $iv, $key); + if (empty($data)) { + die(); + } + $jsonobj = json_decode($data, true); + if (!isset($jsonobj)) { + die(); + } + $game_account_id = $jsonobj['account_id']; + $amount = $jsonobj['price']; + $itemid = $jsonobj['itemid']; + $itemnum = $jsonobj['itemnum']; + } $orderid = $this->getOrderId(); if (empty($orderid)) { die(); } - $nowtime = time(); $advice_url = ''; - $amount = 0.01; if (SERVER_ENV != _ONLINE) { $advice_url = "https://gamepay-test.kingsome.cn/webapp/index.php?c=PayNotify&a=payNotify"; } else { diff --git a/webapp/controller/PayNotifyController.class.php b/webapp/controller/PayNotifyController.class.php index 6b480c7..dc910dd 100644 --- a/webapp/controller/PayNotifyController.class.php +++ b/webapp/controller/PayNotifyController.class.php @@ -42,6 +42,7 @@ class PayNotifyController { public function payNotify() { + die(); error_log('payNotify:' . json_encode($_REQUEST)); $sign_info = $this->_reaEncode( 'MerNo=' . $_REQUEST['MerNo'] . '&' .