getDestination(); return $rocket->setDestination( $this->getPacker($rocket)->parse($response) ); } /** * @throws \Yansongda\Pay\Exception\ContainerException * @throws \Yansongda\Pay\Exception\InvalidConfigException * @throws \Yansongda\Pay\Exception\ServiceNotFoundException */ protected function getPacker(Rocket $rocket): ParserInterface { $packer = Pay::get($rocket->getDirection() ?? ParserInterface::class); $packer = is_string($packer) ? Pay::get($packer) : $packer; if (!($packer instanceof ParserInterface)) { throw new InvalidConfigException(Exception::INVALID_PACKER); } return $packer; } }