This demo uses the Payment Widget 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
- Create a virtual environment using python3.9
python3.9 -m venv env
- Activate the virtual environment
source env/bin/activate
- Install the requirements
pip install -r requirements.txt
Setting up API Configurations
- Place your Blockonomics API Key in the
API_KEY
field in the settings.py of NewsPayWall folder, found here
Migration Code
python manage.py migrate
Blockonomics Website Setup
- Create your Blockonomics payment widget. Get the UUID of the product and paste in the premium_news.html page, found here.
- 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>/payment-webhook
as your order hook url and<domain>/dashboard
as redirection url. Here<domain>
is the domain you get from reverse proxy (Ngrok/localtunnel). - Make sure to save your changes!
The Last Line!
python manage.py runserver
Now you are all set to locally run the demo!