public function setOmnipayResponse($response)
    {
        $this->omnipayResponse = $response;
        // also set the target Url if the response is a redirect
        if ($this->isRedirect()) {
            $redirectResponse = $this->omnipayResponse->getRedirectResponse();
            if ($redirectResponse instanceof \Symfony\Component\HttpFoundation\RedirectResponse) {
                $this->targetUrl = $redirectResponse->getTargetUrl();
            }
        }
        return $this;
    }