A simple non-official paymentClient for qvapay service with go, for our comunity
You can install this package by using the go get tool and installing:
go get github.com/kenriortega/qvapay-go
Create your account to process payments through QvaPay at qvapay.com/register.
First create your QvaPay paymentClient using your app credentials.
paymentClient := qvapaygo.NewClient(
os.Getenv("APP_ID"), // app_id
os.Getenv("SECRET_ID"), // secret_id
qvapaygo.BaseURL, // constants url base https://qvapay.com/api
false, // skip verificationSSL
nil, // custom http.PaymentAppClient
nil, // debug io.Writter (os.Stdout)
)
...
info, err := paymentClient.GetInfo(context.Background())
if err != nil {
log.Fatalf(err.Error())
}
fmt.Println(info)
...
balance, err := paymentClient.GetBalance(context.Background())
if err != nil {
log.Fatalf(err.Error())
}
fmt.Println(balance)
...
invoice, err := paymentClient.CreateInvoice(
context.Background(),
25.60,
"Enanitos verdes",
"BRID56568989",
)
if err != nil {
log.Fatalf(err.Error())
}
fmt.Println(invoice)
...
inputId := "6507ee0d-db6c-4aa9-b59a-75dc7f6eab52"
tx, err := paymentClient.GetTransaction(context.Background(), inputId)
if err != nil {
log.Fatalf(err.Error())
}
fmt.Println(tx)
...
txs, err := paymentClient.GetTransactions(context.Background())
if err != nil {
log.Fatalf(err.Error())
}
fmt.Println(txs)
You can also read the QvaPay API documentation: qvapay.com/docs.