Skip to content

Instantly share code, notes, and snippets.

View josecelano's full-sized avatar

Jose Celano josecelano

View GitHub Profile
@josecelano
josecelano / sdk_config.ini
Last active August 29, 2015 14:20
SDK Configurations
;## This is an example configuration file for the SDK.
;## The sample scripts configure the SDK dynamically
;## but you can choose to go for file based configuration
;## in simpler apps (See bootstrap.php for more).
[Account]
acct1.AccessToken = c0afcccdde5081d6429de37d16166ead
;Connection Information
[Http]
; Add Curl Constants to be configured
@josecelano
josecelano / third.php
Last active August 29, 2015 14:20
Adding File based SDK Configurations
<?php
// 1. Autoload the SDK Package. This will include all the files and classes to your autoloader
//require __DIR__ . '/php-client/autoload.php'; // Direct Donwload
require __DIR__ . '/vendor/autoload.php'; // Using Composer
// 2. Define BC_CONFIG_PATH directory
if(!defined("BC_CONFIG_PATH")) {
define("BC_CONFIG_PATH", __DIR__);
}
@josecelano
josecelano / second.php
Last active August 29, 2015 14:20
Adding SDK Configurations to enable Logging
<?php
// 1. Autoload the SDK Package. This will include all the files and classes to your autoloader
//require __DIR__ . '/php-client/autoload.php'; // Direct Donwload
require __DIR__ . '/vendor/autoload.php'; // Using Composer
// 2. Provide your Token. Replace the given one with your token
// https://accounts.blockcypher.com/dashboard
$token = 'c0afcccdde5081d6429de37d16166ead';
$apiContext = new \BlockCypher\Rest\ApiContext(
Verifying that +josecelano is my openname (Bitcoin username). https://onename.com/josecelano
@josecelano
josecelano / validation-in-ddd.php
Created March 31, 2015 14:45
Validation in DDD
<?php
class PaymentController
{
public function makePayment()
{
// POST data:
// fromCustomerId
// toCustomerId
// amount