library bitcoincomputer-php
Php libraries for bitcoin payment requests in the Bitcoin Computer Project.
jaschilz/bitcoincomputer-php
Php libraries for bitcoin payment requests in the Bitcoin Computer Project.
- Tuesday, February 23, 2016
- by JASchilz
- Repository
- 1 Watchers
- 0 Stars
- 10 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 3 Versions
- 0 % Grown
, (*1)
Bitcoin Computer PHP Library
Example
Install BTC-Channel
Download and install btc-channel. Be sure to install a specific payment channel adapter. Complete all configuration instructions., (*2)
Download the PHP Bitcoin Computer Library
In your composer.json:, (*3)
{
"require": {
"jaschilz/bitcoincomputer-php" : "0.*"
}
}
Code
In a page:, (*4)
<?php
// Load Composer's autoload
require_once dirname(__FILE__) . '/vendor/autoload.php';
use BitcoinComputer\Request\Request;
use BitcoinComputer\Request\RequestBuilder;
session_start();
/** @var boolean $sessionHasRequest */
$sessionHasRequest = isset($_SESSION['request']);
if (!$sessionHasRequest) {
$_SESSION['request'] = RequestBuilder::begin()
->setSatoshi(400000)
->build();
}
/** @var Request $request */
$request = $_SESSION['request'];
if ($request->isPaid()) {
// In this case, your request has been paid. Satisfy your visitor!
} else {
echo $request;
}
0.1.x-dev
0.1.9999999.9999999-dev
Php libraries for bitcoin payment requests in the Bitcoin Computer Project.
Sources
Download
The Development Requires
0.1.2
0.1.2.0
Php libraries for bitcoin payment requests in the Bitcoin Computer Project.
Sources
Download
The Development Requires
0.1.1
0.1.1.0
Php libraries for bitcoin payment requests in the Bitcoin Computer Project.
Sources
Download
The Development Requires