protected function wrapOmnipayResponse(ResponseInterface $omnipayResponse, $isNotification = false)
    {
        if ($isNotification) {
            $flags = ServiceResponse::SERVICE_NOTIFICATION;
            if (!$omnipayResponse->isSuccessful()) {
                $flags |= ServiceResponse::SERVICE_ERROR;
            }
            return $this->generateServiceResponse($flags, $omnipayResponse);
        }

        $isAsync = GatewayInfo::shouldUseAsyncNotifications($this->payment->Gateway);
        $flags = $isAsync ? ServiceResponse::SERVICE_PENDING : 0;

        if (!$omnipayResponse->isSuccessful() && !$omnipayResponse->isRedirect() && !$isAsync) {
            $flags |= ServiceResponse::SERVICE_ERROR;
        }

        return $this->generateServiceResponse($flags, $omnipayResponse);
    }
protected function wrapOmnipayResponse(ResponseInterface $omnipayResponse, $isNotification = false)
    {
        if ($isNotification) {
            $flags = ServiceResponse::SERVICE_NOTIFICATION;
            if (!$omnipayResponse->isSuccessful()) {
                $flags |= ServiceResponse::SERVICE_ERROR;
            }
            return $this->generateServiceResponse($flags, $omnipayResponse);
        }

        $isAsync = GatewayInfo::shouldUseAsyncNotifications($this->payment->Gateway);
        $flags = $isAsync ? ServiceResponse::SERVICE_PENDING : 0;

        if (!$omnipayResponse->isSuccessful() && !$omnipayResponse->isRedirect() && !$isAsync) {
            $flags |= ServiceResponse::SERVICE_ERROR;
        }

        return $this->generateServiceResponse($flags, $omnipayResponse);
    }
protected function wrapOmnipayResponse ( ResponseInterface $ omnipayResponse , $ isNotification = false ) { if ( $ isNotification ) { $ flags = ServiceResponse :: SERVICE_NOTIFICATION ; if ( ! $ omnipayResponse -> isSuccessful ( ) ) { $ flags |= ServiceResponse :: SERVICE_ERROR ; } return $ this -> generateServiceResponse ( $ flags , $ omnipayResponse ) ; } $ isAsync = GatewayInfo :: shouldUseAsyncNotifications ( $ this -> payment -> Gateway ) ; $ flags = $ isAsync ? ServiceResponse :: SERVICE_PENDING : 0 ; if ( ! $ omnipayResponse -> isSuccessful ( ) && ! $ omnipayResponse -> isRedirect ( ) && ! $ isAsync ) { $ flags |= ServiceResponse :: SERVICE_ERROR ; } return $ this -> generateServiceResponse ( $ flags , $ omnipayResponse ) ; }
Get a service response from the given Omnipay response
@param ResponseInterface $omnipayResponse
@param bool $isNotification whether or not this response is a response to a notification
@throws \SilverStripe\Omnipay\Exception\ServiceException
@return ServiceResponse
Get a service response from the given Omnipay response