thephpleague / omnipay-common

Core components for the Omnipay PHP payment processing library
MIT License
329 stars 242 forks source link

AbstractResponse error? #212

Closed daedeloth closed 4 years ago

daedeloth commented 4 years ago

Hi

I'm trying to get the PayNL omnipay adapter working, but there seems to be an issue. After spending some time in teh code, I bumped into this piece in AbstractResponse:

/**
     * Validate that the current Response is a valid redirect.
     *
     * @return void
     */
    protected function validateRedirect()
    {
        if (!$this instanceof RedirectResponseInterface || !$this->isRedirect()) {
            throw new RuntimeException('This response does not support redirection.');
        }

        if (empty($this->getRedirectUrl())) {
            throw new RuntimeException('The given redirectUrl cannot be empty.');
        }

        if (!in_array($this->getRedirectMethod(), ['GET', 'POST'])) {
            throw new RuntimeException('Invalid redirect method "'.$this->getRedirectMethod().'".');
        }
    }

Surely this line is wrong? if (!$this instanceof RedirectResponseInterface || !$this->isRedirect()) { and should be if (!$this instanceof RedirectResponseInterface && !$this->isRedirect()) { ?

Error I keep getting: This response does not support redirection.

daedeloth commented 4 years ago

Never mind, implemented correclty.