BlockIo / block_io-php

PHP library for Block.io
MIT License
56 stars 139 forks source link

Installing the PHP library #50

Closed santanu-amit-team closed 2 years ago

santanu-amit-team commented 2 years ago

While trying to process the transaction got this error. This is during the summarize_prepared_transaction call

Fatal error: Uncaught Error: Object of class stdClass could not be converted to string in /home/naturetrustus/public_html/test/vendor/block_io-php/block_io-php/lib/block_io.php:86 Stack trace:

0 /home/naturetrustus/public_html/test/vendor/block_io-php/block_io-php/lib/block_io.php(65): BlockIo->_request('summarize_prepa...', Object(stdClass))

1 /home/naturetrustus/public_html/test/test.php(63): BlockIo->__call('summarize_prepa...', Object(stdClass))

2 {main}

thrown in /home/naturetrustus/public_html/test/vendor/block_io-php/block_io-php/lib/block_io.php on line 86

doersf commented 2 years ago

What version of the PHP library is this? What version of PHP is this?

summarize_prepared_transaction isn't a network call, meaning you're likely using a old version of this library.

santanu-amit-team commented 2 years ago

PHP version 7.4.

We have used "composer require block_io-php/block_io-php" to download the composer

doersf commented 2 years ago

You're not using v2.0.x of the library -- there is no "block_io.php" anymore.

You need to follow instructions more clearly (see README and docs). Here's the composer.json you need for your project:

{
    "require":{
    "block_io-php/block_io-php": "2.0.2",
    "bitwasp/bitcoin": "dev-minimal"
    },
    "repositories": [
        {
            "type": "git",
            "url": "https://github.com/doersf/bitcoin-php.git"
        }
    ]
}

This will install v2.0.2 of the library, and use the proper bitcoin-php repository for its dependency.

santanu-amit-team commented 2 years ago

When trying to install bitcoin-php it gives us this error https://prnt.sc/zOeJcYbkjL75

doersf commented 2 years ago

This is why you need to use the composer.json as provided above. The bitcoin-php repository needs to be doersf/bitcoin-php#dev-minimal.

santanu-amit-team commented 2 years ago

Now able to install all the required settings. We are trying to implement bitcoin and dogecoin as payment on our website. Just to confirm this library will accept payment of bitcoin and dogecoin from any wallet right?

doersf commented 2 years ago

The library works for Bitcoin, Dogecoin, Litecoin, and their testnets.