$rocket]); $rocket->mergePayload($this->getPayload($rocket->getParams())); Logger::info('[unipay][PreparePlugin] 插件装载完毕', ['rocket' => $rocket]); return $next($rocket); } /** * @throws ContainerException * @throws ServiceNotFoundException * @throws InvalidConfigException */ protected function getPayload(array $params): array { $tenant = get_tenant($params); $config = get_unipay_config($params); $init = [ 'version' => '5.1.0', 'encoding' => 'utf-8', 'backUrl' => $config['notify_url'] ?? '', 'currencyCode' => '156', 'accessType' => '0', 'signature' => '', 'signMethod' => '01', 'merId' => $config['mch_id'] ?? '', 'frontUrl' => $config['return_url'] ?? '', 'certId' => $this->getCertId($tenant, $config), ]; return array_merge( $init, array_filter($params, fn ($v, $k) => !Str::startsWith(strval($k), '_'), ARRAY_FILTER_USE_BOTH), ); } }