Skip to content

utopia-opensource/crypton-go-vouchers

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crypton-go-vouchers

Crypton Donation Library used to work with vouchers written in Go

go-report Build Status

Installation

go get github.com/Sagleft/crypton-go-vouchers/cryptonat

then

import "github.com/Sagleft/crypton-go-vouchers/cryptonat"

Usage

cryptonat := cryptonat.Handler{Client: utopiaClient}

or

handler := cryptonat.Handler{}
handler.SetClient(utopiaClient)

Then try activating the voucher:

data := handler.ActivateVoucher("UTP-P3FH-OJQZ-7XWI-CAVT-LYDW")
fmt.Println(data)

response example:

{
	"status": "pending",
	"referenceNumber": "367404A95932624C284B16AF1C1EDF1BB0F9CDCA1CC5136B167378BBF933FAD8",
	"amount": 0
}

check voucher status by reference number:

referenceNumber := "367404A95932624C284B16AF1C1EDF1BB0F9CDCA1CC5136B167378BBF933FAD8"
voucherStatusData := handler.CheckVoucherStatus(referenceNumber)
fmt.Println(voucherStatusData)

response example:

{
	"status": "done",
	"created": "2020-01-14T13:18:21.232",
	"amount": 2,
	"comments": "",
	"direction": 1,
	"trid": "0ZWTT62Z4DO51"
}

scheme

How can this be used?

  • creating a web service that processes client requests;
  • creation of a payment service;
  • development of a bot for the channel.

License

crypton-go-vouchers is licensed under The MIT License.


udocs

About

Crypton Donation Library used to work with vouchers written in Go

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%