$this->mockGetPrecalculatedFeeGh($request_data), 'GetUnpayedList' => $this->mockGetUnpayedList($request_data), 'GetPrecalculatedFee' => $this->mockGetPrecalculatedFee($request_data), 'NotifyPayed' => $this->mockNotifyPayed($request_data), default => throw new GeneralException("Method '{$request_name}' not found"), }; } /** * 响应格式化 * @return mixed * @throws Exception */ public function responseFormat(): mixed { try { // 此处为json格式 return json_decode((string)$this->transfer_response, true); } catch (Exception $e) { throw new Exception($e->getMessage()); } } /** * 获取返回值 * @param bool $is_format * @return mixed * @throws Exception */ public function getResult(bool $is_format = true): mixed { return $this->responseFormat($this->transfer_response); } /** * mockGetPrecalculatedFeeGh * @param array $params * @return self */ private function mockGetPrecalculatedFeeGh(array $params): self { $this->transfer_response = ''; return $this; } /** * mockRegisterCard * @param array $params * @return self */ private function mockGetUnpayedList(array $params): self { $this->transfer_response = ''; return $this; } /** * mockGetPrecalculatedFee * @param array $params * @return self */ private function mockGetPrecalculatedFee(array $params): self { $this->transfer_response = ''; return $this; } /** * mockNotifyPayed * @param array $params * @return self */ private function mockNotifyPayed(array $params): self { $this->transfer_response = ''; return $this; } }