btcpayserver / btcpayserver-php-client

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

Should we drop support for php lib? #18

Closed reablaz closed 4 years ago

reablaz commented 4 years ago

PHP lib of btcpayserver is poorly maintained and brings lot of complexity and confusion. Many developers i've helped to setup that lib was frustrating in the process. There are multiple minor bugs (like need to provide url+port, typo in Client/Requests.php [Schema -> Scheme, but i dont want create issue right now, probably this will be not needed at all :D]), which makes initial setup nightmare. Also, as i observe there is no much demand on that lib and no maintainers who would like to take care about it.

I would say that PHP lib is rather kinda backward-compatability to bitpays way doing things.

I dont get why we need PHP lib, when we have APPS in btcpayserver. On the PHP app it is possible to issue new invoices using same way as APPS do. Simply with POST request as it happens on APPS html, but on server side.

So from APPS page:

image

Is convertable to:

curl -X POST https://btcpayjungle.com/apps/afDV9vCTESTTESTSETvHWJR1KcgWJ/pos -d amount=100 -d email=test@user.com .... etc or somtheing like this in php:

image

APPS also support callback (notification) URL, so on you PHP side you create some callbacks.php json parser, which come from btcpayserver. As mentioned on APPS page, it is not secure to trust callbacks, so you can verify that data with GET request from btcpayserver by orderID:

image

reablaz commented 4 years ago

related: https://github.com/btcpayserver/btcpayserver/issues/1059

reablaz commented 4 years ago

doing my best... but anyway i dont like this lib :/

NicolasDorier commented 4 years ago

Can you try https://github.com/btcpayserver/php-bitpay-client instead? it is possible that it is better maintained.

woutersamaey commented 4 years ago

No need @NicolasDorier as I have merged Bitpay’s latest API here A few months back. Only thing I didn't do is rewrite the sample code. Will review the PR. Besides this, this API isn’t that bad. It works for my Magento 2 plugin.

reablaz commented 4 years ago

Can you try https://github.com/btcpayserver/php-bitpay-client instead? it is possible that it is better maintained.

i can. and i used that as well. i am able to go trough all the errors, make some edits and spin it up. But the problem i face is that more ppl are coming, finding that lib, setting it up and ending with nothing, because they hope it will work out of box, not after manual error fixing. This php lib is extremely hard way to integrate your PHP app. I suggest to keep only ONE, easy way to integrate your PHP app, without confusing ppl. Of course if i am really right that most (if not all) functionality needed will work with API-approach.

NicolasDorier commented 4 years ago

@woutersamaey ah ok you are on this library. I always mix up both library, I thought you were maintaining the other.

reablaz commented 4 years ago

@NicolasDorier @woutersamaey as i see, bitpay php lib isnt maintained much as well (except some minor fixes). I would like to hear from you guys why we need that PHP lib (or python lib as well, which one i use btw. i've integrated once PHP lib into codeigniter project as well), if all needed we can get with simple HTTP calls (regardless of programming language). Moreover, REST API is coming. And if we stay with those libs for different programming languages, maybe is worth to create new on top of APP feature (with HTTP req)?

NicolasDorier commented 4 years ago

@reablaz if you prefer not using this lib, you don't have to.

Having a library is a convenience so you don't have to go back and forth to read the doc of the API.

reablaz commented 4 years ago

yes, i understand this. but the point i am trying to make is that maybe we should provide a more simple&light lib, while dropping huge, complex and less maintained.. anyway, i think my opinion not gaining support and this is fine, because i am not much in development field and may be wrong