2017 © Pedro Peláez
 

blesta-gateway-nonmerchant coingate

CoinGate

image

blesta/coingate

CoinGate

  • Monday, July 2, 2018
  • by tysonphillips
  • Repository
  • 3 Watchers
  • 0 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

CoinGate PHP library

PHP library for CoinGate API., (*1)

You can sign up for a CoinGate account at https://coingate.com for production and https://sandbox.coingate.com for testing (sandbox)., (*2)

Please note, that for Sandbox you must generate separate API credentials on https://sandbox.coingate.com. API credentials generated on https://coingate.com will not work for Sandbox mode., (*3)

Composer

You can install library via Composer. Run the following command in your terminal:, (*4)

composer require blesta/coingate

Manual Installation

Donwload latest release and include init.php file., (*5)

require_once('/path/to/coingate/init.php');

Getting Started

Usage of CoinGate library., (*6)

Setting up CoinGate library

Setting default authentication

use CoinGate\CoinGate;

\CoinGate\CoinGate::config(array(
  'environment' => 'sandbox', // sandbox OR live
  'app_id'      => 'YOUR_APP_ID',
  'api_key'     => 'YOUR_API_KEY',
  'api_secret'  => 'YOUR_API_SECRET'
));

// $order = \CoinGate\Merchant\Order::find(7294);

Setting authentication individually

use CoinGate\CoinGate;

# \CoinGate\Merchant\Order::find($orderId, $options = array(), $authentication = array())

$order = \CoinGate\Merchant\Order::find(1087999, array(), array(
    'environment' => 'sandbox', // sandbox OR live
    'app_id' => 'YOUR_APP_ID',
    'api_key' => 'YOUR_API_KEY',
    'api_secret' => 'YOUR_API_SECRET'));

Creating Merchant Order

https://developer.coingate.com/docs/create-order, (*7)

use CoinGate\CoinGate;

$post_params = array(
                   'order_id'          => 'YOUR-CUSTOM-ORDER-ID-115',
                   'price'             => 1050.99,
                   'currency'          => 'USD',
                   'receive_currency'  => 'EUR',
                   'callback_url'      => 'https://example.com/payments/callback?token=6tCENGUYI62ojkuzDPX7Jg',
                   'cancel_url'        => 'https://example.com/cart',
                   'success_url'       => 'https://example.com/account/orders',
                   'title'             => 'Order #112',
                   'description'       => 'Apple Iphone 6'
               );

$order = \CoinGate\Merchant\Order::create($post_params);

if ($order) {
    echo $order->status;
} else {
    # Order Is Not Valid
}

Getting Merchant Order

https://developer.coingate.com/docs/get-order, (*8)

use CoinGate\CoinGate;

try {
    $order = \CoinGate\Merchant\Order::find(7294);

    if ($order) {
      var_dump($order);
    }
    else {
      echo 'Order not found';
    }
} catch (Exception $e) {
  echo $e->getMessage(); // BadCredentials Not found App by Access-Key
}

Test API Credentials

$testConnection = \CoinGate\CoinGate::testConnection(array(
  'environment'   => 'sandbox',
  'app_id'        => 'APP_ID',
  'api_key'       => 'APP_KEY',
  'api_secret'    => 'APP_SECRET'
));

if ($testConnection !== true) {
  echo $testConnection; // CoinGate\BadCredentials: BadCredentials Not found App by Access-Key
}

The Versions

02/07 2018

1.1.x-dev

1.1.9999999.9999999-dev https://coingate.com

CoinGate

  Sources   Download

MIT

The Requires

 

The Development Requires

merchant bitcoin coingate

02/07 2018

dev-master

9999999-dev https://coingate.com

CoinGate

  Sources   Download

MIT

The Requires

 

The Development Requires

merchant bitcoin coingate

02/07 2018

1.1.0

1.1.0.0 https://coingate.com

CoinGate

  Sources   Download

MIT

The Requires

 

The Development Requires

merchant bitcoin coingate

02/07 2018

dev-update-version

dev-update-version https://coingate.com

CoinGate

  Sources   Download

MIT

The Requires

 

The Development Requires

merchant bitcoin coingate

02/07 2018

dev-update-composer-file

dev-update-composer-file https://coingate.com

CoinGate library for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

merchant bitcoin coingate

22/06 2018

1.0.x-dev

1.0.9999999.9999999-dev https://coingate.com

CoinGate library for PHP

  Sources   Download

MIT

The Requires

  • ext-curl *
  • ext-json *

 

The Development Requires

merchant bitcoin coingate