Skip to content

Simple example of bitcoin payment with block.io and Laravel

Notifications You must be signed in to change notification settings

charonne/block-payment

Repository files navigation

Presentation

Block Payment is a simple app to make bitcoin payments to a group of people. It is used as an exercice to understand bitcoin.
The app can send small amounts of satoshis to a group of people, and check if the users have sent the amount back.

Block Payment is developped with the wallet service Block.io, the PHP Framework Laravel, Bootstrap, and SQLite.

Installation

Install vendors

Execute composer composer update

Add block.io credentials

Create the file /config/api.php, and add
return [ // ...

// Block.io API
'blockio' => [
    'apiKey'    => 'xxxx-xxxx-xxxx-xxxx',
    'pin'       => 'xxxxx',
],
// ...   

];

Install database

Create the database sqlite file, touch database/database.sqlite

To create tables, execute php artisan migrate

Usage

Create a payment

You have to start a payment, then give the 4 letters code to users.

Add an user address

Users have to add the code to add their address.
For the exercice, users have to use a new bitcoin address that will never be used again, so they can add their private key if their are not sure to remeber it.

Make a payment

Use the artisan command php artisan payment:send payment_code

Check the addresses balance

In the exercice, users have to send the amount back. This script is to check their balance which should be equal to 0.
Use the artisan command php artisan payment:check payment_code

About

Simple example of bitcoin payment with block.io and Laravel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages