laravel-paybear maintained by highjhacker
Description
Laravel integration for PayBear
Author
Last update
2019/02/07 14:53
(dev-master)
License
Downloads
5
Tags
WIP : Don't use at the moment.
Laravel Paybear
Laravel package allowing to use Paybear with ease.
Installation
With composer
$ composer require highjhacker/laravel-paybear
Usage example
Publish the migration and config file from the package :
$ php artisan vendor:publish --provider="Highjhacker\Paybear\PaybearServiceProvider" --tag="migrations"
$ php artisan vendor:publish --provider="Highjhacker\Paybear\PaybearServiceProvider" --tag="config"
Next, run the migration :
$ php artisan migrate
Finally, setup your environment variables by creating an .env file and adding your credentials to it :
PAYBEAR_PUBLIC_KEY='mypublickey'
PAYBEAR_PRIVATE_KEY='myprivatekey'
PAYBEAR_CALLBACK_URL='https://my.callback.url'
Initialize the client :
use Highjhacker\Paybear\Connection
$connection = new Connection(['host' => 'https://api.paybear.io']);
...
Get activated currencies on the Paybear account :
$connection->paybear()->getCurrencies();
Create payment request :
# First parameter is the cryptocurrency to accept (eth, btc, bch, ltc, dash, btg, etc)
# Second parameter is the OrderID to use for making a callback
$connection->paybear()->createPaymentRequest('eth', '7e691214bebe31eaa4b813c59825391b');
Callback :
# To implement
Get market rates for all cryptocurrencies :
# By default using euro
$connection->paybear()->getMarketRates();
# Or with dollar
$connection->paybear()->getMarketRates('usd');
Get market rate for a specific cryptocurrency :
# By default with the rate of BTC in euros
$connection->paybear()->getMarketRate();
# Or
$connection->paybear()->getMarketRate('usd', 'eth');
Development setup
TODO
Release History
- 0.0.1
- Work in progress
Contributing
- Fork it (https://github.com/Highjhacker/paybear-laravel)
- Create your feature branch (
git checkout -b feature/fooBar) - Commit your changes (
git commit -am 'Add some fooBar') - Push to the branch (
git push origin feature/fooBar) - Create a new Pull Request
Credits
License
Distributed under the MIT license. See LICENSE for more information.