PHPackages                             peterfox/bitpayclient - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. peterfox/bitpayclient

Abandoned → [peterfox/bitpayclient](/?search=peterfox%2Fbitpayclient)ArchivedLibrary[Payment Processing](/categories/payments)

peterfox/bitpayclient
=====================

The purpose of this library is to be an object orientated alternative to the official BitPay PHP library. The library is designed to make it easier to integrate BitPay in to more heavy PHP frameworks that use composer as a package manager such as Symfony2 and Laravel.

1.1.0(12y ago)23993[3 issues](https://github.com/peterfox/bitpayclient/issues)[1 PRs](https://github.com/peterfox/bitpayclient/pulls)GPL-3.0PHPPHP &gt;=5.4.0

Since Feb 4Pushed 9y ago1 watchersCompare

[ Source](https://github.com/peterfox/bitpayclient)[ Packagist](https://packagist.org/packages/peterfox/bitpayclient)[ RSS](/packages/peterfox-bitpayclient/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (5)Versions (5)Used By (0)

BitPayClient
============

[](#bitpayclient)

The purpose of this library is to be an object orientated alternative to the official [BitPay PHP library](https://github.com/bitpay/php-client).

The library is designed to make it easier to integrate BitPay in to more heavy PHP frameworks that use composer as a package manager such as Symfony2 and Laravel.

The library is written by myself, [Peter Fox](http://www.peterfox.me).

Version
-------

[](#version)

1.1.0 - 16th March 2014 - Allows for throwing exception when an error api response is returned 1.0.0 - 5th Feburary 2014

Installation
------------

[](#installation)

Add to your projects composer.json

```
{
    "require": {
        "peterfox/bitpayclient":"1.0.*"
    }
}
```

Then run composer install or composer update to install this package.

Usage
-----

[](#usage)

The most basic use is as follows:

```
$client = new BitPayClient('YOUR-API-KEY');

$invoiceResponse = $client->createInvoice(0.0001, 'BTC');
```

You can supply further parameters for creating an invoice via a third array parameter (to see all possible parameters read the BitPay API):

```
$client = new BitPayClient('YOUR-API-KEY');

$invoiceResponse = $client->createInvoice(0.0001, 'BTC', ['redirectUrl' => 'http://somewhere']);
```

You can also supply a PosData value as an array and it will be sent as a Base64 encoded string (please note that other data will be modified to be base64 as well):

```
$client = new BitPayClient('YOUR-API-KEY');

$invoiceResponse = $client->createInvoice(0.0001, 'BTC', ['posData' => ['some_id' => 100]]);
```

The library also allows for making responses from Array (like from a $\_POST):

```
$client = new BitPayClient('YOUR-API-KEY');

$invoiceData = [
            'id'=> 'CNRWBUPUZs9foP2ysZBBc',
            'url'=> 'https://bitpay.com/invoice?CNRWBUPUZs9foP2ysZBBc',
            'status' => 'new',
            'btcPrice' => '0.0001',
            'price' => 0.0001,
            'currency' => 'BTC',
            'invoiceTime' => 1391301679184,
            'expirationTime' => 1391302579184,
            'currentTime' => 1391302121888
            ];

$invoiceResponse = $client->getInvoiceFromArray($invoiceData);
```

There's also the functionality of getting an invoice from BitPay's API if you so wish:

```
$client = new BitPayClient('YOUR-API-KEY');

$invoiceGetResponse = $client->getInvoice('CNRWBUPUZs9foP2ysZBBc');
```

Testing
-------

[](#testing)

After cloning and installing this repo you can run */vendor/bin/phpunit* in the root of the project and test it.

You will have to create a file called apikey.txt in the root directory of the project containing your api to actually run these tests.

The testing of this project uses [PHP-VCR](https://github.com/php-vcr/php-vcr) which is useful for running the tests multiple times as testCreateInvoice\_LimitExceeded() test will cause BitPay to send you an email as a warning which can be a bit tedious. The fixtures are all stored in test/fixtures/.

License
-------

[](#license)

GNU GPL Version 3

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~20 days

Total

3

Last Release

4443d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/15fcbffff7260a7e75c3f8600eb112b9447aaa5926965ba5376881ef50b9ab8b?d=identicon)[peterfox](/maintainers/peterfox)

---

Top Contributors

[![peterfox](https://avatars.githubusercontent.com/u/1716506?v=4)](https://github.com/peterfox "peterfox (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/peterfox-bitpayclient/health.svg)

```
[![Health](https://phpackages.com/badges/peterfox-bitpayclient/health.svg)](https://phpackages.com/packages/peterfox-bitpayclient)
```

###  Alternatives

[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[zfr/zfr-stripe

PHP library for interacting with the Stripe REST API

4692.3k1](/packages/zfr-zfr-stripe)[dnetix/redirection

Library to connect with PlacetoPay Checkout service

17123.3k2](/packages/dnetix-redirection)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
