This is an example payment verification system using node.js and NOWNodes for the blockchain interface
You can contact NOWNodes and request a free personal API key to begin with, by visiting https://nownodes.io/pricing and clicking "Order now". You will need this API key to interface with their service.
You can then define how much you expect a user to pay for your service, for example 100 DGB (Or you can extend upon this library and make it dynamic, for example if you were taking payments for varying goods and services), and then once it notices the payment has been made it will validate and permit the user to proceed to the next step in the process.
- Install Node v12
For Ubuntu:
#!/bin/bash # Using Ubuntu curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - sudo apt-get install -y nodejs
- Edit .env.example and put your NOWNodes API key in there, save it as .env
- Modify the example.js
- Install dependencies
npm update && npm install
- Compile weak-napi
cd node_modules/weak-napi && ./build && make
- Run
npm start