| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- /**
- * 聚合渠道支付回调接口
- *
- */
- namespace app\api\controller\v1;
- use app\api\service\NotifyService;
- use app\common\controller\Base;
- class ComplexPayNotify extends Base
- {
- public function notify()
- {
- $logGet = '';
- $logPost = '';
- if ($get = request()->get()) {
- $logGet = http_build_query($get);
- }
- if ($post = request()->post()) {
- $logPost = json_encode($post);
- }
- log_message('渠道订单回调: path=' . request()->path() . ' - get=' . $logGet . ' - post=' . $logPost, 'info', LOG_PATH . 'complexPayNotify/');
- try {
- $postData = input();
- if (count($postData) < 3) {
- $postInput = request()->getInput();
- parse_str($postInput, $postInput);
- $postData = array_merge($postData, $postInput);
- }
- } catch (\Exception $e) {
- echo 'errNoData!';
- exit();
- }
- $channel = input('channelqf');
- $gameid = input('gameidqf');
- if (!$channel || !$gameid) {
- echo 'errNoGame';
- exit();
- }
- (new NotifyService())->notify($channel, $postData);
- }
- }
|