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