yani- / coinbase by yani-

A simple Laravel 4 package for processing bitcoin payments via Coinbase
116
2
1
Package Data
Maintainer Username: yani-
Maintainer Contact: yani@iliev.me (Yani Iliev)
Package Create Date: 2015-08-29
Package Last Update: 2017-10-18
Language: PHP
License: BSD-2-Clause
Last Refreshed: 2024-11-15 03:02:49
Package Statistics
Total Downloads: 116
Monthly Downloads: 1
Daily Downloads: 0
Total Stars: 2
Total Watchers: 1
Total Forks: 2
Total Open Issues: 0

Coinbase

Build Status Scrutinizer Code Quality Latest Stable Version Total Downloads

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