Skip to content

Latest commit

 

History

History
85 lines (71 loc) · 3.06 KB

README.md

File metadata and controls

85 lines (71 loc) · 3.06 KB

NOWPayments Go Library

godoc

This is an unofficial Go library for the crypto NOWPayments API version 1.

Note that the current implementation mostly focuses on the payments API for now:

Topic Endpoint Implemented
Recurring payments No
Billing (sub-partner) No
Payments Yes
Get estimated price ✔️
Get the minimum payment amount ✔️
Get payment status ✔️
Get list of payments ✔️
Get/Update payment estimate ✔️
Create invoice ✔️
Create payment ✔️
Create payment from invoice ✔️
Currencies Yes
Get available currencies ✔️
Get available checked currencies ✔️
Payouts No
API status Yes
Get API status ✔️
Authentication Yes
Authentication ✔️

Installation

$ go get github.com/matm/go-nowpayments

CLI Tool

A np tool is available to easily play with the payments API from the command line. Please make sure to target the sandbox API server in this case.

Can be installed with:

$ go install github.com/matm/go-nowpayments/cmd/np@latest

The following commands are available:

Usage of np:
  -a float
        pay amount for new payment/invoice (default 2)
  -c    show list of selected currencies
  -d    turn debugging on
  -f string
        JSON config file to use
  -i    new invoice
  -l    list all payments
  -n    new payment
  -p string
        status of payment ID
  -pi string
        new payment from invoice ID

In order to work, np expects a JSON config file provided as an argument, like

$ np -f conf.json -c

to list all crypto currencies available for payments.

The JSON config file looks like

{
  "server": "https://api-sandbox.nowpayments.io/v1",
  "login": "your_email_adresse",
  "password": "some_password",
  "apiKey": "the API key to use"
}
  • server is the path to the API server, i.e. one of
    • sandbox: https://api-sandbox.nowpayments.io/v1
    • production: https://api.nowpayments.io/v1
  • login and password are your NOWPayments credentials
  • apiKey is one API key generated in your admin account