| Conditions | 2 |
| Paths | 2 |
| Total Lines | 21 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | public function assembly(Rocket $rocket, Closure $next): Rocket |
||
| 19 | { |
||
| 20 | $config = get_wechat_config($rocket->getParams()); |
||
| 21 | |||
| 22 | $wechatId = $this->getWechatId($config, $rocket); |
||
| 23 | |||
| 24 | if (!$rocket->getPayload()->has('notify_url')) { |
||
| 25 | $wechatId['notify_url'] = $config['notify_url'] ?? null; |
||
| 26 | } |
||
| 27 | |||
| 28 | $rocket->mergePayload($wechatId); |
||
| 29 | |||
| 30 | $rocket->mergePayload([ |
||
| 31 | 'sign' => $this->v2GetSign($config['mch_secret_key_v2'] ?? '', $rocket->getPayload()->all()), |
||
| 32 | ]); |
||
| 33 | |||
| 34 | $rocket->setDestination($rocket->getPayload()); |
||
| 35 | |||
| 36 | $rocket->setDirection(NoHttpRequestParser::class); |
||
| 37 | |||
| 38 | return $next($rocket); |
||
| 39 | } |
||
| 64 |