Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kenriortega/qvapay-go
A simple non-official client for qvapay service with go, for our comunity
https://github.com/kenriortega/qvapay-go
Last synced: 15 days ago
JSON representation
A simple non-official client for qvapay service with go, for our comunity
- Host: GitHub
- URL: https://github.com/kenriortega/qvapay-go
- Owner: kenriortega
- License: mit
- Created: 2021-09-04T16:36:48.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-17T01:20:54.000Z (about 2 years ago)
- Last Synced: 2024-07-31T20:44:16.050Z (3 months ago)
- Language: Go
- Size: 72.3 KB
- Stars: 9
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- cuban-opensource - qvapay-go - official client for qvapay service with go) (SDK / Engineering Calculations)
README
# qvapay-go
A simple non-official paymentClient for qvapay service with go, for our comunity[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
## Setup
You can install this package by using the go get tool and installing:
```bash
go get github.com/kenriortega/qvapay-go
```
## Sign up on **QvaPay**
Create your account to process payments through **QvaPay** at [qvapay.com/register](https://qvapay.com/register).## Using the paymentClient
First create your **QvaPay** paymentClient using your app credentials.
```go
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)
)```
### Get your app info
```go
...
info, err := paymentClient.GetInfo(context.Background())
if err != nil {
log.Fatalf(err.Error())
}
fmt.Println(info)```
### Get your account balance
```go
...
balance, err := paymentClient.GetBalance(context.Background())
if err != nil {
log.Fatalf(err.Error())
}
fmt.Println(balance)```
### Create an invoice```go
...
invoice, err := paymentClient.CreateInvoice(
context.Background(),
25.60,
"Enanitos verdes",
"BRID56568989",
)
if err != nil {
log.Fatalf(err.Error())
}
fmt.Println(invoice)
```
### Get transaction```go
...
inputId := "6507ee0d-db6c-4aa9-b59a-75dc7f6eab52"
tx, err := paymentClient.GetTransaction(context.Background(), inputId)
if err != nil {
log.Fatalf(err.Error())
}
fmt.Println(tx)
```
### Get transactions
```go
...
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](https://qvapay.com/docs).