Downloads
Stars
Version
WIP : Don't use at the moment.
Laravel package allowing to use Paybear with ease.
With composer
$ composer require highjhacker/laravel-paybear
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');
TODO
git checkout -b feature/fooBar
)git commit -am 'Add some fooBar'
)git push origin feature/fooBar
)Distributed under the MIT license. See LICENSE for more information.