protected function generateServiceResponse(
        $flags,
        $omnipayData = null
    ) {
        $response = new ServiceResponse($this->payment, $flags);

        if ($omnipayData) {
            $response->setOmnipayResponse($omnipayData);
        }

        // redirects and notifications don't need a target URL.
        if (!$response->isNotification() && !$response->isRedirect()) {
            $response->setTargetUrl(
                ($response->isError() || $response->isCancelled())
                    ? $this->payment->FailureUrl
                    : $this->payment->SuccessUrl
            );
        }

        // Hook to update service response via extensions. This can be used to customize the service response
        ErrorHandling::safeExtend($this, 'updateServiceResponse', $response);

        return $response;
    }
protected function generateServiceResponse(
        $flags,
        $omnipayData = null
    ) {
        $response = new ServiceResponse($this->payment, $flags);

        if ($omnipayData) {
            $response->setOmnipayResponse($omnipayData);
        }

        // redirects and notifications don't need a target URL.
        if (!$response->isNotification() && !$response->isRedirect()) {
            $response->setTargetUrl(
                ($response->isError() || $response->isCancelled())
                    ? $this->payment->FailureUrl
                    : $this->payment->SuccessUrl
            );
        }

        // Hook to update service response via extensions. This can be used to customize the service response
        ErrorHandling::safeExtend($this, 'updateServiceResponse', $response);

        return $response;
    }
protected function generateServiceResponse ( $ flags , $ omnipayData = null ) { $ response = new ServiceResponse ( $ this -> payment , $ flags ) ; if ( $ omnipayData ) { $ response -> setOmnipayResponse ( $ omnipayData ) ; } // redirects and notifications don't need a target URL. if ( ! $ response -> isNotification ( ) && ! $ response -> isRedirect ( ) ) { $ response -> setTargetUrl ( ( $ response -> isError ( ) || $ response -> isCancelled ( ) ) ? $ this -> payment -> FailureUrl : $ this -> payment -> SuccessUrl ) ; } // Hook to update service response via extensions. This can be used to customize the service response ErrorHandling :: safeExtend ( $ this , 'updateServiceResponse' , $ response ) ; return $ response ; }
Generate a service response
@param int $flags a combination of service flags
@param AbstractResponse|NotificationInterface|null $omnipayData the response or notification from the Omnipay gateway
@throws \SilverStripe\Omnipay\Exception\ServiceException
@return ServiceResponse
Generate a service response