| Total Complexity | 4 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class CreatePlugin extends GeneralPlugin |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @throws \Yansongda\Pay\Exception\ContainerDependencyException |
||
| 15 | * @throws \Yansongda\Pay\Exception\ContainerException |
||
| 16 | * @throws \Yansongda\Pay\Exception\ServiceNotFoundException |
||
| 17 | */ |
||
| 18 | protected function doSomething(Rocket $rocket): void |
||
| 19 | { |
||
| 20 | $config = get_wechat_config($rocket->getParams()); |
||
| 21 | |||
| 22 | $extra = [ |
||
| 23 | 'appid' => $config->get('mp_app_id'), |
||
| 24 | ]; |
||
| 25 | |||
| 26 | if (Pay::MODE_SERVICE == $config->get('mode')) { |
||
| 27 | $extra = [ |
||
| 28 | 'sub_mchid' => $config->get('sub_mch_id', ''), |
||
| 29 | ]; |
||
| 30 | } |
||
| 31 | |||
| 32 | $rocket->mergePayload($extra); |
||
| 33 | } |
||
| 34 | |||
| 35 | protected function getUri(Rocket $rocket): string |
||
| 38 | } |
||
| 39 | |||
| 40 | protected function getPartnerUri(Rocket $rocket): string |
||
| 43 | } |
||
| 44 | } |
||
| 45 |