2017 © Pedro Peláez
 

library coinbase-commerce

PHP SDK for Coinbase commerce

image

codename065/coinbase-commerce

PHP SDK for Coinbase commerce

  • Saturday, May 19, 2018
  • by codename065
  • Repository
  • 2 Watchers
  • 2 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

coinbase-commerce-php-sdk

This SDK is a way to simplify the usage of Coinbase Commerce REST API for your web application., (*1)

About Coinbase Commerce

Coinbase Commerce is the easiest and safest way for your business to start accepting digital currency payments. For more info go to Coinbase Commerce API reference page, (*2)

Available Endpoints

The following are the endpoints available, (*3)

Charge

POST /api/charge
GET /api/charge

Checkout

POST /api/checkout
GET /api/checkout

Instalation

The coinbase-commerce-php-sdk is available at GitHub. It requires PHP Guzzle and PHP 5.6 or later., (*4)

You will need to use Composer to install dependencies. Assuming you already have Composer:, (*5)

Via Composer command

$ composer require codename065/coinbase-commerce-php-sdk

Via Composer update/install

To use the Coinbase Commerce PHP SDK from Composer: * Add a composer.json file to your project and link to Coinbase Commerce:, (*6)

{
    "require": {
        "codename065/coinabse-commerce": "*"
    }
}

Run composer install or composer update to download the latest version and dependencies., (*7)

Via Git (clone)

First, clone the repository:, (*8)

# git clone https://github.com/codename065/coinbase-commerce.git # optionally, specify the directory in which to clone
$ cd path/to/install

Then, you can run the composer command to install:, (*9)

$ composer install

Usage

Architecture

The SDK has a very simple architecture:, (*10)

  HTTP Client       to communicate with Coinbase Commerce servers
  Models            Data Objects, to hold and transport data

Using the SDK

Below you can find an example for the Charge endpoint ( \charge ), (*11)

<?php

// Include Composer autoload
require_once ('vendor/autoload.php');

// Create a client
$client = new \WPDMPP\Coinbase\Commerce\Client();
$client->setApiKey('{your API Key}')

// Prepare the charge
$charge = new \WPDMPP\Coinbase\Commerce\Model\Charge();

// Create local price
$money = new \WPDMPP\Coinbase\Commerce\Model\Money();
$money->SetAmount('5.00');
$money->SetCurrency('USD');

$charge->setName('$5 Talk Credits');
$charge->setDescription('Talk to Anyone, Anytime!');
$charge->setPricingType('fixed_price');
$charge->setLocalPrice($money);
$charge->setRedirectUrl('{https://your.site.com}');

try{
    // Create the request and get back Coinbase Commerce response
    $response = $client->createCharge($charge);
}catch(\Exception $ex){
    echo $ex->getMessage();
}

// Print response
echo ($response);

Hosted URL

, (*12)

Congratulations, You're done!

Any questions regarding the Coinbase Commerce PHP SDK , don't hesitate to contact us at support@wpdownloadmanager.com, (*13)

Sell Digital Products Securely

Coinbase payment gateway for WordPress Download Manager, (*14)

https://www.wpdownloadmanager.com/download/coinbase-payment-gateway/, (*15)

The Versions

19/05 2018

dev-master

9999999-dev https://www.wpdownloadmanager.com/download/coinbase-payment-gateway/

PHP SDK for Coinbase commerce

  Sources   Download

GPL-3.0-or-later

The Requires

 

php rest sdk crypto coinbase commerce api v1