highjhacker / laravel-paybear
PayBear的Laravel集成
dev-master
2019-02-07 13:53 UTC
Requires
- php: ^7.2
- guzzlehttp/guzzle: ^6.3
- illuminate/database: ^5.7
- illuminate/support: ^5.7
Requires (Dev)
- phpunit/phpunit: ^7.5
This package is auto-updated.
Last update: 2024-09-08 07:28:16 UTC
README
工作进展中:目前不要使用。
Laravel Paybear
允许轻松使用Paybear的Laravel包。
安装
使用composer
$ composer require highjhacker/laravel-paybear
使用示例
发布包中的迁移和配置文件
$ php artisan vendor:publish --provider="Highjhacker\Paybear\PaybearServiceProvider" --tag="migrations" $ php artisan vendor:publish --provider="Highjhacker\Paybear\PaybearServiceProvider" --tag="config"
然后,运行迁移
$ php artisan migrate
最后,通过创建.env
文件并添加凭证来设置环境变量
PAYBEAR_PUBLIC_KEY='mypublickey' PAYBEAR_PRIVATE_KEY='myprivatekey' PAYBEAR_CALLBACK_URL='https://my.callback.url'
初始化客户端
use Highjhacker\Paybear\Connection $connection = new Connection(['host' => 'https://api.paybear.io']); ...
获取Paybear账户上的激活货币
$connection->paybear()->getCurrencies();
创建支付请求
# 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');
回调
# To implement
获取所有加密货币的市场汇率
# By default using euro $connection->paybear()->getMarketRates(); # Or with dollar $connection->paybear()->getMarketRates('usd');
获取特定加密货币的市场汇率
# By default with the rate of BTC in euros $connection->paybear()->getMarketRate(); # Or $connection->paybear()->getMarketRate('usd', 'eth');
开发设置
TODO
发行历史
- 0.0.1
- 工作进展中
贡献
- 分叉它 (https://github.com/Highjhacker/paybear-laravel)
- 创建你的功能分支 (
git checkout -b feature/fooBar
) - 提交你的更改 (
git commit -am 'Add some fooBar'
) - 推送到分支 (
git push origin feature/fooBar
) - 创建一个新的Pull Request
致谢
许可协议
在MIT许可下分发。有关更多信息,请参阅LICENSE。