Skip to content
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.

aimagician/bitpaymagic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bitpaymagic

Simple Laravel 5 wrapper for the Bitpay php client

Installation

Add this package to your project, with Composer

composer require aimagician/bitpaymagic

Configuration

Run the following command to have Laravel set up a configuration file for you.

php artisan vendor:publish

This will create in config folder a "bitpaymagic.php" config file. Config file uses a .env variables. Update .env file with these keys.

BITPAY_STORAGE_PASS=YourTopSecretPassword
BITPAY_PAIRING_CODE=YourPairingCode
BITPAY_PAIRING_CODE_LABEL="Test Token Label - optional"
BITPAY_ENV=testnet
BITPAY_GENERATED_TOKEN="Put here generated token"

Pairing code can be setup here in: Payment Tools -> Manage API tokens -> Add new token -> Add token

To generate needed keys

run this artisan command, and update generated token value in .env file(BITPAY_GENERATED_TOKEN)

php artisan bitpaymagic:setup

This step is needed to run just once, if error is being shown, please revoke and update pairing code, and try again, or follow this tutorial and do everything manually.

Trait

A Bitpaymagic Trait initBitpaymagicClient() function will return a client

use BitpaymagicTrait;
...
...
$client = $this->initBitpaymagicClient();

Facades

Simply use Laravel facades:

use Bitpay\Buyer;
use Bitpay\Currency;
use Bitpay\Invoice;
use Bitpay\Item;

Bitpay documentation

How to setup test environment

A full working example: https://github.com/aimagician/bitpay-test

About

A simple Laravel 5 wrapper for Bitpay

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages