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 installnpm installcp .env.example .envphp 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_PASSWORDoptions to match the credentials of the local database you created. - Place your Blockonomics API Key in the
Blockonomics_APIfield. This will allow us to run migrations in the next step.
Migration Code
php artisan migratephp 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
OPTIONSin the PAYMENT BUTTONS/URL tab on merchants page. You need to setup theORDER HOOK URLandRedirection URL. - To test the code locally, follow instructions from this video and make sure to place the
<domain>/receiveas your order hook url and<domain>/homeas 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!