PHPackages                             muyaedward/wbapp-bitpay - 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. [API Development](/categories/api)
4. /
5. muyaedward/wbapp-bitpay

ActiveLibrary[API Development](/categories/api)

muyaedward/wbapp-bitpay
=======================

Bitpay wrapper for WritersBay App

1.0(7y ago)03MITPHPPHP ^7.1

Since Apr 18Pushed 7y ago1 watchersCompare

[ Source](https://github.com/muyaedward/wbapp-bitpay)[ Packagist](https://packagist.org/packages/muyaedward/wbapp-bitpay)[ Docs](https://github.com/muyaedward/wbapp-bitpay)[ RSS](/packages/muyaedward-wbapp-bitpay/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

WritersBay App + BitPay Integration
===================================

[](#writersbay-app--bitpay-integration)

Accept Bitcoin and Bitcoin Cash for your WritersBay App and BitPay client.

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

[](#installation)

You can install the package via composer:

```
composer require muyaedward/wbapp-bitpay
```

Publish config file with:

```
php artisan vendor:publish --provider="Muyaedward\WbappBitpay\WbappBitpayServiceProvider"
```

Steps to configure and pair with BitPay Server
----------------------------------------------

[](#steps-to-configure-and-pair-with-bitpay-server)

- Add following keys to `.env` file and updated the details ([view more about configuration](https://support.bitpay.com/hc/en-us/articles/115003001063-How-do-I-configure-the-PHP-BitPay-Client-Library-)):

    ```
    BITPAY_PRIVATE_KEY_PATH=/tmp/bitpay.pri
    BITPAY_PUBLIC_KEY_PATH=/tmp/bitpay.pub
    BITPAY_NETWORK=testnet
    BITPAY_KEY_STORAGE_PASSWORD=SomeRandomePasswordForKeypairEncryption
    BITPAY_TOKEN=
    ```
- Create [Test Account](http://test.bitpay.com/)(for devlopement) or [Live Account](http://bitpay.com/) on BitPay.
- Create [new token for application](https://test.bitpay.com/dashboard/merchant/api-tokens)(test account) or [new token for application](https://bitpay.com/dashboard/merchant/api-tokens) on BitPay and **copy newly generated 7 character Pairing Code**.
- Create keypairs and pair your client(application) with BitPay server.

    ```
    php artisan wbapp-bitpay:createkeypair yourPairingCode
    ```

    [![laravel_bitpay_1](https://camo.githubusercontent.com/da390053800766c6dffefde0bf40cf7c99fb1d7b493c1e8a748b0256e08bdb79/68747470733a2f2f707265766965772e6962622e636f2f67614a31444a2f6c61726176656c5f6269747061795f332e706e67)](https://preview.ibb.co/gaJ1DJ/laravel_bitpay_3.png)

Above command will **generate private key, public key** and save to your specified location. Next it will pair your client i.e. application with BitPay server referring your provided **pairing code** and create new token/key and will be saved in `.env`.

- Done. ⛳

Usage
-----

[](#usage)

##### Create Invoice and checkout

[](#create-invoice-and-checkout)

```
public function createInvoice()
{
    // Create instance of invoice
    $invoice = WbappBitpay::Invoice();

    // Create instance of item
    $item = WbappBitpay::Item();

    // Set item details
    $item->setCode('124')
        ->setDescription('Item 1')
        ->setPrice('1.99');

    // Add item to invoice. (Only one item can be added)
    $invoice->setItem($item);

    // Order reference number from the point-of-sale (POS).
    // It should be a unique identifier for each order that you submit.
    $invoice->setPosData(uniqid()); // Optional

    // Create buyer instance
    $buyer = WbappBitpay::Buyer();

    // Add buyer details
    $buyer->setFirstName('Vaibhav')
        ->setLastName('Roham');

    // Add buyer to invoice
    $invoice->setBuyer($buyer);

    // Set currency for this invoice
    $invoice->setCurrency(WbappBitpay::Currency('USD'));

    // Create invoice on BitPay server
    $invoice = WbappBitpay::createInvoice($invoice);

    // Redirect URL on success
    $invoice->setRedirectUrl(route('bitpay-redirect-back'));

    // Webhook URL to receive various events
    $invoice->setNotificationUrl(route('bitpay-webhook'));

    // Redirect user to following URL for payment approval.
    // Or you can create stripe like checkout from https://bitpay.com/create-checkout
    $paymentUrl = $invoice->getUrl();
}
```

[![laravel_bitpay_2](https://camo.githubusercontent.com/8b2e50744e0d88fe29e7c0abbd9b11c7ade25e0b9c2340eeddb393f5947340c5/68747470733a2f2f696d6167652e6962622e636f2f6a784d7a46792f6c61726176656c5f6269747061795f322e706e67)](https://preview.ibb.co/jxMzFy/laravel_bitpay_2.png)

---

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Edward Mwangi](https://github.com/muyaedward)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

2578d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1068abc44a610494c51024b5a679afcaee66be85d34c9b3f5e2a44672922707e?d=identicon)[kikuyu1](/maintainers/kikuyu1)

---

Top Contributors

[![muyaedward](https://avatars.githubusercontent.com/u/7256186?v=4)](https://github.com/muyaedward "muyaedward (5 commits)")

---

Tags

btcbitapywritersbayapp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/muyaedward-wbapp-bitpay/health.svg)

```
[![Health](https://phpackages.com/badges/muyaedward-wbapp-bitpay/health.svg)](https://phpackages.com/packages/muyaedward-wbapp-bitpay)
```

###  Alternatives

[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/common-protos

Google API Common Protos for PHP

173103.7M49](/packages/google-common-protos)[hubspot/api-client

Hubspot API client

23414.2M16](/packages/hubspot-api-client)

PHPackages © 2026

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