Categorygithub.com/CIDgravity/go-nowpayments
repository
1.0.3
Repository: https://github.com/cidgravity/go-nowpayments.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# README

NOWPayments Go Library

Go Reference Go Report Card codecov

This repository is originally forked from repository is https://codecov.io/gh/matn/go-nowpayments This is an unofficial Go library for the crypto NOWPayments API

TopicEndpointPackage.MethodImplemented
Instant Payments NotificationsYes
Verify signatureipn.VerifyRequestSignature(...):heavy_check_mark:
SubscriptionsYes
Create plansubscriptions.New(...):heavy_check_mark:
Create e-mail subscriptionsubscriptions.NewWithEmail(...):heavy_check_mark:
Update plansubscriptions.Update(...):heavy_check_mark:
Get plansubscriptions.Get(...):heavy_check_mark:
List planssubscriptions.List(...):heavy_check_mark:
Recurring paymentsYes
Createrecurring_payments.New(...):heavy_check_mark:
Getrecurring_payments.Get(...):heavy_check_mark:
Deleterecurring_payments.Delete(...):heavy_check_mark:
Billing (sub-partner / Custody)Yes
Deposit with paymentcustody.NewDepositWithPayment(...):heavy_check_mark:
Deposit from master accountcustody.NewDepositFroMasterAccount(...):heavy_check_mark:
Get paymentscustody.GetPayments(...):heavy_check_mark:
Transfer between userscustody.NewTransfer(...):heavy_check_mark:
Get transfercustody.GetTransfer(...):heavy_check_mark:
List transferscustody.ListTransfers(...):heavy_check_mark:
Create usercustody.NewUser(...):heavy_check_mark:
List userscustody.ListUsers(...):heavy_check_mark:
Get user balancecustody.GetBalance(...):heavy_check_mark:
Write-off to master accountcustody.NewWriteOffToMaster(...):heavy_check_mark:
PaymentsYes
Get estimated pricepayments.EstimatedPrice(...):heavy_check_mark:
Get the minimum payment amountpayments.MinimumAmount(...):heavy_check_mark:
Get payment statuspayments.Status():heavy_check_mark:
Get list of paymentspayments.List(...):heavy_check_mark:
Get/Update payment estimatepayments.RefreshEstimatedPrice(...):heavy_check_mark:
Create invoicepayments.NewInvoice(...):heavy_check_mark:
Create paymentpayments.New(...):heavy_check_mark:
Create payment from invoicepayments.NewFromInvoice(...):heavy_check_mark:
CurrenciesYes
Get available currenciescurrencies.All():heavy_check_mark:
Get available checked currenciescurrencies.Selected():heavy_check_mark:
PayoutsNo
API statusYes
Get API statuscore.Status():heavy_check_mark:
AuthenticationYes
Authenticationcore.Authenticate(...):heavy_check_mark:

Installation

$ go get github.com/CIDgravity/[email protected]

Usage

Just load the config with all the credentials from a file or using a Reader then display the NOWPayments' API status and the last 2 payments made with:

package main

import (
	"fmt"
	"log"
	"strings"

	"github.com/CIDgravity/go-nowpayments/config"
	"github.com/CIDgravity/go-nowpayments/core"
	"github.com/CIDgravity/go-nowpayments/payments"
)

func main() {
	err := config.Load(strings.NewReader(`
            {
                  "server": "https://api-sandbox.nowpayments.io/v1",
                  "login": "[email protected]",
                  "password": "some_password",
                  "apiKey": "some_api_key"
            }
      `))

	if err != nil {
		log.Fatal(err)
	}

	core.UseBaseURL(core.BaseURL(config.Server()))
	core.UseClient(core.NewHTTPClient())

	ps, err := payments.List(&payments.ListOption{
		Limit: 2,
	})

	if err != nil {
		log.Fatal(err)
	}

	fmt.Printf("Last %d payments: %v\n", limit, ps)
}

CLI Tool

The CLI tool has not been updated and is not maintained in this repository To use it, you can do it from the original repository https://codecov.io/gh/matn/go-nowpayments