| Conditions | 3 |
| Paths | 2 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | public function assembly(Rocket $rocket, Closure $next): Rocket |
||
| 23 | { |
||
| 24 | Logger::debug('[Wechat][V3][Marketing][Fapiao][Blockchain][GetTaxCodePlugin] 插件开始装载', ['rocket' => $rocket]); |
||
| 25 | |||
| 26 | $payload = $rocket->getPayload(); |
||
| 27 | $offset = $payload?->get('offset') ?? null; |
||
| 28 | $limit = $payload?->get('limit') ?? null; |
||
| 29 | |||
| 30 | if (empty($offset) || empty($limit)) { |
||
| 31 | throw new InvalidParamsException(Exception::PARAMS_NECESSARY_PARAMS_MISSING, '参数异常: 获取商户可开具的商品和服务税收分类编码对照表,缺少 `offset` 或 `limit` 参数'); |
||
| 32 | } |
||
| 33 | |||
| 34 | $rocket->setPayload([ |
||
| 35 | '_method' => 'GET', |
||
| 36 | '_url' => 'v3/new-tax-control-fapiao/merchant/tax-codes?offset='.$offset.'&limit='.$limit, |
||
| 37 | ]); |
||
| 38 | |||
| 39 | Logger::info('[Wechat][V3][Marketing][Fapiao][Blockchain][GetTaxCodePlugin] 插件装载完毕', ['rocket' => $rocket]); |
||
| 40 | |||
| 41 | return $next($rocket); |
||
| 42 | } |
||
| 44 |