-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f44f6d9
commit cc4f9a3
Showing
2 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"log" | ||
"os" | ||
"runtime" | ||
|
||
"github.com/joho/godotenv" | ||
"github.com/kenriortega/qvapay-go" | ||
) | ||
|
||
func init() { | ||
err := godotenv.Load() | ||
if err != nil { | ||
log.Fatalf(err.Error()) | ||
} | ||
numcpu := runtime.NumCPU() | ||
runtime.GOMAXPROCS(numcpu) // Try to use all available CPUs. | ||
} | ||
|
||
func main() { | ||
api := qvapay.NewAPIClient( | ||
os.Getenv("APP_ID"), // app_id | ||
os.Getenv("APP_SECRET"), // secret_id | ||
qvapay.BaseURL, // constants url base https://qvapay.com/api | ||
false, // skip verificationSSL | ||
nil, // custom http.Client | ||
nil, // debug io.Writter (os.Stdout) | ||
) | ||
|
||
tx, err := api.GetTransactions( | ||
context.Background(), | ||
qvapay.APIQueryParams{Page: 1}, | ||
) | ||
if err != nil { | ||
log.Fatalf(err.Error()) | ||
} | ||
fmt.Println(tx) | ||
} |