| .. | ||
| btcpayserver | ||
| ngrok | ||
| prestashop | ||
| .env.dist | ||
| autocomplete.php | ||
| bitcoin-cli.sh | ||
| docker-compose.yml | ||
| README.md | ||
BTCPayServer Plugin - Development Environment
This repository provides a development environment for this plugin, including Docker-based services and helper scripts.
TOC
- Prerequisites
- Getting Started
- Autocomplete
- Troubleshooting
- Directory Structure
- Bitcoin CLI Helper
- License
Prerequisites
- Docker and Docker Compose installed
Getting Started
-
Clone the repository:
git clone https://github.com/btcpayserver/prestashop-plugin.git cd prestashop-plugin -
Configure environment variables:
- Copy
.env.distto.envand adjust values as needed:cp development/.env.dist development/.env # Edit development/.env as required - For PrestaShop, edit
development/prestashop/prestashop.envif needed.
- Copy
-
Choosing PrestaShop Flashlight Version:
- The development environment uses the PrestaShop Flashlight Docker image.
- You can select the version by setting the
PS_VERSIONvariable in your.envfile.- For example options see commented lines in
.env.distor Docker Hub. - Adjust the version to match your testing needs.
- For example options see commented lines in
-
Start the development environment:
cd development docker compose up --dThis will pull and start all required containers (e.g., PrestaShop, MariaDB, Ngrok).
-
Access the services:
- PrestaShop: http://localhost:8080 (will redirect you to the proper Ngrok URL)
- Default username/password, see prestashop.env
- BTCPay Server: http://localhost:49392
- Check the logs for the proper Ngrok URL.
- PrestaShop: http://localhost:8080 (will redirect you to the proper Ngrok URL)
-
PrestaShop expects the Ngrok URL to stay the same, if it doesn't you have to stop it, remove the volume and recreate it.
Autocomplete
development/autocomplete.phpprovides PHP autocompletion for IDEs.
Troubleshooting
- Ensure all environment variables are set correctly.
- Check Docker logs for errors:
docker compose logs - For permission issues, try running Docker as administrator.
Directory Structure
This folder contains the following files and subfolders:
.env.dist: Example environment variables for development.autocomplete.php: Helper for IDE autocompletion.bitcoin-cli.sh: Helper script to interact with Bitcoin Core inside the Docker environment.docker-compose.yml: Docker Compose file to spin up the development environment.btcpayserver/: Contains BTCPay Server-specific environment files and configs:btcpayserver.env: Environment variables for BTCPay Server container.
ngrok/ngrok.yml: Contains Ngrok specific configuration.prestashop/: Contains PrestaShop-specific environment files and configs:prestashop.env: Environment variables for PrestaShop container.
Bitcoin CLI Helper
The development/bitcoin-cli.sh script is a helper for interacting with the Bitcoin node running in Docker (default: regtest mode).
It wraps common bitcoin-cli commands for development and testing.
Usage:
./bitcoin-cli.sh COMMAND [ARGS]
Supported commands:
getnewaddress- Generate a new Bitcoin address.generatetoaddress BLOCKS ADDRESS- Mine blocks to a specific address.generate NUM_BLOCKS- Mine a number of blocks (regtest only)settxfee FEE- Set transaction fee per kBsendtoaddress ADDRESS AMOUNT- Send funds to an addressgetbalance- Get wallet balancelisttransactions- List recent transactions
The script automatically runs the commands inside the bitcoind Docker container.
License
See LICENSE for details.