Skip to content

digilolnet/go-nowpayments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NOWPayments Go Library

Go Reference Go Report Card codecov

Topic Endpoint Package.Method Implemented
Instant Payments Notifications Yes
Verify signature ipn.VerifyRequestSignature(...) ✔️
Subscriptions Yes
Create plan subscriptions.New(...) ✔️
Create e-mail subscription subscriptions.NewWithEmail(...) ✔️
Update plan subscriptions.Update(...) ✔️
Get plan subscriptions.Get(...) ✔️
List plans subscriptions.List(...) ✔️
Recurring payments Yes
Create recurring_payments.New(...) ✔️
Get recurring_payments.Get(...) ✔️
Delete recurring_payments.Delete(...) ✔️
Billing (sub-partner / Custody) Yes
Deposit with payment custody.NewDepositWithPayment(...) ✔️
Deposit from master account custody.NewDepositFroMasterAccount(...) ✔️
Get payments custody.GetPayments(...) ✔️
Transfer between users custody.NewTransfer(...) ✔️
Get transfer custody.GetTransfer(...) ✔️
List transfers custody.ListTransfers(...) ✔️
Create user custody.NewUser(...) ✔️
List users custody.ListUsers(...) ✔️
Get user balance custody.GetBalance(...) ✔️
Write-off to master account custody.NewWriteOffToMaster(...) ✔️
Payments Yes
Get estimated price payments.EstimatedPrice(...) ✔️
Get the minimum payment amount payments.MinimumAmount(...) ✔️
Get payment status payments.Status() ✔️
Get list of payments payments.List(...) ✔️
Get/Update payment estimate payments.RefreshEstimatedPrice(...) ✔️
Create invoice payments.NewInvoice(...) ✔️
Create payment payments.New(...) ✔️
Create payment from invoice payments.NewFromInvoice(...) ✔️
Currencies Yes
Get available currencies currencies.All() ✔️
Get available checked currencies currencies.Selected() ✔️
Payouts No
API status Yes
Get API status core.Status() ✔️
Authentication Yes
Authentication core.Authenticate(...) ✔️

Installation

go get github.com/digilolnet/go-nowpayments

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/digilolnet/go-nowpayments/config"
	"github.com/digilolnet/go-nowpayments/core"
	"github.com/digilolnet/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)
}

About

Go library for the crypto NOWPayments API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages