Lightweight monero payment gateway
 
 
 
 
Go to file
Keith Irwin d80f59bd3b
feat: 🚧 Built initial payment frontend
2024-04-22 23:08:35 -06:00
merch feat: 🚧 Built initial payment frontend 2024-04-22 23:08:35 -06:00
pay feat: 🚧 Built initial payment frontend 2024-04-22 23:08:35 -06:00
.gitignore refactor: 🚧 Switched to js, fixed bugs 2024-04-22 11:11:03 -06:00
Dockerfile refactor: 🚧 Switched to js, fixed bugs 2024-04-22 11:11:03 -06:00
LICENSE chore: 🎉 Added license 2024-04-18 10:37:49 -06:00
README.md refactor: 🚧 Built basic wallet loading functionality 2024-04-21 18:14:40 -06:00
daemon.dockerfile refactor: 🚧 Built basic wallet loading functionality 2024-04-21 18:14:40 -06:00
docker-compose.override.sample.yml refactor: 🚧 Built basic wallet loading functionality 2024-04-21 18:14:40 -06:00
docker-compose.yml feat: 🚧 Built initial payment frontend 2024-04-22 23:08:35 -06:00
main.js feat: 🚧 Built initial payment frontend 2024-04-22 23:08:35 -06:00
package-lock.json feat: 🚧 Built initial payment frontend 2024-04-22 23:08:35 -06:00
package.json feat: 🚧 Built initial payment frontend 2024-04-22 23:08:35 -06:00
sample.env feat: 🚧 Built initial payment frontend 2024-04-22 23:08:35 -06:00
wallet.dockerfile feat: 🚧 Built initial payment frontend 2024-04-22 23:08:35 -06:00

README.md

pago

A lightweight monero payment gateway that can be embedded into any website. "pago" is esperanto for "payment", just as "monero" is esperanto for "money".

Overview

There are three components to pago, shown in the big square at the bottom in this diagram:

   monero network
          ▲
          │
    ┌─────▼───────┐
    │   monerod   │
    │(remote node)│
    └───────▲─────┘
   daemonRPC│
  ┌─────────▼──────┐
  │view-only wallet│
  └──────▲────▲────┘
walletRPC│    │walletRPC
+--------│----│--------+
|┌───────▼─┐ ┌▼───────┐|
|│Processor│ │Merchant│|
|│   API   │ │frontend│|
|└──▲──────┘ └────────┘|
|   │HTTPS/WSS         |
| ┌─▼──────────────┐   |
| │Payment frontend│   |
| └────────────────┘   |
+-----------------pago-+
  • The Processor API which creates payments using authenticated RPC calls to a viewonly monero wallet
  • The Payment frontend, an embeddable html/js/css interface for making payments, which communicates with the processor API with HTTPS and WSS (websockets)
  • The Merchant frontend, an embeddable html/js/css interface for checking payment status, which makes authenticated RPC calls to the wallet directly

The processor api is an express/node.js server and the two frontends have a single lightweight dependency: the knockoutJS microframework.

There is no database. Data are stored in the wallet file, which should be backed up like any data.

Installation

Copy sample files to environment files:

cp docker-compose.override.sample.yml docker-compose.override.yml
cp sample.env .env

Configure .env and docker-compose.override.yml according to your setup (they are commmented).

Docker is not required; you can also run npm run start to run a server on port 80. You will need to run a wallet-rpc service too.

Wallet

Pago should be used with a viewonly wallet. If you already have a monero wallet, you can create a view only version of it for use with pago.

If you don't have one, create one on a secure computer. Back up the seed phrase offline and set a good password.

Now take your wallet and go to "show keys" in the GUI or run the respective cli command. You will need 3 things:

  1. Primary address (starts with a 4...)
  2. Private View Key (sometimes just called view key)
  3. Restore height (optional, recommended)

Put all this information in the .env file and create a password, WALLET_PASSWORD for use with this wallet file.

If this is your first time running pago, a viewonly wallet file will be created in wallet/. Pago doesn't use a database; all its payment history data are stored in this wallet file. Be sure to back up this directory as you would back up a database and remember its password.

You can restore a wallet from a previous pago instance. Simply drop your existing mywallet and mywallet.keys files into wallet/. Be sure to set WALLET_NAME=mywallet and WALLET_PASSWORD=... in .env to match it.

The wallet/ dir and its contents should be owned by uid 101:

sudo chown -R 101:101 wallet/