public function send(ConversionInterface $conversion): ResponseInterface
    {
        if (!$conversion instanceof Conversion) {
            throw new UnsupportedConversionTypeException($this, $conversion);
        }

        $previousSentConversion = $this->repository->pull(
            $conversion->getId(),
            get_class($conversion)
        );
        if ($previousSentConversion instanceof StoredConversionInterface) {
            throw new DuplicatedConversionException($conversion);
        }

        $request = new Request("get", $this->getPath($conversion));
        $response = $this->client->send($request);

        $this->repository->push($conversion, $response);
        return $response;
    }
public function send(ConversionInterface $conversion): ResponseInterface
    {
        if (!$conversion instanceof Conversion) {
            throw new UnsupportedConversionTypeException($this, $conversion);
        }

        $previousSentConversion = $this->repository->pull(
            $conversion->getId(),
            get_class($conversion)
        );
        if ($previousSentConversion instanceof StoredConversionInterface) {
            throw new DuplicatedConversionException($conversion);
        }

        $request = new Request("get", $this->getPath($conversion));
        $response = $this->client->send($request);

        $this->repository->push($conversion, $response);
        return $response;
    }
public function send ( ConversionInterface $ conversion ) : ResponseInterface { if ( ! $ conversion instanceof Conversion ) { throw new UnsupportedConversionTypeException ( $ this , $ conversion ) ; } $ previousSentConversion = $ this -> repository -> pull ( $ conversion -> getId ( ) , get_class ( $ conversion ) ) ; if ( $ previousSentConversion instanceof StoredConversionInterface ) { throw new DuplicatedConversionException ( $ conversion ) ; } $ request = new Request ( "get" , $ this -> getPath ( $ conversion ) ) ; $ response = $ this -> client -> send ( $ request ) ; $ this -> repository -> push ( $ conversion , $ response ) ; return $ response ; }
Sending POST query to CPA network after creating conversion

@param ConversionInterface $conversion

@throws UnsupportedConversionTypeException
@throws DuplicatedConversionException
@throws RequestException

@return ResponseInterface
Sending POST query to CPA network after creating conversion