JstProductEvent::class, 'trade_after_sale' => JstTradeEvent::class, 'orderCancel' => JstOrderCancelEvent::class, 'orderPost' => JstOrderPostEvent::class, 'orderRefund' => JstOrderRefundEvent::class, ]; public static function callback(Request $request): Json { $actionCode = $request->getMore([['action_code', false]])['action_code'] ?? ''; Log::info('JST callback ' . $actionCode); if ($actionCode && isset(self::$eventList[$actionCode])) { $reflectionClass = new ReflectionClass(self::$eventList[$actionCode]); /** @var JstEvent $eventObj */ $eventObj = $reflectionClass->newInstance(); $eventObj->event($request); return json(['code' => 0, 'msg' => 'ok']); } throw new ValidateException('unknown action_code'); } }