mateodioev / coinbase-commerce
Coinbase commerce api
v1.3
2022-09-13 02:51 UTC
Requires
- mateodioev/request: ^2.0
README
Install
composer require mateodioev/coinbase-commerce
Add your api key
use Mateodioev\CoinbaseCommerce\Client; Client::init($your_api_key);
Contents
Charges
use Mateodioev\CoinbaseCommerce\Charges; $charges = new Charges;
List charges
$charges->list();
Create charge
$chargeData = [ 'name' => 'Charge name', 'description' => 'My description', 'pricing_type' => 'fixed_price', 'local_price' => [ 'amount' => '10.00', 'currency' => 'USD' ], 'metadata' => [ 'user_id' => '123456789' ] ]; $charges->create($chargeData);
Show a charge
$charges->show($chargeId);
Cancel a charge
$charges->cancel($chargeId);
Resolve a charge
$charges->resolve($chargeId);
Checkouts
use Mateodioev\CoinbaseCommerce\Checkouts; $checkouts = new Checkouts;
List checkouts
$checkouts->list();
Create a checkout
$checkoutData = [ 'name' => 'The Sovereign Individual', 'description' => 'Mastering the Transition to the Information Age', 'pricing_type' => 'fixed_price', 'local_price' => [ 'amount' => '100.00', 'currency' => 'USD' ], 'requested_info' => ['name', 'email'] ]; $checkouts->create($checkoutData);
Show a checkout
$checkouts->show($id);
Update a checkout
$checkoutData = [ 'name' => 'New name' ]; $checkouts->update($checkoutId, $checkoutData);
Delete a checkout
$checkouts->delete($checkoutId);
Invoices
use Mateodioev\CoinbaseCommerce\Invoices; $invoices = new Invoices;
List invoices
$invoices->list();
Create an invoice
$invoiceData = [ 'business_name' => 'Crypto Payment\'s', 'customer_email' => 'customer@test.com', 'customer_name' => 'Test customer', 'local_price' => [ 'amount' => 10.00, 'currency' => 'USD' ] ]; $invoices->create($invoiceData);
Show an invoice
$invoices->show($id);
Void an invoice
$invoices->void($id);
Resolve an invoice
$invoices->resolve($id);
Events
use Mateodioev\CoinbaseCommerce\Events; $events = new Events;
List events
$events->list();
Show an event
$events->show($id);