Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/9ssi7/papara
the papara rest api client for golang
https://github.com/9ssi7/papara
papara rest-client
Last synced: 19 days ago
JSON representation
the papara rest api client for golang
- Host: GitHub
- URL: https://github.com/9ssi7/papara
- Owner: 9ssi7
- License: apache-2.0
- Created: 2024-03-25T20:28:00.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-03-25T20:48:51.000Z (10 months ago)
- Last Synced: 2024-12-13T23:49:33.708Z (25 days ago)
- Topics: papara, rest-client
- Language: Go
- Homepage: https://pkg.go.dev/github.com/9ssi7/papara
- Size: 13.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Papara Go API Client
This library makes it easy to interact with the Papara API.
### Supported APIs
- [x] Account API
- [x] User Verification API
- [x] Pay with Papara API
- [ ] [Pay with Vpos API](https://github.com/9ssi7/papara/issues/1)
- [ ] [Pay with QR API](https://github.com/9ssi7/papara/issues/2)
- [ ] [Pay with Link API](https://github.com/9ssi7/papara/issues/3)
- [ ] [Mass Payment API](https://github.com/9ssi7/papara/issues/4)### Installation
```go
go get github.com/9ssi7/papara
```### Usage
```go
import (
"fmt"
"github.com/9ssi7/papara"
)func main() {
// Set your API key and URL
apiKey := "YOUR_API_KEY"
apiUrl := "YOUR_API_URL"// Create a new Papara client
client := papara.New(papara.Config{
ApiKey: apiKey,
ApiUrl: apiUrl,
})// Get account information
account, err := client.Account()
if err != nil {
fmt.Println(err)
return
}fmt.Println("Account Information:")
fmt.Println(" ID:", account.Data.ID)
fmt.Println(" Balance:", account.Data.Balances[0].TotalBalance)// Create a payment
payment, err := client.CreatePayment(papara.PaymentCreateRequest{
Amount: 100.0,
ReferenceId: "ORDER-1234",
OrderDescription: "Order #1234",
NotificationUrl: "https://your-website.com/callback",
FailNotificationUrl: "https://your-website.com/fail-callback",
RedirectUrl: "https://your-website.com/success",
})
if err != nil {
fmt.Println(err)
return
}fmt.Println("Payment Created:")
fmt.Println(" ID:", payment.Data.ID)
fmt.Println(" Payment URL:", payment.Data.PaymentUrl)
}
```### Contributing
If you want to contribute to this library, you are welcome to send pull requests or open issues on Github.