btcpayserver / btcpayserver-php-client

PHP implementation for the BTCPayServer cryptographically secure RESTful API
MIT License
29 stars 33 forks source link

Typo: Call to undefined method BTCPayServer\Client\Request::getSchema() #49

Closed boooyu44 closed 3 years ago

boooyu44 commented 3 years ago

_Method BTCPayServer\Client\Request::_toString() must not throw an exception, caught Error: Call to undefined method BTCPayServer\Client\Request::getSchema()"

File: Client/Request.php

There's typo in function getUriWithPort(). Should be getScheme() not getSchema(). Please fix it. The library fails to create invoice while trying to migrate bitpay based project. Error is triggered when creating invoice. When i fix this typo manually, all works.

/**
     * @inheritdoc
     */
    public function getUri()
    {
        return sprintf(
            '%s://%s/%s',
            $this->getScheme(), !!!!
            $this->getHost(),
            $this->getPath()
        );
    }
/**
 * @inheritdoc
 */
public function getUriWithPort()
{
    return sprintf(
        '%s://%s:%s/%s',
        $this->getSchema(),       !!!!
        $this->getHost(),
        $this->getPort(),
        $this->getPath()
    );
}
woutersamaey commented 3 years ago

Can you submit a PR?

boooyu44 commented 3 years ago

Just for feedback.

The issue has been long time fixed and spotted almost 2 years ago. I pulled ^1.0 instead of master.

https://github.com/btcpayserver/btcpayserver-php-client/commit/cfed65495f704136842aaa6529f4f674d31aee47

My fault :)