btcpayserver / btcpayserver-php-client

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

php Fatal error 004_HostedPaymentPage.php #17

Open stxxo opened 5 years ago

stxxo commented 5 years ago

Fatal error: Method BTCPayServer\Client\Request::__toString() must not throw an exception, caught Error: Call to undefined method BTCPayServer\Client\Request::getSchema() in /var/www/clients/client0/web3/web/myhost/btcpay/004_HostedPaymentPage.php on line 0

error in file BTCPayServer/Client/Request.php Workaround: insert this code in file Request.php

    public function getSchema()
    {
        return $this->scheme;
    }
woutersamaey commented 5 years ago

This method already exists. Are you using the latest code from the master branch?

stxxo commented 5 years ago

This method already exists. Are you using the latest code from the master branch?

I've installed the btcpayserver-php-client a few hours ago with composer. Just have checked my files again "public function getSchema" is missing.

woutersamaey commented 5 years ago

The method does exit. Look at https://github.com/btcpayserver/btcpayserver-php-client/blob/2b5720b9d2996dfcc4eda546804fff8ac60c272f/src/BTCPayServer/Client/Request.php#L109

stxxo commented 5 years ago

The method does exit. Look at

ah, yes! Please search for "getSchema" and "getScheme", a typo in the last character Didnt have seen it :)

psyb0t commented 5 years ago

@woutersamaey do you have a packagist account? I wanna add you as a maintainer so you can update.

woutersamaey commented 5 years ago

@psyb0t yes, my username is woutersamaey

woutersamaey commented 5 years ago

@psyb0t can you approve this access request? It's needed so we can connect Packagist to Github. image

psyb0t commented 5 years ago

@woutersamaey nope. @NicolasDorier ?

woutersamaey commented 5 years ago

Packagist says the repo needs an update to use the new GitHub hook system. For this to work, the organization needs to approve access. image

NicolasDorier commented 5 years ago

I added the authorization.

woutersamaey commented 5 years ago

Thanks @NicolasDorier Sync is working now.

RedLicorice commented 4 years ago

This has not yet been fixed. Using v 1.0 on a Laravel project.

MarianMatys commented 3 years ago

I've just installed the package using composer to localhost and live server and in both cases, the typo is still there ("getSchemA"). I know it's fixed on Github. How is this even possible? Could someone please explain?

I've fixed it manually, but I'm worried it will come back during an update in the future - obviously, I will not remember it:)

Thank you!