yani/coinbase
最新稳定版本:2.0
Composer 安装命令:
composer require yani/coinbase
包简介
A simple Laravel 4 package for processing bitcoin payments via Coinbase
关键字:
README 文档
README
A simple Laravel package for processing payments via Coinbase
Requirements
- PHP 5.4 or greater
- Laravel 4.1 or greater
Installation
You can install the package using the Composer package manager. Assuming you have Composer installed globally:
composer require yani/coinbase:0.*
Service provider and alias
Next, add the Yani\Coinbase\CoinbaseServiceProvider service provider to the providers array in your app/config.php file.
'providers' => array( ... 'Yani\Coinbase\CoinbaseServiceProvider', ),
and then add the facade to your aliases array in your app/config.php file.
'aliases' => array( ... 'Coinbase' => 'Yani\Coinbase\Facades\Coinbase', ),
Configuration
Publish the configuration with
php artisan config:publish yani/coinbase
This will add the boilerplate configuration to app/config/packages/yani/coinbase/config.php.
Usage
$amount = 100; $currency = 'USD'; $name = 'Order #1'; try { $checkout = Coinbase::createCheckout($amount, $currency, $name); echo $checkout->id; // ffc93ba1-874d-5c55-853c-53c9c4814b1e echo $checkout->embed_code; // af0b52802ad7b36806e307b2d294e3b4 // You can find a full list of the response here: https://developers.coinbase.com/api/v2#create-checkout } catch (CoinbaseCheckoutException $e) { echo "The order failed because: " . $e->getMessage(); }
License
MIT
统计信息
- 总下载量: 118
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-2-Clause
- 更新时间: 2015-08-30