Skip to content

Manage eCash payments received through your online business.

License

Notifications You must be signed in to change notification settings

PayButton/paybutton-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

paybutton-server

master status

https://paybutton.org

Developing

Installing and running PayButton locally

  • Install and configure Docker

  • Clone the repo and go to the repo directory

  • Copy config/example-config.json to paybutton-config.json

  • Create a .env.local file with the environment variables:

    • PRICE_API_TOKEN="<COINDANCE_API_KEY>"
    • WS_AUTH_KEY="<RANDOMLY_GENERATED_UUID>"
    • MASTER_SECRET_KEY="<RANDOMLY_GENERATED_UUID>"
    • SIDESHIFT_SECRET_KEY="<SIDESHIFT_SECRET_KEY>" (necessary only when working with the paybutton client for SideShift integration)
  • Run the following make command* to build/pull the relevant docker images and run the server locally:

    make dev
    

    *If you run docker as root, run the command above with sudo

  • App will be available at http://localhost:3000.

  • Local changes on source code should trigger a reload immediately.

Optional configuration

PayButton Server is configured with a paybutton-config.json file in the root of the repository. An example file can be find at config/example-config.json. The values it takes are:


apiDomain

type: string
default: "http://localhost:3000/api",

Base path for the API.

apiBasePath

type: string
default: "/api/auth"

Base API endpoint for authentication.

websiteDomain

type: string
default: "http://localhost:3000"

Base path for the website.

wsBaseURL

type: string
default: "http://localhost:5000"

Base path for the websocket server.

showTestNetworks

type: boolean
default: false,

If the connection of test networks for eCash and Bitcoin Cash should appear in the Networks tab.

networkBlockchainURLs

type: {
   "ecash": "https://chronik.fabien.cash",
   "bitcoincash": "https://chronik.pay2stay.com/bch"
}

What URLs to connect each network chosen client to (from networkBlockchainClients)

priceAPIURL

type: string
default: "https://coin.dance/api/"

API to get prices from. Only coin.dance currently supported.

redisURL

type: string
default: "redis://paybutton-cache:6379"

URL for the Redis server.

networkBlockchainClients

type: {
    "ecash": "chronik",
    "bitcoincash": "chronik"
}
default: {
    "ecash": "chronik",
    "bitcoincash": "chronik"
}

Which client to use to get the blockchain information for each network. Currently, only "chronik" is supported for eCash and Bitcoin Cash.

networksUnderMaintenance

type: {
   "ecash": boolean
   "bitcoincash": boolean
}

default: {
 "bitcoincash": true
}

What networks are currently under maintenance.

triggerPOSTTimeout

type: number
default: 3000

How long a POST request triggered from a button payment will wait for an answer to be marked as successful.

sideshiftAffiliateId

type: string
default: N/A

Necessary only for paybutton client to interact with sideshift through the server.


  • For production, set ENVIRONMENT=production in .env.local. This optimizes the build for performance and skips the setup of various dev tools (like LiveReload).

Want to join the team?

Send us an email and we'll get in touch: [email protected]