request); Log::write('[shopro_huifu] notify hit(legacy): req_seq_id=' . $this->peekReqSeqId($raw)); @file_put_contents(RUNTIME_PATH . 'log/huifu_notify_hit.log', date('c') . ' legacy ' . $this->peekReqSeqId($raw) . "\n", FILE_APPEND); try { $handler = new HuifuNotifyHandler(); $ack = $handler->handlePayNotify($raw); http_response_code($ack['httpCode']); echo $ack['body']; } catch (\Throwable $e) { Log::write('[shopro_huifu] notify error: ' . $e->getMessage()); http_response_code(500); echo ''; } exit; } public function notifyrefund() { http_response_code(200); echo 'OK'; exit; } protected function peekReqSeqId(array $raw) { $respData = $raw['resp_data'] ?? ''; if (is_string($respData) && $respData !== '') { $data = json_decode($respData, true); if (is_array($data) && !empty($data['req_seq_id'])) { return (string) $data['req_seq_id']; } } return '-'; } }