2017 © Pedro Peláez
 

library paytoshi-library-php

PHP Library for Paytoshi's API.

image

looptribe/paytoshi-library-php

PHP Library for Paytoshi's API.

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Paytoshi PHP Library

Build Status Coverage Status Packagist, (*1)

PHP Library for Paytoshi's API., (*2)

Requirements

  • PHP >= 5.3
  • PHP cURL extension (recommended) OR
  • allow_fopen_url enabled in your PHP config.

Installation

The recommended way to install Paytoshi PHP Library is through composer., (*3)

composer.phar require looptribe/paytoshi-library-php

Usage

Paytoshi PHP Library uses the Buzz library., (*4)

Create the API wrapper object

Using FileGetContents

``` php <?php, (*5)

$browser = new \Buzz\Browser(); $paytoshi = new \Looptribe\Paytoshi\Api\PaytoshiApi($browser, 'http://paytoshi.org/api/v1/');, (*6)


#### Using cUrl ``` php <?php $browser = new \Buzz\Browser(new \Buzz\Client\Curl()); $paytoshi = new Looptribe\Paytoshi\Api\PaytoshiApi($browser, 'http://paytoshi.org/api/v1/');

Setup the client

If you wish you can set a timeout on the requests (default 5 seconds): ``` php <?php, (*7)

// Set 10 seconds of timeout $browser->getClient()->setTimeout(10);, (*8)


### Faucet API #### Create a new faucet payout ``` php <?php // Create the $paytoshi object as explained in the previous section ... // Create a new payout $result = $paytoshi->send( 'a8p9uevhfgx7ewt1kf09v2n3kfhzkeyxi8ywcehfqnl9is30gq', //Faucet Api key '1EhNaUFaVW99in6drLeD8ygrLicAcf8rAc', //Bitcoin address 100, //Amount '127.0.0.1' //Recipient ip ); // Create a referral payout $result = $paytoshi->send( 'a8p9uevhfgx7ewt1kf09v2n3kfhzkeyxi8ywcehfqnl9is30gq', //Faucet Api key '18aWoXRJRTfK8ZdxH9Y8qW3Q3AKPqra2DlyO', //Bitcoin address 100, //Amount '127.0.0.1', //Recipient ip true //Referral flag );

Check balance

``` php // Check balance $result = $paytoshi->getBalance( 'a8p9uevhfgx7ewt1kf09v2n3kfhzkeyxi8ywcehfqnl9is30gq' //Faucet Api key );, (*9)

// Your balance in satoshi $balance = $result->getAvailableBalance(); ```, (*10)

License

Paytoshi PHP Library is BSD licensed., (*11)

The Versions

12/01 2016

dev-master

9999999-dev https://paytoshi.org/

PHP Library for Paytoshi's API.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

11/01 2016

v1.0

1.0.0.0 https://paytoshi.org/

PHP Library for Paytoshi's API.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires