| Total Complexity | 5 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | class FindReturnAdvancePlugin extends GeneralPlugin |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @throws \Yansongda\Pay\Exception\InvalidParamsException |
||
| 16 | */ |
||
| 17 | protected function getUri(Rocket $rocket): string |
||
| 18 | { |
||
| 19 | throw new InvalidParamsException(Exception::NOT_IN_SERVICE_MODE); |
||
| 20 | } |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @throws \Yansongda\Pay\Exception\ContainerDependencyException |
||
| 24 | * @throws \Yansongda\Pay\Exception\ContainerException |
||
| 25 | * @throws \Yansongda\Pay\Exception\InvalidParamsException |
||
| 26 | * @throws \Yansongda\Pay\Exception\ServiceNotFoundException |
||
| 27 | */ |
||
| 28 | protected function getPartnerUri(Rocket $rocket): string |
||
| 29 | { |
||
| 30 | $payload = $rocket->getPayload(); |
||
| 31 | $config = get_wechat_config($rocket->getParams()); |
||
| 32 | $subMchId = $payload->get('sub_mchid', $config->get('sub_mch_id', '')); |
||
| 33 | |||
| 34 | if (is_null($payload->get('refund_id'))) { |
||
| 35 | throw new InvalidParamsException(Exception::MISSING_NECESSARY_PARAMS); |
||
| 36 | } |
||
| 37 | |||
| 38 | return 'v3/ecommerce/refunds/'.$payload->get('refund_id').'/return-advance?sub_mchid='. $subMchId; |
||
| 39 | } |
||
| 40 | |||
| 41 | protected function getMethod(): string |
||
| 44 | } |
||
| 45 | |||
| 46 | protected function doSomething(Rocket $rocket): void |
||
| 49 | } |
||
| 50 | } |
||
| 51 |