Monero and Wownero cryptocurrency payment system I scratched up in PHP a year ago.
data | ||
files | ||
vendor | ||
composer.json | ||
index.php | ||
LICENSE | ||
physprep.php | ||
README.TXT |
------------------------------------------------------------------------------ /| //| | //| // | | ___ __ ___ ___ // | // | | // ) ) // ) ) // ) ) // ) ) // / / // | // | | // / / // / / //___/ / // / / ((___/ / // |// | | ((___/ / // / / // ((___( ( / / Monpay (now renamed to Neropay) is a simple GET-only PHP Monero & Wownero cryptocurrency payment system. it uses the XMPP chat protocol for notifications, receipts, and support. Manifest It is unnecessarily difficult to integrate a cryptocurrency payment system into one or more online shops and businesses, one is pressured and tempted into using foreign and bloated APIs or plugins into preexisting (and terrible) Content Management Systems (CMS) such as 'Wordpress', and yet still not make 100% of the profit, as well as dealing with restrictions, such as a cap on number of transactions per month. There is some libre-licensed projects that allow individuals to host crypto payments, but these usually come with caveats of their own, such as making Monero a second priority, using Javascript, having a difficult setup, large number of lines, not handling multiple shops or services, and not allowing for user instantiated services and businesses. Features Pros: * Sale of digital items * Sale of physical items * XMPP notifications * under 1K LOC * No javascript * Easy integration with websites * Optionally redirect users after purchase * Generates QR codes during payment * No middle man (other than you) * No fees * Self hosted * No docker * Support for Wownero WOW * Automatic documentation via doxygen Cons: * PHP sucks * so does the 'composer' package manager Setup 1. Install in a web directory 2. Install php-fpm, and php-curl if you havn't, check the output of phpinfo(); 3. SQLite for PHP is usually default, check if so 4. Install the monero package, remote node RPC setup is below monero-wallet-rpc --rpc-bind-port 18083 --disable-rpc-login --wallet-dir wallets --daemon-address soynero.net.org.com.edu.gov:18081 Consider making a service, the following is an example SysVInit service script: ------------------------------- #!/bin/sh ### BEGIN INIT INFO # Provides: monero # Required-Start: $local_fs $remote_fs $network $syslog $named # Required-Stop: $local_fs $remote_fs $network $syslog $named # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start Monero Wallet RPC # Description: Start Monero Wallet RPC ### END INIT INFO NAME=monero DESC=monero . /lib/init/vars.sh . /lib/lsb/init-functions start_monero() { # Start the daemon/service #Change daemon address if necessary! monero-wallet-rpc --rpc-bind-port 18083 --disable-rpc-login --wallet-dir /var/www/neropay/wallets --daemon-address 127.0.0.1:18081 --log-file /var/log/monero.log --detach } stop_monero() { pkill monero-wallet } case "$1" in start) start_monero ;; stop) stop_monero case "$?" in 0|1) log_end_msg 0 ;; 2) log_end_msg 1 ;; esac ;; *) echo "Usage: $NAME {start|stop|restart}" >&2 exit 3 ;; esac ------------------------------- 5. Ensure www-data ownership/permissions, unix nonsense 6. Put items in data/items.txt according to the format 7. NGINX/httpd web server configuration 8. Test to see if transactions work 9. Turn off error reporting and benchmarking for live usage 10. Make 'data' directory inaccessible or out of web root 11. Enjoy Specification Monpay uses an SQLite database to store concurrent and completed payments, this was done because Vilyaem wanted to experiment with SQLite, and to prevent race-condition problems that result in the loss of funds for both parties. Monpay uses a simple CSV formatted plain-text file as a 'database' for items, each entry defining the name (or filename) of the item, the type of the item (physical or digital), the price in XMR of the item, the seller's XMPP address (for notifications), the Monero address, an optional entry for a 'ledger path' which would be used to communicate to a locally hosted site what transactions have occured, and finally, an optional 'redirect' entry, when the transaction is complete, the user will be redirected to the page specified in the 'redirect' field. Payments: In the 'payments' table in 'payments.db' IP Address (ip) Temporary monero wallet name (walletname) Item Name (item) Amount due (dues) Status (status) Items: name,type,price,seller xmpp,seller payment address,ledgerdir,redirect Dependencies * xmpp-php by norgul * php-qrcode by chillerlan * monerophp by Monero Integrations Roadmap 1. Successful digital transactions X 2. Successful physical transactions X 3. Successful merchant support 4. Support Wownero? X 5. Support I2P/Tor? 6. Complete rewrite in C CGI? License Public Domain CC0 -----------------------------------------------------------------------------