func ReceivePaymetLog(c *gin.Context) {
	var dest model.PaymentRecord
	var recv model.PaymentRecord
	err := c.BindJSON(&recv)
	if err != nil {
		log.Error(err.Error())
		c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{"success": false})
		return
	}
	if recv.Delegate == "" || recv.DelegatePubKey == "" {
		c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{"success": false})
		return
	}
	recv.SourceIP = c.ClientIP()
	copyStructure(&recv, &dest)
	err = ArkStatsDB.Save(&dest)
	log.Info("Received and saved paymentrecord log")
	c.JSON(200, gin.H{"success": true, "logID": recv.Pk})
}
ReceivePaymetLog from blockchain
package api
import (
	"net/http"
	"strconv"
	"github.com/gin-gonic/gin"
	"github.com/kristjank/ark-go/cmd/model"
	log "github.com/sirupsen/logrus"
)
type PostDataResponse struct {
	Success  bool                  `json:"success,omitempty"`
	Payments []model.PaymentRecord `json:"payments,omitempty"`
	Error    string                `json:"error,omitempty"`
	Count    int                   `json:"count,omitempty"`
}
func OnlyLocalCallAllowed() gin.HandlerFunc {
	return func(c *gin.Context) {
		if c.ClientIP() == "127.0.0.1" || c.ClientIP() == "::1" {
			c.Next()
		} else {
			log.Info("Outside call to service mode is not allowed")
			c.AbortWithStatus(http.StatusBadRequest)
		}
	}
}
func GetServerInformation(c *gin.Context) {
	stats, _ := getStatistics("MAINNET")
	statsD, _ := getStatistics("DEVNET")
	statsK, _ := getStatistics("KAPU")
	c.JSON(200, gin.H{"version": ArkGoStatsServerVersion,
		"mainnet":          stats,
		"mainnetCount":     len(stats),
		"devnet":           statsD,
		"devnetCount":      len(statsD),
		"kapumainnet":      statsK,
		"kapumainnetCount": len(statsK),
	})
}