This demo uses the Payment Button API provided by Blockonomics to receive Bitcoin payments. It can be easily integrated with your online store. The video tutorial for this demo can be found here.
Installing dependencies
composer install
npm install
cp .env.example .env
php artisan key:generate
- By now, you have installed all the dependencies and also created copy of the .env file.
Setting up Environment Configurations
- In the .env file, add database information to allow Laravel to connect to the database, fill in the
DB_HOST
,DB_PORT
,DB_DATABASE
,DB_USERNAME
, andDB_PASSWORD
options to match the credentials of the local database you created. - Place your Blockonomics API Key in the
Blockonomics_API
field. This will allow us to run migrations in the next step.
Migration Code
php artisan migrate
php artisan storage:link
Blockonomics Website Setup
- Create your Blockonomics payment button. Get the button code to paste in the html page from step 01.
- Head to this line and replace the payment button code with your code.
- Go to
OPTIONS
in the PAYMENT BUTTONS/URL tab on merchants page. You need to setup theORDER HOOK URL
andRedirection URL
. - To test the code locally, follow instructions from this video and make sure to place the
<domain>/receive
as your order hook url and<domain>/home
as redirection url. Here<domain>
is the domain you get from reverse proxy (Ngrok/localtunnel). - Make sure to save your changes!
The Last Line!
php artisan serve
Now you are all set to locally run the demo!