Express server setup for easy payment with paypal-rest-sdk for Discord Bots.
Live Demo: https://discord-pay-demo.herokuapp.com/
- More compact & less client-side javascript code.
- You don't need to specify host anymore
discord.pay is an express server that you can clone to integrate with your discord bot to easily add payment. discord.pay are made to be a standalone website apart from your discord bot.
- Using
degit
-$ npx degit repyh/discord.pay
- Git clone -
$ git clone https://github.com/repyh/discord.pay
Just a reminder, you obviously need to have a PayPal account.
- Make a new application in https://developer.paypal.com/
- Clone this repo.
- Copy the application id and secret and paste it into
.env
file to their place. - Copy your discord bot token and pate it into the
.env
file. - Run
node index.js
- Done! Your server should be running and listen to all the payments made! To go checkout your page, goto your domain/ip.
You can add all the functionality to either modify or do something to the user that successfully made a purchase inside /functions/onSuccess.js
file.
You can add and customize your products/items in the items.json
file. Its pretty self-explanatory.
You can customize your store page by going into the views
folder. discord.pay uses ejs for easier use.
Once you're done testing your stuffs, you can go agead and change the mode
property in paypal.configure
function into live
. For reference, you can google paypal developer sandbox and live mode
.
`
I'm pretty bad at explaining stuffs and I accidentally deleted the previous draft and I only made this as quick as I can.
Many features will come soon and this will be updated too.