I have installed the latest php-client version (1.9).

When I go to the Drupal status report page it is showing the library as not installed.

http://i.imgur.com/q8pCKgd.png

I do have the library installed as you can see from my terminal.

$ cd htdocs/sites/all/libraries/php-client/
$ ls
bp_lib.php  bp_options.php  CHANGELOG  LICENSE  README.md

Any help wold be appreciated

Comments

iwant2fly’s picture

Issue summary: View changes
iwant2fly’s picture

Title: Pj[-client library not installed » Php-client library not installed
deekayen’s picture

Sometimes when Bitpay updates their library, they move stuff around and the library detection on the Drupal module gets confused. It's usually a trivial fix when I make time to update.

  • deekayen committed 3614bcd on 7.x-2.x
    Issue #2326439 by iwant2fly: Fixed Php-client library not installed.
    
deekayen’s picture

Status: Active » Fixed

7.x-2.4 should resolve the issue.

iwant2fly’s picture

Works great. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

donquixote’s picture

Status: Closed (fixed) » Needs work

They changed it again. They even removed the file. And you can no longer download the library from the proposed location, instead you are redirected to
https://github.com/bitpay/php-bitpay-client

So I think commerce_bitpay needs a very specific commit (history snapshot) of php-bitpay-client. Just which one?

Also, i think the line number is quite a fragile way to determine the version. Is this really the best way to do this? Libraries API allows to specify a version callback..

deekayen’s picture

The whole module is fragile because I think the API this module uses is deprecated. It's a bigger issue than just a Libraries API reference.

deekayen’s picture

Having not read any code yet, "This is a self-contained PHP implementation of BitPay's new cryptographically secure API" doesn't look like a good sign for a quick fix.

donquixote’s picture

Well, I think it used to work kinda ok with an older version of the library. I just need to know which version..

The problem only occured after an update to both the module *and* the library (on a dev instance of a site).
And I did the module update only because the client was not happy with the "Complete checkout" button. So, to fix #2108313: Complete checkout button doesn't go anywhere.

I understand if you say that maybe the whole module needs a rewrite, but I think we can get sth usable just by choosing a suitable version of bitpay php-client.

deekayen’s picture

Yeah, but you're implying they've been making releases. This "new" version 2.0.0 is the first time they've tagged a release in git.

The git commit snapshot at https://github.com/bitpay/php-bitpay-client/archive/b76b91d97ef94d82e9cb... is what this module worked with last time I fixed it. They've done a done of development on the library since then.

deekayen’s picture

Status: Needs work » Closed (fixed)

I copied the same zip file link to the project main page.

Next time this module breaks, it's probably them turning off the old API.

donquixote’s picture

I am actually using a git clone of that library. So the commit ID is what I need :)
b76b91d97ef94d82e9cbf7f03b592b9fd1034463

donquixote’s picture

Maybe interesting to see the commit history around that one. (look for HEAD)
(further down = older commits)
"Fixed comparison operator" might be important for us.
Everything after that seem to be the big new API-breaking changes.

* |   64568ca Merge pull request #26 from ionux/master
|\ \  
| |/  
| * d256966 Added GMP dependency
| * 1596585 Formatting
| * c118fb4 Fix for wrong variable name
| * f4d797f Use Bitauth signature method in test
| * e6ef177 Fix for missing semicolon
| * 6c43d36 Added extra null tests
| [..]
| * c9194c7 Updated so use new keys
| * 91b1f0f A little refactoring getting ready for some key on key action
| * fd51918 Refactored the bitpay class a little
| * bb3babd Updated some defaults
| * 067d17d A few updates and bug fixes, all tests now pass
| * 60cbe7b Bug fix
| * 8ce4e33 Added new header
| * a357bb4 Removed a line that is echoed on cli
| * 02d6017 Updated so that a dist file can be made for distribution
| * c5edfdb Added license to all files
| * cf8ca85 Updated license
| * 6651326 Updated readme file
| * 6f014b8 --amend
| * ea84386 Removed phing for Robo
| *   5e3a433 Merge branch '2.x'
| |\  
| | * 0350f05 Initial Commit
| * c401c5d Removed all files
|/  
*   ce6a1b9 Merge pull request #25 from k-sorrels/master
|\  
| * e5a0f56 Fixed comparison operator
|/  
*   b76b91d (HEAD) Merge pull request #23 from cstevens88/master
|\  
| * 2a3662f Added CHANGELOG, added LICENSE
|/  
*   bf16cee Merge pull request #22 from ionux/master
|\  
| * 21dbb2e Updated header comments with PHPDoc style tags for Packagist
| * d542c77 Updated header comments with PHPDoc style tags for Packagist
* |   7067bb6 Merge pull request #21 from ionux/master
|\ \  
| |/  
| * 46c6819 Updated version number
| * f987a30 Updated version info & minor formatting
| * 98510d7 Removed copy/paste artifact from function comments
| * 48a20dd Corrected cURL option parameters per PHP docs
* |   17926e1 Merge pull request #20 from ionux/master
|\ \  
| |/  
| * d71c96a Added missing param for curl_errno()
| * ac51984 Updated with more helpful error messages
| * 362072d Removed reference to createinvoices.php
| * 7e78c4b Clarified license & improved option comments
| * db4c7bb Added new version info and changes
| * 454cd36 Create LICENSE
|/  
*   179948b Merge pull request #19 from bitcoinerswithoutborders/version_update_in_readme
donquixote’s picture

Nah, great. I am now working with this commit and get

"Notice: Constant VERSION already defined in require_once() (line 44 of /var/www/e4btc.com/dev/htdocs/sites/all/libraries/php-client/bp_lib.php)."
(how stupid of both Drupal and this library to define a VERSION constant in the global namespace)

Also, the "Complete checkout" button is back to doing nothing :(

deekayen’s picture

If you figure out a good commit hash to use, I'll link to it's github zip on the project page.