PHP code example of localtools / coinbase-commerce-sdk
1. Go to this page and download the library: Download localtools/coinbase-commerce-sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
localtools / coinbase-commerce-sdk example snippets
use LocalTools\CoinbaseCommerceSdk\CoinbaseCommerce;
$token = 'your-access-token';
$sdk = new CoinbaseCommerce($token);
use LocalTools\CoinbaseCommerceSdk\Dtos\CreateChargeDto;
use LocalTools\CoinbaseCommerceSdk\Responses\Checkout\Extra\LocalPrice;
$createChargeDto = new CreateChargeDto(
'The Human Fund',
'Money For People',
'fixed_price',
new LocalPrice('1.00', 'USD'),
'USD'
);
$charge = $sdk->charges->createCharge($createChargeDto);
echo $charge->id;